1 # Copyright (C) 2011-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
22 from medcalc.medevents import notifyGui_addPresentation, notifyGui_removePresentation
24 __manager = medcalc.medcorba.factory.getPresentationManager()
26 def MakeScalarMap(proxy,
27 viewMode=MEDCALC.VIEW_MODE_DEFAULT,
28 displayedComponent=MEDCALC.DISPLAY_DEFAULT,
29 scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
30 colorMap=MEDCALC.COLOR_MAP_DEFAULT
32 # Create the presentation instance in CORBA engine
33 # The engine in turn creates the ParaView pipeline elements
34 params = MEDCALC.ScalarMapParameters(proxy.id, displayedComponent, scalarBarRange, colorMap)
35 presentation_id = __manager.makeScalarMap(params, viewMode)
36 notifyGui_addPresentation(proxy.id, presentation_id)
37 return presentation_id
40 #def MakeContour(proxy,
41 # viewMode=MEDCALC.VIEW_MODE_DEFAULT,
42 # displayedComponent=MEDCALC.DISPLAY_DEFAULT,
43 # scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
44 # colorMap=MEDCALC.COLOR_MAP_DEFAULT,
45 # nbContours=MEDCALC.NB_CONTOURS_DEFAULT
47 # params = MEDCALC.ContourParameters(proxy.id, viewMode, displayedComponent, scalarBarRange, colorMap, nbContours)
48 # presentation_id = __manager.makeContour(params)
49 # notifyGui_addPresentation(proxy.id, presentation_id)
50 # return presentation_id
53 #def MakeVectorField(proxy,
54 # viewMode=MEDCALC.VIEW_MODE_DEFAULT
56 # params = MEDCALC.VectorFieldParameters(proxy.id, viewMode)
57 # presentation_id = __manager.makeVectorField(params)
58 # notifyGui_addPresentation(proxy.id, presentation_id)
59 # return presentation_id
62 #def MakeSlices(proxy,
63 # viewMode=MEDCALC.VIEW_MODE_DEFAULT,
64 # orientation=MEDCALC.SLICE_ORIENTATION_DEFAULT,
65 # nbSlices=MEDCALC.NB_SLICES_DEFAULT
67 # params = MEDCALC.SlicesParameters(proxy.id, viewMode, orientation, nbSlices)
68 # presentation_id = __manager.makeSlices(params)
69 # notifyGui_addPresentation(proxy.id, presentation_id)
70 # return presentation_id
73 #def MakeDeflectionShape(proxy,
74 # viewMode=MEDCALC.VIEW_MODE_DEFAULT
76 # params = MEDCALC.DeflectionShapeParameters(proxy.id, viewMode)
77 # presentation_id = __manager.makeDeflectionShape(params)
78 # notifyGui_addPresentation(proxy.id, presentation_id)
79 # return presentation_id
82 #def MakePointSprite(proxy,
83 # viewMode=MEDCALC.VIEW_MODE_DEFAULT,
84 # displayedComponent=MEDCALC.DISPLAY_DEFAULT,
85 # scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
86 # colorMap=MEDCALC.COLOR_MAP_DEFAULT,
88 # params = MEDCALC.PointSpriteParameters(proxy.id, viewMode, displayedComponent, scalarBarRange, colorMap)
89 # presentation_id = __manager.makePointSprite(params)
90 # notifyGui_addPresentation(proxy.id, presentation_id)
91 # return presentation_id
94 def RemovePresentation(presentation_id):
95 ok = __manager.removePresentation(presentation_id)
97 notifyGui_removePresentation(presentation_id)
100 def GetScalarMapParameters(presentation_id):
101 # TODO: check that pres id is really a ScalarMap ...
102 params = __manager.getScalarMapParameters(presentation_id)
105 def UpdateScalarMap(presentation_id, params):
106 __manager.updateScalarMap(presentation_id, params)