34 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
47 G4UEllipticalCone::G4UEllipticalCone(
const G4String& pName,
52 : Base_t(pName, a, b, h, cut)
60 G4UEllipticalCone::G4UEllipticalCone( __void__&
a )
68 G4UEllipticalCone::~G4UEllipticalCone() { }
74 G4UEllipticalCone::G4UEllipticalCone(
const G4UEllipticalCone& rhs)
82 G4UEllipticalCone& G4UEllipticalCone::operator = (
const G4UEllipticalCone& rhs)
86 if (
this == &rhs) {
return *
this; }
90 Base_t::operator=(rhs);
99 G4double G4UEllipticalCone::GetSemiAxisX()
const
101 return Base_t::GetSemiAxisX();
104 G4double G4UEllipticalCone::GetSemiAxisY()
const
106 return Base_t::GetSemiAxisY();
109 G4double G4UEllipticalCone::GetZMax()
const
111 return Base_t::GetZMax();
114 G4double G4UEllipticalCone::GetZTopCut()
const
116 return Base_t::GetZTopCut();
119 G4double G4UEllipticalCone::GetSemiAxisMax ()
const
121 return std::max(GetSemiAxisX(),GetSemiAxisY());
124 G4double G4UEllipticalCone::GetSemiAxisMin ()
const
126 return std::min(GetSemiAxisX(),GetSemiAxisY());
135 Base_t::SetParameters(x, y, z, GetZTopCut());
138 void G4UEllipticalCone::SetZCut(
G4double newzTopCut)
140 Base_t::SetParameters(GetSemiAxisX(), GetSemiAxisY(), GetZMax(), newzTopCut);
147 G4VSolid* G4UEllipticalCone::Clone()
const
149 return new G4UEllipticalCone(*
this);
163 pMin.
set(-xmax,-ymax,-zcut);
164 pMax.
set( xmax, ymax, zcut);
168 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
171 message <<
"Bad bounding box (min >= max) for solid: "
173 <<
"\npMin = " << pMin
174 <<
"\npMax = " <<
pMax;
175 G4Exception(
"G4UEllipticalCone::BoundingLimits()",
"GeomMgt0001",
186 G4UEllipticalCone::CalculateExtent(
const EAxis pAxis,
196 BoundingLimits(bmin,bmax);
199 return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
201 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
203 return exist = (pMin <
pMax) ?
true :
false;
208 static const G4int NSTEPS = 48;
210 static const G4double sinHalf = std::sin(0.5*ang);
211 static const G4double cosHalf = std::cos(0.5*ang);
212 static const G4double sinStep = 2.*sinHalf*cosHalf;
213 static const G4double cosStep = 1. - 2.*sinHalf*sinHalf;
216 G4double sxmin = GetSemiAxisX()*(height-zcut)/cosHalf;
217 G4double symin = GetSemiAxisY()*(height-zcut)/cosHalf;
226 baseA[
k].set(sxmax*cosCur,symax*sinCur,-zcut);
227 baseB[
k].set(sxmin*cosCur,symin*sinCur, zcut);
230 sinCur = sinCur*cosStep + cosCur*sinStep;
231 cosCur = cosCur*cosStep - sinTmp*sinStep;
234 std::vector<const G4ThreeVectorList *> polygons(2);
235 polygons[0] = &baseA;
236 polygons[1] = &baseB;
238 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
246 G4Polyhedron* G4UEllipticalCone::CreatePolyhedron()
const
249 GetZMax(), GetZTopCut());
252 #endif // G4GEOM_USE_USOLIDS