Slicer 5.9
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 : public vtkMRMLNode
39{
40public:
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
44 //--------------------------------------------------------------------------
46 //--------------------------------------------------------------------------
47
49 void ReadXMLAttributes(const char** atts) override;
50
52 void WriteXML(ostream& of, int indent) override;
53
57
60 void Reset(vtkMRMLNode* defaultNode) override;
61
68 inline void SetLayoutName(const char* layoutName);
69 inline const char* GetLayoutName();
70
81 vtkSetMacro(ViewGroup, int);
82 vtkGetMacro(ViewGroup, int);
83
86 vtkSetStringMacro(LayoutLabel);
87 vtkGetStringMacro(LayoutLabel);
88
90 vtkGetMacro(Active, int);
91 vtkSetMacro(Active, int);
92
100 vtkGetMacro(Visibility, int);
101 vtkSetMacro(Visibility, int);
102
125 bool SetInteractionNodeID(const char* interactionNodeId);
129
134 vtkSetMacro(MappedInLayout, bool);
135 virtual bool IsMappedInLayout();
136
143 bool SetAndObserveParentLayoutNodeID(const char* layoutNodeId);
147
157
161 vtkGetVector3Macro(BackgroundColor, double);
162 vtkSetVector3Macro(BackgroundColor, double);
163
167 vtkGetVector3Macro(BackgroundColor2, double);
168 vtkSetVector3Macro(BackgroundColor2, double);
169
172 vtkSetVector3Macro(LayoutColor, double);
173 vtkGetVector3Macro(LayoutColor, double);
174
175 static double* GetRedColor() VTK_SIZEHINT(3);
176 static double* GetYellowColor() VTK_SIZEHINT(3);
177 static double* GetGreenColor() VTK_SIZEHINT(3);
178 static double* GetCompareColor() VTK_SIZEHINT(3);
179 static double* GetGrayColor() VTK_SIZEHINT(3);
180 static double* GetThreeDViewBlueColor() VTK_SIZEHINT(3);
181
184 vtkGetMacro(OrientationMarkerEnabled, bool);
185
187 vtkSetMacro(OrientationMarkerType, int);
188 vtkGetMacro(OrientationMarkerType, int);
189
195 void SetOrientationMarkerHumanModelNodeID(const char* modelNodeId);
198
200 static const char* GetOrientationMarkerTypeAsString(int id);
201 static int GetOrientationMarkerTypeFromString(const char* name);
202
204 vtkSetMacro(OrientationMarkerSize, int);
205 vtkGetMacro(OrientationMarkerSize, int);
206
208 static const char* GetOrientationMarkerSizeAsString(int id);
209 static int GetOrientationMarkerSizeFromString(const char* name);
210
220
228
231 vtkGetMacro(RulerEnabled, bool);
232
234 vtkSetMacro(RulerType, int);
235 vtkGetMacro(RulerType, int);
236
238 static const char* GetRulerTypeAsString(int id);
239 static int GetRulerTypeFromString(const char* name);
240
243 {
247 RulerType_Last // insert valid types above this line
248 };
249
251 vtkSetMacro(RulerColor, int);
252 vtkGetMacro(RulerColor, int);
253
255 static const char* GetRulerColorAsString(int id);
256 static int GetRulerColorFromString(const char* name);
257
260 {
264 RulerColor_Last // insert valid types above this line
265 };
266
273 const char* GetAxisLabel(int labelIndex);
274 void SetAxisLabel(int labelIndex, const char* label);
275
280 std::string GetDirectionLabel(double direction[3], bool positive = true, double toleranceDeg = 1.0);
281
283 static const int AxisLabelsCount;
284
289 vtkMRMLLayoutNode* GetMaximizedState(bool& maximized, bool& canBeMaximized);
290
292
297 vtkGetMacro(ScreenScaleFactor, double);
298 vtkSetMacro(ScreenScaleFactor, double);
300
301protected:
304
307
310 int ViewGroup{ 0 };
311
314 char* LayoutLabel{ nullptr };
315
319 int Visibility{ 1 };
320
324 int Active{ 0 };
325
330
333 double LayoutColor[3];
334
341
343
347 bool RulerEnabled{ false };
350
353 double ScreenScaleFactor{ 0.2 };
354
357 vtkSmartPointer<vtkStringArray> AxisLabels;
358
362
365};
366
367//------------------------------------------------------------------------------
368void vtkMRMLAbstractViewNode::SetLayoutName(const char* layoutName)
369{
370 this->SetSingletonTag(layoutName);
371}
372
373//------------------------------------------------------------------------------
375{
376 return this->GetSingletonTag();
377}
378
379#endif
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)
int ViewGroup
Views with the same ViewGroup value are in the same group.
static double * GetCompareColor() VTK_SIZEHINT(3)
OrientationMarkerTypeType
Enum to specify orientation marker types.
static const char * GetRulerColorAsString(int id)
Convert between ruler color ID and name.
virtual bool IsMappedInLayout()
double BackgroundColor[3]
Background colors.
double LayoutColor[3]
Color for view header in layout as RGB.
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)
static double * GetThreeDViewBlueColor() VTK_SIZEHINT(3)
static const char * GetOrientationMarkerSizeAsString(int id)
Convert between orientation marker type ID and name.
RulerColorType
Enum to specify ruler colors.
RulerTypeType
Enum to specify ruler types.
static double * GetGrayColor() VTK_SIZEHINT(3)
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.
bool MappedInLayout
Define if the view is displayed in the current layout.
static double * GetRedColor() VTK_SIZEHINT(3)
static double * GetYellowColor() VTK_SIZEHINT(3)
vtkMRMLAbstractViewNode(const vtkMRMLAbstractViewNode &)
const char * GetOrientationMarkerHumanModelNodeID()
static const char * OrientationMarkerHumanModelReferenceRole
const char * GetAxisLabel(int labelIndex)
void SetOrientationMarkerHumanModelNodeID(const char *modelNodeId)
vtkMRMLInteractionNode * GetInteractionNode()
Get interaction node.
static int GetRulerColorFromString(const char *name)
static const char * ParentLayoutNodeReferenceRole
static const char * InteractionNodeReferenceRole
static const char * GetOrientationMarkerTypeAsString(int id)
Convert between orientation marker type ID and name.
~vtkMRMLAbstractViewNode() override
char * LayoutLabel
Label to show for the view (shortcut for the name)
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)
vtkMRMLModelNode * GetOrientationMarkerHumanModelNode()
static int GetOrientationMarkerSizeFromString(const char *name)
static double * GetGreenColor() VTK_SIZEHINT(3)
void PrintSelf(ostream &os, vtkIndent indent) override
bool SetInteractionNode(vtkMRMLNode *node)
static int GetOrientationMarkerTypeFromString(const char *name)
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.
virtual char * GetSingletonTag()
virtual void SetSingletonTag(const char *)
Tag that make this node a singleton in the scene.