MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00004 00009 //---------------------------------------------------------------------------------- 00010 00011 #ifndef __mlBaseGraphItem_H 00012 #define __mlBaseGraphItem_H 00013 00014 // project specific settings. 00015 #include "mlVesselGraphSystem.h" 00016 #include "mlGraph.h" 00017 #include "Properties/mlPropertyContainer.h" 00018 00019 // ML includes 00020 #include "mlBase.h" 00021 #include "mlSystemWarningsDisable.h" 00022 #include <boost/shared_ptr.hpp> 00023 #include "mlSystemWarningsRestore.h" 00024 00025 #define GETPROPERTYREFERENCE(name) name() 00026 00027 ML_START_NAMESPACE 00028 00029 class TreeNode; 00030 00032 class VESSELGRAPH_EXPORT BaseGraphItem : public PropertyContainer 00033 { 00034 // LoadTreeData needs access to the internal properties in order to correctly 00035 // restore the graph structures. 00036 friend class Graph; 00037 friend class LoadTreeData; 00038 00039 public: 00041 00042 00043 Graph* getGraph(void) { return _graph; } 00044 const Graph* getGraph(void) const { return _graph; } 00045 00047 MLint getId(void) const { return _id; } 00048 00051 MLint getRootId() const { return _rootId; } 00053 void setRootId(MLint rootId) { _rootId = rootId; } 00055 00056 protected: 00058 BaseGraphItem(Graph& graph, MLint id, const ManagerPointer& manager); 00059 00061 BaseGraphItem(const BaseGraphItem &item); 00062 00064 BaseGraphItem& operator=(const BaseGraphItem &item); 00065 00067 virtual void copyProperties(const BaseGraphItem* other); 00068 00070 bool operator==(const BaseGraphItem& other) const; 00071 bool operator!=(const BaseGraphItem& other) const { return !(*this==other); } 00072 00074 Graph* _graph; 00075 00077 00078 00079 virtual void addStateToTree(TreeNode* parent) const; 00080 00082 ML_SET_ADDSTATE_VERSION(2); 00083 00085 virtual void readStateFromTree(TreeNode* parent); 00087 00088 private: 00090 MLint _id; 00093 MLint _rootId; 00094 00095 ML_ABSTRACT_CLASS_HEADER(BaseGraphItem); 00096 }; 00097 00098 ML_END_NAMESPACE 00099 00100 00101 #endif // __mlBaseGraphItem_H 00102 00103