Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AffineTransform Class Reference

G4AffineTransform is a class for geometric affine transformations. It supports efficient arbitrary rotation & transformation of vectors and the computation of compound & inverse transformations. A 'rotation flag' is maintained internally for greater computational efficiency for transforms that do not involve rotation. More...

#include <G4AffineTransform.hh>

Public Member Functions

 G4AffineTransform ()
 G4AffineTransform (const G4ThreeVector &tlate)
 G4AffineTransform (const G4RotationMatrix &rot)
 G4AffineTransform (const G4RotationMatrix &rot, const G4ThreeVector &tlate)
 G4AffineTransform (const G4RotationMatrix *rot, const G4ThreeVector &tlate)
 G4AffineTransform (const G4AffineTransform &rhs)=default
 G4AffineTransform (G4AffineTransform &&rhs)=default
G4AffineTransformoperator= (const G4AffineTransform &rhs)
G4AffineTransformoperator= (G4AffineTransform &&rhs)=default
 ~G4AffineTransform ()=default
G4AffineTransform operator* (const G4AffineTransform &tf) const
G4AffineTransformoperator*= (const G4AffineTransform &tf)
G4AffineTransformProduct (const G4AffineTransform &tf1, const G4AffineTransform &tf2)
G4AffineTransformInverseProduct (const G4AffineTransform &tf1, const G4AffineTransform &tf2)
G4ThreeVector TransformPoint (const G4ThreeVector &vec) const
G4ThreeVector InverseTransformPoint (const G4ThreeVector &vec) const
G4ThreeVector TransformAxis (const G4ThreeVector &axis) const
G4ThreeVector InverseTransformAxis (const G4ThreeVector &axis) const
void ApplyPointTransform (G4ThreeVector &vec) const
void ApplyAxisTransform (G4ThreeVector &axis) const
G4AffineTransform Inverse () const
G4AffineTransformInvert ()
G4AffineTransformoperator+= (const G4ThreeVector &tlate)
G4AffineTransformoperator-= (const G4ThreeVector &tlate)
G4bool operator== (const G4AffineTransform &tf) const
G4bool operator!= (const G4AffineTransform &tf) const
G4double operator[] (const G4int n) const
G4bool IsRotated () const
G4bool IsTranslated () const
G4RotationMatrix NetRotation () const
G4RotationMatrix InverseNetRotation () const
G4ThreeVector NetTranslation () const
G4ThreeVector InverseNetTranslation () const
void SetNetRotation (const G4RotationMatrix &rot)
void SetNetTranslation (const G4ThreeVector &tlate)
 operator G4Transform3D () const

Detailed Description

G4AffineTransform is a class for geometric affine transformations. It supports efficient arbitrary rotation & transformation of vectors and the computation of compound & inverse transformations. A 'rotation flag' is maintained internally for greater computational efficiency for transforms that do not involve rotation.

Definition at line 68 of file G4AffineTransform.hh.

Constructor & Destructor Documentation

◆ G4AffineTransform() [1/7]

G4AffineTransform::G4AffineTransform ( )
inline

◆ G4AffineTransform() [2/7]

G4AffineTransform::G4AffineTransform ( const G4ThreeVector & tlate)
inline

Constructor for Translation only: under t'form, translate point at origin by 'tlate'.

◆ G4AffineTransform() [3/7]

G4AffineTransform::G4AffineTransform ( const G4RotationMatrix & rot)
inline

Constructor for Rotation only: under t'form, rotate by 'rot'.

◆ G4AffineTransform() [4/7]

G4AffineTransform::G4AffineTransform ( const G4RotationMatrix & rot,
const G4ThreeVector & tlate )
inline

Constructor for Translation and Rotation: under t'form, rotate by 'rot' then translate by 'tlate'.

◆ G4AffineTransform() [5/7]

G4AffineTransform::G4AffineTransform ( const G4RotationMatrix * rot,
const G4ThreeVector & tlate )
inline

Alternative Constructor optionally rotating by 'rot' by pointer then translate by 'tlate' - 'rot' may be null.

◆ G4AffineTransform() [6/7]

G4AffineTransform::G4AffineTransform ( const G4AffineTransform & rhs)
inlinedefault

Copy & move constructor.

◆ G4AffineTransform() [7/7]

