0022627: Change OCCT memory management defaults
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_VertexInspector.hxx
CommitLineData
82192477 1// File: BRepBuilderAPI_VertexInspector.hxx
2// Created: Nov 24 16:48:12 2011
3// Author: ANNA MASALSKAYA
4// Copyright: Open CASCADE SAS 2011
5
6#ifndef _BRepBuilderAPI_VertexInspector_Header
7#define _BRepBuilderAPI_VertexInspector_Header
8
9#ifndef _TColStd_ListOfInteger_HeaderFile
10#include <TColStd_ListOfInteger.hxx>
11#endif
12#ifndef NCollection_Vector_HeaderFile
13#include <NCollection_Vector.hxx>
14#endif
15#ifndef _gp_XY_HeaderFile
16#include <gp_XY.hxx>
17#endif
18#ifndef _gp_XYZ_HeaderFile
19#include <gp_XYZ.hxx>
20#endif
21
22#ifndef NCollection_CellFilter_HeaderFile
23#include <NCollection_CellFilter.hxx>
24#endif
25
26typedef NCollection_Vector<gp_XYZ> VectorOfPoint;
27
28//=======================================================================
29//! Class BRepBuilderAPI_VertexInspector
30//! derived from NCollection_CellFilter_InspectorXYZ
31//! This class define the Inspector interface for CellFilter algorithm,
32//! working with gp_XYZ points in 3d space.
33//! Used in search of coincidence points with a certain tolerance.
34//=======================================================================
35
36class BRepBuilderAPI_VertexInspector : public NCollection_CellFilter_InspectorXYZ
37{
38public:
39 typedef Standard_Integer Target;
40 //! Constructor; remembers the tolerance
41 BRepBuilderAPI_VertexInspector (const Standard_Real theTol)
42 : myTol(theTol*theTol)
43 {}
44
45 //! Keep the points used for comparison
46 void Add (const gp_XYZ& thePnt)
47 {
48 myPoints.Append (thePnt);
49 }
50
51 //! Clear the list of adjacent points
52 void ClearResList()
53 {
54 myResInd.Clear();
55 }
56
57 //! Set current point to search for coincidence
58 void SetCurrent (const gp_XYZ& theCurPnt)
59 {
60 myCurrent = theCurPnt;
61 }
62
63 //! Get list of indexes of points adjacent with the current
64 const TColStd_ListOfInteger& ResInd()
65 {
66 return myResInd;
67 }
68
69 //! Implementation of inspection method
70 NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget);
71
72private:
73 Standard_Real myTol;
74 TColStd_ListOfInteger myResInd;
75 VectorOfPoint myPoints;
76 gp_XYZ myCurrent;
77};
78
79#endif