Transformation Class Reference

Transformation for homogenous three dimensional space. More...

#include <transformation.hpp>

List of all members.

Public Member Functions

 Transformation ()
 Constructor for identity transformation.
 Transformation (double x11, double x12, double x13, double x14, double x21, double x22, double x23, double x24, double x31, double x32, double x33, double x34, double x41, double x42, double x43, double x44)
 Constructor for preset transformation matrix.
 Transformation (const Transformation &m)
 Copy constructor.
 ~Transformation ()
 Destructor.
double & operator[] (int i)
 Indexing for transformation matrix.
const double & operator[] (int i) const
 Indexing for constant transformation matrix.
double determinant (void) const
 Return determinant of matrix.
Transformation inverse (void) const
 Return inverse matrix.
const Transformationoperator *= (double s)
 Multiplication of tranformation matrix by scalar.
Transformation operator * (const Transformation &m) const
 Multiplication of transformation matrices for combining transformations.
Vec4D operator * (const Vec4D &v) const
 Multiplication of tranformation matrix by vector.
Vec4D operator% (const Vec4D &v) const
 Multiplication of the transpose of the tranformation matrix by vector.
Vec4D transform (const Vec4D &xin) const
 Transform homogenous vector xin.
Vec3D transform_point (const Vec3D &xin) const
 Transform point xin.
Vec3D inv_transform_point (const Vec3D &xin) const
 Inverse transform point xin.
Vec3D transform_vector (const Vec3D &xin) const
 Transform vector xin.
Vec3D inv_transform_vector (const Vec3D &xin) const
 Inverse transform vector xin.
void translate (const Vec3D &d)
 Translate transformation.
void scale (const Vec3D &s)
 Scale transformation.
void rotate_x (double a)
 Rotate transformation around x-axis.
void rotate_y (double a)
 Rotate transformation around y-axis.
void rotate_z (double a)
 Rotate transformation around z-axis.

Static Public Member Functions

static Transformation translation (const Vec3D &d)
 Return translation transformation.
static Transformation scaling (const Vec3D &s)
 Return scaling transformation.
static Transformation rotation_x (double a)
 Return rotation transformation rotating around x-axis.
static Transformation rotation_y (double a)
 Return rotation transformation rotating around y-axis.
static Transformation rotation_z (double a)
 Return rotation transformation rotating around z-axis.

Friends

std::ostream & operator<< (std::ostream &os, const Transformation &t)
 Outputting to stream.


Detailed Description

Transformation for homogenous three dimensional space.

Transformation for homogenous three dimensional space operates of 4-vectors of type Vec4D. The transformation contains convenience functions for making affine transformations on 3-vectors of type Vec3D.


Constructor & Destructor Documentation

Transformation::Transformation (  )  [inline]

Constructor for identity transformation.

Transformation::Transformation ( double  x11,
double  x12,
double  x13,
double  x14,
double  x21,
double  x22,
double  x23,
double  x24,
double  x31,
double  x32,
double  x33,
double  x34,
double  x41,
double  x42,
double  x43,
double  x44 
) [inline]

Constructor for preset transformation matrix.

Transformation::Transformation ( const Transformation m  )  [inline]

Copy constructor.

Transformation::~Transformation (  )  [inline]

Destructor.


Member Function Documentation

double Transformation::determinant ( void   )  const

Return determinant of matrix.

Vec3D Transformation::inv_transform_point ( const Vec3D xin  )  const

Inverse transform point xin.

Assumes the transformation is affine. Homogenization of output vector is not done.

This is a convenience function to inverting a transformation matrix and then doing a transform. If more than one transform is done inverse() and transform() functions should be used.

Vec3D Transformation::inv_transform_vector ( const Vec3D xin  )  const

Inverse transform vector xin.

Assumes the transformation is affine. Homogenization of output vector is not done.

This is a convenience function to inverting a transformation matrix and then doing a transform. If more than one transform is done inverse() and transform_vector() functions should be used.

Transformation Transformation::inverse ( void   )  const

Return inverse matrix.

Vec4D Transformation::operator * ( const Vec4D v  )  const

Multiplication of tranformation matrix by vector.

Makes a full transformation on the homogenous vector v.

Transformation Transformation::operator * ( const Transformation m  )  const

Multiplication of transformation matrices for combining transformations.

Tranformation is done by multiplying the matrix with a vector from the right. Therefore the multiplication of transformation matrices has the effect that the right-hand-side transformation is applied first and left-hand-side second.

const Transformation& Transformation::operator *= ( double  s  ) 

Multiplication of tranformation matrix by scalar.

Vec4D Transformation::operator% ( const Vec4D v  )  const

Multiplication of the transpose of the tranformation matrix by vector.

Used for transforming surface normal vectors.

const double& Transformation::operator[] ( int  i  )  const [inline]

Indexing for constant transformation matrix.

double& Transformation::operator[] ( int  i  )  [inline]

Indexing for transformation matrix.

void Transformation::rotate_x ( double  a  )  [inline]

Rotate transformation around x-axis.

The effect of the new transformation is to first rotate the coordinates and then apply the old transformation.

void Transformation::rotate_y ( double  a  )  [inline]

Rotate transformation around y-axis.

The effect of the new transformation is to first rotate the coordinates and then apply the old transformation.

void Transformation::rotate_z ( double  a  )  [inline]

Rotate transformation around z-axis.

The effect of the new transformation is to first rotate the coordinates and then apply the old transformation.

static Transformation Transformation::rotation_x ( double  a  )  [inline, static]

Return rotation transformation rotating around x-axis.

static Transformation Transformation::rotation_y ( double  a  )  [inline, static]

Return rotation transformation rotating around y-axis.

static Transformation Transformation::rotation_z ( double  a  )  [inline, static]

Return rotation transformation rotating around z-axis.

void Transformation::scale ( const Vec3D s  )  [inline]

Scale transformation.

The effect of the new transformation is to first scale the coordinates and then apply the old transformation.

static Transformation Transformation::scaling ( const Vec3D s  )  [inline, static]

Return scaling transformation.

Vec4D Transformation::transform ( const Vec4D xin  )  const

Transform homogenous vector xin.

Vec3D Transformation::transform_point ( const Vec3D xin  )  const

Transform point xin.

Assumes the transformation is affine. Homogenization of output vector is not done.

Vec3D Transformation::transform_vector ( const Vec3D xin  )  const

Transform vector xin.

Assumes the transformation is affine. Homogenization of output vector is not done.

void Transformation::translate ( const Vec3D d  )  [inline]

Translate transformation.

The effect of the new transformation is to first translate the coordinates and then apply the old transformation.

static Transformation Transformation::translation ( const Vec3D d  )  [inline, static]

Return translation transformation.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Transformation t 
) [friend]

Outputting to stream.


The documentation for this class was generated from the following file:
Generated on Thu Apr 21 13:39:22 2011 for IBSimu by  doxygen 1.4.7