ALBA
albaInteractor2DMeasure_Template.h
Go to the documentation of this file.
1/*=========================================================================
2Program: ALBA (Agile Library for Biomedical Applications)
3Module: albaInteractor2DMeasure_Template.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 __appInteractor2DMeasure_Template_h
17#define __appInteractor2DMeasure_Template_h
18
19//----------------------------------------------------------------------------
20// Include :
21//----------------------------------------------------------------------------
23#include "vtkActor.h"
24#include "vtkPolyData.h"
25#include "vtkPolyDataMapper.h"
26
27//----------------------------------------------------------------------------
28// Forward references :
29//----------------------------------------------------------------------------
30class vtkActor;
31class vtkActor2D;
32class vtkDataSetMapper;
33class vtkImageData;
34class vtkLookupTable;
35class vtkPolyDataMapper2D;
36class vtkTransform;
37class vtkTransformPolyDataFilter;
38class albaVMEImage;
39
40// Class Name: albaInteractor2DMeasure_Template
42{
43public:
44
46
47 // MEASURE
49 void AddMeasure(double * pointUL, double * pointUR, double * pointDR, double * pointDL);
51 virtual void EditPoints(int index, double * pointUL, double * pointUR, double * pointDR, double * pointDL);
52 virtual void EditTextureCoord(int index, double * pointUL, double * pointUR, double * pointDR, double * pointDL);
54 virtual void EditMeasure(int index, double *point);
56 virtual void RemoveMeasure(int index);
58 virtual void SelectMeasure(int index);
59
60 virtual void SetPointSize(double size);
61 void SetTexture(vtkImageData *imageData);
62
63 void SetTextureOpacity(double opacity);
64
65 void SetTextureColor(double r, double g, double b);
66
68 void GetMeasurePoints(int index, double * pointUL, double * pointUR, double * pointDR, double * pointDL);
69 void GetCenter(int index, double *center);
70
71 virtual void Show(bool show);
72
73 void ShowPoints(bool show);
74 void ShowTexture(bool show);
75
76 void Rotate(double angle, double *origin = NULL);
77 void CropImage(albaVMEImage *vmeImage);
78 void CropImage(albaVMEImage *vmeImage, double *bounds);
79
80 bool Load(albaVME *input, wxString tag);
81 bool Save(albaVME *input, wxString tag);
82
83 vtkTexture* GetTexture(int index) { return m_TexturedQuadVector[index]->GetTexture(); }
84 void SetTexture(int index, vtkTexture* texture) { m_TexturedQuadVector[index]->SetTexture(texture); }
85
86 vtkLookupTable* GetLut() { return m_TemplateLookupTable; };
87
88 void SetConfigDir(wxString dir) { m_ConfigDir = dir; };
89
90protected:
91
94
95 // Draw Measure
96 void MoveMeasure(int index, double * point);
97 void DrawNewMeasure(double * wp);
98
99 // RENDERING
100 void UpdatePointsActor(double * pointUL, double * pointUR, double * pointDR, double * pointDL);
101 void UpdateTexureActor(double * pointUL, double * pointUR, double * pointDR, double * pointDL);
102
103 // UTILS
104 virtual void FindAndHighlight(double * point);
105
107
108 // Persistent Points
109 std::vector<albaActor2dStackHelper *> m_PointsStackVectorUL;
110 std::vector<albaActor2dStackHelper *> m_PointsStackVectorUR;
111 std::vector<albaActor2dStackHelper *> m_PointsStackVectorDR;
112 std::vector<albaActor2dStackHelper *> m_PointsStackVectorDL;
113 std::vector<albaActor2dStackHelper *> m_PointsStackVectorC;
114
115 // Persistent Texture Quad
116 std::vector<vtkPolyData *> m_QuadVector;
117 std::vector<vtkActor *> m_TexturedQuadVector;
118
119 vtkLookupTable *m_TemplateLookupTable;
120
121 double m_Angle;
122 wxString m_ConfigDir;
123
124private:
126 void operator=(const albaInteractor2DMeasure_Template&); // Not implemented.
127 friend class appInteractor2DMeasure_TemplateTest;
128};
129#endif
virtual void EditMeasure(int index, double *point)
Edit Measure.
virtual void EditTextureCoord(int index, double *pointUL, double *pointUR, double *pointDR, double *pointDL)
virtual void FindAndHighlight(double *point)
Find Measure Point and Set Action.
void SetTextureOpacity(double opacity)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorUR
std::vector< albaActor2dStackHelper * > m_PointsStackVectorC
std::vector< albaActor2dStackHelper * > m_PointsStackVectorDR
virtual void RemoveMeasure(int index)
Delete the Measure.
void GetCenter(int index, double *center)
void UpdateTexureActor(double *pointUL, double *pointUR, double *pointDR, double *pointDL)
void SetTexture(int index, vtkTexture *texture)
void SetTextureColor(double r, double g, double b)
virtual void SetPointSize(double size)
void CropImage(albaVMEImage *vmeImage, double *bounds)
void MoveMeasure(int index, double *point)
Move Measure.
albaTypeMacro(albaInteractor2DMeasure_Template, albaInteractor2DMeasure)
void CropImage(albaVMEImage *vmeImage)
virtual void Show(bool show)
bool Save(albaVME *input, wxString tag)
void GetMeasurePoints(int index, double *pointUL, double *pointUR, double *pointDR, double *pointDL)
Get measure points.
void SetTexture(vtkImageData *imageData)
std::vector< albaActor2dStackHelper * > m_PointsStackVectorDL
void UpdatePointsActor(double *pointUL, double *pointUR, double *pointDR, double *pointDL)
void DrawNewMeasure(double *wp)
Draw New Measure.
std::vector< albaActor2dStackHelper * > m_PointsStackVectorUL
bool Load(albaVME *input, wxString tag)
LOAD/SAVE.
void AddMeasure(double *pointUL, double *pointUR, double *pointDR, double *pointDL)
Add Measure.
virtual void SelectMeasure(int index)
Select a Measure.
virtual void EditPoints(int index, double *pointUL, double *pointUR, double *pointDR, double *pointDL)
Edit Points.
void Rotate(double angle, double *origin=NULL)
albaVME -
Definition: albaVME.h:150