1 // Created on: 2005-02-14
2 // Created by: Alexey MORENOV
3 // Copyright (c) 2005-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef ShapeAnalysis_BoxBndTree_HeaderFile
17 #define ShapeAnalysis_BoxBndTree_HeaderFile
19 #include <NCollection_UBTree.hxx>
20 #include <Bnd_Box.hxx>
22 #include <Standard_Transient.hxx>
23 #include <TopTools_HArray1OfShape.hxx>
25 #include <ShapeExtend.hxx>
26 #include <ShapeExtend_Status.hxx>
27 #include <TopoDS_Vertex.hxx>
28 #include <TColStd_MapOfInteger.hxx>
29 #include <TColStd_Array1OfInteger.hxx>
31 typedef NCollection_UBTree <Standard_Integer , Bnd_Box> ShapeAnalysis_BoxBndTree;
33 class ShapeAnalysis_BoxBndTreeSelector
34 : public ShapeAnalysis_BoxBndTree::Selector
37 ShapeAnalysis_BoxBndTreeSelector
38 (Handle (TopTools_HArray1OfShape) theSeq,
39 Standard_Boolean theShared)
40 : mySeq(theSeq), myShared(theShared), myNb(0), myTol(1e-7), myMin3d(1e-7),myArrIndices(1,2),
41 myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK))
46 void DefineBoxes (const Bnd_Box& theFBox, const Bnd_Box& theLBox)
53 void DefineVertexes (TopoDS_Vertex theVf, TopoDS_Vertex theVl)
56 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
59 void DefinePnt (gp_Pnt theFPnt, gp_Pnt theLPnt)
62 myStatus =ShapeExtend::EncodeStatus (ShapeExtend_OK);
65 Standard_Integer GetNb ()
68 void SetNb (Standard_Integer theNb)
71 void LoadList(Standard_Integer elem)
75 { myStop = Standard_False; }
77 void SetTolerance (Standard_Real theTol)
81 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
84 Standard_Boolean ContWire(Standard_Integer nbWire)
85 { return myList.Contains(nbWire); }
87 inline Standard_Boolean LastCheckStatus (const ShapeExtend_Status theStatus) const
88 { return ShapeExtend::DecodeStatus ( myStatus, theStatus ); }
90 Standard_Boolean Reject (const Bnd_Box& theBnd) const;
91 Standard_Boolean Accept (const Standard_Integer &);
96 Handle (TopTools_HArray1OfShape) mySeq;
97 Standard_Boolean myShared;
98 Standard_Integer myNb;
99 TopoDS_Vertex myFVertex;
100 TopoDS_Vertex myLVertex;
103 TColStd_MapOfInteger myList;
105 Standard_Real myMin3d;
106 TColStd_Array1OfInteger myArrIndices;
107 Standard_Integer myStatus;