1 // File: ShapeAnalysis_BoxBndTree.hxx
2 // Created: 14.02.05 12:38:56
3 // Author: Alexey MORENOV
4 // Copyright: Open CASCADE 2005
6 #ifndef ShapeAnalysis_BoxBndTree_HeaderFile
7 #define ShapeAnalysis_BoxBndTree_HeaderFile
9 #include <NCollection_UBTree.hxx>
10 #include <Bnd_Box.hxx>
12 #include <MMgt_TShared.hxx>
13 #include <TopTools_HArray1OfShape.hxx>
15 #include <ShapeExtend.hxx>
16 #include <ShapeExtend_Status.hxx>
17 #include <TopoDS_Vertex.hxx>
18 #include <TColStd_MapOfInteger.hxx>
19 #include <TColStd_Array1OfInteger.hxx>
21 typedef NCollection_UBTree <Standard_Integer , Bnd_Box> ShapeAnalysis_BoxBndTree;
23 class ShapeAnalysis_BoxBndTreeSelector
24 : public ShapeAnalysis_BoxBndTree::Selector
27 ShapeAnalysis_BoxBndTreeSelector
28 (Handle (TopTools_HArray1OfShape) theSeq,
29 Standard_Boolean theShared)
30 : mySeq(theSeq), myShared(theShared), myNb(0), myTol(1e-7), myMin3d(1e-7),myArrIndices(1,2),
31 myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK))
36 void DefineBoxes (const Bnd_Box& theFBox, const Bnd_Box& theLBox)
43 void DefineVertexes (TopoDS_Vertex theVf, TopoDS_Vertex theVl)
46 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
49 void DefinePnt (gp_Pnt theFPnt, gp_Pnt theLPnt)
52 myStatus =ShapeExtend::EncodeStatus (ShapeExtend_OK);
55 Standard_Integer GetNb ()
58 void SetNb (Standard_Integer theNb)
61 void LoadList(Standard_Integer elem)
65 { myStop = Standard_False; }
67 void SetTolerance (Standard_Real theTol)
71 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
74 Standard_Boolean ContWire(Standard_Integer nbWire)
75 { return myList.Contains(nbWire); }
77 inline Standard_Boolean LastCheckStatus (const ShapeExtend_Status Status) const
78 { return ShapeExtend::DecodeStatus ( myStatus, Status ); }
80 Standard_Boolean Reject (const Bnd_Box& theBnd) const;
81 Standard_Boolean Accept (const Standard_Integer &);
86 Handle (TopTools_HArray1OfShape) mySeq;
87 Standard_Boolean myShared;
88 Standard_Integer myStatus;
89 Standard_Integer myNb;
90 TopoDS_Vertex myFVertex;
91 TopoDS_Vertex myLVertex;
94 TColStd_MapOfInteger myList;
96 Standard_Real myMin3d;
97 TColStd_Array1OfInteger myArrIndices;