34 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
47 G4UEllipticalTube::G4UEllipticalTube(
const G4String& pName,
51 : Base_t(pName, dx, dy, dz)
59 G4UEllipticalTube::G4UEllipticalTube( __void__&
a )
67 G4UEllipticalTube::~G4UEllipticalTube() { }
73 G4UEllipticalTube::G4UEllipticalTube(
const G4UEllipticalTube& rhs)
81 G4UEllipticalTube& G4UEllipticalTube::operator = (
const G4UEllipticalTube& rhs)
85 if (
this == &rhs) {
return *
this; }
89 Base_t::operator=(rhs);
98 G4double G4UEllipticalTube::GetDx()
const
100 return Base_t::GetDx();
103 G4double G4UEllipticalTube::GetDy()
const
105 return Base_t::GetDy();
108 G4double G4UEllipticalTube::GetDz()
const
110 return Base_t::GetDz();
136 G4VSolid* G4UEllipticalTube::Clone()
const
138 return new G4UEllipticalTube(*
this);
152 pMin.
set(-dx,-dy,-dz);
153 pMax.
set( dx, dy, dz);
161 G4UEllipticalTube::CalculateExtent(
const EAxis pAxis,
171 BoundingLimits(bmin,bmax);
174 return bbox.CalculateExtent(pAxis,pVoxelLimit, pTransform, pMin, pMax);
176 if (bbox.BoundingBoxVsVoxelLimits(pAxis, pVoxelLimit, pTransform, pMin, pMax))
178 return exist = (pMin <
pMax) ?
true :
false;
187 const G4int NSTEPS = 24;
190 G4double sinHalf = std::sin(0.5*ang);
191 G4double cosHalf = std::cos(0.5*ang);
192 G4double sinStep = 2.*sinHalf*cosHalf;
193 G4double cosStep = 1. - 2.*sinHalf*sinHalf;
202 baseA[
k].set(sx*cosCur,sy*sinCur,-dz);
203 baseB[
k].set(sx*cosCur,sy*sinCur, dz);
206 sinCur = sinCur*cosStep + cosCur*sinStep;
207 cosCur = cosCur*cosStep - sinTmp*sinStep;
210 std::vector<const G4ThreeVectorList *> polygons(2);
211 polygons[0] = &baseA;
212 polygons[1] = &baseB;
214 exist = benv.CalculateExtent(pAxis, pVoxelLimit, pTransform, pMin, pMax);
222 G4Polyhedron* G4UEllipticalTube::CreatePolyhedron()
const
234 #endif // G4GEOM_USE_USOLIDS