mt
 All Classes Files Functions Enumerations Groups Pages
Public Member Functions | List of all members
mt::Transform Class Reference

Rigid transformation class. More...

#include <transform.h>

Public Member Functions

 Transform ()
 Default constructor. Creates identity transform.
 Transform (const Rotation &rotation, const Point3 &translation)
 Constructor for rotation and translation input.
Transformoperator*= (const Transform &t)
 Obtains the composition of the current and input transforms.
Point3 operator() (const Point3 &p) const
 Applies transform to input point.
bool operator== (const Transform &t) const
bool operator!= (const Transform &t) const
Transform inverse () const
 Inverse transform.
Point3 getTranslation () const
 Gets translational component of transform.
Point3getTranslationRef ()
const Point3getTranslationRef () const
Rotation getRotation () const
 Gets rotational component of transform.
RotationgetRotationRef ()
const RotationgetRotationRef () const
void setTranslation (const Point3 &translation)
 Sets translational component of transform.
void setRotation (const Rotation &rotation)
 Sets rotational component of transform.
void setIdentity ()
 Sets identity transform.

Detailed Description

Rigid transformation class.

The Transform class provides the usual operators and functions used for expressing and manipulating rigid transformations.

This is an example of how to use the Transform class:

using namespace mt;
// Constructor
const Unit3 axis(1.0, 0.0, 0.0);
const Scalar angle = HALF_PI;
const Rotation rot(axis, angle); // Rotational part
const Point3 tr(2.0, -1.0, 1.0); // Translational part
const Transform T1(rot, tr);
const Transform T2 = T1 * T1;
// Applying a transform to a vector
const Point3 p_initial(0.0, 0.0, 1.0);
Point3 p_final;
p_final = T1(p_initial); // p_final = [2.0, -2.0, 1.0]
p_final = T2(p_initial); // p_final = [4.0, -2.0, -1.0]
p_final = (T1 * T1)(p_initial); // Same as above
p_final = T2 * p_initial; // Same as above
p_final = T1 * T1 * p_initial; // Same as above

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