34#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
48G4USphere::G4USphere(
const G4String& pName,
52 : Base_t(pName, pRmin, pRmax, pSPhi, pDPhi, pSTheta, pDTheta)
60G4USphere::G4USphere(
const G4USphere& rhs)
69G4USphere& G4USphere::operator = (
const G4USphere& rhs)
73 if (
this == &rhs) {
return *
this; }
77 Base_t::operator=(rhs);
86G4double G4USphere::GetInnerRadius()
const
88 return Base_t::GetInnerRadius();
90G4double G4USphere::GetOuterRadius()
const
92 return Base_t::GetOuterRadius();
94G4double G4USphere::GetStartPhiAngle()
const
96 return Base_t::GetStartPhiAngle();
98G4double G4USphere::GetDeltaPhiAngle()
const
100 return Base_t::GetDeltaPhiAngle();
102G4double G4USphere::GetStartThetaAngle()
const
104 return Base_t::GetStartThetaAngle();
106G4double G4USphere::GetDeltaThetaAngle()
const
108 return Base_t::GetDeltaThetaAngle();
110G4double G4USphere::GetSinStartPhi()
const
112 return Base_t::GetSinSPhi();
114G4double G4USphere::GetCosStartPhi()
const
116 return Base_t::GetCosSPhi();
118G4double G4USphere::GetSinEndPhi()
const
120 return Base_t::GetSinEPhi();
122G4double G4USphere::GetCosEndPhi()
const
124 return Base_t::GetCosEPhi();
126G4double G4USphere::GetSinStartTheta()
const
128 return Base_t::GetSinSTheta();
130G4double G4USphere::GetCosStartTheta()
const
132 return Base_t::GetCosSTheta();
134G4double G4USphere::GetSinEndTheta()
const
136 return Base_t::GetSinETheta();
138G4double G4USphere::GetCosEndTheta()
const
140 return Base_t::GetCosETheta();
143void G4USphere::SetInnerRadius(
G4double newRMin)
145 Base_t::SetInnerRadius(newRMin);
146 fRebuildPolyhedron =
true;
148void G4USphere::SetOuterRadius(
G4double newRmax)
150 Base_t::SetOuterRadius(newRmax);
151 fRebuildPolyhedron =
true;
155 Base_t::SetStartPhiAngle(newSphi, trig);
156 fRebuildPolyhedron =
true;
158void G4USphere::SetDeltaPhiAngle(
G4double newDphi)
160 Base_t::SetDeltaPhiAngle(newDphi);
161 fRebuildPolyhedron =
true;
163void G4USphere::SetStartThetaAngle(
G4double newSTheta)
165 Base_t::SetStartThetaAngle(newSTheta);
166 fRebuildPolyhedron =
true;
168void G4USphere::SetDeltaThetaAngle(
G4double newDTheta)
170 Base_t::SetDeltaThetaAngle(newDTheta);
171 fRebuildPolyhedron =
true;
192 return new G4USphere(*
this);
201 static G4bool checkBBox =
true;
208 if (GetDeltaThetaAngle() >= pi && GetDeltaPhiAngle() >= twopi)
210 pMin.
set(-rmax,-rmax,-rmax);
211 pMax.
set( rmax, rmax, rmax);
215 G4double sinStart = GetSinStartTheta();
216 G4double cosStart = GetCosStartTheta();
220 G4double stheta = GetStartThetaAngle();
221 G4double etheta = stheta + GetDeltaThetaAngle();
222 G4double rhomin = rmin*std::min(sinStart,sinEnd);
224 if (stheta > halfpi) rhomax = rmax*sinStart;
225 if (etheta < halfpi) rhomax = rmax*sinEnd;
229 GetSinStartPhi(),GetCosStartPhi(),
230 GetSinEndPhi(),GetCosEndPhi(),
233 G4double zmin = std::min(rmin*cosEnd,rmax*cosEnd);
234 G4double zmax = std::max(rmin*cosStart,rmax*cosStart);
235 pMin.
set(xymin.
x(),xymin.
y(),zmin);
236 pMax.
set(xymax.
x(),xymax.
y(),zmax);
241 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
243 std::ostringstream message;
244 message <<
"Bad bounding box (min >= max) for solid: "
246 <<
"\npMin = " << pMin
247 <<
"\npMax = " << pMax;
248 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
266 std::ostringstream message;
267 message <<
"Inconsistency in bounding boxes for solid: "
269 <<
"\nBBox min: wrapper = " << pMin <<
" solid = " << vmin
270 <<
"\nBBox max: wrapper = " << pMax <<
" solid = " << vmax;
271 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
282G4bool G4USphere::CalculateExtent(
const EAxis pAxis,
290 BoundingLimits(bmin,bmax);
294 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
307 GetStartThetaAngle(),
308 GetDeltaThetaAngle());
const G4double kCarTolerance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
CLHEP::Hep2Vector G4TwoVector
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
G4BoundingEnvelope is a helper class to facilitate calculation of the extent of a solid within the li...
G4Sphere is, in the general case, a section of a spherical shell, between specified phi and theta ang...
G4VPVParameterisation ia an abstract base class for Parameterisation, able to compute the transformat...
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
G4VoxelLimits represents limitation/restrictions of space, where restrictions are only made perpendic...