Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
std::hash< G4Polyhedron > Struct Reference

#include <G4VVtkPipeline.hh>

Public Member Functions

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

Detailed Description

Definition at line 91 of file G4VVtkPipeline.hh.

Member Function Documentation

◆ operator()()

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

Definition at line 93 of file G4VVtkPipeline.hh.

94 {
95 using std::hash;
96 using std::size_t;
97
98 G4bool notLastFace;
99 G4Point3D vertex[4];
100 G4int edgeFlag[4];
101 G4Normal3D normals[4];
102 G4int nEdges;
103
104 std::size_t h = 0;
105
106 do {
107 notLastFace = ph.GetNextFacet(nEdges, vertex, edgeFlag, normals);
108
109 for (int i = 0; i < nEdges; i++) {
110 std::size_t hx = std::hash<double>()(vertex[i].x());
111 std::size_t hy = std::hash<double>()(vertex[i].y());
112 std::size_t hz = std::hash<double>()(vertex[i].z());
113 std::hash_combine(h, hx);
114 std::hash_combine(h, hy);
115 std::hash_combine(h, hz);
116 }
117 } while (notLastFace);
118
119 return h;
120 }
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: