37#if !defined(G4GEOM_USE_UTRAP)
70 fTthetaCphi = std::tan(pTheta)*std::cos(pPhi);
71 fTthetaSphi = std::tan(pTheta)*std::sin(pPhi);
73 fDy1 = pDy1; fDx1 = pDx1; fDx2 = pDx2; fTalpha1 = std::tan(pAlp1);
74 fDy2 = pDy2; fDx3 = pDx3; fDx4 = pDx4; fTalpha2 = std::tan(pAlp2);
94 && pt[0].z() == pt[1].z()
95 && pt[0].z() == pt[2].z()
96 && pt[0].z() == pt[3].z()
99 && pt[4].z() == pt[5].z()
100 && pt[4].z() == pt[6].z()
101 && pt[4].z() == pt[7].z()
105 && pt[0].y() == pt[1].y()
106 && pt[2].y() == pt[3].y()
107 && pt[4].y() == pt[5].y()
108 && pt[6].y() == pt[7].y()
110 && std::fabs(pt[0].y()+pt[2].y()+pt[4].y()+pt[6].y()) <
kCarTolerance
111 && std::fabs(pt[0].x()+pt[1].x()+pt[4].x()+pt[5].x() +
114 std::ostringstream message;
115 message <<
"Invalid vertice coordinates for Solid: " <<
GetName();
124 fDy1 = ((pt[2]).y()-(pt[1]).y())*0.5;
125 fDx1 = ((pt[1]).x()-(pt[0]).x())*0.5;
126 fDx2 = ((pt[3]).x()-(pt[2]).x())*0.5;
127 fTalpha1 = ((pt[2]).x()+(pt[3]).x()-(pt[1]).x()-(pt[0]).x())*0.25/fDy1;
129 fDy2 = ((pt[6]).y()-(pt[5]).y())*0.5;
130 fDx3 = ((pt[5]).x()-(pt[4]).x())*0.5;
131 fDx4 = ((pt[7]).x()-(pt[6]).x())*0.5;
132 fTalpha2 = ((pt[6]).x()+(pt[7]).x()-(pt[5]).x()-(pt[4]).x())*0.25/fDy2;
134 fTthetaCphi = ((pt[4]).x()+fDy2*fTalpha2+fDx3)/fDz;
135 fTthetaSphi = ((pt[4]).y()+fDy2)/fDz;
151 fDz = 0.5*pZ; fTthetaCphi = 0; fTthetaSphi = 0;
152 fDy1 = 0.5*pY; fDx1 = 0.5*pX; fDx2 = 0.5*pLTX; fTalpha1 = 0.5*(pLTX - pX)/pY;
153 fDy2 = fDy1; fDx3 = fDx1; fDx4 = fDx2; fTalpha2 = fTalpha1;
169 fDz = pDz; fTthetaCphi = 0; fTthetaSphi = 0;
170 fDy1 = pDy1; fDx1 = pDx1; fDx2 = pDx1; fTalpha1 = 0;
171 fDy2 = pDy2; fDx3 = pDx2; fDx4 = pDx2; fTalpha2 = 0;
189 fTthetaCphi = std::tan(pTheta)*std::cos(pPhi);
190 fTthetaSphi = std::tan(pTheta)*std::sin(pPhi);
192 fDy1 = pDy; fDx1 = pDx; fDx2 = pDx; fTalpha1 = std::tan(pAlpha);
193 fDy2 = pDy; fDx3 = pDx; fDx4 = pDx; fTalpha2 = fTalpha1;
207 fDz(1.), fTthetaCphi(0.), fTthetaSphi(0.),
208 fDy1(1.), fDx1(1.), fDx2(1.), fTalpha1(0.),
209 fDy2(1.), fDx3(1.), fDx4(1.), fTalpha2(0.)
221 fDz(1.), fTthetaCphi(0.), fTthetaSphi(0.),
222 fDy1(1.), fDx1(1.), fDx2(1.), fTalpha1(0.),
223 fDy2(1.), fDx3(1.), fDx4(1.), fTalpha2(0.)
241 :
G4CSGSolid(rhs), halfCarTolerance(rhs.halfCarTolerance),
242 fDz(rhs.fDz), fTthetaCphi(rhs.fTthetaCphi), fTthetaSphi(rhs.fTthetaSphi),
243 fDy1(rhs.fDy1), fDx1(rhs.fDx1), fDx2(rhs.fDx2), fTalpha1(rhs.fTalpha1),
244 fDy2(rhs.fDy2), fDx3(rhs.fDx3), fDx4(rhs.fDx4), fTalpha2(rhs.fTalpha2)
246 for (
G4int i=0; i<4; ++i) { fPlanes[i] = rhs.fPlanes[i]; }
247 for (
G4int i=0; i<6; ++i) { fAreas[i] = rhs.fAreas[i]; }
248 fTrapType = rhs.fTrapType;
259 if (
this == &rhs) {
return *
this; }
267 halfCarTolerance = rhs.halfCarTolerance;
268 fDz = rhs.fDz; fTthetaCphi = rhs.fTthetaCphi; fTthetaSphi = rhs.fTthetaSphi;
269 fDy1 = rhs.fDy1; fDx1 = rhs.fDx1; fDx2 = rhs.fDx2; fTalpha1 = rhs.fTalpha1;
270 fDy2 = rhs.fDy2; fDx3 = rhs.fDx3; fDx4 = rhs.fDx4; fTalpha2 = rhs.fTalpha2;
271 for (
G4int i=0; i<4; ++i) { fPlanes[i] = rhs.fPlanes[i]; }
272 for (
G4int i=0; i<6; ++i) { fAreas[i] = rhs.fAreas[i]; }
273 fTrapType = rhs.fTrapType;
301 fTthetaCphi = std::tan(pTheta)*std::cos(pPhi);
302 fTthetaSphi = std::tan(pTheta)*std::sin(pPhi);
304 fDy1 = pDy1; fDx1 = pDx1; fDx2 = pDx2; fTalpha1 = std::tan(pAlp1);
305 fDy2 = pDy2; fDx3 = pDx3; fDx4 = pDx4; fTalpha2 = std::tan(pAlp2);
315void G4Trap::CheckParameters()
318 fDy1<=0 || fDx1<=0 || fDx2<=0 ||
319 fDy2<=0 || fDx3<=0 || fDx4<=0)
321 std::ostringstream message;
322 message <<
"Invalid Length Parameters for Solid: " <<
GetName()
323 <<
"\n X - " <<fDx1<<
", "<<fDx2<<
", "<<fDx3<<
", "<<fDx4
324 <<
"\n Y - " <<fDy1<<
", "<<fDy2
326 G4Exception(
"G4Trap::CheckParameters()",
"GeomSolids0002",
337 G4double DzTthetaCphi = fDz*fTthetaCphi;
338 G4double DzTthetaSphi = fDz*fTthetaSphi;
339 G4double Dy1Talpha1 = fDy1*fTalpha1;
340 G4double Dy2Talpha2 = fDy2*fTalpha2;
344 G4ThreeVector(-DzTthetaCphi-Dy1Talpha1-fDx1,-DzTthetaSphi-fDy1,-fDz),
345 G4ThreeVector(-DzTthetaCphi-Dy1Talpha1+fDx1,-DzTthetaSphi-fDy1,-fDz),
346 G4ThreeVector(-DzTthetaCphi+Dy1Talpha1-fDx2,-DzTthetaSphi+fDy1,-fDz),
347 G4ThreeVector(-DzTthetaCphi+Dy1Talpha1+fDx2,-DzTthetaSphi+fDy1,-fDz),
348 G4ThreeVector( DzTthetaCphi-Dy2Talpha2-fDx3, DzTthetaSphi-fDy2, fDz),
349 G4ThreeVector( DzTthetaCphi-Dy2Talpha2+fDx3, DzTthetaSphi-fDy2, fDz),
350 G4ThreeVector( DzTthetaCphi+Dy2Talpha2-fDx4, DzTthetaSphi+fDy2, fDz),
351 G4ThreeVector( DzTthetaCphi+Dy2Talpha2+fDx4, DzTthetaSphi+fDy2, fDz)
363 constexpr G4int iface[4][4] = { {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3} };
364 const static G4String side[4] = {
"~-Y",
"~+Y",
"~-X",
"~+X" };
366 for (
G4int i=0; i<4; ++i)
372 fPlanes[i]))
continue;
375 G4ThreeVector normal(fPlanes[i].a,fPlanes[i].b,fPlanes[i].c);
377 for (
G4int k=0; k<4; ++k)
379 G4double dist = normal.
dot(pt[iface[i][k]]) + fPlanes[i].
d;
380 if (std::abs(dist) > std::abs(dmax)) dmax = dist;
382 std::ostringstream message;
383 message <<
"Side face " << side[i] <<
" is not planar for solid: "
384 <<
GetName() <<
"\nDiscrepancy: " << dmax/mm <<
" mm\n";
386 G4Exception(
"G4Trap::MakePlanes()",
"GeomSolids0002",
412 normal = normal.
unit();
415 plane.
a = normal.
x();
416 plane.
b = normal.
y();
417 plane.
c = normal.
z();
418 plane.
d = -normal.
dot(centre);
425 G4double dmax = std::max(std::max(std::max(d1,d2),d3),d4);
437 constexpr G4int iface[6][4] =
438 { {0,1,3,2}, {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3}, {4,6,7,5} };
445 for (
G4int i=0; i<6; ++i)
450 pt[iface[i][3]]).
mag();
452 for (
G4int i=1; i<6; ++i) { fAreas[i] += fAreas[i - 1]; }
456 if (fPlanes[0].b == -1 && fPlanes[1].b == 1 &&
463 if (std::abs(fPlanes[2].a + fPlanes[3].a) <
DBL_EPSILON &&
464 std::abs(fPlanes[2].c - fPlanes[3].c) <
DBL_EPSILON &&
469 fPlanes[2].
a = -fPlanes[3].
a;
470 fPlanes[2].
c = fPlanes[3].
c;
472 if (std::abs(fPlanes[2].a + fPlanes[3].a) <
DBL_EPSILON &&
473 std::abs(fPlanes[2].b - fPlanes[3].b) <
DBL_EPSILON &&
478 fPlanes[2].
a = -fPlanes[3].
a;
479 fPlanes[2].
b = fPlanes[3].
b;
504 (dx4 + dx3 - dx2 - dx1)*(dy2 - dy1)/3)*dz*0.125;
519 { {0,1,3,2}, {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3}, {4,6,7,5} };
522 for (
G4int i=0; i<6; ++i)
527 pt[iface[i][3]]).
mag();
554 G4double xmin = kInfinity, xmax = -kInfinity;
555 G4double ymin = kInfinity, ymax = -kInfinity;
556 for (
G4int i=0; i<8; ++i)
559 if (x < xmin) xmin = x;
560 if (x > xmax) xmax = x;
562 if (y < ymin) ymin = y;
563 if (y > ymax) ymax = y;
567 pMin.
set(xmin,ymin,-dz);
568 pMax.
set(xmax,ymax, dz);
572 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
574 std::ostringstream message;
575 message <<
"Bad bounding box (min >= max) for solid: "
577 <<
"\npMin = " << pMin
578 <<
"\npMax = " << pMax;
579 G4Exception(
"G4Trap::BoundingLimits()",
"GeomMgt0001",
606 return exist = (pMin < pMax) ?
true :
false;
625 std::vector<const G4ThreeVectorList *> polygons(2);
626 polygons[0] = &baseA;
627 polygons[1] = &baseB;
645 G4double dy1 = fPlanes[0].
b*p.
y()+fPlanes[0].
c*p.
z()+fPlanes[0].
d;
646 G4double dy2 = fPlanes[1].
b*p.
y()+fPlanes[1].
c*p.
z()+fPlanes[1].
d;
647 G4double dy = std::max(dz,std::max(dy1,dy2));
650 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
652 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
653 G4double dist = std::max(dy,std::max(dx1,dx2));
655 return (dist > halfCarTolerance) ?
kOutside :
661 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
663 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
665 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
666 G4double dist = std::max(dy,std::max(dx1,dx2));
668 return (dist > halfCarTolerance) ?
kOutside :
674 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
676 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
679 return (dist > halfCarTolerance) ?
kOutside :
685 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
687 + fPlanes[3].
b*p.
y()+fPlanes[3].
d;
690 return (dist > halfCarTolerance) ?
kOutside :
705 nz = std::copysign(
G4double(std::abs(dz) <= halfCarTolerance), p.
z());
711 for (
G4int i=0; i<2; ++i)
713 G4double dy = fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
714 if (std::abs(dy) > halfCarTolerance)
continue;
719 for (
G4int i=2; i<4; ++i)
722 fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
723 if (std::abs(dx) > halfCarTolerance)
continue;
734 ny = std::copysign(
G4double(std::abs(dy) <= halfCarTolerance), p.
y());
735 for (
G4int i=2; i<4; ++i)
738 fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
739 if (std::abs(dx) > halfCarTolerance)
continue;
750 ny = std::copysign(
G4double(std::abs(dy) <= halfCarTolerance), p.
y());
752 fPlanes[3].
c*p.
z() + fPlanes[3].
d;
753 G4double k = std::abs(dx) <= halfCarTolerance;
754 nx = std::copysign(k, p.
x())*fPlanes[3].
a;
755 nz += k*fPlanes[3].
c;
761 ny = std::copysign(
G4double(std::abs(dy) <= halfCarTolerance), p.
y());
763 fPlanes[3].
b*p.
y() + fPlanes[3].
d;
764 G4double k = std::abs(dx) <= halfCarTolerance;
765 nx = std::copysign(k, p.
x())*fPlanes[3].
a;
766 ny += k*fPlanes[3].
b;
773 G4double mag2 = nx*nx + ny*ny + nz*nz;
781 std::ostringstream message;
782 G4int oldprc = message.precision(16);
783 message <<
"Point p is not on surface (!?) of solid: "
785 message <<
"Position:\n";
786 message <<
" p.x() = " << p.
x()/mm <<
" mm\n";
787 message <<
" p.y() = " << p.
y()/mm <<
" mm\n";
788 message <<
" p.z() = " << p.
z()/mm <<
" mm";
789 G4cout.precision(oldprc) ;
790 G4Exception(
"G4Trap::SurfaceNormal(p)",
"GeomSolids1002",
794 return ApproxSurfaceNormal(p);
807 for (
G4int i=0; i<4; ++i)
811 fPlanes[i].
c*p.
z() + fPlanes[i].
d;
812 if (d > dist) { dist = d; iside = i; }
817 return G4ThreeVector(fPlanes[iside].a, fPlanes[iside].b, fPlanes[iside].c);
832 if ((std::abs(p.
z()) - fDz) >= -halfCarTolerance && p.
z()*v.
z() >= 0)
835 G4double dz = (invz < 0) ? fDz : -fDz;
845 G4double cosa = fPlanes[i].
b*v.
y() + fPlanes[i].
c*v.
z();
846 G4double dist = fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
847 if (dist >= -halfCarTolerance)
849 if (cosa >= 0)
return kInfinity;
851 if (tymin < tmp) tymin = tmp;
856 if (tymax > tmp) tymax = tmp;
865 G4double cosa = fPlanes[i].
a*v.
x()+fPlanes[i].
b*v.
y()+fPlanes[i].
c*v.
z();
866 G4double dist = fPlanes[i].
a*p.
x()+fPlanes[i].
b*p.
y()+fPlanes[i].
c*p.
z() +
868 if (dist >= -halfCarTolerance)
870 if (cosa >= 0)
return kInfinity;
872 if (txmin < tmp) txmin = tmp;
877 if (txmax > tmp) txmax = tmp;
883 G4double tmin = std::max(std::max(txmin,tymin),tzmin);
884 G4double tmax = std::min(std::min(txmax,tymax),tzmax);
886 if (tmax <= tmin + halfCarTolerance)
return kInfinity;
887 return (tmin < halfCarTolerance ) ? 0. : tmin;
903 G4double dy1 = fPlanes[0].
b*p.
y()+fPlanes[0].
c*p.
z()+fPlanes[0].
d;
904 G4double dy2 = fPlanes[1].
b*p.
y()+fPlanes[1].
c*p.
z()+fPlanes[1].
d;
905 G4double dy = std::max(dz,std::max(dy1,dy2));
908 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
910 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
911 G4double dist = std::max(dy,std::max(dx1,dx2));
912 return (dist > 0) ? dist : 0.;
917 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
919 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
921 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
922 G4double dist = std::max(dy,std::max(dx1,dx2));
923 return (dist > 0) ? dist : 0.;
928 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
930 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
932 return (dist > 0) ? dist : 0.;
937 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
939 + fPlanes[3].
b*p.
y()+fPlanes[3].
d;
941 return (dist > 0) ? dist : 0.;
959 if ((std::abs(p.
z()) - fDz) >= -halfCarTolerance && p.
z()*v.
z() > 0)
964 n->set(0, 0, (p.
z() < 0) ? -1 : 1);
970 G4int iside = (vz < 0) ? -4 : -2;
977 G4double cosa = fPlanes[i].
b*v.
y() + fPlanes[i].
c*v.
z();
980 G4double dist = fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
981 if (dist >= -halfCarTolerance)
986 n->set(0, fPlanes[i].b, fPlanes[i].c);
991 if (tmax > tmp) { tmax = tmp; iside = i; }
999 G4double cosa = fPlanes[i].
a*v.
x()+fPlanes[i].
b*v.
y()+fPlanes[i].
c*v.
z();
1003 fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
1004 if (dist >= -halfCarTolerance)
1009 n->set(fPlanes[i].a, fPlanes[i].b, fPlanes[i].c);
1014 if (tmax > tmp) { tmax = tmp; iside = i; }
1024 n->set(0, 0, iside + 3);
1026 n->set(fPlanes[iside].a, fPlanes[iside].b, fPlanes[iside].c);
1041 std::ostringstream message;
1042 G4int oldprc = message.precision(16);
1043 message <<
"Point p is outside (!?) of solid: " <<
GetName() <<
G4endl;
1044 message <<
"Position:\n";
1045 message <<
" p.x() = " << p.
x()/mm <<
" mm\n";
1046 message <<
" p.y() = " << p.
y()/mm <<
" mm\n";
1047 message <<
" p.z() = " << p.
z()/mm <<
" mm";
1048 G4cout.precision(oldprc);
1049 G4Exception(
"G4Trap::DistanceToOut(p)",
"GeomSolids1002",
1059 G4double dy1 = fPlanes[0].
b*p.
y()+fPlanes[0].
c*p.
z()+fPlanes[0].
d;
1060 G4double dy2 = fPlanes[1].
b*p.
y()+fPlanes[1].
c*p.
z()+fPlanes[1].
d;
1061 G4double dy = std::max(dz,std::max(dy1,dy2));
1064 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
1066 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
1067 G4double dist = std::max(dy,std::max(dx1,dx2));
1068 return (dist < 0) ? -dist : 0.;
1073 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
1075 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
1077 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
1078 G4double dist = std::max(dy,std::max(dx1,dx2));
1079 return (dist < 0) ? -dist : 0.;
1084 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
1086 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
1088 return (dist < 0) ? -dist : 0.;
1093 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
1095 + fPlanes[3].
b*p.
y()+fPlanes[3].
d;
1097 return (dist < 0) ? -dist : 0.;
1118 return new G4Trap(*
this);
1127 G4double phi = std::atan2(fTthetaSphi,fTthetaCphi);
1128 G4double theta = std::atan(std::sqrt(fTthetaCphi*fTthetaCphi
1129 +fTthetaSphi*fTthetaSphi));
1130 G4double alpha1 = std::atan(fTalpha1);
1131 G4double alpha2 = std::atan(fTalpha2);
1134 G4int oldprc = os.precision(16);
1135 os <<
"-----------------------------------------------------------\n"
1136 <<
" *** Dump for solid: " <<
GetName() <<
" ***\n"
1137 <<
" ===================================================\n"
1138 <<
" Solid type: G4Trap\n"
1140 <<
" half length Z: " << fDz/mm <<
" mm\n"
1141 <<
" half length Y, face -Dz: " << fDy1/mm <<
" mm\n"
1142 <<
" half length X, face -Dz, side -Dy1: " << fDx1/mm <<
" mm\n"
1143 <<
" half length X, face -Dz, side +Dy1: " << fDx2/mm <<
" mm\n"
1144 <<
" half length Y, face +Dz: " << fDy2/mm <<
" mm\n"
1145 <<
" half length X, face +Dz, side -Dy2: " << fDx3/mm <<
" mm\n"
1146 <<
" half length X, face +Dz, side +Dy2: " << fDx4/mm <<
" mm\n"
1147 <<
" theta: " << theta/degree << signDegree <<
"\n"
1148 <<
" phi: " << phi/degree << signDegree <<
"\n"
1149 <<
" alpha, face -Dz: " << alpha1/degree << signDegree <<
"\n"
1150 <<
" alpha, face +Dz: " << alpha2/degree << signDegree <<
"\n"
1151 <<
"-----------------------------------------------------------\n";
1152 os.precision(oldprc);
1163 for (
G4int i=0; i<8; ++i)
1165 G4int iy = (i==0 || i==1 || i==4 || i==5) ? 0 : 1;
1166 G4int ix = (i==0 || i==2 || i==4 || i==6) ? 2 : 3;
1168 G4double y = -(fPlanes[iy].
c*z + fPlanes[iy].
d)/fPlanes[iy].b;
1169 G4double x = -(fPlanes[ix].
b*y + fPlanes[ix].
c*z
1170 + fPlanes[ix].
d)/fPlanes[ix].a;
1182 constexpr G4int iface [6][4] =
1183 { {0,1,3,2}, {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3}, {4,6,7,5} };
1193 k -= (select <= fAreas[4]);
1194 k -= (select <= fAreas[3]);
1195 k -= (select <= fAreas[2]);
1196 k -= (select <= fAreas[1]);
1197 k -= (select <= fAreas[0]);
1201 G4int i0 = iface[k][0];
1202 G4int i1 = iface[k][1];
1203 G4int i2 = iface[k][2];
1204 G4int i3 = iface[k][3];
1206 if (select > fAreas[k] - s2) i0 = i2;
1212 if (u + v > 1.) { u = 1. - u; v = 1. - v; }
1213 return (1.-u-v)*pt[i0] + u*pt[i1] + v*pt[i3];
1227 G4double phi = std::atan2(fTthetaSphi, fTthetaCphi);
1228 G4double alpha1 = std::atan(fTalpha1);
1229 G4double alpha2 = std::atan(fTalpha2);
1230 G4double theta = std::atan(std::sqrt(fTthetaCphi*fTthetaCphi
1231 +fTthetaSphi*fTthetaSphi));
1234 fDy1, fDx1, fDx2, alpha1,
1235 fDy2, fDx3, fDx4, alpha2);
const G4double kCarTolerance
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
double dot(const Hep3Vector &) const
void set(double x, double y, double z)
G4bool BoundingBoxVsVoxelLimits(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4bool fRebuildPolyhedron
G4CSGSolid & operator=(const G4CSGSolid &rhs)
G4ThreeVector GetPointOnSurface() const
void SetAllParameters(G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pAlp1, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlp2)
G4Polyhedron * CreatePolyhedron() const
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const
G4double GetSurfaceArea()
G4double GetZHalfLength() const
EInside Inside(const G4ThreeVector &p) const
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep)
G4Trap(const G4String &pName, G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pAlp1, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlp2)
G4double GetCubicVolume()
G4bool MakePlane(const G4ThreeVector &p1, const G4ThreeVector &p2, const G4ThreeVector &p3, const G4ThreeVector &p4, TrapSidePlane &plane)
G4GeometryType GetEntityType() const
std::ostream & StreamInfo(std::ostream &os) const
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const
void DescribeYourselfTo(G4VGraphicsScene &scene) const
G4Trap & operator=(const G4Trap &rhs)
virtual void AddSolid(const G4Box &)=0
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const