1 // Created by: Eugeny MALTCHIKOV
2 // Copyright (c) 2017 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef BOPTools_BoxSelector_HeaderFile
16 #define BOPTools_BoxSelector_HeaderFile
18 #include <TColStd_ListOfInteger.hxx>
19 #include <NCollection_UBTree.hxx>
20 #include <Standard_Integer.hxx>
22 //! Template Selector for the unbalanced binary tree
23 //! of overlapped bounding boxes.
24 template <class BoxType> class BOPTools_BoxSelector :
25 public NCollection_UBTree<Standard_Integer, BoxType>::Selector
30 BOPTools_BoxSelector() {};
32 //! Checks if the box should be rejected
33 virtual Standard_Boolean Reject(const BoxType& theOther) const
35 return myBox.IsOut(theOther);
39 virtual Standard_Boolean Accept(const Standard_Integer& theIndex)
41 myIndices.Append(theIndex);
45 //! Clears the indices
52 void SetBox(const BoxType& theBox)
57 //! Returns the list of accepted indices
58 const TColStd_ListOfInteger& Indices() const
66 TColStd_ListOfInteger myIndices;