Slicer  4.11
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
20 class vtkMRMLDisplayNode;
21 
22 // STD includes
23 #include <vector>
24 
40 
41 class vtkMRMLDisplayNode;
42 
43 class VTK_MRML_EXPORT vtkMRMLDisplayableNode : public vtkMRMLTransformableNode
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
49  //--------------------------------------------------------------------------
51  //--------------------------------------------------------------------------
52 
53  vtkMRMLNode* CreateNodeInstance() override = 0;
54 
55  const char* GetNodeTagName() override = 0;
56 
59  void ReadXMLAttributes( const char** atts) override;
60 
63  void WriteXML(ostream& of, int indent) override;
64 
70  virtual void WriteCLI(std::vector<std::string>& vtkNotUsed(commandLine),
71  std::string vtkNotUsed(prefix),
72  int vtkNotUsed(coordinateSystemFlag) = 0,
73  int vtkNotUsed(multipleFlag) = 1) {};
74 
77  void Copy(vtkMRMLNode *node) override;
78 
82  void SetAndObserveDisplayNodeID(const char *displayNodeID);
83 
87  void AddAndObserveDisplayNodeID(const char *displayNodeID);
88 
92  void RemoveNthDisplayNodeID(int n);
93 
96  void RemoveAllDisplayNodeIDs();
97 
112  void SetAndObserveNthDisplayNodeID(int n, const char *displayNodeID);
113 
116  bool HasDisplayNodeID(const char* displayNodeID);
117 
121  int GetNumberOfDisplayNodes();
122 
128  const char *GetNthDisplayNodeID(int n);
129 
133  const char *GetDisplayNodeID();
134 
145  vtkMRMLDisplayNode* GetNthDisplayNode(int n);
146 
150  vtkMRMLDisplayNode* GetDisplayNode();
151 
158 
161  void ProcessMRMLEvents ( vtkObject * /*caller*/,
162  unsigned long /*event*/,
163  void * /*callData*/ ) override;
164 
173  enum
174  {
175  DisplayModifiedEvent = 17000,
176  };
177 
181  virtual void CreateDefaultDisplayNodes();
182 
186  virtual void CreateDefaultSequenceDisplayNodes();
187 
192  virtual int GetDisplayVisibility();
193  virtual void SetDisplayVisibility(int visible);
194 
197  virtual int GetDisplayClassVisibility(const char* nodeClass);
198  virtual void SetDisplayClassVisibility(const char* nodeClass, int visible);
199 
204  virtual void GetRASBounds(double bounds[6]);
205 
209  virtual void GetBounds(double bounds[6]);
210 
211  virtual const char* GetDisplayNodeReferenceRole();
212 
216  void SetSelectable(int) override;
217 
218 protected:
220  ~vtkMRMLDisplayableNode() override;
222  void operator=(const vtkMRMLDisplayableNode&);
223 
224  static const char* DisplayNodeReferenceRole;
226 
227  virtual const char* GetDisplayNodeReferenceMRMLAttributeName();
228 
231  void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override;
232 
235  void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override;
236 
239  void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override;
240 
241 private:
244  std::vector<vtkMRMLDisplayNode *> DisplayNodes;
245 };
246 
247 #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.
virtual void WriteCLI(std::vector< std::string > &vtkNotUsed(commandLine), std::string vtkNotUsed(prefix), int vtkNotUsed(coordinateSystemFlag)=0, int vtkNotUsed(multipleFlag)=1)
void OnNodeReferenceRemoved(vtkMRMLNodeReference *reference) override
Called after a node reference ID is removed (list size decreased).
virtual void Copy(vtkMRMLNode *node)
Copy node contents from another node of the same type. Does not copy node ID and Scene. Performs deep copy - an independent copy is created from all data, including bulk data.
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:775
virtual void SetSelectable(int)
MRML node for representing a node with a transform.