Integration of OCCT 6.5.0 from SVN
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_BoxBndTree.hxx
CommitLineData
7fd59977 1// File: ShapeAnalysis_BoxBndTree.hxx
2// Created: 14.02.05 12:38:56
3// Author: Alexey MORENOV
4// Copyright: Open CASCADE 2005
5
6#ifndef ShapeAnalysis_BoxBndTree_HeaderFile
7#define ShapeAnalysis_BoxBndTree_HeaderFile
8
9#include <NCollection_UBTree.hxx>
10#include <Bnd_Box.hxx>
11#include <gp_Pnt.hxx>
12#include <MMgt_TShared.hxx>
13#include <TopTools_HArray1OfShape.hxx>
14
15#include <ShapeExtend.hxx>
16#include <ShapeExtend_Status.hxx>
17#include <TopoDS_Vertex.hxx>
18#include <TColStd_MapOfInteger.hxx>
19
20typedef NCollection_UBTree <Standard_Integer , Bnd_Box> ShapeAnalysis_BoxBndTree;
21
22class ShapeAnalysis_BoxBndTreeSelector
23 : public ShapeAnalysis_BoxBndTree::Selector
24{
25 public:
26 ShapeAnalysis_BoxBndTreeSelector
27 (Handle (TopTools_HArray1OfShape) theSeq,
28 Standard_Boolean theShared)
29 : mySeq(theSeq), myShared(theShared), myNb(0), myTol(1e-7), myMin3d(1e-7),
30 myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK)){}
31
32 void DefineBoxes (const Bnd_Box& theFBox, const Bnd_Box& theLBox)
33 { myFBox = theFBox;
34 myLBox = theLBox; }
35
36 void DefineVertexes (TopoDS_Vertex theVf, TopoDS_Vertex theVl)
37 { myFVertex = theVf;
38 myLVertex = theVl;
39 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
40 }
41
42 void DefinePnt (gp_Pnt theFPnt, gp_Pnt theLPnt)
43 { myFPnt = theFPnt;
44 myLPnt = theLPnt;
45 myStatus =ShapeExtend::EncodeStatus (ShapeExtend_OK);
46 }
47
48 Standard_Integer GetNb ()
49 { return myNb; }
50
51 void SetNb (Standard_Integer theNb)
52 { myNb = theNb; }
53
54 void LoadList(Standard_Integer elem)
55 { myList.Add(elem); }
56
57 void SetStop ()
58 { myStop = Standard_False; }
59
60 void SetTolerance (Standard_Real theTol)
61 {
62 myTol = theTol;
63 myMin3d = theTol;
64 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
65 }
66
67 Standard_Boolean ContWire(Standard_Integer nbWire)
68 { return myList.Contains(nbWire); }
69
70 inline Standard_Boolean LastCheckStatus (const ShapeExtend_Status Status) const
71 { return ShapeExtend::DecodeStatus ( myStatus, Status ); }
72
73 Standard_Boolean Reject (const Bnd_Box& theBnd) const;
74 Standard_Boolean Accept (const Standard_Integer &);
75
76 private:
77 Bnd_Box myFBox;
78 Bnd_Box myLBox;
79 Handle (TopTools_HArray1OfShape) mySeq;
80 Standard_Boolean myShared;
81 Standard_Integer myStatus;
82 Standard_Integer myNb;
83 TopoDS_Vertex myFVertex;
84 TopoDS_Vertex myLVertex;
85 gp_Pnt myFPnt;
86 gp_Pnt myLPnt;
87 TColStd_MapOfInteger myList;
88 Standard_Real myTol;
89 Standard_Real myMin3d;
90};
91
92#endif