0024171: Eliminate CLang compiler warning -Wreorder
[occt.git] / src / ShapeAnalysis / ShapeAnalysis_BoxBndTree.hxx
CommitLineData
b311480e 1// Created on: 2005-02-14
2// Created by: Alexey MORENOV
3// Copyright (c) 2005-2012 OPEN CASCADE SAS
4//
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.
9//
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.
12//
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.
19
7fd59977 20
21#ifndef ShapeAnalysis_BoxBndTree_HeaderFile
22#define ShapeAnalysis_BoxBndTree_HeaderFile
23
24#include <NCollection_UBTree.hxx>
25#include <Bnd_Box.hxx>
26#include <gp_Pnt.hxx>
27#include <MMgt_TShared.hxx>
28#include <TopTools_HArray1OfShape.hxx>
29
30#include <ShapeExtend.hxx>
31#include <ShapeExtend_Status.hxx>
32#include <TopoDS_Vertex.hxx>
33#include <TColStd_MapOfInteger.hxx>
974c25ed 34#include <TColStd_Array1OfInteger.hxx>
7fd59977 35
36typedef NCollection_UBTree <Standard_Integer , Bnd_Box> ShapeAnalysis_BoxBndTree;
37
38class ShapeAnalysis_BoxBndTreeSelector
39 : public ShapeAnalysis_BoxBndTree::Selector
40{
41 public:
42 ShapeAnalysis_BoxBndTreeSelector
43 (Handle (TopTools_HArray1OfShape) theSeq,
44 Standard_Boolean theShared)
974c25ed
G
45 : mySeq(theSeq), myShared(theShared), myNb(0), myTol(1e-7), myMin3d(1e-7),myArrIndices(1,2),
46 myStatus(ShapeExtend::EncodeStatus (ShapeExtend_OK))
47 {
48 myArrIndices.Init(0);
49 }
7fd59977 50
51 void DefineBoxes (const Bnd_Box& theFBox, const Bnd_Box& theLBox)
52 { myFBox = theFBox;
974c25ed
G
53 myLBox = theLBox;
54 myArrIndices.Init(0);
55
56 }
7fd59977 57
58 void DefineVertexes (TopoDS_Vertex theVf, TopoDS_Vertex theVl)
59 { myFVertex = theVf;
60 myLVertex = theVl;
61 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
62 }
63
64 void DefinePnt (gp_Pnt theFPnt, gp_Pnt theLPnt)
65 { myFPnt = theFPnt;
66 myLPnt = theLPnt;
67 myStatus =ShapeExtend::EncodeStatus (ShapeExtend_OK);
68 }
69
70 Standard_Integer GetNb ()
71 { return myNb; }
72
73 void SetNb (Standard_Integer theNb)
74 { myNb = theNb; }
75
76 void LoadList(Standard_Integer elem)
77 { myList.Add(elem); }
78
79 void SetStop ()
80 { myStop = Standard_False; }
81
82 void SetTolerance (Standard_Real theTol)
83 {
84 myTol = theTol;
85 myMin3d = theTol;
86 myStatus=ShapeExtend::EncodeStatus (ShapeExtend_OK);
87 }
88
89 Standard_Boolean ContWire(Standard_Integer nbWire)
90 { return myList.Contains(nbWire); }
91
92 inline Standard_Boolean LastCheckStatus (const ShapeExtend_Status Status) const
93 { return ShapeExtend::DecodeStatus ( myStatus, Status ); }
94
95 Standard_Boolean Reject (const Bnd_Box& theBnd) const;
96 Standard_Boolean Accept (const Standard_Integer &);
97
98 private:
99 Bnd_Box myFBox;
100 Bnd_Box myLBox;
101 Handle (TopTools_HArray1OfShape) mySeq;
102 Standard_Boolean myShared;
7fd59977 103 Standard_Integer myNb;
104 TopoDS_Vertex myFVertex;
105 TopoDS_Vertex myLVertex;
106 gp_Pnt myFPnt;
107 gp_Pnt myLPnt;
108 TColStd_MapOfInteger myList;
109 Standard_Real myTol;
110 Standard_Real myMin3d;
974c25ed 111 TColStd_Array1OfInteger myArrIndices;
eafb234b 112 Standard_Integer myStatus;
113
7fd59977 114};
115
116#endif