1 # Copyright (C) 2010-2015 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/Plot3D/G2 case
21 # Create Plot 3D for field of the the given MED file for 10 timestamps%
24 from paravistest import datadir, pictureext, get_picture_dir
25 from presentations import *
26 from pvsimple import *
27 import pvserver as paravis
29 # Create presentations
30 myParavis = paravis.myParavis
32 picturedir = get_picture_dir("Plot3D/G2")
34 theFileName = datadir + "Bug829_resu_mode.med"
35 print " --------------------------------- "
36 print "file ", theFileName
37 print " --------------------------------- "
40 #print "Import %s..." % theFileName.split('/')[-1],
41 result = OpenDataFile(theFileName)
42 aProxy = GetActiveSource()
44 raise RuntimeError, "Error: can't import file."
47 aView = GetRenderView()
49 aFieldEntity = EntityType.NODE
50 aFieldName = "MODES___DEPL____________________"
52 #create Plot 3D presentations for 10 timestamps
55 aPrs = Plot3DOnField(aProxy, aFieldEntity,aFieldName , i)
57 raise RuntimeError, "Presentation is None!!!"
58 #display only current scalar map
63 # Add path separator to the end of picture path if necessery
64 if not picturedir.endswith(os.sep):
66 prs_type = PrsTypeEnum.PLOT3D
68 # Get name of presentation type
69 prs_name = PrsTypeEnum.get_name(prs_type)
70 f_prs_type = prs_name.replace(' ', '').upper()
71 # Construct image file name
72 pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext
74 # Show and record the presentation
75 process_prs_for_test(aPrs, aView, pic_name)