#pragma once #include "Reflection/Reflection.h" #include "Reflection/ReflectionDataTable.h" #include "Reflection/ReflectionProperty.h" #include #include "SignalTypes.h" namespace B3D { class DataModelInstance; class Instance { public: //Constructors Instance(void); Instance(const Instance&); virtual ~Instance(void); //Virtual Functions virtual void render(RenderDevice*); virtual void renderName(RenderDevice*); virtual void update(); virtual void setParent(Instance*); virtual void updateParentDatamodel(); //TODO implement virtual Instance* clone() const { return new Instance(*this); } virtual void reflectionNotify(ReflectionProperty* property); //Functions std::vector children; // All children. std::string getClassName(); Instance* findFirstChild(std::string); std::vector getChildren(); std::vector getAllChildren(); void setName(std::string newName); void addChild(Instance*); void removeChild(Instance*); void clearChildren(); Instance* getParent(); DataModelInstance * getParentDataModel(void); //Variables Reflection::ReflectionProperty name; bool canDelete; virtual bool postMessage(SigMesg msgId, void* lParam, void* wParam); protected: //Constructor //Used specifically to identify an instance class by an instance class, //NOT for use outside of Instance and decendants! Instance(std::string className); //Variables Reflection::ReflectionDataTable * dataTable; Instance * parent; DataModelInstance * parentDataModel; }; }