1 // Created on: 2005-02-14
2 // Created by: Alexey MORENOV
3 // Copyright (c) 2005-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.
21 #ifndef ShapeAnalysis_BoxBndTree_HeaderFile
22 #define ShapeAnalysis_BoxBndTree_HeaderFile
24 #include <NCollection_UBTree.hxx>
25 #include <Bnd_Box.hxx>
27 #include <MMgt_TShared.hxx>
28 #include <TopTools_HArray1OfShape.hxx>
30 #include <ShapeExtend.hxx>
31 #include <ShapeExtend_Status.hxx>
32 #include <TopoDS_Vertex.hxx>
33 #include <TColStd_MapOfInteger.hxx>
34 #include <TColStd_Array1OfInteger.hxx>
36 typedef NCollection_UBTree <Standard_Integer , Bnd_Box> ShapeAnalysis_BoxBndTree;
38 class ShapeAnalysis_BoxBndTreeSelector
39 : public ShapeAnalysis_BoxBndTree::Selector
42 ShapeAnalysis_BoxBndTreeSelector
43 (Handle (TopTools_HArray1OfShape) theSeq,
44 Standard_Boolean theShared)
45 : mySeq(theSeq), myShared(theShared), myNb(0), myTol(1e-7), myMin3d(1e-7),myArrIndices(1,2),
46 myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK))
51 void DefineBoxes (const Bnd_Box& theFBox, const Bnd_Box& theLBox)
58 void DefineVertexes (TopoDS_Vertex theVf, TopoDS_Vertex theVl)
61 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
64 void DefinePnt (gp_Pnt theFPnt, gp_Pnt theLPnt)
67 myStatus =ShapeExtend::EncodeStatus (ShapeExtend_OK);
70 Standard_Integer GetNb ()
73 void SetNb (Standard_Integer theNb)
76 void LoadList(Standard_Integer elem)
80 { myStop = Standard_False; }
82 void SetTolerance (Standard_Real theTol)
86 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
89 Standard_Boolean ContWire(Standard_Integer nbWire)
90 { return myList.Contains(nbWire); }
92 inline Standard_Boolean LastCheckStatus (const ShapeExtend_Status Status) const
93 { return ShapeExtend::DecodeStatus ( myStatus, Status ); }
95 Standard_Boolean Reject (const Bnd_Box& theBnd) const;
96 Standard_Boolean Accept (const Standard_Integer &);
101 Handle (TopTools_HArray1OfShape) mySeq;
102 Standard_Boolean myShared;
103 Standard_Integer myNb;
104 TopoDS_Vertex myFVertex;
105 TopoDS_Vertex myLVertex;
108 TColStd_MapOfInteger myList;
110 Standard_Real myMin3d;
111 TColStd_Array1OfInteger myArrIndices;
112 Standard_Integer myStatus;