Salome HOME
7dd0fe9463a5f89fe1e18b27542bb88fa98d3b0b
[modules/med.git] / src / MEDCalc / tui / medpresentation.py
1 # Copyright (C) 2011-2016  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 medcalc
21 import MEDCALC
22 from medcalc.medevents import notifyGui_addPresentation
23
24 __manager = medcalc.medcorba.factory.getPresentationManager()
25
26 def MakeScalarMap(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
27   # Create the presentation instance in CORBA engine
28   # The engine in turn creates the ParaView pipeline elements
29   params = MEDCALC.ScalarMapParameters(proxy.id, viewMode)
30   presentation_id = __manager.makeScalarMap(params)
31   notifyGui_addPresentation(proxy.id, presentation_id)
32 #
33
34 def MakeContour(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
35   params = MEDCALC.ContourParameters(proxy.id, viewMode)
36   presentation_id = __manager.makeContour(params)
37   notifyGui_addPresentation(proxy.id, presentation_id)
38 #
39
40 def MakeVectorField(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
41   params = MEDCALC.VectorFieldParameters(proxy.id, viewMode)
42   presentation_id = __manager.makeVectorField(params)
43   notifyGui_addPresentation(proxy.id, presentation_id)
44 #
45
46 def MakeSlices(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
47   params = MEDCALC.SlicesParameters(proxy.id, viewMode)
48   presentation_id = __manager.makeSlices(params)
49   notifyGui_addPresentation(proxy.id, presentation_id)
50 #
51
52 def MakeDeflectionShape(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
53   params = MEDCALC.DeflectionShapeParameters(proxy.id, viewMode)
54   presentation_id = __manager.makeDeflectionShape(params)
55   notifyGui_addPresentation(proxy.id, presentation_id)
56 #
57
58 def MakePointSprite(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
59   params = MEDCALC.PointSpriteParameters(proxy.id, viewMode)
60   presentation_id = __manager.makePointSprite(params)
61   notifyGui_addPresentation(proxy.id, presentation_id)
62 #