7fd59977 |
1 | // File: MeshAlgo_IndexedPntComparator.gxx |
2 | // Created: Tue Apr 5 11:50:40 1994 |
3 | // Author: Didier PIFFAULT |
4 | // <dpf@zerox> |
5 | |
6 | //======================================================================= |
7 | //function : MeshAlgo_IndexedPntComparator |
8 | //purpose : |
9 | //======================================================================= |
10 | |
11 | #include <BRepMesh_Vertex.hxx> |
12 | |
13 | |
14 | MeshAlgo_IndexedPntComparator::MeshAlgo_IndexedPntComparator |
15 | (const Direction& theDir, |
16 | const Standard_Real theTol, |
17 | const HandledStructureOfPnt& HDS) |
18 | : IndexedStructure(HDS),DirectionOfSort(theDir), Tolerance(theTol) |
19 | {} |
20 | |
21 | //======================================================================= |
22 | //function : IsLower |
23 | //purpose : |
24 | //======================================================================= |
25 | |
26 | Standard_Boolean MeshAlgo_IndexedPntComparator::IsLower |
27 | (const Standard_Integer Left, const Standard_Integer Right) const |
28 | { |
29 | return ((IndexedStructure->GetNode(Left).Coord()*DirectionOfSort) < |
30 | (IndexedStructure->GetNode(Right).Coord()*DirectionOfSort)); |
31 | } |
32 | |
33 | //======================================================================= |
34 | //function : IsGreater |
35 | //purpose : |
36 | //======================================================================= |
37 | |
38 | Standard_Boolean MeshAlgo_IndexedPntComparator::IsGreater |
39 | (const Standard_Integer Left, const Standard_Integer Right) const |
40 | { |
41 | return ((IndexedStructure->GetNode(Left).Coord()*DirectionOfSort) > |
42 | (IndexedStructure->GetNode(Right).Coord()*DirectionOfSort)); |
43 | } |
44 | |
45 | //======================================================================= |
46 | //function : IsEqual |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | Standard_Boolean MeshAlgo_IndexedPntComparator::IsEqual |
51 | (const Standard_Integer Left, const Standard_Integer Right) const |
52 | { |
53 | return (IndexedStructure->GetNode(Left).Coord().IsEqual |
54 | (IndexedStructure->GetNode(Right).Coord(), Tolerance)); |
55 | } |
56 | |