0022627: Change OCCT memory management defaults
[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>
974c25ed 19#include <TColStd_Array1OfInteger.hxx>
7fd59977 20
21typedef NCollection_UBTree <Standard_Integer , Bnd_Box> ShapeAnalysis_BoxBndTree;
22
23class ShapeAnalysis_BoxBndTreeSelector
24 : public ShapeAnalysis_BoxBndTree::Selector
25{
26 public:
27 ShapeAnalysis_BoxBndTreeSelector
28 (Handle (TopTools_HArray1OfShape) theSeq,
29 Standard_Boolean theShared)
974c25ed
G
30 : mySeq(theSeq), myShared(theShared), myNb(0), myTol(1e-7), myMin3d(1e-7),myArrIndices(1,2),
31 myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK))
32 {
33 myArrIndices.Init(0);
34 }
7fd59977 35
36 void DefineBoxes (const Bnd_Box& theFBox, const Bnd_Box& theLBox)
37 { myFBox = theFBox;
974c25ed
G
38 myLBox = theLBox;
39 myArrIndices.Init(0);
40
41 }
7fd59977 42
43 void DefineVertexes (TopoDS_Vertex theVf, TopoDS_Vertex theVl)
44 { myFVertex = theVf;
45 myLVertex = theVl;
46 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
47 }
48
49 void DefinePnt (gp_Pnt theFPnt, gp_Pnt theLPnt)
50 { myFPnt = theFPnt;
51 myLPnt = theLPnt;
52 myStatus =ShapeExtend::EncodeStatus (ShapeExtend_OK);
53 }
54
55 Standard_Integer GetNb ()
56 { return myNb; }
57
58 void SetNb (Standard_Integer theNb)
59 { myNb = theNb; }
60
61 void LoadList(Standard_Integer elem)
62 { myList.Add(elem); }
63
64 void SetStop ()
65 { myStop = Standard_False; }
66
67 void SetTolerance (Standard_Real theTol)
68 {
69 myTol = theTol;
70 myMin3d = theTol;
71 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
72 }
73
74 Standard_Boolean ContWire(Standard_Integer nbWire)
75 { return myList.Contains(nbWire); }
76
77 inline Standard_Boolean LastCheckStatus (const ShapeExtend_Status Status) const
78 { return ShapeExtend::DecodeStatus ( myStatus, Status ); }
79
80 Standard_Boolean Reject (const Bnd_Box& theBnd) const;
81 Standard_Boolean Accept (const Standard_Integer &);
82
83 private:
84 Bnd_Box myFBox;
85 Bnd_Box myLBox;
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;
92 gp_Pnt myFPnt;
93 gp_Pnt myLPnt;
94 TColStd_MapOfInteger myList;
95 Standard_Real myTol;
96 Standard_Real myMin3d;
974c25ed 97 TColStd_Array1OfInteger myArrIndices;
7fd59977 98};
99
100#endif