Thea
Public Types | Public Member Functions | Static Public Member Functions | List of all members
RigidTransformN< N, T > Class Template Reference

A rigid transformation in N-space, consisting of a rotation followed by a translation. More...

#include <RigidTransformN.hpp>

Inheritance diagram for RigidTransformN< N, T >:
RigidTransformNBase< N, T > CoordinateFrameNBase< 2, T > CoordinateFrameNBase< 3, T > CoordinateFrameNBase< N, T > CoordinateFrameN< 2, T > CoordinateFrameN< 3, T > CoordinateFrameN< N, T >

Public Types

typedef RigidTransformN< N, T > RigidTransformT
 N-dimensional rigid transform type. More...
 

Public Member Functions

void _setRotation (MatrixT const &rot)
 Set the rotation matrix (use with caution since it can break the rigidity guarantee). More...
 
template<typename U >
RigidTransformN< N, U > cast () const
 Cast the transform to a different scalar type. More...
 
MatrixT const & getRotation () const
 Get rotation component. More...
 
VectorT const & getTranslation () const
 Get translation component. More...
 
Matrix< N+1, N+1, T > homogeneous () const
 Convert to an (N + 1) x (N + 1) transformation matrix in homogeneous coordinates (last row is identity). More...
 
RigidTransformT inverse () const
 Get the inverse transform. More...
 
 operator AffineTransformT () const
 Convert to a general affine transform. More...
 
Real operator() (int i, int j) const
 Get an element of the N x (N + 1) matrix representing this transform. More...
 
RigidTransformT operator* (RigidTransformT const &rhs) const
 Compose this transform with another. More...
 
VectorT operator* (VectorT const &v) const
 Apply this transform to a N-vector. More...
 
 RigidTransformN ()
 Default constructor. More...
 
void setIdentity ()
 Set the transform to identity. More...
 
void setTranslation (VectorT const &translation_)
 Set translation component. More...
 
AffineTransformT const & toAffine () const
 Convert to a general affine transform. More...
 
Matrix< N, N+1, T > toMatrix () const
 Convert to an N x (N + 1) transformation matrix. More...
 
std::string toString () const
 Get a string representing the transform. More...
 

Static Public Member Functions

static RigidTransformT _fromAffine (AffineTransformT const &aff_)
 Construct from an affine transform, assuming it is rigid (use with caution since it can break the rigidity guarantee). More...
 
static RigidTransformT const & identity ()
 Get the identity transform. More...
 
static RigidTransformT translation (VectorT const &translation_)
 Construct a translation. More...
 

Detailed Description

template<int N, typename T = Real>
class Thea::RigidTransformN< N, T >

A rigid transformation in N-space, consisting of a rotation followed by a translation.

Note
While this is technically an affine transform, it restricts enough functionality to make a separate implementation preferable. It can be trivially converted to an AffineTransformN using the implicit conversion operator or toAffine().

Definition at line 25 of file RigidTransformN.hpp.

Member Typedef Documentation

typedef RigidTransformN<N, T> RigidTransformT
inherited

N-dimensional rigid transform type.

Definition at line 41 of file RigidTransformN.hpp.

Constructor & Destructor Documentation

Default constructor.

Constructs the identity transform.

Definition at line 164 of file RigidTransformN.hpp.

Member Function Documentation

static RigidTransformT _fromAffine ( AffineTransformT const &  aff_)
staticinherited

Construct from an affine transform, assuming it is rigid (use with caution since it can break the rigidity guarantee).

Definition at line 62 of file RigidTransformN.hpp.

void _setRotation ( MatrixT const &  rot)
inherited

Set the rotation matrix (use with caution since it can break the rigidity guarantee).

Definition at line 82 of file RigidTransformN.hpp.

RigidTransformN<N, U> cast ( ) const
inherited

Cast the transform to a different scalar type.

Definition at line 70 of file RigidTransformN.hpp.

MatrixT const& getRotation ( ) const
inherited

Get rotation component.

Definition at line 79 of file RigidTransformN.hpp.

VectorT const& getTranslation ( ) const
inherited

Get translation component.

Definition at line 85 of file RigidTransformN.hpp.

Matrix<N + 1, N + 1, T> homogeneous ( ) const
inherited

Convert to an (N + 1) x (N + 1) transformation matrix in homogeneous coordinates (last row is identity).

Definition at line 94 of file RigidTransformN.hpp.

static RigidTransformT const& identity ( )
staticinherited

Get the identity transform.

Definition at line 133 of file RigidTransformN.hpp.

RigidTransformT inverse ( ) const
inherited

Get the inverse transform.

Definition at line 109 of file RigidTransformN.hpp.

operator AffineTransformT ( ) const
inherited

Convert to a general affine transform.

This may be less efficient than toAffine(), but the code looks cleaner (e.g. in a * b * c, each of the variables can be either AffineTransformT or RigidTransformT).

Definition at line 106 of file RigidTransformN.hpp.

Real operator() ( int  i,
int  j 
) const
inherited

Get an element of the N x (N + 1) matrix representing this transform.

Definition at line 116 of file RigidTransformN.hpp.

RigidTransformT operator* ( RigidTransformT const &  rhs) const
inherited

Compose this transform with another.

The other is applied first.

Definition at line 119 of file RigidTransformN.hpp.

VectorT operator* ( VectorT const &  v) const
inherited

Apply this transform to a N-vector.

Definition at line 122 of file RigidTransformN.hpp.

void setIdentity ( )
inherited

Set the transform to identity.

Definition at line 76 of file RigidTransformN.hpp.

void setTranslation ( VectorT const &  translation_)
inherited

Set translation component.

Definition at line 88 of file RigidTransformN.hpp.

AffineTransformT const& toAffine ( ) const
inherited

Convert to a general affine transform.

This may be more efficient than the conversion operator since it explicitly omits any possible copying, but the code doesn't look as clean.

Definition at line 100 of file RigidTransformN.hpp.

Matrix<N, N + 1, T> toMatrix ( ) const
inherited

Convert to an N x (N + 1) transformation matrix.

Definition at line 91 of file RigidTransformN.hpp.

std::string toString ( ) const
inherited

Get a string representing the transform.

Definition at line 125 of file RigidTransformN.hpp.

static RigidTransformT translation ( VectorT const &  translation_)
staticinherited

Construct a translation.

Definition at line 53 of file RigidTransformN.hpp.


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