OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EntityContainer.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable : 4251)
3
4#include "EntityBase.h"
5#include "OldTreeIcon.h"
6
7#include <list>
8
9class __declspec(dllexport) EntityContainer : public EntityBase
10{
11public:
12 EntityContainer(ot::UID ID, EntityBase *parent, EntityObserver *obs, ModelState *ms, ClassFactoryHandler* factory, const std::string &owner);
13 virtual ~EntityContainer();
14
20 void addChild(EntityBase *child);
26 virtual void removeChild(EntityBase *child) override;
27
28 const std::list<EntityBase *> &getChildrenList(void);
29
30 virtual bool getEntityBox(double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) override;
31
32 virtual EntityBase *getEntityFromName(const std::string &n) override;
33
34 virtual bool considerForPropertyFilter(void) override { return false; };
35 virtual bool considerChildrenForPropertyFilter(void) override { return true; };
36
37 virtual void StoreToDataBase(void) override;
38
39 virtual void addVisualizationNodes(void) override;
40
41 virtual std::string getClassName(void) override { return "EntityContainer"; } ;
42
43 virtual void addPrefetchingRequirementsForTopology(std::list<ot::UID> &prefetchIds) override;
44
45 virtual entityType getEntityType(void) override;
46
47 void setCreateVisualizationItem(bool flag);
48 bool getCreateVisualizationItem(void) { return createVisualizationItem; }
49
50 virtual void detachFromHierarchy(void) override;
51
52protected:
53 virtual int getSchemaVersion(void) override { return 1; } ;
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
57
58private:
59 std::list<EntityBase *> children;
60 bool createVisualizationItem;
61};
62
63
64
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27