121 if (
this == &rhs) {
return *
this; }
145 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
147 std::ostringstream message;
148 message <<
"Bad bounding box (min >= max) for solid: "
150 <<
"\npMin = " << pMin
151 <<
"\npMax = " << pMax;
152 G4Exception(
"G4SubtractionSolid::BoundingLimits()",
"GeomMgt0001",
173 pTransform, pMin, pMax );
183 if (positionA ==
kOutside)
return positionA;
186 if (positionB ==
kOutside)
return positionA;
214 G4cout <<
"WARNING - Invalid call [1] in "
215 <<
"G4SubtractionSolid::SurfaceNormal(p)" <<
G4endl
216 <<
" Point p is outside !" <<
G4endl;
218 G4cerr <<
"WARNING - Invalid call [1] in "
219 <<
"G4SubtractionSolid::SurfaceNormal(p)" <<
G4endl
220 <<
" Point p is outside !" <<
G4endl;
248 G4cout <<
"WARNING - Invalid call [2] in "
249 <<
"G4SubtractionSolid::SurfaceNormal(p)" <<
G4endl
250 <<
" Point p is inside !" <<
G4endl;
252 G4cerr <<
"WARNING - Invalid call [2] in "
253 <<
"G4SubtractionSolid::SurfaceNormal(p)" <<
G4endl
254 <<
" Point p is inside !" <<
G4endl;
270 G4double dist = 0.0, dist2 = 0.0, disTmp = 0.0;
275 G4cout <<
"WARNING - Invalid call in "
276 <<
"G4SubtractionSolid::DistanceToIn(p,v)" <<
G4endl
277 <<
" Point p is inside !" <<
G4endl;
280 G4cerr <<
"WARNING - Invalid call in "
281 <<
"G4SubtractionSolid::DistanceToIn(p,v)" <<
G4endl
282 <<
" Point p is inside !" <<
G4endl;
300 if(disTmp == kInfinity)
310 if (dist == dist2) {
return dist; }
319 ->GetConstituentMovedSolid()->GetName();
321 std::ostringstream message;
322 message <<
"Illegal condition caused by solids: "
324 message.precision(16);
325 message <<
"Looping detected in point " << p+dist*v
326 <<
", from original point " << p
327 <<
" and direction " << v <<
G4endl
328 <<
"Computed candidate distance: " << dist <<
"*mm. ";
329 message.precision(6);
331 G4Exception(
"G4SubtractionSolid::DistanceToIn(p,v)",
333 "Returning candidate distance.");
345 if( dist == kInfinity )
361 if(disTmp == kInfinity)
366 if (dist == dist2) {
return dist; }
375 ->GetConstituentMovedSolid()->GetName();
377 std::ostringstream message;
378 message <<
"Illegal condition caused by solids: "
380 message.precision(16);
381 message <<
"Looping detected in point " << p+dist*v
382 <<
", from original point " << p
383 <<
" and direction " << v <<
G4endl
384 <<
"Computed candidate distance: " << dist <<
"*mm. ";
385 message.precision(6);
387 G4Exception(
"G4SubtractionSolid::DistanceToIn(p,v)",
389 "Returning candidate distance.");
414 G4cout <<
"WARNING - Invalid call in "
415 <<
"G4SubtractionSolid::DistanceToIn(p)" <<
G4endl
416 <<
" Point p is inside !" <<
G4endl;
418 G4cerr <<
"WARNING - Invalid call in "
419 <<
"G4SubtractionSolid::DistanceToIn(p)" <<
G4endl
420 <<
" Point p is inside !" <<
G4endl;
460 G4cout <<
"WARNING - Invalid call in "
461 <<
"G4SubtractionSolid::DistanceToOut(p,v)" <<
G4endl
462 <<
" Point p is outside !" <<
G4endl;
465 G4cerr <<
"WARNING - Invalid call in "
466 <<
"G4SubtractionSolid::DistanceToOut(p,v)" <<
G4endl
467 <<
" Point p is outside !" <<
G4endl;
504 G4cout <<
"WARNING - Invalid call in "
505 <<
"G4SubtractionSolid::DistanceToOut(p)" <<
G4endl
506 <<
" Point p is outside" <<
G4endl;
508 G4cerr <<
"WARNING - Invalid call in "
509 <<
"G4SubtractionSolid::DistanceToOut(p)" <<
G4endl
510 <<
" Point p is outside" <<
G4endl;
528 return G4String(
"G4SubtractionSolid");
573 if (processor.
execute(*result)) {
return result; }
574 else {
return nullptr; }
595 bminA.
x() < bmaxB.
x() && bminA.
y() < bmaxB.
y() && bminA.
z() < bmaxB.
z() &&
596 bminB.
x() < bmaxA.
x() && bminB.
y() < bmaxA.
y() && bminB.
z() < bmaxA.
z();
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
virtual G4double GetCubicVolume()
virtual ~G4SubtractionSolid()
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
virtual G4double GetCubicVolume() final
G4SubtractionSolid & operator=(const G4SubtractionSolid &rhs)
void DescribeYourselfTo(G4VGraphicsScene &scene) const
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
G4Polyhedron * CreatePolyhedron() const
G4GeometryType GetEntityType() const
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const
G4SubtractionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
EInside Inside(const G4ThreeVector &p) const
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
virtual void AddSolid(const G4Box &)=0
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const =0
virtual G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const =0
virtual void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
virtual G4double GetCubicVolume()
virtual G4GeometryType GetEntityType() const =0
bool execute(HepPolyhedron &)