76 : kCarTolerance(rhs.kCarTolerance), fshapeName(rhs.fshapeName)
114 if (
this == &rhs) {
return *
this; }
141 std::ostringstream message;
142 message <<
"Illegal call to G4VSolid::ComputeDimensions()" <<
G4endl
143 <<
"Method not overloaded by derived class !";
144 G4Exception(
"G4VSolid::ComputeDimensions()",
"GeomMgt0003",
154 std::ostringstream message;
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;
225 halfepsilon = 0.5*epsilon;
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;
266 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,surf;
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;
326 std::ostringstream message;
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);
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)
void ClipPolygonToSimpleLimits(G4ThreeVectorList &pPolygon, G4ThreeVectorList &outputPolygon, const G4VoxelLimits &pVoxelLimit) const
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
std::vector< G4ThreeVector > G4ThreeVectorList
static G4SolidStore * GetInstance()
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
virtual G4Polyhedron * CreatePolyhedron() const
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
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
std::ostream & operator<<(std::ostream &os, const G4VSolid &e)
void SetYmin(G4double ymin)
G4bool IsZLimited() const
virtual G4double GetSurfaceArea()
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
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