Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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=nullptr, G4Normal3D *normals=nullptr) const
void hash_combine(std::size_t)

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