Slicer 5.4
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLAbstractViewNode.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 This file was originally developed by Julien Finet, Kitware Inc.
17 and was partially funded by NIH grant 3P41RR013218-12S1
18
19==============================================================================*/
20
21#ifndef __vtkMRMLAbstractViewNode_h
22#define __vtkMRMLAbstractViewNode_h
23
24// VTK includes
25#include <vtkSmartPointer.h>
26
27// MRML includes
28#include "vtkMRMLNode.h"
29
33class vtkStringArray;
34
38class VTK_MRML_EXPORT vtkMRMLAbstractViewNode
39 : public vtkMRMLNode
40{
41public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
45 //--------------------------------------------------------------------------
47 //--------------------------------------------------------------------------
48
50 void ReadXMLAttributes( const char** atts) override;
51
53 void WriteXML(ostream& of, int indent) override;
54
58
61 void Reset(vtkMRMLNode* defaultNode) override;
62
69 inline void SetLayoutName(const char *layoutName);
70 inline const char *GetLayoutName();
71
82 vtkSetMacro(ViewGroup, int);
83 vtkGetMacro(ViewGroup, int);
84
87 vtkSetStringMacro(LayoutLabel);
88 vtkGetStringMacro(LayoutLabel);
89
91 vtkGetMacro(Active, int );
92 vtkSetMacro(Active, int );
93
101 vtkGetMacro(Visibility, int);
102 vtkSetMacro(Visibility, int);
103
126 bool SetInteractionNodeID(const char *interactionNodeId);
130
135 virtual int IsMappedInLayout();
136 virtual void SetMappedInLayout(int value);
137
144 bool SetAndObserveParentLayoutNodeID(const char *layoutNodeId);
148
158
162 vtkGetVector3Macro(BackgroundColor, double);
163 vtkSetVector3Macro(BackgroundColor, double);
164
168 vtkGetVector3Macro(BackgroundColor2, double);
169 vtkSetVector3Macro(BackgroundColor2, double);
170
171
174 vtkSetVector3Macro(LayoutColor, double);
175 vtkGetVector3Macro(LayoutColor, double);
176
177 static double* GetRedColor() VTK_SIZEHINT(3);
178 static double* GetYellowColor() VTK_SIZEHINT(3);
179 static double* GetGreenColor() VTK_SIZEHINT(3);
180 static double* GetCompareColor() VTK_SIZEHINT(3);
181 static double* GetGrayColor() VTK_SIZEHINT(3);
182 static double* GetThreeDViewBlueColor() VTK_SIZEHINT(3);
183
186 vtkGetMacro(OrientationMarkerEnabled, bool);
187
189 vtkSetMacro(OrientationMarkerType, int);
190 vtkGetMacro(OrientationMarkerType, int);
191
197 void SetOrientationMarkerHumanModelNodeID(const char* modelNodeId);
198 const char* GetOrientationMarkerHumanModelNodeID();
199 vtkMRMLModelNode* GetOrientationMarkerHumanModelNode();
200
202 static const char* GetOrientationMarkerTypeAsString(int id);
203 static int GetOrientationMarkerTypeFromString(const char* name);
204
206 vtkSetMacro(OrientationMarkerSize, int);
207 vtkGetMacro(OrientationMarkerSize, int);
208
210 static const char* GetOrientationMarkerSizeAsString(int id);
211 static int GetOrientationMarkerSizeFromString(const char* name);
212
215 {
216 OrientationMarkerTypeNone=0,
220 OrientationMarkerType_Last // insert valid types above this line
221 };
222
224 {
225 OrientationMarkerSizeSmall=0,
228 OrientationMarkerSize_Last // insert valid types above this line
229 };
230
233 vtkGetMacro(RulerEnabled, bool);
234
236 vtkSetMacro(RulerType, int);
237 vtkGetMacro(RulerType, int);
238
240 static const char* GetRulerTypeAsString(int id);
241 static int GetRulerTypeFromString(const char* name);
242
245 {
246 RulerTypeNone=0,
249 RulerType_Last // insert valid types above this line
250 };
251
253 vtkSetMacro(RulerColor, int);
254 vtkGetMacro(RulerColor, int);
255
257 static const char* GetRulerColorAsString(int id);
258 static int GetRulerColorFromString(const char* name);
259
262 {
263 RulerColorWhite=0,
266 RulerColor_Last // insert valid types above this line
267 };
268
275 const char* GetAxisLabel(int labelIndex);
276 void SetAxisLabel(int labelIndex, const char* label);
277
282 std::string GetDirectionLabel(double direction[3], bool positive=true, double toleranceDeg=1.0);
283
285 static const int AxisLabelsCount;
286
291 vtkMRMLLayoutNode* GetMaximizedState(bool& maximized, bool& canBeMaximized);
292
293protected:
296
299
302 int ViewGroup{0};
303
306 char* LayoutLabel{nullptr};
307
311 int Visibility{1};
312
316 int Active{0};
317
320 double BackgroundColor[3];
321 double BackgroundColor2[3];
322
325 double LayoutColor[3];
326
330 bool OrientationMarkerEnabled{false};
331 int OrientationMarkerType{OrientationMarkerTypeNone};
332 int OrientationMarkerSize{OrientationMarkerSizeMedium};
333
335
339 bool RulerEnabled{false};
340 int RulerType{RulerTypeNone};
341 int RulerColor{RulerColorWhite};
342
345 vtkSmartPointer<vtkStringArray> AxisLabels;
346
349};
350
351//------------------------------------------------------------------------------
352void vtkMRMLAbstractViewNode::SetLayoutName(const char *layoutName)
353{
354 this->SetSingletonTag(layoutName);
355}
356
357//------------------------------------------------------------------------------
359{
360 return this->GetSingletonTag();
361}
362
363#endif
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
void ReadXMLAttributes(const char **atts) override
MRMLNode methods.
std::string GetDirectionLabel(double direction[3], bool positive=true, double toleranceDeg=1.0)
bool SetAndObserveParentLayoutNodeID(const char *layoutNodeId)
OrientationMarkerTypeType
Enum to specify orientation marker types.
static const char * GetRulerColorAsString(int id)
Convert between ruler color ID and name.
virtual void SetMappedInLayout(int value)
static int GetRulerTypeFromString(const char *name)
vtkSmartPointer< vtkStringArray > AxisLabels
Labels of coordinate system axes.
bool IsViewVisibleInLayout()
Indicates whether or not the view is visible in the current layout.
void SetLayoutName(const char *layoutName)
bool SetAndObserveParentLayoutNode(vtkMRMLNode *node)
RulerColorType
Enum to specify ruler colors.
RulerTypeType
Enum to specify ruler types.
vtkMRMLCopyContentMacro(vtkMRMLAbstractViewNode)
static const int AxisLabelsCount
Total number of coordinate system axis labels.
bool SetInteractionNodeID(const char *interactionNodeId)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
static double * GetRedColor() VTK_SIZEHINT(3)
vtkMRMLAbstractViewNode(const vtkMRMLAbstractViewNode &)
static const char * OrientationMarkerHumanModelReferenceRole
const char * GetAxisLabel(int labelIndex)
vtkMRMLInteractionNode * GetInteractionNode()
Get interaction node.
virtual int IsMappedInLayout()
static int GetRulerColorFromString(const char *name)
static const char * ParentLayoutNodeReferenceRole
static const char * InteractionNodeReferenceRole
~vtkMRMLAbstractViewNode() override
vtkMRMLLayoutNode * GetMaximizedState(bool &maximized, bool &canBeMaximized)
vtkMRMLNode * GetParentLayoutNode()
static const char * GetRulerTypeAsString(int id)
Convert between ruler type ID and name.
void SetAxisLabel(int labelIndex, const char *label)
void PrintSelf(ostream &os, vtkIndent indent) override
bool SetInteractionNode(vtkMRMLNode *node)
void Reset(vtkMRMLNode *defaultNode) override
Reimplemented to preserve layout label when reset.
void operator=(const vtkMRMLAbstractViewNode &)
Node that describes the view layout of the application.
MRML node to represent a 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
virtual char * GetSingletonTag()
virtual void SetSingletonTag(const char *)
Tag that make this node a singleton in the scene.