Files
geant4/source/geometry/solids/BREPS/include/G4Axis2Placement3D.icc
T
2016-06-08 16:57:27 +02:00

128 lines
3.8 KiB
Plaintext

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4Axis2Placement3D.icc,v 1.7 2001/07/20 11:52:42 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
// --------------------------------------------------------------------
// GEANT 4 inline definitions file
//
// G4AxisPlacement3D.icc
//
// Implementation of inline methods of G4AxisPlacement3D
// --------------------------------------------------------------------
inline
G4bool G4Axis2Placement3D::operator==(const G4Axis2Placement3D& other) const
{
return ((location == other.location) && (axis == other.axis) &&
(refDirection == other.refDirection) &&
(pX == other.pX) && (pY == other.pY) && (pZ == other.pZ) &&
(toPlacementCoordinates == other.toPlacementCoordinates) &&
(fromPlacementCoordinates == other.fromPlacementCoordinates))
? true : false;
}
inline
void G4Axis2Placement3D::Init( const G4Vector3D& refDirection0 ,
const G4Vector3D& axis0 ,
const G4Point3D& location0 )
{
refDirection = refDirection0;
axis = axis0;
location = location0;
// get the axes of the placement coordinate system
// (p[] of the STEP standard)
pZ = axis.unit();
pX = (refDirection-(refDirection*pZ)*pZ).unit();
pY = pZ.cross(pX); // normalized
// basis transformation
fromPlacementCoordinates =
G4Translate3D(location0) *
G4Transform3D(HepXHat, HepYHat, HepZHat, pX, pY, pZ);
toPlacementCoordinates= fromPlacementCoordinates.inverse();
}
inline
G4Axis2Placement3D::G4Axis2Placement3D(const G4Vector3D& refDirection0,
const G4Vector3D& axis0 ,
const G4Point3D& location0 )
{
Init( refDirection0, axis0, location0);
}
inline
G4Point3D G4Axis2Placement3D::GetLocation() const
{
return location;
}
inline
G4Vector3D G4Axis2Placement3D::GetAxis() const
{
return axis;
}
inline
G4Vector3D G4Axis2Placement3D::GetRefDirection() const
{
return refDirection;
}
/////////////////////////////////////////////////////////////////////////////
inline
const G4Transform3D& G4Axis2Placement3D::GetToPlacementCoordinates() const
{
return toPlacementCoordinates;
}
inline
const G4Transform3D& G4Axis2Placement3D::GetFromPlacementCoordinates() const
{
return fromPlacementCoordinates;
}
inline
G4Vector3D G4Axis2Placement3D::GetPX() const
{
return pX;
}
inline
G4Vector3D G4Axis2Placement3D::GetPY() const
{
return pY;
}
inline
G4Vector3D G4Axis2Placement3D::GetPZ() const
{
return pZ;
}