OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
GraphicsCopyInformation.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTCore/Point2D.h"
10#include "OTCore/CoreTypes.h"
14
15// std header
16#include <list>
17
18namespace ot {
19
21 public:
26
30 virtual ~GraphicsCopyInformation() = default;
31
32 GraphicsCopyInformation& operator = (const GraphicsCopyInformation&) = default;
34
35 static std::string getGraphicsCopyInformationType(void) { return "GraphicsCopy"; };
36 virtual std::string getCopyType(void) const override { return GraphicsCopyInformation::getGraphicsCopyInformationType(); };
37
38 static int getGraphicsCopyInformationVersion(void) { return 1; };
39 virtual int getCopyVersion(void) const override { return GraphicsCopyInformation::getGraphicsCopyInformationVersion(); };
40
41 virtual void addToJsonObject(ot::JsonValue & _object, ot::JsonAllocator & _allocator) const override;
42 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
43
44 void setViewName(const std::string& _name) { m_viewName = _name; };
45 const std::string& getViewName(void) const { return m_viewName; };
46
47 void setViewOwner(const BasicServiceInformation& _owner) { m_viewOwner = _owner; };
48 const BasicServiceInformation& getViewOwner(void) const { return m_viewOwner; };
49
50 void addItemInformation(UID _uid, const Point2DD& _pos);
51 void addItemInformation(const ItemInformation& _info);
52 void setItemInformation(const std::list<ItemInformation>& _info) { m_items = _info; };
53 const std::list<ItemInformation>& getItemInformation(void) const { return m_items; };
54
56 void moveItemsToPoint(const Point2DD& _pos);
57
59 void moveItemsBy(const Point2DD& _dist);
60
61 bool isValid(void) const;
62
63 private:
64 std::string m_viewName;
65 BasicServiceInformation m_viewOwner;
66 std::list<ItemInformation> m_items;
67 };
68
69}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The BasicServiceInformation class is used to hold a service name and type. The BasicServiceInformatio...
Definition BasicServiceInformation.h:21
Definition CopyInformation.h:19
Definition GraphicsCopyInformation.h:20
GraphicsCopyInformation(const GraphicsCopyInformation &)=default
void setViewOwner(const BasicServiceInformation &_owner)
Definition GraphicsCopyInformation.h:47
void setItemInformation(const std::list< ItemInformation > &_info)
Definition GraphicsCopyInformation.h:52
const BasicServiceInformation & getViewOwner(void) const
Definition GraphicsCopyInformation.h:48
const std::list< ItemInformation > & getItemInformation(void) const
Definition GraphicsCopyInformation.h:53
void setViewName(const std::string &_name)
Definition GraphicsCopyInformation.h:44
virtual std::string getCopyType(void) const override
Definition GraphicsCopyInformation.h:36
GraphicsCopyInformation(GraphicsCopyInformation &&)=default
const std::string & getViewName(void) const
Definition GraphicsCopyInformation.h:45
static int getGraphicsCopyInformationVersion(void)
Definition GraphicsCopyInformation.h:38
virtual ~GraphicsCopyInformation()=default
virtual int getCopyVersion(void) const override
Definition GraphicsCopyInformation.h:39
static std::string getGraphicsCopyInformationType(void)
Definition GraphicsCopyInformation.h:35
2D Point with double values
Definition Point2D.h:144
Definition Connector.h:8
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
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
Definition GraphicsCopyInformation.h:22
Point2DD pos
Definition GraphicsCopyInformation.h:24
UID uid
Definition GraphicsCopyInformation.h:23