| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4Axis2Placement3D.icc,v 1.9 2006/06/29 18:37:41 gunter Exp $
|
|---|
| 28 | // GEANT4 tag $Name: HEAD $
|
|---|
| 29 | //
|
|---|
| 30 | // --------------------------------------------------------------------
|
|---|
| 31 | // GEANT 4 inline definitions file
|
|---|
| 32 | //
|
|---|
| 33 | // G4AxisPlacement3D.icc
|
|---|
| 34 | //
|
|---|
| 35 | // Implementation of inline methods of G4AxisPlacement3D
|
|---|
| 36 | // --------------------------------------------------------------------
|
|---|
| 37 |
|
|---|
| 38 | inline
|
|---|
| 39 | G4bool G4Axis2Placement3D::operator==(const G4Axis2Placement3D& other) const
|
|---|
| 40 | {
|
|---|
| 41 | return ((location == other.location) && (axis == other.axis) &&
|
|---|
| 42 | (refDirection == other.refDirection) &&
|
|---|
| 43 | (pX == other.pX) && (pY == other.pY) && (pZ == other.pZ) &&
|
|---|
| 44 | (toPlacementCoordinates == other.toPlacementCoordinates) &&
|
|---|
| 45 | (fromPlacementCoordinates == other.fromPlacementCoordinates))
|
|---|
| 46 | ? true : false;
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | inline
|
|---|
| 50 | void G4Axis2Placement3D::Init( const G4Vector3D& refDirection0 ,
|
|---|
| 51 | const G4Vector3D& axis0 ,
|
|---|
| 52 | const G4Point3D& location0 )
|
|---|
| 53 | {
|
|---|
| 54 | refDirection = refDirection0;
|
|---|
| 55 | axis = axis0;
|
|---|
| 56 | location = location0;
|
|---|
| 57 |
|
|---|
| 58 | // get the axes of the placement coordinate system
|
|---|
| 59 | // (p[] of the STEP standard)
|
|---|
| 60 | pZ = axis.unit();
|
|---|
| 61 | pX = (refDirection-(refDirection*pZ)*pZ).unit();
|
|---|
| 62 | pY = pZ.cross(pX); // normalized
|
|---|
| 63 |
|
|---|
| 64 | // basis transformation
|
|---|
| 65 | fromPlacementCoordinates =
|
|---|
| 66 | G4Translate3D(location0) *
|
|---|
| 67 | G4Transform3D(CLHEP::HepXHat, CLHEP::HepYHat, CLHEP::HepZHat,
|
|---|
| 68 | pX, pY, pZ);
|
|---|
| 69 |
|
|---|
| 70 | toPlacementCoordinates= fromPlacementCoordinates.inverse();
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | inline
|
|---|
| 75 | G4Axis2Placement3D::G4Axis2Placement3D(const G4Vector3D& refDirection0,
|
|---|
| 76 | const G4Vector3D& axis0 ,
|
|---|
| 77 | const G4Point3D& location0 )
|
|---|
| 78 | {
|
|---|
| 79 | Init( refDirection0, axis0, location0);
|
|---|
| 80 | }
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 | inline
|
|---|
| 84 | G4Point3D G4Axis2Placement3D::GetLocation() const
|
|---|
| 85 | {
|
|---|
| 86 | return location;
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 | inline
|
|---|
| 90 | G4Vector3D G4Axis2Placement3D::GetAxis() const
|
|---|
| 91 | {
|
|---|
| 92 | return axis;
|
|---|
| 93 | }
|
|---|
| 94 |
|
|---|
| 95 | inline
|
|---|
| 96 | G4Vector3D G4Axis2Placement3D::GetRefDirection() const
|
|---|
| 97 | {
|
|---|
| 98 | return refDirection;
|
|---|
| 99 | }
|
|---|
| 100 |
|
|---|
| 101 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 102 |
|
|---|
| 103 | inline
|
|---|
| 104 | const G4Transform3D& G4Axis2Placement3D::GetToPlacementCoordinates() const
|
|---|
| 105 | {
|
|---|
| 106 | return toPlacementCoordinates;
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 | inline
|
|---|
| 110 | const G4Transform3D& G4Axis2Placement3D::GetFromPlacementCoordinates() const
|
|---|
| 111 | {
|
|---|
| 112 | return fromPlacementCoordinates;
|
|---|
| 113 | }
|
|---|
| 114 |
|
|---|
| 115 | inline
|
|---|
| 116 | G4Vector3D G4Axis2Placement3D::GetPX() const
|
|---|
| 117 | {
|
|---|
| 118 | return pX;
|
|---|
| 119 | }
|
|---|
| 120 |
|
|---|
| 121 | inline
|
|---|
| 122 | G4Vector3D G4Axis2Placement3D::GetPY() const
|
|---|
| 123 | {
|
|---|
| 124 | return pY;
|
|---|
| 125 | }
|
|---|
| 126 |
|
|---|
| 127 | inline
|
|---|
| 128 | G4Vector3D G4Axis2Placement3D::GetPZ() const
|
|---|
| 129 | {
|
|---|
| 130 | return pZ;
|
|---|
| 131 | }
|
|---|