OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityAnnotation.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityBase.h"
5#include "OldTreeIcon.h"
6#include <vector>
7#include <array>
8
9class EntityAnnotationData;
10
11class __declspec(dllexport) EntityAnnotation : public EntityBase {
12public:
13 EntityAnnotation(ot::UID ID, EntityBase *parent, EntityObserver *mdl, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
14 virtual ~EntityAnnotation();
15
16 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
17
18 void addPoint(double x, double y, double z, double r, double g, double b);
19 void addTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double r, double g, double b);
20
21 const std::vector<std::array<double, 3>> &getPoints(void);
22 const std::vector<std::array<double, 3>> &getPointsRGB(void);
23
24 const std::vector<std::array<double, 3>> &getTriangleP1(void);
25 const std::vector<std::array<double, 3>> &getTriangleP2(void);
26 const std::vector<std::array<double, 3>> &getTriangleP3(void);
27 const std::vector<std::array<double, 3>> &getTriangleRGB(void);
28
29 const double* getEdgeColorRGB();
30
31 virtual void StoreToDataBase(void) override;
32 virtual void addVisualizationNodes(void) override;
33
34 virtual std::string getClassName(void) { return "EntityAnnotation"; };
35
36 void addVisualizationItem(bool isHidden);
37
38 virtual entityType getEntityType(void) override { return TOPOLOGY; };
39 virtual void removeChild(EntityBase *child) override;
40
41 EntityAnnotationData *getAnnotationData(void) { EnsureAnnotationDataIsLoaded(); return annotationData; }
42
43private:
44 virtual int getSchemaVersion(void) { return 1; };
45 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
46 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
47 void EnsureAnnotationDataIsLoaded(void);
48 void storeAnnotationData(void);
49 void releaseAnnotationData(void);
50
51 EntityAnnotationData *annotationData;
52 long long annotationDataStorageId;
53};
54
55
56
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27