Salome HOME
fa3339be78594fafc3b44020f14726233f6b9927
[modules/paravis.git] / test / VisuPrs / bugs / D3.py
1 # Copyright (C) 2010-2014  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/bugs3/D3 case
21
22 from paravistest import datadir
23 from presentations import *
24 import pvserver as paravis
25 import pvsimple
26
27 my_paravis = paravis.myParavis
28
29 # 1. Import of the "LinearStaticsSTA9.resu.med" file
30 med_file_path = datadir + "LinearStaticsSTA9.resu.med"
31 my_paravis.ImportFile(med_file_path)
32 med_reader = pvsimple.GetActiveSource()
33 if med_reader is None:
34     raise RuntimeError, "LinearStaticsSTA9.resu.med was not imported!!!"
35
36 view = pvsimple.GetRenderView()
37
38 # Creation of colored "DeformedShape" presentations, based on time stamps of "RESU_DEPL" field
39 presentation = DeformedShapeOnField(med_reader, EntityType.NODE, 'RESU____DEPL____________________', 1, is_colored=True)
40 if presentation is None : 
41     raise RuntimeError, "DeformedShapeOnField Presentation is None!!!"
42
43 display_only(presentation, view)
44 reset_view(view)
45   
46 # Creation of colored "Vectors" presentations, based on time stamps of "RESU_DEPL" field
47 presentation = VectorsOnField(med_reader, EntityType.NODE, 'RESU____DEPL____________________', 1, is_colored=True)
48 if presentation is None : 
49     raise RuntimeError, "Vectors Presentation is None!!!"
50
51 display_only(presentation, view)
52 reset_view(view)
53
54 # Creation of colored "DeformedShapeAndScalarMap" presentations, based on time stamps of "RESU_DEPL" field
55 presentation = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, 'RESU____DEPL____________________', 1)
56 if presentation is None : 
57     raise RuntimeError, "DeformedShapeAndScalarMap Presentation is None!!!"
58
59 display_only(presentation, view)
60 reset_view(view)
61
62 # Creation of colored "CutPlanes" presentations, based on time stamps of "RESU_DEPL" field
63 presentation = CutPlanesOnField(med_reader, EntityType.NODE, 'RESU____DEPL____________________', 1)
64 if presentation is None : 
65     raise RuntimeError, "CutPlanes Presentation is None!!!"
66
67 display_only(presentation, view)
68 reset_view(view)
69
70