115 if (
this == &rhs) {
return *
this; }
120 fshapeName = rhs.fshapeName;
142 std::ostringstream message;
143 message <<
"Illegal call to G4VSolid::ComputeDimensions()" <<
G4endl
144 <<
"Method not overloaded by derived class !";
145 G4Exception(
"G4VSolid::ComputeDimensions()",
"GeomMgt0003",
155 std::ostringstream message;
156 message <<
"Not implemented for solid: "
158 <<
"Returning origin.";
159 G4Exception(
"G4VSolid::GetPointOnSurface()",
"GeomMgt1001",
191 G4int cubVolStatistics = 1000000;
207 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,volume,halfepsilon;
224 if(nStat < 100) nStat = 100;
225 if(epsilon > 0.01) epsilon = 0.01;
228 for(
G4int i = 0; i < nStat; i++ )
237 volume = (maxX-minX+
epsilon)*(maxY-minY+epsilon)
238 * (maxZ-minZ+
epsilon)*iInside/nStat;
253 G4int stat = 1000000;
267 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,surf;
284 if(nStat < 100) { nStat = 100; }
292 if(dY<dX) { minval=dY; }
293 if(dZ<minval) { minval=dZ; }
298 minX-=ell; minY-=ell; minZ-=ell; dX+=dd; dY+=dd; dZ+=dd;
300 for(
G4int i = 0; i < nStat; i++ )
314 surf = dX*dY*dZ*inside/dd/nStat;
327 std::ostringstream message;
328 message <<
"Clone() method not implemented for type: "
330 <<
"Returning NULL pointer!";
349 const G4int pSectionIndex,
357 polygon.push_back((*pVertices)[pSectionIndex]);
358 polygon.push_back((*pVertices)[pSectionIndex+1]);
359 polygon.push_back((*pVertices)[pSectionIndex+2]);
360 polygon.push_back((*pVertices)[pSectionIndex+3]);
380 const G4int pSectionIndex,
387 polygon.push_back((*pVertices)[pSectionIndex]);
388 polygon.push_back((*pVertices)[pSectionIndex+4]);
389 polygon.push_back((*pVertices)[pSectionIndex+5]);
390 polygon.push_back((*pVertices)[pSectionIndex+1]);
395 polygon.push_back((*pVertices)[pSectionIndex+1]);
396 polygon.push_back((*pVertices)[pSectionIndex+5]);
397 polygon.push_back((*pVertices)[pSectionIndex+6]);
398 polygon.push_back((*pVertices)[pSectionIndex+2]);
403 polygon.push_back((*pVertices)[pSectionIndex+2]);
404 polygon.push_back((*pVertices)[pSectionIndex+6]);
405 polygon.push_back((*pVertices)[pSectionIndex+7]);
406 polygon.push_back((*pVertices)[pSectionIndex+3]);
411 polygon.push_back((*pVertices)[pSectionIndex+3]);
412 polygon.push_back((*pVertices)[pSectionIndex+7]);
413 polygon.push_back((*pVertices)[pSectionIndex+4]);
414 polygon.push_back((*pVertices)[pSectionIndex]);
449 noLeft = pPolygon.size();
454 for (i=0;i<noLeft;i++)
456 component = pPolygon[i].operator()(pAxis);
459 if (component < pMin)
464 if (component > pMax)
508 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
512 if ( !outputPolygon.size() )
return;
517 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
519 if ( !pPolygon.size() )
return;
520 else outputPolygon.clear();
526 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
533 if ( !outputPolygon.size() )
return;
537 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
539 if ( !pPolygon.size() )
return;
540 else outputPolygon.clear();
546 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
553 if ( !outputPolygon.size() )
return;
557 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
575 G4int noVertices=pPolygon.size();
578 for (i = 0 ; i < noVertices ; i++ )
580 vStart = pPolygon[i];
582 if ( i == noVertices-1 ) vEnd = pPolygon[0];
583 else vEnd = pPolygon[i+1];
585 if ( pVoxelLimit.
Inside(vStart) )
587 if (pVoxelLimit.
Inside(vEnd))
591 outputPolygon.push_back(vEnd);
599 outputPolygon.push_back(vEnd);
604 if (pVoxelLimit.
Inside(vEnd))
610 outputPolygon.push_back(vStart);
611 outputPolygon.push_back(vEnd);
628 std::ostringstream message;
629 message <<
"Not implemented for solid: "
631 <<
"\nReturning infinite boundinx box.";
void set(double x, double y, double z)
virtual G4Polyhedron * GetPolyhedron() const
void ClipCrossSection(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
static const G4double kInfinity
G4double GetMinYExtent() const
static void Register(G4VSolid *pSolid)
CLHEP::Hep3Vector G4ThreeVector
static void DeRegister(G4VSolid *pSolid)
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
G4bool IsYLimited() const
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
G4double GetSurfaceTolerance() const
virtual G4double GetCubicVolume()
void SetXmax(G4double xmax)
G4bool IsXLimited() const
virtual G4GeometryType GetEntityType() const =0
void SetYmax(G4double ymax)
G4double GetMaxXExtent() const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4double GetMinZExtent() const
virtual std::ostream & StreamInfo(std::ostream &os) const =0
void CalculateClippedPolygonExtent(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
virtual EInside Inside(const G4ThreeVector &p) const =0
G4bool Inside(const G4ThreeVector &pVec) const
static G4SolidStore * GetInstance()
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
const G4double kCarTolerance
virtual G4Polyhedron * CreatePolyhedron() const
std::vector< G4ThreeVector > G4ThreeVectorList
G4double EstimateSurfaceArea(G4int nStat, G4double ell) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double GetMinXExtent() const
virtual G4VisExtent GetExtent() const
G4double GetMaxZExtent() const
void SetZmin(G4double zmin)
virtual G4ThreeVector GetPointOnSurface() const
virtual const G4VSolid * GetConstituentSolid(G4int no) const
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
G4VSolid(const G4String &name)
G4double GetMaxYExtent() const
G4VSolid & operator=(const G4VSolid &rhs)
virtual G4VSolid * Clone() const
void SetZmax(G4double zmax)
void SetXmin(G4double xmin)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
void SetYmin(G4double ymin)
G4bool IsZLimited() const
virtual G4double GetSurfaceArea()
virtual void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
double epsilon(double density, double temperature)
virtual const G4DisplacedSolid * GetDisplacedSolidPtr() const
static G4GeometryTolerance * GetInstance()
void ClipPolygon(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const