Commit | Line | Data |
---|---|---|
0d88155b O |
1 | // File: BRepMesh_Vertex.cxx |
2 | // Created: Thu Sep 23 12:46:51 1993 | |
3 | // Author: Didier PIFFAULT | |
4 | // <dpf@zerox> | |
7fd59977 | 5 | |
6 | #include <BRepMesh_Vertex.ixx> | |
7 | #include <Precision.hxx> | |
8 | ||
9 | ||
10 | BRepMesh_Vertex::BRepMesh_Vertex() | |
0d88155b | 11 | : myLocation(0), myMovability(BRepMesh_Free) |
7fd59977 | 12 | {} |
13 | ||
14 | BRepMesh_Vertex::BRepMesh_Vertex(const gp_XY& UV, | |
0d88155b O |
15 | const Standard_Integer Locat3d, |
16 | const BRepMesh_DegreeOfFreedom Move) | |
17 | : myUV(UV), myLocation(Locat3d), myMovability(Move) | |
7fd59977 | 18 | {} |
19 | ||
20 | BRepMesh_Vertex::BRepMesh_Vertex(const Standard_Real U, | |
0d88155b O |
21 | const Standard_Real V, |
22 | const BRepMesh_DegreeOfFreedom Move) | |
23 | : myUV(U, V), myLocation(0), myMovability(Move) | |
7fd59977 | 24 | {} |
25 | ||
26 | void BRepMesh_Vertex::Initialize(const gp_XY& UV, | |
0d88155b O |
27 | const Standard_Integer Locat3d, |
28 | const BRepMesh_DegreeOfFreedom Move) | |
7fd59977 | 29 | { |
30 | myUV=UV; | |
31 | myLocation=Locat3d; | |
32 | myMovability=Move; | |
33 | } | |
34 | ||
0d88155b | 35 | void BRepMesh_Vertex::SetMovability(const BRepMesh_DegreeOfFreedom Move) |
7fd59977 | 36 | { |
37 | myMovability=Move; | |
38 | } | |
39 | ||
40 | //======================================================================= | |
41 | //function : HashCode IsEqual | |
42 | //purpose : Services for Map | |
43 | //======================================================================= | |
44 | Standard_Integer BRepMesh_Vertex::HashCode(const Standard_Integer Upper)const | |
45 | { | |
46 | return ::HashCode (Floor(1e5*myUV.X())*Floor(1e5*myUV.Y()), Upper); | |
47 | } | |
48 | ||
49 | Standard_Boolean BRepMesh_Vertex::IsEqual(const BRepMesh_Vertex& Other)const | |
50 | { | |
0d88155b | 51 | if (myMovability!=BRepMesh_Deleted && Other.myMovability!=BRepMesh_Deleted) |
7fd59977 | 52 | return (myUV.IsEqual(Other.myUV, Precision::PConfusion())); |
53 | return Standard_False; | |
54 | } | |
55 |