Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2008-05-26 |
2 | // Created by: Ekaterina SMIRNOVA | |
973c2be1 | 3 | // Copyright (c) 2008-2014 OPEN CASCADE SAS |
b311480e | 4 | // |
973c2be1 | 5 | // This file is part of Open CASCADE Technology software library. |
b311480e | 6 | // |
d5f74e42 | 7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published | |
973c2be1 | 9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT | |
11 | // distribution for complete text of the license and disclaimer of any warranty. | |
b311480e | 12 | // |
973c2be1 | 13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. | |
0d88155b O |
15 | |
16 | #ifndef BRepMesh_CircleInspector_Header | |
17 | #define BRepMesh_CircleInspector_Header | |
18 | ||
19 | #include <BRepMesh_Circ.hxx> | |
20 | ||
21 | #include <BRepMesh_ListOfInteger.hxx> | |
22 | #include <Precision.hxx> | |
23 | #include <gp_XY.hxx> | |
24 | #include <gp_XYZ.hxx> | |
25 | ||
26 | #include <NCollection_CellFilter.hxx> | |
27 | #include <NCollection_Vector.hxx> | |
28 | ||
29 | typedef NCollection_Vector<BRepMesh_Circ> CircVector; | |
30 | ||
31 | //======================================================================= | |
32 | //! The class to find in the coincidence points | |
33 | //======================================================================= | |
34 | ||
35 | class BRepMesh_CircleInspector : public NCollection_CellFilter_InspectorXY | |
36 | { | |
37 | public: | |
38 | typedef Standard_Integer Target; | |
39 | //! Constructor; remembers tolerance and collector data structure. | |
40 | //! All the found points are put in the map and excluded from further | |
41 | //! consideration. | |
42 | BRepMesh_CircleInspector (Standard_Real theTol, | |
43 | Standard_Integer nbComp, | |
44 | const BRepMesh_BaseAllocator& theAlloc); | |
45 | ||
46 | void Add(Standard_Integer theInd,const BRepMesh_Circ& theCircle) | |
47 | { | |
48 | myInitCircle.SetValue(theInd, theCircle); | |
49 | } | |
50 | ||
51 | void ClerResList() | |
52 | { | |
53 | myResInd.Clear(); | |
54 | } | |
55 | ||
56 | CircVector& MapOfCirc() | |
57 | { | |
58 | return myInitCircle; | |
59 | } | |
60 | ||
61 | BRepMesh_Circ& GetCirc(Standard_Integer theInd) | |
62 | { | |
63 | return myInitCircle(theInd); | |
64 | } | |
65 | ||
66 | //! Set current node to be checked | |
67 | void SetCurrent (const gp_XY& theCurCircle) | |
68 | { | |
69 | myCurrent = theCurCircle; | |
70 | } | |
71 | ||
72 | //!Get result index of node | |
73 | BRepMesh_ListOfInteger& GetCoincidentInd() | |
74 | { | |
75 | return myResInd; | |
76 | } | |
77 | ||
78 | //! Implementation of inspection method | |
79 | NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget); | |
80 | ||
81 | static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget) | |
82 | { | |
83 | return (theIdx == theTarget); | |
84 | } | |
85 | ||
86 | private: | |
87 | Standard_Real myTol; | |
88 | BRepMesh_ListOfInteger myResInd; | |
89 | CircVector myInitCircle; | |
90 | gp_XY myCurrent; | |
91 | }; | |
92 | ||
93 | #endif |