OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityResultUnstructuredMeshData.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include <list>
5
6#include "EntityBase.h"
7#include "EntityResultBase.h"
8#include "OldTreeIcon.h"
9#include "EntityBinaryData.h"
10
11class __declspec(dllexport) EntityResultUnstructuredMeshData : public EntityBase, public EntityResultBase
12{
13public:
14 EntityResultUnstructuredMeshData(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
15 virtual ~EntityResultUnstructuredMeshData();
16
17 virtual bool getEntityBox(double & xmin, double & xmax, double & ymin, double & ymax, double & zmin, double & zmax) override;
18
19 virtual std::string getClassName(void) { return "EntityResultUnstructuredMeshData"; };
20
21 virtual entityType getEntityType(void) override { return DATA;};
22
23 long long getNumberOfPoints(void) { return _numberPoints; };
24 long long getNumberOfCells(void) { return _numberCells; };
25
26 void getData(size_t& lenPointScalar, float*& pointScalar, size_t& lenPointVector, float*& pointVector, size_t& lenCellScalar, float*& cellScalar, size_t& lenCellVector, float*& cellVector, ClassFactoryHandler* factory);
27
28 // Please note that setting the data also transfers the ownership of the EntityBinaryData objects. The objects must not be deleted outside the EntityResultUnstructuredMesh.
29 void setData(long long numberPoints, long long numberCells, EntityBinaryData*& pointScalar, EntityBinaryData*& pointVector, EntityBinaryData*& cellScalar, EntityBinaryData*& cellVector);
30
31private:
32
33 long long _numberPoints = 0;
34 long long _numberCells = 0;
35
36 EntityBinaryData* _pointScalar = nullptr;
37 EntityBinaryData* _pointVector = nullptr;
38 EntityBinaryData* _cellScalar = nullptr;
39 EntityBinaryData* _cellVector = nullptr;
40
41 long long _pointScalarID = -1;
42 long long _pointScalarVersion = -1;
43 long long _pointVectorID = -1;
44 long long _pointVectorVersion = -1;
45 long long _cellScalarID = -1;
46 long long _cellScalarVersion = -1;
47 long long _cellVectorID = -1;
48 long long _cellVectorVersion = -1;
49
50 void clearAllBinaryData(void);
51 void updateIDFromObjects(void);
52 void readData(EntityBinaryData* data, size_t& lenValues, float*& values);
53
54 virtual void AddStorageData(bsoncxx::builder::basic::document &storage) override;
55 virtual void readSpecificDataFromDataBase(bsoncxx::document::view &doc_view, std::map<ot::UID, EntityBase *> &entityMap) override;
56};
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27