1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SMESH_NumberFilter.hxx
23 #ifndef _SMESH_NumberFilter_HeaderFile
24 #define _SMESH_NumberFilter_HeaderFile
26 #include "SUIT_SelectionFilter.h"
28 #include <TopAbs_ShapeEnum.hxx>
29 #include <TColStd_MapOfInteger.hxx>
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(GEOM_Gen)
39 * Class : SMESH_NumberFilter
40 * Description : Filter for geom or smesh objects.
41 * Filter geom objects by number of subshapes of the given type
42 * Parameters of constructor:
43 * * theSubShapeType - Type of subshape
44 * * theNumber - Number of subshapes. Object is selected if it contains theNumber of
45 * theSubShapeType sub-shapes
46 * * theShapeType - This map specifies types of object to be selected
47 * * theMainObject - Sub-shapes of this object is selected only
48 * * theIsClosedOnly - Closed shapes is selected if this parameter is true
50 class SMESH_NumberFilter : public SUIT_SelectionFilter
53 SMESH_NumberFilter (const char* theKind,
54 const TopAbs_ShapeEnum theSubShapeType,
56 const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE,
57 GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(),
58 const bool theIsClosedOnly = false );
60 SMESH_NumberFilter (const char* theKind,
61 const TopAbs_ShapeEnum theSubShapeType,
63 const TColStd_MapOfInteger& theShapeTypes,
64 GEOM::GEOM_Object_ptr theMainObj = GEOM::GEOM_Object::_nil(),
65 const bool theIsClosedOnly = false );
67 virtual ~SMESH_NumberFilter();
69 virtual bool isOk (const SUIT_DataOwner*) const;
71 void SetSubShapeType (const TopAbs_ShapeEnum);
72 void SetNumber (const int);
73 void SetClosedOnly (const bool);
74 void SetShapeType (const TopAbs_ShapeEnum);
75 void SetShapeTypes (const TColStd_MapOfInteger&);
76 void SetMainShape (GEOM::GEOM_Object_ptr);
79 GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*, const bool extractReference = true ) const;
83 TopAbs_ShapeEnum mySubShapeType;
86 TColStd_MapOfInteger myShapeTypes;
87 GEOM::GEOM_Object_var myMainObj;