summaryrefslogtreecommitdiff
path: root/inc/STEPConstruct_PointHasher.lxx
blob: 710fc5f4e3c704f9750bf3f430379c7b76e585c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//=======================================================================
//function : HashCode
//purpose  : 
//=======================================================================
inline Standard_Integer STEPConstruct_PointHasher::HashCode
  (const gp_Pnt& point, const Standard_Integer Upper)
{
  union 
    {
    Standard_Real R[3];
    Standard_Integer I[6];
    } U;

  point.Coord(U.R[0],U.R[1],U.R[2]);  

  return ::HashCode(U.I[0]/23+U.I[1]/19+U.I[2]/17+U.I[3]/13+U.I[4]/11+U.I[5]/7,Upper);
  //  return ::HashCode((U.I[0]>>4)+(U.I[1]>>3)+(U.I[2]>>2)+(U.I[3]>>1)+(U.I[4]>>4)+(U.I[5]>>3),Upper);

}