Salome HOME
Copyrights update 2015.
[modules/med.git] / src / MEDOP / tui / xmedpy / tests / test_xmed_visualisation.py
1 #!/usr/bin/env python
2 #  -*- coding: iso-8859-1 -*-
3 # Copyright (C) 2007-2015  CEA/DEN, EDF R&D
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
18 #
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #
21
22 # This file is a set of basic use case to test (from the python
23 # context) the functions developped in XMED and MED modules for the
24 # visualization of fields using VISU or PARAVIS.
25 #
26 # (gboulant - 6/7/2011)
27 #
28
29 import xmed
30 from xmed import properties
31 from xmed.fieldproxy import FieldProxy
32
33 # Load some test data in the MedDataManager
34 filepath  = properties.testFilePath
35 fieldHandlerList = xmed.dataManager.addFieldsFromFile(filepath)
36
37 def setup():
38     """
39     This function defines a set of field variable for quick tests in
40     the python console. You just have to execute the function to get
41     the variables defined in the global context.
42     """
43     fh1=fieldHandlerList[0]
44     fh2=fieldHandlerList[1]
45     f1 = FieldProxy(fh1)
46     f2 = FieldProxy(fh2)
47     return fh1, fh2, f1, f2
48
49 # Setup for quick tests in the python console
50 fh1, fh2, f1, f2 = setup()
51
52 def TEST_driver_visu():
53     from xmed import fieldtools
54     fieldtools.view_using_visu(f1)
55
56 if __name__ == "__main__":
57     TEST_driver_visu()