37 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
55 G4VSolid(name), fShape(s), fRebuildPolyhedron(false), fPolyhedron(0)
59 G4USolid::G4USolid(__void__&
a)
60 :
G4VSolid(a), fShape(0), fRebuildPolyhedron(false), fPolyhedron(0)
66 delete fPolyhedron; fPolyhedron = 0;
71 return (
this == &s) ?
true :
false;
77 VUSolid::EnumInside in_temp;
83 in_temp = fShape->Inside(pt);
85 if (in_temp == VUSolid::EnumInside::eSurface)
return kSurface;
86 if (in_temp == VUSolid::EnumInside::eInside)
return kInside;
113 G4double dist = fShape->DistanceToIn(p, v);
125 G4double dist = fShape->SafetyFromOutside(p);
147 G4double dist = fShape->DistanceToOut(p, v, n, valid);
150 if(valid){ *validNorm =
true; }
151 else { *validNorm =
false; }
170 G4double dist = fShape->SafetyFromInside(p);
177 return fShape->Capacity();
182 return fShape->SurfaceArea();
188 p = fShape->GetPointOnSurface();
192 G4bool G4USolid::CalculateExtent(
const EAxis pAxis,
199 VUSolid::EAxisType eAxis = VUSolid::eXaxis;
203 eAxis = VUSolid::eYaxis;
208 eAxis = VUSolid::eZaxis;
211 fShape->ExtentAxis(eAxis, pMin, pMax);
259 pMin -= kCarTolerance ;
260 pMax += kCarTolerance ;
268 G4bool existsAfterClip = false ;
276 vertices = CreateRotatedVertices(pTransform) ;
277 ClipCrossSection(vertices, 0, pVoxelLimit, pAxis, pMin, pMax) ;
278 ClipCrossSection(vertices, 4, pVoxelLimit, pAxis, pMin, pMax) ;
279 ClipBetweenSections(vertices, 0, pVoxelLimit, pAxis, pMin, pMax) ;
281 if (pVoxelLimit.
IsLimited(pAxis) ==
false)
285 existsAfterClip = true ;
289 pMin -= kCarTolerance;
290 pMax += kCarTolerance;
302 existsAfterClip = true ;
315 pMin -= kCarTolerance;
325 pMax += kCarTolerance;
337 existsAfterClip = true ;
343 return existsAfterClip;
351 std::ostringstream message;
352 message <<
"Illegal call to G4USolid::ComputeDimensions()" <<
G4endl
353 <<
"Method not overloaded by derived class !";
354 G4Exception(
"G4USolid::ComputeDimensions()",
"GeomSolids0003",
366 G4String string = fShape->GetEntityType();
367 return "G4" + string;
370 std::ostream& G4USolid::StreamInfo(std::ostream& os)
const
372 return fShape->StreamInfo(os);
375 G4USolid::G4USolid(
const G4USolid& rhs)
376 :
G4VSolid(rhs), fRebuildPolyhedron(false), fPolyhedron(0)
378 fShape = rhs.fShape->
Clone();
381 G4USolid& G4USolid::operator=(
const G4USolid& rhs)
396 fShape = rhs.fShape->Clone();
397 fRebuildPolyhedron =
false;
398 delete fPolyhedron; fPolyhedron = 0;
405 std::ostringstream message;
406 message <<
"Clone() method not implemented for type: "
407 << GetEntityType() <<
"!" <<
G4endl
408 <<
"Returning NULL pointer!";
416 G4double xMin, xMax, yMin, yMax, zMin, zMax;
418 fShape->ExtentAxis(VUSolid::eXaxis, xMin, xMax);
419 fShape->ExtentAxis(VUSolid::eYaxis, yMin, yMax);
420 fShape->ExtentAxis(VUSolid::eZaxis, zMin, zMax);
427 vertices->reserve(8);
448 G4Exception(
"G4VUSolid::CreateRotatedVertices()",
"FatalError",
458 std::ostringstream message;
459 message <<
"Visualization not supported for USolid shape "
460 << GetEntityType() <<
"... Sorry!" <<
G4endl;
461 G4Exception(
"G4USolid::CreatePolyhedron()",
"GeomSolids0003",
469 fRebuildPolyhedron ||
470 fPolyhedron->GetNumberOfRotationStepsAtTimeOfCreation() !=
471 fPolyhedron->GetNumberOfRotationSteps())
475 fPolyhedron = CreatePolyhedron();
476 fRebuildPolyhedron =
false;
488 CalculateExtent(
kXAxis, voxelLimits, affineTransform, vmin, vmax);
491 CalculateExtent(
kYAxis, voxelLimits, affineTransform, vmin, vmax);
494 CalculateExtent(
kZAxis, voxelLimits, affineTransform, vmin, vmax);
500 #endif // G4GEOM_USE_USOLIDS
static const G4double kInfinity
G4double GetMinYExtent() const
CLHEP::Hep3Vector G4ThreeVector
void SetXmax(G4double xmax)
virtual void AddSolid(const G4Box &)=0
#define G4MUTEX_INITIALIZER
void SetYmax(G4double ymax)
G4double GetMaxXExtent() const
G4double GetMinZExtent() const
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double GetMinXExtent() const
G4double GetMaxZExtent() const
void SetZmin(G4double zmin)
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
G4bool operator==(const G4GeometryCell &k1, const G4GeometryCell &k2)
G4double GetMaxYExtent() const
G4VSolid & operator=(const G4VSolid &rhs)
virtual G4VSolid * Clone() const
void SetZmax(G4double zmax)
void SetXmin(G4double xmin)
G4double GetMaxExtent(const EAxis pAxis) const
void SetYmin(G4double ymin)
G4double GetMinExtent(const EAxis pAxis) const