1 # Copyright (C) 2010-2013 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.
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
29 my_paravis = paravis.myParavis
30 picturedir = get_picture_dir(sys.argv[1], "bugs/A0")
33 print 'Importing "hydro_sea_alv.med"...',
34 file_path = datadir + "hydro_sea_alv.med"
35 my_paravis.ImportFile(file_path)
36 med_reader = pvsimple.GetActiveSource()
38 if med_reader is None:
43 # 2. Create cut lines on "Head" field
44 mesh_name = "maillage_migr3d"
46 cell_entity = presentations.EntityType.CELL
47 timestamps = med_reader.TimestepValues.GetData()
49 for ts in xrange(1, len(timestamps) + 1):
50 print "Timestamp: ", ts
51 cutlines = presentations.CutLinesOnField(med_reader, cell_entity, field_name, ts,
52 orientation1=presentations.Orientation.ZX,
53 orientation2=presentations.Orientation.YZ)
54 pic_name = mesh_name + "_" + str(cell_entity) + "_" + field_name + "_" + str(ts) + "_TCUTLINES." + pictureext
55 pic_path = os.path.join(picturedir, pic_name)
57 presentations.process_prs_for_test(cutlines, pvsimple.GetRenderView(), pic_path)
58 nb_lines = len(cutlines.Input.SliceOffsetValues)
59 print "Number of lines = ", nb_lines