ALBA
|
#include <albaInteractorConstraint.h>
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) |
albaRefSys * | GetRefSys () |
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 | |
albaRefSys * | m_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] |
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:
during rotation the RefSys is the rotation reference system ie its position is the centre of rotation.
Definition at line 47 of file albaInteractorConstraint.h.
The possible constrained modalities for each axis.
Enumerator | |
---|---|
LOCK | |
FREE | |
BOUNDS | |
SNAP_STEP | |
SNAP_ARRAY |
Definition at line 79 of file albaInteractorConstraint.h.
albaInteractorConstraint::albaInteractorConstraint | ( | ) |
|
virtual |
albaInteractorConstraint::albaInteractorConstraint | ( | const albaInteractorConstraint & | source | ) |
Copy constructor to allow object copy.
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).
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.
int albaInteractorConstraint::GetConstraintModality | ( | int | axis | ) |
Get the constraint modality for the given axis.
int albaInteractorConstraint::GetNumberOfDOF | ( | ) |
Get the number of axis on which movement is allowed (ie unlocked axis).
If DOF==3 the movement is unconstrained.
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.
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.
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.
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.
void albaInteractorConstraint::SetLowerBound | ( | int | axis, |
double | lbound | ||
) |
Set the lower bound for bound constraint type for the given axis.
double albaInteractorConstraint::GetLowerBound | ( | int | axis | ) |
Get the lower bound for bound constraint type for the given axis.
void albaInteractorConstraint::SetUpperBound | ( | int | axis, |
double | ubound | ||
) |
Set the upper bound for bound constraint type for the given axis.
double albaInteractorConstraint::GetUpperBound | ( | int | axis | ) |
Get the upper bound for bound constraint type for the given axis.
void albaInteractorConstraint::SetBounds | ( | int | axis, |
double * | bounds | ||
) |
Set the bounds interval.
void albaInteractorConstraint::GetBounds | ( | int | axis, |
double * | bounds | ||
) |
Get the bounds interval.
void albaInteractorConstraint::SetMin | ( | int | axis, |
double | min | ||
) |
Set the min value for snap step constraint type for the given axis.
double albaInteractorConstraint::GetMin | ( | int | axis | ) |
Get the min value for snap step constraint type for the given axis.
void albaInteractorConstraint::SetMax | ( | int | axis, |
double | min | ||
) |
Set the max value for snap step constraint type for the given axis.
double albaInteractorConstraint::GetMax | ( | int | axis | ) |
Get the max value for snap step constraint type for the given axis.
void albaInteractorConstraint::SetStep | ( | int | axis, |
double | step | ||
) |
Set the step value for snap step constraint type for the given axis.
double albaInteractorConstraint::GetStep | ( | int | axis | ) |
Get the step value for snap step constraint type for the given axis.
void albaInteractorConstraint::SetSnapStep | ( | int | axis, |
double | min, | ||
double | max, | ||
double | step | ||
) |
Set snap step modality parameters.
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
vtkDoubleArray * albaInteractorConstraint::GetSnapArray | ( | int | axis | ) |
Get the array which contains the allowed positions for snap.
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.
void albaInteractorConstraint::SetRefSys | ( | albaRefSys * | ref_sys | ) |
Copy the contents of another RefSys into the contraint one.
void albaInteractorConstraint::SetRefSys | ( | albaRefSys & | ref_sys | ) |
void albaInteractorConstraint::Print | ( | std::ostream & | os, |
const int | tabs | ||
) |
Debug printing of internal data.
|
inline |
Definition at line 210 of file albaInteractorConstraint.h.
|
protected |
the constraint reference system
Definition at line 215 of file albaInteractorConstraint.h.
|
protected |
Register constraint modality for each axis.
Definition at line 218 of file albaInteractorConstraint.h.
|
protected |
Bounds modality parameters.
Definition at line 221 of file albaInteractorConstraint.h.
|
protected |
Definition at line 222 of file albaInteractorConstraint.h.
|
protected |
Snap step modality parameters.
Definition at line 225 of file albaInteractorConstraint.h.
|
protected |
Definition at line 226 of file albaInteractorConstraint.h.
|
protected |
Definition at line 227 of file albaInteractorConstraint.h.
|
protected |
Snap array modality.
Definition at line 230 of file albaInteractorConstraint.h.