90 for (
G4int k=0; k<4; k++) {
91 ostr <<
" " << facet.
edge[k].
v <<
"/" << facet.
edge[k].
f;
98 ostr <<
"Nvertices=" << ph.
nvert <<
", Nfacets=" << ph.
nface << std::endl;
100 for (i=1; i<=ph.
nvert; i++) {
101 ostr <<
"xyz(" << i <<
")="
102 << ph.
pV[i].
x() <<
' ' << ph.
pV[i].
y() <<
' ' << ph.
pV[i].
z()
105 for (i=1; i<=ph.
nface; i++) {
106 ostr <<
"face(" << i <<
")=" << ph.
pF[i] << std::endl;
118: nvert(0), nface(0), pV(0), pF(0)
132: nvert(0), nface(0), pV(nullptr), pF(nullptr)
203 for (i=0; i<4; i++) {
204 if (iNode == std::abs(pF[iFace].edge[i].v))
break;
208 <<
"HepPolyhedron::FindNeighbour: face " << iFace
209 <<
" has no node " << iNode
215 if (pF[iFace].edge[i].v == 0) i = 2;
217 return (pF[iFace].edge[i].v > 0) ? 0 : pF[iFace].edge[i].f;
231 G4int k = iFace, iOrder = 1,
n = 1;
234 k = FindNeighbour(k, iNode, iOrder);
235 if (k == iFace)
break;
238 normal += GetUnitNormal(k);
240 if (iOrder < 0)
break;
271 const G4int nMin = 3;
274 <<
"HepPolyhedron::SetNumberOfRotationSteps: attempt to set the\n"
275 <<
"number of steps per circle < " << nMin <<
"; forced to " << nMin
310 if (
pV != 0)
delete []
pV;
311 if (
pF != 0)
delete []
pF;
312 if (Nvert > 0 && Nface > 0) {
332 enum {DUMMY, BOTTOM, LEFT, BACK, RIGHT, FRONT, TOP};
334 pF[1] =
G4Facet(1,LEFT, 4,BACK, 3,RIGHT, 2,FRONT);
335 pF[2] =
G4Facet(5,TOP, 8,BACK, 4,BOTTOM, 1,FRONT);
336 pF[3] =
G4Facet(8,TOP, 7,RIGHT, 3,BOTTOM, 4,LEFT);
337 pF[4] =
G4Facet(7,TOP, 6,FRONT, 2,BOTTOM, 3,BACK);
338 pF[5] =
G4Facet(6,TOP, 5,LEFT, 1,BOTTOM, 2,RIGHT);
339 pF[6] =
G4Facet(5,FRONT, 6,RIGHT, 7,BACK, 8,LEFT);
364 if (r1 == 0. && r2 == 0.)
return;
369 G4int ii1 = ifWholeCircle ? i1 : i1+nds;
370 G4int ii2 = ifWholeCircle ? i2 : i2+nds;
371 G4int vv = ifWholeCircle ? vEdge : 1;
375 pF[kface++] =
G4Facet(i1,0, v2*i2,0, (i2+1),0);
376 }
else if (r2 == 0.) {
377 pF[kface++] =
G4Facet(i1,0, i2,0, v1*(i1+1),0);
379 pF[kface++] =
G4Facet(i1,0, v2*i2,0, (i2+1),0, v1*(i1+1),0);
383 pF[kface++] =
G4Facet(vv*i1,0, v2*i2,0, vEdge*(i2+1),0);
384 for (i2++,i=1; i<nds-1; i2++,i++) {
385 pF[kface++] =
G4Facet(vEdge*i1,0, v2*i2,0, vEdge*(i2+1),0);
387 pF[kface++] =
G4Facet(vEdge*i1,0, v2*i2,0, vv*ii2,0);
388 }
else if (r2 == 0.) {
389 pF[kface++] =
G4Facet(vv*i1,0, vEdge*i2,0, v1*(i1+1),0);
390 for (i1++,i=1; i<nds-1; i1++,i++) {
391 pF[kface++] =
G4Facet(vEdge*i1,0, vEdge*i2,0, v1*(i1+1),0);
393 pF[kface++] =
G4Facet(vEdge*i1,0, vv*i2,0, v1*ii1,0);
395 pF[kface++] =
G4Facet(vv*i1,0, v2*i2,0, vEdge*(i2+1),0,v1*(i1+1),0);
396 for (i1++,i2++,i=1; i<nds-1; i1++,i2++,i++) {
397 pF[kface++] =
G4Facet(vEdge*i1,0, v2*i2,0, vEdge*(i2+1),0,v1*(i1+1),0);
399 pF[kface++] =
G4Facet(vEdge*i1,0, v2*i2,0, vv*ii2,0, v1*ii1,0);
424 G4int k1, k2, k3, k4;
427 for (
G4int i=0; i<4; i++) {
430 if (r[k1] == 0. && r[k2] == 0.) vv[i] = -1;
434 if (ii[1] == ii[2]) {
438 pF[kface++] =
G4Facet(vv[0]*k1,0, vv[2]*k2,0, vv[3]*k3,0);
439 if (r[ii[0]] != 0.) k1 += nds;
440 if (r[ii[2]] != 0.) k2 += nds;
441 if (r[ii[3]] != 0.) k3 += nds;
442 pF[kface++] =
G4Facet(vv[2]*k3,0, vv[0]*k2,0, vv[3]*k1,0);
443 }
else if (kk[ii[0]] == kk[ii[1]]) {
447 pF[kface++] =
G4Facet(vv[1]*k1,0, vv[2]*k2,0, vv[3]*k3,0);
448 if (r[ii[0]] != 0.) k1 += nds;
449 if (r[ii[2]] != 0.) k2 += nds;
450 if (r[ii[3]] != 0.) k3 += nds;
451 pF[kface++] =
G4Facet(vv[2]*k3,0, vv[1]*k2,0, vv[3]*k1,0);
452 }
else if (kk[ii[2]] == kk[ii[3]]) {
456 pF[kface++] =
G4Facet(vv[0]*k1,0, vv[1]*k2,0, vv[3]*k3,0);
457 if (r[ii[0]] != 0.) k1 += nds;
458 if (r[ii[1]] != 0.) k2 += nds;
459 if (r[ii[2]] != 0.) k3 += nds;
460 pF[kface++] =
G4Facet(vv[1]*k3,0, vv[0]*k2,0, vv[3]*k1,0);
466 pF[kface++] =
G4Facet(vv[0]*k1,0, vv[1]*k2,0, vv[2]*k3,0, vv[3]*k4,0);
467 if (r[ii[0]] != 0.) k1 += nds;
468 if (r[ii[1]] != 0.) k2 += nds;
469 if (r[ii[2]] != 0.) k3 += nds;
470 if (r[ii[3]] != 0.) k4 += nds;
471 pF[kface++] =
G4Facet(vv[2]*k4,0, vv[1]*k3,0, vv[0]*k2,0, vv[3]*k1,0);
505 G4bool ifWholeCircle = (std::abs(dphi-wholeCircle) <
perMillion) ?
true :
false;
506 G4double delPhi = ifWholeCircle ? wholeCircle : dphi;
509 if (nSphi == 0) nSphi = 1;
510 G4int nVphi = ifWholeCircle ? nSphi : nSphi + 1;
511 G4bool ifClosed = np1 > 0 ? false :
true;
515 G4int absNp1 = std::abs(np1);
516 G4int absNp2 = std::abs(np2);
518 G4int i1end = absNp1-1;
519 G4int i2beg = absNp1;
520 G4int i2end = absNp1+absNp2-1;
523 for(i=i1beg; i<=i2end; i++) {
530 for (i=i1beg; i<=i1end; i++) {
531 Nverts += (r[i] == 0.) ? 1 : nVphi;
539 if (r[i2beg] != r[i1beg] || z[i2beg] != z[i1beg]) {
540 Nverts += (r[i2beg] == 0.) ? 1 : nVphi;
544 for(i=i2beg+1; i<i2end; i++) {
545 Nverts += (r[i] == 0.) ? 1 : nVphi;
548 if (r[i2end] != r[i1end] || z[i2end] != z[i1end]) {
549 if (absNp2 > 1) Nverts += (r[i2end] == 0.) ? 1 : nVphi;
557 G4int Nfaces = ifClosed ? absNp1*nSphi : (absNp1-1)*nSphi;
562 for(i=i2beg; i<i2end; i++) {
563 if (r[i] > 0. || r[i+1] > 0.) Nfaces += nSphi;
567 if (r[i2end] > 0. || r[i2beg] > 0.) Nfaces += nSphi;
574 if (ifSide1 && (r[i1beg] > 0. || r[i2beg] > 0.)) Nfaces += nSphi;
575 if (ifSide2 && (r[i1end] > 0. || r[i2end] > 0.)) Nfaces += nSphi;
580 if (!ifWholeCircle) {
581 Nfaces += ifClosed ? 2*absNp1 : 2*(absNp1-1);
587 if (
pV ==
nullptr ||
pF ==
nullptr)
return;
592 kk =
new G4int[absNp1+absNp2];
597 for(i=i1beg; i<=i1end; i++) {
600 {
pV[k++] =
G4Point3D(0, 0, z[i]); }
else { k += nVphi; }
609 {
pV[k++] =
G4Point3D(0, 0, z[i]); }
else { k += nVphi; }
616 for(i=i2beg+1; i<i2end; i++) {
619 {
pV[k++] =
G4Point3D(0, 0, z[i]); }
else { k += nVphi; }
638 for(j=0; j<nVphi; j++) {
639 cosPhi = std::cos(phi+j*delPhi/nSphi);
640 sinPhi = std::sin(phi+j*delPhi/nSphi);
641 for(i=i1beg; i<=i2end; i++) {
643 pV[kk[i]+j] =
G4Point3D(r[i]*cosPhi,r[i]*sinPhi,z[i]);
654 v2 = ifClosed ? nodeVis : 1;
655 for(i=i1beg; i<i1end; i++) {
657 if (!ifClosed && i == i1end-1) {
660 v2 = (r[i] == r[i+1] && r[i+1] == r[i+2]) ? -1 : nodeVis;
662 RotateEdge(kk[i], kk[i+1], r[i], r[i+1], v1, v2,
663 edgeVis, ifWholeCircle, nSphi, k);
666 RotateEdge(kk[i1end], kk[i1beg], r[i1end],r[i1beg], nodeVis, nodeVis,
667 edgeVis, ifWholeCircle, nSphi, k);
673 v2 = ifClosed ? nodeVis : 1;
674 for(i=i2beg; i<i2end; i++) {
676 if (!ifClosed && i==i2end-1) {
679 v2 = (r[i] == r[i+1] && r[i+1] == r[i+2]) ? -1 : nodeVis;
681 RotateEdge(kk[i+1], kk[i], r[i+1], r[i], v2, v1,
682 edgeVis, ifWholeCircle, nSphi, k);
685 RotateEdge(kk[i2beg], kk[i2end], r[i2beg], r[i2end], nodeVis, nodeVis,
686 edgeVis, ifWholeCircle, nSphi, k);
694 RotateEdge(kk[i2beg], kk[i1beg], r[i2beg], r[i1beg], 1, 1,
695 -1, ifWholeCircle, nSphi, k);
698 RotateEdge(kk[i1end], kk[i2end], r[i1end], r[i2end], 1, 1,
699 -1, ifWholeCircle, nSphi, k);
705 if (!ifWholeCircle) {
710 for (i=i1beg; i<=i1end; i++) {
712 ii[3] = (i == i1end) ? i1beg : i+1;
713 ii[1] = (absNp2 == 1) ? i2beg : ii[0]+absNp1;
714 ii[2] = (absNp2 == 1) ? i2beg : ii[3]+absNp1;
722 for (i=i1beg; i<i1end; i++) {
725 ii[1] = (absNp2 == 1) ? i2beg : ii[0]+absNp1;
726 ii[2] = (absNp2 == 1) ? i2beg : ii[3]+absNp1;
727 vv[0] = (i == i1beg) ? 1 : -1;
729 vv[2] = (i == i1end-1) ? 1 : -1;
742 <<
"HepPolyhedron::RotateAroundZ: number of generated faces ("
743 << k-1 <<
") is not equal to the number of allocated faces ("
753 const std::vector<G4TwoVector> &rz,
780 if (nSphi == 0) nSphi = 1;
781 G4int nVphi = (ifWholeCircle) ? nSphi : nSphi + 1;
785 G4int Nrz = rz.size();
787 for (
G4int i = 0; i < Nrz; ++i)
789 G4int k = (i == 0) ? Nrz - 1 : i - 1;
790 area += rz[k].x()*rz[i].y() - rz[i].x()*rz[k].y();
797 for (
G4int i = 0; i < Nrz; ++i)
807 for(
G4int i = 0; i < Nrz; ++i) Nverts += (r[i] == 0.) ? 1 : nVphi;
810 for (
G4int i = 0; i < Nrz; ++i)
812 G4int k = (i == 0) ? Nrz - 1 : i - 1;
813 Nedges -= (r[k] == 0 && r[i] == 0);
816 G4int Nfaces = Nedges*nSphi;
817 if (!ifWholeCircle) Nfaces += 2*(Nrz - 2);
822 if (
pV ==
nullptr ||
pF ==
nullptr)
835 for(
G4int i = 0; i < Nrz; ++i)
838 if (r[i] == 0.)
pV[kfree++] =
G4Point3D(0, 0, z[i]);
839 if (r[i] != 0.) kfree += nVphi;
843 for(
G4int j = 0; j < nVphi; ++j)
845 G4double cosPhi = std::cos(phi + j*delPhi/nSphi);
846 G4double sinPhi = std::sin(phi + j*delPhi/nSphi);
847 for(
G4int i = 0; i < Nrz; ++i)
850 pV[kk[i] + j] =
G4Point3D(r[i]*cosPhi, r[i]*sinPhi, z[i]);
857 for(
G4int i = 0; i < Nrz; ++i)
859 G4int i1 = (i < Nrz - 1) ? i + 1 : 0;
861 if (area < 0.) std::swap(i1, i2);
862 RotateEdge(kk[i1], kk[i2], r[i1], r[i2], nodeVis, nodeVis,
863 edgeVis, ifWholeCircle, nSphi, kfree);
870 std::vector<G4int> triangles;
874 G4int ntria = triangles.size()/3;
875 for (
G4int i = 0; i < ntria; ++i)
877 G4int i1 = triangles[0 + i*3];
878 G4int i2 = triangles[1 + i*3];
879 G4int i3 = triangles[2 + i*3];
880 if (area < 0.) std::swap(i1, i3);
881 G4int v1 = (std::abs(i2-i1) == 1 || std::abs(i2-i1) == Nrz-1) ? 1 : -1;
882 G4int v2 = (std::abs(i3-i2) == 1 || std::abs(i3-i2) == Nrz-1) ? 1 : -1;
883 G4int v3 = (std::abs(i1-i3) == 1 || std::abs(i1-i3) == Nrz-1) ? 1 : -1;
884 ii[0] = i1; ii[1] = i2; ii[2] = i2; ii[3] = i3;
885 vv[0] = v1; vv[1] = -1; vv[2] = v2; vv[3] = v3;
896 if (kfree - 1 !=
nface)
899 <<
"HepPolyhedron::RotateContourAroundZ: number of generated faces ("
900 << kfree-1 <<
") is not equal to the number of allocated faces ("
908 std::vector<G4int> &result)
927 if (
n < 3)
return false;
932 for(
G4int i = 0; i <
n; ++i)
934 G4int k = (i == 0) ?
n - 1 : i - 1;
935 area += polygon[k].x()*polygon[i].y() - polygon[i].x()*polygon[k].y();
943 for (
G4int i = 0; i <
n; ++i) V[i] = i;
945 for (
G4int i = 0; i <
n; ++i) V[i] = (
n - 1) - i;
951 for(
G4int b = nv - 1; nv > 2; )
957 if (area < 0.) std::reverse(result.begin(),result.end());
962 G4int a = (b < nv) ? b : 0;
963 b = (a+1 < nv) ? a+1 : 0;
964 G4int c = (b+1 < nv) ? b+1 : 0;
969 result.push_back(V[a]);
970 result.push_back(V[b]);
971 result.push_back(V[c]);
975 for(
G4int i = b; i < nv; ++i) V[i] = V[i+1];
981 if (area < 0.) std::reverse(result.begin(),result.end());
1001 G4double Ax = contour[V[a]].x(), Ay = contour[V[a]].y();
1002 G4double Bx = contour[V[b]].x(), By = contour[V[b]].y();
1003 G4double Cx = contour[V[c]].x(), Cy = contour[V[c]].y();
1004 if ((Bx-Ax)*(Cy-Ay) - (By-Ay)*(Cx-Ax) <
kCarTolerance)
return false;
1012 for (
G4int i=0; i<
n; ++i)
1014 if((i == a) || (i == b) || (i == c))
continue;
1016 if (Px < xmin || Px > xmax)
continue;
1018 if (Py < ymin || Py > ymax)
continue;
1020 if ((Bx-Ax)*(Cy-Ay) - (By-Ay)*(Cx-Ax) > 0.)
1022 if ((Ax-Cx)*(Py-Cy) - (Ay-Cy)*(Px-Cx) < 0.)
continue;
1023 if ((Bx-Ax)*(Py-Ay) - (By-Ay)*(Px-Ax) < 0.)
continue;
1024 if ((Cx-Bx)*(Py-By) - (Cy-By)*(Px-Bx) < 0.)
continue;
1028 if ((Ax-Cx)*(Py-Cy) - (Ay-Cy)*(Px-Cx) > 0.)
continue;
1029 if ((Bx-Ax)*(Py-Ay) - (By-Ay)*(Px-Ax) > 0.)
continue;
1030 if ((Cx-Bx)*(Py-By) - (Cy-By)*(Px-Bx) > 0.)
continue;
1047 if (
nface <= 0)
return;
1049 struct edgeListMember {
1050 edgeListMember *next;
1054 } *edgeList, *freeList, **headList;
1059 edgeList =
new edgeListMember[2*
nface];
1060 headList =
new edgeListMember*[
nvert];
1063 for (i=0; i<
nvert; i++) {
1066 freeList = edgeList;
1067 for (i=0; i<2*
nface-1; i++) {
1068 edgeList[i].next = &edgeList[i+1];
1070 edgeList[2*
nface-1].next = 0;
1074 G4int iface, iedge, nedge, i1, i2, k1, k2;
1075 edgeListMember *prev, *cur;
1077 for(iface=1; iface<=
nface; iface++) {
1078 nedge = (
pF[iface].
edge[3].
v == 0) ? 3 : 4;
1079 for (iedge=0; iedge<nedge; iedge++) {
1081 i2 = (iedge < nedge-1) ? iedge+1 : 0;
1082 i1 = std::abs(
pF[iface].edge[i1].v);
1083 i2 = std::abs(
pF[iface].edge[i2].v);
1084 k1 = (i1 < i2) ? i1 : i2;
1085 k2 = (i1 > i2) ? i1 : i2;
1090 headList[k1] = freeList;
1093 <<
"Polyhedron::SetReferences: bad link "
1097 freeList = freeList->next;
1106 if (cur->v2 == k2) {
1107 headList[k1] = cur->next;
1108 cur->next = freeList;
1110 pF[iface].
edge[iedge].
f = cur->iface;
1111 pF[cur->iface].
edge[cur->iedge].
f = iface;
1112 i1 = (
pF[iface].
edge[iedge].
v < 0) ? -1 : 1;
1113 i2 = (
pF[cur->iface].
edge[cur->iedge].
v < 0) ? -1 : 1;
1116 <<
"Polyhedron::SetReferences: different edge visibility "
1117 << iface <<
"/" << iedge <<
"/"
1118 <<
pF[iface].
edge[iedge].
v <<
" and "
1119 << cur->iface <<
"/" << cur->iedge <<
"/"
1120 <<
pF[cur->iface].
edge[cur->iedge].
v
1131 prev->next = freeList;
1134 <<
"Polyhedron::SetReferences: bad link "
1138 freeList = freeList->next;
1147 if (cur->v2 == k2) {
1148 prev->next = cur->next;
1149 cur->next = freeList;
1151 pF[iface].
edge[iedge].
f = cur->iface;
1152 pF[cur->iface].
edge[cur->iedge].
f = iface;
1153 i1 = (
pF[iface].
edge[iedge].
v < 0) ? -1 : 1;
1154 i2 = (
pF[cur->iface].
edge[cur->iedge].
v < 0) ? -1 : 1;
1157 <<
"Polyhedron::SetReferences: different edge visibility "
1158 << iface <<
"/" << iedge <<
"/"
1159 <<
pF[iface].
edge[iedge].
v <<
" and "
1160 << cur->iface <<
"/" << cur->iedge <<
"/"
1161 <<
pF[cur->iface].
edge[cur->iedge].
v
1172 for (i=0; i<
nvert; i++) {
1173 if (headList[i] != 0) {
1175 <<
"Polyhedron::SetReferences: List " << i <<
" is not empty"
1196 if (
nface <= 0)
return;
1197 G4int i, k, nnode, v[4],f[4];
1198 for (i=1; i<=
nface; i++) {
1199 nnode = (
pF[i].
edge[3].
v == 0) ? 3 : 4;
1200 for (k=0; k<nnode; k++) {
1201 v[k] = (k+1 == nnode) ?
pF[i].edge[0].v :
pF[i].edge[k+1].v;
1202 if (v[k] *
pF[i].edge[k].v < 0) v[k] = -v[k];
1205 for (k=0; k<nnode; k++) {
1206 pF[i].
edge[nnode-1-k].
v = v[k];
1207 pF[i].
edge[nnode-1-k].
f = f[k];
1249 G4int vIndex = pF[iFace].edge[iQVertex].v;
1251 edgeFlag = (vIndex > 0) ? 1 : 0;
1252 index = std::abs(vIndex);
1254 if (iQVertex >= 3 || pF[iFace].edge[iQVertex+1].v == 0) {
1256 if (++iFace > nface) iFace = 1;
1274 if (index <= 0 || index > nvert) {
1276 <<
"HepPolyhedron::GetVertex: irrelevant index " << index
1297 G4bool rep = GetNextVertexIndex(index, edgeFlag);
1318 if (nface == 0)
return false;
1320 G4int k = pF[iFace].edge[iNode].v;
1321 if (k > 0) { edgeFlag = 1; }
else { edgeFlag = -1; k = -k; }
1323 normal = FindNodeNormal(iFace,k);
1324 if (iNode >= 3 || pF[iFace].edge[iNode+1].v == 0) {
1326 if (++iFace > nface) iFace = 1;
1350 G4int k1, k2, kflag, kface1, kface2;
1352 if (iFace == 1 && iQVertex == 0) {
1353 k2 = pF[nface].edge[0].v;
1354 k1 = pF[nface].edge[3].v;
1355 if (k1 == 0) k1 = pF[nface].edge[2].v;
1356 if (std::abs(k1) > std::abs(k2)) iOrder = -1;
1360 k1 = pF[iFace].edge[iQVertex].v;
1364 kface2 = pF[iFace].edge[iQVertex].f;
1365 if (iQVertex >= 3 || pF[iFace].edge[iQVertex+1].v == 0) {
1367 k2 = std::abs(pF[iFace].edge[iQVertex].v);
1371 k2 = std::abs(pF[iFace].edge[iQVertex].v);
1373 }
while (iOrder*k1 > iOrder*k2);
1375 i1 = k1; i2 = k2; edgeFlag = (kflag > 0) ? 1 : 0;
1376 iface1 = kface1; iface2 = kface2;
1378 if (iFace > nface) {
1379 iFace = 1; iOrder = 1;
1398 G4int kface1, kface2;
1399 return GetNextEdgeIndices(i1, i2, edgeFlag, kface1, kface2);
1405 G4int &edgeFlag)
const
1417 G4bool rep = GetNextEdgeIndices(i1,i2,edgeFlag);
1438 G4bool rep = GetNextEdgeIndices(i1,i2,edgeFlag,iface1,iface2);
1455 if (iFace < 1 || iFace > nface) {
1457 <<
"HepPolyhedron::GetFacet: irrelevant index " << iFace
1462 for (i=0; i<4; i++) {
1463 k = pF[iFace].edge[i].v;
1465 if (iFaces != 0) iFaces[i] = pF[iFace].edge[i].f;
1468 if (edgeFlags != 0) edgeFlags[i] = 1;
1471 if (edgeFlags != 0) edgeFlags[i] = -1;
1490 GetFacet(index,
n, iNodes, edgeFlags);
1492 for (
G4int i=0; i<
n; i++) {
1493 nodes[i] = pV[iNodes[i]];
1494 if (normals != 0) normals[i] = FindNodeNormal(index,iNodes[i]);
1514 if (edgeFlags == 0) {
1515 GetFacet(iFace,
n,
nodes);
1516 }
else if (normals == 0) {
1517 GetFacet(iFace,
n,
nodes, edgeFlags);
1519 GetFacet(iFace,
n,
nodes, edgeFlags, normals);
1522 if (++iFace > nface) {
1540 if (iFace < 1 || iFace > nface) {
1542 <<
"HepPolyhedron::GetNormal: irrelevant index " << iFace
1547 G4int i0 = std::abs(pF[iFace].edge[0].v);
1548 G4int i1 = std::abs(pF[iFace].edge[1].v);
1549 G4int i2 = std::abs(pF[iFace].edge[2].v);
1550 G4int i3 = std::abs(pF[iFace].edge[3].v);
1551 if (i3 == 0) i3 = i0;
1552 return (pV[i2] - pV[i0]).cross(pV[i3] - pV[i1]);
1565 if (iFace < 1 || iFace > nface) {
1567 <<
"HepPolyhedron::GetUnitNormal: irrelevant index " << iFace
1572 G4int i0 = std::abs(pF[iFace].edge[0].v);
1573 G4int i1 = std::abs(pF[iFace].edge[1].v);
1574 G4int i2 = std::abs(pF[iFace].edge[2].v);
1575 G4int i3 = std::abs(pF[iFace].edge[3].v);
1576 if (i3 == 0) i3 = i0;
1577 return ((pV[i2] - pV[i0]).cross(pV[i3] - pV[i1])).unit();
1592 normal = GetNormal(iFace);
1593 if (++iFace > nface) {
1629 G4int i0 = std::abs(
pF[iFace].edge[0].v);
1630 G4int i1 = std::abs(
pF[iFace].edge[1].v);
1631 G4int i2 = std::abs(
pF[iFace].edge[2].v);
1632 G4int i3 = std::abs(
pF[iFace].edge[3].v);
1633 if (i3 == 0) i3 = i0;
1634 srf += ((
pV[i2] -
pV[i0]).cross(
pV[i3] -
pV[i1])).mag();
1651 G4int i0 = std::abs(
pF[iFace].edge[0].v);
1652 G4int i1 = std::abs(
pF[iFace].edge[1].v);
1653 G4int i2 = std::abs(
pF[iFace].edge[2].v);
1654 G4int i3 = std::abs(
pF[iFace].edge[3].v);
1658 pt = (
pV[i0]+
pV[i1]+
pV[i2]) * (1./3.);
1660 pt = (
pV[i0]+
pV[i1]+
pV[i2]+
pV[i3]) * 0.25;
1662 v += ((
pV[i2] -
pV[i0]).cross(
pV[i3] -
pV[i1])).dot(pt);
1702 enum {DUMMY, BOTTOM,
1703 LEFT_BOTTOM, LEFT_FRONT, LEFT_TOP, LEFT_BACK,
1704 BACK_BOTTOM, BACK_LEFT, BACK_TOP, BACK_RIGHT,
1705 RIGHT_BOTTOM, RIGHT_BACK, RIGHT_TOP, RIGHT_FRONT,
1706 FRONT_BOTTOM, FRONT_RIGHT, FRONT_TOP, FRONT_LEFT,
1709 pF[ 1]=
G4Facet(1,LEFT_BOTTOM, 4,BACK_BOTTOM, 3,RIGHT_BOTTOM, 2,FRONT_BOTTOM);
1711 pF[ 2]=
G4Facet(4,BOTTOM, -1,LEFT_FRONT, -12,LEFT_BACK, 0,0);
1712 pF[ 3]=
G4Facet(1,FRONT_LEFT, -5,LEFT_TOP, -12,LEFT_BOTTOM, 0,0);
1713 pF[ 4]=
G4Facet(5,TOP, -8,LEFT_BACK, -12,LEFT_FRONT, 0,0);
1714 pF[ 5]=
G4Facet(8,BACK_LEFT, -4,LEFT_BOTTOM, -12,LEFT_TOP, 0,0);
1716 pF[ 6]=
G4Facet(3,BOTTOM, -4,BACK_LEFT, -11,BACK_RIGHT, 0,0);
1717 pF[ 7]=
G4Facet(4,LEFT_BACK, -8,BACK_TOP, -11,BACK_BOTTOM, 0,0);
1718 pF[ 8]=
G4Facet(8,TOP, -7,BACK_RIGHT, -11,BACK_LEFT, 0,0);
1719 pF[ 9]=
G4Facet(7,RIGHT_BACK, -3,BACK_BOTTOM, -11,BACK_TOP, 0,0);
1721 pF[10]=
G4Facet(2,BOTTOM, -3,RIGHT_BACK, -10,RIGHT_FRONT, 0,0);
1722 pF[11]=
G4Facet(3,BACK_RIGHT, -7,RIGHT_TOP, -10,RIGHT_BOTTOM, 0,0);
1723 pF[12]=
G4Facet(7,TOP, -6,RIGHT_FRONT, -10,RIGHT_BACK, 0,0);
1724 pF[13]=
G4Facet(6,FRONT_RIGHT,-2,RIGHT_BOTTOM,-10,RIGHT_TOP, 0,0);
1726 pF[14]=
G4Facet(1,BOTTOM, -2,FRONT_RIGHT, -9,FRONT_LEFT, 0,0);
1727 pF[15]=
G4Facet(2,RIGHT_FRONT,-6,FRONT_TOP, -9,FRONT_BOTTOM, 0,0);
1728 pF[16]=
G4Facet(6,TOP, -5,FRONT_LEFT, -9,FRONT_RIGHT, 0,0);
1729 pF[17]=
G4Facet(5,LEFT_FRONT, -1,FRONT_BOTTOM, -9,FRONT_TOP, 0,0);
1731 pF[18]=
G4Facet(5,FRONT_TOP, 6,RIGHT_TOP, 7,BACK_TOP, 8,LEFT_TOP);
1739 const G4int faces[][4])
1755 if (
nvert == 0)
return 1;
1757 for (
G4int i=0; i<Nnodes; i++) {
1758 pV[i+1] =
G4Point3D(xyz[i][0], xyz[i][1], xyz[i][2]);
1760 for (
G4int k=0; k<Nfaces; k++) {
1761 pF[k+1] =
G4Facet(faces[k][0],0,faces[k][1],0,faces[k][2],0,faces[k][3],0);
1846 G4double DzTthetaCphi = Dz*std::tan(Theta)*std::cos(Phi);
1847 G4double DzTthetaSphi = Dz*std::tan(Theta)*std::sin(Phi);
1848 G4double Dy1Talp1 = Dy1*std::tan(Alp1);
1849 G4double Dy2Talp2 = Dy2*std::tan(Alp2);
1853 pV[1] =
G4Point3D(-DzTthetaCphi-Dy1Talp1-Dx1,-DzTthetaSphi-Dy1,-Dz);
1854 pV[2] =
G4Point3D(-DzTthetaCphi-Dy1Talp1+Dx1,-DzTthetaSphi-Dy1,-Dz);
1855 pV[3] =
G4Point3D(-DzTthetaCphi+Dy1Talp1+Dx2,-DzTthetaSphi+Dy1,-Dz);
1856 pV[4] =
G4Point3D(-DzTthetaCphi+Dy1Talp1-Dx2,-DzTthetaSphi+Dy1,-Dz);
1857 pV[5] =
G4Point3D( DzTthetaCphi-Dy2Talp2-Dx3, DzTthetaSphi-Dy2, Dz);
1858 pV[6] =
G4Point3D( DzTthetaCphi-Dy2Talp2+Dx3, DzTthetaSphi-Dy2, Dz);
1859 pV[7] =
G4Point3D( DzTthetaCphi+Dy2Talp2+Dx4, DzTthetaSphi+Dy2, Dz);
1860 pV[8] =
G4Point3D( DzTthetaCphi+Dy2Talp2-Dx4, DzTthetaSphi+Dy2, Dz);
1870 :
HepPolyhedronTrap(Dz, Theta, Phi, Dy, Dx, Dx,
Alpha, Dy, Dx, Dx,
Alpha) {}
1899 if (r1 < 0. || r2 <= 0.) k = 1;
1901 if (dz <= 0.) k += 2;
1907 phi2 = sPhi; phi1 = phi2 + dPhi;
1911 phi1 = sPhi; phi2 = phi1 + wholeCircle;
1915 phi1 = sPhi; phi2 = phi1 + dPhi;
1919 if (std::abs(dphi-wholeCircle) <
perMillion) dphi = wholeCircle;
1920 if (dphi > wholeCircle) k += 4;
1923 std::cerr <<
"HepPolyhedronParaboloid: error in input parameters";
1924 if ((k & 1) != 0) std::cerr <<
" (radiuses)";
1925 if ((k & 2) != 0) std::cerr <<
" (half-length)";
1926 if ((k & 4) != 0) std::cerr <<
" (angles)";
1927 std::cerr << std::endl;
1928 std::cerr <<
" r1=" << r1;
1929 std::cerr <<
" r2=" << r2;
1930 std::cerr <<
" dz=" << dz <<
" sPhi=" << sPhi <<
" dPhi=" << dPhi
1939 G4double k1 = (r2*r2 - r1*r1) / 2 / dz;
1947 for(
G4int i = 1; i <
n - 1; i++)
1949 rr[i] = rr[i-1] - dl;
1950 zz[i] = (rr[i]*rr[i] - k2) / k1;
2004 if (r1 < 0. || r2 < 0. || r1 >= r2) k = 1;
2005 if (halfZ <= 0.) k += 2;
2006 if (sqrtan1 < 0.|| sqrtan2 < 0.) k += 4;
2010 std::cerr <<
"HepPolyhedronHype: error in input parameters";
2011 if ((k & 1) != 0) std::cerr <<
" (radiuses)";
2012 if ((k & 2) != 0) std::cerr <<
" (half-length)";
2013 if ((k & 4) != 0) std::cerr <<
" (angles)";
2014 std::cerr << std::endl;
2015 std::cerr <<
" r1=" << r1 <<
" r2=" << r2;
2016 std::cerr <<
" halfZ=" << halfZ <<
" sqrTan1=" << sqrtan1
2017 <<
" sqrTan2=" << sqrtan2
2025 G4int nz1 = (sqrtan1 == 0.) ? 2 :
ns + 1;
2026 G4int nz2 = (sqrtan2 == 0.) ? 2 :
ns + 1;
2032 for(
G4int i = 0; i < nz2; ++i)
2034 zz[i] = halfZ - dz2*i;
2035 rr[i] = std::sqrt(sqrtan2*zz[i]*zz[i] + r2*r2);
2040 for(
G4int i = 0; i < nz1; ++i)
2043 zz[j] = halfZ - dz1*i;
2044 rr[j] = std::sqrt(sqrtan1*zz[j]*zz[j] + r1*r1);
2049 RotateAroundZ(0, 0., wholeCircle, nz2, nz1, zz, rr, -1, -1);
2085 if (Rmn1 < 0. || Rmx1 < 0. || Rmn2 < 0. || Rmx2 < 0.) k = 1;
2086 if (Rmn1 > Rmx1 || Rmn2 > Rmx2) k = 1;
2087 if (Rmn1 == Rmx1 && Rmn2 == Rmx2) k = 1;
2089 if (Dz <= 0.) k += 2;
2093 phi2 = Phi1; phi1 = phi2 - Dphi;
2094 }
else if (Dphi == 0.) {
2095 phi1 = Phi1; phi2 = phi1 + wholeCircle;
2097 phi1 = Phi1; phi2 = phi1 + Dphi;
2100 if (std::abs(dphi-wholeCircle) <
perMillion) dphi = wholeCircle;
2101 if (dphi > wholeCircle) k += 4;
2104 std::cerr <<
"HepPolyhedronCone(s)/Tube(s): error in input parameters";
2105 if ((k & 1) != 0) std::cerr <<
" (radiuses)";
2106 if ((k & 2) != 0) std::cerr <<
" (half-length)";
2107 if ((k & 4) != 0) std::cerr <<
" (angles)";
2108 std::cerr << std::endl;
2109 std::cerr <<
" Rmn1=" << Rmn1 <<
" Rmx1=" << Rmx1;
2110 std::cerr <<
" Rmn2=" << Rmn2 <<
" Rmx2=" << Rmx2;
2111 std::cerr <<
" Dz=" << Dz <<
" Phi1=" << Phi1 <<
" Dphi=" << Dphi
2182 if (dphi <= 0. || dphi >
twopi) {
2184 <<
"HepPolyhedronPgon/Pcon: wrong delta phi = " << dphi
2191 <<
"HepPolyhedronPgon/Pcon: number of z-planes less than two = " << nz
2198 <<
"HepPolyhedronPgon/Pcon: error in number of phi-steps =" << npdv
2204 for (i=0; i<nz; i++) {
2205 if (rmin[i] < 0. || rmax[i] < 0. || rmin[i] > rmax[i]) {
2207 <<
"HepPolyhedronPgon: error in radiuses rmin[" << i <<
"]="
2208 << rmin[i] <<
" rmax[" << i <<
"]=" << rmax[i]
2220 if (z[0] > z[nz-1]) {
2221 for (i=0; i<nz; i++) {
2228 for (i=0; i<nz; i++) {
2230 rr[i] = rmax[nz-i-1];
2231 zz[i+nz] = z[nz-i-1];
2232 rr[i+nz] = rmin[nz-i-1];
2239 G4int edgeVis = (npdv == 0) ? -1 : 1;
2240 RotateAroundZ(npdv, phi, dphi, nz, nz, zz, rr, nodeVis, edgeVis);
2250 const std::vector<G4TwoVector> &rz)
2267 if (dphi <= 0. || dphi >
twopi) {
2269 <<
"HepPolyhedronPgon/Pcon: wrong delta phi = " << dphi
2276 <<
"HepPolyhedronPgon/Pcon: error in number of phi-steps = " << npdv
2281 G4int nrz = rz.size();
2284 <<
"HepPolyhedronPgon/Pcon: invalid number of nodes in rz-contour = " << nrz
2292 G4int edgeVis = (npdv == 0) ? -1 : 1;
2306 const std::vector<G4TwoVector> &rz)
2332 if (dphi <= 0. || dphi >
twopi) {
2334 <<
"HepPolyhedronSphere: wrong delta phi = " << dphi
2339 if (the < 0. || the >
pi) {
2341 <<
"HepPolyhedronSphere: wrong theta = " << the
2346 if (dthe <= 0. || dthe >
pi) {
2348 <<
"HepPolyhedronSphere: wrong delta theta = " << dthe
2353 if (the+dthe >
pi) {
2355 <<
"HepPolyhedronSphere: wrong theta + delta theta = "
2356 << the <<
" " << dthe
2361 if (rmin < 0. || rmin >= rmax) {
2363 <<
"HepPolyhedronSphere: error in radiuses"
2364 <<
" rmin=" << rmin <<
" rmax=" << rmax
2373 if (np1 <= 1) np1 = 2;
2382 for (
G4int i=0; i<np1; i++) {
2383 cosa = std::cos(the+i*a);
2384 sina = std::sin(the+i*a);
2388 zz[i+np1] = rmin*cosa;
2389 rr[i+np1] = rmin*sina;
2430 if (dphi <= 0. || dphi >
twopi) {
2432 <<
"HepPolyhedronTorus: wrong delta phi = " << dphi
2437 if (rmin < 0. || rmin >= rmax || rmax >= rtor) {
2439 <<
"HepPolyhedronTorus: error in radiuses"
2440 <<
" rmin=" << rmin <<
" rmax=" << rmax <<
" rtorus=" << rtor
2456 for (
G4int i=0; i<np1; i++) {
2457 cosa = std::cos(i*a);
2458 sina = std::sin(i*a);
2460 rr[i] = rtor+rmax*sina;
2462 zz[i+np1] = rmin*cosa;
2463 rr[i+np1] = rtor+rmin*sina;
2500 pV[1].
set(p0[0], p0[1], p0[2]);
2501 pV[2].
set(p1[0], p1[1], p1[2]);
2502 pV[3].
set(p2[0], p2[1], p2[2]);
2503 pV[4].
set(p3[0], p3[1], p3[2]);
2511 pV[3].
set(p3[0], p3[1], p3[2]);
2512 pV[4].
set(p2[0], p2[1], p2[2]);
2543 if (zCut1 >= cz || zCut2 <= -cz || zCut1 > zCut2) {
2544 std::cerr <<
"HepPolyhedronEllipsoid: wrong zCut1 = " << zCut1
2545 <<
" zCut2 = " << zCut2
2546 <<
" for given cz = " << cz << std::endl;
2550 std::cerr <<
"HepPolyhedronEllipsoid: bad z semi-axis: cz = " << cz
2565 sthe= std::acos(zCut2/cz);
2574 dthe= std::acos(zCut1/cz)-sthe;
2589 G4Exception(
"HepPolyhedronEllipsoid::HepPolyhedronEllipsoid",
2602 for (
G4int i=0; i<np1-cutflag; i++) {
2603 cosa = std::cos(sthe+i*a);
2604 sina = std::sin(sthe+i*a);
2617 std::cerr <<
"Logic error in HepPolyhedronEllipsoid, memory corrupted!"
2622 std::cerr <<
"Warning: logic error in HepPolyhedronEllipsoid."
2642 p->
setX( p->
x() * ax/cz );
2643 p->
setY( p->
y() * by/cz );
2670 if ( (ax <= 0.) || (ay <= 0.) || (h <= 0.) || (zTopCut <= 0.) ) { k = 1; }
2673 std::cerr <<
"HepPolyhedronCone: error in input parameters";
2674 std::cerr << std::endl;
2680 zTopCut = (h >= zTopCut ? zTopCut : h);
2689 rr[0] = (h-zTopCut);
2690 rr[1] = (h+zTopCut);
2706 p->
setX( p->
x() * ax );
2707 p->
setY( p->
y() * ay );
2739 G4double maxAng = (
A == 0.) ? 0. : std::acosh(1. + H/
A);
2740 G4double delAng = maxAng/(np1 - 1);
2748 for (
G4int iz = 1; iz < np1 - 1; ++iz)
2751 zz[iz] =
A*std::cosh(ang) -
A;
2752 rr[iz] =
B*std::sinh(ang);
2786#include "BooleanProcessor.src"
2800 return processor.execute(OP_UNION, *
this, p,ierr);
2815 return processor.execute(OP_INTERSECTION, *
this, p,ierr);
2830 return processor.execute(OP_SUBTRACTION, *
this, p,ierr);
2838#include "HepPolyhedronProcessor.src"
const G4double kCarTolerance
G4double B(G4double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
HepGeom::Normal3D< G4double > G4Normal3D
HepGeom::Point3D< G4double > G4Point3D
static constexpr double perMillion
static constexpr double twopi
static constexpr double nm
static constexpr double pi
static constexpr double deg
HepGeom::Vector3D< G4double > G4Vector3D
const G4double spatialTolerance
#define DEFAULT_NUMBER_OF_STEPS
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
void set(T x1, T y1, T z1)
T dot(const BasicVector3D< T > &v) const
virtual ~HepPolyhedronBox()
HepPolyhedronBox(G4double Dx, G4double Dy, G4double Dz)
virtual ~HepPolyhedronCone()
HepPolyhedronCone(G4double Rmn1, G4double Rmx1, G4double Rmn2, G4double Rmx2, G4double Dz)
virtual ~HepPolyhedronCons()
HepPolyhedronCons(G4double Rmn1, G4double Rmx1, G4double Rmn2, G4double Rmx2, G4double Dz, G4double Phi1, G4double Dphi)
virtual ~HepPolyhedronEllipsoid()
HepPolyhedronEllipsoid(G4double dx, G4double dy, G4double dz, G4double zcut1, G4double zcut2)
virtual ~HepPolyhedronEllipticalCone()
HepPolyhedronEllipticalCone(G4double dx, G4double dy, G4double z, G4double zcut1)
HepPolyhedronHype(G4double r1, G4double r2, G4double tan1, G4double tan2, G4double halfZ)
virtual ~HepPolyhedronHype()
virtual ~HepPolyhedronHyperbolicMirror()
HepPolyhedronHyperbolicMirror(G4double a, G4double h, G4double r)
virtual ~HepPolyhedronPara()
HepPolyhedronPara(G4double Dx, G4double Dy, G4double Dz, G4double Alpha, G4double Theta, G4double Phi)
virtual ~HepPolyhedronParaboloid()
HepPolyhedronParaboloid(G4double r1, G4double r2, G4double dz, G4double Phi1, G4double Dphi)
virtual ~HepPolyhedronPcon()
HepPolyhedronPcon(G4double phi, G4double dphi, G4int nz, const G4double *z, const G4double *rmin, const G4double *rmax)
virtual ~HepPolyhedronPgon()
HepPolyhedronPgon(G4double phi, G4double dphi, G4int npdv, G4int nz, const G4double *z, const G4double *rmin, const G4double *rmax)
virtual ~HepPolyhedronSphere()
HepPolyhedronSphere(G4double rmin, G4double rmax, G4double phi, G4double dphi, G4double the, G4double dthe)
virtual ~HepPolyhedronTet()
HepPolyhedronTet(const G4double p0[3], const G4double p1[3], const G4double p2[3], const G4double p3[3])
HepPolyhedronTorus(G4double rmin, G4double rmax, G4double rtor, G4double phi, G4double dphi)
virtual ~HepPolyhedronTorus()
HepPolyhedronTrap(G4double Dz, G4double Theta, G4double Phi, G4double Dy1, G4double Dx1, G4double Dx2, G4double Alp1, G4double Dy2, G4double Dx3, G4double Dx4, G4double Alp2)
virtual ~HepPolyhedronTrap()
HepPolyhedronTrd1(G4double Dx1, G4double Dx2, G4double Dy, G4double Dz)
virtual ~HepPolyhedronTrd1()
virtual ~HepPolyhedronTrd2()
HepPolyhedronTrd2(G4double Dx1, G4double Dx2, G4double Dy1, G4double Dy2, G4double Dz)
virtual ~HepPolyhedronTube()
HepPolyhedronTube(G4double Rmin, G4double Rmax, G4double Dz)
HepPolyhedronTubs(G4double Rmin, G4double Rmax, G4double Dz, G4double Phi1, G4double Dphi)
virtual ~HepPolyhedronTubs()
static void SetNumberOfRotationSteps(G4int n)
void RotateAroundZ(G4int nstep, G4double phi, G4double dphi, G4int np1, G4int np2, const G4double *z, G4double *r, G4int nodeVis, G4int edgeVis)
G4bool GetNextEdgeIndices(G4int &i1, G4int &i2, G4int &edgeFlag, G4int &iface1, G4int &iface2) const
G4Normal3D GetUnitNormal(G4int iFace) const
void GetFacet(G4int iFace, G4int &n, G4int *iNodes, G4int *edgeFlags=0, G4int *iFaces=0) const
G4int createTwistedTrap(G4double Dz, const G4double xy1[][2], const G4double xy2[][2])
G4bool GetNextNormal(G4Normal3D &normal) const
HepPolyhedron & operator=(const HepPolyhedron &from)
G4Normal3D FindNodeNormal(G4int iFace, G4int iNode) const
static G4int GetNumberOfRotationSteps()
G4Normal3D GetNormal(G4int iFace) const
G4int FindNeighbour(G4int iFace, G4int iNode, G4int iOrder) const
G4bool TriangulatePolygon(const std::vector< G4TwoVector > &polygon, std::vector< G4int > &result)
void RotateContourAroundZ(G4int nstep, G4double phi, G4double dphi, const std::vector< G4TwoVector > &rz, G4int nodeVis, G4int edgeVis)
G4Point3D GetVertex(G4int index) const
G4double GetSurfaceArea() const
HepPolyhedron subtract(const HepPolyhedron &p) const
G4bool GetNextVertex(G4Point3D &vertex, G4int &edgeFlag) const
G4double GetVolume() const
HepPolyhedron intersect(const HepPolyhedron &p) const
HepPolyhedron & Transform(const G4Transform3D &t)
G4int createPolyhedron(G4int Nnodes, G4int Nfaces, const G4double xyz[][3], const G4int faces[][4])
void AllocateMemory(G4int Nvert, G4int Nface)
G4bool GetNextUnitNormal(G4Normal3D &normal) const
static void ResetNumberOfRotationSteps()
G4bool CheckSnip(const std::vector< G4TwoVector > &contour, G4int a, G4int b, G4int c, G4int n, const G4int *V)
void RotateEdge(G4int k1, G4int k2, G4double r1, G4double r2, G4int v1, G4int v2, G4int vEdge, G4bool ifWholeCircle, G4int ns, G4int &kface)
G4bool GetNextFacet(G4int &n, G4Point3D *nodes, G4int *edgeFlags=0, G4Normal3D *normals=0) const
static G4ThreadLocal G4int fNumberOfRotationSteps
G4bool GetNextVertexIndex(G4int &index, G4int &edgeFlag) const
HepPolyhedron add(const HepPolyhedron &p) const
G4bool GetNextEdge(G4Point3D &p1, G4Point3D &p2, G4int &edgeFlag) const
void SetSideFacets(G4int ii[4], G4int vv[4], G4int *kk, G4double *r, G4double dphi, G4int ns, G4int &kface)
static constexpr double deg
static constexpr double twopi
static constexpr double perMillion
static double normal(HepRandomEngine *eptr)
static constexpr double pi
static constexpr double nm
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments