Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationBidimensionalNode.h
Go to the documentation of this file.
1 #ifndef __vtkMRMLAnnotationBidimensionalNode_h
2 #define __vtkMRMLAnnotationBidimensionalNode_h
3 
4 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
6 
7 class vtkMatrix4x4;
8 class vtkAbstractTransform;
9 class vtkMRMLScene;
10 
12 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationBidimensionalNode : public vtkMRMLAnnotationLinesNode
13 {
14 public:
17  // Description:
18  // Just prints short summary
19  void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) VTK_OVERRIDE;
20 
21  //--------------------------------------------------------------------------
22  // MRMLNode methods
23  //--------------------------------------------------------------------------
24 
25  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
26  // Description:
27  // Get node XML tag name (like Volume, Model)
28  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AnnotationBidimensional";}
29 
30  virtual const char* GetIcon() VTK_OVERRIDE {return ":/Icons/AnnotationBidimensional.png";}
31 
32  // Description:
33  // Read node attributes from XML file
34  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
35 
36  // Description:
37  // Write this node's information to a MRML file in XML format.
38  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
39 
40 
41  // Description:
42  // Copy the node's attributes to this object
43  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
44 
45  void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE;
46 
47  // Description:
48  // alternative method to propagate events generated in Display nodes
49  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
50  unsigned long /*event*/,
51  void * /*callData*/ ) VTK_OVERRIDE;
52 
53 
54  // Description:
55  // get/set the distance annotation format, it's in standard sprintf notation
56  vtkGetStringMacro(AnnotationFormat);
57  vtkSetStringMacro(AnnotationFormat);
58 
59  // Description:
60  // get/set the resolution (number of subdivisions) of the line.
61  vtkGetMacro(Resolution, int);
62  vtkSetMacro(Resolution, int);
63 
64  // Description:
65  // transform utility functions
66  void Initialize(vtkMRMLScene* mrmlScene) VTK_OVERRIDE;
67 
68  std::vector<double> GetBidimensionalMeasurement();
69  void SetBidimensionalMeasurement(double val1, double val2);
70 
71  int SetControlPoint(double newControl[3], int id);
72 
73  int SetControlPointWorldCoordinates(double newControl[3], int id)
74  {
75  double localPoint[4]={0,0,0,1};
76  this->TransformPointFromWorld(newControl, localPoint);
77  return this->SetControlPoint(localPoint, id);
78  }
79 
80  enum
81  {
82  BidimensionalNodeAddedEvent = 0,
84  };
85 
86 
87 protected:
92 
93  // Description:
94  // number of subdivisions on the line
97 
98  double measurement1;
99  double measurement2;
100 
101 };
102 
103 #endif
void Initialize(vtkMRMLScene *mrmlScene) VTK_OVERRIDE
virtual void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1) VTK_OVERRIDE
int SetControlPointWorldCoordinates(double newControl[3], int id)
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&#39;s attributes to this object.
virtual void WriteXML(ostream &of, int indent) VTK_OVERRIDE
Write this node&#39;s information to a MRML file in XML format.
virtual const char * GetIcon() VTK_OVERRIDE
static vtkMRMLAnnotationLinesNode * New()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
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.
virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3])