Salome HOME
[MEDCalc] Add presentation parameters
[modules/med.git] / src / MEDCalc / tui / medpresentation.py
index 7c665b505220a0cc7075aae54d222d3e5fd29eb1..fd1100627f61c7e55ea099ec3023c95110d7480d 100644 (file)
@@ -23,47 +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 MakeContour(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
-  print "Not implemented yet"
-  #params = MEDCALC.ContourParameters(proxy.id, viewMode)
-  #presentation_id = __manager.makeContour(params)
-  #notifyGui_addPresentation(proxy.id, presentation_id)
+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(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
+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(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
-  print "Not implemented yet"
-  #params = MEDCALC.SlicesParameters(proxy.id, viewMode)
-  #presentation_id = __manager.makeSlices(params)
-  #notifyGui_addPresentation(proxy.id, presentation_id)
+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(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
+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(proxy, viewMode=MEDCALC.VIEW_MODE_REPLACE):
-  params = MEDCALC.PointSpriteParameters(proxy.id, viewMode)
+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)
 #