587 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
589 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
591 return exist = (pMin < pMax) ?
true :
false;
600 std::vector<G4int> iout;
612 if (area < 0.) std::reverse(contourRZ.begin(),contourRZ.end());
617 std::ostringstream message;
618 message <<
"Triangulation of RZ contour has failed for solid: "
620 <<
"\nExtent has been calculated using boundary box";
623 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
627 const G4int NSTEPS = 24;
633 G4int ksteps = (dphi <= astep) ? 1 : (
G4int)((dphi-
deg)/astep) + 1;
636 G4double sinHalf = std::sin(0.5*ang);
637 G4double cosHalf = std::cos(0.5*ang);
638 G4double sinStep = 2.*sinHalf*cosHalf;
639 G4double cosStep = 1. - 2.*sinHalf*sinHalf;
647 std::vector<const G4ThreeVectorList *> polygons;
648 polygons.resize(ksteps+2);
650 for (
G4int k=0; k<ksteps+2; ++k) pols[k].resize(6);
651 for (
G4int k=0; k<ksteps+2; ++k) polygons[k] = &pols[k];
658 G4int ntria = triangles.size()/3;
659 for (
G4int i=0; i<ntria; ++i)
662 for (
G4int k=0; k<3; ++k)
664 G4int e0 = i3+k, e1 = (k<2) ? e0+1 : i3;
667 r0[k2+0] = triangles[e0].x(); z0[k2+0] = triangles[e0].y();
668 r0[k2+1] = triangles[e1].x(); z0[k2+1] = triangles[e1].y();
672 if (z0[k2+1] - z0[k2+0] <= 0)
continue;
678 G4double sinCur = sinStart*cosHalf + cosStart*sinHalf;
679 G4double cosCur = cosStart*cosHalf - sinStart*sinHalf;
680 for (
G4int j=0; j<6; ++j) pols[0][j].set(r0[j]*cosStart,r0[j]*sinStart,z0[j]);
681 for (
G4int k=1; k<ksteps+1; ++k)
683 for (
G4int j=0; j<6; ++j) pols[k][j].set(r1[j]*cosCur,r1[j]*sinCur,z0[j]);
685 sinCur = sinCur*cosStep + cosCur*sinStep;
686 cosCur = cosCur*cosStep - sinTmp*sinStep;
688 for (
G4int j=0; j<6; ++j) pols[ksteps+1][j].set(r0[j]*cosEnd,r0[j]*sinEnd,z0[j]);
693 if (!benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,emin,emax))
continue;
694 if (emin < pMin) pMin = emin;
695 if (emax > pMax) pMax =
emax;
696 if (eminlim > pMin && emaxlim < pMax)
return true;
698 return (pMin < pMax);
static const G4double kInfinity
G4int GetNumRZCorner() const
G4double GetSinStartPhi() const
G4double GetEndPhi() const
static constexpr double twopi
void Extent(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4double GetCosStartPhi() const
G4double GetStartPhi() const
std::vector< G4ThreeVector > G4ThreeVectorList
G4double GetCosEndPhi() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static const G4double emax
G4double GetSinEndPhi() const
CLHEP::Hep2Vector G4TwoVector
static constexpr double deg
G4double GetMaxExtent(const EAxis pAxis) const
G4PolyconeSideRZ GetCorner(G4int index) const
G4double GetMinExtent(const EAxis pAxis) const