CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
HepGeom::Transform3D Class Reference

#include <Transform3D.h>

Inheritance diagram for HepGeom::Transform3D:
HepGeom::Reflect3D HepGeom::Reflect3D HepGeom::Rotate3D HepGeom::Rotate3D HepGeom::Scale3D HepGeom::Scale3D HepGeom::Translate3D HepGeom::Translate3D

List of all members.

Classes

class  Transform3D_row

Public Member Functions

 Transform3D ()
 Transform3D (const CLHEP::HepRotation &m, const CLHEP::Hep3Vector &v)
 Transform3D (const Point3D< double > &fr0, const Point3D< double > &fr1, const Point3D< double > &fr2, const Point3D< double > &to0, const Point3D< double > &to1, const Point3D< double > &to2)
 Transform3D (const Transform3D &m)
 ~Transform3D ()
const Transform3D_row operator[] (int) const
double operator() (int, int) const
double xx () const
double xy () const
double xz () const
double yx () const
double yy () const
double yz () const
double zx () const
double zy () const
double zz () const
double dx () const
double dy () const
double dz () const
Transform3Doperator= (const Transform3D &m)
void setIdentity ()
Transform3D inverse () const
Transform3D operator* (const Transform3D &b) const
void getDecomposition (Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
bool isNear (const Transform3D &t, double tolerance=2.2E-14) const
CLHEP::HepRotation getRotation () const
CLHEP::Hep3Vector getTranslation () const
bool operator== (const Transform3D &transform) const
bool operator!= (const Transform3D &transform) const
 Transform3D ()
 Transform3D (const CLHEP::HepRotation &m, const CLHEP::Hep3Vector &v)
 Transform3D (const Point3D< double > &fr0, const Point3D< double > &fr1, const Point3D< double > &fr2, const Point3D< double > &to0, const Point3D< double > &to1, const Point3D< double > &to2)
 Transform3D (const Transform3D &m)
 ~Transform3D ()
const Transform3D_row operator[] (int) const
double operator() (int, int) const
double xx () const
double xy () const
double xz () const
double yx () const
double yy () const
double yz () const
double zx () const
double zy () const
double zz () const
double dx () const
double dy () const
double dz () const
Transform3Doperator= (const Transform3D &m)
void setIdentity ()
Transform3D inverse () const
Transform3D operator* (const Transform3D &b) const
void getDecomposition (Scale3D &scale, Rotate3D &rotation, Translate3D &translation) const
bool isNear (const Transform3D &t, double tolerance=2.2E-14) const
CLHEP::HepRotation getRotation () const
CLHEP::Hep3Vector getTranslation () const
bool operator== (const Transform3D &transform) const
bool operator!= (const Transform3D &transform) const

Static Public Attributes

static const Transform3D Identity = Transform3D ()

Protected Member Functions

 Transform3D (double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
void setTransform (double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
 Transform3D (double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
void setTransform (double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)

Protected Attributes

double xx_
double xy_
double xz_
double dx_
double yx_
double yy_
double yz_
double dy_
double zx_
double zy_
double zz_
double dz_

Detailed Description

Class for transformation of 3D geometrical objects. It allows different translations, rotations, scalings and reflections. Several specialized classes are derived from it:

TranslateX3D, TranslateY3D, TranslateZ3D, Translate3D,
RotateX3D, RotateY3D, RotateZ3D, Rotate3D,
ScaleX3D, ScaleY3D, ScaleZ3D, Scale3D,
ReflectX3D, ReflectY3D, ReflectZ3D, Reflect3D.

The idea behind these classes is to provide some additional constructors for Transform3D, they normally should not be used as separate classes.

Example:

Remark: For the reason that the operator* is left associative, the notation

   v2 = m3*(m2*(m1*v1));

is much more effective then the notation

   v2 = m3*m2*m1*v1;

In the first case three operations Transform3D*Vector3D are executed, in the second case two operations Transform3D*Transform3D and one Transform3D*Vector3D are performed. Transform3D*Transform3D is roughly three times slower than Transform3D*Vector3D.

Author:
<Evgueni.Tcherniaev@cern.ch>

Definition at line 172 of file CLHEP/Geometry/Transform3D.h.


Constructor & Destructor Documentation

HepGeom::Transform3D::Transform3D ( double  XX,
double  XY,
double  XZ,
double  DX,
double  YX,
double  YY,
double  YZ,
double  DY,
double  ZX,
double  ZY,
double  ZZ,
double  DZ 
) [inline, protected]

Definition at line 179 of file CLHEP/Geometry/Transform3D.h.

Default constructor - sets the Identity transformation.

Definition at line 212 of file CLHEP/Geometry/Transform3D.h.

Referenced by inverse(), and operator*().

Constructor: rotation and then translation.

HepGeom::Transform3D::Transform3D ( const Point3D< double > &  fr0,
const Point3D< double > &  fr1,
const Point3D< double > &  fr2,
const Point3D< double > &  to0,
const Point3D< double > &  to1,
const Point3D< double > &  to2 
)

Constructor: transformation of basis (assumed - no reflection).

Definition at line 67 of file Transform3D.cc.

References HepGeom::BasicVector3D< T >::cross(), setIdentity(), setTransform(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

Copy constructor.

Definition at line 232 of file CLHEP/Geometry/Transform3D.h.

Destructor. Virtual for now as some persistency mechanism needs that, in future releases this might go away again.

Definition at line 242 of file CLHEP/Geometry/Transform3D.h.

HepGeom::Transform3D::Transform3D ( double  XX,
double  XY,
double  XZ,
double  DX,
double  YX,
double  YY,
double  YZ,
double  DY,
double  ZX,
double  ZY,
double  ZZ,
double  DZ 
) [inline, protected]

Definition at line 179 of file Geometry/Transform3D.h.

Default constructor - sets the Identity transformation.

Definition at line 212 of file Geometry/Transform3D.h.

Constructor: rotation and then translation.

HepGeom::Transform3D::Transform3D ( const Point3D< double > &  fr0,
const Point3D< double > &  fr1,
const Point3D< double > &  fr2,
const Point3D< double > &  to0,
const Point3D< double > &  to1,
const Point3D< double > &  to2 
)

Constructor: transformation of basis (assumed - no reflection).

Copy constructor.

Definition at line 232 of file Geometry/Transform3D.h.

Destructor. Virtual for now as some persistency mechanism needs that, in future releases this might go away again.

Definition at line 242 of file Geometry/Transform3D.h.


Member Function Documentation

double HepGeom::Transform3D::dx ( ) const [inline]

Gets dx-element of the transformation matrix.

Definition at line 280 of file CLHEP/Geometry/Transform3D.h.

References dx_.

Referenced by HepGeom::operator*(), HepGeom::Point3D< float >::transform(), and HepGeom::Point3D< double >::transform().

double HepGeom::Transform3D::dx ( ) const [inline]

Gets dx-element of the transformation matrix.

Definition at line 280 of file Geometry/Transform3D.h.

References dx_.

double HepGeom::Transform3D::dy ( ) const [inline]

Gets dy-element of the transformation matrix.

Definition at line 283 of file Geometry/Transform3D.h.

References dy_.

double HepGeom::Transform3D::dy ( ) const [inline]

Gets dy-element of the transformation matrix.

Definition at line 283 of file CLHEP/Geometry/Transform3D.h.

References dy_.

Referenced by HepGeom::operator*(), HepGeom::Point3D< float >::transform(), and HepGeom::Point3D< double >::transform().

double HepGeom::Transform3D::dz ( ) const [inline]

Gets dz-element of the transformation matrix.

Definition at line 286 of file Geometry/Transform3D.h.

References dz_.

double HepGeom::Transform3D::dz ( ) const [inline]

Gets dz-element of the transformation matrix.

Definition at line 286 of file CLHEP/Geometry/Transform3D.h.

References dz_.

Referenced by HepGeom::operator*(), HepGeom::Point3D< float >::transform(), and HepGeom::Point3D< double >::transform().

void HepGeom::Transform3D::getDecomposition ( Scale3D scale,
Rotate3D rotation,
Translate3D translation 
) const

Decomposition of general transformation. This function gets decomposition of the transformation in three consequentive specific transformations: Scale3D, then Rotate3D, then Translate3, i.e.

   Transform3D = Translate3D * Rotate3D * Scale3D
Parameters:
scaleoutput: scaling transformation; if there was a reflection, then scale factor for z-component (scale(2,2)) will be negative.
rotationoutput: rotation transformaion.
translationoutput: translation transformaion.

Definition at line 178 of file Transform3D.cc.

Referenced by main().

void HepGeom::Transform3D::getDecomposition ( Scale3D scale,
Rotate3D rotation,
Translate3D translation 
) const

Decomposition of general transformation. This function gets decomposition of the transformation in three consequentive specific transformations: Scale3D, then Rotate3D, then Translate3, i.e.

   Transform3D = Translate3D * Rotate3D * Scale3D
Parameters:
scaleoutput: scaling transformation; if there was a reflection, then scale factor for z-component (scale(2,2)) will be negative.
rotationoutput: rotation transformaion.
translationoutput: translation transformaion.

Extracts the rotation matrix. This functions is obsolete - use getDecomposition() instead.

Referenced by XF::Pow::operator()().

Extracts the rotation matrix. This functions is obsolete - use getDecomposition() instead.

Extracts the translation vector. This functions is obsolete - use getDecomposition() instead.

Referenced by XF::Pow::operator()().

Extracts the translation vector. This functions is obsolete - use getDecomposition() instead.

Returns the inverse transformation.

Returns the inverse transformation.

Definition at line 146 of file Transform3D.cc.

References dx_, dy_, dz_, Transform3D(), xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

Referenced by main().

bool HepGeom::Transform3D::isNear ( const Transform3D t,
double  tolerance = 2.2E-14 
) const

Returns true if the difference between corresponding matrix elements is less than the tolerance.

Definition at line 208 of file Transform3D.cc.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

bool HepGeom::Transform3D::isNear ( const Transform3D t,
double  tolerance = 2.2E-14 
) const

Returns true if the difference between corresponding matrix elements is less than the tolerance.

bool HepGeom::Transform3D::operator!= ( const Transform3D transform) const [inline]

Test for inequality.

Definition at line 354 of file CLHEP/Geometry/Transform3D.h.

References operator==().

bool HepGeom::Transform3D::operator!= ( const Transform3D transform) const [inline]

Test for inequality.

Definition at line 354 of file Geometry/Transform3D.h.

References operator==().

double HepGeom::Transform3D::operator() ( int  ,
int   
) const

Fortran-style subscripting: returns (i,j) element of the matrix.

double HepGeom::Transform3D::operator() ( int  i,
int  j 
) const

Fortran-style subscripting: returns (i,j) element of the matrix.

Definition at line 28 of file Transform3D.cc.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

Transform3D HepGeom::Transform3D::operator* ( const Transform3D b) const

Transformation by another Transform3D.

Definition at line 56 of file Transform3D.cc.

References dx_, dy_, dz_, Transform3D(), xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

Transform3D HepGeom::Transform3D::operator* ( const Transform3D b) const

Transformation by another Transform3D.

Transform3D& HepGeom::Transform3D::operator= ( const Transform3D m) [inline]

Assignment.

Definition at line 290 of file CLHEP/Geometry/Transform3D.h.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

Transform3D& HepGeom::Transform3D::operator= ( const Transform3D m) [inline]

Assignment.

Definition at line 290 of file Geometry/Transform3D.h.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

bool HepGeom::Transform3D::operator== ( const Transform3D transform) const

Test for equality.

bool HepGeom::Transform3D::operator== ( const Transform3D transform) const

Test for equality.

Definition at line 225 of file Transform3D.cc.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

Referenced by operator!=().

const Transform3D_row HepGeom::Transform3D::operator[] ( int  ) const [inline]

Returns object of the helper class for C-style subscripting r[i][j]

const Transform3D_row HepGeom::Transform3D::operator[] ( int  ) const [inline]

Returns object of the helper class for C-style subscripting r[i][j]

Sets the Identity transformation.

Definition at line 299 of file CLHEP/Geometry/Transform3D.h.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

Referenced by HepGeom::Reflect3D::Reflect3D(), and Transform3D().

Sets the Identity transformation.

Definition at line 299 of file Geometry/Transform3D.h.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

void HepGeom::Transform3D::setTransform ( double  XX,
double  XY,
double  XZ,
double  DX,
double  YX,
double  YY,
double  YZ,
double  DY,
double  ZX,
double  ZY,
double  ZZ,
double  DZ 
) [inline, protected]
void HepGeom::Transform3D::setTransform ( double  XX,
double  XY,
double  XZ,
double  DX,
double  YX,
double  YY,
double  YZ,
double  DY,
double  ZX,
double  ZY,
double  ZZ,
double  DZ 
) [inline, protected]

Definition at line 187 of file Geometry/Transform3D.h.

References dx_, dy_, dz_, xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

double HepGeom::Transform3D::xx ( ) const [inline]
double HepGeom::Transform3D::xx ( ) const [inline]

Gets xx-element of the transformation matrix.

Definition at line 253 of file Geometry/Transform3D.h.

References xx_.

double HepGeom::Transform3D::xy ( ) const [inline]
double HepGeom::Transform3D::xy ( ) const [inline]

Gets xy-element of the transformation matrix.

Definition at line 256 of file Geometry/Transform3D.h.

References xy_.

double HepGeom::Transform3D::xz ( ) const [inline]

Gets xz-element of the transformation matrix.

Definition at line 259 of file Geometry/Transform3D.h.

References xz_.

double HepGeom::Transform3D::xz ( ) const [inline]
double HepGeom::Transform3D::yx ( ) const [inline]

Gets yx-element of the transformation matrix.

Definition at line 262 of file Geometry/Transform3D.h.

References yx_.

double HepGeom::Transform3D::yx ( ) const [inline]
double HepGeom::Transform3D::yy ( ) const [inline]
double HepGeom::Transform3D::yy ( ) const [inline]

Gets yy-element of the transformation matrix.

Definition at line 265 of file Geometry/Transform3D.h.

References yy_.

double HepGeom::Transform3D::yz ( ) const [inline]

Gets yz-element of the transformation matrix.

Definition at line 268 of file Geometry/Transform3D.h.

References yz_.

double HepGeom::Transform3D::yz ( ) const [inline]
double HepGeom::Transform3D::zx ( ) const [inline]
double HepGeom::Transform3D::zx ( ) const [inline]

Gets zx-element of the transformation matrix.

Definition at line 271 of file Geometry/Transform3D.h.

References zx_.

double HepGeom::Transform3D::zy ( ) const [inline]
double HepGeom::Transform3D::zy ( ) const [inline]

Gets zy-element of the transformation matrix.

Definition at line 274 of file Geometry/Transform3D.h.

References zy_.

double HepGeom::Transform3D::zz ( ) const [inline]
double HepGeom::Transform3D::zz ( ) const [inline]

Gets zz-element of the transformation matrix.

Definition at line 277 of file Geometry/Transform3D.h.

References zz_.


Member Data Documentation

Global identity transformation.

Definition at line 198 of file CLHEP/Geometry/Transform3D.h.

Referenced by main().


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