Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLMarkupsLineNode.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 __vtkMRMLMarkupsLineNode_h
19 #define __vtkMRMLMarkupsLineNode_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 vtkMRMLMarkupsLineNode : public vtkMRMLMarkupsNode
37 {
38 public:
39  static vtkMRMLMarkupsLineNode *New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  const char* GetIcon() override {return ":/Icons/MarkupsLine.png";}
45  const char* GetAddIcon() override {return ":/Icons/MarkupsLineMouseModePlace.png";}
46  const char* GetPlaceAddIcon() override {return ":/Icons/MarkupsLineMouseModePlaceAdd.png";}
47 
48  //--------------------------------------------------------------------------
49  // MRMLNode methods
50  //--------------------------------------------------------------------------
51 
52  vtkMRMLNode* CreateNodeInstance() override;
54  const char* GetNodeTagName() override {return "MarkupsLine";}
55 
57  const char* GetMarkupType() override {return "Line";};
58 
59  // Get markup type GUI display name
60  const char* GetTypeDisplayName() override {return "Line";};
61 
63  const char* GetDefaultNodeNamePrefix() override {return "L";};
64 
66  void ReadXMLAttributes( const char** atts) override;
67 
69  void WriteXML(ostream& of, int indent) override;
70 
74 
76  virtual double GetLineLengthWorld();
77 
79  bool GetLineStartPosition(double position[3]);
83  bool GetLineEndPosition(double position[3]);
84  bool GetLineStartPositionWorld(double position[3]);
85  bool GetLineEndPositionWorld(double position[3]);
87 
89  vtkVector3d GetLineStartPosition();
92  vtkVector3d GetLineEndPosition();
93  vtkVector3d GetLineStartPositionWorld();
94  vtkVector3d GetLineEndPositionWorld();
96 
98  void SetLineStartPosition(double position[3]);
101  void SetLineEndPosition(double position[3]);
102  void SetLineStartPositionWorld(double position[3]);
103  void SetLineEndPositionWorld(double position[3]);
105 
106  // Deprecated methods
107 
109  bool GetPosition1(double position[3]);
115  bool GetPosition2(double position[3]);
117 
119  double* GetPosition1();
125  double* GetPosition2();
127 
129  bool GetPositionWorldCoordinates1(double position[3]);
135  bool GetPositionWorldCoordinates2(double position[3]);
137 
139  bool SetPosition1(double newControl[3]);
145  bool SetPosition2(double newControl[3]);
146  bool SetPosition1(double nC1, double nC2, double nC3);
147  bool SetPosition2(double nC1, double nC2, double nC3);
149 
151  bool SetPositionWorldCoordinates1(double newControl[3]);
157  bool SetPositionWorldCoordinates2(double newControl[3]);
159 
160 protected:
162  ~vtkMRMLMarkupsLineNode() override;
164  void operator=(const vtkMRMLMarkupsLineNode&);
165 
167  void UpdateInteractionHandleToWorldMatrix() override;
168 };
169 
170 #endif
const char * GetMarkupType() override
Get markup type internal name.
void operator=(const vtkMRMLMarkupsNode &)
virtual void UpdateInteractionHandleToWorldMatrix()
Calculates the handle to world matrix based on the current control points.
MRML node to represent a line markup Line Markups nodes contain two control points. Visualization parameters are set in the vtkMRMLMarkupsDisplayNode class.
const char * GetIcon() override
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
const char * GetAddIcon() override
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
#define vtkMRMLCopyContentDefaultMacro(thisClassName)
Definition: vtkMRMLNode.h:155
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
const char * GetPlaceAddIcon() override
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
const char * GetTypeDisplayName() override
const char * GetDefaultNodeNamePrefix() override
Get markup short name.
void PrintSelf(ostream &os, vtkIndent indent) override