From: secher Date: Tue, 22 Jan 2008 14:04:31 +0000 (+0000) Subject: add test on filter module X-Git-Tag: for_M2008_07022008~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2c644ea4fc3ebe69821b48860daf6acb7026f6a0;p=modules%2Ffilter.git add test on filter module --- diff --git a/src/FILTER/test_filter.py b/src/FILTER/test_filter.py new file mode 100644 index 0000000..ad06ffe --- /dev/null +++ b/src/FILTER/test_filter.py @@ -0,0 +1,44 @@ +# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG +# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT +# 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.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# Author: Bernard Secher 2008 january +# +import os +import salome +import SALOME_FILTER +import libSALOME_LifeCycleCORBA +lcc=libSALOME_LifeCycleCORBA.SALOME_LifeCycleCORBA() +filter=lcc.FindOrLoad_Component("FactoryServer","FILTER") +inputFile=os.getenv("FILTER_ROOT_DIR")+"/share/salome/resources/filter/xx.aa.med" +inputMesh="MeshFromEnsight" +inputField="FieldFromEnsight" +inputTS=0 +nbth=1 +fth=2.2 +sth=0.0 +flag=True +rf=SALOME_FILTER.F_FIELD +outputFile="filtered.med" +filter.loadMED(inputFile) +filter.readReferenceField(inputMesh,inputField,inputTS) +filter.generateCriteria(nbth,fth,sth,flag,rf) +filter.createEnsightInputFiles() +filter.filtering() +filter.projectFieldsOnDecimateMesh() +filter.createMedOutputFile(outputFile) +filter.unloadMED()