// // ******************************************************************** // * 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. * // ******************************************************************** // // // // Test for G4ReflectedSolid class // // 23.07.01 V.Grichine // 10.05.02 V.Grichine, bug fixed in CalculateExtent: box like algorithm proposed by // J. Apostolakis // #include #include #include "globals.hh" #include "geomdefs.hh" #include "ApproxEqual.hh" #include "G4ThreeVector.hh" #include "G4Point3D.hh" #include "G4Vector3D.hh" #include "G4Normal3D.hh" #include "G4RotationMatrix.hh" #include "G4AffineTransform.hh" #include "G4Transform3D.hh" #include "G4VoxelLimits.hh" #include "G4Box.hh" #include "G4Cons.hh" #include "G4Para.hh" #include "G4Sphere.hh" #include "G4Torus.hh" #include "G4Trap.hh" #include "G4Trd.hh" #include "G4Tubs.hh" #include "G4IntersectionSolid.hh" #include "G4SubtractionSolid.hh" #include "G4UnionSolid.hh" #include "G4ReflectedSolid.hh" #include "G4DisplacedSolid.hh" const G4String OutputInside(const EInside a) { switch(a) { case kInside: return "Inside"; case kOutside: return "Outside"; case kSurface: return "Surface"; } return "????"; } int main() { G4ThreeVector pzero(0,0,0), p; G4ThreeVector ponxside(20,0,0),ponyside(0,30,0),ponzside(0,0,40), ponb2x(10,0,0),ponb2y(0,10,0),ponb2z(0,0,10), ponb2mx(-10,0,0),ponb2my(0,-10,0),ponb2mz(0,0,-10); G4ThreeVector ponmxside(-20,0,0),ponmyside(0,-30,0),ponmzside(0,0,-40); G4ThreeVector ponzsidey(0,25,40),ponmzsidey(0,25,-40), ponb2zy(0,5,10),ponb2mzy(0,5,-10) ; G4ThreeVector pbigx(100,0,0),pbigy(0,100,0),pbigz(0,0,100); G4ThreeVector pbigmx(-100,0,0),pbigmy(0,-100,0),pbigmz(0,0,-100); G4ThreeVector vx(1,0,0),vy(0,1,0),vz(0,0,1); G4ThreeVector vmx(-1,0,0),vmy(0,-1,0),vmz(0,0,-1); G4ThreeVector vxy(1/std::sqrt(2.0),1/std::sqrt(2.0),0); G4ThreeVector vmxy(-1/std::sqrt(2.0),1/std::sqrt(2.0),0); G4ThreeVector vmxmy(-1/std::sqrt(2.0),-1/std::sqrt(2.0),0); G4ThreeVector vxmy(1/std::sqrt(2.0),-1/std::sqrt(2.0),0); G4ThreeVector vxmz(1/std::sqrt(2.0),0,-1/std::sqrt(2.0)); G4double dist; G4int i; G4ThreeVector *pNorm,norm; G4bool *pgoodNorm,goodNorm,calcNorm=true; pNorm=&norm; pgoodNorm=&goodNorm; G4RotationMatrix identity, xRot ; G4Transform3D moveX50(identity,G4ThreeVector(50.0, 0.0, 0.0)); G4Transform3D moveY50(identity,G4ThreeVector(0.0, 50.0, 0.0)); // NOTE: xRot = rotation such that x axis->y axis & y axis->-x axis xRot.rotateZ(-pi*0.5) ; G4ReflectX3D reflectX ; G4Point3D newPointN = reflectX*G4Normal3D(1,1,1) ; G4cout<<"x component of normal newPoint = "<