OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityMeshTetFace.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityContainer.h"
5#include "BoundingBox.h"
6#include "EntityBase.h"
7#include "OldTreeIcon.h"
8
9#include <list>
10
11class __declspec(dllexport) EntityMeshTetTriangle
12{
13public:
14 EntityMeshTetTriangle() {};
15 virtual ~EntityMeshTetTriangle() {};
16
17 void setNumberOfNodes(int n) { assert(nodes.empty()); nodes.resize(n); }
18 int getNumberOfNodes(void) { return (int) nodes.size(); }
19
20 void setNode(int i, size_t n) { assert(i < (int) nodes.size()); nodes[i] = n;};
21 size_t getNode(int i) { assert(i < (int) nodes.size()); return nodes[i]; };
22
23private:
24 std::vector<size_t> nodes;
25};
26
27class __declspec(dllexport) EntityMeshTetFace : public EntityBase
28{
29public:
30 EntityMeshTetFace(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
31 virtual ~EntityMeshTetFace() {};
32
33 void setNumberTriangles(size_t nT) { triangles.resize(nT); setModified(); };
34 size_t getNumberTriangles(void) { return triangles.size(); };
35
36 EntityMeshTetTriangle &getTriangle(size_t n) { assert(n < triangles.size()); return triangles[n]; };
37 BoundingBox &getBoundingBox(void) { return boundingBox; };
38 void setBoundingBox(const BoundingBox &box) { boundingBox = box; setModified(); };
39
40 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax);
41
42 void setSurfaceId(int id) { surfaceId = id; setModified(); };
43 int getSurfaceId(void) { return surfaceId; };
44
45 void addAnnotation(bool orientationForward, ot::UID id) {faceAnnotationIDs.push_back(std::make_pair(orientationForward, id)); setModified();};
46 size_t getNumberAnnotations(void) { return faceAnnotationIDs.size(); };
47 void getAnnotation(int index, bool &orientationForward, ot::UID &annotationEntityID) { orientationForward = faceAnnotationIDs[index].first; annotationEntityID = faceAnnotationIDs[index].second; };
48
49 virtual std::string getClassName(void) { return "EntityMeshTetFace"; };
50
51 virtual entityType getEntityType(void) override { return DATA; };
52
53private:
54 virtual int getSchemaVersion(void) { return 1; };
55 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
56 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
57
58 bsoncxx::document::value getBSON(std::vector<EntityMeshTetTriangle> &triangles);
59 bsoncxx::document::value getBSON(std::vector<std::pair<bool, ot::UID>> &faceAnnotationIDs);
60 void readBSON(bsoncxx::document::view &trianglesObj, std::vector<EntityMeshTetTriangle> &triangles);
61 void readBSON(bsoncxx::document::view &annotationObj, std::vector<std::pair<bool, ot::UID>> &faceAnnotationIDs);
62
63 int surfaceId;
64 std::vector<EntityMeshTetTriangle> triangles;
65 std::vector<std::pair<bool, ot::UID>> faceAnnotationIDs;
66 BoundingBox boundingBox;
67};
@ nodes
Definition MonitorSettings.h:17
EntityBrep double std::vector< Geometry::Node > std::list< Geometry::Triangle > & triangles
Definition GeometryOperations.h:22
BoundingBox getBoundingBox(std::list< EntityGeometry * > &geometryEntities)
Definition GeometryOperations.cpp:230
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27