ALBA
albaInteractor2DMeasure_Angle.h
Go to the documentation of this file.
1/*=========================================================================
2Program: ALBA (Agile Library for Biomedical Applications)
3Module: albaInteractor2DMeasure_Angle.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_Angle_h
17#define __albaInteractor2DMeasure_Angle_h
18
19//----------------------------------------------------------------------------
20// Include :
21//----------------------------------------------------------------------------
23
24//----------------------------------------------------------------------------
25// Forward references :
26//----------------------------------------------------------------------------
27class vtkLineSource;
28class vtkPolyDataMapper2D;
29class vtkActor2D;
30
31// Class Name: albaInteractor2DMeasure_Angle
33{
34public:
35
37
38 // MEASURE
40 virtual void AddMeasure(double *point1, double *point2, double *point3);
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);
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
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);
78 virtual void UpdatePointsActor(double * point1, double * point2, double * point3);
79 void UpdateCircleActor(double * point1, double * point2, double * ori);
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_PointsStackVectorOri;
87 std::vector<albaActor2dStackHelper *> m_PointsStackVectorA;
88 std::vector<albaActor2dStackHelper *> m_PointsStackVectorB;
89
90 // Persistent line
91 std::vector<albaActor2dStackHelper *> m_LineStackVectorOA; // First Line
92 std::vector<albaActor2dStackHelper *> m_LineStackVectorOB; // Second Line
93
94 // Persistent Circle
95 std::vector<albaActor2dStackHelper *> m_CircleStackVector;
96
97 std::vector<bool> m_SecondLineAdded;
98 std::vector<double> m_Angles;
99
102
104 double m_OldLineP3[3];
106
108
109private:
111 void operator=(const albaInteractor2DMeasure_Angle&); // Not implemented.
112 friend class albaInteractor2DMeasure_AngleTest;
113};
114#endif
bool Save(albaVME *input, wxString tag)
bool Load(albaVME *input, wxString tag)
LOAD/SAVE.
virtual void SetLineWidth(double width)
std::vector< albaActor2dStackHelper * > m_LineStackVectorOB
virtual void Show(bool show)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorA
virtual void RemoveMeasure(int index)
Delete the Measure.
void GetCenter(int index, double *center)
void MoveMeasure(int index, double *point)
Move Measure.
virtual void SelectMeasure(int index)
Select a Measure.
albaTypeMacro(albaInteractor2DMeasure_Angle, albaInteractor2DMeasure)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorB
virtual void AddMeasure(double *point1, double *point2, double *point3)
Add Measure.
virtual void UpdateLineActors(double *point1, double *point2, double *point3)
void GetMeasureLinePoints(int index, double *point1, double *point2, double *point3)
Get measure line extremity points.
std::vector< albaActor2dStackHelper * > m_LineStackVectorOA
std::vector< albaActor2dStackHelper * > m_CircleStackVector
double GetMeasureAngle(int idx)
void DrawNewMeasure(double *wp)
Draw New Measure.
void UpdateCircleActor(double *point1, double *point2, double *ori)
virtual void SetPointSize(double size)
virtual void FindAndHighlight(double *point)
Find Measure Point and Set Action.
void UpdateTextActor(double *point1, double *point2)
void UpdateMeasure(int index, double measure)
virtual void UpdatePointsActor(double *point1, double *point2, double *point3)
virtual void EditMeasure(int index, double *point)
Edit Measure.
std::vector< albaActor2dStackHelper * > m_PointsStackVectorOri
albaVME -
Definition: albaVME.h:150