ALBA
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
albaGizmoTranslate Class Reference

#include <albaGizmoTranslate.h>

Inheritance diagram for albaGizmoTranslate:
Inheritance graph
[legend]
Collaboration diagram for albaGizmoTranslate:
Collaboration graph
[legend]

Public Member Functions

 albaGizmoTranslate (albaVME *input, albaObserver *listener=NULL, bool BuildGUI=true)
 
virtual ~albaGizmoTranslate ()
 
void SetInput (albaVME *vme)
 
void SetRenderWindowHeightPercentage (double percentage)
 
void SetAutoscale (bool autoscale)
 
void SetAlwaysVisible (bool alwaysVisible)
 
void OnEvent (albaEventBase *alba_event)
 
void Show (bool show)
 
void Show (bool showX, bool showY, bool showZ)
 
void SetAbsPose (albaMatrix *absPose, albaTimeStamp ts=-1)
 
albaMatrixGetAbsPose ()
 
void SetRefSys (albaVME *refSys)
 
albaVMEGetRefSys ()
 
albaGUIGetGui ()
 
void SetConstraintModality (int axis, int constrainModality)
 
int GetConstraintModality (int axis)
 
void SetStep (int axis, double step)
 
int GetStep (int axis)
 
- Public Member Functions inherited from albaGizmoInterface
void SetName (albaString name)
 
albaString GetName ()
 
virtual void SetInput (albaVME *vme)
 
albaVMEGetInput ()
 
void SetMediator (albaObserver *mediator)
 
albaObserverGetMediator ()
 
void SetAutoscale (bool autoscale)
 
bool GetAutoscale ()
 
void SetRenderWindowHeightPercentage (double percentage)
 
double GetRenderWindowHeightPercentage ()
 
void SetAlwaysVisible (bool alwaysVisible)
 
bool GetAlwaysVisible ()
 
void SetListener (albaObserver *listener)
 
albaObserverGetListener ()
 
virtual void OnEvent (albaEventBase *alba_event)
 
virtual void Show (bool show)
 
void SetModalityToLocal ()
 
void SetModalityToGlobal ()
 
int GetModality ()
 
virtual void SetAbsPose (albaMatrix *absPose)
 
virtual albaMatrixGetAbsPose ()
 
virtual albaGUIGetGui ()
 
- Public Member Functions inherited from albaObserver
 albaObserver ()
 
virtual ~albaObserver ()
 
virtual void OnEvent (albaEventBase *e)=0
 

Protected Types

enum  AXIS { X = 0 , Y , Z }
 
enum  PLANE { XNORMAL = 0 , YNORMAL , ZNORMAL }
 
enum  ACTIVE_COMPONENT {
  NONE = -1 , X_AXIS = 0 , Y_AXIS , Z_AXIS ,
  XN_PLANE , YN_PLANE , ZN_PLANE
}
 

Protected Member Functions

void OnEventGizmoGui (albaEventBase *alba_event)
 
void OnEventGizmoComponents (albaEventBase *alba_event)
 
void Highlight (int component)
 
void SendTransformMatrixFromGui (albaEventBase *alba_event)
 
- Protected Member Functions inherited from albaGizmoInterface
 albaGizmoInterface ()
 
virtual ~albaGizmoInterface ()
 
void SendTransformMatrix (albaMatrix *matrix, int eventId, long arg)
 
virtual void OnEventGizmoGui (albaEventBase *alba_event)
 
virtual void OnEventGizmoComponents (albaEventBase *alba_event)
 

Protected Attributes

albaGUIGizmoTranslatem_GuiGizmoTranslate
 
albaGizmoTranslateAxism_GTAxis [3]
 
albaGizmoTranslatePlanem_GTPlane [3]
 
int m_ActiveGizmoComponent
 
albaMatrixm_PivotPose
 
bool m_BuildGUI
 
int m_ConstraintModality [3]
 
int m_Step [3]
 
