Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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);
69  void SetReferenceActiveVolumeID (const char *id) { this->SetActiveVolumeID(id); };
70 
72  vtkGetStringMacro (SecondaryVolumeID);
73  void SetSecondaryVolumeID(const char* id);
75  void SetReferenceSecondaryVolumeID (char *id) { this->SetSecondaryVolumeID(id); };
76 
78  vtkGetStringMacro (ActiveLabelVolumeID);
79  void SetActiveLabelVolumeID(const char* id);
81  void SetReferenceActiveLabelVolumeID (const char *id) { this->SetActiveLabelVolumeID(id); };
82 
85  vtkGetStringMacro (ActiveFiducialListID);
88  void SetActiveFiducialListID(const char* id);
91  void SetReferenceActiveFiducialListID (const char *id) { this->SetActiveFiducialListID(id); };
92 
97  vtkGetStringMacro (ActivePlaceNodeClassName);
102  vtkSetStringMacro(ActivePlaceNodeClassName);
107  void SetReferenceActivePlaceNodeClassName (const char *className);
108 
112  vtkGetStringMacro (ActivePlaceNodeID);
116  void SetActivePlaceNodeID(const char* id);
121  void SetReferenceActivePlaceNodeID (const char *id)
122  { this->SetActivePlaceNodeID(id);
124 
126  vtkGetStringMacro (ActiveROIListID);
127  void SetActiveROIListID(const char* id);
129  void SetReferenceActiveROIListID (const char *id) { this->SetActiveROIListID(id); };
130 
132  vtkGetStringMacro (ActiveCameraID );
133  void SetActiveCameraID(const char* id);
135  void SetReferenceActiveCameraID (const char *id) { this->SetActiveCameraID(id); };
136 
138  vtkGetStringMacro (ActiveTableID);
139  void SetActiveTableID(const char* id);
141  void SetReferenceActiveTableID (char *id) { this->SetActiveTableID(id); };
142 
144  vtkGetStringMacro (ActiveViewID );
145  void SetActiveViewID(const char* id );
147  void SetReferenceActiveViewID (const char *id) { this->SetActiveViewID(id); };
148 
150  vtkGetStringMacro (ActiveLayoutID );
151  void SetActiveLayoutID(const char* id);
153  void SetReferenceActiveLayoutID (const char *id) { this->SetActiveLayoutID(id); };
154 
156  vtkGetStringMacro (ActivePlotChartID );
157  void SetActivePlotChartID(const char* id);
159  void SetReferenceActivePlotChartID (const char *id) { this->SetActivePlotChartID(id); };
160 
173  enum
174  {
175  ActivePlaceNodeIDChangedEvent = 19001,
179  };
180 
183  void AddNewPlaceNodeClassNameToList(const char *newID, const char *resource = NULL, const char *iconName = "");
184 
185  // -- Units --
186 
196  const char* GetUnitNodeID(const char* quantity);
197  void SetUnitNodeID(const char* quantity, const char* id);
198 
201  vtkMRMLUnitNode* GetUnitNode(const char* quantity);
202 
206  void GetUnitNodes(std::vector<vtkMRMLUnitNode*>& units);
207 
210  void GetUnitNodeIDs(std::vector<const char*>& quantities,
211  std::vector<const char*>& unitIDs);
212 
216  void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE;
217 
220  void RemovePlaceNodeClassNameFromList(const char *className);
223  std::string GetPlaceNodeClassNameByIndex(int n);
226  std::string GetPlaceNodeResourceByIndex(int n);
229  std::string GetPlaceNodeIconNameByIndex(int n);
230 
232  int PlaceNodeClassNameInList(std::string className);
237  std::string GetPlaceNodeResourceByClassName(std::string className);
239  int GetNumberOfPlaceNodeClassNamesInList() { return static_cast<int>(this->PlaceNodeClassNameList.size()); };
240 
243  std::string GetModelHierarchyDisplayNodeClassName(const std::string& dispayableNodeClass)const;
244 
247  std::map<std::string, std::string> GetModelHierarchyDisplayNodeClassNames()const;
248 
255  void AddModelHierarchyDisplayNodeClassName(const std::string& dispayableNodeClass,
256  const std::string& displayNodeClass);
257 
260  void ClearModelHierarchyDisplayNodeClassNames();
261 
262 protected:
266  void operator=(const vtkMRMLSelectionNode&);
267 
268  static const char* UnitNodeReferenceRole;
270 
271  virtual const char* GetUnitNodeReferenceRole();
272  virtual const char* GetUnitNodeReferenceMRMLAttributeName();
273 
286 
289  std::map<std::string, std::string> ModelHierarchyDisplayNodeClassName;
290 
291  std::vector<std::string> PlaceNodeClassNameList;
292  std::vector<std::string> PlaceNodeResourceList;
293  std::vector<std::string> PlaceNodeIconNameList;
294 };
295 
296 #endif
void SetReferenceActiveTableID(char *id)
static const char * UnitNodeReferenceRole
void SetReferenceActiveLayoutID(const char *id)
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 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)
int GetNumberOfPlaceNodeClassNamesInList()
Get the number of class names in the list.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
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)