MeVisLab Toolbox Reference
mlBaseGraphItem.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_BASE_GRAPH_ITEM_H
14 #define ML_BASE_GRAPH_ITEM_H
15 
16 
18 
19 // project specific settings.
20 #include "mlVesselGraphSystem.h"
22 
23 // ML includes
25 #include <boost/shared_ptr.hpp>
27 
28 #define GETPROPERTYREFERENCE(name) name()
29 
31 
32 class Graph;
33 
36 {
37  // LoadTreeData needs access to the internal properties in order to correctly
38  // restore the graph structures.
39  friend class Graph;
40  friend class LoadTreeData;
41 
42 public:
46  Graph* getGraph(void) { return _graph; }
47  const Graph* getGraph(void) const { return _graph; }
48 
50  MLint getId(void) const { return _id; }
52 
53 protected:
55  BaseGraphItem(Graph& graph, MLint id, const ManagerPointer& manager);
56 
59 
62 
64  void copyProperties(const BaseGraphItem* other);
65 
67  bool operator==(const BaseGraphItem& other) const;
68  bool operator!=(const BaseGraphItem& other) const { return !(*this==other); }
69 
72 
73 private:
75  MLint _id;
76 
77 public:
78 
81  MLint getRootId() const { return _rootId; }
83  void setRootId(MLint rootId) { _rootId = rootId; }
84 
85 protected:
89  void addStateToTree(TreeNode* parent) const override;
90 
93 
95  void readStateFromTree(TreeNode* parent) override;
97 
98 private:
101  MLint _rootId;
102 
104 };
105 
107 
108 
109 #endif // __mlBaseGraphItem_H
class BaseGraphItem
BaseGraphItem(Graph &graph, MLint id, const ManagerPointer &manager)
Constructor.
bool operator!=(const BaseGraphItem &other) const
bool operator==(const BaseGraphItem &other) const
Compare properties (ignores topology information)
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
BaseGraphItem(const BaseGraphItem &item)
Copy constructor (creates an unconnected object, only copies properties), deprecated.
MLint getId(void) const
Get unique id of the object.
void copyProperties(const BaseGraphItem *other)
Copy all properties (topology information is left unchanged)
void setRootId(MLint rootId)
Sets the root id. Usually called by calling setRootIdToAllChildren on the graph itself.
BaseGraphItem & operator=(const BaseGraphItem &item)
Assignment operator, deprecated. Use copyProperties() instead.
Graph * getGraph(void)
void addStateToTree(TreeNode *parent) const override
Graph * _graph
Reference to the owner Graph object.
MLint getRootId() const
Get root id.
const Graph * getGraph(void) const
ML_SET_ADDSTATE_VERSION(2)
Set current addStateToTree() version number:
Defines the basic Graph class which holds sets of nodes, edges and roots to model tubular structures ...
Definition: mlGraph.h:64
PropertyManager::Pointer ManagerPointer
ML_ABSTRACT_CLASS_HEADER(PropertyContainer)
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
#define VESSELGRAPH_BEGIN_NAMESPACE