Slicer  4.11
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) override;
20 
21  //--------------------------------------------------------------------------
22  // MRMLNode methods
23  //--------------------------------------------------------------------------
24 
25  vtkMRMLNode* CreateNodeInstance() override;
26  // Description:
27  // Get node XML tag name (like Volume, Model)
28  const char* GetNodeTagName() override {return "AnnotationBidimensional";}
29 
30  const char* GetIcon() override {return ":/Icons/AnnotationBidimensional.png";}
31 
32  // Description:
33  // Read node attributes from XML file
34  void ReadXMLAttributes( const char** atts) override;
35 
36  // Description:
37  // Write this node's information to a MRML file in XML format.
38  void WriteXML(ostream& of, int indent) override;
39 
40 
41  // Description:
42  // Copy the node's attributes to this object
43  void Copy(vtkMRMLNode *node) override;
44 
45  void UpdateScene(vtkMRMLScene *scene) override;
46 
47  // Description:
48  // alternative method to propagate events generated in Display nodes
49  void ProcessMRMLEvents ( vtkObject * /*caller*/,
50  unsigned long /*event*/,
51  void * /*callData*/ ) 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) 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
int SetControlPointWorldCoordinates(double newControl[3], int id)
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Display nodes
void operator=(const vtkMRMLAnnotationLinesNode &)
void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1) override
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
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:61
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void Copy(vtkMRMLNode *node) override
Copy the node&#39;s attributes to this object
static vtkMRMLAnnotationLinesNode * New()
void WriteXML(ostream &of, int indent) override
Write this node&#39;s information to a MRML file in XML format.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void Initialize(vtkMRMLScene *mrmlScene) override
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
virtual void TransformPointFromWorld(const double inWorld[3], double outLocal[3])