1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_LogicalFilter.cxx
25 // Author : Sergey LITONIN
28 #include "SMESH_LogicalFilter.hxx"
31 Class : SMESH_LogicalFilter
32 Description : Filter for combaining several filters with logical operation (OR or AND)
35 IMPLEMENT_STANDARD_HANDLE( SMESH_LogicalFilter, SALOME_Filter )
36 IMPLEMENT_STANDARD_RTTIEXT( SMESH_LogicalFilter, SALOME_Filter )
38 //=======================================================================
39 // name : SMESH_LogicalFilter::SMESH_LogicalFilter
40 // Purpose : Constructor
41 //=======================================================================
42 SMESH_LogicalFilter::SMESH_LogicalFilter( const SMESH_ListOfFilter& theFilters,
45 myFilters = theFilters;
49 //=======================================================================
50 // name : SMESH_LogicalFilter::~SMESH_LogicalFilter
51 // Purpose : Destructor
52 //=======================================================================
53 SMESH_LogicalFilter::~SMESH_LogicalFilter()
57 //=======================================================================
58 // name : SMESH_LogicalFilter::IsOk
59 // Purpose : Verify validity of entry object
60 //=======================================================================
61 Standard_Boolean SMESH_LogicalFilter::IsOk( const Handle(SALOME_InteractiveObject)& theIO ) const
63 SMESH_ListOfFilter::Iterator anIter( myFilters );
64 for ( ; anIter.More(); anIter.Next() )
66 Handle(SALOME_Filter) aFilter = anIter.Value();
67 if ( !aFilter.IsNull() )
69 if ( myLogOp == LO_OR && anIter.Value()->IsOk( theIO ) )
71 if ( myLogOp == LO_AND && !anIter.Value()->IsOk( theIO ) )
76 return myLogOp == LO_OR ? false : true;
79 //=======================================================================
80 // name : SMESH_LogicalFilter::SetFilters
81 // Purpose : Set new list of filters. Old wilters are removed
82 //=======================================================================
83 void SMESH_LogicalFilter::SetFilters( const SMESH_ListOfFilter& theFilters )
85 myFilters = theFilters;
88 //=======================================================================
89 // name : SMESH_LogicalFilter::SetLogOp
90 // Purpose : Set logical operation
91 //=======================================================================
92 void SMESH_LogicalFilter::SetLogOp( const int theLogOp )
97 //=======================================================================
98 // name : SMESH_LogicalFilter::GetFilters
99 // Purpose : Get list of filters
100 //=======================================================================
101 const SMESH_ListOfFilter& SMESH_LogicalFilter::GetFilters() const
106 //=======================================================================
107 // name : SMESH_LogicalFilter::GetLogOp
108 // Purpose : Get logical operation
109 //=======================================================================
110 int SMESH_LogicalFilter::GetLogOp() const