OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityResult1DPlot.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityContainer.h"
5#include "OldTreeIcon.h"
8
9#include <list>
10
11class __declspec(dllexport) EntityResult1DPlot : public EntityContainer {
12public:
13 EntityResult1DPlot(ot::UID ID, EntityBase *parent, EntityObserver *mdl, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
14 virtual ~EntityResult1DPlot();
15
16 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
17
18 virtual bool considerForPropertyFilter(void) override { return true; };
19 virtual bool considerChildrenForPropertyFilter(void) override { return false; };
20
21 virtual void StoreToDataBase(void) override;
22 virtual void addVisualizationNodes(void) override;
23
24 virtual std::string getClassName(void) { return "EntityResult1DPlot"; };
25
26 void addVisualizationItem(bool isHidden);
27
28 virtual entityType getEntityType(void) override { return TOPOLOGY; };
29
30 void createProperties(void);
31
32 virtual bool updateFromProperties(void) override;
33
34 void setTitle(const std::string &title) { setStringPlotProperty("Title", title); }
35 std::string getTitle(void) { return getStringPlotProperty("Title"); }
36
37 void setPlotType(const std::string &type);
38 std::string getPlotType(void);
39
40 void setPlotQuantity(const std::string &quantity);
41 std::string getPlotQuantity(void);
42
43 void setGrid(bool flag) { setBoolPlotProperty("Grid", flag); }
44 bool getGrid(void) { return getBoolPlotProperty("Grid"); }
45
46 void setGridColor(int colorR, int colorG, int colorB);
47 void getGridColor(int &colorR, int &colorG, int &colorB);
48
49 void setLegend(bool flag) { setBoolPlotProperty("Legend", flag); }
50 bool getLegend(void) { return getBoolPlotProperty("Legend"); }
51
52 void setLogscaleX(bool flag) { setBoolPlotProperty("Logscale X", flag); }
53 bool getLogscaleX(void) { return getBoolPlotProperty("Logscale X"); }
54
55 void setLogscaleY(bool flag) { setBoolPlotProperty("Logscale Y", flag); }
56 bool getLogscaleY(void) { return getBoolPlotProperty("Logscale Y"); }
57
58 void setAutoscaleX(bool flag) { setBoolPlotProperty("Autoscale X", flag); }
59 bool getAutoscaleX(void) { return getBoolPlotProperty("Autoscale X"); }
60
61 void setAutoscaleY(bool flag) { setBoolPlotProperty("Autoscale Y", flag); }
62 bool getAutoscaleY(void) { return getBoolPlotProperty("Autoscale Y"); }
63
64 void setXmin(double value) { setDoublePlotProperty("X min", value); }
65 void setXmax(double value) { setDoublePlotProperty("X max", value); }
66
67 void setYmin(double value) { setDoublePlotProperty("Y min", value); }
68 void setYmax(double value) { setDoublePlotProperty("Y max", value); }
69
70 double getXmin(void) { return getDoublePlotProperty("X min"); }
71 double getXmax(void) { return getDoublePlotProperty("X max"); }
72
73 double getYmin(void) { return getDoublePlotProperty("Y min"); }
74 double getYmax(void) { return getDoublePlotProperty("Y max"); }
75
76 bool updatePropertyVisibilities(void);
77
78 void addCurve(ot::UID _curveID, const std::string& _name);
79 bool deleteCurve(ot::UID _curveID);
80 bool deleteCurve(const std::string& _curveName);
81 const ot::UIDNamePairList& getCurves(void) const { return m_curves; };
82 ot::UIDList getCurveIDs(void) const;
83 std::list<std::string> getCurveNames(void) const;
84 void overrideReferencedCurves(const ot::UIDNamePairList& _curves);
85
86private:
87 virtual int getSchemaVersion(void) { return 1; };
88 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
89 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
90 void setStringPlotProperty(const std::string &name, const std::string &value);
91 void setSelectionPlotProperty(const std::string &name, const std::string &value);
92 void setBoolPlotProperty(const std::string &name, bool value);
93 void setDoublePlotProperty(const std::string &name, double value);
94 std::string getStringPlotProperty(const std::string &name);
95 std::string getSelectionPlotProperty(const std::string &name);
96 bool getBoolPlotProperty(const std::string &name);
97 double getDoublePlotProperty(const std::string &name);
98
99 void addBasicsToConfig(ot::Plot1DCfg& _config);
100
101 ot::UIDNamePairList m_curves;
102};
103
104
105
bsoncxx::types::value value
Definition DocumentManager.h:16
Definition Plot1DCfg.h:19
UICORE_API_EXPORT void setTitle(UID _windowUID, const QString &_title)
Will set the title at the specified window.
Definition uiAPI.cpp:872
std::list< ot::UIDNamePair > UIDNamePairList
Definition UIDNamePair.h:53
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
std::list< UID > UIDList
Unique identifier list.
Definition CoreTypes.h:31