1 // Created on: 2011-06-01
2 // Created by: Oleg AGASHIN
3 // Copyright (c) 2011-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #ifndef _BRepMesh_VertexInspector_HeaderFile
23 #define _BRepMesh_VertexInspector_HeaderFile
25 #include <BRepMesh_ListOfInteger.hxx>
26 #ifndef _Precision_HeaderFile
27 #include <Precision.hxx>
29 #ifndef _gp_XY_HeaderFile
32 #ifndef _gp_XYZ_HeaderFile
36 #ifndef NCollection_CellFilter_HeaderFile
37 #include <NCollection_CellFilter.hxx>
39 #ifndef _BRepMesh_Vertex_HeaderFile
40 #include <BRepMesh_Vertex.hxx>
42 #ifndef _BRepMesh_VectorOfVertex_HeaderFile
43 #include <BRepMesh_VectorOfVertex.hxx>
45 #ifndef _TColStd_Array1OfReal_HeaderFile
46 #include <TColStd_Array1OfReal.hxx>
48 #include <BRepMesh_BaseAllocator.hxx>
50 //=======================================================================
51 //! The class to find in the coincidence points
52 //=======================================================================
54 class BRepMesh_VertexInspector : public NCollection_CellFilter_InspectorXY
57 typedef Standard_Integer Target;
58 //! Constructor; remembers tolerance and collector data structure.
59 //! theTol can be Real or Array1OfReal with two elements which describe
60 //! tolerance for each dimension.
61 BRepMesh_VertexInspector (const Standard_Integer nbComp,
62 const BRepMesh_BaseAllocator& theAlloc);
64 BRepMesh_VertexInspector (const Standard_Integer nbComp,
65 const Standard_Real theTol,
66 const BRepMesh_BaseAllocator& theAlloc);
68 BRepMesh_VertexInspector (const Standard_Integer nbComp,
69 const Standard_Real aTolX,
70 const Standard_Real aTolY,
71 const BRepMesh_BaseAllocator& theAlloc);
73 Standard_Integer Add(const BRepMesh_Vertex& theVertex);
75 void SetTolerance(const Standard_Real theTol)
77 myTol(0) = theTol*theTol;
81 void SetTolerance(const Standard_Real theTolX, const Standard_Real theTolY)
83 myTol(0) = theTolX*theTolX;
84 myTol(1) = theTolY*theTolY;
93 void Delete(const Standard_Integer theIndex)
95 myVertices(theIndex-1).SetMovability(BRepMesh_Deleted);
96 myDelNodes.Append(theIndex);
99 Standard_Integer GetNbVertices() const
101 return myVertices.Length();
104 BRepMesh_Vertex& GetVertex(Standard_Integer theInd)
106 return myVertices(theInd-1);
109 //! Set current node to be checked
110 void SetCurrent (const gp_XY& theCurVertex, const Standard_Boolean theExactVal = Standard_False)
113 myCurrent = theCurVertex;
116 //!Get result index of node
117 const Standard_Integer GetCoincidentInd() const
119 if ( myResInd.Size() > 0 )
121 return myResInd.First();
126 const BRepMesh_ListOfInteger& GetListOfDelNodes() const
131 //! Implementation of inspection method
132 NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget);
134 static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget)
136 return (theIdx == theTarget);
140 TColStd_Array1OfReal myTol;
141 BRepMesh_ListOfInteger myResInd;
142 BRepMesh_VectorOfVertex myVertices;
143 BRepMesh_ListOfInteger myDelNodes;