a4d315c3da2b81dd5231b765ea3b6cf52db7ae4c
[occt.git] / src / MeshAlgo / MeshAlgo_CircleInspector.hxx
1 // File:        MeshAlgo_CircleInspector.hxx
2 // Created:     May 26 16:40:53 2008
3 // Author:      Ekaterina SMIRNOVA
4 // Copyright: Open CASCADE SAS 2008
5
6
7 #ifndef MeshAlgo_CircleInspector_Header
8 #define MeshAlgo_CircleInspector_Header
9
10 #include <MeshAlgo_Circ.hxx>
11
12 #include <MeshDS_ListOfInteger.hxx>
13 #include <Precision.hxx>
14 #include <gp_XY.hxx>
15 #include <gp_XYZ.hxx>
16
17 #include <NCollection_CellFilter.hxx>
18 #include <NCollection_Vector.hxx>
19
20 typedef NCollection_Vector<MeshAlgo_Circ> CircVector;
21
22 //=======================================================================
23 //! The class to find in the coincidence points 
24 //=======================================================================
25
26 class MeshAlgo_CircleInspector : public NCollection_CellFilter_InspectorXY
27 {
28 public:
29   typedef Standard_Integer Target;
30   //! Constructor; remembers tolerance and collector data structure.
31   //! All the found points are put in the map and excluded from further
32   //! consideration.
33   MeshAlgo_CircleInspector (Standard_Real theTol,
34                             Standard_Integer nbComp,
35                             const MeshDS_BaseAllocator& theAlloc);
36
37   void Add(Standard_Integer theInd,const MeshAlgo_Circ& theCircle)
38   {
39     myInitCircle.SetValue(theInd, theCircle);
40   }
41
42   void ClerResList()
43   {
44     myResInd.Clear();
45   }
46   
47   CircVector& MapOfCirc()
48   {
49     return myInitCircle; 
50   }
51   
52   MeshAlgo_Circ& GetCirc(Standard_Integer theInd)
53   {
54     return myInitCircle(theInd);
55   }
56
57   //! Set current node to be checked
58   void SetCurrent (const gp_XY& theCurCircle) 
59   { 
60     myCurrent = theCurCircle;
61   }
62
63   //!Get result index of node
64   MeshDS_ListOfInteger& GetCoincidentInd()
65   {
66     return myResInd;
67   }
68
69    //! Implementation of inspection method
70   NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget); 
71   
72   static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget)
73   {
74     return (theIdx == theTarget);
75   }
76
77 private:
78   Standard_Real                        myTol;
79   MeshDS_ListOfInteger                 myResInd;
80   CircVector                           myInitCircle;
81   gp_XY                                myCurrent;
82 };
83
84 #endif