OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Painter2D.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 "OTCore/Serializable.h"
12
13#define OT_JSON_MEMBER_Painter2DType "P2Type"
14
15namespace ot {
16
18 public:
20 virtual ~Painter2D() {};
21
23 virtual std::string getFactoryKey(void) const = 0;
24
28 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
29
33 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
34
35 virtual std::string generateQss(void) const = 0;
36
37 virtual ot::Color getDefaultColor(void) const = 0;
38
40 virtual bool isEqualTo(const Painter2D* _other) const = 0;
41
43 Painter2D* createCopy(void) const;
44
45 private:
46 Painter2D(const Painter2D&) = delete;
47 Painter2D& operator = (const Painter2D&) = delete;
48 };
49
50}
#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 Painter2D.h:17
Painter2D()
Definition Painter2D.h:19
virtual std::string generateQss(void) const =0
virtual std::string getFactoryKey(void) const =0
Returns the unique Painter2D type name that is used in the Painter2DFactory.
virtual ~Painter2D()
Definition Painter2D.h:20
virtual bool isEqualTo(const Painter2D *_other) const =0
Returns true if this painter is equal to the other painter.
virtual ot::Color getDefaultColor(void) const =0
The Serializable class is the default interface of serializable objects.
Definition Serializable.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