Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLSelectionNode.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: vtkMRMLSelectionNode.h,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.3 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLSelectionNode_h
16 #define __vtkMRMLSelectionNode_h
17 
18 // MRML includes
19 #include "vtkMRMLNode.h"
20 
21 class vtkMRMLUnitNode;
22 
23 // STD includes
24 #include <vector>
25 
34 class VTK_MRML_EXPORT vtkMRMLSelectionNode : public vtkMRMLNode
35 {
36  public:
37  static vtkMRMLSelectionNode *New();
39  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
40 
41  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
42 
44  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
45 
47  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
48 
50  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
51 
53  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "Selection";}
54 
56  virtual void SetSceneReferences() VTK_OVERRIDE;
57 
59  virtual void UpdateReferenceID(const char *oldID, const char *newID) VTK_OVERRIDE;
60 
63  virtual void UpdateReferences() VTK_OVERRIDE;
64 
66  vtkGetStringMacro (ActiveVolumeID);
67  void SetActiveVolumeID(const char* id);
68  void SetReferenceActiveVolumeID (const char *id) { this->SetActiveVolumeID(id); };
69 
71  vtkGetStringMacro (SecondaryVolumeID);
72  void SetSecondaryVolumeID(const char* id);
73  void SetReferenceSecondaryVolumeID (char *id) { this->SetSecondaryVolumeID(id); };
74 
76  vtkGetStringMacro (ActiveLabelVolumeID);
77  void SetActiveLabelVolumeID(const char* id);
78  void SetReferenceActiveLabelVolumeID (const char *id) { this->SetActiveLabelVolumeID(id); };
79 
82  vtkGetStringMacro (ActiveFiducialListID);
85  void SetActiveFiducialListID(const char* id);
88  void SetReferenceActiveFiducialListID (const char *id) { this->SetActiveFiducialListID(id); };
89 
94  vtkGetStringMacro (ActivePlaceNodeClassName);
99  vtkSetStringMacro(ActivePlaceNodeClassName);
104  void SetReferenceActivePlaceNodeClassName (const char *className);
105 
109  vtkGetStringMacro (ActivePlaceNodeID);
113  void SetActivePlaceNodeID(const char* id);
118  void SetReferenceActivePlaceNodeID (const char *id)
119  { this->SetActivePlaceNodeID(id);
121 
123  vtkGetStringMacro (ActiveROIListID);
124  void SetActiveROIListID(const char* id);
125  void SetReferenceActiveROIListID (const char *id) { this->SetActiveROIListID(id); };
126 
128  vtkGetStringMacro (ActiveCameraID );
129  void SetActiveCameraID(const char* id);
130  void SetReferenceActiveCameraID (const char *id) { this->SetActiveCameraID(id); };
131 
133  vtkGetStringMacro (ActiveTableID);
134  void SetActiveTableID(const char* id);
135  void SetReferenceActiveTableID (char *id) { this->SetActiveTableID(id); };
136 
138  vtkGetStringMacro (ActiveViewID );
139  void SetActiveViewID(const char* id );
140  void SetReferenceActiveViewID (const char *id) { this->SetActiveViewID(id); };
141 
143  vtkGetStringMacro (ActiveLayoutID );
144  void SetActiveLayoutID(const char* id);
145  void SetReferenceActiveLayoutID (const char *id) { this->SetActiveLayoutID(id); };
146 
148  vtkGetStringMacro (ActivePlotChartID );
149  void SetActivePlotChartID(const char* id);
150  void SetReferenceActivePlotChartID (const char *id) { this->SetActivePlotChartID(id); };
151 
164  enum
165  {
166  ActivePlaceNodeIDChangedEvent = 19001,
170  };
171 
174  void AddNewPlaceNodeClassNameToList(const char *newID, const char *resource = NULL, const char *iconName = "");
175 
176  // -- Units --
177 
187  const char* GetUnitNodeID(const char* quantity);
188  void SetUnitNodeID(const char* quantity, const char* id);
189 
192  vtkMRMLUnitNode* GetUnitNode(const char* quantity);
193 
197  void GetUnitNodes(std::vector<vtkMRMLUnitNode*>& units);
198 
201  void GetUnitNodeIDs(std::vector<const char*>& quantities,
202  std::vector<const char*>& unitIDs);
203 
207  void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE;
208 
211  void RemovePlaceNodeClassNameFromList(const char *className);
214  std::string GetPlaceNodeClassNameByIndex(int n);
217  std::string GetPlaceNodeResourceByIndex(int n);
220  std::string GetPlaceNodeIconNameByIndex(int n);
221 
223  int PlaceNodeClassNameInList(std::string className);
228  std::string GetPlaceNodeResourceByClassName(std::string className);
230  int GetNumberOfPlaceNodeClassNamesInList() { return static_cast<int>(this->PlaceNodeClassNameList.size()); };
231 
234  std::string GetModelHierarchyDisplayNodeClassName(const std::string& dispayableNodeClass)const;
235 
238  std::map<std::string, std::string> GetModelHierarchyDisplayNodeClassNames()const;
239 
246  void AddModelHierarchyDisplayNodeClassName(const std::string& dispayableNodeClass,
247  const std::string& displayNodeClass);
248 
251  void ClearModelHierarchyDisplayNodeClassNames();
252 
253 protected:
257  void operator=(const vtkMRMLSelectionNode&);
258 
259  static const char* UnitNodeReferenceRole;
261 
262  virtual const char* GetUnitNodeReferenceRole();
263  virtual const char* GetUnitNodeReferenceMRMLAttributeName();
264 
277 
280  std::map<std::string, std::string> ModelHierarchyDisplayNodeClassName;
281 
282  std::vector<std::string> PlaceNodeClassNameList;
283  std::vector<std::string> PlaceNodeResourceList;
284  std::vector<std::string> PlaceNodeIconNameList;
285 };
286 
287 #endif
void SetReferenceActiveTableID(char *id)
static const char * UnitNodeReferenceRole
void SetReferenceActiveLayoutID(const char *id)
virtual void UpdateReferences()
The method should remove all pointers and observations to all nodes that are not in the scene anymore...
void SetReferenceActivePlaceNodeID(const char *id)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
virtual void UpdateReferenceID(const char *oldID, const char *newID)
Update the stored reference to another node in the scene.
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
virtual void SetSceneReferences()
Update the references of the node to the scene.
std::vector< std::string > PlaceNodeIconNameList
static const char * UnitNodeReferenceMRMLAttributeName
void SetReferenceActiveViewID(const char *id)
void SetReferenceActiveLabelVolumeID(const char *id)
std::map< std::string, std::string > ModelHierarchyDisplayNodeClassName
void SetReferenceSecondaryVolumeID(char *id)
void SetReferenceActiveFiducialListID(const char *id)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
void SetReferenceActiveROIListID(const char *id)
void SetReferenceActiveVolumeID(const char *id)
int GetNumberOfPlaceNodeClassNamesInList()
Get the number of class names in the list.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
void SetReferenceActiveCameraID(const char *id)
Node that holds the information about a unit.
MRML node for storing information about the active nodes in the scene.
std::vector< std::string > PlaceNodeClassNameList
std::vector< std::string > PlaceNodeResourceList
void SetReferenceActivePlotChartID(const char *id)