ALBA
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
albaGizmoAutoscaleHelper Class Reference

#include <albaGizmoAutoscaleHelper.h>

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

Public Member Functions

 albaGizmoAutoscaleHelper ()
 
virtual ~albaGizmoAutoscaleHelper ()
 
 albaTypeMacro (albaGizmoAutoscaleHelper, albaTransformBase)
 
void SetRenderer (vtkRenderer *ren)
 
vtkRenderer * GetRenderer ()
 
void SetFollowScale (bool flag)
 
bool GetFollowScale ()
 
void FollowScaleOn ()
 
void FollowScaleOff ()
 
void SetRenderWindowHeightPercentage (double percentage)
 
double GetRenderWindowHeightPercentage ()
 
void SetActor (vtkActor *actor)
 
vtkActor * GetActor ()
 
void SetVME (albaVME *vme)
 
albaVMEGetVME ()
 
virtual int DeepCopy (albaGizmoAutoscaleHelper *trans)
 
virtual unsigned long GetMTime ()
 
- Public Member Functions inherited from albaTransformBase
 albaTransformBase ()
 
 ~albaTransformBase ()
 
 albaTransformBase (const albaTransformBase &)
 
 albaAbstractTypeMacro (albaTransformBase, albaReferenceCounted)
 
virtual void Print (std::ostream &os, const int indent=0) const
 
virtual const albaMatrixGetMatrix ()
 
albaMatrixGetMatrixPointer ()
 
void TransformPoint (const float in[3], float out[3])
 
void TransformPoint (const double in[3], double out[3])
 
void TransformNormalAtPoint (const float point[3], const float in[3], float out[3])
 
void TransformNormalAtPoint (const double point[3], const double in[3], double out[3])
 
void TransformVectorAtPoint (const float point[3], const float in[3], float out[3])
 
void TransformVectorAtPoint (const double point[3], const double in[3], double out[3])
 
virtual void Update ()
 
void Modified ()
 
virtual void InternalTransformPoint (const double in[3], double out[3])
 
virtual void InternalTransformPoint (const float in[3], float out[3])
 
virtual unsigned long GetMTime ()
 
virtual unsigned long GetUpdateTime ()
 
void SetTimeStamp (albaTimeStamp t)
 
albaTimeStamp GetTimeStamp ()
 
- Public Member Functions inherited from albaReferenceCounted
 albaReferenceCounted ()
 
virtual ~albaReferenceCounted ()
 
 albaAbstractTypeMacro (albaReferenceCounted, albaObject)
 
virtual void Delete ()
 
void Register (void *obj)
 
virtual void UnRegister (void *obj)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
- Public Member Functions inherited from albaObject
 albaObject ()
 
virtual ~albaObject ()
 
virtual void Delete ()
 
virtual const char * GetTypeName () const
 
virtual bool IsA (const char *type_name) const
 
virtual bool IsA (const albaTypeID &type_id) const
 
virtual albaObjectNewObjectInstance () const =0
 
virtual const albaTypeIDGetTypeId () const
 
virtual void Print (std::ostream &os, const int indent=0) const
 
 albaObject (const albaObject &c)
 
- Public Member Functions inherited from albaEventBroadcaster
 albaEventBroadcaster (void *owner=NULL)
 
virtual ~albaEventBroadcaster ()
 
 albaEventBroadcaster (const albaEventBroadcaster &c)
 
void AddObserver (albaObserver *obj)
 
void AddObserver (albaObserver &obj)
 
albaObserverCallbackAddObserverCallback (void(*f)(void *sender, albaID eid, void *clientdata, void *calldata))
 
bool RemoveObserver (albaObserver *obj)
 
void RemoveAllObservers ()
 
bool IsObserver (albaObserver *obj)
 
bool HasObservers ()
 
void GetObservers (std::vector< albaObserver * > &olist)
 
void InvokeEvent (albaEventBase &e)
 
void InvokeEvent (albaEventBase *e)
 
void InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
 
void SetChannel (albaID ch)
 
albaID GetChannel ()
 
virtual void SetListener (albaObserver *o)
 
- Public Member Functions inherited from albaEventSender
 albaEventSender ()
 
virtual void SetListener (albaObserver *o)
 
virtual albaObserverGetListener ()
 
virtual bool HasListener ()
 
virtual void InvokeEvent (albaEventBase &e)
 
virtual void InvokeEvent (albaEventBase *e)
 
virtual void InvokeEvent (void *sender, albaID id=ID_NO_EVENT, void *data=NULL)
 

Protected Member Functions

void SetBounds (albaOBB *bounds)
 
albaOBBGetBounds ()
 
void UpdatePoseMatrix (albaMatrix *matrix, albaMatrix *old_view_matrix, albaMatrix *new_view_matrix)
 
void RecomputeAll ()
 
void AutoFitting ()
 
virtual void InternalUpdate ()
 
virtual void InternalUpdate ()=0
 

Static Protected Member Functions

static void AutoFitting (albaMatrix *matrix, albaOBB *tracked_bounds, vtkRenderer *ren)
 
