1 # Copyright (C) 2010-2016 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # This case corresponds to: /visu/bugs/A0 case
24 from paravistest import datadir, pictureext, get_picture_dir
28 picturedir = get_picture_dir("bugs/A0")
31 print 'Importing "hydro_sea_alv.med"...',
32 file_path = datadir + "hydro_sea_alv.med"
33 pvsimple.OpenDataFile(file_path)
34 med_reader = pvsimple.GetActiveSource()
36 if med_reader is None:
41 # 2. Create cut lines on "Head" field
42 mesh_name = "maillage_migr3d"
44 cell_entity = presentations.EntityType.CELL
45 timestamps = med_reader.TimestepValues.GetData()
47 for ts in xrange(1, len(timestamps) + 1):
48 print "Timestamp: ", ts
49 cutlines = presentations.CutLinesOnField(med_reader, cell_entity, field_name, ts,
50 orientation1=presentations.Orientation.ZX,
51 orientation2=presentations.Orientation.YZ)
52 pic_name = mesh_name + "_" + str(cell_entity) + "_" + field_name + "_" + str(ts) + "_TCUTLINES." + pictureext
53 pic_path = os.path.join(picturedir, pic_name)
55 presentations.process_prs_for_test(cutlines, pvsimple.GetRenderView(), pic_path)
56 nb_lines = len(cutlines.Input.SliceOffsetValues)
57 print "Number of lines = ", nb_lines