Slicer  5.1
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLMarkupsAngleNode.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 __vtkMRMLMarkupsAngleNode_h
19 #define __vtkMRMLMarkupsAngleNode_h
20 
21 // MRML includes
22 #include "vtkMRMLDisplayableNode.h"
23 
24 // Markups includes
25 #include "vtkSlicerMarkupsModuleMRMLExport.h"
27 #include "vtkMRMLMarkupsNode.h"
28 
36 class VTK_SLICER_MARKUPS_MODULE_MRML_EXPORT vtkMRMLMarkupsAngleNode : public vtkMRMLMarkupsNode
37 {
38 public:
39  static vtkMRMLMarkupsAngleNode *New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  const char* GetIcon() override {return ":/Icons/MarkupsAngle.png";}
45  const char* GetAddIcon() override {return ":/Icons/MarkupsAngleMouseModePlace.png";}
46  const char* GetPlaceAddIcon() override {return ":/Icons/MarkupsAngleMouseModePlaceAdd.png";}
47 
53  {
57  AngleMeasurementMode_Last
58  };
59 
60  //--------------------------------------------------------------------------
61  // MRMLNode methods
62  //--------------------------------------------------------------------------
63 
64  vtkMRMLNode* CreateNodeInstance() override;
66  const char* GetNodeTagName() override {return "MarkupsAngle";}
67 
69  const char* GetMarkupType() override {return "Angle";};
70 
71  // Get markup type GUI display name
72  const char* GetTypeDisplayName() override {return "Angle";};
73 
75  const char* GetDefaultNodeNamePrefix() override {return "A";};
76 
78  void ReadXMLAttributes( const char** atts) override;
79 
81  void WriteXML(ostream& of, int indent) override;
82 
86 
89  vtkGetMacro(AngleMeasurementMode, int);
92  void SetAngleMeasurementMode(int type);
97  const char* GetAngleMeasurementModeAsString(int id);
102  int GetAngleMeasurementModeFromString(const char* name);
106  void SetAngleMeasurementModeToMinimal();
110  void SetAngleMeasurementModeToOrientedSigned();
114  void SetAngleMeasurementModeToOrientedPositive();
115 
118  vtkGetVector3Macro(OrientationRotationAxis, double);
121  virtual void SetOrientationRotationAxis(double r, double a, double s);
124  virtual void SetOrientationRotationAxis(double ras[3]);
125 
128  double GetAngleDegrees();
129 
130 protected:
132  ~vtkMRMLMarkupsAngleNode() override;
134  void operator=(const vtkMRMLMarkupsAngleNode&);
135 
137  void UpdateInteractionHandleToWorldMatrix() override;
138 
139 protected:
143  double OrientationRotationAxis[3];
144 
151 };
152 
153 #endif
MRML node to represent an angle markup Angle Markups nodes contain three control points. Visualization parameters are set in the vtkMRMLMarkupsDisplayNode class.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void operator=(const vtkMRMLMarkupsNode &)
const char * GetAddIcon() override
virtual void UpdateInteractionHandleToWorldMatrix()
Calculates the handle to world matrix based on the current control points.
const char * GetDefaultNodeNamePrefix() override
Get markup short name.
const char * GetPlaceAddIcon() override
const char * GetMarkupType() override
Get markup type internal name.
vtkMRMLCopyContentMacro(vtkMRMLMarkupsNode)
const char * GetTypeDisplayName() override
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
const char * GetIcon() override
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void PrintSelf(ostream &os, vtkIndent indent) override