ALBA
albaInteractor2DMeasure_LineDistance.h
Go to the documentation of this file.
1/*=========================================================================
2Program: ALBA (Agile Library for Biomedical Applications)
3Module: albaInteractor2DMeasure_LineDistance.h
4Language: C++
5Date: $Date: 2021-01-01 12:00:00 $
6Version: $Revision: 1.0.0.0 $
7Authors: Gianluigi Crimi
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_LineDistance_h
17#define __albaInteractor2DMeasure_LineDistance_h
18
19//----------------------------------------------------------------------------
20// Include :
21//----------------------------------------------------------------------------
23
24//----------------------------------------------------------------------------
25// Forward references :
26//----------------------------------------------------------------------------
27class vtkLineSource;
28class vtkPolyDataMapper2D;
29class vtkActor2D;
30
31// Class Name: albaInteractor2DMeasure_LineDistance
33{
34public:
35
37
38 // MEASURE
40 virtual void AddMeasure(double *point1, double *point2);
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);
58
59 bool Load(albaVME *input, wxString tag);
60 bool Save(albaVME *input, wxString tag);
61
62 double GetDistance(int idx);
63protected:
64
67
68 // Draw Measure
69 void MoveMeasure(int index, double * point);
70 void DrawNewMeasure(double * wp);
71
72 void UpdateMeasure(int index, double measure);
73
74 // RENDERING
75 virtual void UpdateLineActors(double * point1, double * point2);
76 virtual void UpdatePointsActor(double * point1, double * point2);
77 void UpdateTextActor(double * point1, double * point2);
78
79 //UTILS
80 virtual void FindAndHighlight(double * point);
81
82 // Persistent line
83 std::vector<albaActor2dStackHelper *> m_LineStackVector; // Main Line
84 std::vector<albaActor2dStackHelper *> m_LineStackVectorB; // Second Line
85 std::vector<albaActor2dStackHelper *> m_LineStackVectorPerp; // Perpendicular Line
86
87 // Persistent Points
88 std::vector<albaActor2dStackHelper *> m_PointsStackVectorL;
89 std::vector<albaActor2dStackHelper *> m_PointsStackVectorR;
90
91 std::vector<bool> m_SecondLineAdded;
92 std::vector<double> m_Distances;
93
96
99
100private:
102 void operator=(const albaInteractor2DMeasure_LineDistance&); // Not implemented.
103 friend class albaInteractor2DMeasure_LineDistanceTest;
104};
105#endif
void MoveMeasure(int index, double *point)
Move Measure.
virtual void UpdatePointsActor(double *point1, double *point2)
virtual void EditMeasure(int index, double *point)
Edit Measure.
std::vector< albaActor2dStackHelper * > m_LineStackVector
virtual void UpdateLineActors(double *point1, double *point2)
virtual void FindAndHighlight(double *point)
Find Measure Point and Set Action.
albaTypeMacro(albaInteractor2DMeasure_LineDistance, albaInteractor2DMeasure)
bool Save(albaVME *input, wxString tag)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorR
bool Load(albaVME *input, wxString tag)
LOAD/SAVE.
virtual void Show(bool show)
virtual void RemoveMeasure(int index)
Delete the Measure.
virtual void SetLineWidth(double width)
virtual void SelectMeasure(int index)
Select a Measure.
virtual void AddMeasure(double *point1, double *point2)
Add Measure.
std::vector< albaActor2dStackHelper * > m_PointsStackVectorL
std::vector< albaActor2dStackHelper * > m_LineStackVectorB
std::vector< albaActor2dStackHelper * > m_LineStackVectorPerp
virtual void SetPointSize(double size)
void GetMeasureLinePoints(int index, double *point1, double *point2)
Get measure line extremity points.
void UpdateTextActor(double *point1, double *point2)
void DrawNewMeasure(double *wp)
Draw New Measure.
void UpdateMeasure(int index, double measure)
albaVME -
Definition: albaVME.h:150