34#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
52 : Base_t(pName, pRmax)
60G4UOrb::G4UOrb(
const G4UOrb& rhs)
69G4UOrb& G4UOrb::operator = (
const G4UOrb& rhs)
73 if (
this == &rhs) {
return *
this; }
77 Base_t::operator=(rhs);
88 return Base_t::GetRadius();
91void G4UOrb::SetRadius(
G4double newRmax)
93 Base_t::SetRadius(newRmax);
94 fRebuildPolyhedron =
true;
97G4double G4UOrb::GetRadialTolerance()
const
99 return Base_t::GetRadialTolerance();
120 return new G4UOrb(*
this);
130 pMin.
set(-radius,-radius,-radius);
131 pMax.
set( radius, radius, radius);
135 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
137 std::ostringstream message;
138 message <<
"Bad bounding box (min >= max) for solid: "
140 <<
"\npMin = " << pMin
141 <<
"\npMax = " << pMax;
142 G4Exception(
"G4UOrb::BoundingLimits()",
"GeomMgt0001",
153G4UOrb::CalculateExtent(
const EAxis pAxis,
162 BoundingLimits(bmin,bmax);
167 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
169 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
171 return exist = pMin < pMax;
176 static const G4int NTHETA = 8;
177 static const G4int NPHI = 16;
178 static const G4double sinHalfTheta = std::sin(halfpi/NTHETA);
179 static const G4double cosHalfTheta = std::cos(halfpi/NTHETA);
180 static const G4double sinHalfPhi = std::sin(pi/NPHI);
181 static const G4double cosHalfPhi = std::cos(pi/NPHI);
182 static const G4double sinStepTheta = 2.*sinHalfTheta*cosHalfTheta;
183 static const G4double cosStepTheta = 1. - 2.*sinHalfTheta*sinHalfTheta;
184 static const G4double sinStepPhi = 2.*sinHalfPhi*cosHalfPhi;
185 static const G4double cosStepPhi = 1. - 2.*sinHalfPhi*sinHalfPhi;
188 G4double rtheta = radius/cosHalfTheta;
197 k.set(cosCurPhi,sinCurPhi);
199 sinCurPhi = sinCurPhi*cosStepPhi + cosCurPhi*sinStepPhi;
200 cosCurPhi = cosCurPhi*cosStepPhi - sinTmpPhi*sinStepPhi;
205 for (
auto & circle : circles) circle.resize(NPHI);
207 G4double sinCurTheta = sinHalfTheta;
208 G4double cosCurTheta = cosHalfTheta;
209 for (
auto & circle : circles)
213 for (
G4int k=0; k<NPHI; ++k)
215 circle[k].set(rho*xy[k].x(),rho*xy[k].y(),z);
218 sinCurTheta = sinCurTheta*cosStepTheta + cosCurTheta*sinStepTheta;
219 cosCurTheta = cosCurTheta*cosStepTheta - sinTmpTheta*sinStepTheta;
223 std::vector<const G4ThreeVectorList *> polygons;
224 polygons.resize(NTHETA);
225 for (
G4int i=0; i<NTHETA; ++i) polygons[i] = &circles[i];
228 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)
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...
G4Orb represents a full sphere.
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...