]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMFiltersSelection/GEOM_TypeFilter.cxx
Salome HOME
Fix for Bug IPAL9161(3.0.0 (09 June): It is impossible to perform Fillet and Chamfer...
[modules/geom.git] / src / GEOMFiltersSelection / GEOM_TypeFilter.cxx
1 #include "GEOM_TypeFilter.h"
2
3 //=======================================================================
4 // function : GEOM_TypeFilter
5 // purpose  : 
6 //=======================================================================
7 GEOM_TypeFilter::GEOM_TypeFilter( SalomeApp_Study* study, const int type, const bool isShapeType )
8 :GEOM_SelectionFilter( study ),
9  myType( type ),
10  myIsShapeType(isShapeType)
11 {
12 }
13
14 //=======================================================================
15 // function : ~GEOM_TypeFilter
16 // purpose  : 
17 //=======================================================================
18 GEOM_TypeFilter::~GEOM_TypeFilter()
19 {
20 }
21
22 //=======================================================================
23 // function : isOk
24 // purpose  : 
25 //=======================================================================
26 bool GEOM_TypeFilter::isOk( const SUIT_DataOwner* sOwner ) const
27 {
28   GEOM::GEOM_Object_var obj = getObject( sOwner );
29   if ( !CORBA::is_nil( obj ) )
30     {
31       if (!myIsShapeType)
32         return obj->GetType() == type();
33       else
34         return obj->GetShapeType() == type();
35     }
36   
37   return false;
38 }
39
40 //=======================================================================
41 // function : type
42 // purpose  : 
43 //=======================================================================
44 int GEOM_TypeFilter::type() const
45 {
46   return myType;
47 }