Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
23
24// Markups includes
25#include "vtkMRMLExport.h"
27#include "vtkMRMLMarkupsNode.h"
28
35class VTK_MRML_EXPORT vtkMRMLMarkupsLineNode : public vtkMRMLMarkupsNode
36{
37public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
43 const char* GetIcon() override {return ":/Icons/MarkupsLine.png";}
44 const char* GetAddIcon() override {return ":/Icons/MarkupsLineMouseModePlace.png";}
45 const char* GetPlaceAddIcon() override {return ":/Icons/MarkupsLineMouseModePlaceAdd.png";}
46
47 //--------------------------------------------------------------------------
48 // MRMLNode methods
49 //--------------------------------------------------------------------------
50
53 const char* GetNodeTagName() override {return "MarkupsLine";}
54
56 const char* GetMarkupType() override {return "Line";};
57
59 void ReadXMLAttributes( const char** atts) override;
60
62 void WriteXML(ostream& of, int indent) override;
63
67
69 virtual double GetLineLengthWorld();
70
72
75 bool GetLineStartPosition(double position[3]);
76 bool GetLineEndPosition(double position[3]);
77 bool GetLineStartPositionWorld(double position[3]);
78 bool GetLineEndPositionWorld(double position[3]);
80
82
84 vtkVector3d GetLineStartPosition();
85 vtkVector3d GetLineEndPosition();
89
91
93 void SetLineStartPosition(double position[3]);
94 void SetLineEndPosition(double position[3]);
95 void SetLineStartPositionWorld(double position[3]);
96 void SetLineEndPositionWorld(double position[3]);
98
99 // Deprecated methods
100
102
107 bool GetPosition1(double position[3]);
108 bool GetPosition2(double position[3]);
110
112
117 double* GetPosition1();
118 double* GetPosition2();
120
122
127 bool GetPositionWorldCoordinates1(double position[3]);
128 bool GetPositionWorldCoordinates2(double position[3]);
130
132
137 bool SetPosition1(double newControl[3]);
138 bool SetPosition2(double newControl[3]);
139 bool SetPosition1(double nC1, double nC2, double nC3);
140 bool SetPosition2(double nC1, double nC2, double nC3);
142
144
149 bool SetPositionWorldCoordinates1(double newControl[3]);
150 bool SetPositionWorldCoordinates2(double newControl[3]);
152
153protected:
158
161};
162
163#endif
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
bool GetLineStartPosition(double position[3])
bool SetPosition2(double newControl[3])
const char * GetMarkupType() override
Get markup type internal name.
bool GetPosition2(double position[3])
void UpdateInteractionHandleToWorldMatrix() override
Calculates the handle to world matrix based on the current control points.
bool GetPositionWorldCoordinates2(double position[3])
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
void SetLineStartPosition(double position[3])
bool SetPosition1(double nC1, double nC2, double nC3)
static vtkMRMLMarkupsLineNode * New()
vtkVector3d GetLineStartPosition()
bool GetLineEndPositionWorld(double position[3])
vtkVector3d GetLineStartPositionWorld()
bool SetPosition1(double newControl[3])
void SetLineEndPosition(double position[3])
vtkMRMLMarkupsLineNode(const vtkMRMLMarkupsLineNode &)
const char * GetPlaceAddIcon() override
vtkVector3d GetLineEndPositionWorld()
virtual double GetLineLengthWorld()
Return line length (distance between the two line endpoints) in world coordinate system.
vtkVector3d GetLineEndPosition()
~vtkMRMLMarkupsLineNode() override
void SetLineStartPositionWorld(double position[3])
bool GetLineStartPositionWorld(double position[3])
void PrintSelf(ostream &os, vtkIndent indent) override
Print out the node information to the output stream.
bool GetPosition1(double position[3])
bool SetPosition2(double nC1, double nC2, double nC3)
vtkMRMLCopyContentDefaultMacro(vtkMRMLMarkupsLineNode)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
bool GetPositionWorldCoordinates1(double position[3])
const char * GetIcon() override
void SetLineEndPositionWorld(double position[3])
bool SetPositionWorldCoordinates1(double newControl[3])
bool GetLineEndPosition(double position[3])
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
bool SetPositionWorldCoordinates2(double newControl[3])
void operator=(const vtkMRMLMarkupsLineNode &)
const char * GetAddIcon() override
Abstract Superclass for all specific types of MRML nodes.