Slicer  4.8
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 
30 class vtkMRMLModelNode;
31 class vtkStringArray;
32 
36 class VTK_MRML_EXPORT vtkMRMLAbstractViewNode
37  : public vtkMRMLNode
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42 
43  //--------------------------------------------------------------------------
45  //--------------------------------------------------------------------------
46 
49  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
50 
53  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
54 
57  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
58 
61  virtual void Reset(vtkMRMLNode* defaultNode) VTK_OVERRIDE;
62 
70  inline void SetLayoutName(const char *layoutName);
71  inline const char *GetLayoutName();
72 
84  vtkSetMacro(ViewGroup, int);
85  vtkGetMacro(ViewGroup, int);
86 
90  vtkSetStringMacro(LayoutLabel);
91  vtkGetStringMacro(LayoutLabel);
92 
95  vtkGetMacro (Active, int );
96  vtkSetMacro (Active, int );
97 
105  vtkGetMacro(Visibility, int);
106  vtkSetMacro(Visibility, int);
107 
108 
113  virtual int IsMappedInLayout();
114  virtual void SetMappedInLayout(int value);
115 
124  bool IsViewVisibleInLayout();
125 
130  vtkGetVector3Macro (BackgroundColor, double);
131  vtkSetVector3Macro (BackgroundColor, double);
132 
137  vtkGetVector3Macro (BackgroundColor2, double);
138  vtkSetVector3Macro (BackgroundColor2, double);
139 
142  vtkGetMacro(OrientationMarkerEnabled, bool);
143 
146  vtkSetMacro(OrientationMarkerType, int);
147  vtkGetMacro(OrientationMarkerType, int);
148 
155  void SetOrientationMarkerHumanModelNodeID(const char* modelNodeId);
156  const char* GetOrientationMarkerHumanModelNodeID();
157  vtkMRMLModelNode* GetOrientationMarkerHumanModelNode();
158 
161  static const char* GetOrientationMarkerTypeAsString(int id);
162  static int GetOrientationMarkerTypeFromString(const char* name);
163 
166  vtkSetMacro(OrientationMarkerSize, int);
167  vtkGetMacro(OrientationMarkerSize, int);
168 
171  static const char* GetOrientationMarkerSizeAsString(int id);
172  static int GetOrientationMarkerSizeFromString(const char* name);
173 
176  {
177  OrientationMarkerTypeNone=0,
181  OrientationMarkerType_Last // insert valid types above this line
182  };
183 
185  {
186  OrientationMarkerSizeSmall=0,
189  OrientationMarkerSize_Last // insert valid types above this line
190  };
191 
194  vtkGetMacro(RulerEnabled, bool);
195 
198  vtkSetMacro(RulerType, int);
199  vtkGetMacro(RulerType, int);
200 
203  static const char* GetRulerTypeAsString(int id);
204  static int GetRulerTypeFromString(const char* name);
205 
208  {
209  RulerTypeNone=0,
212  RulerType_Last // insert valid types above this line
213  };
214 
222  const char* GetAxisLabel(int labelIndex);
223  void SetAxisLabel(int labelIndex, const char* label);
224 
227  static const int AxisLabelsCount;
228 
229 protected:
232 
234  void operator=(const vtkMRMLAbstractViewNode&);
235 
239 
242  char * LayoutLabel;
243 
248 
252  int Active;
253 
256  virtual void RemoveActiveFlagInScene();
257 
260  double BackgroundColor[3];
261  double BackgroundColor2[3];
262 
269 
272 
278 
281  vtkSmartPointer<vtkStringArray> AxisLabels;
282 };
283 
284 //------------------------------------------------------------------------------
285 void vtkMRMLAbstractViewNode::SetLayoutName(const char *layoutName)
286 {
287  this->SetSingletonTag(layoutName);
288 }
289 
290 //------------------------------------------------------------------------------
292 {
293  return this->GetSingletonTag();
294 }
295 
296 #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 * OrientationMarkerHumanModelMRMLAttributeName
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:135
virtual void SetSingletonTag(const char *)
Tag that make this node a singleton in the scene.
RulerTypeType
Enum to specify orientation marker types.