76 : kCarTolerance(rhs.kCarTolerance), fshapeName(rhs.fshapeName)
114 if (
this == &rhs) {
return *
this; }
119 fshapeName = rhs.fshapeName;
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;
223 if(nStat < 100) nStat = 100;
224 if(epsilon > 0.01) epsilon = 0.01;
226 for(
G4int i = 0; i < nStat; i++ )
235 volume = (maxX-minX)*(maxY-minY)*(maxZ-minZ)*iInside/nStat;
250 G4int stat = 1000000;
264 G4double px,py,pz,minX,maxX,minY,maxY,minZ,maxZ,surf;
281 if(nStat < 100) { nStat = 100; }
289 if(dY<dX) { minval=dY; }
290 if(dZ<minval) { minval=dZ; }
295 minX-=ell; minY-=ell; minZ-=ell; dX+=dd; dY+=dd; dZ+=dd;
297 for(
G4int i = 0; i < nStat; i++ )
311 surf = dX*dY*dZ*inside/dd/nStat;
324 std::ostringstream message;
325 message <<
"Clone() method not implemented for type: "
327 <<
"Returning NULL pointer!";
346 const G4int pSectionIndex,
354 polygon.push_back((*pVertices)[pSectionIndex]);
355 polygon.push_back((*pVertices)[pSectionIndex+1]);
356 polygon.push_back((*pVertices)[pSectionIndex+2]);
357 polygon.push_back((*pVertices)[pSectionIndex+3]);
377 const G4int pSectionIndex,
384 polygon.push_back((*pVertices)[pSectionIndex]);
385 polygon.push_back((*pVertices)[pSectionIndex+4]);
386 polygon.push_back((*pVertices)[pSectionIndex+5]);
387 polygon.push_back((*pVertices)[pSectionIndex+1]);
392 polygon.push_back((*pVertices)[pSectionIndex+1]);
393 polygon.push_back((*pVertices)[pSectionIndex+5]);
394 polygon.push_back((*pVertices)[pSectionIndex+6]);
395 polygon.push_back((*pVertices)[pSectionIndex+2]);
400 polygon.push_back((*pVertices)[pSectionIndex+2]);
401 polygon.push_back((*pVertices)[pSectionIndex+6]);
402 polygon.push_back((*pVertices)[pSectionIndex+7]);
403 polygon.push_back((*pVertices)[pSectionIndex+3]);
408 polygon.push_back((*pVertices)[pSectionIndex+3]);
409 polygon.push_back((*pVertices)[pSectionIndex+7]);
410 polygon.push_back((*pVertices)[pSectionIndex+4]);
411 polygon.push_back((*pVertices)[pSectionIndex]);
446 noLeft = pPolygon.size();
451 for (i=0;i<noLeft;i++)
453 component = pPolygon[i].operator()(pAxis);
456 if (component < pMin)
461 if (component > pMax)
505 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
509 if ( !outputPolygon.size() )
return;
514 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
516 if ( !pPolygon.size() )
return;
517 else outputPolygon.clear();
523 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
530 if ( !outputPolygon.size() )
return;
534 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
536 if ( !pPolygon.size() )
return;
537 else outputPolygon.clear();
543 ClipPolygonToSimpleLimits(pPolygon,outputPolygon,simpleLimit1);
550 if ( !outputPolygon.size() )
return;
554 ClipPolygonToSimpleLimits(outputPolygon,pPolygon,simpleLimit2);
572 G4int noVertices=pPolygon.size();
575 for (i = 0 ; i < noVertices ; i++ )
577 vStart = pPolygon[i];
579 if ( i == noVertices-1 ) vEnd = pPolygon[0];
580 else vEnd = pPolygon[i+1];
582 if ( pVoxelLimit.
Inside(vStart) )
584 if (pVoxelLimit.
Inside(vEnd))
588 outputPolygon.push_back(vEnd);
596 outputPolygon.push_back(vEnd);
601 if (pVoxelLimit.
Inside(vEnd))
607 outputPolygon.push_back(vStart);
608 outputPolygon.push_back(vEnd);
CLHEP::Hep3Vector G4ThreeVector
std::ostream & operator<<(std::ostream &os, const G4VSolid &e)
std::vector< G4ThreeVector > G4ThreeVectorList
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
static void Register(G4VSolid *pSolid)
static void DeRegister(G4VSolid *pSolid)
static G4SolidStore * GetInstance()
G4double EstimateSurfaceArea(G4int nStat, G4double ell) const
virtual G4VSolid * Clone() const
virtual const G4VSolid * GetConstituentSolid(G4int no) const
virtual std::ostream & StreamInfo(std::ostream &os) const =0
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
G4double EstimateCubicVolume(G4int nStat, G4double epsilon) const
virtual G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const =0
virtual G4VisExtent GetExtent() const
virtual G4NURBS * CreateNURBS() const
G4VSolid(const G4String &name)
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
virtual G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=0, G4ThreeVector *n=0) const =0
virtual G4ThreeVector GetPointOnSurface() const
void ClipPolygon(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis) const
virtual G4Polyhedron * GetPolyhedron() const
virtual G4Polyhedron * CreatePolyhedron() const
G4VSolid & operator=(const G4VSolid &rhs)
virtual G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const =0
virtual const G4DisplacedSolid * GetDisplacedSolidPtr() const
virtual G4double GetCubicVolume()
void ClipCrossSection(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
virtual G4double GetSurfaceArea()
void CalculateClippedPolygonExtent(G4ThreeVectorList &pPolygon, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
virtual G4GeometryType GetEntityType() const =0
void SetYmin(G4double ymin)
void SetYmax(G4double ymax)
void SetXmax(G4double xmax)
void SetXmin(G4double xmin)
void SetZmax(G4double zmax)
void SetZmin(G4double zmin)
G4bool IsYLimited() const
G4bool ClipToLimits(G4ThreeVector &pStart, G4ThreeVector &pEnd) const
G4double GetMinZExtent() const
void AddLimit(const EAxis pAxis, const G4double pMin, const G4double pMax)
G4bool IsXLimited() const
G4double GetMaxYExtent() const
G4bool Inside(const G4ThreeVector &pVec) const
G4double GetMaxZExtent() const
G4double GetMinYExtent() const
G4double GetMinXExtent() const
G4bool IsZLimited() const
G4double GetMaxXExtent() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)