CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
HepGeom::Transform3D Class Reference

#include <CLHEP/Geometry/Transform3D.h>

Inheritance diagram for HepGeom::Transform3D:
HepGeom::Reflect3D HepGeom::Rotate3D HepGeom::Scale3D HepGeom::Translate3D HepGeom::ReflectX3D HepGeom::ReflectY3D HepGeom::ReflectZ3D HepGeom::RotateX3D HepGeom::RotateY3D HepGeom::RotateZ3D HepGeom::ScaleX3D HepGeom::ScaleY3D HepGeom::ScaleZ3D HepGeom::TranslateX3D HepGeom::TranslateY3D HepGeom::TranslateZ3D

Classes

class  Transform3D_row

Public Member Functions

 Transform3D ()
 Transform3D (const CLHEP::HepRotation &mt, 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 &mt)=default
 Transform3D (Transform3D &&mt)=default
 ~Transform3D ()=default
Transform3Doperator= (const Transform3D &mt)=default
Transform3Doperator= (Transform3D &&mt)=default
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
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

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)

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 Transform3D.h.

Constructor & Destructor Documentation

◆ Transform3D() [1/6]

◆ Transform3D() [2/6]

HepGeom::Transform3D::Transform3D ( )
inline

Default constructor - sets the Identity transformation.

Definition at line 212 of file Transform3D.h.

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

◆ Transform3D() [3/6]

◆ Transform3D() [4/6]

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() [5/6]

HepGeom::Transform3D::Transform3D ( const Transform3D & mt)
default

Copy constructor.

References Transform3D().

◆ Transform3D() [6/6]

HepGeom::Transform3D::Transform3D ( Transform3D && mt)
default

Move constructor.

References Transform3D().

◆ ~Transform3D()

HepGeom::Transform3D::~Transform3D ( )
default

Destructor.

Member Function Documentation

◆ dx()

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

Gets dx-element of the transformation matrix.

Definition at line 286 of file Transform3D.h.

References dx_.

◆ dy()

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

Gets dy-element of the transformation matrix.

Definition at line 289 of file Transform3D.h.

References dy_.

◆ dz()

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

Gets dz-element of the transformation matrix.

Definition at line 292 of file Transform3D.h.

References dz_.

◆ getDecomposition()

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(double XX, double XY, double XZ, double DX, double YX, double YY, double YZ, double DY, double ZX, double ZY, double ZZ, double DZ)
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()

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

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

Definition at line 39 of file Transform3D.icc.

References CLHEP::HepRotation::rotateAxes(), xx_, xy_, xz_, yx_, yy_, yz_, zx_, zy_, and zz_.

◆ getTranslation()

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

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

Definition at line 48 of file Transform3D.icc.

References dx_, dy_, and dz_.

◆ inverse()

Transform3D HepGeom::Transform3D::inverse ( ) const

Returns the inverse transformation.

References Transform3D().

◆ isNear()

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.

References Transform3D().

◆ operator!=()

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

Test for inequality.

Definition at line 351 of file Transform3D.h.

References operator==(), and Transform3D().

◆ operator()()

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

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

◆ operator*()

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

Transformation by another Transform3D.

References Transform3D().

◆ operator=() [1/2]

Transform3D & HepGeom::Transform3D::operator= ( const Transform3D & mt)
default

Assignment.

References Transform3D().

◆ operator=() [2/2]

Transform3D & HepGeom::Transform3D::operator= ( Transform3D && mt)
default

Move assignment.

References Transform3D().

◆ operator==()

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

Test for equality.

References Transform3D().

Referenced by operator!=().

◆ operator[]()

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

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

Definition at line 25 of file Transform3D.icc.

◆ setIdentity()

void HepGeom::Transform3D::setIdentity ( )
inline

Sets the Identity transformation.

Definition at line 296 of file Transform3D.h.

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

◆ setTransform()

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

◆ xx()

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

Gets xx-element of the transformation matrix.

Definition at line 259 of file Transform3D.h.

References xx_.

◆ xy()

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

Gets xy-element of the transformation matrix.

Definition at line 262 of file Transform3D.h.

References xy_.

◆ xz()

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

Gets xz-element of the transformation matrix.

Definition at line 265 of file Transform3D.h.

References xz_.

◆ yx()

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

Gets yx-element of the transformation matrix.

Definition at line 268 of file Transform3D.h.

References yx_.

◆ yy()

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

Gets yy-element of the transformation matrix.

Definition at line 271 of file Transform3D.h.

References yy_.

◆ yz()

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

Gets yz-element of the transformation matrix.

Definition at line 274 of file Transform3D.h.

References yz_.

◆ zx()

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

Gets zx-element of the transformation matrix.

Definition at line 277 of file Transform3D.h.

References zx_.

◆ zy()

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

Gets zy-element of the transformation matrix.

Definition at line 280 of file Transform3D.h.

References zy_.

◆ zz()

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

Gets zz-element of the transformation matrix.

Definition at line 283 of file 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
static

Global identity transformation.

Definition at line 198 of file Transform3D.h.

◆ 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: