Salome HOME
[MEDCalc] Add presentation parameters
[modules/med.git] / src / MEDCalc / tui / medpresentation.py
index 0395826b586f6d214a8a72bfd7147bb567ae0f44..fd1100627f61c7e55ea099ec3023c95110d7480d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2015  CEA/DEN, EDF R&D
+# Copyright (C) 2011-2016  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -23,35 +23,67 @@ from medcalc.medevents import notifyGui_addPresentation
 
 __manager = medcalc.medcorba.factory.getPresentationManager()
 
-def MakeScalarMap(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
+def MakeScalarMap(proxy,
+                  viewMode=MEDCALC.VIEW_MODE_DEFAULT,
+                  displayedInfo=MEDCALC.DISPLAY_DEFAULT,
+                  scalarBarRange=MEDCALC.ScalarBarRange(MEDCALC.SCALAR_BAR_RANGE_VAL_MIN_DEFAULT,
+                                                        MEDCALC.SCALAR_BAR_RANGE_VAL_MAX_DEFAULT),
+                  colorMap=MEDCALC.COLOR_MAP_DEFAULT
+                  ):
   # Create the presentation instance in CORBA engine
   # The engine in turn creates the ParaView pipeline elements
-
-  print "In MakeScalarMap (Python)"
-
-  print "viewMode:", viewMode, " [", type(viewMode), "]"
-
-  params = MEDCALC.ScalarMapParameters(proxy.id, viewMode)
+  params = MEDCALC.ScalarMapParameters(proxy.id, viewMode, displayedInfo, scalarBarRange, colorMap)
   presentation_id = __manager.makeScalarMap(params)
   notifyGui_addPresentation(proxy.id, presentation_id)
 #
 
-def MakeIsoSurface():
-  print "Not implemented yet"
+def MakeContour(proxy,
+                viewMode=MEDCALC.VIEW_MODE_DEFAULT,
+                displayedInfo=MEDCALC.DISPLAY_DEFAULT,
+                scalarBarRange=MEDCALC.ScalarBarRange(MEDCALC.SCALAR_BAR_RANGE_VAL_MIN_DEFAULT,
+                                                      MEDCALC.SCALAR_BAR_RANGE_VAL_MAX_DEFAULT),
+                colorMap=MEDCALC.COLOR_MAP_DEFAULT,
+                nbContours=MEDCALC.NB_CONTOURS_DEFAULT
+                ):
+  params = MEDCALC.ContourParameters(proxy.id, viewMode, displayedInfo, scalarBarRange, colorMap, nbContours)
+  presentation_id = __manager.makeContour(params)
+  notifyGui_addPresentation(proxy.id, presentation_id)
 #
 
-def MakeVectorField():
-  print "Not implemented yet"
+def MakeVectorField(proxy,
+                    viewMode=MEDCALC.VIEW_MODE_DEFAULT
+                    ):
+  params = MEDCALC.VectorFieldParameters(proxy.id, viewMode)
+  presentation_id = __manager.makeVectorField(params)
+  notifyGui_addPresentation(proxy.id, presentation_id)
 #
 
-def MakeSlices():
-  print "Not implemented yet"
+def MakeSlices(proxy,
+               viewMode=MEDCALC.VIEW_MODE_DEFAULT,
+               orientation=MEDCALC.SLICE_ORIENTATION_DEFAULT,
+               nbSlices=MEDCALC.NB_SLICES_DEFAULT
+               ):
+  params = MEDCALC.SlicesParameters(proxy.id, viewMode, orientation, nbSlices)
+  presentation_id = __manager.makeSlices(params)
+  notifyGui_addPresentation(proxy.id, presentation_id)
 #
 
-def MakeDeflectionShape():
-  print "Not implemented yet"
+def MakeDeflectionShape(proxy,
+                        viewMode=MEDCALC.VIEW_MODE_DEFAULT
+                        ):
+  params = MEDCALC.DeflectionShapeParameters(proxy.id, viewMode)
+  presentation_id = __manager.makeDeflectionShape(params)
+  notifyGui_addPresentation(proxy.id, presentation_id)
 #
 
-def MakePointSprite():
-  print "Not implemented yet"
+def MakePointSprite(proxy,
+                    viewMode=MEDCALC.VIEW_MODE_DEFAULT,
+                    displayedInfo=MEDCALC.DISPLAY_DEFAULT,
+                    scalarBarRange=MEDCALC.ScalarBarRange(MEDCALC.SCALAR_BAR_RANGE_VAL_MIN_DEFAULT,
+                                                          MEDCALC.SCALAR_BAR_RANGE_VAL_MAX_DEFAULT),
+                    colorMap=MEDCALC.COLOR_MAP_DEFAULT,
+                    ):
+  params = MEDCALC.PointSpriteParameters(proxy.id, viewMode, displayedInfo, scalarBarRange, colorMap)
+  presentation_id = __manager.makePointSprite(params)
+  notifyGui_addPresentation(proxy.id, presentation_id)
 #