1 // Created on: 2011-11-29
2 // Created by: ANNA MASALSKAYA
3 // Copyright (c) 2011-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 _BRepBuilderAPI_BndBoxTreeSelector_Header
17 #define _BRepBuilderAPI_BndBoxTreeSelector_Header
19 #ifndef _TColStd_ListOfInteger_HeaderFile
20 #include <TColStd_ListOfInteger.hxx>
22 #ifndef _Bnd_Box_HeaderFile
23 #include <Bnd_Box.hxx>
25 #ifndef NCollection_UBTree_HeaderFile
26 #include <NCollection_UBTree.hxx>
29 typedef NCollection_UBTree <Standard_Integer, Bnd_Box> BRepBuilderAPI_BndBoxTree;
31 //=======================================================================
32 //! Class BRepBuilderAPI_BndBoxTreeSelector
33 //! derived from UBTree::Selector
34 //! This class is used to select overlapping boxes, stored in
35 //! NCollection::UBTree; contains methods to maintain the selection
36 //! condition and to retrieve selected objects after search.
37 //=======================================================================
39 class BRepBuilderAPI_BndBoxTreeSelector : public BRepBuilderAPI_BndBoxTree::Selector
42 //! Constructor; calls the base class constructor
43 BRepBuilderAPI_BndBoxTreeSelector() : BRepBuilderAPI_BndBoxTree::Selector() {}
45 //! Implementation of rejection method
47 //! True if the bounding box does not intersect with the current
48 Standard_Boolean Reject (const Bnd_Box& theBox) const
50 return (myBox.IsOut (theBox));
53 //! Implementation of acceptance method
54 //! This method is called when the bounding box intersect with the current.
55 //! It stores the object - the index of box in the list of accepted objects.
57 //! True, because the object is accepted
58 Standard_Boolean Accept (const Standard_Integer& theObj)
60 myResInd.Append (theObj);
64 //! Clear the list of intersecting boxes
70 //! Set current box to search for overlapping with him
71 void SetCurrent (const Bnd_Box& theBox)
76 //! Get list of indexes of boxes intersecting with the current box
77 const TColStd_ListOfInteger& ResInd()
83 TColStd_ListOfInteger myResInd;