36 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
44 G4UTrap::G4UTrap(
const G4String& pName,
51 : G4USolid(pName, new UTrap(pName, pdz, pTheta, pPhi,
52 pdy1, pdx1, pdx2, pAlp1, pdy2, pdx3, pdx4, pAlp2))
56 G4UTrap::G4UTrap(
const G4String& pName,
58 : G4USolid(pName, new UTrap(pName))
63 G4UTrap::G4UTrap(
const G4String& pName,
67 : G4USolid(pName, new UTrap(pName, pZ, pY, pX, pLTX))
71 G4UTrap::G4UTrap(
const G4String& pName,
75 : G4USolid(pName, new UTrap(pName, pdx1, pdx2, pdy1, pdy2, pdz))
79 G4UTrap::G4UTrap(
const G4String& pName,
82 : G4USolid(pName, new UTrap(pName, pdx, pdy, pdz, pAlpha, pTheta, pPhi))
86 G4UTrap::G4UTrap(
const G4String& pName )
87 : G4USolid(pName, new UTrap(pName))
96 G4UTrap::G4UTrap( __void__&
a )
113 G4UTrap::G4UTrap(
const G4UTrap& rhs)
122 G4UTrap& G4UTrap::operator = (
const G4UTrap& rhs)
126 if (
this == &rhs) {
return *
this; }
130 G4USolid::operator=(rhs);
139 G4double G4UTrap::GetZHalfLength()
const
141 return GetShape()->GetZHalfLength();
143 G4double G4UTrap::GetYHalfLength1()
const
145 return GetShape()->GetYHalfLength1();
147 G4double G4UTrap::GetXHalfLength1()
const
149 return GetShape()->GetXHalfLength1();
151 G4double G4UTrap::GetXHalfLength2()
const
153 return GetShape()->GetXHalfLength2();
155 G4double G4UTrap::GetTanAlpha1()
const
157 return GetShape()->GetTanAlpha1();
159 G4double G4UTrap::GetYHalfLength2()
const
161 return GetShape()->GetYHalfLength2();
163 G4double G4UTrap::GetXHalfLength3()
const
165 return GetShape()->GetXHalfLength3();
167 G4double G4UTrap::GetXHalfLength4()
const
169 return GetShape()->GetXHalfLength4();
171 G4double G4UTrap::GetTanAlpha2()
const
173 return GetShape()->GetTanAlpha2();
177 UTrapSidePlane iplane = GetShape()->GetSidePlane(n);
183 UVector3 axis = GetShape()->GetSymAxis();
193 GetShape()->SetAllParameters(pDz, pTheta, pPhi,
194 pDy1, pDx1, pDx2, pAlp1,
195 pDy2, pDx3, pDx4, pAlp2);
196 fRebuildPolyhedron =
true;
202 for (
unsigned int i=0; i<8; ++i)
204 upt[i] = UVector3(pt[i].
x(), pt[i].y(), pt[i].
z());
206 GetShape()->SetPlanes(upt);
207 fRebuildPolyhedron =
true;
228 return new G4UTrap(*
this);
237 G4double fTthetaSphi = GetShape()->GetThetaSphi();
238 G4double fTthetaCphi = GetShape()->GetThetaCphi();
239 G4double phi = std::atan2(fTthetaSphi, fTthetaCphi);
240 G4double alpha1 = std::atan(GetTanAlpha1());
241 G4double alpha2 = std::atan(GetTanAlpha2());
242 G4double theta = std::atan(std::sqrt(fTthetaCphi*fTthetaCphi+fTthetaSphi*fTthetaSphi));
246 GetXHalfLength1(), GetXHalfLength2(), alpha1,
248 GetXHalfLength3(), GetXHalfLength4(), alpha2);
251 #endif // G4GEOM_USE_USOLIDS
CLHEP::Hep3Vector G4ThreeVector
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
const G4double x[NPOINTSGL]