ALBA
albaGizmoROI.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGizmoROI
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
18#ifndef __albaGizmoROI_H__
19#define __albaGizmoROI_H__
20
21//----------------------------------------------------------------------------
22// Include:
23//----------------------------------------------------------------------------
24#include "albaGizmoInterface.h"
25#include "albaObserver.h"
27#include "albaGizmoHandle.h"
28
29//----------------------------------------------------------------------------
30// forward references :
31//----------------------------------------------------------------------------
32class albaGizmoHandle;
33class albaMatrix;
34class albaVME;
35
36//----------------------------------------------------------------------------
37// albaGizmoROI :
38//----------------------------------------------------------------------------
77class ALBA_EXPORT albaGizmoROI: public albaGizmoInterface
78{
79public:
80 albaGizmoROI(albaVME *input, albaObserver* listener = NULL , int constraintModality=albaGizmoHandle::BOUNDS,albaVME* parent=NULL,bool showShadingPlane=false);
81 virtual ~albaGizmoROI();
82
84 virtual void SetInput(albaVME *vme);
85
87 virtual void OnEvent(albaEventBase *alba_event);
88
90 void Highlight(int component);
91
93 void HighlightOff();
94
95 //----------------------------------------------------------------------------
96 // show
97 //----------------------------------------------------------------------------
98
100 void Show(bool show);
101
103 void ShowHandles(bool show);
104
106 void ShowShadingPlane(bool show);
107
109 void ShowROI(bool show);
110
113
115 void SetBounds(double bounds[6]);
116 double *GetBounds();
117 void GetBounds(double bounds[6]);
118
120 void Reset();
121
123 void EnableMinimumHandleSize(bool value){m_EnableMinimumHandleSize = value;}
124 void SetMinimumHandleSize(double value){m_MinimumHandleSize = value;}
125 void EnableMinimumDistanceBetweenGizmo(bool value){m_EnableMinimumDistanceBetweenGizmo = value;}
126
127protected:
128
131 void Highlight(int component, bool highlight);
132
134
137
141
145 virtual void UpdateGizmosLength();
146
149
151
152
153 albaGizmoHandle *m_GHandle[6];
154 double m_Center[6][3];
156
161
163 friend class albaGizmoROITest ;
164
165};
166#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
Bounding box gizmo for highlighting a region of interest.
Base class for operations and views gizmos.
albaGizmoBoundingBox * m_OutlineGizmo
The gizmo bounding box.
Definition: albaGizmoROI.h:155
virtual void UpdateGizmosLength()
Update the gizmos length.
int m_ActiveGizmoComponent
Register the active gizmo component at MOUSE_DOWN.
Definition: albaGizmoROI.h:133
void Reset()
Reset the gizmo.
double m_Accumulator
Definition: albaGizmoROI.h:157
int m_ConstraintModality
Definition: albaGizmoROI.h:150
void UpdateOutlineBounds()
Update gizmo outline bounds based on handles position.
void Show(bool show)
Show the gizmo.
void Highlight(int component)
Highlight the given component and set highlight to false for the others.
double m_MinimumHandleSize
Definition: albaGizmoROI.h:158
virtual void SetInput(albaVME *vme)
Set input vme for the gizmo.
albaGizmoROI(albaVME *input, albaObserver *listener=NULL, int constraintModality=albaGizmoHandle::BOUNDS, albaVME *parent=NULL, bool showShadingPlane=false)
void SetBounds(double bounds[6])
Set/Get the gizmo bounds.
void GetBounds(double bounds[6])
void UpdateHandlePositions()
After one handle movement recenter other handles.
void OnEventGizmoComponents(albaEventBase *alba_event)
Process events from gizmo components.
void SetMinimumHandleSize(double value)
Definition: albaGizmoROI.h:124
virtual ~albaGizmoROI()
void ShowROI(bool show)
Show gizmo cube.
virtual void OnEvent(albaEventBase *alba_event)
Events handling.
void HighlightOff()
Set highlight to false for all gizmo components.
bool m_EnableMinimumDistanceBetweenGizmo
Definition: albaGizmoROI.h:160
double * GetBounds()
void EnableMinimumDistanceBetweenGizmo(bool value)
Definition: albaGizmoROI.h:125
void SetConstrainRefSys(albaMatrix *constrain)
Set the constrain ref sys.
void ShowHandles(bool show)
Show gizmo handles.
void EnableMinimumHandleSize(bool value)
Minimum handles size.
Definition: albaGizmoROI.h:123
bool m_EnableMinimumHandleSize
Definition: albaGizmoROI.h:159
void ShowShadingPlane(bool show)
Show shading planes.
void Highlight(int component, bool highlight)
Highlight one component of the gizmo and turn off the highlight others; setting highlight to false it...
albaMatrix - Time stamped 4x4 Matrix.
Definition: albaMatrix.h:44
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaVME -
Definition: albaVME.h:150