G4Axis2Placement3D.icc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // --------------------------------------------------------------------
00030 // GEANT 4 inline definitions file
00031 //
00032 // G4AxisPlacement3D.icc
00033 //
00034 // Implementation of inline methods of G4AxisPlacement3D
00035 // --------------------------------------------------------------------
00036 
00037 inline
00038 G4bool G4Axis2Placement3D::operator==(const G4Axis2Placement3D& other) const
00039 {
00040   return ((location == other.location) && (axis == other.axis) &&
00041           (refDirection == other.refDirection) &&
00042           (pX == other.pX) && (pY == other.pY) && (pZ == other.pZ) &&
00043           (toPlacementCoordinates == other.toPlacementCoordinates) &&
00044           (fromPlacementCoordinates == other.fromPlacementCoordinates))
00045          ? true : false; 
00046 }
00047 
00048 inline
00049 void G4Axis2Placement3D::Init( const G4Vector3D& refDirection0 ,
00050                                const G4Vector3D& axis0         ,
00051                                const G4Point3D& location0       ) 
00052 {
00053   refDirection = refDirection0;
00054   axis         = axis0;
00055   location     = location0;
00056   
00057   // get the axes of the placement coordinate system
00058   // (p[] of the STEP standard)
00059   pZ = axis.unit();
00060   pX = (refDirection-(refDirection*pZ)*pZ).unit();
00061   pY = pZ.cross(pX); // normalized
00062   
00063   // basis transformation
00064   fromPlacementCoordinates =
00065                 G4Translate3D(location0) *
00066                 G4Transform3D(CLHEP::HepXHat, CLHEP::HepYHat, CLHEP::HepZHat,
00067                               pX, pY, pZ);
00068 
00069   toPlacementCoordinates= fromPlacementCoordinates.inverse();
00070 }
00071 
00072 
00073 inline
00074 G4Axis2Placement3D::G4Axis2Placement3D(const G4Vector3D& refDirection0,
00075                                        const G4Vector3D& axis0        ,
00076                                        const G4Point3D& location0      )
00077 {
00078   Init( refDirection0, axis0, location0);
00079 }
00080 
00081 
00082 inline
00083 G4Point3D G4Axis2Placement3D::GetLocation() const
00084 {
00085   return location;
00086 }
00087 
00088 inline
00089 G4Vector3D G4Axis2Placement3D::GetAxis() const
00090 {
00091   return axis;
00092 }
00093 
00094 inline
00095 G4Vector3D G4Axis2Placement3D::GetRefDirection() const 
00096 {
00097   return refDirection;
00098 }
00099 
00101 
00102 inline
00103 const G4Transform3D& G4Axis2Placement3D::GetToPlacementCoordinates() const 
00104 {
00105   return toPlacementCoordinates;
00106 }
00107 
00108 inline
00109 const G4Transform3D& G4Axis2Placement3D::GetFromPlacementCoordinates() const 
00110 {
00111   return fromPlacementCoordinates;
00112 }
00113 
00114 inline
00115 G4Vector3D G4Axis2Placement3D::GetPX() const
00116 {
00117   return pX;
00118 }
00119 
00120 inline
00121 G4Vector3D G4Axis2Placement3D::GetPY() const
00122 {
00123   return pY;
00124 }
00125 
00126 inline
00127 G4Vector3D G4Axis2Placement3D::GetPZ() const
00128 {
00129   return pZ;
00130 }

Generated on Mon May 27 17:47:42 2013 for Geant4 by  doxygen 1.4.7