Salome HOME
Merge branch 'origin/agy/feedbackads140304'
[modules/paravis.git] / test / VisuPrs / bugs / C9.py
1 # Copyright (C) 2010-2013  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.
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/bugs2/C9 case
21
22 from paravistest import datadir, pictureext, get_picture_dir
23 from presentations import *
24 import paravis
25 import pvsimple
26
27 my_paravis = paravis.myParavis
28
29 # 1. Import MED file
30 med_file_path = datadir + "TimeStamps.med"
31
32 my_paravis.ImportFile(med_file_path)
33 med_reader = pvsimple.GetActiveSource()
34
35 if med_reader is None:
36     raise RuntimeError, "TimeStamps.med was not imported!!!"
37
38 # 2. Creation of presentations
39 mesh_on_cells = MeshOnEntity(med_reader, "dom", EntityType.CELL)
40 if mesh_on_cells is None : 
41     raise RuntimeError, "Mesh presentation is None!!!"
42
43 view = pvsimple.GetRenderView()
44 display_only(mesh_on_cells, view)
45 reset_view(view)
46
47 mesh_on_cells.Representation = 'Wireframe'
48
49 scalar_map = ScalarMapOnField(med_reader, EntityType.NODE, "vitesse", 1)
50 if scalar_map is None : 
51     raise RuntimeError, "ScalarMap presentation is None!!!"
52
53 scalar_map.Visibility = 1
54 pvsimple.Render()
55
56 pvsimple.Delete(scalar_map)
57 pvsimple.Render()