36 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
42 using namespace CLHEP;
48 G4UTrd::G4UTrd(
const G4String& pName,
52 : Base_t(pName, pdx1, pdx2, pdy1, pdy2, pdz)
61 G4UTrd::G4UTrd( __void__&
a )
78 G4UTrd::G4UTrd(
const G4UTrd& rhs)
87 G4UTrd& G4UTrd::operator = (
const G4UTrd& rhs)
91 if (
this == &rhs) {
return *
this; }
95 Base_t::operator=(rhs);
104 G4double G4UTrd::GetXHalfLength1()
const
108 G4double G4UTrd::GetXHalfLength2()
const
112 G4double G4UTrd::GetYHalfLength1()
const
116 G4double G4UTrd::GetYHalfLength2()
const
120 G4double G4UTrd::GetZHalfLength()
const
125 void G4UTrd::SetXHalfLength1(
G4double val)
127 Base_t::SetXHalfLength1(val);
128 fRebuildPolyhedron =
true;
130 void G4UTrd::SetXHalfLength2(
G4double val)
132 Base_t::SetXHalfLength2(val);
133 fRebuildPolyhedron =
true;
135 void G4UTrd::SetYHalfLength1(
G4double val)
137 Base_t::SetYHalfLength1(val);
138 fRebuildPolyhedron =
true;
140 void G4UTrd::SetYHalfLength2(
G4double val)
142 Base_t::SetYHalfLength2(val);
143 fRebuildPolyhedron =
true;
145 void G4UTrd::SetZHalfLength(
G4double val)
147 Base_t::SetZHalfLength(val);
148 fRebuildPolyhedron =
true;
153 Base_t::SetAllParameters(pdx1, pdx2, pdy1, pdy2, pdz);
154 fRebuildPolyhedron =
true;
175 return new G4UTrd(*
this);
184 static G4bool checkBBox =
true;
194 pMin.
set(-xmax,-ymax,-dz);
195 pMax.
set( xmax, ymax, dz);
199 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
202 message <<
"Bad bounding box (min >= max) for solid: "
204 <<
"\npMin = " << pMin
205 <<
"\npMax = " << pMax;
206 G4Exception(
"G4UTrd::BoundingLimits()",
"GeomMgt0001",
225 message <<
"Inconsistency in bounding boxes for solid: "
227 <<
"\nBBox min: wrapper = " << pMin <<
" solid = " << vmin
228 <<
"\nBBox max: wrapper = " << pMax <<
" solid = " << vmax;
229 G4Exception(
"G4UTrd::BoundingLimits()",
"GeomMgt0001",
241 G4UTrd::CalculateExtent(
const EAxis pAxis,
251 BoundingLimits(bmin,bmax);
254 if (
true)
return bbox.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
256 if (bbox.BoundingBoxVsVoxelLimits(pAxis,pVoxelLimit,pTransform,pMin,pMax))
258 return exist = (pMin < pMax) ?
true :
false;
270 baseA[0].set(-dx1,-dy1,-dz);
271 baseA[1].set( dx1,-dy1,-dz);
272 baseA[2].set( dx1, dy1,-dz);
273 baseA[3].set(-dx1, dy1,-dz);
274 baseB[0].set(-dx2,-dy2, dz);
275 baseB[1].set( dx2,-dy2, dz);
276 baseB[2].set( dx2, dy2, dz);
277 baseB[3].set(-dx2, dy2, dz);
279 std::vector<const G4ThreeVectorList *> polygons(2);
280 polygons[0] = &baseA;
281 polygons[1] = &baseB;
284 exist = benv.CalculateExtent(pAxis,pVoxelLimit,pTransform,pMin,pMax);
301 #endif // G4GEOM_USE_USOLIDS
void set(double x, double y, double z)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
std::vector< ExP01TrackerHit * > a
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const
void message(RunManager *runmanager)
const G4double kCarTolerance
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout