OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityMeshCartesianFace.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) EntityMeshCartesianFace : public EntityBase
12{
13public:
14 enum eType {INDEX_BASED = 0, POINT_BASED = 1};
15
16 EntityMeshCartesianFace(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
17 virtual ~EntityMeshCartesianFace() {};
18
19 void setType(eType t) { type = t; }
20
21 // Access the index based data
22 void setNumberCellFaces(int direction, size_t nT);
23 size_t getNumberCellFaces(int direction);
24 long long getCellFace(int direction, size_t n) { assert(direction >= 0 && direction < 3); assert(n < cellFaces[direction].size()); return cellFaces[direction][n]; };
25 void setCellFace(int direction, size_t n, long long face) { assert(direction >= 0 && direction < 3); assert(n < cellFaces[direction].size()); cellFaces[direction][n] = face; };
26
27 // Access the point based data
28 void setNumberCellFaces(size_t nT);
29 size_t getNumberCellFaces(void);
30 void setCellFace(size_t n, long long p0, long long p1, long long p2, long long p3) { assert(n < pointIndices[0].size()); pointIndices[0][n] = p0; pointIndices[1][n] = p1; pointIndices[2][n] = p2; pointIndices[3][n] = p3; };
31
32 BoundingBox &getBoundingBox(void) { return boundingBox; };
33 void setBoundingBox(const BoundingBox &box) { boundingBox = box; setModified(); };
34
35 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax);
36
37 void setSurfaceId(int id) { surfaceId = id; setModified(); };
38 int getSurfaceId(void) { return surfaceId; };
39
40 virtual std::string getClassName(void) { return "EntityMeshCartesianFace"; };
41
42 virtual entityType getEntityType(void) override { return DATA; };
43
44private:
45 virtual int getSchemaVersion(void) { return 1; };
46 virtual void AddStorageData(bsoncxx::builder::basic::document &storage);
47 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
48 void readCellFaces(bsoncxx::document::view &doc_view, int direction, const std::string &itemName);
49 void readPoints(bsoncxx::document::view &doc_view, int index, const std::string &itemName);
50
51 eType type;
52 int surfaceId;
53 std::vector<long long> cellFaces[3];
54 std::vector<long long> pointIndices[4];
55 BoundingBox boundingBox;
56};
double p2[]
Definition GeometryOperations.h:24
BoundingBox getBoundingBox(std::list< EntityGeometry * > &geometryEntities)
Definition GeometryOperations.cpp:230
UICORE_API_EXPORT objectType type(UID _objectUID)
Will return the object type of the specified object.
Definition uiAPI.cpp:596
UICORE_API_EXPORT QSize size(UID _windowUID)
Will return the size of the window.
Definition uiAPI.cpp:924
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27