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_HeaderFile
17 #define BRepBuilderAPI_BndBoxTreeSelector_HeaderFile
19 #include <TColStd_ListOfInteger.hxx>
20 #include <Bnd_Box.hxx>
21 #include <NCollection_UBTree.hxx>
23 typedef NCollection_UBTree <Standard_Integer, Bnd_Box> BRepBuilderAPI_BndBoxTree;
25 //=======================================================================
26 //! Class BRepBuilderAPI_BndBoxTreeSelector
27 //! derived from UBTree::Selector
28 //! This class is used to select overlapping boxes, stored in
29 //! NCollection::UBTree; contains methods to maintain the selection
30 //! condition and to retrieve selected objects after search.
31 //=======================================================================
33 class BRepBuilderAPI_BndBoxTreeSelector : public BRepBuilderAPI_BndBoxTree::Selector
36 //! Constructor; calls the base class constructor
37 BRepBuilderAPI_BndBoxTreeSelector() : BRepBuilderAPI_BndBoxTree::Selector() {}
39 //! Implementation of rejection method
41 //! True if the bounding box does not intersect with the current
42 Standard_Boolean Reject (const Bnd_Box& theBox) const
44 return (myBox.IsOut (theBox));
47 //! Implementation of acceptance method
48 //! This method is called when the bounding box intersect with the current.
49 //! It stores the object - the index of box in the list of accepted objects.
51 //! True, because the object is accepted
52 Standard_Boolean Accept (const Standard_Integer& theObj)
54 myResInd.Append (theObj);
58 //! Clear the list of intersecting boxes
64 //! Set current box to search for overlapping with him
65 void SetCurrent (const Bnd_Box& theBox)
70 //! Get list of indexes of boxes intersecting with the current box
71 const TColStd_ListOfInteger& ResInd()
77 TColStd_ListOfInteger myResInd;