OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsEllipseItemCfg.h
Go to the documentation of this file.
1
5// ###########################################################################################################################################################################################################################################################################################################################
6
7#pragma once
8
9// OpenTwin header
10#include "OTGui/Outline.h"
12
13#define OT_FactoryKey_GraphicsEllipseItem "OT_GIElli"
14
15namespace ot {
16
17 class Painter2D;
18
20 public:
21 GraphicsEllipseItemCfg(double _radiusX = 5., double _radiusY = 5., ot::Painter2D* _backgroundPainter = (ot::Painter2D*)nullptr);
23
25 virtual GraphicsItemCfg* createCopy(void) const override;
26
30 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
31
35 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
36
38 virtual std::string getFactoryKey(void) const override { return std::string(OT_FactoryKey_GraphicsEllipseItem); };
39
40 void setRadiusX(double _radius) { m_radiusX = _radius; };
41 double getRadiusX(void) const { return m_radiusX; };
42 void setRadiusY(double _radius) { m_radiusY = _radius; };
43 double getRadiusY(void) const { return m_radiusY; };
44
45 void setOutline(const ot::OutlineF& _outline) { m_outline = _outline; };
46 const ot::OutlineF& getOutline(void) const { return m_outline; };
47
48 void setBackgroundPainer(ot::Painter2D* _painter);
49 const ot::Painter2D* getBackgroundPainter(void) const { return m_backgroundPainter; };
50
51 private:
52 double m_radiusX;
53 double m_radiusY;
54 ot::OutlineF m_outline;
55 ot::Painter2D* m_backgroundPainter;
56
58 GraphicsEllipseItemCfg& operator = (GraphicsEllipseItemCfg&) = delete;
59 };
60
61}
#define OT_FactoryKey_GraphicsEllipseItem
Definition GraphicsEllipseItemCfg.h:13
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition GraphicsEllipseItemCfg.h:19
virtual std::string getFactoryKey(void) const override
Returns the key that is used to create an instance of this class in the simple factory.
Definition GraphicsEllipseItemCfg.h:38
void setRadiusX(double _radius)
Definition GraphicsEllipseItemCfg.h:40
double getRadiusX(void) const
Definition GraphicsEllipseItemCfg.h:41
void setOutline(const ot::OutlineF &_outline)
Definition GraphicsEllipseItemCfg.h:45
double getRadiusY(void) const
Definition GraphicsEllipseItemCfg.h:43
const ot::Painter2D * getBackgroundPainter(void) const
Definition GraphicsEllipseItemCfg.h:49
void setRadiusY(double _radius)
Definition GraphicsEllipseItemCfg.h:42
const ot::OutlineF & getOutline(void) const
Definition GraphicsEllipseItemCfg.h:46
The GraphicsItemCfg is the base class for all graphics item configurations.
Definition GraphicsItemCfg.h:33
The OutlineF class is used to describe how a outline should look like.
Definition Outline.h:161
Definition Painter2D.h:17
Definition Connector.h:8
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30