OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Plot1DCfg.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/CoreTypes.h"
11#include "OTGui/Plot1DAxisCfg.h"
13
14// std header
15#include <list>
16
17namespace ot {
18
20 public:
21 enum PlotType {
23 Polar
24 };
25
33
34 static std::string plotTypeToString(PlotType _type);
35 static PlotType stringToPlotType(const std::string& _type);
36
37 static std::string axisQuantityToString(AxisQuantity _quantity);
38 static AxisQuantity stringToAxisQuantity(const std::string& _quantity);
39
40 // ###########################################################################################################################################################################################################################################################################################################################
41
42 Plot1DCfg();
43 Plot1DCfg(const Plot1DCfg& _other);
44 virtual ~Plot1DCfg();
45
46 Plot1DCfg& operator = (const Plot1DCfg& _other);
47
51 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
52
56 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
57
58 bool operator == (const Plot1DCfg& _other) const;
59 bool operator != (const Plot1DCfg& _other) const;
60
61 // ###########################################################################################################################################################################################################################################################################################################################
62
63 // Setter / Getter
64
65 void setUid(UID _uid) { m_uid = _uid; };
66 UID getUid(void) const { return m_uid; };
67
68 void setName(const std::string& _name) { m_name = _name; };
69 const std::string& getName(void) const { return m_name; };
70
71 void setTitle(const std::string& _title) { m_title = _title; };
72 const std::string& getTitle(void) const { return m_title; };
73
74 void setProjectName(const std::string& _projectName) { m_projectName = _projectName; };
75 const std::string& getProjectName(void) const { return m_projectName; };
76
77 void setPlotType(PlotType _type) { m_type = _type; };
78 PlotType getPlotType(void) const { return m_type; };
79
80 void setAxisQuantity(AxisQuantity _quantity) { m_axisQuantity = _quantity; };
81 AxisQuantity getAxisQuantity(void) const { return m_axisQuantity; };
82
83 void setGridVisible(bool _visible) { m_gridVisible = _visible; };
84 bool getGridVisible(void) const { return m_gridVisible; };
85
86 void setGridColor(const Color& _color) { m_gridColor = _color; };
87 const Color& getGridColor(void) const { return m_gridColor; };
88
89 void setGridLineWidth(double _width) { m_gridWidth = _width; };
90 double getGridLineWidth(void) const { return m_gridWidth; };
91
92 void setHidden(bool _isHidden) { m_isHidden = _isHidden; };
93 bool getHidden(void) const { return m_isHidden; };
94
95 void setLegendVisible(bool _isVisible) { m_legendVisible = _isVisible; };
96 bool getLegendVisible(void) const { return m_legendVisible; };
97
98 void setOldTreeIcons(const NavigationTreeItemIcon& _icons) { m_treeIcons = _icons; };
99 const NavigationTreeItemIcon& getOldTreeIcons(void) const { return m_treeIcons; };
100
101 void setXAxis(const Plot1DAxisCfg& _xAxis) { m_xAxis = _xAxis; };
102 const Plot1DAxisCfg& getXAxis(void) const { return m_xAxis; };
103
104 void setXAxisMin(double _min) { m_xAxis.setMin(_min); };
105 double getXAxisMin(void) const { return m_xAxis.getMin(); };
106
107 void setXAxisMax(double _max) { m_xAxis.setMax(_max); };
108 double getXAxisMax(void) const { return m_xAxis.getMax(); };
109
110 void setXAxisIsLogScale(bool _logScaleEnabled) { m_xAxis.setIsLogScale(_logScaleEnabled); };
111 bool getXAxisIsLogScale(void) const { return m_xAxis.getIsLogScale(); };
112
113 void setXAxisIsAutoScale(bool _autoScaleEnabled) { m_xAxis.setIsAutoScale(_autoScaleEnabled); };
114 bool getXAxisIsAutoScale(void) const { return m_xAxis.getIsAutoScale(); };
115
116 void setYAxis(const Plot1DAxisCfg& _yAxis) { m_yAxis = _yAxis; };
117 const Plot1DAxisCfg& getYAxis(void) const { return m_yAxis; };
118
119 void setYAxisMin(double _min) { m_yAxis.setMin(_min); };
120 double getYAxisMin(void) const { return m_yAxis.getMin(); };
121
122 void setYAxisMax(double _max) { m_yAxis.setMax(_max); };
123 double getYAxisMax(void) const { return m_yAxis.getMax(); };
124
125 void setYAxisIsLogScale(bool _logScaleEnabled) { m_yAxis.setIsLogScale(_logScaleEnabled); };
126 bool getYAxisIsLogScale(void) const { return m_yAxis.getIsLogScale(); };
127
128 void setYAxisIsAutoScale(bool _autoScaleEnabled) { m_yAxis.setIsAutoScale(_autoScaleEnabled); };
129 bool getYAxisIsAutoScale(void) const { return m_yAxis.getIsAutoScale(); };
130
131 private:
132 UID m_uid;
133
134 std::string m_name;
135 std::string m_title;
136 std::string m_projectName;
137 PlotType m_type;
138 AxisQuantity m_axisQuantity;
139
140 bool m_gridVisible;
141 ot::Color m_gridColor;
142 double m_gridWidth;
143
144 bool m_isHidden;
145 bool m_legendVisible;
146
147 NavigationTreeItemIcon m_treeIcons;
148
149 Plot1DAxisCfg m_xAxis;
150 Plot1DAxisCfg m_yAxis;
151 };
152
153}
bool operator==(const FaceSelection &left, const FaceSelection &right)
Definition Model.cpp:55
#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 NavigationTreeItemIcon.h:19
Definition Plot1DAxisCfg.h:17
Definition Plot1DCfg.h:19
void setName(const std::string &_name)
Definition Plot1DCfg.h:68
void setXAxisMax(double _max)
Definition Plot1DCfg.h:107
void setOldTreeIcons(const NavigationTreeItemIcon &_icons)
Definition Plot1DCfg.h:98
void setYAxisMin(double _min)
Definition Plot1DCfg.h:119
void setLegendVisible(bool _isVisible)
Definition Plot1DCfg.h:95
bool getXAxisIsLogScale(void) const
Definition Plot1DCfg.h:111
void setPlotType(PlotType _type)
Definition Plot1DCfg.h:77
const std::string & getTitle(void) const
Definition Plot1DCfg.h:72
void setProjectName(const std::string &_projectName)
Definition Plot1DCfg.h:74
void setYAxisIsAutoScale(bool _autoScaleEnabled)
Definition Plot1DCfg.h:128
void setYAxisMax(double _max)
Definition Plot1DCfg.h:122
double getGridLineWidth(void) const
Definition Plot1DCfg.h:90
bool getYAxisIsAutoScale(void) const
Definition Plot1DCfg.h:129
void setAxisQuantity(AxisQuantity _quantity)
Definition Plot1DCfg.h:80
void setHidden(bool _isHidden)
Definition Plot1DCfg.h:92
bool getXAxisIsAutoScale(void) const
Definition Plot1DCfg.h:114
bool getYAxisIsLogScale(void) const
Definition Plot1DCfg.h:126
const NavigationTreeItemIcon & getOldTreeIcons(void) const
Definition Plot1DCfg.h:99
void setGridColor(const Color &_color)
Definition Plot1DCfg.h:86
void setUid(UID _uid)
Definition Plot1DCfg.h:65
double getYAxisMax(void) const
Definition Plot1DCfg.h:123
void setXAxisIsAutoScale(bool _autoScaleEnabled)
Definition Plot1DCfg.h:113
void setGridLineWidth(double _width)
Definition Plot1DCfg.h:89
double getYAxisMin(void) const
Definition Plot1DCfg.h:120
const std::string & getName(void) const
Definition Plot1DCfg.h:69
PlotType
Definition Plot1DCfg.h:21
@ Cartesian
Definition Plot1DCfg.h:22
void setXAxisMin(double _min)
Definition Plot1DCfg.h:104
void setXAxisIsLogScale(bool _logScaleEnabled)
Definition Plot1DCfg.h:110
const std::string & getProjectName(void) const
Definition Plot1DCfg.h:75
bool getLegendVisible(void) const
Definition Plot1DCfg.h:96
bool getHidden(void) const
Definition Plot1DCfg.h:93
AxisQuantity getAxisQuantity(void) const
Definition Plot1DCfg.h:81
void setYAxis(const Plot1DAxisCfg &_yAxis)
Definition Plot1DCfg.h:116
double getXAxisMax(void) const
Definition Plot1DCfg.h:108
double getXAxisMin(void) const
Definition Plot1DCfg.h:105
const Plot1DAxisCfg & getYAxis(void) const
Definition Plot1DCfg.h:117
void setYAxisIsLogScale(bool _logScaleEnabled)
Definition Plot1DCfg.h:125
PlotType getPlotType(void) const
Definition Plot1DCfg.h:78
const Plot1DAxisCfg & getXAxis(void) const
Definition Plot1DCfg.h:102
void setXAxis(const Plot1DAxisCfg &_xAxis)
Definition Plot1DCfg.h:101
UID getUid(void) const
Definition Plot1DCfg.h:66
const Color & getGridColor(void) const
Definition Plot1DCfg.h:87
void setGridVisible(bool _visible)
Definition Plot1DCfg.h:83
AxisQuantity
Definition Plot1DCfg.h:26
@ Real
Definition Plot1DCfg.h:29
@ Magnitude
Definition Plot1DCfg.h:27
@ Imaginary
Definition Plot1DCfg.h:30
@ Phase
Definition Plot1DCfg.h:28
void setTitle(const std::string &_title)
Definition Plot1DCfg.h:71
bool getGridVisible(void) const
Definition Plot1DCfg.h:84
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
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