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

#include <albaInteractorConstraint.h>

Collaboration diagram for albaInteractorConstraint:
Collaboration graph
[legend]

Public Types

enum  AXIS { X = 0 , Y , Z , NUM_AXES }
 
enum  PLANE { XY = 0 , XZ , YZ , NUM_PLANES }
 
enum  CONSTRAINT_MODALITY {
  LOCK = 0 , FREE , BOUNDS , SNAP_STEP ,
  SNAP_ARRAY
}
 

Public Member Functions

 albaInteractorConstraint ()
 
virtual ~albaInteractorConstraint ()
 
 albaInteractorConstraint (const albaInteractorConstraint &source)
 
void SetConstraintModality (int constraintModalityOnX, int constraintModalityOnY, int constraintModalityOnZ)
 
void SetConstraintModality (int axis, int constrainModality)
 
int GetConstraintModality (int axis)
 
int GetNumberOfDOF ()
 
int GetConstraintAxis ()
 
int GetConstraintPlane ()
 
int GetConstraintPlaneAxes (int &axis1, int &axis2)
 
void Reset ()
 
void SetLowerBound (int axis, double lbound)
 
double GetLowerBound (int axis)
 
void SetUpperBound (int axis, double ubound)
 
double GetUpperBound (int axis)
 
void SetBounds (int axis, double *bounds)
 
void GetBounds (int axis, double *bounds)
 
void SetMin (int axis, double min)
 
double GetMin (int axis)
 
void SetMax (int axis, double min)
 
double GetMax (int axis)
 
void SetStep (int axis, double step)
 
double GetStep (int axis)
 
void SetSnapStep (int axis, double min, double max, double step)
 
void SetSnapArray (int axis, vtkDoubleArray *array)
 
vtkDoubleArray * GetSnapArray (int axis)
 
albaRefSysGetRefSys ()
 
void SetRefSys (albaRefSys *ref_sys)
 
void SetRefSys (albaRefSys &ref_sys)
 
void Print (std::ostream &os, const int tabs)
 
void DeepCopy (const albaInteractorConstraint *source)
 

Protected Attributes

albaRefSysm_RefSys
 
int m_ConstraintModality [3]
 
double m_LowerBound [3]
 
double m_UpperBound [3]
 
double m_Min [3]
 
double m_Max [3]
 
double m_Step [3]
 
vtkALBAAutoPointer< vtkDoubleArray > m_SnapArray [3]
 

Detailed Description

class representing a constraint for the interaction This class is used to store constraint modality parameters and owns a reference system used for constrained interaction.

The stored reference system is used as pivot reference system ie:

Definition at line 47 of file albaInteractorConstraint.h.

Member Enumeration Documentation

◆ AXIS

Axis enum.

Enumerator
NUM_AXES 

Definition at line 61 of file albaInteractorConstraint.h.

◆ PLANE

Plane enum.

Enumerator
XY 
XZ 
YZ 
NUM_PLANES 

Definition at line 70 of file albaInteractorConstraint.h.

◆ CONSTRAINT_MODALITY

The possible constrained modalities for each axis.

Enumerator
LOCK 
FREE 
BOUNDS 
SNAP_STEP 
SNAP_ARRAY 

Definition at line 79 of file albaInteractorConstraint.h.

Constructor & Destructor Documentation

◆ albaInteractorConstraint() [1/2]

albaInteractorConstraint::albaInteractorConstraint ( )

◆ ~albaInteractorConstraint()

virtual albaInteractorConstraint::~albaInteractorConstraint ( )
virtual

◆ albaInteractorConstraint() [2/2]

albaInteractorConstraint::albaInteractorConstraint ( const albaInteractorConstraint source)

Copy constructor to allow object copy.

Member Function Documentation

◆ SetConstraintModality() [1/2]

void albaInteractorConstraint::SetConstraintModality ( int  constraintModalityOnX,
int  constraintModalityOnY,
int  constraintModalityOnZ 
)

Contrain on a specified axis, plane or unconstrained; allowed constraints are LOCK, FREE, SNAP_STEP, SNAP_ARRAY For example to allow free movement only along X axis use SetConstraintAxis(FREE, LOCK, LOCK).

◆ SetConstraintModality() [2/2]

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

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

◆ GetConstraintModality()

int albaInteractorConstraint::GetConstraintModality ( int  axis)

Get the constraint modality for the given axis.

◆ GetNumberOfDOF()

int albaInteractorConstraint::GetNumberOfDOF ( )

Get the number of axis on which movement is allowed (ie unlocked axis).

If DOF==3 the movement is unconstrained.

◆ GetConstraintAxis()

int albaInteractorConstraint::GetConstraintAxis ( )

Return constraint axis when there is only one degree of freedom for the given movement type.

If there is more than one dof returns -1.

◆ GetConstraintPlane()

int albaInteractorConstraint::GetConstraintPlane ( )

