|
ATLAS Offline Software
|
#include <SbPolyhedron.h>
|
| SbPolyhedronPara (double Dx, double Dy, double Dz, double Alpha, double Theta, double Phi) |
|
virtual | ~SbPolyhedronPara () |
|
virtual SbPolyhedron & | operator= (const SbPolyhedron &from) |
|
int | GetNoVertices () const |
|
int | GetNoFacets () const |
|
SbPolyhedron & | Transform (const HEPVis::SbRotation &rot, const SbVec3d &trans) |
|
bool | GetNextVertexIndex (int &index, int &edgeFlag) const |
|
HVPoint3D | GetVertex (int index) const |
|
const HVPoint3D & | GetVertexFast (int index) const |
|
bool | GetNextVertex (HVPoint3D &vertex, int &edgeFlag) const |
|
bool | GetNextVertex (HVPoint3D &vertex, int &edgeFlag, HVNormal3D &normal) const |
|
bool | GetNextEdgeIndeces (int &i1, int &i2, int &edgeFlag, int &iface1, int &iface2) const |
|
bool | GetNextEdgeIndeces (int &i1, int &i2, int &edgeFlag) const |
|
bool | GetNextEdge (HVPoint3D &p1, HVPoint3D &p2, int &edgeFlag) const |
|
bool | GetNextEdge (HVPoint3D &p1, HVPoint3D &p2, int &edgeFlag, int &iface1, int &iface2) const |
|
void | GetFacet (int iFace, int &n, int *iNodes, int *edgeFlags=0, int *iFaces=0) const |
|
void | GetFacet (int iFace, int &n, HVPoint3D *nodes, int *edgeFlags=0, HVNormal3D *normals=0) const |
|
bool | GetNextFacet (int &n, HVPoint3D *nodes, int *edgeFlags=0, HVNormal3D *normals=0) const |
|
HVNormal3D | GetNormal (int iFace) const |
|
HVNormal3D | GetUnitNormal (int iFace) const |
|
bool | GetNextNormal (HVNormal3D &normal) const |
|
bool | GetNextUnitNormal (HVNormal3D &normal) const |
|
SbPolyhedron | add (const SbPolyhedron &p) const |
|
SbPolyhedron | subtract (const SbPolyhedron &p) const |
|
SbPolyhedron | intersect (const SbPolyhedron &p) const |
|
double | GetSurfaceArea () const |
|
double | GetVolume () const |
|
|
void | AllocateMemory (int Nvert, int Nface) |
|
int | FindNeighbour (int iFace, int iNode, int iOrder) const |
|
HVNormal3D | FindNodeNormal (int iFace, int iNode) const |
|
void | CreatePrism () |
|
void | RotateEdge (int k1, int k2, double r1, double r2, int v1, int v2, int vEdge, bool ifWholeCircle, int ns, int &kface) |
|
void | SetSideFacets (int ii[4], int vv[4], int *kk, double *r, double dphi, int ns, int &kface) |
|
void | RotateAroundZ (int nstep, double phi, double dphi, int np1, int np2, const double *z, double *r, int nodeVis, int edgeVis) |
|
void | SetReferences () |
|
void | InvertFacets () |
|
Definition at line 438 of file SbPolyhedron.h.
◆ SbPolyhedronPara()
SbPolyhedronPara::SbPolyhedronPara |
( |
double |
Dx, |
|
|
double |
Dy, |
|
|
double |
Dz, |
|
|
double |
Alpha, |
|
|
double |
Theta, |
|
|
double |
Phi |
|
) |
| |
Definition at line 1442 of file SbPolyhedron.cxx.
1445 :
SbPolyhedronTrap(
Dz, Theta,
Phi, Dy, Dx, Dx, Alpha, Dy, Dx, Dx, Alpha) {}
◆ ~SbPolyhedronPara()
SbPolyhedronPara::~SbPolyhedronPara |
( |
| ) |
|
|
virtual |
◆ add()
◆ AllocateMemory()
void SbPolyhedron::AllocateMemory |
( |
int |
Nvert, |
|
|
int |
Nface |
|
) |
| |
|
protectedinherited |
◆ CreatePrism()
void SbPolyhedron::CreatePrism |
( |
| ) |
|
|
protectedinherited |
Definition at line 286 of file SbPolyhedron.cxx.
299 m_pF[2] =
SbFacet(5,TOP, 8,BACK, 4,BOTTOM, 1,FRONT);
301 m_pF[4] =
SbFacet(7,TOP, 6,FRONT, 2,BOTTOM, 3,BACK);
◆ FindNeighbour()
int SbPolyhedron::FindNeighbour |
( |
int |
iFace, |
|
|
int |
iNode, |
|
|
int |
iOrder |
|
) |
| const |
|
protectedinherited |
Definition at line 189 of file SbPolyhedron.cxx.
200 for (
i=0;
i<4;
i++) {
201 if (iNode ==
iabs(
m_pF[iFace].m_edge[
i].
v))
break;
205 <<
"SbPolyhedron::FindNeighbour: face " << iFace
206 <<
" has no node " << iNode
212 if (
m_pF[iFace].m_edge[
i].
v == 0)
i = 2;
◆ FindNodeNormal()
HVNormal3D SbPolyhedron::FindNodeNormal |
( |
int |
iFace, |
|
|
int |
iNode |
|
) |
| const |
|
protectedinherited |
Definition at line 217 of file SbPolyhedron.cxx.
228 int k = iFace, iOrder = 1;
232 if (
k == iFace)
break;
236 if (iOrder < 0)
break;
◆ GetFacet() [1/2]
void SbPolyhedron::GetFacet |
( |
int |
iFace, |
|
|
int & |
n, |
|
|
HVPoint3D * |
nodes, |
|
|
int * |
edgeFlags = 0 , |
|
|
HVNormal3D * |
normals = 0 |
|
) |
| const |
|
inherited |
◆ GetFacet() [2/2]
void SbPolyhedron::GetFacet |
( |
int |
iFace, |
|
|
int & |
n, |
|
|
int * |
iNodes, |
|
|
int * |
edgeFlags = 0 , |
|
|
int * |
iFaces = 0 |
|
) |
| const |
|
inherited |
Definition at line 1117 of file SbPolyhedron.cxx.
1128 if (iFace < 1 || iFace >
m_nface) {
1130 <<
"SbPolyhedron::GetFacet: irrelevant index " << iFace
1135 for (
i=0;
i<4;
i++) {
1141 if (edgeFlags != 0) edgeFlags[
i] = 1;
1144 if (edgeFlags != 0) edgeFlags[
i] = -1;
◆ GetNextEdge() [1/2]
◆ GetNextEdge() [2/2]
bool SbPolyhedron::GetNextEdge |
( |
HVPoint3D & |
p1, |
|
|
HVPoint3D & |
p2, |
|
|
int & |
edgeFlag, |
|
|
int & |
iface1, |
|
|
int & |
iface2 |
|
) |
| const |
|
inherited |
◆ GetNextEdgeIndeces() [1/2]
bool SbPolyhedron::GetNextEdgeIndeces |
( |
int & |
i1, |
|
|
int & |
i2, |
|
|
int & |
edgeFlag |
|
) |
| const |
|
inherited |
◆ GetNextEdgeIndeces() [2/2]
bool SbPolyhedron::GetNextEdgeIndeces |
( |
int & |
i1, |
|
|
int & |
i2, |
|
|
int & |
edgeFlag, |
|
|
int & |
iface1, |
|
|
int & |
iface2 |
|
) |
| const |
|
inherited |
Definition at line 1007 of file SbPolyhedron.cxx.
1020 static int iFace = 1;
1021 static int iQVertex = 0;
1022 static int iOrder = 1;
1023 int k1, k2, kflag, kface1, kface2;
1025 if (iFace == 1 && iQVertex == 0) {
1029 if (
iabs(k1) >
iabs(k2)) iOrder = -1;
1038 if (iQVertex >= 3 ||
m_pF[iFace].m_edge[iQVertex+1].
v == 0) {
1040 k2 =
iabs(
m_pF[iFace].m_edge[iQVertex].
v);
1044 k2 =
iabs(
m_pF[iFace].m_edge[iQVertex].
v);
1046 }
while (iOrder*k1 > iOrder*k2);
1048 i1 = k1; i2 = k2; edgeFlag = (kflag > 0) ? 1 : 0;
1049 iface1 = kface1; iface2 = kface2;
1052 iFace = 1; iOrder = 1;
◆ GetNextFacet()
bool SbPolyhedron::GetNextFacet |
( |
int & |
n, |
|
|
HVPoint3D * |
nodes, |
|
|
int * |
edgeFlags = 0 , |
|
|
HVNormal3D * |
normals = 0 |
|
) |
| const |
|
inherited |
Definition at line 1173 of file SbPolyhedron.cxx.
1185 static int iFace = 1;
1187 if (edgeFlags == 0) {
1189 }
else if (normals == 0) {
1192 GetFacet(iFace,
n, nodes, edgeFlags, normals);
◆ GetNextNormal()
bool SbPolyhedron::GetNextNormal |
( |
HVNormal3D & |
normal | ) |
const |
|
inherited |
◆ GetNextUnitNormal()
bool SbPolyhedron::GetNextUnitNormal |
( |
HVNormal3D & |
normal | ) |
const |
|
inherited |
◆ GetNextVertex() [1/2]
bool SbPolyhedron::GetNextVertex |
( |
HVPoint3D & |
vertex, |
|
|
int & |
edgeFlag |
|
) |
| const |
|
inherited |
◆ GetNextVertex() [2/2]
bool SbPolyhedron::GetNextVertex |
( |
HVPoint3D & |
vertex, |
|
|
int & |
edgeFlag, |
|
|
HVNormal3D & |
normal |
|
) |
| const |
|
inherited |
Definition at line 975 of file SbPolyhedron.cxx.
988 static int iFace = 1;
989 static int iNode = 0;
991 if (
m_nface == 0)
return false;
994 if (
k > 0) { edgeFlag = 1; }
else { edgeFlag = -1;
k = -
k; }
997 if (iNode >= 3 ||
m_pF[iFace].m_edge[iNode+1].
v == 0) {
999 if (++iFace >
m_nface) iFace = 1;
◆ GetNextVertexIndex()
bool SbPolyhedron::GetNextVertexIndex |
( |
int & |
index, |
|
|
int & |
edgeFlag |
|
) |
| const |
|
inherited |
Definition at line 902 of file SbPolyhedron.cxx.
912 static int iFace = 1;
913 static int iQVertex = 0;
916 edgeFlag = (vIndex > 0) ? 1 : 0;
919 if (iQVertex >= 3 ||
m_pF[iFace].m_edge[iQVertex+1].
v == 0) {
921 if (++iFace >
m_nface) iFace = 1;
◆ GetNoFacets()
int SbPolyhedron::GetNoFacets |
( |
| ) |
const |
|
inlineinherited |
◆ GetNormal()
HVNormal3D SbPolyhedron::GetNormal |
( |
int |
iFace | ) |
const |
|
inherited |
Definition at line 1203 of file SbPolyhedron.cxx.
1213 if (iFace < 1 || iFace >
m_nface) {
1215 <<
"SbPolyhedron::GetNormal: irrelevant index " << iFace
1224 if (i3 == 0) i3 = i0;
◆ GetNoVertices()
int SbPolyhedron::GetNoVertices |
( |
| ) |
const |
|
inlineinherited |
◆ GetNumberOfRotationSteps()
static int SbPolyhedron::GetNumberOfRotationSteps |
( |
| ) |
|
|
inlinestaticinherited |
◆ GetSurfaceArea()
double SbPolyhedron::GetSurfaceArea |
( |
| ) |
const |
|
inherited |
◆ GetUnitNormal()
HVNormal3D SbPolyhedron::GetUnitNormal |
( |
int |
iFace | ) |
const |
|
inherited |
Definition at line 1228 of file SbPolyhedron.cxx.
1238 if (iFace < 1 || iFace >
m_nface) {
1240 <<
"SbPolyhedron::GetUnitNormal: irrelevant index " << iFace
1249 if (i3 == 0) i3 = i0;
◆ GetVertex()
HVPoint3D SbPolyhedron::GetVertex |
( |
int |
index | ) |
const |
|
inherited |
◆ GetVertexFast()
◆ GetVolume()
double SbPolyhedron::GetVolume |
( |
| ) |
const |
|
inherited |
◆ intersect()
◆ InvertFacets()
void SbPolyhedron::InvertFacets |
( |
| ) |
|
|
protectedinherited |
◆ operator=()
◆ ResetNumberOfRotationSteps()
static void SbPolyhedron::ResetNumberOfRotationSteps |
( |
| ) |
|
|
inlinestaticinherited |
◆ RotateAroundZ()
void SbPolyhedron::RotateAroundZ |
( |
int |
nstep, |
|
|
double |
phi, |
|
|
double |
dphi, |
|
|
int |
np1, |
|
|
int |
np2, |
|
|
const double * |
z, |
|
|
double * |
r, |
|
|
int |
nodeVis, |
|
|
int |
edgeVis |
|
) |
| |
|
protectedinherited |
Definition at line 438 of file SbPolyhedron.cxx.
464 static double wholeCircle = 2*
M_PI;
468 bool ifWholeCircle = (fabs(dphi-wholeCircle) <
perMillion) ?
470 double delPhi = ifWholeCircle ? wholeCircle : dphi;
471 int nSphi = (nstep > 0) ?
473 if (nSphi == 0) nSphi = 1;
474 int nVphi = ifWholeCircle ? nSphi : nSphi+1;
475 bool ifClosed = np1 > 0 ? false :
true;
479 int absNp1 =
iabs(np1);
480 int absNp2 =
iabs(np2);
482 int i1end = absNp1-1;
484 int i2end = absNp1+absNp2-1;
487 for(
i=i1beg;
i<=i2end;
i++) {
492 for (
i=i1beg;
i<=i1end;
i++) {
493 j += (
r[
i] == 0.) ? 1 : nVphi;
496 bool ifSide1 =
false;
497 bool ifSide2 =
false;
499 if (
r[i2beg] !=
r[i1beg] ||
z[i2beg] !=
z[i1beg]) {
500 j += (
r[i2beg] == 0.) ? 1 : nVphi;
504 for(
i=i2beg+1;
i<i2end;
i++) {
505 j += (
r[
i] == 0.) ? 1 : nVphi;
508 if (
r[i2end] !=
r[i1end] ||
z[i2end] !=
z[i1end]) {
509 if (absNp2 > 1) j += (
r[i2end] == 0.) ? 1 : nVphi;
515 k = ifClosed ? absNp1*nSphi : (absNp1-1)*nSphi;
518 for(
i=i2beg;
i<i2end;
i++) {
519 if (
r[
i] > 0. ||
r[
i+1] > 0.)
k += nSphi;
523 if (
r[i2end] > 0. ||
r[i2beg] > 0.)
k += nSphi;
528 if (ifSide1 && (
r[i1beg] > 0. ||
r[i2beg] > 0.))
k += nSphi;
529 if (ifSide2 && (
r[i1end] > 0. ||
r[i2end] > 0.))
k += nSphi;
532 if (!ifWholeCircle) {
533 k += ifClosed ? 2*absNp1 : 2*(absNp1-1);
543 kk =
new int[absNp1+absNp2];
546 for(
i=i1beg;
i<=i1end;
i++) {
559 for(
i=i2beg+1;
i<i2end;
i++) {
574 double cosPhi, sinPhi;
576 for(j=0; j<nVphi; j++) {
577 cosPhi =
cos(
phi+j*delPhi/nSphi);
578 sinPhi =
sin(
phi+j*delPhi/nSphi);
579 for(
i=i1beg;
i<=i2end;
i++) {
589 v2 = ifClosed ? nodeVis : 1;
590 for(
i=i1beg;
i<i1end;
i++) {
592 if (!ifClosed &&
i == i1end-1) {
595 v2 = (
r[
i] ==
r[
i+1] &&
r[
i+1] ==
r[
i+2]) ? -1 : nodeVis;
598 edgeVis, ifWholeCircle, nSphi,
k);
602 edgeVis, ifWholeCircle, nSphi,
k);
608 v2 = ifClosed ? nodeVis : 1;
609 for(
i=i2beg;
i<i2end;
i++) {
611 if (!ifClosed &&
i==i2end-1) {
614 v2 = (
r[
i] ==
r[
i+1] &&
r[
i+1] ==
r[
i+2]) ? -1 : nodeVis;
617 edgeVis, ifWholeCircle, nSphi,
k);
621 edgeVis, ifWholeCircle, nSphi,
k);
630 -1, ifWholeCircle, nSphi,
k);
634 -1, ifWholeCircle, nSphi,
k);
640 if (!ifWholeCircle) {
645 for (
i=i1beg;
i<=i1end;
i++) {
647 ii[3] = (
i == i1end) ? i1beg :
i+1;
648 ii[1] = (absNp2 == 1) ? i2beg : ii[0]+absNp1;
649 ii[2] = (absNp2 == 1) ? i2beg : ii[3]+absNp1;
657 for (
i=i1beg;
i<i1end;
i++) {
660 ii[1] = (absNp2 == 1) ? i2beg : ii[0]+absNp1;
661 ii[2] = (absNp2 == 1) ? i2beg : ii[3]+absNp1;
662 vv[0] = (
i == i1beg) ? 1 : -1;
664 vv[2] = (
i == i1end-1) ? 1 : -1;
675 <<
"Polyhedron::RotateAroundZ: number of generated faces ("
676 <<
k-1 <<
") is not equal to the number of allocated faces ("
◆ RotateEdge()
void SbPolyhedron::RotateEdge |
( |
int |
k1, |
|
|
int |
k2, |
|
|
double |
r1, |
|
|
double |
r2, |
|
|
int |
v1, |
|
|
int |
v2, |
|
|
int |
vEdge, |
|
|
bool |
ifWholeCircle, |
|
|
int |
ns, |
|
|
int & |
kface |
|
) |
| |
|
protectedinherited |
Definition at line 306 of file SbPolyhedron.cxx.
328 if (r1 == 0. && r2 == 0)
return;
333 int ii1 = ifWholeCircle ? i1 : i1+
ns;
334 int ii2 = ifWholeCircle ? i2 : i2+
ns;
335 int vv = ifWholeCircle ? vEdge : 1;
340 }
else if (r2 == 0.) {
343 m_pF[kface++] =
SbFacet(i1,0,
v2*i2,0, (i2+1),0, v1*(i1+1),0);
348 for (i2++,
i=1;
i<
ns-1; i2++,
i++) {
349 m_pF[kface++] =
SbFacet(vEdge*i1,0,
v2*i2,0, vEdge*(i2+1),0);
352 }
else if (r2 == 0.) {
354 for (i1++,
i=1;
i<
ns-1; i1++,
i++) {
355 m_pF[kface++] =
SbFacet(vEdge*i1,0, vEdge*i2,0, v1*(i1+1),0);
360 for (i1++,i2++,
i=1;
i<
ns-1; i1++,i2++,
i++) {
361 m_pF[kface++] =
SbFacet(vEdge*i1,0,
v2*i2,0, vEdge*(i2+1),0,v1*(i1+1),0);
◆ SetNumberOfRotationSteps()
void SbPolyhedron::SetNumberOfRotationSteps |
( |
int |
n | ) |
|
|
staticinherited |
Definition at line 245 of file SbPolyhedron.cxx.
258 <<
"SbPolyhedron::SetNumberOfRotationSteps: attempt to set the\n"
259 <<
"number of steps per circle < " << nMin <<
"; forced to " << nMin
◆ SetReferences()
void SbPolyhedron::SetReferences |
( |
| ) |
|
|
protectedinherited |
Definition at line 682 of file SbPolyhedron.cxx.
694 struct edgeListMember {
695 edgeListMember *
next;
699 } *edgeList, *freeList, **headList;
704 edgeList =
new edgeListMember[2*
m_nface];
705 headList =
new edgeListMember*[
m_nvert];
713 edgeList[
i].next = &edgeList[
i+1];
715 edgeList[2*
m_nface-1].next = 0;
719 int iface, iedge, nedge, i1, i2, k1, k2;
720 edgeListMember *prev, *
cur;
722 for(iface=1; iface<=
m_nface; iface++) {
724 for (iedge=0; iedge<nedge; iedge++) {
726 i2 = (iedge < nedge-1) ? iedge+1 : 0;
729 k1 = (i1 < i2) ? i1 : i2;
730 k2 = (i1 > i2) ? i1 : i2;
735 headList[k1] = freeList;
736 freeList = freeList->next;
746 headList[k1] =
cur->next;
747 cur->next = freeList;
755 <<
"Polyhedron::SetReferences: different edge visibility "
756 << iface <<
"/" << iedge <<
"/"
758 <<
cur->iface <<
"/" <<
cur->iedge <<
"/"
770 prev->next = freeList;
771 freeList = freeList->next;
781 prev->next =
cur->next;
782 cur->next = freeList;
790 <<
"Polyhedron::SetReferences: different edge visibility "
791 << iface <<
"/" << iedge <<
"/"
793 <<
cur->iface <<
"/" <<
cur->iedge <<
"/"
806 if (headList[
i] != 0) {
808 <<
"Polyhedron::SetReferences: List " <<
i <<
" is not empty"
◆ SetSideFacets()
void SbPolyhedron::SetSideFacets |
( |
int |
ii[4], |
|
|
int |
vv[4], |
|
|
int * |
kk, |
|
|
double * |
r, |
|
|
double |
dphi, |
|
|
int |
ns, |
|
|
int & |
kface |
|
) |
| |
|
protectedinherited |
Definition at line 368 of file SbPolyhedron.cxx.
390 for (
int i=0;
i<4;
i++) {
392 k2 = (
i == 3) ? ii[0] : ii[
i+1];
393 if (
r[k1] == 0. &&
r[k2] == 0.)
vv[
i] = -1;
397 if (ii[1] == ii[2]) {
402 if (
r[ii[0]] != 0.) k1 +=
ns;
403 if (
r[ii[2]] != 0.) k2 +=
ns;
404 if (
r[ii[3]] != 0.) k3 +=
ns;
406 }
else if (
kk[ii[0]] ==
kk[ii[1]]) {
411 if (
r[ii[0]] != 0.) k1 +=
ns;
412 if (
r[ii[2]] != 0.) k2 +=
ns;
413 if (
r[ii[3]] != 0.) k3 +=
ns;
415 }
else if (
kk[ii[2]] ==
kk[ii[3]]) {
420 if (
r[ii[0]] != 0.) k1 +=
ns;
421 if (
r[ii[1]] != 0.) k2 +=
ns;
422 if (
r[ii[2]] != 0.) k3 +=
ns;
430 if (
r[ii[0]] != 0.) k1 +=
ns;
431 if (
r[ii[1]] != 0.) k2 +=
ns;
432 if (
r[ii[2]] != 0.) k3 +=
ns;
433 if (
r[ii[3]] != 0.) k4 +=
ns;
◆ subtract()
◆ Transform()
◆ m_nface
int SbPolyhedron::m_nface |
|
protectedinherited |
◆ m_nvert
int SbPolyhedron::m_nvert |
|
protectedinherited |
◆ m_pF
◆ m_pV
◆ s_numberOfRotationSteps
The documentation for this class was generated from the following files:
HVNormal3D FindNodeNormal(int iFace, int iNode) const
static int s_numberOfRotationSteps
Scalar phi() const
phi method
bool GetNextVertexIndex(int &index, int &edgeFlag) const
bool GetNextEdgeIndeces(int &i1, int &i2, int &edgeFlag, int &iface1, int &iface2) const
void GetFacet(int iFace, int &n, int *iNodes, int *edgeFlags=0, int *iFaces=0) const
SbPolyhedronTrap(double Dz, double Theta, double Phi, double Dy1, double Dx1, double Dx2, double Alp1, double Dy2, double Dx3, double Dx4, double Alp2)
#define DEFAULT_NUMBER_OF_STEPS
virtual SbPolyhedron & operator=(const SbPolyhedron &from)
HVNormal3D GetNormal(int iFace) const
bool GetNextNormal(HVNormal3D &normal) const
void AllocateMemory(int Nvert, int Nface)
static int GetNumberOfRotationSteps()
@ RIGHT
the drift radius is positive (see Trk::AtaStraightLine)
HVNormal3D GetUnitNormal(int iFace) const
void SetSideFacets(int ii[4], int vv[4], int *kk, double *r, double dphi, int ns, int &kface)
def dot(G, fn, nodesToHighlight=[])
int FindNeighbour(int iFace, int iNode, int iOrder) const
void RotateEdge(int k1, int k2, double r1, double r2, int v1, int v2, int vEdge, bool ifWholeCircle, int ns, int &kface)
@ LEFT
the drift radius is negative (see Trk::AtaStraightLine)
struct SbFacet::@66 m_edge[4]