summaryrefslogtreecommitdiff
path: root/inc/BRepMesh_CircleInspector.hxx
blob: d20f1fcf0810455920c2762ed851af850fa3f5d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// File:        BRepMesh_CircleInspector.hxx
// Created:     May 26 16:40:53 2008
// Author:      Ekaterina SMIRNOVA
// Copyright:   Open CASCADE SAS 2008


#ifndef BRepMesh_CircleInspector_Header
#define BRepMesh_CircleInspector_Header

#include <BRepMesh_Circ.hxx>

#include <BRepMesh_ListOfInteger.hxx>
#include <Precision.hxx>
#include <gp_XY.hxx>
#include <gp_XYZ.hxx>

#include <NCollection_CellFilter.hxx>
#include <NCollection_Vector.hxx>

typedef NCollection_Vector<BRepMesh_Circ> CircVector;

//=======================================================================
//! The class to find in the coincidence points 
//=======================================================================

class BRepMesh_CircleInspector : public NCollection_CellFilter_InspectorXY
{
public:
  typedef Standard_Integer Target;
  //! Constructor; remembers tolerance and collector data structure.
  //! All the found points are put in the map and excluded from further
  //! consideration.
  BRepMesh_CircleInspector (Standard_Real theTol,
    Standard_Integer nbComp,
    const BRepMesh_BaseAllocator& theAlloc);

  void Add(Standard_Integer theInd,const BRepMesh_Circ& theCircle)
  {
    myInitCircle.SetValue(theInd, theCircle);
  }

  void ClerResList()
  {
    myResInd.Clear();
  }

  CircVector& MapOfCirc()
  {
    return myInitCircle; 
  }

  BRepMesh_Circ& GetCirc(Standard_Integer theInd)
  {
    return myInitCircle(theInd);
  }

  //! Set current node to be checked
  void SetCurrent (const gp_XY& theCurCircle) 
  { 
    myCurrent = theCurCircle;
  }

  //!Get result index of node
  BRepMesh_ListOfInteger& GetCoincidentInd()
  {
    return myResInd;
  }

  //! Implementation of inspection method
  NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget); 

  static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget)
  {
    return (theIdx == theTarget);
  }

private:
  Standard_Real                        myTol;
  BRepMesh_ListOfInteger               myResInd;
  CircVector                           myInitCircle;
  gp_XY                                myCurrent;
};

#endif