src/GEOMFiltersSelection/GEOM_SelectionFilter.h

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00003 // 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either 
00007 // version 2.1 of the License.
00008 // 
00009 // This library is distributed in the hope that it will be useful 
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public  
00015 // License along with this library; if not, write to the Free Software 
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 #ifndef GEOM_SELECTIONFILTER_H
00021 #define GEOM_SELECTIONFILTER_H
00022 
00023 #include <SalomeApp_Filter.h>
00024 
00025 #include <TopoDS_Shape.hxx>
00026 
00027 #include <qvaluelist.h>
00028 
00029 // IDL Headers
00030 #include <SALOMEconfig.h>
00031 #include CORBA_SERVER_HEADER(GEOM_Gen)
00032 
00033 class Standard_EXPORT GEOM_SelectionFilter : public SalomeApp_Filter
00034 {
00035 public:
00036   GEOM_SelectionFilter( SalomeApp_Study* study, const bool theAll = false );
00037   ~GEOM_SelectionFilter();
00038 
00039   virtual bool isOk( const SUIT_DataOwner* ) const;
00040 
00041 protected:
00042   GEOM::GEOM_Object_ptr getObject( const SUIT_DataOwner*, const bool = true ) const;
00043   bool                  getShape( const GEOM::GEOM_Object_ptr&, TopoDS_Shape& ) const;
00044   
00045   bool                  contains( const int ) const;
00046   void                  add( const int );
00047   void                  remove( const int );
00048 
00049   void                  setAll( const bool );
00050   bool                  isAll() const;
00051 
00052   bool                  isShapeOk( const TopoDS_Shape& ) const;
00053 
00054 private:
00055   QValueList<int>       myTypes;
00056   bool                  myAll;
00057 
00058 };
00059 
00060 #endif