]> SALOME platform Git repositories - modules/paravis.git/blob - test/demo10.py
Salome HOME
Merge from BR_PARAVIS_DEV 29Dec09
[modules/paravis.git] / test / demo10.py
1
2 if not ('servermanager' in dir()):
3   from pvsimple import *
4
5 import os
6
7 def demo10(fname, impth):
8     """This method demonstrates the Contour filter."""
9
10     reader = ExodusIIReader(FileName=fname)
11     v=GetActiveView()
12     ##Show(reader, view=v)
13     contourFilter = Contour(reader)
14     contourFilter.ContourBy = 'Temp'
15     contourFilter.Isosurfaces
16     ##[]
17
18     contourFilter.Isosurfaces = [400]
19     camera = GetActiveCamera()
20     camera.Position = [0., 60., -33]
21     camera.Elevation(-70)
22  
23     dp2 = GetDisplayProperties(contourFilter)
24     contourFilter.PointData[:]
25     ##[Array: Temp, Array: V, Array: Pres, Array: AsH3, Array: GaMe3, Array: CH4, Array: H2]
26
27     temp = contourFilter.PointData[0]
28     temp.GetRange()
29     ## (399.99999999999994, 400.00000000000006)
30
31     dp2.LookupTable = MakeBlueToRedLT(399.999,400)
32     dp2.ColorAttributeType = 'POINT_DATA'
33     dp2.ColorArrayName = 'Temp'
34     Render()
35     WriteImage(filename = (impth + "contourFilter_1.png"), view=v, Magnification=2)
36
37     pres = contourFilter.PointData[2]
38     pres.GetRange()
39     ##(0.0074376024368978605, 0.02845284189526591)
40
41     dp2.LookupTable = MakeBlueToRedLT(0.007437602, 0.02845284)
42     dp2.ColorArrayName = 'Pres'
43     Render()
44     WriteImage(filename = (impth + "contourFilter_2.png"), view=v, Magnification=2)
45
46     dp1 = GetDisplayProperties(reader)
47     dp1.Representation = 'Wireframe'
48     dp1.LookupTable = dp2.LookupTable
49     dp1.ColorAttributeType = 'POINT_DATA'
50     dp1.ColorArrayName = 'Pres'
51     Show(reader)
52  
53     camera.Dolly(0.5)
54     Render()
55     camera.Elevation(-150)
56     Render()
57     WriteImage(filename = (impth + "contourFilter_3.png"), view=v, Magnification=2)
58
59     
60 testdir = os.getenv("TESTDIR")
61 pvdata = os.getenv("PVDATA")
62
63 if __name__ == "__main__":
64  demo10(fname=pvdata+"/Data/disk_out_ref.ex2", impth=testdir+"/Pic/")