Slicer 5.9
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
21class vtkMRMLUnitNode;
22
23// STD includes
24#include <vector>
25
34class VTK_MRML_EXPORT vtkMRMLSelectionNode : public vtkMRMLNode
35{
36 public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
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);
66
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
91 const char* GetActivePlaceNodeID();
94 void SetActivePlaceNodeID(const char* id);
98 void SetReferenceActivePlaceNodeID (const char *id)
99 { this->SetActivePlaceNodeID(id);
101
103 const char* GetActiveROIListID();
104 void SetActiveROIListID(const char* id);
106 void SetReferenceActiveROIListID (const char *id) { this->SetActiveROIListID(id); };
107
109 const char* GetActiveCameraID();
110 void SetActiveCameraID(const char* id);
112 void SetReferenceActiveCameraID (const char *id) { this->SetActiveCameraID(id); };
113
115 const char* GetActiveTableID();
116 void SetActiveTableID(const char* id);
118 void SetReferenceActiveTableID (char *id) { this->SetActiveTableID(id); };
119
121 const char* GetActiveViewID();
122 void SetActiveViewID(const char* id );
124 void SetReferenceActiveViewID (const char *id) { this->SetActiveViewID(id); };
125
127 const char* GetActiveLayoutID();
128 void SetActiveLayoutID(const char* id);
130 void SetReferenceActiveLayoutID (const char *id) { this->SetActiveLayoutID(id); };
131
133 const char* GetActivePlotChartID();
134 void SetActivePlotChartID(const char* id);
136 void SetReferenceActivePlotChartID (const char *id) { this->SetActivePlotChartID(id); };
137
150 enum
151 {
157 };
158
161 void AddNewPlaceNodeClassNameToList(const char *newID, const char *resource = nullptr, const char *iconName = "");
162
163 // -- Units --
164
174 const char* GetUnitNodeID(const char* quantity);
175 void SetUnitNodeID(const char* quantity, const char* id);
176
179 vtkMRMLUnitNode* GetUnitNode(const char* quantity);
180
184 void GetUnitNodes(std::vector<vtkMRMLUnitNode*>& units);
185
188 void GetUnitNodeIDs(std::vector<const char*>& quantities,
189 std::vector<const char*>& unitIDs);
190
194 void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override;
195
198 void RemovePlaceNodeClassNameFromList(const char *className);
204 std::string GetPlaceNodeResourceByIndex(int n);
207 std::string GetPlaceNodeIconNameByIndex(int n);
208
210 int PlaceNodeClassNameInList(std::string className);
215 std::string GetPlaceNodeResourceByClassName(std::string className);
217 int GetNumberOfPlaceNodeClassNamesInList() { return static_cast<int>(this->PlaceNodeClassNameList.size()); };
218
224
225protected:
230
233
234 std::vector<std::string> PlaceNodeClassNameList;
235 std::vector<std::string> PlaceNodeResourceList;
236 std::vector<std::string> PlaceNodeIconNameList;
237};
238
239#endif
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
bool GetActivePlaceNodePlacementValid()
the node has a locked number of points.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
const char * GetActiveViewID()
the ID of a MRMLViewNode
void SetActiveTableID(const char *id)
void RemovePlaceNodeClassNameFromList(const char *className)
void SetUnitNodeID(const char *quantity, const char *id)
void SetActiveViewID(const char *id)
std::string GetPlaceNodeIconNameByIndex(int n)
void SetReferenceActiveTableID(char *id)
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
std::vector< std::string > PlaceNodeIconNameList
const char * GetUnitNodeID(const char *quantity)
void SetReferenceActivePlotChartID(const char *id)
int PlaceNodeClassNameInList(std::string className)
Check for an classname in the list, returning it's index, -1 if not in list.
const char * GetActiveLabelVolumeID()
the ID of a MRMLVolumeNode
void GetUnitNodes(std::vector< vtkMRMLUnitNode * > &units)
std::vector< std::string > PlaceNodeResourceList
std::vector< std::string > PlaceNodeClassNameList
void Copy(vtkMRMLNode *node) override
Copy the node's attributes to this object.
const char * GetActiveTableID()
the ID of a MRMLTableNode
void SetActivePlaceNodeID(const char *id)
const char * GetActiveVolumeID()
the ID of a MRMLVolumeNode (typically background)
void AddNewPlaceNodeClassNameToList(const char *newID, const char *resource=nullptr, const char *iconName="")
void SetActivePlotChartID(const char *id)
void SetReferenceActiveROIListID(const char *id)
void SetReferenceActiveViewID(const char *id)
void SetReferenceActivePlaceNodeID(const char *id)
vtkMRMLSelectionNode(const vtkMRMLSelectionNode &)
void SetReferenceActivePlaceNodeClassName(const char *className)
const char * GetActivePlaceNodeID()
void SetReferenceActiveLabelVolumeID(const char *id)
void SetReferenceActiveCameraID(const char *id)
std::string GetPlaceNodeResourceByClassName(std::string className)
const char * GetSecondaryVolumeID()
the ID of a MRMLVolumeNode (typically foreground)
void SetActiveVolumeID(const char *id)
void SetReferenceSecondaryVolumeID(char *id)
void SetActiveCameraID(const char *id)
vtkMRMLUnitNode * GetUnitNode(const char *quantity)
void SetSecondaryVolumeID(const char *id)
static vtkMRMLSelectionNode * New()
void GetUnitNodeIDs(std::vector< const char * > &quantities, std::vector< const char * > &unitIDs)
void ReadXMLAttributes(const char **atts) override
Set node attributes.
std::string GetPlaceNodeResourceByIndex(int n)
void SetActivePlaceNodePlacementValid(bool valid)
Set whether point placement is valid for the active placement node.
int GetNumberOfPlaceNodeClassNamesInList()
Get the number of class names in the list.
void PrintSelf(ostream &os, vtkIndent indent) override
void SetReferenceActiveVolumeID(const char *id)
void operator=(const vtkMRMLSelectionNode &)
~vtkMRMLSelectionNode() override
const char * GetActiveCameraID()
the ID of a MRMLCameraNode
const char * GetActivePlotChartID()
the ID of a MRMLPlotChartNode
void SetActiveLayoutID(const char *id)
const char * GetActiveROIListID()
the ID of a MRMLROIList
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
void SetReferenceActiveLayoutID(const char *id)
std::string GetPlaceNodeClassNameByIndex(int n)
void SetActiveLabelVolumeID(const char *id)
void SetActiveROIListID(const char *id)
const char * GetActiveLayoutID()
the ID of a MRMLLayoutNode
Node that holds the information about a unit.