Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationSplineNode.h
Go to the documentation of this file.
1 #ifndef __vtkMRMLAnnotationSplineNode_h
2 #define __vtkMRMLAnnotationSplineNode_h
3 
5 
6 class vtkMRMLScene;
7 
9 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationSplineNode : public vtkMRMLAnnotationLinesNode
10 {
11 public:
14  // Description:
15  // Just prints short summary
16  void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) VTK_OVERRIDE;
17 
18  //--------------------------------------------------------------------------
19  // MRMLNode methods
20  //--------------------------------------------------------------------------
21 
22  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
23  // Description:
24  // Get node XML tag name (like Volume, Model)
25  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AnnotationRuler";}
26 
27  // Description:
28  // Read node attributes from XML file
29  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
30 
31  // Description:
32  // Write this node's information to a MRML file in XML format.
33  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
34 
35 
36  // Description:
37  // Copy the node's attributes to this object
38  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
39 
40  void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE;
41 
42  // Description:
43  // alternative method to propagate events generated in Display nodes
44  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
45  unsigned long /*event*/,
46  void * /*callData*/ ) VTK_OVERRIDE;
47 
48 
49  // Legacy code
50  // Description:
51  // get/set the first point position
52  double* GetPosition1() {return this->GetControlPointCoordinates(0);}
53 
54  // Description:
55  // get/set the distance annotation format, it's in standard sprintf notation
56  vtkGetStringMacro(DistanceAnnotationFormat);
57  vtkSetStringMacro(DistanceAnnotationFormat);
58 
59  // Description:
60  // KP Define - should be part of AnnotationRulerDisplayNode
61  double GetDistanceAnnotationScale();
62  void SetDistanceAnnotationScale(double init);
63 
64  // Description:
65  // get/set the distance annotation visbility
66  int GetDistanceAnnotationVisibility();
67  void SetDistanceAnnotationVisibility(int flag);
68 
69  int SetRuler(vtkIdType line1Id, int sel, int vis);
70 
71  // Description:
72  // get/set the resolution (number of subdivisions) of the line.
73  vtkGetMacro(Resolution, int);
74  vtkSetMacro(Resolution, int);
75 
76  // Description:
77  // get/set the point representation colour
78  double *GetPointColour();
79  void SetPointColour( double initColor[3]);
80 
81  // Description:
82  // get/set the line representation colour
83  double *GetLineColour();
84  void SetLineColour(double newColor[3]);
85 
86  // Description:
87  // get/set the distance annotation text colour
88  double *GetDistanceAnnotationTextColour();
89  void SetDistanceAnnotationTextColour(double initColor[3]);
90 
91  void Initialize(vtkMRMLScene* mrmlScene) VTK_OVERRIDE;
92 
93  double GetSplineMeasurement();
94  void SetSplineMeasurement(double val);
95 
96  int SetControlPoint(double newControl[3], int id);
97 
98  enum
99  {
100  SplineNodeAddedEvent = 0,
102  };
103 
104 
105 protected:
110 
111  // Description:
112  // number of subdivisions on the line
115 
116  int AddControlPoint(double newControl[3],int selectedFlag, int visibleFlag);
117 
119 
120 };
121 
122 #endif
void Initialize(vtkMRMLScene *mrmlScene) VTK_OVERRIDE
virtual void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1) VTK_OVERRIDE
int AddControlPoint(double newControl[3], int selectedFlag, int visibleFlag)
void operator=(const vtkMRMLAnnotationLinesNode &)
virtual void ReadXMLAttributes(const char **atts) VTK_OVERRIDE
Read node attributes from XML file
int SetControlPoint(int id, double newControl[3], int selectedFlag, int visibleFlag)
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE
Copy the node's attributes to this object.
virtual void WriteXML(ostream &of, int indent) VTK_OVERRIDE
Write this node's information to a MRML file in XML format.
double * GetControlPointCoordinates(vtkIdType id)
static vtkMRMLAnnotationLinesNode * New()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
virtual void ProcessMRMLEvents(vtkObject *, unsigned long, void *) VTK_OVERRIDE
alternative method to propagate events generated in Display nodes
void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE
Finds the storage node and read the data