34 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
44 using namespace CLHEP;
52 : Base_t(pName, pRmax)
61 G4UOrb::G4UOrb( __void__&
a )
78 G4UOrb::G4UOrb(
const G4UOrb& rhs)
87 G4UOrb& G4UOrb::operator = (
const G4UOrb& rhs)
91 if (
this == &rhs) {
return *
this; }
95 Base_t::operator=(rhs);
106 return Base_t::GetRadius();
109 void G4UOrb::SetRadius(
G4double newRmax)
111 Base_t::SetRadius(newRmax);
112 fRebuildPolyhedron =
true;
115 G4double G4UOrb::GetRadialTolerance()
const
117 return Base_t::GetRadialTolerance();
138 return new G4UOrb(*
this);
148 pMin.
set(-radius,-radius,-radius);
149 pMax.
set( radius, radius, radius);
153 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
156 message <<
"Bad bounding box (min >= max) for solid: "
158 <<
"\npMin = " << pMin
159 <<
"\npMax = " <<
pMax;
160 G4Exception(
"G4UOrb::BoundingLimits()",
"GeomMgt0001",
171 G4UOrb::CalculateExtent(
const EAxis pAxis,
180 BoundingLimits(bmin,bmax);
185 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
187 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
189 return exist = (pMin <
pMax) ?
true :
false;
194 static const G4int NTHETA = 8;
195 static const G4int NPHI = 16;
198 static const G4double sinHalfPhi = std::sin(
pi/NPHI);
199 static const G4double cosHalfPhi = std::cos(
pi/NPHI);
200 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
201 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
202 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
203 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
206 G4double rtheta = radius/cosHalfTheta;
215 xy[
k].
set(cosCurPhi,sinCurPhi);
217 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
218 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
223 for (
G4int i=0; i<NTHETA; ++i) circles[i].resize(NPHI);
225 G4double sinCurTheta = sinHalfTheta;
226 G4double cosCurTheta = cosHalfTheta;
227 for (
G4int i=0; i<NTHETA; ++i)
233 circles[i][
k].set(rho*xy[
k].
x(),rho*xy[
k].
y(),z);
236 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
237 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
241 std::vector<const G4ThreeVectorList *> polygons;
242 polygons.resize(NTHETA);
243 for (
G4int i=0; i<NTHETA; ++i) polygons[i] = &circles[i];
246 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
259 #endif // G4GEOM_USE_USOLIDS