OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsImageItemCfg.h
Go to the documentation of this file.
1
5// ###########################################################################################################################################################################################################################################################################################################################
6
7#pragma once
8
9// OpenTwin header
10#include "OTCore/Color.h"
12
13#define OT_FactoryKey_GraphicsImageItem "OT_GIImage"
14
15namespace ot {
16
18 public:
19 GraphicsImageItemCfg(const std::string& _imageSubPath = std::string());
20 virtual ~GraphicsImageItemCfg();
21
23 virtual GraphicsItemCfg* createCopy(void) const override;
24
28 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
29
33 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
34
36 virtual std::string getFactoryKey(void) const override { return std::string(OT_FactoryKey_GraphicsImageItem); };
37
38 void setImagePath(const std::string& _path) { m_imageSubPath = _path; };
39 const std::string& imagePath(void) const { return m_imageSubPath; };
40
41 void setMaintainAspectRatio(bool _active) { m_maintainAspectRatio = _active; };
42 bool isMaintainAspectRatio(void) const { return m_maintainAspectRatio; };
43
44 private:
45 std::string m_imageSubPath;
46 bool m_maintainAspectRatio;
47
49 GraphicsImageItemCfg& operator = (GraphicsImageItemCfg&) = delete;
50 };
51
52}
#define OT_FactoryKey_GraphicsImageItem
Definition GraphicsImageItemCfg.h:13
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition GraphicsImageItemCfg.h:17
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 GraphicsImageItemCfg.h:36
void setImagePath(const std::string &_path)
Definition GraphicsImageItemCfg.h:38
void setMaintainAspectRatio(bool _active)
Definition GraphicsImageItemCfg.h:41
const std::string & imagePath(void) const
Definition GraphicsImageItemCfg.h:39
bool isMaintainAspectRatio(void) const
Definition GraphicsImageItemCfg.h:42
The GraphicsItemCfg is the base class for all graphics item configurations.
Definition GraphicsItemCfg.h:33
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