0024737: Coding - remove <br> tag from header files
[occt.git] / src / BRepMesh / BRepMesh_VertexInspector.hxx
1 // Created on: 2011-06-01
2 // Created by: Oleg AGASHIN
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 _BRepMesh_VertexInspector_HeaderFile
17 #define _BRepMesh_VertexInspector_HeaderFile
18
19 #include <BRepMesh_ListOfInteger.hxx> 
20 #include <Precision.hxx>
21 #include <gp_XY.hxx>
22 #include <gp_XYZ.hxx>
23 #include <NCollection_CellFilter.hxx>
24 #include <BRepMesh_Vertex.hxx>
25 #include <BRepMesh_VectorOfVertex.hxx>
26 #include <TColStd_Array1OfReal.hxx>
27 #include <BRepMesh_BaseAllocator.hxx>
28
29 //=======================================================================
30 //! The class to find in the coincidence points 
31 //=======================================================================
32
33 class BRepMesh_VertexInspector : public NCollection_CellFilter_InspectorXY
34 {
35 public:
36   typedef Standard_Integer Target;
37   //! Constructor; remembers tolerance and collector data structure.
38   //! theTol can be Real or Array1OfReal with two elements which describe
39   //! tolerance for each dimension.
40   BRepMesh_VertexInspector (const Standard_Integer nbComp,
41                             const BRepMesh_BaseAllocator& theAlloc);
42                             
43   BRepMesh_VertexInspector (const Standard_Integer nbComp,
44                             const Standard_Real    theTol,
45                             const BRepMesh_BaseAllocator& theAlloc);
46                             
47   BRepMesh_VertexInspector (const Standard_Integer nbComp,
48                             const Standard_Real    aTolX,
49                             const Standard_Real    aTolY,
50                             const BRepMesh_BaseAllocator& theAlloc);
51
52   Standard_Integer Add(const BRepMesh_Vertex& theVertex);
53   
54   void SetTolerance(const Standard_Real theTol)
55   {
56     myTol(0) = theTol*theTol;
57     myTol(1) = 0.;
58   }
59   
60   void SetTolerance(const Standard_Real theTolX, const Standard_Real theTolY)
61   {
62     myTol(0) = theTolX*theTolX;
63     myTol(1) = theTolY*theTolY;
64   }
65   
66   void Clear()
67   {
68     myVertices.Clear();
69     myDelNodes.Clear();
70   }
71
72   void Delete(const Standard_Integer theIndex)
73   {
74     myVertices(theIndex-1).SetMovability(BRepMesh_Deleted);
75     myDelNodes.Append(theIndex);
76   }
77   
78   Standard_Integer GetNbVertices() const
79   {
80     return myVertices.Length(); 
81   }
82
83   BRepMesh_Vertex& GetVertex(Standard_Integer theInd)
84   {
85     return myVertices(theInd-1);
86   }
87   
88   //! Set current node to be checked
89   void SetCurrent (const gp_XY& theCurVertex, const Standard_Boolean) 
90   { 
91     myResInd.Clear();
92     myCurrent = theCurVertex;
93   }
94
95   //!Get result index of node
96   const Standard_Integer GetCoincidentInd() const
97   {
98     if ( myResInd.Size() > 0 )
99     {
100       return myResInd.First();
101     }
102     return 0;
103   }
104   
105   const BRepMesh_ListOfInteger& GetListOfDelNodes() const
106   {
107     return myDelNodes;
108   }
109
110   //! Implementation of inspection method
111   NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget); 
112
113   static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget)
114   {
115     return (theIdx == theTarget);
116   }
117
118 private:
119   TColStd_Array1OfReal                 myTol;
120   BRepMesh_ListOfInteger               myResInd;
121   BRepMesh_VectorOfVertex              myVertices;
122   BRepMesh_ListOfInteger               myDelNodes;
123   gp_XY                                myCurrent;
124 };
125
126 #endif