35 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
45 using namespace CLHEP;
53 : Base_t(pName, pRmax)
62 G4UOrb::G4UOrb( __void__&
a )
79 G4UOrb::G4UOrb(
const G4UOrb& rhs)
88 G4UOrb& G4UOrb::operator = (
const G4UOrb& rhs)
92 if (
this == &rhs) {
return *
this; }
96 Base_t::operator=(rhs);
107 return Base_t::GetRadius();
110 void G4UOrb::SetRadius(
G4double newRmax)
112 Base_t::SetRadius(newRmax);
113 fRebuildPolyhedron =
true;
116 G4double G4UOrb::GetRadialTolerance()
const
118 return Base_t::GetRadialTolerance();
139 return new G4UOrb(*
this);
149 pMin.
set(-radius,-radius,-radius);
150 pMax.
set( radius, radius, radius);
154 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
157 message <<
"Bad bounding box (min >= max) for solid: "
159 <<
"\npMin = " << pMin
160 <<
"\npMax = " << pMax;
161 G4Exception(
"G4UOrb::BoundingLimits()",
"GeomMgt0001",
172 G4UOrb::CalculateExtent(
const EAxis pAxis,
181 BoundingLimits(bmin,bmax);
186 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
188 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
190 return exist = (pMin < pMax) ?
true :
false;
195 static const G4int NTHETA = 8;
196 static const G4int NPHI = 16;
199 static const G4double sinHalfPhi = std::sin(
pi/NPHI);
200 static const G4double cosHalfPhi = std::cos(
pi/NPHI);
201 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
202 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
203 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
204 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
207 G4double rtheta = radius/cosHalfTheta;
214 for (
G4int k=0; k<NPHI; ++k)
216 xy[k].
set(cosCurPhi,sinCurPhi);
218 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
219 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
224 for (
G4int i=0; i<NTHETA; ++i) circles[i].resize(NPHI);
226 G4double sinCurTheta = sinHalfTheta;
227 G4double cosCurTheta = cosHalfTheta;
228 for (
G4int i=0; i<NTHETA; ++i)
232 for (
G4int k=0; k<NPHI; ++k)
234 circles[i][k].set(rho*xy[k].
x(),rho*xy[k].
y(),z);
237 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
238 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
242 std::vector<const G4ThreeVectorList *> polygons;
243 polygons.resize(NTHETA);
244 for (
G4int i=0; i<NTHETA; ++i) polygons[i] = &circles[i];
247 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
260 #endif // G4GEOM_USE_USOLIDS
void set(double x, double y, double z)
std::vector< ExP01TrackerHit * > a
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
void message(RunManager *runmanager)
std::vector< G4ThreeVector > G4ThreeVectorList
static constexpr double twopi
static constexpr double halfpi
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void set(double x, double y)
G4GLOB_DLL std::ostream G4cout
static constexpr double pi