Back to index

salome-smesh  6.5.0
SMESH_NumberFilter.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SMESH_NumberFilter.hxx
00024 //  Module : SMESH
00025 //
00026 #ifndef _SMESH_NumberFilter_HeaderFile
00027 #define _SMESH_NumberFilter_HeaderFile
00028 
00029 #include "SMESH_Type.h"
00030 
00031 #include "SUIT_SelectionFilter.h"
00032 
00033 #include <TopAbs_ShapeEnum.hxx>
00034 #include <TColStd_MapOfInteger.hxx>
00035 
00036 #include <SALOMEconfig.h>
00037 #include CORBA_SERVER_HEADER(GEOM_Gen)
00038 
00039 #include <string>
00040 
00041 class SUIT_DataOwner;
00042 
00056 class SMESHFILTERSSELECTION_EXPORT SMESH_NumberFilter : public SUIT_SelectionFilter
00057 {
00058  public:
00059   SMESH_NumberFilter (const char*            theKind,
00060                       const TopAbs_ShapeEnum theSubShapeType,
00061                       const int              theNumber,
00062                       const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE,
00063                       GEOM::GEOM_Object_ptr  theMainObj = GEOM::GEOM_Object::_nil(),
00064                       const bool             theIsClosedOnly = false );
00065 
00066   SMESH_NumberFilter (const char*                 theKind,
00067                       const TopAbs_ShapeEnum      theSubShapeType,
00068                       const int                   theNumber,
00069                       const TColStd_MapOfInteger& theShapeTypes,
00070                       GEOM::GEOM_Object_ptr       theMainObj = GEOM::GEOM_Object::_nil(),
00071                       const bool                  theIsClosedOnly = false );
00072 
00073   virtual ~SMESH_NumberFilter();
00074 
00075   virtual bool isOk (const SUIT_DataOwner*) const;
00076 
00077   void SetSubShapeType (const TopAbs_ShapeEnum);
00078   void SetNumber       (const int);
00079   void SetClosedOnly   (const bool);
00080   void SetShapeType    (const TopAbs_ShapeEnum);
00081   void SetShapeTypes   (const TColStd_MapOfInteger&);
00082   void SetMainShape    (GEOM::GEOM_Object_ptr);
00083 
00084  private:
00085   GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*, const bool extractReference = true ) const;
00086 
00087  private:
00088   std::string           myKind;
00089   TopAbs_ShapeEnum      mySubShapeType;
00090   int                   myNumber;
00091   bool                  myIsClosedOnly;
00092   TColStd_MapOfInteger  myShapeTypes;
00093   GEOM::GEOM_Object_var myMainObj;
00094 };
00095 
00096 #endif