Back to index

salome-paravis  6.5.0
F9.py
Go to the documentation of this file.
00001 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 #
00003 # This library is free software; you can redistribute it and/or
00004 # modify it under the terms of the GNU Lesser General Public
00005 # License as published by the Free Software Foundation; either
00006 # version 2.1 of the License.
00007 #
00008 # This library is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 # Lesser General Public License for more details.
00012 #
00013 # You should have received a copy of the GNU Lesser General Public
00014 # License along with this library; if not, write to the Free Software
00015 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 #
00017 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 #
00019 
00020 # This case corresponds to: /visu/StreamLines/F9 case
00021 
00022 import sys
00023 
00024 from paravistest import datadir, pictureext, get_picture_dir
00025 from presentations import StreamLinesOnField, EntityType, \
00026      reset_view, process_prs_for_test
00027 import paravis
00028 import pvsimple
00029 
00030 
00031 my_paravis = paravis.myParavis
00032 
00033 # Directory for saving snapshots
00034 picturedir = get_picture_dir(sys.argv[1], "StreamLines/F9")
00035 
00036 # Import of the "Bug829_resu_mode.med" file
00037 file_path = datadir + "Bug829_resu_mode.med"
00038 
00039 my_paravis.ImportFile(file_path)
00040 med_reader = pvsimple.GetActiveSource()
00041 
00042 if med_reader is None:
00043     raise RuntimeError("Bug829_resu_mode.med was not imported!!!")
00044 
00045 # Get view
00046 view = pvsimple.GetRenderView()
00047 
00048 # Create a set of Stream Lines, based on time stamps of "MODES_DEPL" field
00049 print "BREAKPOINT_1"
00050 
00051 for i in range(1, 11):
00052     prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES_DEPL", i)
00053     if prs is None:
00054         raise RuntimeError("Presentation on timestamp {0} is None!!!".
00055                            format(i))
00056 
00057     picture_path = picturedir + "/" + "time_stamp_" + str(i) + "." + pictureext
00058     process_prs_for_test(prs, view, picture_path)
00059 
00060 print "BREAKPOINT_2"