Salome HOME
Merge branch 'akl/tests_update'
[modules/paravis.git] / test / demo_15_med.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
21 # ATTENTION. This script is prepared for the future not for current moment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22
23 if not ('servermanager' in dir()):
24   from pvsimple import *
25
26 import os
27
28 def LoadMultipleFiles_med(FilePath, FilePrefix):
29
30   TETRA_dom_fl = MEDReader( FileName = [FilePath + FilePrefix + '1' + '.med',
31                                                                                FilePath + FilePrefix + '2' + '.med', 
32                                                                                FilePath + FilePrefix + '3' + '.med',
33                                                                                FilePath + FilePrefix + '4' + '.med',
34                                                                                FilePath + FilePrefix + '5' + '.med',
35                                                                                FilePath + FilePrefix + '6' + '.med'])
36   TETRA_dom_fl.CellArrays = ['Pression', 'Temp.C', 'VitesseX']
37   TETRA_dom_fl.GlobalFamilyStatus = ['1 1 1', '1 2 1', '1 3 1', '1 4 1', '1 5 1']
38   TETRA_dom_fl.GlobalEntityStatus = ['0 203', '0 304']
39
40   rv = GetRenderView()
41   a1_Temp_C_PVLookupTable = CreateLookupTable( RGBPoints=[-1.3, 0.23, 0.3, 0.75, 200., 0.70, 0.016, 0.15],
42                                                                                             VectorMode='Magnitude',
43                                                                                             ColorSpace='Diverging',
44                                                                                             ScalarRangeInitialized=1.0 )
45
46   dr = Show()
47   dr.EdgeColor = [0.0, 0.0, 0.50]
48   dr.SelectionCellLabelColor = [0.0, 1.0, 0.0]
49   dr.SelectionPointLabelJustification = 'Center'
50   dr.SelectionCellLabelJustification = 'Center'
51   dr.ScalarOpacityFunction = []
52   dr.ColorArrayName = 'Temp.C'
53   dr.SelectionLineWidth = 2.0
54   dr.ScalarOpacityUnitDistance = 2.6738860338205099
55   dr.SelectionCellLabelFontSize = 24
56   dr.SelectionColor = [1.0, 0.0, 1.0]
57   dr.SelectionRepresentation = 'Wireframe'
58   dr.LookupTable = a1_Temp_C_PVLookupTable
59
60   rv.CameraPosition = [50.0, -29.75, 267.55447959748415]
61   rv.CameraFocalPoint = [50.0, -29.75, 0.0]
62   rv.CameraClippingRange = [248.95893480150932, 291.60779679144639]
63   rv.CenterOfRotation = [50.0, -29.75, 0.0]
64   rv.CameraParallelScale = 69.24819492232271
65
66   Render()
67
68 testdir = os.getenv("TESTDIR")
69 pvdata = os.getenv("PVDATA")
70
71 if __name__ == "__main__":
72   LoadMultipleFiles_med(FilePath=testdir+"/TETRA_domaine_fluide/", FilePrefix="TETRA_domaine_fluide")