Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLMarkupsNode.h
Go to the documentation of this file.
1 /*==============================================================================
2 
3  Program: 3D Slicer
4 
5  Portions (c) Copyright Brigham and Women's Hospital (BWH) All Rights Reserved.
6 
7  See COPYRIGHT.txt
8  or http://www.slicer.org/copyright/copyright.txt for details.
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 ==============================================================================*/
17 
18 #ifndef __vtkMRMLMarkupsNode_h
19 #define __vtkMRMLMarkupsNode_h
20 
21 // MRML includes
22 #include "vtkMRMLDisplayableNode.h"
23 #include "vtkCurveGenerator.h"
24 #include "vtkMRMLMeasurement.h"
25 #include "vtkMRMLSelectionNode.h"
26 
27 // Markups includes
28 #include "vtkSlicerMarkupsModuleMRMLExport.h"
29 
30 // VTK includes
31 #include <vtkPointLocator.h>
32 #include <vtkSmartPointer.h>
33 #include <vtkVector.h>
34 
35 class vtkMatrix3x3;
36 class vtkMRMLUnitNode;
37 class vtkParallelTransportFrame;
38 
66 
67 class vtkAlgorithmOutput;
68 class vtkCollection;
69 class vtkDataArray;
70 class vtkGeneralTransform;
71 class vtkMatrix4x4;
73 class vtkPolyData;
74 class vtkStringArray;
75 class vtkTransformPolyDataFilter;
76 
77 class VTK_SLICER_MARKUPS_MODULE_MRML_EXPORT vtkMRMLMarkupsNode : public vtkMRMLDisplayableNode
78 {
83 
84 public:
85 
86  struct ControlPoint
87  {
89  {
90  // position is 0
91  this->Position[0] = 0.0;
92  this->Position[1] = 0.0;
93  this->Position[2] = 0.0;
94 
95  this->OrientationMatrix[0] = 1.0;
96  this->OrientationMatrix[1] = 0.0;
97  this->OrientationMatrix[2] = 0.0;
98 
99  this->OrientationMatrix[3] = 0.0;
100  this->OrientationMatrix[4] = 1.0;
101  this->OrientationMatrix[5] = 0.0;
102 
103  this->OrientationMatrix[6] = 0.0;
104  this->OrientationMatrix[7] = 0.0;
105  this->OrientationMatrix[8] = 1.0;
106 
107  Selected = true;
108  Locked = false;
109  Visibility = true;
110  PositionStatus = PositionUndefined;
111  AutoCreated = false;
112  }
113 
114  // Positions and orientation in local coordinates.
115  // If transform is applied to the markup node then world
116  // coordinates may be obtained by applying "to world" transform.
117  double Position[3];
118  // Orientation of control point in 3x3 matrix.
119  // x axis (0, 3, 6), y axis (1, 4, 7), and z axis (2, 5, 8).
120  double OrientationMatrix[9];
121 
122  std::string ID;
123  std::string Label;
124  std::string Description;
125  std::string AssociatedNodeID;
126 
127  bool Selected;
128  bool Locked;
132  };
133 
134  typedef std::vector<ControlPoint*> ControlPointsListType;
135 
137 
138  void PrintSelf(ostream& os, vtkIndent indent) override;
139 
140  virtual const char* GetIcon() {return ":/Icons/MarkupsGeneric.png";}
141  virtual const char* GetAddIcon() {return ":/Icons/MarkupsGenericMouseModePlace.png";}
142  virtual const char* GetPlaceAddIcon() {return ":/Icons/MarkupsGenericMouseModePlaceAdd.png";}
143 
144  //--------------------------------------------------------------------------
145  // MRMLNode methods
146  //--------------------------------------------------------------------------
147 
150  virtual const char* GetMarkupType() {return "Markup";};
151 
153  virtual const char* GetDefaultNodeNamePrefix() {return "M";};
154 
156  void ReadXMLAttributes(const char** atts) override;
157 
159  void WriteXML(ostream& of, int indent) override;
160 
165  void WriteCLI(std::vector<std::string>& commandLine,
166  std::string prefix, int coordinateSystem = vtkMRMLStorageNode::CoordinateSystemRAS,
167  int multipleFlag = 1) override;
168 
172 
174  void ProcessMRMLEvents ( vtkObject * /*caller*/,
175  unsigned long /*event*/,
176  void * /*callData*/ ) override;
177 
181  int EndModify(int previousDisableModifiedEventState) override;
182 
185 
187  void CreateDefaultDisplayNodes() override;
188 
190 
194  int GetNumberOfMeasurements();
195  int GetNumberOfEnabledMeasurements();
196  vtkMRMLMeasurement* GetNthMeasurement(int id);
197  vtkMRMLMeasurement* GetMeasurement(const char* name);
198  void AddMeasurement(vtkMRMLMeasurement* measurement);
199  void RemoveNthMeasurement(int id);
200  void ClearValueForAllMeasurements();
202 
205  void UpdateAllMeasurements();
206 
208 
217  void SetNthMeasurement(int id, vtkMRMLMeasurement* measurement);
218  void SetNthMeasurement(int id, const std::string& name, double value, const std::string &units,
219  std::string printFormat = "", const std::string description = "",
220  vtkCodedEntry* quantityCode = nullptr, vtkCodedEntry* derivationCode = nullptr,
221  vtkCodedEntry* unitsCode = nullptr, vtkCodedEntry* methodCode = nullptr);
222  void RemoveAllMeasurements();
224 
232  enum
233  {
234  LockModifiedEvent = 19000,
238  PointPositionDefinedEvent,
239  PointPositionUndefinedEvent,
249  };
250 
252  enum
253  {
258  PositionStatus_Last
259  };
260 
261  static const char* GetPositionStatusAsString(int id);
262  static int GetPositionStatusFromString(const char* name);
263 
265  virtual void RemoveAllControlPoints();
266  virtual void UnsetAllControlPoints();
267 
276  vtkGetMacro(Locked, int);
277  void SetLocked(int locked);
278  vtkBooleanMacro(Locked, int);
280 
282  vtkMRMLMarkupsDisplayNode *GetMarkupsDisplayNode();
283 
285  bool ControlPointExists(int n);
286 
288  int GetNumberOfControlPoints();
290  int GetNumberOfDefinedControlPoints(bool includePreview=false);
292  int GetNumberOfUndefinedControlPoints(bool includePreview = false);
293 
295  ControlPoint* GetNthControlPoint(int n);
297  std::vector<ControlPoint*>* GetControlPoints();
298 
306  int AddNControlPoints(int n, std::string label = std::string(), vtkVector3d* point = nullptr);
307  int AddNControlPoints(int n, std::string label, double point[3]);
309 
315  void SetControlPointPositionsWorld(vtkPoints* points);
316 
318  void GetControlPointPositionsWorld(vtkPoints* points);
319 
322  int AddControlPoint(vtkVector3d point, std::string label = std::string());
323  int AddControlPoint(double point[3], std::string label = std::string());
324  int AddControlPoint(double x, double y, double z, std::string label = std::string());
326 
332  int AddControlPoint(ControlPoint *controlPoint, bool autoLabel=true);
333 
337  int AddControlPointWorld(vtkVector3d point, std::string label = std::string());
338  int AddControlPointWorld(double point[3], std::string label = std::string());
339  int AddControlPointWorld(double x, double y, double z, std::string label = std::string());
341 
349  bool InsertControlPoint(ControlPoint* controlPoint, int targetIndex);
350  bool InsertControlPoint(int n, vtkVector3d point, std::string label = std::string());
351  bool InsertControlPoint(int n, double point[3], std::string label = std::string());
353 
355  //Add and insert control point at index, defined in the world coordinate system.
356  //\sa InsertControlPoint
357  bool InsertControlPointWorld(int n, vtkVector3d pointWorld, std::string label = std::string());
358  bool InsertControlPointWorld(int n, double pointWorld[3], std::string label = std::string());
360 
362  void RemoveNthControlPoint(int pointIndex);
363 
365  void SwapControlPoints(int m1, int m2);
366 
369  bool GetNthControlPointAutoCreated(int n);
370  void SetNthControlPointAutoCreated(int n, bool flag);
372 
376  void GetNthControlPointPosition(int pointIndex, double point[3]);
377  double* GetNthControlPointPosition(int pointIndex) VTK_SIZEHINT(3);
379 
382  // Note: this method is not redundant because GetNthControlPointPosition returns a double*
383  // (as it is safe to do so) and so the method that returns a vtkVector3d cannot have the same name.
384  vtkVector3d GetNthControlPointPositionVector(int pointIndex);
385 
389  int GetNthControlPointPositionWorld(int pointIndex, double worldxyz[3]);
390  vtkVector3d GetNthControlPointPositionWorld(int pointIndex);
392 
393 
396  void SetNthControlPointPosition(const int pointIndex, const double x, const double y, const double z, int positionStatus = PositionDefined);
397  void SetNthControlPointPosition(const int pointIndex, const double position[3], int positionStatus = PositionDefined);
399 
404  void SetNthControlPointPositionWorld(const int pointIndex, const double x, const double y, const double z, int positionStatus = PositionDefined);
405  void SetNthControlPointPositionWorld(const int pointIndex, const double position[3], int positionStatus = PositionDefined);
407 
411  void SetNthControlPointPositionOrientationWorld(const int pointIndex,
412  const double pos[3], const double orientationMatrix[9], const char* associatedNodeID, int positionStatus = PositionDefined);
413 
417  void SetNthControlPointOrientation(int n, double w, double x, double y, double z);
418  void SetNthControlPointOrientation(int n, const double wxyz[4]);
420 
423  void GetNthControlPointOrientation(int n, double orientationWXYZ[4]);
424 
428  double* GetNthControlPointOrientationMatrix(int n) VTK_SIZEHINT(9);
429  void SetNthControlPointOrientationMatrix(int n, double orientationMatrix[9]);
431 
434  void GetNthControlPointOrientationMatrix(int n, vtkMatrix3x3* matrix);
435  void SetNthControlPointOrientationMatrix(int n, vtkMatrix3x3* matrix);
437 
441  void GetNthControlPointOrientationMatrixWorld(int n, double orientationMatrix[9]);
442  vtkVector<double, 9> GetNthControlPointOrientationMatrixWorld(int n);
443  void SetNthControlPointOrientationMatrixWorld(int n, const double orientationMatrix[9]);
445 
448  void GetNthControlPointOrientationMatrixWorld(int n, vtkMatrix3x3* matrix);
449  void SetNthControlPointOrientationMatrixWorld(int n, vtkMatrix3x3* matrix);
451 
453  int GetNthControlPointPositionStatus(int pointIndex);
454 
459  int GetNthControlPointIndexByPositionStatus(int pointIndex, int positionStatus);
460 
462  void UnsetNthControlPointPosition(int pointIndex);
463 
465  void SetNthControlPointPositionMissing(int pointIndex);
466 
468  void ResetNthControlPointPosition(int n);
469 
471  void RestoreNthControlPointPosition(int n);
472 
476  vtkVector3d GetCenterOfRotation();
477 
481  bool GetCenterOfRotation(double point[3]);
482 
486  // \sa GetCenterOfRotation
487  bool GetCenterOfRotationWorld(double worldxyz[3]);
488 
492  void SetCenterOfRotation(const double x, const double y, const double z);
493  void SetCenterOfRotation(const double position[3]);
495 
499  void SetCenterOfRotationWorld(const double x, const double y, const double z);
500  void SetCenterOfRotationWorld(const double positionWorld[3]);
502 
505  void GetNthControlPointNormal(int n, double normal[3]);
506  vtkVector3d GetNthControlPointNormal(int n);
508 
511  void GetNthControlPointNormalWorld(int n, double normalWorld[3]);
512  vtkVector3d GetNthControlPointNormalWorld(int n);
514 
517  std::string GetNthControlPointAssociatedNodeID(int n = 0);
518  void SetNthControlPointAssociatedNodeID(int n, std::string id);
520 
522  std::string GetNthControlPointID(int n);
523 
525  int GetNthControlPointIndexByID(const char* controlPointID);
527  ControlPoint* GetNthControlPointByID(const char* controlPointID);
528 
531  bool GetNthControlPointSelected(int n = 0);
534  void SetNthControlPointSelected(int n, bool flag);
535 
538  bool GetNthControlPointLocked(int n = 0);
545  void SetNthControlPointLocked(int n, bool flag);
546 
549  bool GetNthControlPointVisibility(int n = 0);
550 
554  bool GetNthControlPointPositionVisibility(int n = 0);
555 
563  void SetNthControlPointVisibility(int n, bool flag);
564 
567  std::string GetNthControlPointLabel(int n = 0);
568  void SetNthControlPointLabel(int n, std::string label);
570 
572  void GetControlPointLabels(vtkStringArray* labels);
573 
577  std::string GetNthControlPointDescription(int n = 0);
578  void SetNthControlPointDescription(int n, std::string description);
580 
583  bool CanApplyNonLinearTransforms()const override;
584 
587  void ApplyTransform(vtkAbstractTransform* transform) override;
588 
597  std::string GetControlPointLabelFormat();
598  void SetControlPointLabelFormat(std::string format);
600 
605  std::string ReplaceListNameInControlPointLabelFormat();
606 
614  bool GetModifiedSinceRead() override;
615 
619  bool ResetNthControlPointID(int n);
620 
625  bool GetFixedNumberOfControlPoints();
626  void SetFixedNumberOfControlPoints(bool fixed);
628 
632  vtkGetMacro(RequiredNumberOfControlPoints, int);
633 
642  vtkGetMacro(MaximumNumberOfControlPoints, int);
643 
647  static void ConvertOrientationMatrixToWXYZ(const double orientationMatrix[9], double orientationWXYZ[4]);
648  static void ConvertOrientationWXYZToMatrix(const double orientationWXYZ[4], double orientationMatrix[9]);
650 
653  virtual vtkPoints* GetCurvePoints();
654  virtual vtkPoints* GetCurvePointsWorld();
655  virtual vtkPolyData* GetCurve();
656  virtual vtkPolyData* GetCurveWorld();
657  virtual vtkAlgorithmOutput* GetCurveWorldConnection();
659 
661  int GetControlPointIndexFromInterpolatedPointIndex(vtkIdType interpolatedPointIndex);
662 
664  vtkGetMacro(CurveClosed, bool);
665 
669  vtkCurveGenerator* GetCurveGenerator() { return this->CurveGenerator.GetPointer(); };
670 
671  void GetRASBounds(double bounds[6]) override;
672  void GetBounds(double bounds[6]) override;
673 
676  int GetClosestControlPointIndexToPositionWorld(double pos[3], bool visibleOnly=false);
677 
679  virtual vtkMatrix4x4* GetInteractionHandleToWorldMatrix();
680 
683  virtual std::string GetPropertiesLabelText();
684 
686  vtkMRMLUnitNode* GetUnitNode(const char* quantity);
687 
690  virtual void UpdateAssignedAttribute() {};
691 
693  virtual bool GetControlPointPlacementComplete();
694 
702  int GetControlPointPlacementStartIndex();
703  void SetControlPointPlacementStartIndex(int);
705 
710  vtkGetMacro(LastUsedControlPointNumber, int);
711  vtkSetMacro(LastUsedControlPointNumber, int);
713 
714  //-----------------------------------------------------------
715  // All public methods below are deprecated
716  //
717  // These methods are either deprecated because they use old terms (markup instead of control point),
718  // or include "array", "vector", "pointer" in the name (it is redundant, as input arguments can be
719  // deduced from the type; and return type for vectors is always vtkVectorNd).
720  //
721 
724  {
725  vtkWarningMacro("vtkMRMLMarkupsNode::RemoveAllMarkups method is deprecated, please use RemoveAllControlPoints instead");
726  this->RemoveAllControlPoints();
727  };
728 
730  bool MarkupExists(int n)
731  {
732  vtkWarningMacro("vtkMRMLMarkupsNode::MarkupExists method is deprecated, please use ControlPointExists instead");
733  return this->ControlPointExists(n);
734  };
735 
738  {
739  vtkWarningMacro("vtkMRMLMarkupsNode::GetNumberOfMarkups method is deprecated, please use GetNumberOfControlPoints instead");
740  return this->GetNumberOfControlPoints();
741  };
744  {
745  vtkWarningMacro("vtkMRMLMarkupsNode::GetNumberOfPointsInNthMarkup method is deprecated, please use GetNumberOfControlPoints instead");
746  return this->GetNumberOfControlPoints();
747  };
748 
750  vtkVector3d GetMarkupPointVector(int markupIndex, int)
751  {
752  vtkWarningMacro("vtkMRMLMarkupsNode::GetMarkupPointVector method is deprecated, please use GetNthControlPointPositionVector instead");
753  return this->GetNthControlPointPositionVector(markupIndex);
754  };
755 
757  void GetMarkupPoint(int markupIndex, int pointIndex, double point[3]);
758 
760  void RemoveMarkup(int pointIndex)
761  {
762  vtkWarningMacro("vtkMRMLMarkupsNode::RemoveMarkup method is deprecated, please use RemoveNthControlPoint instead");
763  this->RemoveNthControlPoint(pointIndex);
764  };
765 
769  void SetNthControlPointPositionFromPointer(const int pointIndex, const double* pos);
770 
773  void SetNthControlPointPositionFromArray(const int pointIndex, const double pos[3], int positionStatus = PositionDefined)
774  {
775  vtkWarningMacro("vtkMRMLMarkupsNode::SetNthControlPointPositionFromArray method is deprecated, please use SetNthControlPointPosition instead");
776  this->SetNthControlPointPosition(pointIndex, pos[0], pos[1], pos[2], positionStatus);
777  }
778 
782  void SetNthControlPointPositionWorldFromArray(const int pointIndex, const double pos[3], int positionStatus = PositionDefined);
783 
789  const double positionWorld[3], const double orientationMatrix_World[9],
790  const char* associatedNodeID, int positionStatus = PositionDefined)
791  {
792  vtkWarningMacro("vtkMRMLMarkupsNode::SetNthControlPointPositionOrientationWorldFromArray method is deprecated,"
793  << " please use SetNthControlPointPositionOrientationWorld instead");
794  this->SetNthControlPointPositionOrientationWorld(
795  pointIndex, positionWorld, orientationMatrix_World, associatedNodeID, positionStatus);
796  }
797 
803  vtkVector4d GetNthControlPointOrientationVector(int pointIndex);
804 
809  {
810  vtkWarningMacro("vtkMRMLMarkupsNode::GetCenterOfRotationVector method is deprecated, please use GetCenterOfRotation instead");
811  return this->GetCenterOfRotation();
812  }
813 
817  void SetCenterOfRotationFromPointer(const double* pos);
821  void SetCenterOfRotationFromArray(const double pos[3])
822  {
823  vtkWarningMacro("vtkMRMLMarkupsNode::SetCenterOfRotationFromArray method is deprecated, please use SetCenterOfRotation instead");
824  this->SetCenterOfRotation(pos[0], pos[1], pos[2]);
825  }
826 
831  void SetNthControlPointOrientationFromPointer(int n, const double* orientationWXYZ);
832  void SetNthControlPointOrientationFromArray(int n, const double orientationWXYZ[4])
833  {
834  vtkWarningMacro("vtkMRMLMarkupsNode::SetNthControlPointOrientationFromArray method is deprecated, please use SetNthControlPointOrientation instead");
835  this->SetNthControlPointOrientation(n, orientationWXYZ[0], orientationWXYZ[1], orientationWXYZ[2], orientationWXYZ[3]);
836  }
838 
840  std::string GetNthMarkupAssociatedNodeID(int n = 0)
841  {
842  vtkWarningMacro("vtkMRMLMarkupsNode::GetNthMarkupAssociatedNodeID method is deprecated, please use GetNthControlPointAssociatedNodeID instead");
843  return this->GetNthControlPointAssociatedNodeID(n);
844  };
846  void SetNthMarkupAssociatedNodeID(int n, std::string id)
847  {
848  vtkWarningMacro("vtkMRMLMarkupsNode::SetNthMarkupAssociatedNodeID method is deprecated, please use SetNthControlPointAssociatedNodeID instead");
849  this->SetNthControlPointAssociatedNodeID(n, id);
850  };
851 
853  std::string GetNthMarkupID(int n = 0)
854  {
855  vtkWarningMacro("vtkMRMLMarkupsNode::GetNthMarkupID method is deprecated, please use GetNthControlPointID instead");
856  return this->GetNthControlPointID(n);
857  };
858 
860  bool GetNthMarkupLocked(int n = 0)
861  {
862  vtkWarningMacro("vtkMRMLMarkupsNode::GetNthMarkupLocked method is deprecated, please use GetNthControlPointLocked instead");
863  return this->GetNthControlPointLocked(n);
864  };
866  void SetNthMarkupLocked(int n, bool flag)
867  {
868  vtkWarningMacro("vtkMRMLMarkupsNode::SetNthMarkupLocked method is deprecated, please use SetNthControlPointLocked instead");
869  this->SetNthControlPointLocked(n, flag);
870  };
871 
873  std::string GetNthMarkupLabel(int n = 0)
874  {
875  vtkWarningMacro("vtkMRMLMarkupsNode::GetNthMarkupLabel method is deprecated, please use GetNthControlPointLabel instead");
876  return this->GetNthControlPointLabel(n);
877  };
879  void SetNthMarkupLabel(int n, std::string label)
880  {
881  vtkWarningMacro("vtkMRMLMarkupsNode::SetNthMarkupLabel method is deprecated, please use SetNthControlPointLabel instead");
882  this->SetNthControlPointLabel(n, label);
883  };
885  std::string GetMarkupLabelFormat()
886  {
887  vtkWarningMacro("vtkMRMLMarkupsNode::GetMarkupLabelFormat method is deprecated, please use GetControlPointLabelFormat instead");
888  return this->GetControlPointLabelFormat();
889  };
891  void SetMarkupLabelFormat(std::string format)
892  {
893  // Not warning this at the moment as existing scene files will contain the markupLabelFormat attribute name and would warn on load
894  // vtkWarningMacro("vtkMRMLMarkupsNode::SetMarkupLabelFormat method is deprecated, please use SetControlPointLabelFormat instead");
895  return this->SetControlPointLabelFormat(format);
896  };
899  {
900  vtkWarningMacro("vtkMRMLMarkupsNode::ReplaceListNameInMarkupLabelFormat method is deprecated, please use ReplaceListNameInControlPointLabelFormat instead");
901  return this->ReplaceListNameInControlPointLabelFormat();
902  };
903 
904 protected:
906  ~vtkMRMLMarkupsNode() override;
908  void operator=(const vtkMRMLMarkupsNode&);
909 
910  vtkSmartPointer<vtkStringArray> TextList;
911 
917  bool SetControlPointLabelsWorld(vtkStringArray* labels, vtkPoints* points, std::string separator = "");
918 
922  ControlPoint* GetNthControlPointCustomLog(int n, const char* failedMethodName);
923 
927  void SetNthControlPointID(int n, std::string id);
928 
932  std::string GenerateUniqueControlPointID();
933 
934  std::string GenerateControlPointLabel(int controlPointIndex);
935 
936  virtual void UpdateCurvePolyFromControlPoints();
937 
938  void OnTransformNodeReferenceChanged(vtkMRMLTransformNode* transformNode) override;
939 
942  virtual void UpdateMeasurementsInternal();
943 
946  virtual void WriteMeasurementsToDescription();
947 
949  virtual void UpdateInteractionHandleToWorldMatrix();
950 
952  virtual void TransformOrientationMatrixFromNodeToWorld(
953  const double position_Node[3], const double orientationMatrix_Node[9], double orientationMatrix_World[9]);
954 
956  virtual void TransformOrientationMatrixFromWorldToNode(
957  const double position_World[3], const double orientationMatrix_World[9], double orientationMatrix_Node[9]);
958 
961  int RequiredNumberOfControlPoints{0};
964  int MaximumNumberOfControlPoints{-1};
965 
966  bool CurveClosed{false};
967 
970 
972  vtkSmartPointer<vtkCurveGenerator> CurveGenerator;
973 
978  vtkSmartPointer<vtkParallelTransportFrame> CurveCoordinateSystemGeneratorWorld;
979 
982  vtkSmartPointer<vtkPolyData> CurveInputPoly;
983 
984  vtkSmartPointer<vtkTransformPolyDataFilter> CurvePolyToWorldTransformer;
985  vtkSmartPointer<vtkGeneralTransform> CurvePolyToWorldTransform;
986 
989  vtkSmartPointer<vtkPointLocator> TransformedCurvePolyLocator;
990 
992  int Locked{0};
993 
996  bool FixedNumberOfControlPoints{false};
997 
998  std::string ControlPointLabelFormat{"%N-%d"};
999 
1003  int LastUsedControlPointNumber{0};
1004 
1006  int ControlPointPlacementStartIndex{ -1 };
1007 
1010  vtkVector3d CenterOfRotation;
1011 
1013  vtkCollection* Measurements;
1014 
1015  std::string PropertiesLabelText;
1016 
1018  vtkSmartPointer<vtkMatrix4x4> InteractionHandleToWorldMatrix;
1019 
1021  bool IsUpdatingPoints{false};
1022 
1023  friend class qSlicerMarkupsModuleWidget; // To directly access measurements
1024 };
1025 
1026 #endif
void SetNthMarkupAssociatedNodeID(int n, std::string id)
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Display nodes
ControlPointsListType ControlPoints
Vector of control points.
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
virtual const char * GetDefaultNodeNamePrefix()
Get markup short name.
PositionMissing: point is undefined and placement should not be attempted.
Filter that generates curves between points of an input polydata.
void SetNthControlPointPositionFromArray(const int pointIndex, const double pos[3], int positionStatus=PositionDefined)
MRML node for representing a transformation between this node space and a parent node space...
virtual vtkMRMLStorageNode * CreateDefaultStorageNode()
virtual void GetBounds(double bounds[6])
int GetNumberOfPointsInNthMarkup(int)
std::vector< ControlPoint * > ControlPointsListType
bool GetNthMarkupLocked(int n=0)
vtkSmartPointer< vtkCurveGenerator > CurveGenerator
Converts curve control points to curve points.
virtual bool GetModifiedSinceRead()
virtual void ApplyTransform(vtkAbstractTransform *transform)
Class for storing well-defined measurement results, using coded entries.
vtkSmartPointer< vtkStringArray > TextList
void SetNthControlPointOrientationFromArray(int n, const double orientationWXYZ[4])
void SetNthMarkupLocked(int n, bool flag)
void WriteXML(ostream &of, int indent) override
Write this node&#39;s information to a MRML file in XML format.
virtual const char * GetAddIcon()
vtkSmartPointer< vtkPolyData > CurveInputPoly
vtkVector3d GetMarkupPointVector(int markupIndex, int)
std::string GetNthMarkupLabel(int n=0)
void SetMarkupLabelFormat(std::string format)
void operator=(const vtkMRMLDisplayableNode &)
std::string GetMarkupLabelFormat()
std::string GetNthMarkupAssociatedNodeID(int n=0)
PositionUndefined: position is undefined (coordinate values must not be used).
void SetNthMarkupLabel(int n, std::string label)
PositionDefined: position is specified.
vtkSmartPointer< vtkTransformPolyDataFilter > CurvePolyToWorldTransformer
Point missing before and now it is not missing.
virtual void WriteCLI(std::vector< std::string > &vtkNotUsed(commandLine), std::string vtkNotUsed(prefix), int vtkNotUsed(coordinateSystemFlag)=vtkMRMLStorageNode::CoordinateSystemRAS, int vtkNotUsed(multipleFlag)=1)
Simple class for storing standard coded entries (coding scheme, value, meaning triplets) ...
Definition: vtkCodedEntry.h:26
Point is about to be deleted. Thus it is alive when event is called.
Point was not not missing before and now it is missing.
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSmartPointer< vtkParallelTransportFrame > CurveCoordinateSystemGeneratorWorld
std::string ReplaceListNameInMarkupLabelFormat()
virtual int EndModify(int previousDisableModifiedEventState)
End modifying the node.
Definition: vtkMRMLNode.h:312
virtual void CreateDefaultDisplayNodes()
virtual const char * GetIcon()
Existing control point(s) modified, added, or removed. Modified event is NOT invoked.
void RemoveMarkup(int pointIndex)
vtkSmartPointer< vtkGeneralTransform > CurvePolyToWorldTransform
When an interaction with a control point process finishes.
A superclass for other storage nodes.
void SetCenterOfRotationFromArray(const double pos[3])
virtual const char * GetMarkupType()
std::string PropertiesLabelText
Markups node label format changed. Modified event is invoked, too.
vtkCollection * Measurements
List of measurements stored for the markup.
void SetNthControlPointPositionOrientationWorldFromArray(const int pointIndex, const double positionWorld[3], const double orientationMatrix_World[9], const char *associatedNodeID, int positionStatus=PositionDefined)
vtkMRMLCopyContentMacro(vtkMRMLStorableNode)
When position of the center of rotation is changed (used for example for rotating closed curves)...
vtkCurveGenerator * GetCurveGenerator()
virtual bool CanApplyNonLinearTransforms() const
std::string GetNthMarkupID(int n=0)
When starting interacting with a control point.
vtkVector3d GetCenterOfRotationVector()
PositionPreview: new point is being placed, position is tentative.
vtkSmartPointer< vtkPointLocator > TransformedCurvePolyLocator
virtual void UpdateAssignedAttribute()
Node that holds the information about a unit.
New control point(s) added. Modified event is NOT invoked.
virtual const char * GetPlaceAddIcon()
virtual void OnTransformNodeReferenceChanged(vtkMRMLTransformNode *transformNode)
Called when transform node reference added/modified/removed.
Control point(s) deleted. Modified event is NOT invoked.
vtkSmartPointer< vtkMatrix4x4 > InteractionHandleToWorldMatrix
Transform that moves the xyz unit vectors and origin of the interaction handles to local coordinates...
virtual void GetRASBounds(double bounds[6])