]> SALOME platform Git repositories - modules/smesh.git/blob - src/SMESHFiltersSelection/SMESH_NumberFilter.hxx
Salome HOME
*** empty log message ***
[modules/smesh.git] / src / SMESHFiltersSelection / SMESH_NumberFilter.hxx
1 //  File   : SMESH_NumberFilter.hxx
2 //  Module : SMESH
3
4 #ifndef _SMESH_NumberFilter_HeaderFile
5 #define _SMESH_NumberFilter_HeaderFile
6
7 #include "SUIT_SelectionFilter.h"
8
9 #include <qstring.h>
10
11 #include <TopAbs_ShapeEnum.hxx>
12 #include <TColStd_MapOfInteger.hxx>
13
14 #include <SALOMEconfig.h>
15 #include CORBA_SERVER_HEADER(GEOM_Gen)
16
17 class SUIT_DataOwner;
18
19 /*!
20  *  Class       : SMESH_NumberFilter
21  *  Description : Filter for geom or smesh objects.
22  *                Filter geom objects by number of subshapes of the given type
23  *                Parameters of constructor:
24  *                * theSubShapeType - Type of subshape
25  *                * theNumber       - Number of subshapes. Object is selected if it contains theNumber of
26  *                                    theSubShapeType sub-shapes
27  *                * theShapeType    - This map specifies types of object to be selected
28  *                * theMainObject   - Sub-shapes of this object is selected only
29  *                * theIsClosedOnly - Closed shapes is selected if this parameter is true
30  */
31 class SMESH_NumberFilter : public SUIT_SelectionFilter
32 {
33  public:
34   SMESH_NumberFilter (const QString&         theKind,
35                       const TopAbs_ShapeEnum theSubShapeType,
36                       const int              theNumber,
37                       const TopAbs_ShapeEnum theShapeType = TopAbs_SHAPE,
38                       GEOM::GEOM_Object_ptr  theMainObj = GEOM::GEOM_Object::_nil(),
39                       const bool             theIsClosedOnly = false );
40
41   SMESH_NumberFilter (const QString&              theKind,
42                       const TopAbs_ShapeEnum      theSubShapeType,
43                       const int                   theNumber,
44                       const TColStd_MapOfInteger& theShapeTypes,
45                       GEOM::GEOM_Object_ptr       theMainObj = GEOM::GEOM_Object::_nil(),
46                       const bool                  theIsClosedOnly = false );
47
48   virtual ~SMESH_NumberFilter();
49
50   virtual bool isOk (const SUIT_DataOwner*) const;
51
52   void SetSubShapeType (const TopAbs_ShapeEnum);
53   void SetNumber       (const int);
54   void SetClosedOnly   (const bool);
55   void SetShapeType    (const TopAbs_ShapeEnum);
56   void SetShapeTypes   (const TColStd_MapOfInteger&);
57   void SetMainShape    (GEOM::GEOM_Object_ptr);
58
59  private:
60   GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*) const;
61
62  private:
63   QString               myKind;
64   TopAbs_ShapeEnum      mySubShapeType;
65   int                   myNumber;
66   bool                  myIsClosedOnly;
67   TColStd_MapOfInteger  myShapeTypes;
68   GEOM::GEOM_Object_var myMainObj;
69 };
70
71 #endif