Salome HOME
Merge Python 3 porting.
[modules/paravis.git] / test / VisuPrs / dump_study / B5.py
1 # Copyright (C) 2010-2016  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/dump_study/B5 case
21
22 import os
23 import sys
24 import salome
25
26 # class SalomeSession(object):
27 #     def __init__(self):
28 #         import runSalome
29 #         import sys
30 #         sys.argv += ["--show-desktop=1"]
31 #         sys.argv += ["--splash=0"]
32 #         sys.argv += ["--modules=MED,VISU,PARAVIS"]
33 #         clt, d = runSalome.main()
34 #         port = d['port']
35 #         self.port = port
36 #         return
37 #     pass
38
39
40 # 1. Opening saved study
41
42 # run Salome
43 #salome_session = SalomeSession()
44 salome.salome_init()
45
46 file_name = os.path.join(os.path.dirname(sys.argv[0]), "test1.hdf")
47 salome.myStudy.Open(file_name)
48
49 # 3. Find IsoSurfaces
50 from pvsimple import *
51 import presentations
52 obj = FindSource('IsoSurfaces')
53 if obj is None:
54     print("FAILED: can't find IsoSurfaces!!!")
55
56 # 4. Remove med reader object and all other sources
57 for obj in list(GetSources().values()):
58     presentations.delete_pv_object(obj)
59
60 # 5. Check results
61 obj = FindSource('ScalarMap')
62 if obj is not None:
63     print("FAILED: ScalarMap was not deleted!!!")