Salome HOME
ab71d4a7d6531671fba0d93178513747fe772b40
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_BndSphereTree.cxx
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // File:        GEOMAlgo_BndSphereTree.cxx
21 // Created:     
22 // Author:      Peter KURNEV
23 //              <pkv@irinox>
24 //
25 #include <GEOMAlgo_BndSphereTree.hxx>
26 //=======================================================================
27 //function : 
28 //purpose  : 
29 //=======================================================================
30   GEOMAlgo_BndSphereTreeSelector::GEOMAlgo_BndSphereTreeSelector()
31 {
32 }
33 //=======================================================================
34 //function : ~
35 //purpose  : 
36 //=======================================================================
37   GEOMAlgo_BndSphereTreeSelector::~GEOMAlgo_BndSphereTreeSelector()
38 {
39 }
40 //=======================================================================
41 //function : Reject
42 //purpose  : 
43 //=======================================================================
44   Standard_Boolean GEOMAlgo_BndSphereTreeSelector::Reject (const GEOMAlgo_BndSphere& aBox) const
45 {
46   Standard_Boolean bRet;
47   //
48   bRet=myBox.IsOut(aBox);
49   return bRet;
50 }
51 //=======================================================================
52 //function : Accept
53 //purpose  : 
54 //=======================================================================
55   Standard_Boolean GEOMAlgo_BndSphereTreeSelector::Accept (const Standard_Integer& aIndex)
56 {
57   Standard_Boolean bRet=Standard_False;
58   //
59   if (myFence.Add(aIndex)) {
60     myIndices.Append(aIndex);
61     bRet=!bRet;
62   }
63   return bRet;
64 }
65 //=======================================================================
66 //function : SetBox
67 //purpose  : 
68 //=======================================================================
69   void GEOMAlgo_BndSphereTreeSelector::SetBox(const GEOMAlgo_BndSphere& aBox)
70 {
71   myBox=aBox;
72 }
73 //=======================================================================
74 //function : Clear
75 //purpose  : 
76 //=======================================================================
77   void GEOMAlgo_BndSphereTreeSelector::Clear()
78 {
79   myFence.Clear();
80   myIndices.Clear();
81 }
82 //=======================================================================
83 //function : Indices
84 //purpose  : 
85 //=======================================================================
86   const TColStd_ListOfInteger& GEOMAlgo_BndSphereTreeSelector::Indices() const
87 {
88   return myIndices;
89 }