Slicer  5.1
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) override;
40 
41  vtkMRMLNode* CreateNodeInstance() override;
42 
44  void ReadXMLAttributes( const char** atts) override;
45 
47  void WriteXML(ostream& of, int indent) override;
48 
50  void Copy(vtkMRMLNode *node) override;
51 
53  const char* GetNodeTagName() override {return "Selection";}
54 
56  const char* GetActiveVolumeID();
57  void SetActiveVolumeID(const char* id);
59  void SetReferenceActiveVolumeID (const char *id) { this->SetActiveVolumeID(id); };
60 
62  const char* GetSecondaryVolumeID();
63  void SetSecondaryVolumeID(const char* id);
65  void SetReferenceSecondaryVolumeID (char *id) { this->SetSecondaryVolumeID(id); };
66 
68  const char* GetActiveLabelVolumeID();
69  void SetActiveLabelVolumeID(const char* id);
71  void SetReferenceActiveLabelVolumeID (const char *id) { this->SetActiveLabelVolumeID(id); };
72 
77  vtkGetStringMacro (ActivePlaceNodeClassName);
82  vtkSetStringMacro(ActivePlaceNodeClassName);
87  void SetReferenceActivePlaceNodeClassName (const char *className);
88 
92  const char* GetActivePlaceNodeID();
96  void SetActivePlaceNodeID(const char* id);
101  void SetReferenceActivePlaceNodeID (const char *id)
102  { this->SetActivePlaceNodeID(id);
104 
106  const char* GetActiveROIListID();
107  void SetActiveROIListID(const char* id);
109  void SetReferenceActiveROIListID (const char *id) { this->SetActiveROIListID(id); };
110 
112  const char* GetActiveCameraID();
113  void SetActiveCameraID(const char* id);
115  void SetReferenceActiveCameraID (const char *id) { this->SetActiveCameraID(id); };
116 
118  const char* GetActiveTableID();
119  void SetActiveTableID(const char* id);
121  void SetReferenceActiveTableID (char *id) { this->SetActiveTableID(id); };
122 
124  const char* GetActiveViewID();
125  void SetActiveViewID(const char* id );
127  void SetReferenceActiveViewID (const char *id) { this->SetActiveViewID(id); };
128 
130  const char* GetActiveLayoutID();
131  void SetActiveLayoutID(const char* id);
133  void SetReferenceActiveLayoutID (const char *id) { this->SetActiveLayoutID(id); };
134 
136  const char* GetActivePlotChartID();
137  void SetActivePlotChartID(const char* id);
139  void SetReferenceActivePlotChartID (const char *id) { this->SetActivePlotChartID(id); };
140 
153  enum
154  {
155  ActivePlaceNodeIDChangedEvent = 19001,
160  };
161 
164  void AddNewPlaceNodeClassNameToList(const char *newID, const char *resource = nullptr, const char *iconName = "");
165 
166  // -- Units --
167 
177  const char* GetUnitNodeID(const char* quantity);
178  void SetUnitNodeID(const char* quantity, const char* id);
179 
182  vtkMRMLUnitNode* GetUnitNode(const char* quantity);
183 
187  void GetUnitNodes(std::vector<vtkMRMLUnitNode*>& units);
188 
191  void GetUnitNodeIDs(std::vector<const char*>& quantities,
192  std::vector<const char*>& unitIDs);
193 
197  void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override;
198 
201  void RemovePlaceNodeClassNameFromList(const char *className);
204  std::string GetPlaceNodeClassNameByIndex(int n);
207  std::string GetPlaceNodeResourceByIndex(int n);
210  std::string GetPlaceNodeIconNameByIndex(int n);
211 
213  int PlaceNodeClassNameInList(std::string className);
218  std::string GetPlaceNodeResourceByClassName(std::string className);
220  int GetNumberOfPlaceNodeClassNamesInList() { return static_cast<int>(this->PlaceNodeClassNameList.size()); };
221 
223  void SetActivePlaceNodePlacementValid(bool valid);
226  bool GetActivePlaceNodePlacementValid();
227 
228 protected:
230  ~vtkMRMLSelectionNode() override;
232  void operator=(const vtkMRMLSelectionNode&);
233 
236 
237  std::vector<std::string> PlaceNodeClassNameList;
238  std::vector<std::string> PlaceNodeResourceList;
239  std::vector<std::string> PlaceNodeIconNameList;
240 };
241 
242 #endif
void SetReferenceActiveTableID(char *id)
void SetReferenceActiveLayoutID(const char *id)
virtual void ReadXMLAttributes(const char **atts)
void SetReferenceActivePlaceNodeID(const char *id)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
virtual void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData)
Propagate events generated in mrml.
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.
std::vector< std::string > PlaceNodeIconNameList
void SetReferenceActiveViewID(const char *id)
void SetReferenceActiveLabelVolumeID(const char *id)
void SetReferenceSecondaryVolumeID(char *id)
virtual void WriteXML(ostream &of, int indent)
void SetReferenceActiveROIListID(const char *id)
void SetReferenceActiveVolumeID(const char *id)
int GetNumberOfPlaceNodeClassNamesInList()
Get the number of class names in the list.
void PrintSelf(ostream &os, vtkIndent indent) override
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
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)