34#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
52 : Base_t(pName, pRmax)
61G4UOrb::G4UOrb( __void__& a )
78G4UOrb::G4UOrb(
const G4UOrb& rhs)
87G4UOrb& G4UOrb::operator = (
const G4UOrb& rhs)
91 if (
this == &rhs) {
return *
this; }
95 Base_t::operator=(rhs);
106 return Base_t::GetRadius();
109void G4UOrb::SetRadius(
G4double newRmax)
111 Base_t::SetRadius(newRmax);
112 fRebuildPolyhedron =
true;
115G4double 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())
155 std::ostringstream message;
156 message <<
"Bad bounding box (min >= max) for solid: "
158 <<
"\npMin = " << pMin
159 <<
"\npMax = " << pMax;
160 G4Exception(
"G4UOrb::BoundingLimits()",
"GeomMgt0001",
171G4UOrb::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;
196 static const G4double sinHalfTheta = std::sin(halfpi/NTHETA);
197 static const G4double cosHalfTheta = std::cos(halfpi/NTHETA);
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;
213 for (
G4int k=0; k<NPHI; ++k)
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)
231 for (
G4int k=0; k<NPHI; ++k)
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);
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)
void set(double x, double y, double z)
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const