226 G4double diff1, diff2, maxDiff, newMin, newMax;
227 G4double xoff1, xoff2, yoff1, yoff2, delta;
230 xMin = xoffset -
fRMax;
231 xMax = xoffset +
fRMax;
253 yMin = yoffset -
fRMax;
254 yMax = yoffset +
fRMax;
276 zMin = zoffset -
fDz;
277 zMax = zoffset +
fDz;
302 yoff1 = yoffset - yMin;
303 yoff2 = yMax - yoffset;
305 if ( (yoff1 >= 0) && (yoff2 >= 0) )
315 delta = fRMax*fRMax - yoff1*yoff1;
316 diff1 = (delta>0.) ? std::sqrt(delta) : 0.;
317 delta = fRMax*fRMax - yoff2*yoff2;
318 diff2 = (delta>0.) ? std::sqrt(delta) : 0.;
319 maxDiff = (diff1 > diff2) ? diff1:diff2;
320 newMin = xoffset - maxDiff;
321 newMax = xoffset + maxDiff;
322 pMin = (newMin < xMin) ? xMin : newMin;
323 pMax = (newMax > xMax) ? xMax : newMax;
329 xoff1 = xoffset - xMin;
330 xoff2 = xMax - xoffset;
332 if ( (xoff1 >= 0) && (xoff2 >= 0) )
342 delta = fRMax*fRMax - xoff1*xoff1;
343 diff1 = (delta>0.) ? std::sqrt(delta) : 0.;
344 delta = fRMax*fRMax - xoff2*xoff2;
345 diff2 = (delta>0.) ? std::sqrt(delta) : 0.;
346 maxDiff = (diff1 > diff2) ? diff1 : diff2;
347 newMin = yoffset - maxDiff;
348 newMax = yoffset + maxDiff;
349 pMin = (newMin < yMin) ? yMin : newMin;
350 pMax = (newMax > yMax) ? yMax : newMax;
369 G4int i, noEntries, noBetweenSections4;
370 G4bool existsAfterClip =
false;
376 noEntries = vertices->size();
377 noBetweenSections4 = noEntries - 4;
379 for ( i = 0 ; i < noEntries ; i += 4 )
383 for ( i = 0 ; i < noBetweenSections4 ; i += 4 )
389 existsAfterClip =
true;
407 existsAfterClip =
true;
413 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
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
G4ThreeVectorList * CreateRotatedVertices(const G4AffineTransform &pTransform) 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
EInside Inside(const G4ThreeVector &p) const
G4double GetMaxYExtent() const