Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 
31 class vtkMRMLLayoutNode;
32 class vtkMRMLModelNode;
33 class vtkStringArray;
34 
38 class VTK_MRML_EXPORT vtkMRMLAbstractViewNode
39  : public vtkMRMLNode
40 {
41 public:
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 
123  vtkMRMLInteractionNode* GetInteractionNode();
126  bool SetInteractionNodeID(const char *interactionNodeId);
129  bool SetInteractionNode(vtkMRMLNode* node);
130 
135  virtual int IsMappedInLayout();
136  virtual void SetMappedInLayout(int value);
137 
141  vtkMRMLNode* GetParentLayoutNode();
144  bool SetAndObserveParentLayoutNodeID(const char *layoutNodeId);
147  bool SetAndObserveParentLayoutNode(vtkMRMLNode* node);
148 
157  bool IsViewVisibleInLayout();
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();
178  static double* GetYellowColor();
179  static double* GetGreenColor();
180  static double* GetCompareColor();
181  static double* GetGrayColor();
182  static double* GetThreeDViewBlueColor();
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 
279  static const int AxisLabelsCount;
280 
285  vtkMRMLLayoutNode* GetMaximizedState(bool& maximized, bool& canBeMaximized);
286 
287 protected:
289  ~vtkMRMLAbstractViewNode() override;
290 
292  void operator=(const vtkMRMLAbstractViewNode&);
293 
296  int ViewGroup{0};
297 
300  char* LayoutLabel{nullptr};
301 
305  int Visibility{1};
306 
310  int Active{0};
311 
314  double BackgroundColor[3];
315  double BackgroundColor2[3];
316 
319  double LayoutColor[3];
320 
324  bool OrientationMarkerEnabled{false};
325  int OrientationMarkerType{OrientationMarkerTypeNone};
326  int OrientationMarkerSize{OrientationMarkerSizeMedium};
327 
329 
333  bool RulerEnabled{false};
334  int RulerType{RulerTypeNone};
335  int RulerColor{RulerColorWhite};
336 
339  vtkSmartPointer<vtkStringArray> AxisLabels;
340 
341  static const char* ParentLayoutNodeReferenceRole;
342  static const char* InteractionNodeReferenceRole;
343 };
344 
345 //------------------------------------------------------------------------------
346 void vtkMRMLAbstractViewNode::SetLayoutName(const char *layoutName)
347 {
348  this->SetSingletonTag(layoutName);
349 }
350 
351 //------------------------------------------------------------------------------
353 {
354  return this->GetSingletonTag();
355 }
356 
357 #endif
OrientationMarkerTypeType
Enum to specify orientation marker types.
static const char * OrientationMarkerHumanModelReferenceRole
virtual void Reset(vtkMRMLNode *defaultNode)
Reset node attributes to the initial state as defined in the constructor or the passed default node...
MRML node to represent a 3D surface model.
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
Node that describes the view layout of the application.
virtual char * GetSingletonTag()
void SetLayoutName(const char *layoutName)
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
RulerColorType
Enum to specify ruler colors.
static const char * InteractionNodeReferenceRole
vtkSmartPointer< vtkStringArray > AxisLabels
Labels of coordinate system axes
virtual void WriteXML(ostream &of, int indent)
void PrintSelf(ostream &os, vtkIndent indent) override
#define vtkMRMLCopyContentMacro(thisClassName)
Definition: vtkMRMLNode.h:142
static const int AxisLabelsCount
Total number of coordinate system axis labels.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual void SetSingletonTag(const char *)
Tag that make this node a singleton in the scene.
RulerTypeType
Enum to specify ruler types.
static const char * ParentLayoutNodeReferenceRole