Slicer  5.0
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);
72 
75  vtkGetMacro (CrosshairBehavior, int );
76  vtkSetMacro (CrosshairBehavior, int );
77  static const char* GetCrosshairBehaviorAsString(int id);
78  static int GetCrosshairBehaviorFromString(const char* name);
80 
88  void SetCursorPositionRAS(double ras[3]);
89 
94  void SetCursorPositionXYZ(double xyz[3], vtkMRMLSliceNode *sliceNode);
95 
97  void SetCursorPositionInvalid();
98 
103  bool GetCursorPositionRAS(double ras[3]);
104 
109  vtkMRMLSliceNode* GetCursorPositionXYZ(double xyz[3]);
110 
113  vtkSetVector3Macro(CrosshairRAS, double);
114  vtkGetVector3Macro(CrosshairRAS, double);
115 
118  void SetCrosshairRAS(double ras[3], int id);
119 
121  vtkGetMacro(LightBoxPane, int);
122 
123 
126  void SetCrosshairName(const char *name) {
127  this->SetSingletonTag(name);
128  }
130  return this->GetSingletonTag();
131  }
132 
134  enum
135  {
136  NoCrosshair = 0,
143  CrosshairMode_Last
144  };
145  enum
146  {
147  Fine = 1,
150  CrosshairThickness_Last
151  };
153  enum
154  {
155  NoAction = 0,
156  OffsetJumpSlice = 1,
157  Normal = 1,
158  CenteredJumpSlice = 2,
159  JumpSlice = 2,
160  CrosshairBehavior_Last
161  };
162 
171  vtkSetMacro(FastPick3D, bool);
172  vtkGetMacro(FastPick3D, bool);
173  vtkBooleanMacro(FastPick3D, bool);
175 
176 protected:
178  ~vtkMRMLCrosshairNode() override;
180  void operator=(const vtkMRMLCrosshairNode&);
181 
182  int CrosshairMode{NoCrosshair};
183  int CrosshairThickness{Fine};
184  int CrosshairBehavior{OffsetJumpSlice};
185 
186  double CrosshairRAS[3]{0.0, 0.0, 0.0};
187  int LightBoxPane{0};
188 
191  double CursorPositionRAS[3]{0.0, 0.0, 0.0};
194  double CursorPositionXYZ[3]{0.0, 0.0, 0.0};
198  vtkWeakPointer<vtkMRMLSliceNode> CursorSliceNode;
199 
201  bool CursorPositionRASValid{false};
202  bool FastPick3D{false};
203 };
204 
205 #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.