34 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
41 using namespace CLHEP;
48 G4USphere::G4USphere(
const G4String& pName,
52 : Base_t(pName, pRmin, pRmax, pSPhi, pDPhi, pSTheta, pDTheta)
61 G4USphere::G4USphere( __void__&
a )
70 G4USphere::~G4USphere()
78 G4USphere::G4USphere(
const G4USphere& rhs)
87 G4USphere& G4USphere::operator = (
const G4USphere& rhs)
91 if (
this == &rhs) {
return *
this; }
95 Base_t::operator=(rhs);
104 G4double G4USphere::GetInnerRadius()
const
106 return Base_t::GetInnerRadius();
108 G4double G4USphere::GetOuterRadius()
const
110 return Base_t::GetOuterRadius();
112 G4double G4USphere::GetStartPhiAngle()
const
114 return Base_t::GetStartPhiAngle();
116 G4double G4USphere::GetDeltaPhiAngle()
const
118 return Base_t::GetDeltaPhiAngle();
120 G4double G4USphere::GetStartThetaAngle()
const
122 return Base_t::GetStartThetaAngle();
124 G4double G4USphere::GetDeltaThetaAngle()
const
126 return Base_t::GetDeltaThetaAngle();
128 G4double G4USphere::GetSinStartPhi()
const
130 return Base_t::GetSinSPhi();
132 G4double G4USphere::GetCosStartPhi()
const
134 return Base_t::GetCosSPhi();
136 G4double G4USphere::GetSinEndPhi()
const
138 return Base_t::GetSinEPhi();
140 G4double G4USphere::GetCosEndPhi()
const
142 return Base_t::GetCosEPhi();
144 G4double G4USphere::GetSinStartTheta()
const
146 return Base_t::GetSinSTheta();
148 G4double G4USphere::GetCosStartTheta()
const
150 return Base_t::GetCosSTheta();
152 G4double G4USphere::GetSinEndTheta()
const
154 return Base_t::GetSinETheta();
156 G4double G4USphere::GetCosEndTheta()
const
158 return Base_t::GetCosETheta();
161 void G4USphere::SetInnerRadius(
G4double newRMin)
163 Base_t::SetInnerRadius(newRMin);
164 fRebuildPolyhedron =
true;
166 void G4USphere::SetOuterRadius(
G4double newRmax)
168 Base_t::SetOuterRadius(newRmax);
169 fRebuildPolyhedron =
true;
173 Base_t::SetStartPhiAngle(newSphi, trig);
174 fRebuildPolyhedron =
true;
176 void G4USphere::SetDeltaPhiAngle(
G4double newDphi)
178 Base_t::SetDeltaPhiAngle(newDphi);
179 fRebuildPolyhedron =
true;
181 void G4USphere::SetStartThetaAngle(
G4double newSTheta)
183 Base_t::SetStartThetaAngle(newSTheta);
184 fRebuildPolyhedron =
true;
186 void G4USphere::SetDeltaThetaAngle(
G4double newDTheta)
188 Base_t::SetDeltaThetaAngle(newDTheta);
189 fRebuildPolyhedron =
true;
210 return new G4USphere(*
this);
219 static G4bool checkBBox =
true;
226 if (GetDeltaThetaAngle() >=
pi && GetDeltaPhiAngle() >=
twopi)
228 pMin.
set(-rmax,-rmax,-rmax);
229 pMax.
set( rmax, rmax, rmax);
233 G4double sinStart = GetSinStartTheta();
234 G4double cosStart = GetCosStartTheta();
238 G4double stheta = GetStartThetaAngle();
239 G4double etheta = stheta + GetDeltaThetaAngle();
242 if (stheta >
halfpi) rhomax = rmax*sinStart;
243 if (etheta <
halfpi) rhomax = rmax*sinEnd;
247 GetSinStartPhi(),GetCosStartPhi(),
248 GetSinEndPhi(),GetCosEndPhi(),
253 pMin.
set(xymin.
x(),xymin.
y(),zmin);
254 pMax.
set(xymax.
x(),xymax.
y(),zmax);
259 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
262 message <<
"Bad bounding box (min >= max) for solid: "
264 <<
"\npMin = " << pMin
265 <<
"\npMax = " <<
pMax;
266 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
285 message <<
"Inconsistency in bounding boxes for solid: "
287 <<
"\nBBox min: wrapper = " << pMin <<
" solid = " << vmin
288 <<
"\nBBox max: wrapper = " << pMax <<
" solid = " << vmax;
289 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
300 G4bool G4USphere::CalculateExtent(
const EAxis pAxis,
308 BoundingLimits(bmin,bmax);
312 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
325 GetStartThetaAngle(),
326 GetDeltaThetaAngle());
329 #endif // G4GEOM_USE_USOLIDS