// // ******************************************************************** // * 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: G4IntersectionSolid.cc,v 1.32 2010/05/11 15:03:45 gcosmo Exp $ // GEANT4 tag $Name: geant4-09-04-beta-01 $ // // Implementation of methods for the class G4IntersectionSolid // // History: // // 17.02.05 V.Grichine: bug was fixed in DistanceToIn(p,v) based on algorithm // proposed by Dino Bazzacco // 29.05.01 V.Grichine: bug was fixed in DistanceToIn(p,v) // 16.03.01 V.Grichine: modifications in CalculateExtent() and Inside() // 29.07.99 V.Grichine: modifications in DistanceToIn(p,v) // 12.09.98 V.Grichine: first implementation // // -------------------------------------------------------------------- #include "G4IntersectionSolid.hh" #include #include "G4VoxelLimits.hh" #include "G4VPVParameterisation.hh" #include "G4VGraphicsScene.hh" #include "G4Polyhedron.hh" #include "HepPolyhedronProcessor.h" #include "G4NURBS.hh" // #include "G4NURBSbox.hh" ///////////////////////////////////////////////////////////////////// // // Transfer all data members to G4BooleanSolid which is responsible // for them. pName will be in turn sent to G4VSolid // G4IntersectionSolid::G4IntersectionSolid( const G4String& pName, G4VSolid* pSolidA , G4VSolid* pSolidB ) : G4BooleanSolid(pName,pSolidA,pSolidB) { } /////////////////////////////////////////////////////////////////// // G4IntersectionSolid::G4IntersectionSolid( const G4String& pName, G4VSolid* pSolidA, G4VSolid* pSolidB, G4RotationMatrix* rotMatrix, const G4ThreeVector& transVector ) : G4BooleanSolid(pName,pSolidA,pSolidB,rotMatrix,transVector) { } ////////////////////////////////////////////////////////////////// // // G4IntersectionSolid::G4IntersectionSolid( const G4String& pName, G4VSolid* pSolidA, G4VSolid* pSolidB, const G4Transform3D& transform ) : G4BooleanSolid(pName,pSolidA,pSolidB,transform) { } ////////////////////////////////////////////////////////////////// // // Fake default constructor - sets only member data and allocates memory // for usage restricted to object persistency. G4IntersectionSolid::G4IntersectionSolid( __void__& a ) : G4BooleanSolid(a) { } /////////////////////////////////////////////////////////////// // // G4IntersectionSolid::~G4IntersectionSolid() { } /////////////////////////////////////////////////////////////// // // G4bool G4IntersectionSolid::CalculateExtent(const EAxis pAxis, const G4VoxelLimits& pVoxelLimit, const G4AffineTransform& pTransform, G4double& pMin, G4double& pMax) const { G4bool retA, retB, out; G4double minA, minB, maxA, maxB; retA = fPtrSolidA ->CalculateExtent( pAxis, pVoxelLimit, pTransform, minA, maxA); retB = fPtrSolidB ->CalculateExtent( pAxis, pVoxelLimit, pTransform, minB, maxB); if( retA && retB ) { pMin = std::max( minA, minB ); pMax = std::min( maxA, maxB ); out = (pMax > pMin); // true; #ifdef G4BOOLDEBUG // G4cout.precision(16); // G4cout<<"pMin = "<