G4AffineTransform::G4AffineTransform ( G4AffineTransform && rhs)
inlinedefault

◆ ~G4AffineTransform()

G4AffineTransform::~G4AffineTransform ( )
inlinedefault

Default Destructor.

Member Function Documentation

◆ ApplyAxisTransform()

void G4AffineTransform::ApplyAxisTransform ( G4ThreeVector & axis) const
inline

Transforms the specified 'axis' (in place): sets axis=axis*rot.

Parameters
[in,out]axisThe axis to transform.

◆ ApplyPointTransform()

void G4AffineTransform::ApplyPointTransform ( G4ThreeVector & vec) const
inline

Transforms the specified point 'vec' (in place): sets vec=vec*rot+tlate.

Parameters
[in,out]vecThe point to transform.

Referenced by G4PolyconeSide::CalculateExtent().

◆ Inverse()

G4AffineTransform G4AffineTransform::Inverse ( ) const
inline

Returns the inverse of the current transform.

Referenced by G4DrawVoxels::DrawVoxels().

◆ InverseNetRotation()

G4RotationMatrix G4AffineTransform::InverseNetRotation ( ) const
inline

Returns the inverse net rotation matrix.

Referenced by G4TouchableHistory::G4TouchableHistory().

◆ InverseNetTranslation()

G4ThreeVector G4AffineTransform::InverseNetTranslation ( ) const
inline

Returns the inverse net translation vector.

Referenced by G4TouchableHistory::G4TouchableHistory().

◆ InverseProduct()

G4AffineTransform & G4AffineTransform::InverseProduct ( const G4AffineTransform & tf1,
const G4AffineTransform & tf2 )
inline

[Modifying] Inverse Product function. Sets self=tf1*(tf2^-1).

Parameters
[in]tf1First transformation operand.
[in]tf2Second transformation operand.
Returns
Returns Self reference.

◆ InverseTransformAxis()

G4ThreeVector G4AffineTransform::InverseTransformAxis ( const G4ThreeVector & axis) const
inline

Transforms the specified 'axis' using inverse transformation.

Returns
The inverse transformation of the given axis.

Referenced by G4RegularNavigation::ComputeStep(), G4ReplicaNavigation::ComputeStep(), and G4Navigator::GetLocalExitNormal().

◆ InverseTransformPoint()

G4ThreeVector G4AffineTransform::InverseTransformPoint ( const G4ThreeVector & vec) const
inline

Transforms the specified point 'vec' using inverse transformation.

Returns
The inverse transformation of the given point.

Referenced by G4PVParameterised::CheckOverlaps(), G4PVPlacement::CheckOverlaps(), G4RegularNavigation::ComputeStep(), G4RegularNavigation::ComputeStepSkippingEqualMaterials(), and G4LogicalVolumeModel::DescribeYourselfTo().

◆ Invert()

◆ IsRotated()

G4bool G4AffineTransform::IsRotated ( ) const
inline

Returns true if transform includes rotation.

Referenced by G4PVPlacement::CheckOverlaps().

◆ IsTranslated()

G4bool G4AffineTransform::IsTranslated ( ) const
inline

Returns true if transform includes translation.

◆ NetRotation()

G4RotationMatrix G4AffineTransform::NetRotation ( ) const
inline

◆ NetTranslation()

◆ operator G4Transform3D()

G4AffineTransform::operator G4Transform3D ( ) const
inline

Conversion operator (cast) to G4Transform3D.

◆ operator!=()

G4bool G4AffineTransform::operator!= ( const G4AffineTransform & tf) const
inline

◆ operator*()

G4AffineTransform G4AffineTransform::operator* ( const G4AffineTransform & tf) const
inline

Compound Transforms: tf2=tf2*tf1 equivalent to tf2*=tf1.

Parameters
[in]tfTransformation to combine.
Returns
The compound transformation of self*tf.

◆ operator*=()

G4AffineTransform & G4AffineTransform::operator*= ( const G4AffineTransform & tf)
inline

[Modifying] compound Transforms: Multiplies self by 'tf'.

Parameters
[in]tfTransformation to combine.
Returns
Returns self reference, i.e. A=AB for a*=b.

◆ operator+=()

