2 # Copyright (C) 2010-2016 CEA/DEN, EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # This case corresponds to: /visu/SWIG_scripts/B4 case
26 from paravistest import datadir
27 from presentations import *
31 med_file_path = datadir + "pointe.med"
32 pvsimple.OpenDataFile(med_file_path)
33 med_reader = pvsimple.GetActiveSource()
35 if med_reader is None:
36 raise RuntimeError, "MED file was not imported successfully."
38 # Create presentations
40 if os.access(med_file_path, os.R_OK) :
41 if os.access(med_file_path, os.W_OK) :
43 entity = EntityType.NODE
44 field_name = "fieldnodedouble"
47 scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp_id)
48 if get_nb_components(med_reader, entity, field_name) > 1:
49 vectors = VectorsOnField(med_reader, entity, field_name, timestamp_id)
50 cutplanes = CutPlanesOnField(med_reader, entity, field_name, timestamp_id)
52 mesh = MeshOnEntity(med_reader, mesh_name, entity)
54 print "We have no permission to rewrite medFile"
56 print "We have no permission to read medFile, it will not be opened";
60 print sys.exc_traceback