OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityResult1DCurve.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"
6#include "OTCore/Color.h"
7
8class EntityResult1DCurveData;
9
10class __declspec(dllexport) EntityResult1DCurve : public EntityContainer
11{
12public:
13 enum tDataType {EMPTY, REAL, IMAG, COMPLEX};
14
15 EntityResult1DCurve(ot::UID ID, EntityBase *parent, EntityObserver *mdl, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
16 virtual ~EntityResult1DCurve();
17
18 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
19
20 virtual bool considerForPropertyFilter(void) override { return true; };
21 virtual bool considerChildrenForPropertyFilter(void) override { return false; };
22
23 virtual void StoreToDataBase(void) override;
24 virtual void addVisualizationNodes(void) override;
25
26 virtual std::string getClassName(void) { return "EntityResult1DCurve"; };
27
28 virtual entityType getEntityType(void) override { return TOPOLOGY; };
29 virtual void removeChild(EntityBase *child) override;
30
31 void createProperties(void);
32
33 virtual bool updateFromProperties(void) override;
34
35 void deleteCurveData(void);
36
37 void storeCurveData(void);
38 void releaseCurveData(void);
39
40 long long getCurveDataStorageId(void) { return curveDataStorageId; }
41 long long getCurveDataStorageVersion(void) { return curveDataStorageVersion; }
42
43 void setColor(int colorR, int colorG, int colorB);
44 void setXLabel(const std::string &label) { setCurveProperty("X axis label", label); }
45 void setYLabel(const std::string &label) { setCurveProperty("Y axis label", label); }
46 void setXUnit(const std::string &unit) { setCurveProperty("X axis unit", unit); }
47 void setYUnit(const std::string &unit) { setCurveProperty("Y axis unit", unit); }
48
49 void setCurveXData(const std::vector<double> &x);
50 void setCurveYData(const std::vector<double> &yre, const std::vector<double> &yim);
51
52 void setColorFromID(int colorID);
53
54 tDataType getDataType(void) { return dataType; }
55
56 ot::Color getColor();
57 std::string getAxisLabelX();
58 std::string getAxisLabelY();
59 std::string getUnitX();
60 std::string getUnitY();
61
62private:
63 void EnsureCurveDataLoaded(void);
64 virtual int getSchemaVersion(void) { return 1; };
65 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
66 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
67 void setCurveProperty(const std::string &name, const std::string &value);
68 void syncSettingsFromProperties(void);
69 EntityResult1DCurveData *getCurveData(void);
70 EntityResult1DCurveData *curveData;
71 long long curveDataStorageId;
72 long long curveDataStorageVersion;
73
74 double color[3];
75 std::string xAxisLabel;
76 std::string yAxisLabel;
77 std::string xAxisUnit;
78 std::string yAxisUnit;
79
80 tDataType dataType;
81};
82
83
84
bsoncxx::types::value value
Definition DocumentManager.h:16
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27