List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Friends
utl::TransformationMatrix Class Reference

Transformations matrices for afine transformations. More...

#include <utl/TransformationMatrix.h>

Inheritance diagram for utl::TransformationMatrix:
Inheritance graph
[legend]

Public Types

typedef boost::tuple< double,
double, double > 
Triple
 

Public Member Functions

boost::tuple
< TransformationMatrix,
TransformationMatrix
Decompose () const
 Decomposition into Translation and Rotation. More...
 
double Distance (const TransformationMatrix &second) const
 Distance between transformations (useful for testing) More...
 
TransformationMatrix Inverse () const
 Inverse transformation. More...
 
TransformationMatrixoperator*= (const TransformationMatrix &second)
 Chaining of transformations. More...
 
 TransformationMatrix ()
 

Static Public Member Functions

static TransformationMatrix Rotation (const double angle, const double x, const double y, const double z)
 Rotation by angle about axis given by three components. More...
 
static TransformationMatrix Rotation (const double angle, const Triple &v)
 
static TransformationMatrix RotationX (const double angle)
 Rotation by angle about X axis. More...
 
static TransformationMatrix RotationY (const double angle)
 Rotation by angle about Y axis. More...
 
static TransformationMatrix RotationZ (const double angle)
 Rotation by angle about Z axis. More...
 
static TransformationMatrix TransformToBasis (const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x3, const double y3, const double z3)
 From dreibein (basis vectors) More...
 
static TransformationMatrix Translation (const double x, const double y, const double z)
 Translation. More...
 

Static Public Attributes

static const int kDimension = 4
 Dimension of transformation matrix. More...
 

Private Types

typedef HepGeom::Transform3D InternalTransform
 

Private Member Functions

 TransformationMatrix (const InternalTransform &transform)
 Private constructor to build transformation from HepGeom::Transform3D. More...
 

Private Attributes

InternalTransform fTransform
 The concrete transformation object. More...
 

Friends

template<class Vector >
class BasicVector
 
class io::CoordinateSystem_ROOT
 
std::ostream & operator<< (std::ostream &s, const TransformationMatrix &m)
 
class TransformationPolicy
 

Detailed Description

Transformations matrices for afine transformations.

This class provides the transformations between coordinate systems and the objects contained in them.

We restrict ourselves to the commonly used transformations:

The current implementation does not provide scaling transformations. Transformations to non-orthogonal bases will never be provided by this package.

Special, named constructors create special transformations like rotations or translations.

All transformation are relative, so they do not require a coordinate system to be valid.

Author
Lukas Nellen
Date
23 May 2003

Definition at line 55 of file TransformationMatrix.h.

Member Typedef Documentation

typedef HepGeom::Transform3D utl::TransformationMatrix::InternalTransform
private

Definition at line 107 of file TransformationMatrix.h.

typedef boost::tuple<double, double, double> utl::TransformationMatrix::Triple

Definition at line 58 of file TransformationMatrix.h.

Constructor & Destructor Documentation

utl::TransformationMatrix::TransformationMatrix ( )
inline
utl::TransformationMatrix::TransformationMatrix ( const InternalTransform transform)
inlineprivate

Private constructor to build transformation from HepGeom::Transform3D.

Definition at line 110 of file TransformationMatrix.h.

Member Function Documentation

boost::tuple< TransformationMatrix, TransformationMatrix > TransformationMatrix::Decompose ( ) const

Decomposition into Translation and Rotation.

The original transformation is recovered as

T = trans * rot

Definition at line 71 of file TransformationMatrix.cc.

References fTransform, and TransformationMatrix().

double TransformationMatrix::Distance ( const TransformationMatrix second) const

Distance between transformations (useful for testing)

The distance functions is implemented using a simple metric on the space of matrices:

\[ ||A - B|| = \sqrt{\sum_{ij}(A_{ij}-B_{ij})^2} \]

The actual implementation is delegated.

Definition at line 40 of file TransformationMatrix.cc.

References fTransform, and sqrt().

Referenced by utl::TransformationPolicy::Distance(), testTransformationMatrix::testDistance(), testTransformationMatrix::testDreibein(), testTransformationMatrix::testRotation(), testTransformationMatrix::testTransformation(), and testTransformationMatrix::testTranslation().

