ALBA
albaInteractor2DMeasure_Line.h
Go to the documentation of this file.
1/*=========================================================================
2Program: ALBA (Agile Library for Biomedical Applications)
3Module: albaInteractor2DMeasure_Line.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_Line_h
17#define __albaInteractor2DMeasure_Line_h
18
19//----------------------------------------------------------------------------
20// Include :
21//----------------------------------------------------------------------------
23
24//----------------------------------------------------------------------------
25// Forward references :
26//----------------------------------------------------------------------------
27class vtkLineSource;
28class vtkPolyDataMapper2D;
29class vtkActor2D;
30
31// Class Name: albaInteractor2DMeasure_Line
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
62protected:
63
66
67 // Draw Measure
68 void MoveMeasure(int index, double * point);
69 void DrawNewMeasure(double * wp);
70
71 // RENDERING
72 virtual void UpdateLineActors(double * point1, double * point2);
73 virtual void UpdatePointsActor(double * point1, double * point2);
74 void UpdateLR(vtkLineSource *line, vtkLineSource *lineL, vtkLineSource *lineR);
75 void UpdateTextActor(double * point1, double * point2);
76
77 //UTILS
78 virtual void FindAndHighlight(double * point);
79
80 // Persistent line
81 std::vector<albaActor2dStackHelper *> m_LineStackVector;
82 std::vector<albaActor2dStackHelper *> m_LineStackVectorL; // Persistent line
83 std::vector<albaActor2dStackHelper *> m_LineStackVectorR;
84
85 // Persistent Points
86 std::vector<albaActor2dStackHelper *> m_PointsStackVectorL;
87 std::vector<albaActor2dStackHelper *> m_PointsStackVectorR;
88
91
92private:
94 void operator=(const albaInteractor2DMeasure_Line&); // Not implemented.
95 friend class albaInteractor2DMeasure_LineTest;
96};
97#endif
void DrawNewMeasure(double *wp)
Draw New Measure.
std::vector< albaActor2dStackHelper * > m_LineStackVectorR
void UpdateTextActor(double *point1, double *point2)
virtual void EditMeasure(int index, double *point)
Edit Measure.
virtual void FindAndHighlight(double *point)
Find Measure Point and Set Action.
void MoveMeasure(int index, double *point)
Move Measure.
virtual void RemoveMeasure(int index)
Delete the Measure.
std::vector< albaActor2dStackHelper * > m_PointsStackVectorR
virtual void Show(bool show)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorL
std::vector< albaActor2dStackHelper * > m_LineStackVector
void UpdateLR(vtkLineSource *line, vtkLineSource *lineL, vtkLineSource *lineR)
virtual void UpdateLineActors(double *point1, double *point2)
std::vector< albaActor2dStackHelper * > m_LineStackVectorL
bool Load(albaVME *input, wxString tag)
LOAD/SAVE.
virtual void AddMeasure(double *point1, double *point2)
Add Measure.
virtual void SetLineWidth(double width)
void GetMeasureLinePoints(int index, double *point1, double *point2)
Get measure line extremity points.
bool Save(albaVME *input, wxString tag)
albaTypeMacro(albaInteractor2DMeasure_Line, albaInteractor2DMeasure)
virtual void SetPointSize(double size)
virtual void SelectMeasure(int index)
Select a Measure.
virtual void UpdatePointsActor(double *point1, double *point2)
albaVME -
Definition: albaVME.h:150