35 #if !defined(G4GEOM_USE_UBOX)
64 message <<
"Dimensions too small for Solid: " <<
GetName() <<
"!" <<
G4endl
65 <<
" hX, hY, hZ = " << pX <<
", " << pY <<
", " << pZ;
105 if (
this == &rhs) {
return *
this; }
134 message <<
"Dimension X too small for solid: " <<
GetName() <<
"!"
137 G4Exception(
"G4Box::SetXHalfLength()",
"GeomSolids0002",
158 message <<
"Dimension Y too small for solid: " <<
GetName() <<
"!\n"
160 G4Exception(
"G4Box::SetYHalfLength()",
"GeomSolids0002",
181 message <<
"Dimension Z too small for solid: " <<
GetName() <<
"!\n"
183 G4Exception(
"G4Box::SetZHalfLength()",
"GeomSolids0002",
214 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
217 message <<
"Bad bounding box (min >= max) for solid: "
219 <<
"\npMin = " << pMin
220 <<
"\npMax = " <<
pMax;
284 G4int oldprc = message.precision(16);
285 message <<
"Point p is not on surface (!?) of solid: "
287 message <<
"Position:\n";
288 message <<
" p.x() = " << p.
x()/
mm <<
" mm\n";
289 message <<
" p.y() = " << p.
y()/
mm <<
" mm\n";
290 message <<
" p.z() = " << p.
z()/
mm <<
" mm";
292 G4Exception(
"G4Box::SurfaceNormal(p)",
"GeomSolids1002",
311 if (distx >= disty && distx >= distz)
313 if (disty >= distx && disty >= distz)
352 return (tmin <
delta) ? 0. : tmin;
367 return (dist > 0) ? dist : 0.;
388 n->
set((p.
x() < 0) ? -1. : 1., 0., 0.);
397 n->
set(0., (p.
y() < 0) ? -1. : 1., 0.);
406 n->
set(0., 0., (p.
z() < 0) ? -1. : 1.);
417 G4double ty = (vy == 0) ? tx : (std::copysign(
fDy,vy) - p.
y())/vy;
421 G4double tz = (vz == 0) ? txy : (std::copysign(
fDz,vz) - p.
z())/vz;
429 if (tmax == tx) n->
set((v.
x() < 0) ? -1. : 1., 0., 0.);
430 else if (tmax == ty) n->
set(0., (v.
y() < 0) ? -1. : 1., 0.);
431 else n->
set(0., 0., (v.
z() < 0) ? -1. : 1.);
447 G4int oldprc = message.precision(16);
448 message <<
"Point p is outside (!?) of solid: " <<
GetName() <<
G4endl;
449 message <<
"Position:\n";
450 message <<
" p.x() = " << p.
x()/
mm <<
" mm\n";
451 message <<
" p.y() = " << p.
y()/
mm <<
" mm\n";
452 message <<
" p.z() = " << p.
z()/
mm <<
" mm";
454 G4Exception(
"G4Box::DistanceToOut(p)",
"GeomSolids1002",
462 return (dist > 0) ? dist : 0.;
480 G4int oldprc = os.precision(16);
481 os <<
"-----------------------------------------------------------\n"
482 <<
" *** Dump for solid - " <<
GetName() <<
" ***\n"
483 <<
" ===================================================\n"
484 <<
"Solid type: G4Box\n"
486 <<
" half length X: " <<
fDx/
mm <<
" mm \n"
487 <<
" half length Y: " <<
fDy/
mm <<
" mm \n"
488 <<
" half length Z: " <<
fDz/
mm <<
" mm \n"
489 <<
"-----------------------------------------------------------\n";
490 os.precision(oldprc);
509 (select < 0.5*sxy) ? -fDz : fDz);
511 if (select < sxy + sxz)
513 (select < sxy + 0.5*sxz) ? -fDy : fDy,
527 return new G4Box(*
this);