Slicer  4.8
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);
25  // Description:
26  // Just prints short summary
27  virtual void PrintAnnotationInfo(ostream& os, vtkIndent indent, int titleFlag = 1) VTK_OVERRIDE;
28 
29  //--------------------------------------------------------------------------
30  // MRMLNode methods
31  //--------------------------------------------------------------------------
32 
33  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
34  // Description:
35  // Get node XML tag name (like Volume, Model)
36  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AnnotationControlPoints";}
37 
38  // Description:
39  // Read node attributes from XML file
40  virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;
41 
42  // Description:
43  // Write this node's information to a MRML file in XML format.
44  virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;
45 
50  virtual void WriteCLI(std::vector<std::string>& commandLine,
51  std::string prefix, int coordinateSystem = 0,
52  int multipleFlag = 1) VTK_OVERRIDE;
53 
54  // Description:
55  // Copy the node's attributes to this object
56  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE {Superclass::Copy(node);}
57 
58  void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE;
59 
60  // Description:
61  // alternative method to propagate events generated in Display nodes
62  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
63  unsigned long /*event*/,
64  void * /*callData*/ ) VTK_OVERRIDE;
65 
66 
67  enum
68  {
69  ControlPointModifiedEvent = 19010,
70  };
71 
72  virtual void Modified() VTK_OVERRIDE
73  {
75 
76  if (!this->GetDisableModifiedEvent())
77  {
79  }
80  }
81 
86  virtual int InvokePendingModifiedEvent () VTK_OVERRIDE
87  {
88  if ( this->GetModifiedEventPending() )
89  {
91  }
93  }
94 
95  // Description:
96  // get associated display node or NULL if not set
97  vtkMRMLAnnotationPointDisplayNode* GetAnnotationPointDisplayNode();
98 
99  // Description:
100  // Create default storage node or NULL if does not have one
101  virtual vtkMRMLStorageNode* CreateDefaultStorageNode() VTK_OVERRIDE;
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) VTK_OVERRIDE;
131 
132 
133  // Description:
134  // Initializes all variables associated with annotations
135  virtual void ResetAnnotations() VTK_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  virtual void Initialize(vtkMRMLScene* mrmlScene) VTK_OVERRIDE;
162 
163 protected:
168 
169  // Description:
170  // Create Poly data with substructures necessary for this class
171  void CreatePolyData();
172 
173  // Description:
174  // Initializes control pointes 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 void ReadXMLAttributes(const char **atts) VTK_OVERRIDE
Read node attributes from XML file.
virtual int InvokePendingModifiedEvent()
Invokes any modified events that are pending.
Definition: vtkMRMLNode.h:449
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE
Copy the node&#39;s attributes to this object.
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE
Copy the node&#39;s attributes to this object.
virtual void WriteCLI(std::vector< std::string > &vtkNotUsed(commandLine), std::string vtkNotUsed(prefix), int vtkNotUsed(coordinateSystemFlag)=0, int vtkNotUsed(multipleFlag)=1)
void UpdateScene(vtkMRMLScene *scene) VTK_OVERRIDE
Finds the storage node and read the data.
virtual int GetDisableModifiedEvent()
Turn on/off generating InvokeEvent for set macros.
virtual void WriteXML(ostream &of, int indent) VTK_OVERRIDE
Write this node&#39;s information to a MRML file in XML format.
int NumberingScheme
How the next annotation will be numbered in it&#39;s Text field.
A set of MRML Nodes that supports serialization and undo/redo.
Definition: vtkMRMLScene.h:54
void operator=(const vtkMRMLAnnotationNode &)
virtual const char * GetAttributeTypesEnumAsString(int val)
virtual void ProcessMRMLEvents(vtkObject *, unsigned long, void *) VTK_OVERRIDE
alternative method to propagate events generated in Display nodes
A supercalss 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)
virtual vtkMRMLStorageNode * CreateDefaultStorageNode() VTK_OVERRIDE
virtual void Modified() VTK_OVERRIDE
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent.
Definition: vtkMRMLNode.h:430
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
virtual void ResetAnnotations()
virtual void Modified() VTK_OVERRIDE
Customized version of Modified() allowing to compress vtkCommand::ModifiedEvent.