127 if (
this == &rhs) {
return *
this; }
149 fPMin = pmin - pdelta;
150 fPMax = pmax + pdelta;
177 std::ostringstream message;
178 message <<
"Bad bounding box (min >= max) for solid: "
180 <<
"\npMin = " <<
pMin
181 <<
"\npMax = " <<
pMax;
182 G4Exception(
"G4UnionSolid::BoundingLimits()",
"GeomMgt0001",
199 G4bool touchesA, touchesB, out ;
204 pTransform, minA,
maxA);
206 pTransform, minB, maxB);
207 if( touchesA || touchesB )
232 if (positionA ==
kInside) {
return positionA; }
234 if (positionA ==
kOutside) {
return positionB; }
236 if (positionB ==
kInside) {
return positionB; }
237 if (positionB ==
kOutside) {
return positionA; }
271 return (normalA + normalB).
unit();
275 G4String surf[3] = {
"OUTSIDE",
"SURFACE",
"INSIDE" };
276 std::ostringstream message;
277 G4int oldprc = message.precision(16);
278 message <<
"Invalid call of SurfaceNormal(p) for union solid: "
280 <<
"\nPoint p" << p <<
" is " << surf[
Inside(p)] <<
" !!!";
281 message.precision(oldprc);
282 G4Exception(
"G4UnionSolid::SurfaceNormal()",
"GeomMgt0001",
299 G4cout <<
"WARNING - Invalid call in "
300 <<
"G4UnionSolid::DistanceToIn(p,v)" <<
G4endl
301 <<
" Point p is inside !" <<
G4endl;
304 G4cerr <<
"WARNING - Invalid call in "
305 <<
"G4UnionSolid::DistanceToIn(p,v)" <<
G4endl
306 <<
" Point p is inside !" <<
G4endl;
327 G4cout <<
"WARNING - Invalid call in "
328 <<
"G4UnionSolid::DistanceToIn(p)" <<
G4endl
329 <<
" Point p is inside !" <<
G4endl;
331 G4cerr <<
"WARNING - Invalid call in "
332 <<
"G4UnionSolid::DistanceToIn(p)" <<
G4endl
333 <<
" Point p is inside !" <<
G4endl;
340 if(safety < 0.0) safety = 0.0 ;
370 G4cout <<
"WARNING - Invalid call in "
371 <<
"G4UnionSolid::DistanceToOut(p,v)" <<
G4endl
372 <<
" Point p is outside !" <<
G4endl;
375 G4cerr <<
"WARNING - Invalid call in "
376 <<
"G4UnionSolid::DistanceToOut(p,v)" <<
G4endl
377 <<
" Point p is outside !" <<
G4endl;
442 G4cout <<
"WARNING - Invalid call in "
443 <<
"G4UnionSolid::DistanceToOut(p)" <<
G4endl
444 <<
" Point p is outside !" <<
G4endl;
446 G4cerr <<
"WARNING - Invalid call in "
447 <<
"G4UnionSolid::DistanceToOut(p)" <<
G4endl
448 <<
" Point p is outside !" <<
G4endl;
533 if (
processor.execute(*result)) {
return result; }
534 else {
return nullptr; }
556 bminA.
x() < bmaxB.
x() && bminA.
y() < bmaxB.
y() && bminA.
z() < bmaxB.
z() &&
557 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)
static const G4double pMax
static const G4double pMin
static constexpr double mm
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
virtual G4double GetCubicVolume()
G4double GetRadialTolerance() const
static G4GeometryTolerance * GetInstance()
G4UnionSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const
EInside Inside(const G4ThreeVector &p) const
G4UnionSolid & operator=(const G4UnionSolid &rhs)
G4GeometryType GetEntityType() const
G4Polyhedron * CreatePolyhedron() const
virtual G4double GetCubicVolume() final
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4double halfCarTolerance
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
void DescribeYourselfTo(G4VGraphicsScene &scene) const
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
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()
static const G4double kInfinity
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments