Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLCrosshairNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Program: 3D Slicer
9  Module: $RCSfile: vtkMRMLCrosshairNode.h,v $
10  Date: $Date: 2006/03/19 17:12:29 $
11  Version: $Revision: 1.3 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLCrosshairNode_h
16 #define __vtkMRMLCrosshairNode_h
17 
18 #include "vtkMRMLNode.h"
19 #include "vtkMRMLSliceNode.h"
20 
25 class VTK_MRML_EXPORT vtkMRMLCrosshairNode : public vtkMRMLNode
26 {
27  public:
28  static vtkMRMLCrosshairNode *New();
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
34  enum
35  {
36  CursorPositionModifiedEvent = 22000
37  };
38 
39  vtkMRMLNode* CreateNodeInstance() override;
40 
43  void ReadXMLAttributes( const char** atts) override;
44 
47  void WriteXML(ostream& of, int indent) override;
48 
52 
55  const char* GetNodeTagName() override {return "Crosshair";};
56 
59  vtkGetMacro (CrosshairMode, int );
60  vtkSetMacro (CrosshairMode, int );
61  static const char* GetCrosshairModeAsString(int id);
62  static int GetCrosshairModeFromString(const char* name);
63 
64  vtkSetClampMacro(CrosshairThickness, int, 1, 3);
65  vtkGetMacro(CrosshairThickness, int);
66  void SetCrosshairToFine() { this->SetCrosshairThickness(1); }
67  void SetCrosshairToMedium() { this->SetCrosshairThickness(2); }
68  void SetCrosshairToThick() { this->SetCrosshairThickness(3); }
69  static const char* GetCrosshairThicknessAsString(int id);
70  static int GetCrosshairThicknessFromString(const char* name);
71 
72  vtkGetVector3Macro(CrosshairColor, float);
73  vtkSetVector3Macro(CrosshairColor, float);
75 
78  vtkGetMacro (CrosshairBehavior, int );
79  vtkSetMacro (CrosshairBehavior, int );
80  static const char* GetCrosshairBehaviorAsString(int id);
81  static int GetCrosshairBehaviorFromString(const char* name);
83 
91  void SetCursorPositionRAS(double ras[3]);
92 
97  void SetCursorPositionXYZ(double xyz[3], vtkMRMLSliceNode *sliceNode);
98 
100  void SetCursorPositionInvalid();
101 
106  bool GetCursorPositionRAS(double ras[3]);
107 
112  vtkMRMLSliceNode* GetCursorPositionXYZ(double xyz[3]);
113 
116  vtkSetVector3Macro(CrosshairRAS, double);
117  vtkGetVector3Macro(CrosshairRAS, double);
118 
121  void SetCrosshairRAS(double ras[3], int id);
122 
124  vtkGetMacro(LightBoxPane, int);
125 
126 
129  void SetCrosshairName(const char *name) {
130  this->SetSingletonTag(name);
131  }
133  return this->GetSingletonTag();
134  }
135 
137  enum
138  {
139  NoCrosshair = 0,
146  CrosshairMode_Last
147  };
148  enum
149  {
150  Fine = 1,
153  CrosshairThickness_Last
154  };
156  enum
157  {
158  NoAction = 0,
159  OffsetJumpSlice = 1,
160  Normal = 1,
161  CenteredJumpSlice = 2,
162  JumpSlice = 2,
163  CrosshairBehavior_Last
164  };
165 
174  vtkSetMacro(FastPick3D, bool);
175  vtkGetMacro(FastPick3D, bool);
176  vtkBooleanMacro(FastPick3D, bool);
178 
179 protected:
181  ~vtkMRMLCrosshairNode() override;
183  void operator=(const vtkMRMLCrosshairNode&);
184 
185  int CrosshairMode{NoCrosshair};
186  int CrosshairThickness{Fine};
187  int CrosshairBehavior{OffsetJumpSlice};
188  float CrosshairColor[3]{1.0f, 0.8f, 0.1f}; // Light yellow
189 
190  double CrosshairRAS[3]{0.0, 0.0, 0.0};
191  int LightBoxPane{0};
192 
195  double CursorPositionRAS[3]{0.0, 0.0, 0.0};
198  double CursorPositionXYZ[3]{0.0, 0.0, 0.0};
202  vtkWeakPointer<vtkMRMLSliceNode> CursorSliceNode;
203 
205  bool CursorPositionRASValid{false};
206  bool FastPick3D{false};
207 };
208 
209 #endif
MRML node for storing a slice through RAS space.
MRML node for storing a crosshair through RAS space.
virtual void ReadXMLAttributes(const char **atts)
void operator=(const vtkMRMLNode &)
virtual vtkMRMLNode * CreateNodeInstance()=0
Create instance of the default node. Like New only virtual.
void SetCrosshairName(const char *name)
Name of the layout
virtual char * GetSingletonTag()
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
vtkWeakPointer< vtkMRMLSliceNode > CursorSliceNode
virtual void WriteXML(ostream &of, int indent)
void PrintSelf(ostream &os, vtkIndent indent) override
#define vtkMRMLCopyContentMacro(thisClassName)
Definition: vtkMRMLNode.h:142
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.