Back to index

salome-geom  6.5.0
NMTDS_BndSphereTree.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      NMTDS_BndSphereTree.cxx
00021 // Created:   
00022 // Author:    Peter KURNEV
00023 //            <pkv@irinox>
00024 //
00025 #include <NMTDS_BndSphereTree.hxx>
00026 //=======================================================================
00027 //function : 
00028 //purpose  : 
00029 //=======================================================================
00030   NMTDS_BndSphereTreeSelector::NMTDS_BndSphereTreeSelector()
00031 {
00032 }
00033 //=======================================================================
00034 //function : ~
00035 //purpose  : 
00036 //=======================================================================
00037   NMTDS_BndSphereTreeSelector::~NMTDS_BndSphereTreeSelector()
00038 {
00039 }
00040 //=======================================================================
00041 //function : Reject
00042 //purpose  : 
00043 //=======================================================================
00044   Standard_Boolean NMTDS_BndSphereTreeSelector::Reject (const NMTDS_BndSphere& aBox) const
00045 {
00046   Standard_Boolean bRet;
00047   //
00048   bRet=myBox.IsOut(aBox);
00049   return bRet;
00050 }
00051 //=======================================================================
00052 //function : Accept
00053 //purpose  : 
00054 //=======================================================================
00055   Standard_Boolean NMTDS_BndSphereTreeSelector::Accept (const Standard_Integer& aIndex)
00056 {
00057   Standard_Boolean bRet=Standard_False;
00058   //
00059   if (myFence.Add(aIndex)) {
00060     myIndices.Append(aIndex);
00061     bRet=!bRet;
00062   }
00063   return bRet;
00064 }
00065 //=======================================================================
00066 //function : SetBox
00067 //purpose  : 
00068 //=======================================================================
00069   void NMTDS_BndSphereTreeSelector::SetBox(const NMTDS_BndSphere& aBox)
00070 {
00071   myBox=aBox;
00072 }
00073 //=======================================================================
00074 //function : Clear
00075 //purpose  : 
00076 //=======================================================================
00077   void NMTDS_BndSphereTreeSelector::Clear()
00078 {
00079   myFence.Clear();
00080   myIndices.Clear();
00081 }
00082 //=======================================================================
00083 //function : Indices
00084 //purpose  : 
00085 //=======================================================================
00086   const TColStd_ListOfInteger& NMTDS_BndSphereTreeSelector::Indices() const
00087 {
00088   return myIndices;
00089 }