- Protected Attributes inherited from albaGizmoInterface
albaObserverm_Mediator
 
albaString m_Name
 
albaVMEm_InputVME
 
int m_Modality
 
albaObserverm_Listener
 
albaVMEm_RefSysVME
 
bool m_Visibility
 
double m_RenderWindowHeightPercentage
 
bool m_AlwaysVisible
 
bool m_Autoscale
 

Friends

class albaGizmoTranslateTest
 

Additional Inherited Members

- Public Types inherited from albaGizmoInterface
enum  MODALITY { G_LOCAL = 0 , G_GLOBAL }
 

Detailed Description

Gizmo used to perform constrained translation along the x, yz axis or the xy, xz, yz plane.

This class create a translation gizmo composed of:

3 albaGizmoTranslateAxis 3 albaGizmoTranslatePlane

 z
 ^                                 S2
 |                                -----
 |                                     |         
 |                     +           SQ  |S1            =      
 |                                     |         
 x--------> y   

3 x albaGizmoTranslateAxis 3 x albaGizmoTranslatePlane (single axis translation (single plane translation constrain) constrain)

^  
|-----
|     |         

= | |
| |
-----—>

1 x albaGizmoTranslate

and forward pose matrixes to the listener operation.

This object works by creating smaller components that are parented to the vme tree root ie works in global coordinates. in order to use it in your client create an instance of it and concatenate in post multiply modality matrix that this object is sending to the the vme you want to move.

See also
albaGizmoTranslateAxis, albaGizmoTranslatePlane

Definition at line 80 of file albaGizmoTranslate.h.

Member Enumeration Documentation

◆ AXIS

enum albaGizmoTranslate::AXIS
protected

gizmo components enum

Enumerator

Definition at line 156 of file albaGizmoTranslate.h.

◆ PLANE

enum albaGizmoTranslate::PLANE
protected
Enumerator
XNORMAL 
YNORMAL 
ZNORMAL 

Definition at line 157 of file albaGizmoTranslate.h.

◆ ACTIVE_COMPONENT

Enumerator
NONE 
X_AXIS 
Y_AXIS 
Z_AXIS 
XN_PLANE 
YN_PLANE 
ZN_PLANE 

Definition at line 158 of file albaGizmoTranslate.h.

Constructor & Destructor Documentation

◆ albaGizmoTranslate()

albaGizmoTranslate::albaGizmoTranslate ( albaVME input,
albaObserver listener = NULL,
bool  BuildGUI = true 
)

◆ ~albaGizmoTranslate()

virtual albaGizmoTranslate::~albaGizmoTranslate ( )
virtual

Member Function Documentation

◆ SetInput()

void albaGizmoTranslate::SetInput ( albaVME vme)
virtual

Set input vme for the gizmo.

Reimplemented from albaGizmoInterface.

◆ SetRenderWindowHeightPercentage()

void albaGizmoTranslate::SetRenderWindowHeightPercentage ( double  percentage)

Superclass override.

◆ SetAutoscale()

void albaGizmoTranslate::SetAutoscale ( bool  autoscale)

Superclass override.

◆ SetAlwaysVisible()

void albaGizmoTranslate::SetAlwaysVisible ( bool  alwaysVisible)

Superclass override.

◆ OnEvent()

void albaGizmoTranslate::OnEvent ( albaEventBase alba_event)
virtual

Events handling.

Reimplemented from albaGizmoInterface.

◆ Show() [1/2]

void albaGizmoTranslate::Show ( bool  show)
virtual

Show the gizmo.

Reimplemented from albaGizmoInterface.

◆ Show() [2/2]

void albaGizmoTranslate::Show ( bool  showX,
bool  showY,
bool  showZ 
)

Show the gizmo.

◆ SetAbsPose()

void albaGizmoTranslate::SetAbsPose ( albaMatrix absPose,
albaTimeStamp  ts = -1 
)

Set/Get the gizmo pose.

◆ GetAbsPose()

albaMatrix * albaGizmoTranslate::GetAbsPose ( )
virtual

