34#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
52 : Base_t(pName, pRmax)
61G4UOrb::G4UOrb( __void__& a )
70G4UOrb::~G4UOrb() =
default;
76G4UOrb::G4UOrb(
const G4UOrb& rhs)
85G4UOrb& G4UOrb::operator = (
const G4UOrb& rhs)
89 if (
this == &rhs) {
return *
this; }
93 Base_t::operator=(rhs);
104 return Base_t::GetRadius();
107void G4UOrb::SetRadius(
G4double newRmax)
109 Base_t::SetRadius(newRmax);
110 fRebuildPolyhedron =
true;
113G4double G4UOrb::GetRadialTolerance()
const
115 return Base_t::GetRadialTolerance();
136 return new G4UOrb(*
this);
146 pMin.
set(-radius,-radius,-radius);
147 pMax.
set( radius, radius, radius);
151 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
153 std::ostringstream message;
154 message <<
"Bad bounding box (min >= max) for solid: "
156 <<
"\npMin = " << pMin
157 <<
"\npMax = " << pMax;
158 G4Exception(
"G4UOrb::BoundingLimits()",
"GeomMgt0001",
169G4UOrb::CalculateExtent(
const EAxis pAxis,
178 BoundingLimits(bmin,bmax);
183 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
185 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
187 return exist = pMin < pMax;
192 static const G4int NTHETA = 8;
193 static const G4int NPHI = 16;
194 static const G4double sinHalfTheta = std::sin(halfpi/NTHETA);
195 static const G4double cosHalfTheta = std::cos(halfpi/NTHETA);
196 static const G4double sinHalfPhi = std::sin(pi/NPHI);
197 static const G4double cosHalfPhi = std::cos(pi/NPHI);
198 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
199 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
200 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
201 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
204 G4double rtheta = radius/cosHalfTheta;
213 k.set(cosCurPhi,sinCurPhi);
215 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
216 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
221 for (
auto & circle : circles) circle.resize(NPHI);
223 G4double sinCurTheta = sinHalfTheta;
224 G4double cosCurTheta = cosHalfTheta;
225 for (
auto & circle : circles)
229 for (
G4int k=0; k<NPHI; ++k)
231 circle[k].set(rho*xy[k].x(),rho*xy[k].y(),z);
234 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
235 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
239 std::vector<const G4ThreeVectorList *> polygons;
240 polygons.resize(NTHETA);
241 for (
G4int i=0; i<NTHETA; ++i) polygons[i] = &circles[i];
244 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
std::vector< G4ThreeVector > G4ThreeVectorList
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