Back to index

salome-paravis  6.5.0
B3.py
Go to the documentation of this file.
00001 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 #
00003 # This library is free software; you can redistribute it and/or
00004 # modify it under the terms of the GNU Lesser General Public
00005 # License as published by the Free Software Foundation; either
00006 # version 2.1 of the License.
00007 #
00008 # This library is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 # Lesser General Public License for more details.
00012 #
00013 # You should have received a copy of the GNU Lesser General Public
00014 # License along with this library; if not, write to the Free Software
00015 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 #
00017 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 #
00019 
00020 # This case corresponds to: /visu/CutPlanes/B3 case
00021 
00022 from paravistest import datadir
00023 from presentations import CutPlanesOnField, EntityType
00024 import paravis
00025 import pvsimple
00026 
00027 my_paravis = paravis.myParavis
00028 
00029 #====================Stage1: Importing MED file====================
00030 print "**** Stage1: Importing MED file"
00031 
00032 print 'Import "ResOK_0000.med"...............',
00033 
00034 file_path = datadir + "ResOK_0000.med"
00035 my_paravis.ImportFile(file_path)
00036 med_reader = pvsimple.GetActiveSource()
00037 
00038 if med_reader is None:
00039     print "FAILED"
00040 else:
00041     print "OK"
00042 
00043 #====================Stage2: Creating CutPlanes====================
00044 print "*****Stage2: Creating CutPlanes"
00045 
00046 print "Creating Cut Planes.......",
00047 
00048 node_entity = EntityType.NODE
00049 field_name = 'vitesse'
00050 cutplanes = CutPlanesOnField(med_reader, node_entity, field_name, 1)
00051 
00052 if cutplanes is None:
00053     print "FAILED"
00054 else:
00055     print "OK"