Salome HOME
Mantis issue 0020853: EDF 1394 GEOM: Partition fails between 2 faces. A patch by...
[modules/geom.git] / src / GEOMFiltersSelection / GEOM_PreviewFilter.cxx
index e9766b88ebdc3964cb5dbc9dfd9132786830b22f..de97a994fc597bc44cafd150b144ced754eae0c1 100644 (file)
@@ -1,42 +1,53 @@
-//  GEOM GEOMFiltersSelection : filter selector for the viewer
+//  Copyright (C) 2007-2010  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.
 //
+//  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.
 //
-//  File   : GEOM_PreviewFilter.cxx
-//  Author : Sergey ANIKIN
-//  Module : GEOM
-//  $Header$
+//  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
+//
+
+#include "GEOM_PreviewFilter.h"
 
-#include "GEOM_PreviewFilter.ixx"
-#include "SALOME_InteractiveObject.hxx"
+#include <LightApp_DataOwner.h>
 
-using namespace std;
+//=======================================================================
+// function : GEOM_SelectionFilter
+// purpose  : 
+//=======================================================================
+GEOM_PreviewFilter::GEOM_PreviewFilter( SalomeApp_Study* study )
+: SalomeApp_Filter( study )
+{
+}
 
-GEOM_PreviewFilter::GEOM_PreviewFilter()
+//=======================================================================
+// function : ~GEOM_SelectionFilter
+// purpose  : 
+//=======================================================================
+GEOM_PreviewFilter::~GEOM_PreviewFilter()
 {
 }
 
-Standard_Boolean GEOM_PreviewFilter::IsOk(const Handle(SALOME_InteractiveObject)& anObj) const 
+//=======================================================================
+// function : isOk
+// purpose  : 
+//=======================================================================
+bool GEOM_PreviewFilter::isOk( const SUIT_DataOwner* sOwner ) const
 {
-  return ( !anObj.IsNull() && anObj->hasEntry() && strstr( anObj->getEntry(), "TEMP" ) );
+  const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*> ( sOwner );
+  return ( owner && strstr( owner->entry().toLatin1().constData(), "TEMP" ) );
 }