ALBA
albaInteractor2DMeasure_AngleLine.h
Go to the documentation of this file.
1/*=========================================================================
2Program: ALBA (Agile Library for Biomedical Applications)
3Module: albaInteractor2DMeasure_AngleLine.h
4Language: C++
5Date: $Date: 2021-01-01 12:00:00 $
6Version: $Revision: 1.0.0.0 $
7Authors: Nicola Vanella
8==========================================================================
9Copyright (c) BIC-IOR 2021 (https://github.com/IOR-BIC)
10
11This software is distributed WITHOUT ANY WARRANTY; without even
12the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the above copyright notice for more information.
14=========================================================================*/
15
16#ifndef __albaInteractor2DMeasure_AngleLine_h
17#define __albaInteractor2DMeasure_AngleLine_h
18
19//----------------------------------------------------------------------------
20// Include :
21//----------------------------------------------------------------------------
23
24//----------------------------------------------------------------------------
25// Forward references :
26//----------------------------------------------------------------------------
27class vtkLineSource;
28class vtkPolyDataMapper2D;
29class vtkActor2D;
30
31// Class Name: albaInteractor2DMeasure_AngleLine
33{
34public:
35
37
38 // MEASURE
40 virtual void AddMeasure(double *point1, double *point2, double *point3, double * point4);
42 virtual void EditMeasure(int index, double *point);
44 virtual void RemoveMeasure(int index);
46 virtual void SelectMeasure(int index);
47
48 virtual void SetPointSize(double size);
49 virtual void SetLineWidth(double width);
50
51 virtual void Show(bool show);
52
53 void SetLineExtensionLength(double length) { m_LineExtensionLength = length; };
54 void SetLineStipplePattern(int lp) { m_LineStipplePattern = lp; };
55
57 void GetMeasureLinePoints(int index, double *point1, double *point2, double * point3, double * point4);
58 void GetCenter(int index, double *center);
59
60 bool Load(albaVME *input, wxString tag);
61 bool Save(albaVME *input, wxString tag);
62
63 double GetMeasureAngle(int idx);
64 double CalculateAngle(double * point1, double * point2, double * point3, double * point4);
65protected:
66
69
70 // Draw Measure
71 void MoveMeasure(int index, double * point);
72 void DrawNewMeasure(double * wp);
73
74 void UpdateMeasure(int index, double measure);
75
76 // RENDERING
77 virtual void UpdateLineActors(double * point1, double * point2, double * point3, double * point4);
78 virtual void UpdatePointsActor(double * point1, double * point2, double * point3, double * point4);
79 void UpdateCircleActor(double * point, double angle, double radius);
80 void UpdateTextActor(double * point1, double * point2);
81
82 // UTILS
83 virtual void FindAndHighlight(double * point);
84
85 // Persistent Points
86 std::vector<albaActor2dStackHelper *> m_PointsStackVectorA;
87 std::vector<albaActor2dStackHelper *> m_PointsStackVectorB;
88 std::vector<albaActor2dStackHelper *> m_PointsStackVectorC;
89 std::vector<albaActor2dStackHelper *> m_PointsStackVectorD;
90
91 // Persistent line
92 std::vector<albaActor2dStackHelper *> m_LineStackVectorAB; // First Line
93 std::vector<albaActor2dStackHelper *> m_LineStackVectorCD; // Second Line
94
95 // Persistent Circle
96 std::vector<albaActor2dStackHelper *> m_CircleStackVector;
97
98 std::vector<bool> m_SecondLineP1Added;
99 std::vector<bool> m_SecondLineP2Added;
100 std::vector<double> m_Angles;
101
104
107 double m_OldLineP3[3];
108 double m_OldLineP4[3];
109
111
113
114private:
116 void operator=(const albaInteractor2DMeasure_AngleLine&); // Not implemented.
117 friend class albaInteractor2DMeasure_AngleLineTest;
118};
119#endif
virtual void RemoveMeasure(int index)
Delete the Measure.
void GetCenter(int index, double *center)
virtual void SetPointSize(double size)
virtual void UpdateLineActors(double *point1, double *point2, double *point3, double *point4)
virtual void SelectMeasure(int index)
Select a Measure.
albaTypeMacro(albaInteractor2DMeasure_AngleLine, albaInteractor2DMeasure)
void GetMeasureLinePoints(int index, double *point1, double *point2, double *point3, double *point4)
Get measure line extremity points.
virtual void FindAndHighlight(double *point)
Find Measure Point and Set Action.
void DrawNewMeasure(double *wp)
Draw New Measure.
virtual void UpdatePointsActor(double *point1, double *point2, double *point3, double *point4)
bool Save(albaVME *input, wxString tag)
double CalculateAngle(double *point1, double *point2, double *point3, double *point4)
virtual void SetLineWidth(double width)
void UpdateTextActor(double *point1, double *point2)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorB
std::vector< albaActor2dStackHelper * > m_CircleStackVector
bool Load(albaVME *input, wxString tag)
LOAD/SAVE.
std::vector< albaActor2dStackHelper * > m_PointsStackVectorC
std::vector< albaActor2dStackHelper * > m_PointsStackVectorA
virtual void Show(bool show)
void UpdateCircleActor(double *point, double angle, double radius)
virtual void AddMeasure(double *point1, double *point2, double *point3, double *point4)
Add Measure.
std::vector< albaActor2dStackHelper * > m_LineStackVectorAB
virtual void EditMeasure(int index, double *point)
Edit Measure.
void UpdateMeasure(int index, double measure)
void MoveMeasure(int index, double *point)
Move Measure.
std::vector< albaActor2dStackHelper * > m_PointsStackVectorD
std::vector< albaActor2dStackHelper * > m_LineStackVectorCD
albaVME -
Definition: albaVME.h:150