static void ComputeScaling (albaOBB *inBox, albaOBB *outBox, double *scale)
 
static void InternalProcessEvents (vtkObject *sender, unsigned long channel, void *clientdata, void *calldata)
 

Protected Attributes

double m_RenderWindowHeightPercentage
 
vtkRenderer * m_Renderer
 
vtkCamera * m_Camera
 
bool m_FollowScale
 
albaOBBm_Bounds
 
double m_VMEBounds [6]
 
float m_OldViewAngle
 
double m_OldDistance
 
albaMatrixm_OldViewMatrix
 
vtkCallbackCommand * m_EventRouter
 
vtkActor * m_Actor
 
albaVMEm_VME
 
- Protected Attributes inherited from albaTransformBase
albaAutoPointer< albaMatrixm_Matrix
 
albaMTime m_MTime
 
albaMTime m_UpdateTime
 
albaMutexLock m_UpdateMutex
 
albaTimeStamp m_TimeStamp
 
- Protected Attributes inherited from albaReferenceCounted
int m_ReferenceCount
 
- Protected Attributes inherited from albaObject
bool m_HeapFlag
 
- Protected Attributes inherited from albaEventBroadcaster
albaObserversList m_Observers
 
albaID m_Channel
 
- Protected Attributes inherited from albaEventSender
albaObserverm_Listener
 

Additional Inherited Members

- Static Public Member Functions inherited from albaObject
static const char * GetStaticTypeName ()
 
static bool IsStaticType (const char *type_name)
 
static bool IsStaticType (const albaTypeID &type_id)
 
static const albaTypeIDGetStaticTypeId ()
 
static albaObjectSafeDownCast (albaObject *o)
 
- Protected Types inherited from albaEventBroadcaster
typedef std::list< albaObserver * > albaObserversList
 

Detailed Description

Helper object for gizmo autoscaling ie actor2D-like behavior.

Definition at line 40 of file albaGizmoAutoscaleHelper.h.

Constructor & Destructor Documentation

◆ albaGizmoAutoscaleHelper()

albaGizmoAutoscaleHelper::albaGizmoAutoscaleHelper ( )

◆ ~albaGizmoAutoscaleHelper()

virtual albaGizmoAutoscaleHelper::~albaGizmoAutoscaleHelper ( )
virtual

Member Function Documentation

◆ albaTypeMacro()

albaGizmoAutoscaleHelper::albaTypeMacro ( albaGizmoAutoscaleHelper  ,
albaTransformBase   
)

◆ SetRenderer()

void albaGizmoAutoscaleHelper::SetRenderer ( vtkRenderer *  ren)

Set the renderer used as input for this transform.

◆ GetRenderer()

vtkRenderer * albaGizmoAutoscaleHelper::GetRenderer ( )
inline

Return the renderer used as input for this transform.

Definition at line 52 of file albaGizmoAutoscaleHelper.h.

◆ SetFollowScale()

void albaGizmoAutoscaleHelper::SetFollowScale ( bool  flag)
inline

Enable/Disable following of the camera scaling (on by default)

Definition at line 55 of file albaGizmoAutoscaleHelper.h.

References albaTransformBase::Modified().

Here is the call graph for this function:

◆ GetFollowScale()

bool albaGizmoAutoscaleHelper::GetFollowScale ( )
inline

Definition at line 56 of file albaGizmoAutoscaleHelper.h.

◆ FollowScaleOn()

void albaGizmoAutoscaleHelper::FollowScaleOn ( )
inline

Definition at line 57 of file albaGizmoAutoscaleHelper.h.

◆ FollowScaleOff()

void albaGizmoAutoscaleHelper::FollowScaleOff ( )
inline

Definition at line 58 of file albaGizmoAutoscaleHelper.h.

◆ SetRenderWindowHeightPercentage()

void albaGizmoAutoscaleHelper::SetRenderWindowHeightPercentage ( double  percentage)
inline

Set the size of the gizmo when autoscale is enabled.

The size is expressed as gizmoHeight / renderWindowHeight. Max size is 1 (gizmo height equal to the render window one). This setting has no effect when autoscale is off

Definition at line 62 of file albaGizmoAutoscaleHelper.h.

◆ GetRenderWindowHeightPercentage()

double albaGizmoAutoscaleHelper::GetRenderWindowHeightPercentage ( )
inline

Definition at line 63 of file albaGizmoAutoscaleHelper.h.

◆ SetActor()

void albaGizmoAutoscaleHelper::SetActor ( vtkActor *  actor)
inline

Set the prop to be autoscaled (to be used from the pipe)

Definition at line 66 of file albaGizmoAutoscaleHelper.h.

◆ GetActor()

vtkActor * albaGizmoAutoscaleHelper::GetActor ( )
inline

Definition at line 67 of file albaGizmoAutoscaleHelper.h.

◆ SetVME()

void albaGizmoAutoscaleHelper::SetVME ( albaVME vme)

Set the vme to be autoscaled (to be used from the pipe)

◆ GetVME()

albaVME * albaGizmoAutoscaleHelper::GetVME ( )
inline

Definition at line 71 of file albaGizmoAutoscaleHelper.h.

