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