Slicer  4.10
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) VTK_OVERRIDE;
43 
44  //--------------------------------------------------------------------------
46  //--------------------------------------------------------------------------
47 
49  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
50 
52  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
53 
55  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
56 
59  virtual void Reset(vtkMRMLNode* defaultNode) VTK_OVERRIDE;
60 
67  inline void SetLayoutName(const char *layoutName);
68  inline const char *GetLayoutName();
69 
80  vtkSetMacro(ViewGroup, int);
81  vtkGetMacro(ViewGroup, int);
82 
85  vtkSetStringMacro(LayoutLabel);
86  vtkGetStringMacro(LayoutLabel);
87 
89  vtkGetMacro(Active, int );
90  vtkSetMacro(Active, int );
91 
99  vtkGetMacro(Visibility, int);
100  vtkSetMacro(Visibility, int);
101 
121  vtkMRMLInteractionNode* GetInteractionNode();
124  bool SetInteractionNodeID(const char *interactionNodeId);
127  bool SetInteractionNode(vtkMRMLNode* node);
128 
133  virtual int IsMappedInLayout();
134  virtual void SetMappedInLayout(int value);
135 
139  vtkMRMLNode* GetParentLayoutNode();
142  bool SetAndObserveParentLayoutNodeID(const char *layoutNodeId);
145  bool SetAndObserveParentLayoutNode(vtkMRMLNode* node);
146 
155  bool IsViewVisibleInLayout();
156 
160  vtkGetVector3Macro(BackgroundColor, double);
161  vtkSetVector3Macro(BackgroundColor, double);
162 
166  vtkGetVector3Macro(BackgroundColor2, double);
167  vtkSetVector3Macro(BackgroundColor2, double);
168 
169 
172  vtkSetVector3Macro(LayoutColor, double);
173  vtkGetVector3Macro(LayoutColor, double);
174 
175  static double* GetRedColor();
176  static double* GetYellowColor();
177  static double* GetGreenColor();
178  static double* GetCompareColor();
179  static double* GetGrayColor();
180  static double* GetThreeDViewBlueColor();
181 
184  vtkGetMacro(OrientationMarkerEnabled, bool);
185 
187  vtkSetMacro(OrientationMarkerType, int);
188  vtkGetMacro(OrientationMarkerType, int);
189 
195  void SetOrientationMarkerHumanModelNodeID(const char* modelNodeId);
196  const char* GetOrientationMarkerHumanModelNodeID();
197  vtkMRMLModelNode* GetOrientationMarkerHumanModelNode();
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 
213  {
214  OrientationMarkerTypeNone=0,
218  OrientationMarkerType_Last // insert valid types above this line
219  };
220 
222  {
223  OrientationMarkerSizeSmall=0,
226  OrientationMarkerSize_Last // insert valid types above this line
227  };
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  {
244  RulerTypeNone=0,
247  RulerType_Last // insert valid types above this line
248  };
249 
256  const char* GetAxisLabel(int labelIndex);
257  void SetAxisLabel(int labelIndex, const char* label);
258 
260  static const int AxisLabelsCount;
261 
262 protected:
265 
267  void operator=(const vtkMRMLAbstractViewNode&);
268 
272 
275  char* LayoutLabel;
276 
281 
285  int Active;
286 
289  double BackgroundColor[3];
290  double BackgroundColor2[3];
291 
294  double LayoutColor[3];
295 
302 
304 
310 
313  vtkSmartPointer<vtkStringArray> AxisLabels;
314 
315  static const char* ParentLayoutNodeReferenceRole;
316  static const char* InteractionNodeReferenceRole;
317 };
318 
319 //------------------------------------------------------------------------------
320 void vtkMRMLAbstractViewNode::SetLayoutName(const char *layoutName)
321 {
322  this->SetSingletonTag(layoutName);
323 }
324 
325 //------------------------------------------------------------------------------
327 {
328  return this->GetSingletonTag();
329 }
330 
331 #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)
char * LayoutLabel
Label to show for the view (shortcut for the name)
void operator=(const vtkMRMLNode &)
virtual char * GetSingletonTag()
void SetLayoutName(const char *layoutName)
virtual void Copy(vtkMRMLNode *node)
Copy parameters (not including ID and Scene) from another node of the same type.
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D...
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) VTK_OVERRIDE
int ViewGroup
Views with the same ViewGroup value are in the same group.
static const int AxisLabelsCount
Total number of coordinate system axis labels.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
virtual void SetSingletonTag(const char *)
Tag that make this node a singleton in the scene.
RulerTypeType
Enum to specify orientation marker types.
static const char * ParentLayoutNodeReferenceRole