// File: SMDS_PntHasher.lxx // Created: Wed Jan 23 14:07:00 2002 // Author: Jean-Michel BOULCOURT // #include static Standard_Real tab1[3]; static Standard_Real tab2[3]; //======================================================================= //function : HashCode //purpose : //======================================================================= inline Standard_Integer SMDS_PntHasher::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); } //======================================================================= //function : IsEqual //purpose : //======================================================================= inline Standard_Boolean SMDS_PntHasher::IsEqual (const gp_Pnt& point1, const gp_Pnt& point2) { point1.Coord(tab1[0],tab1[1],tab1[2]); point2.Coord(tab2[0],tab2[1],tab2[2]); return (memcmp(tab1,tab2,sizeof(tab1)) == 0); }