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 
55  void Copy(vtkMRMLNode *node) override;
56 
59  void Reset(vtkMRMLNode* defaultNode) 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 
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  {
261  RulerColorWhite=0,
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 
277  static const int AxisLabelsCount;
278 
279 protected:
281  ~vtkMRMLAbstractViewNode() override;
282 
284  void operator=(const vtkMRMLAbstractViewNode&);
285 
289 
292  char* LayoutLabel;
293 
298 
302  int Active;
303 
306  double BackgroundColor[3];
307  double BackgroundColor2[3];
308 
311  double LayoutColor[3];
312 
319 
321 
328 
331  vtkSmartPointer<vtkStringArray> AxisLabels;
332 
333  static const char* ParentLayoutNodeReferenceRole;
334  static const char* InteractionNodeReferenceRole;
335 };
336 
337 //------------------------------------------------------------------------------
338 void vtkMRMLAbstractViewNode::SetLayoutName(const char *layoutName)
339 {
340  this->SetSingletonTag(layoutName);
341 }
342 
343 //------------------------------------------------------------------------------
345 {
346  return this->GetSingletonTag();
347 }
348 
349 #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...
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
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:139
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