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

Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
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

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
Evgue.nosp@m.ni.T.nosp@m.chern.nosp@m.iaev.nosp@m.@cern.nosp@m..ch

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

Constructor & Destructor Documentation

◆ Transform3D() [1/10]

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 
)
inlineprotected

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

◆ Transform3D() [2/10]

HepGeom::Transform3D::Transform3D ( )
inline

Default constructor - sets the Identity transformation.

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

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

◆ Transform3D() [3/10]

HepGeom::Transform3D::Transform3D ( const CLHEP::HepRotation m,
const CLHEP::Hep3Vector v 
)
inline

Constructor: rotation and then translation.

◆ Transform3D() [4/10]

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().

◆ Transform3D() [5/10]

HepGeom::Transform3D::Transform3D ( const Transform3D m)
inline

Copy constructor.

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

◆ ~Transform3D() [1/2]

HepGeom::Transform3D::~Transform3D ( )
inline

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.

◆ Transform3D() [6/10]

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 
)
inlineprotected

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

◆ Transform3D() [7/10]

HepGeom::Transform3D::Transform3D ( )
inline

Default constructor - sets the Identity transformation.

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

◆ Transform3D() [8/10]

HepGeom::Transform3D::Transform3D ( const CLHEP::HepRotation m,
const CLHEP::Hep3Vector v 
)
inline

Constructor: rotation and then translation.

◆ Transform3D() [9/10]

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).

◆ Transform3D() [10/10]

HepGeom::Transform3D::Transform3D ( const Transform3D m)
inline

Copy constructor.

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

◆ ~Transform3D() [2/2]

HepGeom::Transform3D::~Transform3D ( )
inline

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

◆ dx() [1/2]

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_.

◆ dx() [2/2]

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

Gets dx-element of the transformation matrix.

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

References dx_.

◆ dy() [1/2]

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_.

◆ dy() [2/2]

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

Gets dy-element of the transformation matrix.

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

References dy_.

◆ dz() [1/2]

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_.

◆ dz() [2/2]

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

Gets dz-element of the transformation matrix.

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

References dz_.

◆ getDecomposition() [1/2]

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().

◆ getDecomposition() [2/2]

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.

◆ getRotation() [1/2]

CLHEP::HepRotation HepGeom::Transform3D::getRotation ( ) const
inline

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

Referenced by main().

◆ getRotation() [2/2]

CLHEP::HepRotation HepGeom::Transform3D::getRotation ( ) const
inline

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

◆ getTranslation() [1/2]

CLHEP::Hep3Vector HepGeom::Transform3D::getTranslation ( ) const
inline

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

Referenced by main().

◆ getTranslation() [2/2]

CLHEP::Hep3Vector HepGeom::Transform3D::getTranslation ( ) const
inline

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

◆ inverse() [1/2]

Transform3D HepGeom::Transform3D::inverse ( ) const

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().

◆ inverse() [2/2]

Transform3D HepGeom::Transform3D::inverse ( ) const

Returns the inverse transformation.

◆ isNear() [1/2]

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_.

Referenced by main().

◆ isNear() [2/2]

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.

◆ operator!=() [1/2]

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

Test for inequality.

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

References operator==().

◆ operator!=() [2/2]

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

Test for inequality.

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

References operator==().

◆ operator()() [1/2]

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_.

◆ operator()() [2/2]

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

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

◆ operator*() [1/2]

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

Transformation by another Transform3D.

Definition at line 56 of file Transform3D.cc.

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

◆ operator*() [2/2]

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

Transformation by another Transform3D.

◆ operator=() [1/2]

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

Assignment.

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

◆ operator=() [2/2]

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

Assignment.

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

◆ operator==() [1/2]

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!=().

◆ operator==() [2/2]

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

Test for equality.

◆ operator[]() [1/2]

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

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

◆ operator[]() [2/2]

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

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

◆ setIdentity() [1/2]

void HepGeom::Transform3D::setIdentity ( )
inline

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 main(), HepGeom::Reflect3D::Reflect3D(), and Transform3D().

◆ setIdentity() [2/2]

void HepGeom::Transform3D::setIdentity ( )
inline

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_.

◆ setTransform() [1/2]

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 
)
inlineprotected

◆ setTransform() [2/2]

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 
)
inlineprotected

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

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

◆ xx() [1/2]

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

Gets xx-element of the transformation matrix.

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

References xx_.

Referenced by main().

◆ xx() [2/2]

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

Gets xx-element of the transformation matrix.

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

References xx_.

◆ xy() [1/2]

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

Gets xy-element of the transformation matrix.

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

References xy_.

Referenced by main().

◆ xy() [2/2]

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

Gets xy-element of the transformation matrix.

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

References xy_.

◆ xz() [1/2]

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

Gets xz-element of the transformation matrix.

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

References xz_.

Referenced by main().

◆ xz() [2/2]

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

Gets xz-element of the transformation matrix.

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

References xz_.

◆ yx() [1/2]

double HepGeom::Transform3D::yx ( ) const
inline

Gets yx-element of the transformation matrix.

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

References yx_.

Referenced by main().

◆ yx() [2/2]

double HepGeom::Transform3D::yx ( ) const
inline

Gets yx-element of the transformation matrix.

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

References yx_.

◆ yy() [1/2]

double HepGeom::Transform3D::yy ( ) const
inline

Gets yy-element of the transformation matrix.

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

References yy_.

Referenced by main().

◆ yy() [2/2]

double HepGeom::Transform3D::yy ( ) const
inline

Gets yy-element of the transformation matrix.

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

References yy_.

◆ yz() [1/2]

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

Gets yz-element of the transformation matrix.

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

References yz_.

Referenced by main().

◆ yz() [2/2]

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

Gets yz-element of the transformation matrix.

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

References yz_.

◆ zx() [1/2]

double HepGeom::Transform3D::zx ( ) const
inline

Gets zx-element of the transformation matrix.

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

References zx_.

Referenced by main().

◆ zx() [2/2]

double HepGeom::Transform3D::zx ( ) const
inline

Gets zx-element of the transformation matrix.

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

References zx_.

◆ zy() [1/2]

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

Gets zy-element of the transformation matrix.

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

References zy_.

Referenced by main().

◆ zy() [2/2]

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

Gets zy-element of the transformation matrix.

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

References zy_.

◆ zz() [1/2]

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

Gets zz-element of the transformation matrix.

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

References zz_.

Referenced by main().

◆ zz() [2/2]

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

◆ dx_

double HepGeom::Transform3D::dx_
protected

◆ dy_

double HepGeom::Transform3D::dy_
protected

◆ dz_

double HepGeom::Transform3D::dz_
protected

◆ Identity

const Transform3D HepGeom::Transform3D::Identity = Transform3D ()
static

Global identity transformation.

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

Referenced by main().

◆ xx_

double HepGeom::Transform3D::xx_
protected

◆ xy_

double HepGeom::Transform3D::xy_
protected

◆ xz_

double HepGeom::Transform3D::xz_
protected

◆ yx_

double HepGeom::Transform3D::yx_
protected

◆ yy_

double HepGeom::Transform3D::yy_
protected

◆ yz_

double HepGeom::Transform3D::yz_
protected

◆ zx_

double HepGeom::Transform3D::zx_
protected

◆ zy_

double HepGeom::Transform3D::zy_
protected

◆ zz_

double HepGeom::Transform3D::zz_
protected

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