Get the gizmo abs pose.

Reimplemented from albaGizmoInterface.

◆ SetRefSys()

void albaGizmoTranslate::SetRefSys ( albaVME refSys)

Set the vme to be used as reference system, the vme is referenced; default ref sys is vme abs matrix.

◆ GetRefSys()

albaVME * albaGizmoTranslate::GetRefSys ( )

◆ GetGui()

albaGUI * albaGizmoTranslate::GetGui ( )
inlinevirtual

Return gui owned by the gizmo.

Reimplemented from albaGizmoInterface.

Definition at line 132 of file albaGizmoTranslate.h.

◆ SetConstraintModality()

void albaGizmoTranslate::SetConstraintModality ( int  axis,
int  constrainModality 
)

Set the constraint modality for the given axis; allowed constraint modality are: LOCK, FREE, BOUNDS, SNAP_STEP, SNAP_ARRAY defined in albaInteractorConstraint.

◆ GetConstraintModality()

int albaGizmoTranslate::GetConstraintModality ( int  axis)

◆ SetStep()

void albaGizmoTranslate::SetStep ( int  axis,
double  step 
)

Set the step value for snap step constraint type for the given axis.

◆ GetStep()

int albaGizmoTranslate::GetStep ( int  axis)

◆ OnEventGizmoGui()

void albaGizmoTranslate::OnEventGizmoGui ( albaEventBase alba_event)
protectedvirtual

Gizmo components events handling.

Reimplemented from albaGizmoInterface.

◆ OnEventGizmoComponents()

void albaGizmoTranslate::OnEventGizmoComponents ( albaEventBase alba_event)
protectedvirtual

Gizmo components events handling.

Reimplemented from albaGizmoInterface.

◆ Highlight()

void albaGizmoTranslate::Highlight ( int  component)
protected

Highlight one component and dehighlight other components.

◆ SendTransformMatrixFromGui()

void albaGizmoTranslate::SendTransformMatrixFromGui ( albaEventBase alba_event)
protected

Send matrix to postmultiply to listener.

Friends And Related Function Documentation

◆ albaGizmoTranslateTest

friend class albaGizmoTranslateTest
friend

test friend

Definition at line 185 of file albaGizmoTranslate.h.

Member Data Documentation

◆ m_GuiGizmoTranslate

albaGUIGizmoTranslate* albaGizmoTranslate::m_GuiGizmoTranslate
protected

Definition at line 146 of file albaGizmoTranslate.h.

◆ m_GTAxis

albaGizmoTranslateAxis* albaGizmoTranslate::m_GTAxis[3]
protected

Array holding the three gizmo that performs translation on a vector.

Definition at line 165 of file albaGizmoTranslate.h.

◆ m_GTPlane

albaGizmoTranslatePlane* albaGizmoTranslate::m_GTPlane[3]
protected

Array holding the three gizmo that performs translation on a plane.

Definition at line 168 of file albaGizmoTranslate.h.

◆ m_ActiveGizmoComponent

int albaGizmoTranslate::m_ActiveGizmoComponent
protected

Register the active gizmo component at MOUSE_DOWN.

Definition at line 172 of file albaGizmoTranslate.h.

◆ m_PivotPose

albaMatrix* albaGizmoTranslate::m_PivotPose
protected

Pivot point position;.

Definition at line 176 of file albaGizmoTranslate.h.

◆ m_BuildGUI

bool albaGizmoTranslate::m_BuildGUI
protected

Build Gizmo GUI.

Definition at line 182 of file albaGizmoTranslate.h.

◆ m_ConstraintModality

int albaGizmoTranslate::m_ConstraintModality[3]
protected

register axis constraint modality

Definition at line 188 of file albaGizmoTranslate.h.

◆ m_Step

int albaGizmoTranslate::m_Step[3]
protected

register step on axes

Definition at line 191 of file albaGizmoTranslate.h.


The documentation for this class was generated from the following file: