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)
61G4USphere::G4USphere( __void__& a )
70G4USphere::~G4USphere() =
default;
76G4USphere::G4USphere(
const G4USphere& rhs)
85G4USphere& G4USphere::operator = (
const G4USphere& rhs)
89 if (
this == &rhs) {
return *
this; }
93 Base_t::operator=(rhs);
102G4double G4USphere::GetInnerRadius()
const
104 return Base_t::GetInnerRadius();
106G4double G4USphere::GetOuterRadius()
const
108 return Base_t::GetOuterRadius();
110G4double G4USphere::GetStartPhiAngle()
const
112 return Base_t::GetStartPhiAngle();
114G4double G4USphere::GetDeltaPhiAngle()
const
116 return Base_t::GetDeltaPhiAngle();
118G4double G4USphere::GetStartThetaAngle()
const
120 return Base_t::GetStartThetaAngle();
122G4double G4USphere::GetDeltaThetaAngle()
const
124 return Base_t::GetDeltaThetaAngle();
126G4double G4USphere::GetSinStartPhi()
const
128 return Base_t::GetSinSPhi();
130G4double G4USphere::GetCosStartPhi()
const
132 return Base_t::GetCosSPhi();
134G4double G4USphere::GetSinEndPhi()
const
136 return Base_t::GetSinEPhi();
138G4double G4USphere::GetCosEndPhi()
const
140 return Base_t::GetCosEPhi();
142G4double G4USphere::GetSinStartTheta()
const
144 return Base_t::GetSinSTheta();
146G4double G4USphere::GetCosStartTheta()
const
148 return Base_t::GetCosSTheta();
150G4double G4USphere::GetSinEndTheta()
const
152 return Base_t::GetSinETheta();
154G4double G4USphere::GetCosEndTheta()
const
156 return Base_t::GetCosETheta();
159void G4USphere::SetInnerRadius(
G4double newRMin)
161 Base_t::SetInnerRadius(newRMin);
162 fRebuildPolyhedron =
true;
164void G4USphere::SetOuterRadius(
G4double newRmax)
166 Base_t::SetOuterRadius(newRmax);
167 fRebuildPolyhedron =
true;
171 Base_t::SetStartPhiAngle(newSphi, trig);
172 fRebuildPolyhedron =
true;
174void G4USphere::SetDeltaPhiAngle(
G4double newDphi)
176 Base_t::SetDeltaPhiAngle(newDphi);
177 fRebuildPolyhedron =
true;
179void G4USphere::SetStartThetaAngle(
G4double newSTheta)
181 Base_t::SetStartThetaAngle(newSTheta);
182 fRebuildPolyhedron =
true;
184void G4USphere::SetDeltaThetaAngle(
G4double newDTheta)
186 Base_t::SetDeltaThetaAngle(newDTheta);
187 fRebuildPolyhedron =
true;
208 return new G4USphere(*
this);
217 static G4bool checkBBox =
true;
224 if (GetDeltaThetaAngle() >= pi && GetDeltaPhiAngle() >= twopi)
226 pMin.
set(-rmax,-rmax,-rmax);
227 pMax.
set( rmax, rmax, rmax);
231 G4double sinStart = GetSinStartTheta();
232 G4double cosStart = GetCosStartTheta();
236 G4double stheta = GetStartThetaAngle();
237 G4double etheta = stheta + GetDeltaThetaAngle();
238 G4double rhomin = rmin*std::min(sinStart,sinEnd);
240 if (stheta > halfpi) rhomax = rmax*sinStart;
241 if (etheta < halfpi) rhomax = rmax*sinEnd;
245 GetSinStartPhi(),GetCosStartPhi(),
246 GetSinEndPhi(),GetCosEndPhi(),
249 G4double zmin = std::min(rmin*cosEnd,rmax*cosEnd);
250 G4double zmax = std::max(rmin*cosStart,rmax*cosStart);
251 pMin.
set(xymin.
x(),xymin.
y(),zmin);
252 pMax.
set(xymax.
x(),xymax.
y(),zmax);
257 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
259 std::ostringstream message;
260 message <<
"Bad bounding box (min >= max) for solid: "
262 <<
"\npMin = " << pMin
263 <<
"\npMax = " << pMax;
264 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
282 std::ostringstream message;
283 message <<
"Inconsistency in bounding boxes for solid: "
285 <<
"\nBBox min: wrapper = " << pMin <<
" solid = " << vmin
286 <<
"\nBBox max: wrapper = " << pMax <<
" solid = " << vmax;
287 G4Exception(
"G4USphere::BoundingLimits()",
"GeomMgt0001",
298G4bool G4USphere::CalculateExtent(
const EAxis pAxis,
306 BoundingLimits(bmin,bmax);
310 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
323 GetStartThetaAngle(),
324 GetDeltaThetaAngle());
const G4double kCarTolerance
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const