Return the constraint plane ie an integer from the enum {XY= 0, XZ, YZ} when there are two degree of freedom for the given movement type.

Returns -1 if dof number is different from 2.

◆ GetConstraintPlaneAxes()

int albaInteractorConstraint::GetConstraintPlaneAxes ( int &  axis1,
int &  axis2 
)

Return the constraint plane axes when there are two degree of freedom for the given movement type.

Returns -1 if dof number is different from 2, 0 if dof number is 2.

◆ Reset()

void albaInteractorConstraint::Reset ( )

Constraint modality is set to LOCK for all axes, all values of the element struct are set to 0 and pointers to snap_array are set to NULL.

◆ SetLowerBound()

void albaInteractorConstraint::SetLowerBound ( int  axis,
double  lbound 
)

Set the lower bound for bound constraint type for the given axis.

◆ GetLowerBound()

double albaInteractorConstraint::GetLowerBound ( int  axis)

Get the lower bound for bound constraint type for the given axis.

◆ SetUpperBound()

void albaInteractorConstraint::SetUpperBound ( int  axis,
double  ubound 
)

Set the upper bound for bound constraint type for the given axis.

◆ GetUpperBound()

double albaInteractorConstraint::GetUpperBound ( int  axis)

Get the upper bound for bound constraint type for the given axis.

◆ SetBounds()

void albaInteractorConstraint::SetBounds ( int  axis,
double *  bounds 
)

Set the bounds interval.

◆ GetBounds()

void albaInteractorConstraint::GetBounds ( int  axis,
double *  bounds 
)

Get the bounds interval.

◆ SetMin()

void albaInteractorConstraint::SetMin ( int  axis,
double  min 
)

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

◆ GetMin()

double albaInteractorConstraint::GetMin ( int  axis)

Get the min value for snap step constraint type for the given axis.

◆ SetMax()

void albaInteractorConstraint::SetMax ( int  axis,
double  min 
)

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

◆ GetMax()

double albaInteractorConstraint::GetMax ( int  axis)

Get the max value for snap step constraint type for the given axis.

◆ SetStep()

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

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

◆ GetStep()

double albaInteractorConstraint::GetStep ( int  axis)

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

◆ SetSnapStep()

void albaInteractorConstraint::SetSnapStep ( int  axis,
double  min,
double  max,
double  step 
)

Set snap step modality parameters.

◆ SetSnapArray()

void albaInteractorConstraint::SetSnapArray ( int  axis,
vtkDoubleArray *  array 
)

Set the array which contains the allowed positions for snap.

The array is not copied, only the pointer is stored

◆ GetSnapArray()

vtkDoubleArray * albaInteractorConstraint::GetSnapArray ( int  axis)

Get the array which contains the allowed positions for snap.

◆ GetRefSys()

albaRefSys * albaInteractorConstraint::GetRefSys ( )

Get the constraint reference system, i.e.

the refsys to which the transform will be constrained also known as Pivot reference system.

◆ SetRefSys() [1/2]

void albaInteractorConstraint::SetRefSys ( albaRefSys ref_sys)

Copy the contents of another RefSys into the contraint one.

◆ SetRefSys() [2/2]

void albaInteractorConstraint::SetRefSys ( albaRefSys ref_sys)

◆ Print()

void albaInteractorConstraint::Print ( std::ostream &  os,
const int  tabs 
)

Debug printing of internal data.

◆ DeepCopy()

void albaInteractorConstraint::DeepCopy ( const albaInteractorConstraint source)
inline

Definition at line 210 of file albaInteractorConstraint.h.

Member Data Documentation

◆ m_RefSys

albaRefSys* albaInteractorConstraint::m_RefSys
protected

the constraint reference system

Definition at line 215 of file albaInteractorConstraint.h.

◆ m_ConstraintModality

int albaInteractorConstraint::m_ConstraintModality[3]
protected

Register constraint modality for each axis.

Definition at line 218 of file albaInteractorConstraint.h.

◆ m_LowerBound

double albaInteractorConstraint::m_LowerBound[3]
protected

Bounds modality parameters.

Definition at line 221 of file albaInteractorConstraint.h.

◆ m_UpperBound

double albaInteractorConstraint::m_UpperBound[3]
protected

Definition at line 222 of file albaInteractorConstraint.h.

◆ m_Min

double albaInteractorConstraint::m_Min[3]
protected

Snap step modality parameters.

Definition at line 225 of file albaInteractorConstraint.h.

◆ m_Max

double albaInteractorConstraint::m_Max[3]
protected

Definition at line 226 of file albaInteractorConstraint.h.

◆ m_Step

double albaInteractorConstraint::m_Step[3]
protected

Definition at line 227 of file albaInteractorConstraint.h.

◆ m_SnapArray

vtkALBAAutoPointer<vtkDoubleArray> albaInteractorConstraint::m_SnapArray[3]
protected

Snap array modality.

Definition at line 230 of file albaInteractorConstraint.h.


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