Salome HOME
Merge branch 'V7_dev'
[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 salome.myStudyManager.Close(salome.myStudy)
46
47 file_name = os.path.join(os.path.dirname(sys.argv[0]), "test1.hdf")
48 opened_study = salome.myStudyManager.Open(file_name)
49 salome.myStudy = opened_study
50
51 # 3. Find IsoSurfaces
52 from pvsimple import *
53 obj = FindSource('IsoSurfaces')
54 if obj is None:
55     print "FAILED: can't find IsoSurfaces!!!"
56
57 # 4. Remove med reader object and all other sources
58 for obj in GetSources().values():
59     Delete(obj)
60
61 # 5. Check results
62 obj = FindSource('ScalarMap')
63 if obj is not None:
64     print "FAILED: ScalarMap was not deleted!!!"