Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLDisplayableNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLDisplayableNode.h,v $
10  Date: $Date: 2006/03/19 17:12:28 $
11  Version: $Revision: 1.6 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLDisplayableNode_h
16 #define __vtkMRMLDisplayableNode_h
17 
18 // MRML includes
19 #include "vtkMRMLStorageNode.h"
21 class vtkMRMLDisplayNode;
22 
23 // STD includes
24 #include <vector>
25 
41 
42 class vtkMRMLDisplayNode;
43 
44 class VTK_MRML_EXPORT vtkMRMLDisplayableNode : public vtkMRMLTransformableNode
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
50  //--------------------------------------------------------------------------
52  //--------------------------------------------------------------------------
53 
54  vtkMRMLNode* CreateNodeInstance() override = 0;
55 
56  const char* GetNodeTagName() override = 0;
57 
60  void ReadXMLAttributes( const char** atts) override;
61 
64  void WriteXML(ostream& of, int indent) override;
65 
71  virtual void WriteCLI(std::vector<std::string>& vtkNotUsed(commandLine),
72  std::string vtkNotUsed(prefix),
73  int vtkNotUsed(coordinateSystemFlag) = vtkMRMLStorageNode::CoordinateSystemRAS,
74  int vtkNotUsed(multipleFlag) = 1) {};
75 
78  void Copy(vtkMRMLNode *node) override;
79 
83  void SetAndObserveDisplayNodeID(const char *displayNodeID);
84 
88  void AddAndObserveDisplayNodeID(const char *displayNodeID);
89 
93  void RemoveNthDisplayNodeID(int n);
94 
97  void RemoveAllDisplayNodeIDs();
98 
113  void SetAndObserveNthDisplayNodeID(int n, const char *displayNodeID);
114 
117  bool HasDisplayNodeID(const char* displayNodeID);
118 
122  int GetNumberOfDisplayNodes();
123 
129  const char *GetNthDisplayNodeID(int n);
130 
134  const char *GetDisplayNodeID();
135 
146  vtkMRMLDisplayNode* GetNthDisplayNode(int n);
147 
151  vtkMRMLDisplayNode* GetDisplayNode();
152 
159 
162  void ProcessMRMLEvents ( vtkObject * /*caller*/,
163  unsigned long /*event*/,
164  void * /*callData*/ ) override;
165 
174  enum
175  {
176  DisplayModifiedEvent = 17000,
177  };
178 
182  virtual void CreateDefaultDisplayNodes();
183 
187  virtual void CreateDefaultSequenceDisplayNodes();
188 
194  virtual int GetDisplayVisibility();
195  virtual void SetDisplayVisibility(int visible);
196 
200  virtual int GetDisplayClassVisibility(const char* nodeClass);
201  virtual void SetDisplayClassVisibility(const char* nodeClass, int visible);
202 
207  virtual void GetRASBounds(double bounds[6]);
208 
212  virtual void GetBounds(double bounds[6]);
213 
214  virtual const char* GetDisplayNodeReferenceRole();
215 
219  void SetSelectable(int) override;
220 
221 protected:
223  ~vtkMRMLDisplayableNode() override;
225  void operator=(const vtkMRMLDisplayableNode&);
226 
227  static const char* DisplayNodeReferenceRole;
229 
230  virtual const char* GetDisplayNodeReferenceMRMLAttributeName();
231 
234  void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override;
235 
238  void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override;
239 
242  void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override;
243 
244 private:
247  std::vector<vtkMRMLDisplayNode *> DisplayNodes;
248 };
249 
250 #endif
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Transform nodes
void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override
Called when a node reference ID is modified.
void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override
Called after a node reference ID is removed (list size decreased).
void Copy(vtkMRMLNode *node) override
Copy node contents from another node of the same type. Reimplemented to copy default sequence storage...
virtual void WriteCLI(std::vector< std::string > &vtkNotUsed(commandLine), std::string vtkNotUsed(prefix), int vtkNotUsed(coordinateSystemFlag)=vtkMRMLStorageNode::CoordinateSystemRAS, int vtkNotUsed(multipleFlag)=1)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
const char * GetNodeTagName() override=0
Get node XML tag name (like Volume, Model)
void operator=(const vtkMRMLTransformableNode &)
static const char * DisplayNodeReferenceMRMLAttributeName
void PrintSelf(ostream &os, vtkIndent indent) override
void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override
Called when a node reference ID is added (list size increased).
static const char * DisplayNodeReferenceRole
Abstract class that contains graphical display properties for displayable nodes.
void WriteXML(ostream &of, int indent) override
Write this node&#39;s information to a MRML file in XML format.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
Class to hold information about a node reference.
Definition: vtkMRMLNode.h:801
virtual void SetSelectable(int)
MRML node for representing a node with a transform.