0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / BRepMesh / BRepMesh_CircleInspector.hxx
CommitLineData
b311480e 1// Created on: 2008-05-26
2// Created by: Ekaterina SMIRNOVA
3// Copyright (c) 2008-2012 OPEN CASCADE SAS
4//
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.
9//
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.
12//
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.
19
0d88155b
O
20
21
22#ifndef BRepMesh_CircleInspector_Header
23#define BRepMesh_CircleInspector_Header
24
25#include <BRepMesh_Circ.hxx>
26
27#include <BRepMesh_ListOfInteger.hxx>
28#include <Precision.hxx>
29#include <gp_XY.hxx>
30#include <gp_XYZ.hxx>
31
32#include <NCollection_CellFilter.hxx>
33#include <NCollection_Vector.hxx>
34
35typedef NCollection_Vector<BRepMesh_Circ> CircVector;
36
37//=======================================================================
38//! The class to find in the coincidence points
39//=======================================================================
40
41class BRepMesh_CircleInspector : public NCollection_CellFilter_InspectorXY
42{
43public:
44 typedef Standard_Integer Target;
45 //! Constructor; remembers tolerance and collector data structure.
46 //! All the found points are put in the map and excluded from further
47 //! consideration.
48 BRepMesh_CircleInspector (Standard_Real theTol,
49 Standard_Integer nbComp,
50 const BRepMesh_BaseAllocator& theAlloc);
51
52 void Add(Standard_Integer theInd,const BRepMesh_Circ& theCircle)
53 {
54 myInitCircle.SetValue(theInd, theCircle);
55 }
56
57 void ClerResList()
58 {
59 myResInd.Clear();
60 }
61
62 CircVector& MapOfCirc()
63 {
64 return myInitCircle;
65 }
66
67 BRepMesh_Circ& GetCirc(Standard_Integer theInd)
68 {
69 return myInitCircle(theInd);
70 }
71
72 //! Set current node to be checked
73 void SetCurrent (const gp_XY& theCurCircle)
74 {
75 myCurrent = theCurCircle;
76 }
77
78 //!Get result index of node
79 BRepMesh_ListOfInteger& GetCoincidentInd()
80 {
81 return myResInd;
82 }
83
84 //! Implementation of inspection method
85 NCollection_CellFilter_Action Inspect (const Standard_Integer theTarget);
86
87 static Standard_Boolean IsEqual (Standard_Integer theIdx, const Standard_Integer theTarget)
88 {
89 return (theIdx == theTarget);
90 }
91
92private:
93 Standard_Real myTol;
94 BRepMesh_ListOfInteger myResInd;
95 CircVector myInitCircle;
96 gp_XY myCurrent;
97};
98
99#endif