◆ DeepCopy()

virtual int albaGizmoAutoscaleHelper::DeepCopy ( albaGizmoAutoscaleHelper trans)
virtual

◆ GetMTime()

virtual unsigned long albaGizmoAutoscaleHelper::GetMTime ( )
virtual

Get the MTime: this is the bit of magic that makes everything work.

This MTime takes in consideration also the camera's MTime

Reimplemented from albaTransformBase.

◆ SetBounds()

void albaGizmoAutoscaleHelper::SetBounds ( albaOBB bounds)
inlineprotected

Set the bounds of the object that should follow the camera.

This is necessary to allow the the right scaling.

Definition at line 85 of file albaGizmoAutoscaleHelper.h.

◆ GetBounds()

albaOBB * albaGizmoAutoscaleHelper::GetBounds ( )
inlineprotected

Definition at line 86 of file albaGizmoAutoscaleHelper.h.

◆ UpdatePoseMatrix()

void albaGizmoAutoscaleHelper::UpdatePoseMatrix ( albaMatrix matrix,
albaMatrix old_view_matrix,
albaMatrix new_view_matrix 
)
protected

Change the given matrix to follow camera movements.

◆ RecomputeAll()

void albaGizmoAutoscaleHelper::RecomputeAll ( )
protected

◆ AutoFitting() [1/2]

static void albaGizmoAutoscaleHelper::AutoFitting ( albaMatrix matrix,
albaOBB tracked_bounds,
vtkRenderer *  ren 
)
staticprotected

Change matrix scale to create a transform making two boxes to fit.Translation and Orientation are left unchanged.

Fitting can occur according to different modalities.

See also
ComputeScaling()

◆ AutoFitting() [2/2]

void albaGizmoAutoscaleHelper::AutoFitting ( )
inlineprotected

Definition at line 98 of file albaGizmoAutoscaleHelper.h.

References AutoFitting().

Referenced by AutoFitting().

Here is the call graph for this function:

◆ ComputeScaling()

static void albaGizmoAutoscaleHelper::ComputeScaling ( albaOBB inBox,
albaOBB outBox,
double *  scale 
)
staticprotected

Compute scale between two boxes in order to fit viewport Y.

◆ InternalUpdate()

virtual void albaGizmoAutoscaleHelper::InternalUpdate ( )
protectedvirtual

Updates the internal matrix.

Implements albaTransformBase.

◆ InternalProcessEvents()

static void albaGizmoAutoscaleHelper::InternalProcessEvents ( vtkObject *  sender,
unsigned long  channel,
void *  clientdata,
void *  calldata 
)
staticprotected

Member Data Documentation

◆ m_RenderWindowHeightPercentage

double albaGizmoAutoscaleHelper::m_RenderWindowHeightPercentage
protected

gizmoHeight / renderWindowHeight (1 at maximum)

Definition at line 104 of file albaGizmoAutoscaleHelper.h.

◆ m_Renderer

vtkRenderer* albaGizmoAutoscaleHelper::m_Renderer
protected

This stores the renderer used as input.

Definition at line 111 of file albaGizmoAutoscaleHelper.h.

◆ m_Camera

vtkCamera* albaGizmoAutoscaleHelper::m_Camera
protected

this is to find if the render's active camera is changed

Definition at line 112 of file albaGizmoAutoscaleHelper.h.

◆ m_FollowScale

bool albaGizmoAutoscaleHelper::m_FollowScale
protected

Flag for enabling the scaling according to camera frustum.

Definition at line 113 of file albaGizmoAutoscaleHelper.h.

◆ m_Bounds

albaOBB* albaGizmoAutoscaleHelper::m_Bounds
protected

m_Bounds of the object that should follow the camera

Definition at line 115 of file albaGizmoAutoscaleHelper.h.

◆ m_VMEBounds

double albaGizmoAutoscaleHelper::m_VMEBounds[6]
protected

Input VME bounds

Definition at line 117 of file albaGizmoAutoscaleHelper.h.

◆ m_OldViewAngle

float albaGizmoAutoscaleHelper::m_OldViewAngle
protected

Definition at line 119 of file albaGizmoAutoscaleHelper.h.

◆ m_OldDistance

double albaGizmoAutoscaleHelper::m_OldDistance
protected

Definition at line 120 of file albaGizmoAutoscaleHelper.h.

◆ m_OldViewMatrix

albaMatrix* albaGizmoAutoscaleHelper::m_OldViewMatrix
protected

Definition at line 121 of file albaGizmoAutoscaleHelper.h.

◆ m_EventRouter

vtkCallbackCommand* albaGizmoAutoscaleHelper::m_EventRouter
protected

Definition at line 123 of file albaGizmoAutoscaleHelper.h.

◆ m_Actor

vtkActor* albaGizmoAutoscaleHelper::m_Actor
protected

Definition at line 125 of file albaGizmoAutoscaleHelper.h.

◆ m_VME

albaVME* albaGizmoAutoscaleHelper::m_VME
protected

Definition at line 126 of file albaGizmoAutoscaleHelper.h.


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