OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityFile.h
Go to the documentation of this file.
1/*****************************************************************/
8#pragma once
9#include "EntityBase.h"
10#include "EntityBinaryData.h"
11#include <memory>
12
13class __declspec(dllexport) EntityFile: public EntityBase
14{
15public:
16 EntityFile(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
17
18 virtual bool getEntityBox(double &_xmin, double &_xmax, double &_ymin, double &_ymax, double &_zmin, double &_zmax) override;
19 virtual entityType getEntityType(void) override { return TOPOLOGY; };
20 virtual std::string getClassName(void) override { return "EntityFile"; };
21 virtual bool updateFromProperties(void) override;
22 virtual void addVisualizationNodes() override;
23
24 void setFileProperties(const std::string& _path, const std::string& _fileName, const std::string& _fileType);
25
27 void setData(ot::UID _dataID, ot::UID _dataVersion);
29 std::shared_ptr<EntityBinaryData> getData();
30
31 std::string getPath() const { return m_path; }
32 std::string getFileName() const { return m_fileName; }
33 std::string getFileType() const { return m_fileType; }
34
35protected:
36 virtual void setSpecializedProperties() {};
37 virtual void AddStorageData(bsoncxx::builder::basic::document& _storage) override;
38 virtual void readSpecificDataFromDataBase(bsoncxx::document::view& _doc_view, std::map<ot::UID, EntityBase *>& _entityMap) override;
39
40
41 long long m_dataUID = -1;
42 long long m_dataVersion = -1;
43private:
44 std::string m_path ="";
45 std::string m_fileName ="";
46 std::string m_fileType ="";
47
48 std::shared_ptr<EntityBinaryData> m_data = nullptr;
49
50 void EnsureDataIsLoaded();
51 void setProperties();
52 virtual int getSchemaVersion() { return 1; }
53};
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27