Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationTextNode.h
Go to the documentation of this file.
1 // .NAME vtkMRMLAnnotationTextNode - MRML node to represent a text.
2 // .SECTION Description
3 // Annotation nodes contains control points, internally represented as vtkPolyData.
4 // A Annotation node contains many control points and forms the smallest logical unit of tractography
5 // that MRML will manage/read/write. Each control point has accompanying data.
6 // Visualization parameters for these nodes are controlled by the vtkMRMLAnnotationPointDisplayNode class.
7 //
8 
9 #ifndef __vtkMRMLAnnotationTextNode_h
10 #define __vtkMRMLAnnotationTextNode_h
11 
12 #include "vtkSlicerAnnotationsModuleMRMLExport.h"
14 
15 #include <vtkStdString.h>
16 class vtkStringArray;
17 
19 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationTextNode : public vtkMRMLAnnotationControlPointsNode
20 {
21 public:
24 
25  //--------------------------------------------------------------------------
26  // MRMLNode methods
27  //--------------------------------------------------------------------------
28 
29  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
30  // Description:
31  // Get node XML tag name (like Volume, Model)
32  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AnnotationText";}
33 
34  virtual const char* GetIcon() VTK_OVERRIDE {return ":/Icons/AnnotationText.png";}
35 
36  int SetTextCoordinates(double newCoord[3]) {return this->SetControlPoint(0,newCoord,1,1);}
37  double* GetTextCoordinates() {return this->GetControlPointCoordinates(0);}
38 
39  // normalized viewport coordinates of the lower left of the text box for the caption widget
40  int SetCaptionCoordinates(double x, double y);
41  int SetCaptionCoordinates(double newCoord[2]);
43 
44  void SetTextLabel(const char* newLabel) {this->SetText(0, newLabel, 1, 1);}
45  vtkStdString GetTextLabel() {return this->GetText(0);}
46 
47  enum
48  {
49  TextNodeAddedEvent = 0,
51  };
52 
53 protected:
58 
59 };
60 
61 #endif
int SetTextCoordinates(double newCoord[3])
static vtkMRMLAnnotationControlPointsNode * New()
void SetTextLabel(const char *newLabel)
vtkStdString GetText(int id)
virtual const char * GetIcon() VTK_OVERRIDE
double * GetControlPointCoordinates(vtkIdType id)
virtual vtkMRMLNode * CreateNodeInstance() VTK_OVERRIDE
MRMLNode methods.
void SetText(int id, const char *newText, int selectedFlag, int visibleFlag)
void operator=(const vtkMRMLAnnotationControlPointsNode &)
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
int SetControlPoint(int id, double newControl[3], int selectedFlag, int visibleFlag)