Slicer  4.11
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 vtkMRMLModelNode;
32 class vtkStringArray;
33 
37 class VTK_MRML_EXPORT vtkMRMLAbstractViewNode
38  : public vtkMRMLNode
39 {
40 public:
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 
122  vtkMRMLInteractionNode* GetInteractionNode();
125  bool SetInteractionNodeID(const char *interactionNodeId);
128  bool SetInteractionNode(vtkMRMLNode* node);
129 
134  virtual int IsMappedInLayout();
135  virtual void SetMappedInLayout(int value);
136 
140  vtkMRMLNode* GetParentLayoutNode();
143  bool SetAndObserveParentLayoutNodeID(const char *layoutNodeId);
146  bool SetAndObserveParentLayoutNode(vtkMRMLNode* node);
147 
156  bool IsViewVisibleInLayout();
157 
161  vtkGetVector3Macro(BackgroundColor, double);
162  vtkSetVector3Macro(BackgroundColor, double);
163 
167  vtkGetVector3Macro(BackgroundColor2, double);
168  vtkSetVector3Macro(BackgroundColor2, double);
169 
170 
173  vtkSetVector3Macro(LayoutColor, double);
174  vtkGetVector3Macro(LayoutColor, double);
175 
176  static double* GetRedColor();
177  static double* GetYellowColor();
178  static double* GetGreenColor();
179  static double* GetCompareColor();
180  static double* GetGrayColor();
181  static double* GetThreeDViewBlueColor();
182 
185  vtkGetMacro(OrientationMarkerEnabled, bool);
186 
188  vtkSetMacro(OrientationMarkerType, int);
189  vtkGetMacro(OrientationMarkerType, int);
190 
196  void SetOrientationMarkerHumanModelNodeID(const char* modelNodeId);
197  const char* GetOrientationMarkerHumanModelNodeID();
198  vtkMRMLModelNode* GetOrientationMarkerHumanModelNode();
199 
201  static const char* GetOrientationMarkerTypeAsString(int id);
202  static int GetOrientationMarkerTypeFromString(const char* name);
203 
205  vtkSetMacro(OrientationMarkerSize, int);
206  vtkGetMacro(OrientationMarkerSize, int);
207 
209  static const char* GetOrientationMarkerSizeAsString(int id);
210  static int GetOrientationMarkerSizeFromString(const char* name);
211 
214  {
215  OrientationMarkerTypeNone=0,
219  OrientationMarkerType_Last // insert valid types above this line
220  };
221 
223  {
224  OrientationMarkerSizeSmall=0,
227  OrientationMarkerSize_Last // insert valid types above this line
228  };
229 
232  vtkGetMacro(RulerEnabled, bool);
233 
235  vtkSetMacro(RulerType, int);
236  vtkGetMacro(RulerType, int);
237 
239  static const char* GetRulerTypeAsString(int id);
240  static int GetRulerTypeFromString(const char* name);
241 
244  {
245  RulerTypeNone=0,
248  RulerType_Last // insert valid types above this line
249  };
250 
252  vtkSetMacro(RulerColor, int);
253  vtkGetMacro(RulerColor, int);
254 
256  static const char* GetRulerColorAsString(int id);
257  static int GetRulerColorFromString(const char* name);
258 
261  {
262  RulerColorWhite=0,
265  RulerColor_Last // insert valid types above this line
266  };
267 
274  const char* GetAxisLabel(int labelIndex);
275  void SetAxisLabel(int labelIndex, const char* label);
276 
278  static const int AxisLabelsCount;
279 
280 protected:
282  ~vtkMRMLAbstractViewNode() override;
283 
285  void operator=(const vtkMRMLAbstractViewNode&);
286 
289  int ViewGroup{0};
290 
293  char* LayoutLabel{nullptr};
294 
298  int Visibility{1};
299 
303  int Active{0};
304 
307  double BackgroundColor[3];
308  double BackgroundColor2[3];
309 
312  double LayoutColor[3];
313 
317  bool OrientationMarkerEnabled{false};
318  int OrientationMarkerType{OrientationMarkerTypeNone};
319  int OrientationMarkerSize{OrientationMarkerSizeMedium};
320 
322 
326  bool RulerEnabled{false};
327  int RulerType{RulerTypeNone};
328  int RulerColor{RulerColorWhite};
329 
332  vtkSmartPointer<vtkStringArray> AxisLabels;
333 
334  static const char* ParentLayoutNodeReferenceRole;
335  static const char* InteractionNodeReferenceRole;
336 };
337 
338 //------------------------------------------------------------------------------
339 void vtkMRMLAbstractViewNode::SetLayoutName(const char *layoutName)
340 {
341  this->SetSingletonTag(layoutName);
342 }
343 
344 //------------------------------------------------------------------------------
346 {
347  return this->GetSingletonTag();
348 }
349 
350 #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 &)
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