34#if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
47G4UEllipticalTube::G4UEllipticalTube(
const G4String& pName,
51 : Base_t(pName, dx, dy, dz)
59G4UEllipticalTube::G4UEllipticalTube( __void__& a )
67G4UEllipticalTube::~G4UEllipticalTube() { }
73G4UEllipticalTube::G4UEllipticalTube(
const G4UEllipticalTube& rhs)
81G4UEllipticalTube& G4UEllipticalTube::operator = (
const G4UEllipticalTube& rhs)
85 if (
this == &rhs) {
return *
this; }
89 Base_t::operator=(rhs);
98G4double G4UEllipticalTube::GetDx()
const
100 return Base_t::GetDx();
103G4double G4UEllipticalTube::GetDy()
const
105 return Base_t::GetDy();
108G4double G4UEllipticalTube::GetDz()
const
110 return Base_t::GetDz();
117void G4UEllipticalTube::SetDx(
G4double dx)
122void G4UEllipticalTube::SetDy(
G4double dy)
127void G4UEllipticalTube::SetDz(
G4double dz)
136G4VSolid* G4UEllipticalTube::Clone()
const
138 return new G4UEllipticalTube(*
this);
152 pMin.
set(-dx,-dy,-dz);
153 pMax.
set( dx, dy, dz);
161G4UEllipticalTube::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;
200 for (
G4int k=0; k<NSTEPS; ++k)
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);
222G4Polyhedron* G4UEllipticalTube::CreatePolyhedron()
const
std::vector< G4ThreeVector > G4ThreeVectorList
void set(double x, double y, double z)
HepPolyhedron & Transform(const G4Transform3D &t)