114 if (
this == &rhs) {
return *
this; }
142 message <<
"Illegal call to G4VSolid::ComputeDimensions()" <<
G4endl
143 <<
"Method not overloaded by derived class !";
144 G4Exception(
"G4VSolid::ComputeDimensions()",
"GeomMgt0003",
155 message <<
"Not implemented for solid: "
157 <<
"Returning origin.";
158 G4Exception(
"G4VSolid::GetPointOnSurface()",
"GeomMgt1001",
190 G4int cubVolStatistics = 1000000;
206 G4double px,py,pz,minX,maxX,
minY,
maxY,minZ,
maxZ,volume,halfepsilon;
223 if(nStat < 100) nStat = 100;
224 if(epsilon > 0.01) epsilon = 0.01;
227 for(
G4int i = 0; i < nStat; i++ )
236 volume = (maxX-minX+
epsilon)*(maxY-minY+epsilon)
237 * (maxZ-minZ+
epsilon)*iInside/nStat;
252 G4int stat = 1000000;
283 if(nStat < 100) { nStat = 100; }
291 if(dY<dX) { minval=dY; }
292 if(dZ<minval) { minval=dZ; }
297 minX-=ell; minY-=ell; minZ-=ell; dX+=dd; dY+=dd; dZ+=dd;
299 for(
G4int i = 0; i < nStat; i++ )
313 surf = dX*dY*dZ*inside/dd/nStat;
327 message <<
"Clone() method not implemented for type: "
329 <<
"Returning NULL pointer!";
348 const G4int pSectionIndex,
356 polygon.push_back((*pVertices)[pSectionIndex]);
357 polygon.push_back((*pVertices)[pSectionIndex+1]);
358 polygon.push_back((*pVertices)[pSectionIndex+2]);
359 polygon.push_back((*pVertices)[pSectionIndex+3]);
379 const G4int pSectionIndex,
386 polygon.push_back((*pVertices)[pSectionIndex]);
387 polygon.push_back((*pVertices)[pSectionIndex+4]);
388 polygon.push_back((*pVertices)[pSectionIndex+5]);
389 polygon.push_back((*pVertices)[pSectionIndex+1]);
394 polygon.push_back((*pVertices)[pSectionIndex+1]);
395 polygon.push_back((*pVertices)[pSectionIndex+5]);
396 polygon.push_back((*pVertices)[pSectionIndex+6]);
397 polygon.push_back((*pVertices)[pSectionIndex+2]);
402 polygon.push_back((*pVertices)[pSectionIndex+2]);
403 polygon.push_back((*pVertices)[pSectionIndex+6]);
404 polygon.push_back((*pVertices)[pSectionIndex+7]);
405 polygon.push_back((*pVertices)[pSectionIndex+3]);
410 polygon.push_back((*pVertices)[pSectionIndex+3]);
411 polygon.push_back((*pVertices)[pSectionIndex+7]);
412 polygon.push_back((*pVertices)[pSectionIndex+4]);
413 polygon.push_back((*pVertices)[pSectionIndex]);
448 noLeft = pPolygon.size();
453 for (i=0;i<noLeft;i++)
455 component = pPolygon[i].operator()(pAxis);
458 if (component < pMin)
463 if (component > pMax)
511 if ( !outputPolygon.size() )
return;
518 if ( !pPolygon.size() )
return;
519 else outputPolygon.clear();
532 if ( !outputPolygon.size() )
return;
538 if ( !pPolygon.size() )
return;
539 else outputPolygon.clear();
552 if ( !outputPolygon.size() )
return;
574 G4int noVertices=pPolygon.size();
577 for (i = 0 ; i < noVertices ; i++ )
579 vStart = pPolygon[i];
581 if ( i == noVertices-1 ) vEnd = pPolygon[0];
582 else vEnd = pPolygon[i+1];
584 if ( pVoxelLimit.
Inside(vStart) )
586 if (pVoxelLimit.
Inside(vEnd))
590 outputPolygon.push_back(vEnd);
598 outputPolygon.push_back(vEnd);
603 if (pVoxelLimit.
Inside(vEnd))
609 outputPolygon.push_back(vStart);
610 outputPolygon.push_back(vEnd);
628 message <<
"Not implemented for solid: "
630 <<
"\nReturning infinite boundinx box.";
631 G4Exception(
"G4VSolid::BoundingLimits()",
"GeomMgt1001",
void set(double x, double y, double z)
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
G4bool Inside(const G4ThreeVector &pVec) const
CLHEP::Hep3Vector G4ThreeVector
G4double GetMinZExtent() const
static const G4double kInfinity
G4bool IsZLimited() const
virtual G4VisExtent GetExtent() const
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
virtual G4Polyhedron * GetPolyhedron() const
void SetYmax(G4double ymax)
void CalculateClippedPolygonExtent(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
void SetZmax(G4double zmax)
virtual void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4double GetMinYExtent() const
void message(RunManager *runmanager)
void SetZmin(G4double zmin)
virtual G4double GetSurfaceArea()
virtual G4ThreeVector GetPointOnSurface() const
virtual G4VSolid * Clone() const
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
const G4double kCarTolerance
void SetXmin(G4double xmin)
void SetXmax(G4double xmax)
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual const G4DisplacedSolid * GetDisplacedSolidPtr() const
G4VSolid & operator=(const G4VSolid &rhs)
void SetYmin(G4double ymin)
std::vector< G4ThreeVector > G4ThreeVectorList
G4double GetMaxYExtent() const
G4double GetMaxZExtent() const
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
G4double GetMaxXExtent() const
virtual std::ostream & StreamInfo(std::ostream &os) const =0
double epsilon(double density, double temperature)
void ClipPolygon(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
static G4SolidStore * GetInstance()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static void Register(G4VSolid *pSolid)
G4VSolid(const G4String &name)
virtual G4double GetCubicVolume()
G4bool IsXLimited() const
G4double EstimateSurfaceArea(G4int nStat, G4double ell) const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
virtual G4Polyhedron * CreatePolyhedron() const
static G4GeometryTolerance * GetInstance()
void ClipCrossSection(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
static void DeRegister(G4VSolid *pSolid)
void ClipPolygonToSimpleLimits(G4ThreeVectorList &pPolygon, G4ThreeVectorList &outputPolygon, const G4VoxelLimits &pVoxelLimit) const
virtual G4GeometryType GetEntityType() const =0
virtual const G4VSolid * GetConstituentSolid(G4int no) const
G4double GetMinXExtent() const
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const
G4double GetSurfaceTolerance() const
G4bool IsYLimited() const