Salome HOME
Update ParaVis non-regression test base in the following ways:
[modules/paravis.git] / test / VisuPrs / StreamLines / F9.py
1 # Copyright (C) 2010-2015  CEA/DEN, EDF R&D
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 # This case corresponds to: /visu/StreamLines/F9 case
21
22 import sys
23
24 from paravistest import datadir, pictureext, get_picture_dir
25 from presentations import StreamLinesOnField, EntityType, \
26      reset_view, process_prs_for_test
27 import pvsimple
28
29 # Directory for saving snapshots
30 picturedir = get_picture_dir("StreamLines/F9")
31
32 # Import of the "Bug829_resu_mode.med" file
33 file_path = datadir + "Bug829_resu_mode.med"
34
35 pvsimple.OpenDataFile(file_path)
36 med_reader = pvsimple.GetActiveSource()
37
38 if med_reader is None:
39     raise RuntimeError("Bug829_resu_mode.med was not imported!!!")
40
41 # Get view
42 view = pvsimple.GetRenderView()
43
44 # Create a set of Stream Lines, based on time stamps of "MODES_DEPL" field
45 print "BREAKPOINT_1"
46
47 for i in range(1, 11):
48     prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES___DEPL____________________", i)
49     if prs is None:
50         raise RuntimeError("Presentation on timestamp {0} is None!!!".
51                            format(i))
52
53     picture_path = picturedir + "/" + "time_stamp_" + str(i) + "." + pictureext
54     process_prs_for_test(prs, view, picture_path)
55
56 print "BREAKPOINT_2"