34 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
40 using namespace CLHEP;
46 G4UTrd::G4UTrd(
const G4String& pName,
50 : Base_t(pName, pdx1, pdx2, pdy1, pdy2, pdz)
59 G4UTrd::G4UTrd( __void__&
a )
76 G4UTrd::G4UTrd(
const G4UTrd& rhs)
85 G4UTrd& G4UTrd::operator = (
const G4UTrd& rhs)
89 if (
this == &rhs) {
return *
this; }
93 Base_t::operator=(rhs);
102 G4double G4UTrd::GetXHalfLength1()
const
106 G4double G4UTrd::GetXHalfLength2()
const
110 G4double G4UTrd::GetYHalfLength1()
const
114 G4double G4UTrd::GetYHalfLength2()
const
118 G4double G4UTrd::GetZHalfLength()
const
123 void G4UTrd::SetXHalfLength1(
G4double val)
125 Base_t::SetXHalfLength1(val);
126 fRebuildPolyhedron =
true;
128 void G4UTrd::SetXHalfLength2(
G4double val)
130 Base_t::SetXHalfLength2(val);
131 fRebuildPolyhedron =
true;
133 void G4UTrd::SetYHalfLength1(
G4double val)
135 Base_t::SetYHalfLength1(val);
136 fRebuildPolyhedron =
true;
138 void G4UTrd::SetYHalfLength2(
G4double val)
140 Base_t::SetYHalfLength2(val);
141 fRebuildPolyhedron =
true;
143 void G4UTrd::SetZHalfLength(
G4double val)
145 Base_t::SetZHalfLength(val);
146 fRebuildPolyhedron =
true;
151 Base_t::SetAllParameters(pdx1, pdx2, pdy1, pdy2, pdz);
152 fRebuildPolyhedron =
true;
173 return new G4UTrd(*
this);
182 static G4bool checkBBox =
true;
192 pMin.
set(-xmax,-ymax,-dz);
193 pMax.
set( xmax, ymax, dz);
197 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
200 message <<
"Bad bounding box (min >= max) for solid: "
202 <<
"\npMin = " << pMin
203 <<
"\npMax = " <<
pMax;
204 G4Exception(
"G4UTrd::BoundingLimits()",
"GeomMgt0001",
223 message <<
"Inconsistency in bounding boxes for solid: "
225 <<
"\nBBox min: wrapper = " << pMin <<
" solid = " << vmin
226 <<
"\nBBox max: wrapper = " << pMax <<
" solid = " << vmax;
227 G4Exception(
"G4UTrd::BoundingLimits()",
"GeomMgt0001",
239 G4UTrd::CalculateExtent(
const EAxis pAxis,
249 BoundingLimits(bmin,bmax);
252 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
254 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
256 return exist = (pMin <
pMax) ?
true :
false;
268 baseA[0].set(-dx1,-dy1,-dz);
269 baseA[1].set( dx1,-dy1,-dz);
270 baseA[2].set( dx1, dy1,-dz);
271 baseA[3].set(-dx1, dy1,-dz);
272 baseB[0].set(-dx2,-dy2, dz);
273 baseB[1].set( dx2,-dy2, dz);
274 baseB[2].set( dx2, dy2, dz);
275 baseB[3].set(-dx2, dy2, dz);
277 std::vector<const G4ThreeVectorList *> polygons(2);
278 polygons[0] = &baseA;
279 polygons[1] = &baseB;
282 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
299 #endif // G4GEOM_USE_USOLIDS