// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * 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. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4Axis2Placement3D.icc,v 1.9 2006/06/29 18:37:41 gunter Exp $ // GEANT4 tag $Name: geant4-09-04-beta-01 $ // // -------------------------------------------------------------------- // 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(CLHEP::HepXHat, CLHEP::HepYHat, CLHEP::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; }