55 :
G4VSolid(pName), fPtrSolidA(pSolidA), fPtrSolidB(pSolidB)
116 :
G4VSolid (rhs), fPtrSolidA(rhs.fPtrSolidA), fPtrSolidB(rhs.fPtrSolidB),
117 fStatistics(rhs.fStatistics), fCubVolEpsilon(rhs.fCubVolEpsilon),
118 fAreaAccuracy(rhs.fAreaAccuracy), fCubicVolume(rhs.fCubicVolume),
119 fSurfaceArea(rhs.fSurfaceArea), fRebuildPolyhedron(
false),
120 fpPolyhedron(nullptr), createdDisplacedSolid(rhs.createdDisplacedSolid)
133 if (
this == &rhs) {
return *
this; }
169 G4Exception(
"G4BooleanSolid::GetConstituentSolid()",
191 G4Exception(
"G4BooleanSolid::GetConstituentSolid()",
212 os <<
"-----------------------------------------------------------\n"
213 <<
" *** Dump for Boolean solid - " <<
GetName() <<
" ***\n"
214 <<
" ===================================================\n"
216 <<
" Parameters of constituent solids: \n"
217 <<
"===========================================================\n";
220 os <<
"===========================================================\n";
230 std::vector<std::pair<G4VSolid*,G4Transform3D>>& primitives,
239 for (
auto i=0; i<2; ++i)
241 transform = curPlacement;
247 while (type ==
"G4DisplacedSolid" ||
248 type ==
"G4ReflectedSolid" ||
249 type ==
"G4ScaledSolid")
251 if (type ==
"G4DisplacedSolid")
258 else if (type ==
"G4ReflectedSolid")
263 else if (type ==
"G4ScaledSolid")
265 transform = transform * ((
G4ScaledSolid*)solid)->GetScaleTransform();
274 if (type ==
"G4UnionSolid" ||
275 type ==
"G4SubtractionSolid" ||
276 type ==
"G4IntersectionSolid" ||
277 type ==
"G4BooleanSolid")
279 ((
G4BooleanSolid *)solid)->GetListOfPrimitives(primitives,transform);
283 primitives.push_back(std::pair<G4VSolid*,G4Transform3D>(solid,transform));
296 std::pair<G4VSolid *, G4Transform3D> prim;
305 for (
size_t i=0; i<nprims; ++i)
315 for (
size_t k=0;
k<100000; ++
k)
319 for (
size_t i=0; i<nprims; ++i)
322 area += prim.first->GetSurfaceArea();
323 if (rand < area)
break;
325 p = prim.first->GetPointOnSurface();
330 message <<
"Solid - " <<
GetName() <<
"\n"
331 <<
"All 100k attempts to generate a point on the surface have failed!\n"
332 <<
"The solid created may be an invalid Boolean construct!";
368 if (type ==
"G4UnionSolid")
370 else if (type ==
"G4IntersectionSolid")
372 else if (type ==
"G4SubtractionSolid")
377 message <<
"Solid - " << solid->
GetName()
378 <<
" - Unrecognised composite solid" <<
G4endl
379 <<
" Returning NULL !";
397 if (operand !=
nullptr)
399 processor.
push_back (operation, *operand);
404 message <<
"Solid - " << solid->
GetName()
405 <<
" - No G4Polyhedron for Boolean component";