2 # Copyright (C) 2010-2013 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.
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 my_paravis = paravis.myParavis
34 med_file_path = datadir + "pointe.med"
35 my_paravis.ImportFile(med_file_path)
36 med_reader = pvsimple.GetActiveSource()
38 if med_reader is None:
39 raise RuntimeError, "MED file was not imported successfully."
41 # Create presentations
43 if os.access(med_file_path, os.R_OK) :
44 if os.access(med_file_path, os.W_OK) :
46 entity = EntityType.NODE
47 field_name = "fieldnodedouble"
50 scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp_id)
51 if get_nb_components(med_reader, entity, field_name) > 1:
52 vectors = VectorsOnField(med_reader, entity, field_name, timestamp_id)
53 cutplanes = CutPlanesOnField(med_reader, entity, field_name, timestamp_id)
55 mesh = MeshOnEntity(med_reader, mesh_name, entity)
57 print "We have no permission to rewrite medFile"
59 print "We have no permission to read medFile, it will not be opened";
63 print sys.exc_traceback