64 G4VSolid(pName), fStatistics(1000000), fCubVolEpsilon(0.001),
65 fAreaAccuracy(-1.), fCubicVolume(-1.), fSurfaceArea(-1.),
66 fRebuildPolyhedron(false), fpPolyhedron(0), fPrimitivesSurfaceArea(0.),
67 createdDisplacedSolid(false)
82 G4VSolid(pName), fStatistics(1000000), fCubVolEpsilon(0.001),
83 fAreaAccuracy(-1.), fCubicVolume(-1.), fSurfaceArea(-1.),
84 fRebuildPolyhedron(false), fpPolyhedron(0), fPrimitivesSurfaceArea(0.),
85 createdDisplacedSolid(true)
99 G4VSolid(pName), fStatistics(1000000), fCubVolEpsilon(0.001),
100 fAreaAccuracy(-1.), fCubicVolume(-1.), fSurfaceArea(-1.),
101 fRebuildPolyhedron(false), fpPolyhedron(0), fPrimitivesSurfaceArea(0.),
102 createdDisplacedSolid(true)
114 :
G4VSolid(a), fPtrSolidA(0), fPtrSolidB(0),
115 fStatistics(1000000), fCubVolEpsilon(0.001),
116 fAreaAccuracy(-1.), fCubicVolume(-1.), fSurfaceArea(-1.),
117 fRebuildPolyhedron(false), fpPolyhedron(0), fPrimitivesSurfaceArea(0.),
118 createdDisplacedSolid(false)
140 :
G4VSolid (rhs), fPtrSolidA(rhs.fPtrSolidA), fPtrSolidB(rhs.fPtrSolidB),
141 fStatistics(rhs.fStatistics), fCubVolEpsilon(rhs.fCubVolEpsilon),
142 fAreaAccuracy(rhs.fAreaAccuracy), fCubicVolume(rhs.fCubicVolume),
143 fSurfaceArea(rhs.fSurfaceArea), fRebuildPolyhedron(false), fpPolyhedron(0),
144 createdDisplacedSolid(rhs.createdDisplacedSolid)
157 if (
this == &rhs) {
return *
this; }
193 G4Exception(
"G4BooleanSolid::GetConstituentSolid()",
216 G4Exception(
"G4BooleanSolid::GetConstituentSolid()",
238 os <<
"-----------------------------------------------------------\n"
239 <<
" *** Dump for Boolean solid - " <<
GetName() <<
" ***\n"
240 <<
" ===================================================\n"
242 <<
" Parameters of constituent solids: \n"
243 <<
"===========================================================\n";
246 os <<
"===========================================================\n";
256 std::vector<std::pair<G4VSolid *,G4Transform3D>>& primitives,
265 for (
G4int i=0; i<2; i++)
267 transform = curPlacement;
273 while (type ==
"G4DisplacedSolid" ||
274 type ==
"G4ReflectedSolid" ||
275 type ==
"G4ScaledSolid")
277 if (type ==
"G4DisplacedSolid")
284 else if (type ==
"G4ReflectedSolid")
289 else if (type ==
"G4ScaledSolid")
291 transform = transform * ((
G4ScaledSolid*)solid)->GetScaleTransform();
300 if (type ==
"G4UnionSolid" ||
301 type ==
"G4SubtractionSolid" ||
302 type ==
"G4IntersectionSolid" ||
303 type ==
"G4BooleanSolid")
305 ((
G4BooleanSolid *)solid)->GetListOfPrimitives(primitives,transform);
309 primitives.push_back(std::pair<G4VSolid*,G4Transform3D>(solid,transform));
322 std::pair<G4VSolid *, G4Transform3D> prim;
331 for (
G4int i=0; i<nprims; i++)
341 for (
G4int k=0; k<1000000; k++)
345 for (
G4int i=0; i<nprims; i++)
348 area += prim.first->GetSurfaceArea();
349 if (rand < area)
break;
351 p = prim.first->GetPointOnSurface();
356 message <<
"Solid - " <<
GetName() <<
"\n"
357 <<
"All attempts to generate a point on the surface have failed!\n"
358 <<
"The solid created may be an invalid Boolean construct!";
394 if (type ==
"G4UnionSolid")
396 else if (type ==
"G4IntersectionSolid")
398 else if (type ==
"G4SubtractionSolid")
403 message <<
"Solid - " << solid->
GetName()
404 <<
" - Unrecognised composite solid" <<
G4endl
405 <<
" Returning NULL !";
425 processor.
push_back (operation, *operand);
430 message <<
"Solid - " << solid->
GetName()
431 <<
" - No G4Polyhedron for Boolean component";
virtual G4GeometryType GetEntityType() const
G4bool createdDisplacedSolid
std::vector< ExP01TrackerHit * > a
virtual G4Polyhedron * GetPolyhedron() const
virtual ~G4BooleanSolid()
void message(RunManager *runmanager)
G4BooleanSolid & operator=(const G4BooleanSolid &rhs)
virtual G4Polyhedron * GetPolyhedron() const
void push_back(Operation, const HepPolyhedron &)
G4ThreeVector GetPointOnSurface() const
virtual EInside Inside(const G4ThreeVector &p) const =0
G4VSolid & operator=(const G4VSolid &rhs)
#define G4MUTEX_INITIALIZER
G4BooleanSolid(const G4String &pName, G4VSolid *pSolidA, G4VSolid *pSolidB)
G4bool fRebuildPolyhedron
G4double fPrimitivesSurfaceArea
virtual std::ostream & StreamInfo(std::ostream &os) const =0
std::vector< std::pair< G4VSolid *, G4Transform3D > > fPrimitives
static G4int GetNumberOfRotationSteps()
virtual const G4VSolid * GetConstituentSolid(G4int no) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4Polyhedron * StackPolyhedron(HepPolyhedronProcessor &, const G4VSolid *) const
G4int GetNumberOfRotationStepsAtTimeOfCreation() const
virtual G4Polyhedron * CreatePolyhedron() const
virtual G4GeometryType GetEntityType() const =0
virtual const G4VSolid * GetConstituentSolid(G4int no) const
HepGeom::Point3D< G4double > G4Point3D
void GetListOfPrimitives(std::vector< std::pair< G4VSolid *, G4Transform3D >> &, const G4Transform3D &) const
static int operand(pchar begin, pchar end, double &result, pchar &endp, const dic_type &dictionary)
std::ostream & StreamInfo(std::ostream &os) const
G4Polyhedron * fpPolyhedron