|
|
|||
File indexing completed on 2026-11-23 10:18:37
0001 // Created on: 2011-11-29 0002 // Created by: ANNA MASALSKAYA 0003 // Copyright (c) 2011-2014 OPEN CASCADE SAS 0004 // 0005 // This file is part of Open CASCADE Technology software library. 0006 // 0007 // This library is free software; you can redistribute it and/or modify it under 0008 // the terms of the GNU Lesser General Public License version 2.1 as published 0009 // by the Free Software Foundation, with special exception defined in the file 0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0011 // distribution for complete text of the license and disclaimer of any warranty. 0012 // 0013 // Alternatively, this file may be used under the terms of Open CASCADE 0014 // commercial license or contractual agreement. 0015 0016 #ifndef BRepBuilderAPI_BndBoxTreeSelector_HeaderFile 0017 #define BRepBuilderAPI_BndBoxTreeSelector_HeaderFile 0018 0019 #include <Standard_Integer.hxx> 0020 #include <NCollection_List.hxx> 0021 #include <Bnd_Box.hxx> 0022 #include <NCollection_UBTree.hxx> 0023 0024 //======================================================================= 0025 //! Class BRepBuilderAPI_BndBoxTreeSelector 0026 //! derived from UBTree::Selector 0027 //! This class is used to select overlapping boxes, stored in 0028 //! NCollection::UBTree; contains methods to maintain the selection 0029 //! condition and to retrieve selected objects after search. 0030 //======================================================================= 0031 0032 class BRepBuilderAPI_BndBoxTreeSelector : public NCollection_UBTree<int, Bnd_Box>::Selector 0033 { 0034 public: 0035 //! Constructor; calls the base class constructor 0036 BRepBuilderAPI_BndBoxTreeSelector() 0037 0038 = default; 0039 0040 //! Implementation of rejection method 0041 //! @return 0042 //! True if the bounding box does not intersect with the current 0043 bool Reject(const Bnd_Box& theBox) const override { return (myBox.IsOut(theBox)); } 0044 0045 //! Implementation of acceptance method 0046 //! This method is called when the bounding box intersect with the current. 0047 //! It stores the object - the index of box in the list of accepted objects. 0048 //! @return 0049 //! True, because the object is accepted 0050 bool Accept(const int& theObj) override 0051 { 0052 myResInd.Append(theObj); 0053 return true; 0054 } 0055 0056 //! Clear the list of intersecting boxes 0057 void ClearResList() { myResInd.Clear(); } 0058 0059 //! Set current box to search for overlapping with him 0060 void SetCurrent(const Bnd_Box& theBox) { myBox = theBox; } 0061 0062 //! Get list of indexes of boxes intersecting with the current box 0063 const NCollection_List<int>& ResInd() { return myResInd; } 0064 0065 private: 0066 NCollection_List<int> myResInd; 0067 Bnd_Box myBox; 0068 }; 0069 0070 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|