Geant4-11
Public Member Functions
std::hash< G4Polyhedron > Struct Reference

Public Member Functions

std::size_t operator() (const G4Polyhedron &ph) const
 

Detailed Description

Definition at line 84 of file G4VtkSceneHandler.cc.

Member Function Documentation

◆ operator()()

std::size_t std::hash< G4Polyhedron >::operator() ( const G4Polyhedron ph) const
inline

Definition at line 85 of file G4VtkSceneHandler.cc.

85 {
86 using std::size_t;
87 using std::hash;
88
89 G4bool notLastFace;
90 G4Point3D vertex[4];
91 G4int edgeFlag[4];
92 G4Normal3D normals[4];
93 G4int nEdges;
94
95 std::size_t h = 0;
96
97 do {
98 notLastFace = ph.GetNextFacet(nEdges, vertex, edgeFlag, normals);
99
100 for (int i = 0; i < nEdges; i++) {
101 std::size_t hx = std::hash<double>()(vertex[i].x());
102 std::size_t hy = std::hash<double>()(vertex[i].y());
103 std::size_t hz = std::hash<double>()(vertex[i].z());
104 std::hash_combine(h,hx);
105 std::hash_combine(h,hy);
106 std::hash_combine(h,hz);
107 }
108 } while (notLastFace);
109
110 return h;
111 }
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4bool GetNextFacet(G4int &n, G4Point3D *nodes, G4int *edgeFlags=0, G4Normal3D *normals=0) const
void hash_combine(std::size_t)
static unsigned long FASTCALL hash(XML_Parser parser, KEY s)
Definition: xmlparse.cc:5967

References HepPolyhedron::GetNextFacet(), hash(), std::hash_combine(), HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().


The documentation for this struct was generated from the following file: