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
24 __manager = medcalc.medcorba.factory.getPresentationManager()
26 def MakeScalarMap(proxy,
27 viewMode=MEDCALC.VIEW_MODE_DEFAULT,
28 displayedInfo=MEDCALC.DISPLAY_DEFAULT,
29 scalarBarRange=MEDCALC.ScalarBarRange(MEDCALC.SCALAR_BAR_RANGE_VAL_MIN_DEFAULT,
30 MEDCALC.SCALAR_BAR_RANGE_VAL_MAX_DEFAULT),
31 colorMap=MEDCALC.COLOR_MAP_DEFAULT
33 # Create the presentation instance in CORBA engine
34 # The engine in turn creates the ParaView pipeline elements
35 params = MEDCALC.ScalarMapParameters(proxy.id, viewMode, displayedInfo, scalarBarRange, colorMap)
36 presentation_id = __manager.makeScalarMap(params)
37 notifyGui_addPresentation(proxy.id, presentation_id)
38 return presentation_id
41 def MakeContour(proxy,
42 viewMode=MEDCALC.VIEW_MODE_DEFAULT,
43 displayedInfo=MEDCALC.DISPLAY_DEFAULT,
44 scalarBarRange=MEDCALC.ScalarBarRange(MEDCALC.SCALAR_BAR_RANGE_VAL_MIN_DEFAULT,
45 MEDCALC.SCALAR_BAR_RANGE_VAL_MAX_DEFAULT),
46 colorMap=MEDCALC.COLOR_MAP_DEFAULT,
47 nbContours=MEDCALC.NB_CONTOURS_DEFAULT
49 params = MEDCALC.ContourParameters(proxy.id, viewMode, displayedInfo, scalarBarRange, colorMap, nbContours)
50 presentation_id = __manager.makeContour(params)
51 notifyGui_addPresentation(proxy.id, presentation_id)
52 return presentation_id
55 def MakeVectorField(proxy,
56 viewMode=MEDCALC.VIEW_MODE_DEFAULT
58 params = MEDCALC.VectorFieldParameters(proxy.id, viewMode)
59 presentation_id = __manager.makeVectorField(params)
60 notifyGui_addPresentation(proxy.id, presentation_id)
61 return presentation_id
65 viewMode=MEDCALC.VIEW_MODE_DEFAULT,
66 orientation=MEDCALC.SLICE_ORIENTATION_DEFAULT,
67 nbSlices=MEDCALC.NB_SLICES_DEFAULT
69 params = MEDCALC.SlicesParameters(proxy.id, viewMode, orientation, nbSlices)
70 presentation_id = __manager.makeSlices(params)
71 notifyGui_addPresentation(proxy.id, presentation_id)
72 return presentation_id
75 def MakeDeflectionShape(proxy,
76 viewMode=MEDCALC.VIEW_MODE_DEFAULT
78 params = MEDCALC.DeflectionShapeParameters(proxy.id, viewMode)
79 presentation_id = __manager.makeDeflectionShape(params)
80 notifyGui_addPresentation(proxy.id, presentation_id)
81 return presentation_id
84 def MakePointSprite(proxy,
85 viewMode=MEDCALC.VIEW_MODE_DEFAULT,
86 displayedInfo=MEDCALC.DISPLAY_DEFAULT,
87 scalarBarRange=MEDCALC.ScalarBarRange(MEDCALC.SCALAR_BAR_RANGE_VAL_MIN_DEFAULT,
88 MEDCALC.SCALAR_BAR_RANGE_VAL_MAX_DEFAULT),
89 colorMap=MEDCALC.COLOR_MAP_DEFAULT,
91 params = MEDCALC.PointSpriteParameters(proxy.id, viewMode, displayedInfo, scalarBarRange, colorMap)
92 presentation_id = __manager.makePointSprite(params)
93 notifyGui_addPresentation(proxy.id, presentation_id)
94 return presentation_id