TransformationMatrix TransformationMatrix::Inverse ( ) const
TransformationMatrix & TransformationMatrix::operator*= ( const TransformationMatrix second)

Chaining of transformations.

Definition at line 23 of file TransformationMatrix.cc.

References fTransform.

TransformationMatrix TransformationMatrix::Rotation ( const double  angle,
const double  x,
const double  y,
const double  z 
)
static

Rotation by angle about axis given by three components.

Create a TransformationMatrix representing a rotation

Definition at line 103 of file TransformationMatrix.cc.

References TransformationMatrix().

Referenced by utl::TransformerConstructor< Policy >::Rotation(), testTransformationMatrix::testRotation(), and testTransformationMatrix::testTransformation().

TransformationMatrix TransformationMatrix::Rotation ( const double  angle,
const Triple v 
)
static

Create a TransformationMatrix representing a rotation

Definition at line 114 of file TransformationMatrix.cc.

References TransformationMatrix().

TransformationMatrix TransformationMatrix::RotationX ( const double  angle)
static

Rotation by angle about X axis.

Create a TransformationMatrix representing a rotation about the X axis

Definition at line 127 of file TransformationMatrix.cc.

References TransformationMatrix().

Referenced by utl::TransformerConstructor< Policy >::RotationX(), testTransformationMatrix::testDreibein(), and testTransformationMatrix::testRotation().

TransformationMatrix TransformationMatrix::RotationY ( const double  angle)
static

Rotation by angle about Y axis.

Create a TransformationMatrix representing a rotation about the Y axis

Definition at line 137 of file TransformationMatrix.cc.

References TransformationMatrix().

Referenced by utl::TransformerConstructor< Policy >::RotationY(), testTransformationMatrix::testDreibein(), and testTransformationMatrix::testRotation().

TransformationMatrix TransformationMatrix::RotationZ ( const double  angle)
static

Rotation by angle about Z axis.

Create a TransformationMatrix representing a rotation about the Z axis

Definition at line 147 of file TransformationMatrix.cc.

References TransformationMatrix().

Referenced by utl::TransformerConstructor< Policy >::RotationZ(), PlotGOESNS::PlotGOES::Run(), testTransformationMatrix::testDreibein(), and testTransformationMatrix::testRotation().

TransformationMatrix TransformationMatrix::TransformToBasis ( const double  x1,
const double  y1,
const double  z1,
const double  x2,
const double  y2,
const double  z2,
const double  x3,
const double  y3,
const double  z3 
)
static

From dreibein (basis vectors)

Definition at line 154 of file TransformationMatrix.cc.

References TransformationMatrix().

Referenced by testTransformationMatrix::testDreibein(), and utl::ReferenceEllipsoid::TransformECEFToLocalSystem().

TransformationMatrix TransformationMatrix::Translation ( const double  x,
const double  y,
const double  z 
)
static

Friends And Related Function Documentation

template<class Vector >
friend class BasicVector
friend

Definition at line 121 of file TransformationMatrix.h.

friend class io::CoordinateSystem_ROOT
friend

Definition at line 124 of file TransformationMatrix.h.

std::ostream& operator<< ( std::ostream &  s,
const TransformationMatrix m 
)
friend
friend class TransformationPolicy
friend

Definition at line 122 of file TransformationMatrix.h.

Member Data Documentation

InternalTransform utl::TransformationMatrix::fTransform
private

The concrete transformation object.

The concrete transformation object is owned by the TransformationMatrix class. This means that each constructor has to allocate one, and the destructor has to delete it.

Definition at line 119 of file TransformationMatrix.h.

Referenced by io::CoordinateSystem_ROOT::CoordinateSystem_ROOT(), Decompose(), Distance(), Inverse(), utl::TransformationPolicy::operator*(), operator*=(), and utl::operator<<().

const int utl::TransformationMatrix::kDimension = 4
static

Dimension of transformation matrix.

Definition at line 61 of file TransformationMatrix.h.

Referenced by utl::operator<<().


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

, generated on Tue Sep 26 2023.