0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_VertexInspector.hxx
1 // Created on: 2011-11-24
2 // Created by: ANNA MASALSKAYA
3 // Copyright (c) 2011-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _BRepBuilderAPI_VertexInspector_Header
17 #define _BRepBuilderAPI_VertexInspector_Header
18
19 #include <TColStd_ListOfInteger.hxx>
20 #include <NCollection_Vector.hxx>
21 #include <gp_XY.hxx>
22 #include <gp_XYZ.hxx>
23 #include <NCollection_CellFilter.hxx>
24
25 typedef NCollection_Vector<gp_XYZ> VectorOfPoint;
26
27 //=======================================================================
28 //! Class BRepBuilderAPI_VertexInspector 
29 //!   derived from NCollection_CellFilter_InspectorXYZ
30 //!   This class define the Inspector interface for CellFilter algorithm, 
31 //!   working with gp_XYZ points in 3d space.
32 //!   Used in search of coincidence points with a certain tolerance.
33 //=======================================================================
34
35 class BRepBuilderAPI_VertexInspector : public NCollection_CellFilter_InspectorXYZ
36 {
37 public:
38   typedef Standard_Integer Target;
39   //! Constructor; remembers the tolerance
40   BRepBuilderAPI_VertexInspector (const Standard_Real theTol):myTol(theTol*theTol)
41   {}
42
43   //! Keep the points used for comparison
44   void Add (const gp_XYZ& thePnt)
45   {
46     myPoints.Append (thePnt);
47   }
48   
49   //! Clear the list of adjacent points
50   void ClearResList()
51   {
52     myResInd.Clear();
53   }
54   
55   //! Set current point to search for coincidence
56   void SetCurrent (const gp_XYZ& theCurPnt)
57   { 
58     myCurrent = theCurPnt;
59   }
60
61   //! Get list of indexes of points adjacent with the current
62   const TColStd_ListOfInteger& ResInd()
63   {
64     return myResInd;
65   }
66
67   //! Implementation of inspection method
68   Standard_EXPORT NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget); 
69
70 private:
71   Standard_Real myTol;
72   TColStd_ListOfInteger myResInd;
73   VectorOfPoint myPoints;
74   gp_XYZ myCurrent;
75 };
76
77 #endif