OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityMeshTetItem.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityBase.h"
5#include "Geometry.h"
6#include "BoundingBox.h"
7#include "OldTreeIcon.h"
8
9class EntityMeshTet;
10class EntityMeshTetFace;
11class EntityMeshTetItemDataFaces;
12class EntityMeshTetItemDataTets;
13class EntityMeshTetItemDataTetedges;
14
15#include <list>
16
17
19class __declspec(dllexport) EntityMeshTetItem : public EntityBase
20{
21public:
22 EntityMeshTetItem(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler*factory, const std::string &owner);
23 virtual ~EntityMeshTetItem();
24
25 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
26
27 void setMesh(EntityMeshTet *m) { mesh = m; };
28
29 void setNumberTets(size_t nT);
30 void setNumberTetEdges(size_t nE);
31 void setNumberFaces(size_t nT) { faces.resize(nT); setModified(); };
32
33 int getFaceId(size_t nF) { return faces[nF]; };
34 void setFace(size_t nF, int faceId) { faces[nF] = faceId; setModified(); };
35
36 bool getFaceOrientation(size_t nF) { return getFaceId(nF) > 0; };
37
38 EntityMeshTetFace *getFace(size_t nF);
39
40 void updateStatistics(void);
41 size_t getNumberTriangles(void) { return numberOfTriangles; };
42 size_t getNumberTets(void) { return numberOfTets; };
43 size_t getNumberTetEdges(void) { return numberOfTetEdges; };
44 size_t getNumberFaces(void) { return faces.size(); };
45
46 void setNumberOfTetNodes(size_t nT, int nNodes);
47 void setTetNode(size_t nT, int nodeIndex, size_t node);
48 size_t getTetNode(size_t nT, int nodeIndex);
49
50 void setTetEdgeNodes(size_t nE, size_t n[2]);
51 void getTetEdgeNodes(size_t nE, size_t n[2]);
52
53 virtual void StoreToDataBase(void) override;
54
55 virtual void addVisualizationNodes(void) override;
56
57 void addVisualizationItem(bool isHidden);
58
59 void setColor(double r, double g, double b) { colorRGB[0] = r; colorRGB[1] = g; colorRGB[2] = b; };
60
61 virtual std::string getClassName(void) override { return "EntityMeshTetItem"; };
62
63 long long getMeshDataTetsStorageId(void) { return meshDataTetsStorageId; };
64 long long getMeshDataTetedgesStorageId(void) { return meshDataTetEdgesStorageId; };
65
66 virtual entityType getEntityType(void) override { return TOPOLOGY; };
67 virtual void removeChild(EntityBase *child) override;
68
69 BoundingBox &getBoundingBox(void) { return boundingBox; }
70
71 EntityMeshTetItemDataTets *getMeshDataTets(void) { return meshDataTets; }
72 EntityMeshTetItemDataTetedges *getMeshDataTetEdges(void) { return meshDataTetEdges; }
73
74 virtual bool updateFromProperties(void) override;
75
76private:
77 void EnsureMeshItemDataTetsLoaded(void);
78 void EnsureMeshItemDataTetEdgesLoaded(void);
79 void storeMeshData(void);
80 void releaseMeshData(void);
81 virtual int getSchemaVersion(void) override { return 1; };
82 virtual void AddStorageData(bsoncxx::builder::basic::document &storage) override;
83 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
84
85 EntityMeshTet *mesh;
86
87 EntityMeshTetItemDataTets *meshDataTets;
88 ot::UID meshDataTetsStorageId;
89
90 EntityMeshTetItemDataTetedges *meshDataTetEdges;
91 ot::UID meshDataTetEdgesStorageId;
92
93 double colorRGB[3];
94
95 std::vector<int> faces;
96
97 BoundingBox boundingBox;
98 size_t numberOfTriangles;
99 size_t numberOfTets;
100 size_t numberOfTetEdges;
101};
102
103
104
Mesh m
Definition SelfIntersectionCheck.cpp:26
double double double b[]
Definition GeometryOperations.h:24
BoundingBox getBoundingBox(std::list< EntityGeometry * > &geometryEntities)
Definition GeometryOperations.cpp:230
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27