G4AffineTransform & G4AffineTransform::operator+= ( const G4ThreeVector & tlate)
inline

[Modifying] Adjust the net translation by the given vector.

Returns
Self reference.

◆ operator-=()

G4AffineTransform & G4AffineTransform::operator-= ( const G4ThreeVector & tlate)
inline

◆ operator=() [1/2]

G4AffineTransform & G4AffineTransform::operator= ( const G4AffineTransform & rhs)
inline

Assignment & move operators.

◆ operator=() [2/2]

G4AffineTransform & G4AffineTransform::operator= ( G4AffineTransform && rhs)
inlinedefault

◆ operator==()

G4bool G4AffineTransform::operator== ( const G4AffineTransform & tf) const
inline

Equality and inequality operators.

◆ operator[]()

G4double G4AffineTransform::operator[] ( const G4int n) const
inline

Access operator.

◆ Product()

G4AffineTransform & G4AffineTransform::Product ( const G4AffineTransform & tf1,
const G4AffineTransform & tf2 )
inline

[Modifying] Product function, for avoiding (potential) temporaries: c.Product(a,b) equivalent to c=a*b c.InverseProduct(a*b,b ) equivalent to c=a Sets self=tf1*tf2.

Parameters
[in]tf1First transformation operand.
[in]tf2Second transformation operand.
Returns
Returns Self reference.

Referenced by G4DisplacedSolid::CalculateExtent().

◆ SetNetRotation()

void G4AffineTransform::SetNetRotation ( const G4RotationMatrix & rot)
inline

Setters for rotation and translation.

◆ SetNetTranslation()

void G4AffineTransform::SetNetTranslation ( const G4ThreeVector & tlate)
inline

◆ TransformAxis()

◆ TransformPoint()

G4ThreeVector G4AffineTransform::TransformPoint ( const G4ThreeVector & vec) const
inline

Transforms the specified point 'vec'.

Returns
vec*rot+tlate.

Referenced by G4ReplicaNavigation::BackLocate(), G4PolyPhiFace::CalculateExtent(), G4PVParameterised::CheckOverlaps(), G4PVPlacement::CheckOverlaps(), G4NormalNavigation::ComputeSafety(), G4ParameterisedNavigation::ComputeSafety(), G4ReplicaNavigation::ComputeSafety(), G4VoxelNavigation::ComputeSafety(), G4NormalNavigation::ComputeStep(), G4ParameterisedNavigation::ComputeStep(), G4ReplicaNavigation::ComputeStep(), G4VoxelNavigation::ComputeStep(), G4RegularNavigation::ComputeStepSkippingEqualMaterials(), G4DNAMolecularDissociation::DecayIt(), G4LogicalVolumeModel::DescribeYourselfTo(), G4ITNavigator1::GetLocalExitNormal(), G4ITNavigator2::GetLocalExitNormal(), G4Navigator::GetLocalExitNormal(), G4ITNavigator1::GetLocalExitNormalAndCheck(), G4ITNavigator2::GetLocalExitNormalAndCheck(), G4Navigator::GetLocalExitNormalAndCheck(), G4ITNavigator2::GetRandomInCurrentVolume(), G4ITNavigator2::InsideCurrentVolume(), G4PSCylinderSurfaceCurrent::IsSelectedSurface(), G4PSCylinderSurfaceFlux::IsSelectedSurface(), G4PSFlatSurfaceCurrent::IsSelectedSurface(), G4PSFlatSurfaceFlux::IsSelectedSurface(), G4PSSphereSurfaceCurrent::IsSelectedSurface(), G4PSSphereSurfaceFlux::IsSelectedSurface(), G4ParameterisedNavigation::LevelLocate(), G4RegularNavigation::LevelLocate(), G4VIntersectionLocator::LocateGlobalPointWithinVolumeAndCheck(), G4FastSimHitMaker::make(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4NeutrinoElectronProcess::PostStepDoIt(), G4TauNeutrinoNucleusProcess::PostStepDoIt(), G4VXTRenergyLoss::PostStepDoIt(), G4PSSphereSurfaceFlux::ProcessHits(), G4PSVolumeFlux::ProcessHits(), G4ITNavigator2::RecheckDistanceToCurrentBoundary(), and G4VoxelSafety::SafetyForVoxelNode().


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