15#ifndef __vtkMRMLHierarchyNode_h
16#define __vtkMRMLHierarchyNode_h
33 void PrintSelf(ostream& os, vtkIndent indent)
override;
43 void WriteXML(ostream& of,
int indent)
override;
151 const char *associatedNodeID);
void InvokeHierarchyModifiedEvent(vtkMRMLNode *node=nullptr)
void UpdateReferenceID(const char *oldID, const char *newID) override
Update the stored reference to another node in the scene.
virtual char * GetParentNodeIDReference()
char * ParentNodeIDReference
virtual vtkMRMLNode * GetAssociatedNode()
Get node associated with this hierarchy node.
virtual void GetAssociatedChildrenNodes(vtkCollection *children, const char *childClass=nullptr)
static std::map< vtkMRMLScene *, AssociatedHierarchyNodesType > SceneAssociatedHierarchyNodes
void SetAssociatedNodeIDReference(const char *)
void SetIndexInParent(int index)
Set index of this node in it's parent based on the value of their SortingValue.
int GetNumberOfChildrenNodes()
Returns the number of immediate children in the hierarchy.
static double MaximumSortingValue
vtkMRMLHierarchyNode * GetTopParentNode()
Get the top parent node in the hierarchy.
void SetParentNodeIDReference(const char *id)
String ID of the parent hierarchy MRML node.
virtual void SetAssociatedNodeID(const char *ref)
virtual char * GetParentNodeID()
String ID of the parent hierarchy MRML node.
vtkMRMLHierarchyNode * GetParentNode()
Associated parent MRML node.
static vtkMRMLHierarchyNode * GetAssociatedHierarchyNode(vtkMRMLScene *scene, const char *associatedNodeID)
Get Hierarchy node for a given associated node.
static std::map< vtkMRMLScene *, vtkMTimeType > SceneAssociatedHierarchyNodesMTime
virtual void SetParentNodeID(const char *ref)
std::vector< vtkMRMLHierarchyNode * > GetChildrenNodes()
int AllowMultipleChildren
is this a node that's only supposed to have one child?
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void RemoveHierarchyChildrenNodes()
Removes immediate children nodes, their children are reparented to this parent node.
char * AssociatedNodeIDReference
String ID of the associated MRML node.
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
void MoveInParent(int increment)
virtual char * GetAssociatedNodeID()
String ID of the corresponding displayable MRML node.
~vtkMRMLHierarchyNode() override
void PrintSelf(ostream &os, vtkIndent indent) override
int GetIndexInParent()
Get index of this node in it's parent based on the value of their SortingValue.
void operator=(const vtkMRMLHierarchyNode &)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
void SetSortingValue(double value)
Node's Sorting Value.
vtkMRMLHierarchyNode(const vtkMRMLHierarchyNode &)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
vtkMRMLHierarchyNode * GetNthChildNode(int index)
Get n-th child node sorted in the order of their SortingValue.
static void AssociatedHierarchyIsModified(vtkMRMLScene *scene)
Mark hierarchy as modified.
void GetAllChildrenNodes(std::vector< vtkMRMLHierarchyNode * > &childrenNodes)
Given this hierarchy node returns all it's children recursively.
virtual char * GetAssociatedNodeIDReference()
static void HierarchyIsModified(vtkMRMLScene *scene)
Mark hierarchy as modified when you.
void UpdateReferences() override
std::map< std::string, std::vector< vtkMRMLHierarchyNode * > > HierarchyChildrenNodesType
static int UpdateAssociatedToHierarchyMap(vtkMRMLScene *scene)
void SetSceneReferences() override
Set the reference node to current scene.
void UpdateScene(vtkMRMLScene *scene) override
Observe the reference transform node.
static std::map< vtkMRMLScene *, vtkMTimeType > SceneHierarchyChildrenNodesMTime
static std::map< vtkMRMLScene *, HierarchyChildrenNodesType > SceneHierarchyChildrenNodes
std::map< std::string, vtkMRMLHierarchyNode * > AssociatedHierarchyNodesType
void RemoveAllHierarchyChildrenNodes()
Removes all children hierarchy nodes including children of children, etc.
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
static vtkMRMLHierarchyNode * New()
friend class vtkMRMLScene