forked from Slicer/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 2
/
vtkMRMLDisplayableHierarchyNode.h
155 lines (110 loc) · 4.43 KB
/
vtkMRMLDisplayableHierarchyNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*=auto=========================================================================
Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Program: 3D Slicer
Module: $RCSfile: vtkMRMLDisplayableHierarchyNode.h,v $
Date: $Date: 2006/03/19 17:12:28 $
Version: $Revision: 1.6 $
=========================================================================auto=*/
#ifndef __vtkMRMLDisplayableHierarchyNode_h
#define __vtkMRMLDisplayableHierarchyNode_h
#include "vtkMRMLHierarchyNode.h"
class vtkMRMLDisplayableNode;
class vtkMRMLDisplayNode;
class vtkCallbackCommand;
/// \brief MRML node to represent a hierarchy of displayable nodes
class VTK_MRML_EXPORT vtkMRMLDisplayableHierarchyNode : public vtkMRMLHierarchyNode
{
public:
static vtkMRMLDisplayableHierarchyNode *New();
vtkTypeMacro(vtkMRMLDisplayableHierarchyNode,vtkMRMLHierarchyNode);
void PrintSelf(ostream& os, vtkIndent indent) override;
//--------------------------------------------------------------------------
/// MRMLNode methods
//--------------------------------------------------------------------------
vtkMRMLNode* CreateNodeInstance() override;
///
/// Read node attributes from XML file
void ReadXMLAttributes( const char** atts) override;
///
/// Write this node's information to a MRML file in XML format.
void WriteXML(ostream& of, int indent) override;
///
/// Copy the node's attributes to this object
void Copy(vtkMRMLNode *node) override;
///
/// Get node XML tag name (like Volume, DisplayableHierarchy)
const char* GetNodeTagName() override {return "DisplayableHierarchy";}
/// Set the display node as reference into the scene
void SetSceneReferences() override;
///
/// Updates this node if it depends on other nodes
/// when the node is deleted in the scene
void UpdateReferences() override;
///
/// Finds the Displayable node and read the data
void UpdateScene(vtkMRMLScene *scene) override;
///
/// Update the stored reference to another node in the scene
void UpdateReferenceID(const char *oldID, const char *newID) override;
///
/// String ID of the corresponding displayable MRML node
virtual char* GetDisplayableNodeID()
{
return this->GetAssociatedNodeID();
}
virtual void SetDisplayableNodeID(const char* ref)
{
this->SetAssociatedNodeID(ref);
}
void SetAndObserveDisplayNodeID(const char *DisplayNodeID);
vtkGetStringMacro(DisplayNodeID);
///
/// Get associated displayable MRML node
vtkMRMLDisplayableNode* GetDisplayableNode();
///
/// Get associated display MRML node
vtkMRMLDisplayNode* GetDisplayNode();
///
/// Indicates if the node is expanded
vtkBooleanMacro(Expanded, int);
vtkGetMacro(Expanded, int);
vtkSetMacro(Expanded, int);
///
/// Get the top parent node in the hierarchy which is not expanded
vtkMRMLDisplayableHierarchyNode* GetCollapsedParentNode();
///
/// Find all child displayable nodes in the hierarchy
void GetChildrenDisplayableNodes(vtkCollection *children);
///
/// Get Hierarchy node for a given displayable node
static vtkMRMLDisplayableHierarchyNode* GetDisplayableHierarchyNode(vtkMRMLScene *scene,
const char *displayableNodeID);
/// Removes immediate children nodes, both hierarchy and corresponding displayable/display nodes
/// their children are reparented to this parent node.
void RemoveChildrenNodes();
/// Removes all children hierarchy nodes both hierarchy and corresponding displayable/display nodes,
/// including children of children, etc.
void RemoveAllChildrenNodes();
///
/// alternative method to propagate events generated in Display nodes
void ProcessMRMLEvents ( vtkObject * /*caller*/,
unsigned long /*event*/,
void * /*callData*/ ) override;
/// DisplayModifiedEvent is generated when display node parameters is changed
enum
{
DisplayModifiedEvent = 17000
};
protected:
vtkMRMLDisplayableHierarchyNode();
~vtkMRMLDisplayableHierarchyNode() override;
vtkMRMLDisplayableHierarchyNode(const vtkMRMLDisplayableHierarchyNode&);
void operator=(const vtkMRMLDisplayableHierarchyNode&);
void SetDisplayNodeID(const char *);
char *DisplayNodeID;
vtkMRMLDisplayNode *DisplayNode;
int Expanded;
};
#endif