ALBA
albaGizmoScaleAxis.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoScaleAxis
5 Authors: Stefano Perticoni
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaGizmoScaleAxis_H__
18#define __albaGizmoScaleAxis_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaGizmoInterface.h"
25
26//----------------------------------------------------------------------------
27// forward references :
28//----------------------------------------------------------------------------
30
31class albaVMEGizmo;
32class albaMatrix;
33class albaVME;
34
35class vtkCubeSource;
36class vtkCylinderSource;
37class vtkTransformPolyDataFilter;
38class vtkTransform;
39class vtkAppendPolyData;
40
45class ALBA_EXPORT albaGizmoScaleAxis: public albaGizmoInterface
46{
47public:
48 albaGizmoScaleAxis(albaVME *input, albaObserver *listener = NULL);
50
53 void SetInput(albaVME *vme);
54 albaVME *GetInput() {return this->m_InputVme;};
55
56 //----------------------------------------------------------------------------
57 // events handling
58 //----------------------------------------------------------------------------
59
61 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
62
64 virtual void OnEvent(albaEventBase *alba_event);
65
66 //----------------------------------------------------------------------------
67 // axis setting
68 //----------------------------------------------------------------------------
69
71 enum AXIS {X = 0, Y, Z};
72
74 void SetAxis(int axis);
75 int GetAxis() const;
76
77 //----------------------------------------------------------------------------
78 // highlight and show
79 //----------------------------------------------------------------------------
80
82 void Highlight(bool highlight);
83
85 void Show(bool show);
86
87
90 void SetAbsPose(albaMatrix *absPose);
92
93 //----------------------------------------------------------------------------
94 // cube stuff
95 //----------------------------------------------------------------------------
96
98 void SetCubeLength(double length);
99 double GetCubeLength() const;
100
101 //----------------------------------------------------------------------------
102 // cylinder stuff
103 //----------------------------------------------------------------------------
104
106 void SetCylinderLength(double length);
107 double GetCylinderLength() const;
108
109protected:
110
113 void SetRefSysMatrix(albaMatrix *constrain);
114
116 albaVMEGizmo *m_Gizmo;
117
120
121 enum GIZMOPARTS {CYLINDER = 0, CUBE};
122
125
127 vtkCubeSource *m_Cube;
128
130 vtkCylinderSource *m_Cylinder;
131
133 vtkTransformPolyDataFilter *m_TranslatePDF[2];
134
136 vtkTransform *m_TranslateTr[2];
137
139 vtkAppendPolyData *m_Append;
140
142 vtkTransformPolyDataFilter *m_RotatePDF;
143
145 vtkTransform *m_RotationTr;
146
149
152
155
157 void SetColor(double col[3]);
158 void SetColor(double colR, double colG, double colB);
159
163
167
170 bool m_Show;
171
173 friend class albaGizmoScaleAxisTest;
174};
175#endif
Constrained interaction with mouse device: the left button moves the VME (see OnLeftButtonDown).
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Base class for operations and views gizmos.
Basic gizmo component used to perform constrained scaling along one axis.
vtkAppendPolyData * m_Append
cylinder and cube joined in a single figure
albaGizmoScaleAxis(albaVME *input, albaObserver *listener=NULL)
albaObserver * m_Listener
Register the event receiver object.
void SetColor(double colR, double colG, double colB)
void SetAxis(int axis)
Set/Get gizmo axis, default axis is X.
vtkTransform * m_RotationTr
rotation transform for cylinder and cube
void CreatePipeline()
Create vtk objects needed.
void CreateBehavior()
Create the behavior moving the gizmo.
void SetCubeLength(double length)
Set/Get the length of the cone.
void SetListener(albaObserver *Listener)
Set the event receiver object.
int GetAxis() const
void SetInput(albaVME *vme)
Set the gizmo generating vme; the gizmo will be centered on this vme.
void SetAbsPose(albaMatrix *absPose)
Set the abs pose.
albaVMEGizmo * m_Gizmo
Gizmo vme showing the cylinder and the cube as a single figure.
bool m_Highlight
Register the highlight status.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
void Show(bool show)
Show the gizmo.
albaMatrix * GetAbsPose()
Get the gizmo abs pose.
double GetCubeLength() const
void SetRefSysMatrix(albaMatrix *constrain)
Set the constrain ref sys.
double GetCylinderLength() const
void Highlight(bool highlight)
Highlight the gizmo.
vtkCubeSource * m_Cube
Cube source.
albaVME * m_InputVme
Register input vme.
void SetColor(double col[3])
Gizmo color setting facilities.
bool m_Show
register the show status
int m_Axis
Register the gizmo axis.
vtkCylinderSource * m_Cylinder
Cylinder source.
vtkTransformPolyDataFilter * m_RotatePDF
rotate PDF for the figure
void SetCylinderLength(double length)
Set/Get the length of the cylinder.
albaBehaviorTransform * m_Behavior
the behavior moving the gizmo
virtual ~albaGizmoScaleAxis()
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:45
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaVME -
Definition: albaVME.h:151