OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
FillPainter2D.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/Color.h"
10#include "OTGui/Painter2D.h"
11
12#define OT_FactoryKey_FillPainter2D "OT_P2DFill"
13
14namespace ot {
15
17 public:
20 FillPainter2D(const ot::Color& _color);
21 virtual ~FillPainter2D();
22
26 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
27
31 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
32
34 virtual std::string getFactoryKey(void) const override { return std::string(OT_FactoryKey_FillPainter2D); };
35
36 virtual std::string generateQss(void) const override;
37
38 virtual ot::Color getDefaultColor(void) const override;
39
40 virtual bool isEqualTo(const Painter2D* _other) const override;
41
42 void setColor(const ot::Color& _color) { m_color = _color; };
43 const ot::Color& getColor(void) const { return m_color; };
44
45 private:
46 ot::Color m_color;
47
48 FillPainter2D(const FillPainter2D&) = delete;
49 FillPainter2D& operator = (const FillPainter2D&) = delete;
50 };
51
52}
#define OT_FactoryKey_FillPainter2D
Definition FillPainter2D.h:12
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
Definition FillPainter2D.h:16
void setColor(const ot::Color &_color)
Definition FillPainter2D.h:42
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 FillPainter2D.h:34
const ot::Color & getColor(void) const
Definition FillPainter2D.h:43
Definition Painter2D.h:17
Definition Connector.h:8
DefaultColor
Default colors.
Definition Color.h:18
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