13#ifndef ML_VESSEL_NODE_H
14#define ML_VESSEL_NODE_H
42 bool operator!=(
const VesselNode& other)
const {
return !(*
this==other); }
59 std::vector<VesselEdge*>*
edges() {
return &_edges; }
66 bool isPred(
size_t i)
const {
return _edges[i]->succNode()==
this; }
68 bool isSucc(
size_t i)
const {
return _edges[i]->predNode()==
this; }
70 bool isCycle(
size_t i)
const {
return _edges[i]->isCycle(); }
91 ImageVector
getVectorPos()
const {
return ImageVector(
static_cast<int>(getPos()[0]),
static_cast<int>(getPos()[1]),
static_cast<int>(getPos()[2]), 0, 0, 0); }
95 double distance(
const Vector3& position)
const {
return (position - getPos()).length(); }
125 VesselNode(
Graph& graph,
MLint id,
const Vector3& pos);
135 std::vector<VesselEdge*> _edges;
159 void readOldGraphNodeStateFromTree(TreeNode* parent);
161 void readOldVesselNodeStateFromTree(TreeNode* parent);
BaseGraphItem(Graph &graph, MLint id, const ManagerPointer &manager)
Constructor.
bool isPred(size_t i) const
Is the dependent edge with index i preceding?
const VesselNode * getPredNode() const
Get the one and only predecessor node (return NULL for rootnode).
VesselEdge * getPredEdge()
Get the one and only predecessor edge (return NULL for rootnode).
void convertToWorld(Matrix4 *mat)
Convert nodes' coordinates.
const VesselEdge * getPredEdge() const
Get the one and only predecessor edge (return NULL for rootnode).
~VesselNode() override
Destructor.
void copyProperties(const VesselNode *other)
Copy all properties (topology information is left unchanged).
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
void(VesselNode::* NodeSetFkt)(const MLdouble &)
function to set double parameter value
STATIC_GRAPH_PROPERTY(MLdouble, minDistance, MinDistance)
VesselNode * getPredNode()
Get the one and only predecessor node (return NULL for rootnode).
STATIC_GRAPH_PROPERTY(Vector3, pos, Pos)
bool isSucc(size_t i) const
Is the dependent edge with index i succeeding?
size_t getEdgeNum() const
Get number of edges dependent on the node.
void setVectorPos(const ImageVector &position)
Position in world.
bool closeCycle()
TODO: Unclear what this does.
void transform(const Matrix4 &m)
Apply a 4x4 homogeneous transformation matrix to the node position.
bool operator==(const VesselNode &other) const
STATIC_GRAPH_PROPERTY(MLint, label, Label)
VesselEdge * getDepEdge(size_t i)
Get the pointer of edge with index i.
ImageVector getVectorPos() const
Position in world.
ML_SET_ADDSTATE_VERSION(2)
Set current addStateToTree() version number:
STATIC_GRAPH_PROPERTY(MLdouble, maxPathLength, MaxPathLength)
std::vector< VesselEdge * > * edges()
Get pointer to edge array.
MLdouble(VesselNode::* NodeGetFkt)() const
object bound function pointer: position of function relative to (individual) object base
bool isCycle(size_t i) const
Is the dependent edge with index i a cycle?
double distance(const Vector3 &position) const
void convertToVoxel(Matrix4 *mat)
Convert nodes' coordinates.
void addStateToTree(TreeNode *parent) const override
STATIC_GRAPH_PROPERTY(MLdouble, weight, Weight)
friend class LoadTreeData
VesselNode * getDepNode(size_t i)
Get dependent node via edge with index i.
bool operator!=(const VesselNode &other) const
const VesselEdge * getDepEdge(size_t i) const
Get the pointer of edge with index i.
const VesselNode * getDepNode(size_t i) const
Get dependent node via edge with index i.
#define ML_ABSTRACT_CLASS_HEADER(className)
#define STATIC_GRAPH_PROPERTY(Type, lowerCaseName, upperCaseName)
#define VESSELGRAPH_END_NAMESPACE
#define VESSELGRAPH_EXPORT
#define VESSELGRAPH_BEGIN_NAMESPACE