X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHFiltersSelection%2FSMESH_NumberFilter.hxx;h=c4d3d84180d5a1dfd849bf3f82c3a5eb143a4e6f;hp=a4fc8df16dee84428b30ff952cb7c722f141894e;hb=c63ee099ad2b149bd70136839c973e8910137bc5;hpb=e4737e85f0da6d3f90fd08f6be1c2825195fe16f diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx index a4fc8df16..c4d3d8418 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx @@ -1,124 +1,88 @@ -// SALOME SALOMEGUI : implementation of desktop and GUI kernel -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is distributed in the hope that it will be useful +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : SMESH_NumberFilter.hxx -// Author : Sergey LITONIN // Module : SMESH #ifndef _SMESH_NumberFilter_HeaderFile #define _SMESH_NumberFilter_HeaderFile -#include -#include "SALOME_TypeFilter.hxx" +#include "SUIT_SelectionFilter.h" + #include #include #include -#include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(GEOM_Gen) -DEFINE_STANDARD_HANDLE( SMESH_NumberFilter, SALOME_TypeFilter ) - -/* - Class : SMESH_NumberFilter - Description : Filter for geom or smesh objects. - Filter geom objects by number of subshapes of the given type - Parameters of constructor: - * theSubShapeType - Type of subshape - * theNumber - Number of subshapes. Object is selected if it contains theNumber of - theSubShapeType sub-shapes - * theShapeType - This map specifies types of object to be selected - * theMainObject - Sub-shapes of this object is selected only - * theIsClosedOnly - Closed shapes is selected if this parameter is true -*/ -class SMESH_NumberFilter : public SALOME_TypeFilter +class SUIT_DataOwner; + +/*! + * Class : SMESH_NumberFilter + * Description : Filter for geom or smesh objects. + * Filter geom objects by number of subshapes of the given type + * Parameters of constructor: + * * theSubShapeType - Type of subshape + * * theNumber - Number of subshapes. Object is selected if it contains theNumber of + * theSubShapeType sub-shapes + * * theShapeType - This map specifies types of object to be selected + * * theMainObject - Sub-shapes of this object is selected only + * * theIsClosedOnly - Closed shapes is selected if this parameter is true + */ +class SMESH_NumberFilter : public SUIT_SelectionFilter { - -public: - - SMESH_NumberFilter( const char* theKind, - const TopAbs_ShapeEnum theSubShapeType, - const int theNumber, - const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE, - GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(), - const bool theIsClosedOnly = false ); - - SMESH_NumberFilter( const char* theKind, - const TopAbs_ShapeEnum theSubShapeType, - const int theNumber, - const TColStd_MapOfInteger& theShapeTypes, - GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(), - const bool theIsClosedOnly = false ); - - virtual ~SMESH_NumberFilter(); - virtual Standard_Boolean IsOk( const Handle(SALOME_InteractiveObject)& ) const; - - void SetSubShapeType( const TopAbs_ShapeEnum ); - void SetNumber( const int ); - void SetClosedOnly( const bool ); - void SetShapeType( const TopAbs_ShapeEnum ); - void SetShapeTypes( const TColStd_MapOfInteger& ); - void SetMainShape( GEOM::GEOM_Object_ptr ); - -private: - GEOM::GEOM_Object_ptr getGeom( const Handle(SALOME_InteractiveObject)& theObj ) const; - - -private: + public: + SMESH_NumberFilter (const char* theKind, + const TopAbs_ShapeEnum theSubShapeType, + const int theNumber, + const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE, + GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(), + const bool theIsClosedOnly = false ); + + SMESH_NumberFilter (const char* theKind, + const TopAbs_ShapeEnum theSubShapeType, + const int theNumber, + const TColStd_MapOfInteger& theShapeTypes, + GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(), + const bool theIsClosedOnly = false ); + + virtual ~SMESH_NumberFilter(); + + virtual bool isOk (const SUIT_DataOwner*) const; + + void SetSubShapeType (const TopAbs_ShapeEnum); + void SetNumber (const int); + void SetClosedOnly (const bool); + void SetShapeType (const TopAbs_ShapeEnum); + void SetShapeTypes (const TColStd_MapOfInteger&); + void SetMainShape (GEOM::GEOM_Object_ptr); + + private: + GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*, const bool extractReference = true ) const; + + private: + char* myKind; TopAbs_ShapeEnum mySubShapeType; int myNumber; bool myIsClosedOnly; TColStd_MapOfInteger myShapeTypes; GEOM::GEOM_Object_var myMainObj; - -public: - DEFINE_STANDARD_RTTI( SMESH_NumberFilter ) }; #endif - - - - - - - - - - - - - - - - - - - - - - - - - -