432 G4double RTorus,delta,diff1,diff2,maxDiff,newMin,newMax;
480 zMin = zoffset -
fRmax ;
481 zMax = zoffset +
fRmax ;
510 if ( yoff1 >= 0 && yoff2 >= 0 )
524 delta = RTorus*RTorus - yoff1*yoff1;
525 diff1 = (delta>0.) ? std::sqrt(delta) : 0.;
526 delta = RTorus*RTorus - yoff2*yoff2;
527 diff2 = (delta>0.) ? std::sqrt(delta) : 0.;
528 maxDiff = (diff1 > diff2) ? diff1:diff2 ;
529 newMin = xoffset - maxDiff ;
530 newMax = xoffset + maxDiff ;
531 pMin = (newMin < xMin) ? xMin : newMin ;
532 pMax = (newMax > xMax) ? xMax : newMax ;
537 xoff1 = xoffset - xMin ;
538 xoff2 = xMax - xoffset ;
539 if (xoff1 >= 0 && xoff2 >= 0 )
552 delta = RTorus*RTorus - xoff1*xoff1;
553 diff1 = (delta>0.) ? std::sqrt(delta) : 0.;
554 delta = RTorus*RTorus - xoff2*xoff2;
555 diff2 = (delta>0.) ? std::sqrt(delta) : 0.;
556 maxDiff = (diff1 > diff2) ? diff1 : diff2 ;
557 newMin = yoffset - maxDiff ;
558 newMax = yoffset + maxDiff ;
559 pMin = (newMin < yMin) ? yMin : newMin ;
560 pMax = (newMax > yMax) ? yMax : newMax ;
579 G4int i, noEntries, noBetweenSections4 ;
580 G4bool existsAfterClip = false ;
585 G4int noPolygonVertices ;
591 noEntries = vertices->size() ;
592 noBetweenSections4 = noEntries - noPolygonVertices ;
594 for (i=0;i<noEntries;i+=noPolygonVertices)
598 for (i=0;i<noBetweenSections4;i+=noPolygonVertices)
604 existsAfterClip = true ;
622 existsAfterClip = true ;
628 return existsAfterClip;
void ClipBetweenSections(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
G4double GetMinXExtent() const
static const G4double kInfinity
G4double GetMinYExtent() const
EInside Inside(const G4ThreeVector &p) const
G4double GetMinZExtent() const
G4bool IsYLimited() const
void ClipCrossSection(G4ThreeVectorList *pVertices, const G4int pSectionIndex, const G4VoxelLimits &pVoxelLimit, const EAxis pAxis, G4double &pMin, G4double &pMax) const
G4bool IsXLimited() const
G4double GetMaxZExtent() const
G4double GetMaxXExtent() const
static const double twopi
std::vector< G4ThreeVector > G4ThreeVectorList
G4double GetMinExtent(const EAxis pAxis) const
G4bool IsZLimited() const
G4double GetMaxExtent(const EAxis pAxis) const
G4double GetMaxYExtent() const
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pTransform, G4int &noPolygonVertices) const