Salome HOME
initial commit from paravisaddons
[tools/paravisaddons_common.git] / src / ComplexMode / MoveMesh.py
1 # Copyright (C) 2021  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 #### import the simple module from the paraview
21 from paraview.simple import *
22 #### disable automatic camera reset on 'Show'
23 paraview.simple._DisableFirstRenderCameraReset()
24
25 # create a new 'MED Reader'
26 #f3d_gouttedomed = MEDReader(FileName='/home/H87074/TMP52/f3d_gouttedo.med')
27 #f3d_gouttedomed.AllArrays = ['TS0/MESH/ComSup0/COTE Z@@][@@P1', 'TS0/MESH/ComSup0/VITESSE U@@][@@P1', 'TS0/MESH/ComSup0/VITESSE V@@][@@P1', 'TS0/MESH/ComSup0/VITESSE W@@][@@P1']
28 #f3d_gouttedomed.AllTimeSteps = ['0000', '0001', '0002', '0003', '0004', '0005', '0006', '0007', '0008', '0009', '00010']
29
30 source = GetActiveSource()
31 renderView1 = GetActiveViewOrCreate('RenderView')
32 # get animation scene
33 animationScene1 = GetAnimationScene()
34
35 # update animation scene based on data timesteps
36 animationScene1.UpdateAnimationUsingDataTimeSteps()
37
38 # create a new 'Calculator'
39 calculator1 = Calculator(Input=source)
40
41 # Properties modified on calculator1
42 calculator1.ResultArrayName = 'DisplacementsZ'
43 calculator1.Function = 'COTE Z-coordsZ'
44
45 # get color transfer function/color map for 'DisplacementsZ'
46 displacementsZLUT = GetColorTransferFunction('DisplacementsZ')
47
48 # show data in view
49 #calculator1Display = Show(calculator1, renderView1)
50
51 # hide data in view
52 Hide(source, renderView1)
53
54 # show color bar/color legend
55 #calculator1Display.SetScalarBarVisibility(renderView1, True)
56
57 # get opacity transfer function/opacity map for 'DisplacementsZ'
58
59 # create a new 'Warp By Scalar'
60 warpByScalar1 = WarpByScalar(Input=calculator1)
61 warpByScalar1.Scalars = ['POINTS', 'DisplacementsZ']
62