Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLAnnotationControlPointsNode.h
Go to the documentation of this file.
1 // .NAME vtkMRMLAnnotationControlPointsNode - MRML node to represent a fiber bundle from tractography in DTI data.
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 __vtkMRMLAnnotationControlPointsNode_h
10 #define __vtkMRMLAnnotationControlPointsNode_h
11 
12 #include "vtkMRMLAnnotationNode.h"
13 
15 
17 class VTK_SLICER_ANNOTATIONS_MODULE_MRML_EXPORT vtkMRMLAnnotationControlPointsNode
18  : public vtkMRMLAnnotationNode
19 {
20 public:
23 
24  // void PrintSelf(ostream& os, vtkIndent indent) override;
25  // Description:
26  // Just prints short summary
27  void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) override;
28 
29  //--------------------------------------------------------------------------
30  // MRMLNode methods
31  //--------------------------------------------------------------------------
32 
33  vtkMRMLNode* CreateNodeInstance() override;
34  // Description:
35  // Get node XML tag name (like Volume, Model)
36  const char* GetNodeTagName() override {return "AnnotationControlPoints";}
37 
38  // Description:
39  // Read node attributes from XML file
40  void ReadXMLAttributes( const char** atts) override;
41 
42  // Description:
43  // Write this node's information to a MRML file in XML format.
44  void WriteXML(ostream& of, int indent) override;
45 
50  void WriteCLI(std::vector<std::string>& commandLine,
51  std::string prefix, int coordinateSystem = 0,
52  int multipleFlag = 1) override;
53 
57 
58  void UpdateScene(vtkMRMLScene *scene) override;
59 
60  // Description:
61  // alternative method to propagate events generated in Display nodes
62  void ProcessMRMLEvents ( vtkObject * /*caller*/,
63  unsigned long /*event*/,
64  void * /*callData*/ ) override;
65 
66 
67  enum
68  {
69  ControlPointModifiedEvent = 19010,
70  };
71 
72  void Modified() override
73  {
75 
76  if (!this->GetDisableModifiedEvent())
77  {
79  }
80  }
81 
87  {
88  if ( this->GetModifiedEventPending() )
89  {
91  }
93  }
94 
95  // Description:
96  // get associated display node or nullptr if not set
97  vtkMRMLAnnotationPointDisplayNode* GetAnnotationPointDisplayNode();
98 
99  // Description:
100  // Create default storage node or nullptr if does not have one
102 
103  int AddControlPoint(double newControl[3],int selectedFlag, int visibleFlag);
104 
105  int SetControlPoint(int id, double newControl[3],int selectedFlag, int visibleFlag);
106 
107  int SetControlPointWorldCoordinates(int id, double newControl[3], int selectedFlag, int visibleFlag);
108 
109  int SetControlPoint(int id, double newControl[3]);
110 
111  int SetControlPointWorldCoordinates(int id, double newControl[3]);
112 
113  void DeleteControlPoint(int id);
117  double* GetControlPointCoordinates(vtkIdType id);
118 
119  void GetControlPointWorldCoordinates(vtkIdType id, double *point);
120 
121  int GetNumberOfControlPoints();
122 
123  enum
124  {
127  NUM_CP_ATTRIBUTE_TYPES
128  };
129 
130  const char *GetAttributeTypesEnumAsString(int val) override;
131 
132 
133  // Description:
134  // Initializes all variables associated with annotations
135  void ResetAnnotations() override;
136 
137  // Description:
138  // add display node if not already present
139  void CreateAnnotationPointDisplayNode();
140 
143  {
144  SchemeMin = 0,
145  UseID = SchemeMin,
148  SchemeMax = UsePrevious,
149  };
150 
151 
153  virtual void SetNumberingScheme(int numberingScheme);
154  vtkGetMacro(NumberingScheme, int);
155 
157  const char* GetNumberingSchemeAsString();
158  const char* GetNumberingSchemeAsString(int g);
159  void SetNumberingSchemeFromString(const char *schemeString);
160 
161  void Initialize(vtkMRMLScene* mrmlScene) override;
162 
163 protected:
165  ~vtkMRMLAnnotationControlPointsNode() override = default;
168 
169  // Description:
170  // Create Poly data with substructures necessary for this class
171  void CreatePolyData();
172 
173  // Description:
174  // Initializes control points as well as attributes
175  void ResetControlPoints();
176 
177  // Description:
178  // Initializes all attributes
179  void ResetControlPointsAttributesAll();
180 
183 };
184 
185 #endif
NumberingSchemes
flags to determine how the next fiducial added to the list is labelled
virtual int InvokePendingModifiedEvent()
Invokes any modified events that are pending.
Definition: vtkMRMLNode.h:534
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
virtual int GetDisableModifiedEvent()
Turn on/off generating InvokeEvent for set macros.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
int NumberingScheme
How the next annotation will be numbered in it&#39;s Text field.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Display nodes
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
virtual void WriteCLI(std::vector< std::string > &vtkNotUsed(commandLine), std::string vtkNotUsed(prefix), int vtkNotUsed(coordinateSystemFlag)=vtkMRMLStorageNode::CoordinateSystemRAS, int vtkNotUsed(multipleFlag)=1)
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:57
void operator=(const vtkMRMLAnnotationNode &)
void UpdateScene(vtkMRMLScene *scene) override
Finds the storage node and read the data
virtual const char * GetAttributeTypesEnumAsString(int val)
A superclass for other storage nodes.
virtual int GetModifiedEventPending()
static vtkMRMLAnnotationNode * New()
virtual void Initialize(vtkMRMLScene *mrmlScene)
virtual void PrintAnnotationInfo(ostream &os, vtkIndent indent, int titleFlag=1)
vtkMRMLStorageNode * CreateDefaultStorageNode() override
#define vtkMRMLCopyContentDefaultMacro(thisClassName)
Definition: vtkMRMLNode.h:155
void Modified() override
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent.
Definition: vtkMRMLNode.h:515
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
virtual void ResetAnnotations()