class mpkTransform

The base class for representing spatial transforms.

Inheritance:


Public Fields

odouble R [3][3]
Orientation matrix
odouble T [3]
Translation vector

Public Methods

[more] mpkTransform (const SoTransform* X=0)
[more]void bind (const double* param_ptr)
[more]void rescale (double scalef)
[more]double get_scale ()
[more]TYPE get_type ()
[more]const double* get_axis ()
[more]bool update ()
[more]void set_product (const mpkTransform& X, const mpkTransform& Y)
[more]void append (const mpkTransform& X)
[more]mpkTransform& operator* (const mpkTransform& X)
[more]void set_identity ()
[more]bool is_identity () const
[more]void apply (double out[3], const double in[3]) const
[more]static void apply (double out[3], const double R[3][3], const double T[3], const double in[3])
[more]void apply_inv (double out[3], const double in[3]) const
[more]void print (ostream& f=cout) const
[more] operator SbMatrix () const

Public Members

oenum TYPE
  • constant: constant transform
  • rot1: rotation around axis
  • transl_rot1: rotation around axis, then constant transl
  • transl1: translation along axis
  • func: general functional dependency


Documentation

For efficiency reasons, there is not an abstract base class plus several derived classes, one for each transform type. Instead, this single mpkTransform class includes a type flag and implements all possible transforms. The fields (R,T) store the current values of the transform. Further private fields store information required to update certain transform types, such as axis for a rotation.

Since multiple transforms can depend on the same parameter(s), each parameterized transform must be bound to a set of (normalized) parameters (each in [0,1]) using bind(). Once this has been done, the function update() can read the current values of the assigned parameters to recompute R and T.

For further details see mpkTransform.H.

o mpkTransform(const SoTransform* X=0)
construct from constant transform given by X

ovoid bind(const double* param_ptr)
For binding a parameterized transform to one or more normalized parameters. param_ptr must point to the first parameter.

ovoid rescale(double scalef)
Sets the scale factor.

odouble get_scale()
Returns the scale factor.

oTYPE get_type()
Returns the type.

oconst double* get_axis()
Returns the axis (only meaningful for some transforms).

obool update()
Updates the transform (after at least one parameter has been changed). Returns true for parameterized transform, false for constant transform.

ovoid set_product(const mpkTransform& X, const mpkTransform& Y)
set transform to X*Y

ovoid append(const mpkTransform& X)
concatenate X to the right to the transform

ompkTransform& operator*(const mpkTransform& X)
operator * has the same effect as append()

ovoid set_identity()
sets (R,T) to identity transform but does not modify the type flag

obool is_identity() const
returns true if (R,T) is identity transform

ovoid apply(double out[3], const double in[3]) const
apply transform to in and store result in out

ostatic void apply(double out[3], const double R[3][3], const double T[3], const double in[3])
apply transform (R,T) to in and store result in out

ovoid apply_inv(double out[3], const double in[3]) const
apply the inverse of the transform to in and store result in out

ovoid print(ostream& f=cout) const
print to f

o operator SbMatrix() const
convert to SbMatrix


Direct child classes:
mpkTransl1
mpkRot1
mpkFuncTransf
mpkConstTransl_Rot1
mpkConstTransl
mpkConstRot

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.