51 #include "HepPolyhedronProcessor.h"
128 if (
this == &rhs) {
return *
this; }
151 if (pMin.x() >= pMax.x() || pMin.y() >= pMax.y() || pMin.z() >= pMax.z())
153 std::ostringstream message;
154 message <<
"Bad bounding box (min >= max) for solid: "
156 <<
"\npMin = " << pMin
157 <<
"\npMax = " << pMax;
158 G4Exception(
"G4SubtractionSolid::Extent()",
"GeomMgt0001",
179 pTransform, pMin, pMax );
228 G4cout <<
"WARNING - Invalid call [1] in "
229 <<
"G4SubtractionSolid::SurfaceNormal(p)" <<
G4endl
230 <<
" Point p is outside !" <<
G4endl;
232 G4cerr <<
"WARNING - Invalid call [1] in "
233 <<
"G4SubtractionSolid::SurfaceNormal(p)" << G4endl
234 <<
" Point p is outside !" <<
G4endl;
266 G4cout <<
"WARNING - Invalid call [2] in "
267 <<
"G4SubtractionSolid::SurfaceNormal(p)" <<
G4endl
268 <<
" Point p is inside !" <<
G4endl;
270 G4cerr <<
"WARNING - Invalid call [2] in "
271 <<
"G4SubtractionSolid::SurfaceNormal(p)" << G4endl
272 <<
" Point p is inside !" <<
G4endl;
289 G4double dist = 0.0, dist2 = 0.0, disTmp = 0.0;
294 G4cout <<
"WARNING - Invalid call in "
295 <<
"G4SubtractionSolid::DistanceToIn(p,v)" <<
G4endl
296 <<
" Point p is inside !" <<
G4endl;
299 G4cerr <<
"WARNING - Invalid call in "
300 <<
"G4SubtractionSolid::DistanceToIn(p,v)" << G4endl
301 <<
" Point p is inside !" <<
G4endl;
329 if (dist == dist2) {
return dist; }
338 ->GetConstituentMovedSolid()->GetName();
340 std::ostringstream message;
341 message <<
"Illegal condition caused by solids: "
343 message.precision(16);
344 message <<
"Looping detected in point " << p+dist*v
345 <<
", from original point " << p
346 <<
" and direction " << v << G4endl
347 <<
"Computed candidate distance: " << dist <<
"*mm. ";
348 message.precision(6);
350 G4Exception(
"G4SubtractionSolid::DistanceToIn(p,v)",
352 "Returning candidate distance.");
385 if (dist == dist2) {
return dist; }
394 ->GetConstituentMovedSolid()->GetName();
396 std::ostringstream message;
397 message <<
"Illegal condition caused by solids: "
399 message.precision(16);
400 message <<
"Looping detected in point " << p+dist*v
401 <<
", from original point " << p
402 <<
" and direction " << v << G4endl
403 <<
"Computed candidate distance: " << dist <<
"*mm. ";
404 message.precision(6);
406 G4Exception(
"G4SubtractionSolid::DistanceToIn(p,v)",
408 "Returning candidate distance.");
433 G4cout <<
"WARNING - Invalid call in "
434 <<
"G4SubtractionSolid::DistanceToIn(p)" <<
G4endl
435 <<
" Point p is inside !" <<
G4endl;
437 G4cerr <<
"WARNING - Invalid call in "
438 <<
"G4SubtractionSolid::DistanceToIn(p)" << G4endl
439 <<
" Point p is inside !" <<
G4endl;
479 G4cout <<
"WARNING - Invalid call in "
480 <<
"G4SubtractionSolid::DistanceToOut(p,v)" << G4endl
481 <<
" Point p is outside !" <<
G4endl;
484 G4cerr <<
"WARNING - Invalid call in "
485 <<
"G4SubtractionSolid::DistanceToOut(p,v)" << G4endl
486 <<
" Point p is outside !" <<
G4endl;
523 G4cout <<
"WARNING - Invalid call in "
524 <<
"G4SubtractionSolid::DistanceToOut(p)" <<
G4endl
525 <<
" Point p is outside" <<
G4endl;
527 G4cerr <<
"WARNING - Invalid call in "
528 <<
"G4SubtractionSolid::DistanceToOut(p)" << G4endl
529 <<
" Point p is outside" <<
G4endl;
547 return G4String(
"G4SubtractionSolid");
592 if (processor.execute(*result)) {
return result; }
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
static constexpr double mm
static const G4double kInfinity
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
std::vector< ExP01TrackerHit * > a
virtual ~G4SubtractionSolid()
virtual G4GeometryType GetEntityType() const =0
virtual void AddSolid(const G4Box &)=0
G4Polyhedron * CreatePolyhedron() const
static double normal(HepRandomEngine *eptr)
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const
G4GLOB_DLL std::ostream G4cout
virtual EInside Inside(const G4ThreeVector &p) const =0
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4double GetRadialTolerance() const
G4SubtractionSolid & operator=(const G4SubtractionSolid &rhs)
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
EInside Inside(const G4ThreeVector &p) const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
G4SubtractionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void DescribeYourselfTo(G4VGraphicsScene &scene) const
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4GeometryType GetEntityType() const
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
static G4GeometryTolerance * GetInstance()
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4GLOB_DLL std::ostream G4cerr