OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityFaceAnnotation.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityBase.h"
5#include "BoundingBox.h"
6#include "Geometry.h"
7#include "OldTreeIcon.h"
8
9#include "TopoDS_Shape.hxx"
10
11#include <string>
12
13class EntityFacetData;
14class EntityBrep;
15
16class __declspec(dllexport) EntityFaceAnnotationData
17{
18public:
19 EntityFaceAnnotationData() : modelID(0) {}
20 virtual ~EntityFaceAnnotationData() {}
21
22 void setData(const std::string &name, unsigned long long _modelID, std::string &_faceName) { entityName = name; modelID = _modelID, faceName = _faceName; }
23 unsigned long long getModelID(void) { return modelID; }
24 std::string getEntityName(void) { return entityName; }
25 std::string getFaceName(void) { return faceName; }
26
27private:
28 std::string entityName;
29 std::string faceName;
30 unsigned long long modelID;
31};
32
33class __declspec(dllexport) EntityFaceAnnotation : public EntityBase
34{
35public:
36 EntityFaceAnnotation(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
37 virtual ~EntityFaceAnnotation();
38
39 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
40
41 virtual bool updateFromProperties(void) override;
42
43 void addFacePick(EntityFaceAnnotationData annotation);
44 void setColor(double r, double g, double b);
45
46 std::list<TopoDS_Shape> findFacesFromShape(EntityBrep* brep);
47
48 virtual void StoreToDataBase(void) override;
49
50 void releaseFacets(void);
51
52 virtual void addVisualizationNodes(void) override;
53
54 virtual std::string getClassName(void) { return "EntityFaceAnnotation"; };
55
56 virtual entityType getEntityType(void) override { return TOPOLOGY; };
57 virtual void removeChild(EntityBase *child) override;
58
59 void getGeometryNames(std::list <std::string> &names);
60
61 void renewFacets(void);
62 void storeUpdatedFacets(void);
63 EntityFacetData *getFacets(void) { return facets; };
64 BoundingBox &getBoundingBox(void) { return boundingBox; };
65
66private:
67 virtual int getSchemaVersion(void) { return 1; };
68 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
69 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
70 void updateVisualization(bool isHidden);
71 void EnsureFacetsAreLoaded(void);
72 void storeFacets(void);
73 void findFacesAtIndexFromShape(std::list<TopoDS_Shape> &facesList, int faceIndex, EntityBrep* brep);
74
75 // Persistent data
76 EntityFacetData *facets;
77 long long facetsStorageID;
78
79 BoundingBox boundingBox;
80};
81
BoundingBox getBoundingBox(std::list< EntityGeometry * > &geometryEntities)
Definition GeometryOperations.cpp:230
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27