1 # Copyright (C) 2010-2016 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # This case corresponds to: /visu/imps/B1 case
22 from paravistest import datadir, texturesdir
23 from presentations import *
27 file_path = datadir + "fra.med"
28 pvsimple.OpenDataFile(file_path)
29 med_reader = pvsimple.GetActiveSource()
31 entity = EntityType.NODE
32 field_name = "VITESSE"
36 scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp_id)
38 scalarmap.Visibility = 1
41 # Set representation type to Point Sprite
42 scalarmap.Representation = 'Point Sprite'
45 scalarmap.RenderMode = 'Texture'
46 # COMMENTED OUT! Currently this does not work as Point Sprite ParaView plugin is not correctly wrapped to Python.
47 # As soon as problem is fixed, below code probably need to be modified, but it should be something similar.
49 #texture = vtk.vtkTexture()
50 #pngReader = vtk.vtkPNGReader()
51 #pngReader.SetFileName(os.path.join(texturesdir, "texture1.png"))
52 #texture.SetInputConnection(pngReader.GetOutputPort())
53 #texture.InterpolateOn()
54 #scalarmap.Texture = texture