Salome HOME
23416: [CEA 2033] Impossible to re-compute a mesh from an hdf
[modules/smesh.git] / src / SMESHFiltersSelection / SMESH_LogicalFilter.hxx
index ec10f865b062eb2781fb3cefdd6962ed25e862d6..3a5a9b24b2a0508ab385167d3836c03bbe85ac37 100644 (file)
-//  SALOME SALOMEGUI : implementation of desktop and GUI kernel
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  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. 
-// 
-//  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// Copyright (C) 2003-2007  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, or (at your option) any later version.
 //
+// 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_LogicalFilter.hxx
-//  Author : Sergey LITONIN
 //  Module : SMESH
-
+//
 #ifndef _SMESH_LogicalFilter_HeaderFile
 #define _SMESH_LogicalFilter_HeaderFile
 
-#include "SALOME_Filter.hxx"
+#include "SMESH_Type.h"
 
-#include <Standard_DefineHandle.hxx>
-#include <NCollection_StdBase.hxx>
-#include <NCollection_DefineList.hxx>
+#include <SUIT_SelectionFilter.h>
 
-DEFINE_STANDARD_HANDLE( SMESH_LogicalFilter, SALOME_Filter )
+#include <QList>
 
-DEFINE_BASECOLLECTION( SMESH_FilterColl, Handle(SALOME_Filter) )
-DEFINE_LIST( SMESH_ListOfFilter, SMESH_FilterColl, Handle(SALOME_Filter) )
-
-
-/*
-  Class       : SMESH_LogicalFilter
-  Description : Filter for combaining several filters with logical operation (OR or AND)
-*/
-
-class SMESH_LogicalFilter : public SALOME_Filter
+class SMESHFILTERSSELECTION_EXPORT SMESH_LogicalFilter : public SUIT_SelectionFilter
 {
-public:
-
-  enum { LO_OR, LO_AND, LO_UNDEFINED };
-
-public:
+ public:
+  enum { LO_OR, LO_AND, LO_NOT, LO_UNDEFINED };
 
-                              SMESH_LogicalFilter( const SMESH_ListOfFilter&, const int  );
+ public:
+  SMESH_LogicalFilter( const QList<SUIT_SelectionFilter*>&, const int, bool takeOwnership=false );
+  virtual ~SMESH_LogicalFilter();
 
+  virtual bool isOk (const SUIT_DataOwner*) const;
 
-  virtual                     ~SMESH_LogicalFilter();
-  virtual                     Standard_Boolean IsOk( const Handle(SALOME_InteractiveObject)& ) const;
-
-  void                        SetFilters( const SMESH_ListOfFilter& );
-  void                        SetLogOp( const int );
-  const SMESH_ListOfFilter&    GetFilters() const;
-  int                         GetLogOp() const;
+  void                                 setFilters (const QList<SUIT_SelectionFilter*>&);
+  void                                 setOperation (const int);
+  const QList<SUIT_SelectionFilter*>   getFilters() const;
+  int                                  getOperation() const;
 
 private:
+  void                          deleteFilters();
 
-  SMESH_ListOfFilter           myFilters;
-  int                         myLogOp;
-
-public:
-  DEFINE_STANDARD_RTTI( SMESH_LogicalFilter )
+private:
+  QList<SUIT_SelectionFilter*>  myFilters;
+  int                           myOperation;
+  bool                          myOwnership;
 };
 
 #endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-