Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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{
36public:
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 {
100 this->SetActivePlaceNodeID(id);
102 };
103
105 const char* GetActiveROIListID();
106 void SetActiveROIListID(const char* id);
108 void SetReferenceActiveROIListID(const char* id) { this->SetActiveROIListID(id); };
109
111 const char* GetActiveCameraID();
112 void SetActiveCameraID(const char* id);
114 void SetReferenceActiveCameraID(const char* id) { this->SetActiveCameraID(id); };
115
117 const char* GetActiveTableID();
118 void SetActiveTableID(const char* id);
120 void SetReferenceActiveTableID(char* id) { this->SetActiveTableID(id); };
121
123 const char* GetActiveViewID();
124 void SetActiveViewID(const char* id);
126 void SetReferenceActiveViewID(const char* id) { this->SetActiveViewID(id); };
127
129 const char* GetActiveLayoutID();
130 void SetActiveLayoutID(const char* id);
132 void SetReferenceActiveLayoutID(const char* id) { this->SetActiveLayoutID(id); };
133
135 const char* GetActivePlotChartID();
136 void SetActivePlotChartID(const char* id);
138 void SetReferenceActivePlotChartID(const char* id) { this->SetActivePlotChartID(id); };
139
152 enum
153 {
159 };
160
163 void AddNewPlaceNodeClassNameToList(const char* newID, const char* resource = nullptr, const char* iconName = "");
164
165 // -- Units --
166
176 const char* GetUnitNodeID(const char* quantity);
177 void SetUnitNodeID(const char* quantity, const char* id);
178
181 vtkMRMLUnitNode* GetUnitNode(const char* quantity);
182
186 void GetUnitNodes(std::vector<vtkMRMLUnitNode*>& units);
187
190 void GetUnitNodeIDs(std::vector<const char*>& quantities, std::vector<const char*>& unitIDs);
191
195 void ProcessMRMLEvents(vtkObject* caller, unsigned long event, void* callData) override;
196
199 void RemovePlaceNodeClassNameFromList(const char* className);
205 std::string GetPlaceNodeResourceByIndex(int n);
208 std::string GetPlaceNodeIconNameByIndex(int n);
209
211 int PlaceNodeClassNameInList(std::string className);
216 std::string GetPlaceNodeResourceByClassName(std::string className);
218 int GetNumberOfPlaceNodeClassNamesInList() { return static_cast<int>(this->PlaceNodeClassNameList.size()); };
219
225
226protected:
231
234
235 std::vector<std::string> PlaceNodeClassNameList;
236 std::vector<std::string> PlaceNodeResourceList;
237 std::vector<std::string> PlaceNodeIconNameList;
238};
239
240#endif
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
bool GetActivePlaceNodePlacementValid()
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.