MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
32class 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
42public:
47 {
48 return _graph;
49 }
50 const Graph* getGraph(void) const
51 {
52 return _graph;
53 }
54
56 MLint getId(void) const
57 {
58 return _id;
59 }
61
62protected:
65
67 [[deprecated("Use copyProperties() instead.")]]
70 , _graph(nullptr)
71 , _id(other._id)
72 , _rootId(other._rootId)
73 {}
74
76 [[deprecated("Use copyProperties() instead.")]]
78 {
80 return *this;
81 }
82
85
87 bool operator==(const BaseGraphItem& other) const;
88 bool operator!=(const BaseGraphItem& other) const
89 {
90 return !(*this == other);
91 }
92
95
96private:
98 MLint _id;
99
100public:
104 {
105 return _rootId;
106 }
109 {
110 _rootId = rootId;
111 }
112
113protected:
117 void addStateToTree(TreeNode* parent) const override;
118
121
123 void readStateFromTree(TreeNode* parent) override;
125
126private:
129 MLint _rootId;
130
132};
133
135
136
137#endif // __mlBaseGraphItem_H
class BaseGraphItem
Graph * getGraph(void)
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.
MLint getId(void) const
Get unique id of the object.
void copyProperties(const BaseGraphItem *other)
Copy all properties (topology information is left unchanged)
const Graph * getGraph(void) const
BaseGraphItem & operator=(const BaseGraphItem &other)
Assignment operator, deprecated. Use copyProperties() instead.
BaseGraphItem(const BaseGraphItem &other)
Copy constructor (creates an unconnected object, only copies properties), deprecated.
void setRootId(MLint rootId)
Sets the root id. Usually called by calling setRootIdToAllChildren on the graph itself.
void addStateToTree(TreeNode *parent) const override
Graph * _graph
Reference to the owner Graph object.
MLint getRootId() const
Get root id.
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
void copyProperties(const PropertyContainer &other)
Copy all properties from the given container to this object.
#define ML_ABSTRACT_CLASS_HEADER(className)
Similar to ML_ABSTRACT_CLASS_HEADER_EXPORTED with a non-existing export symbol.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_EXPORT
Definiert systemspezifische Macros, die f"ur diese DLL gelten sollen.
#define VESSELGRAPH_BEGIN_NAMESPACE