Exemplo n.º 1
0
def __notifyGui(eventType, dataId=-1, filename="", presentationId=-1, msg=""):
    medEvent = MEDCALC.MedEvent(eventType, dataId, filename, presentationId,
                                msg)
    if not eventListenerIsRunning(): return

    # Notify the GUI of the update event
    processMedEvent(medEvent)
Exemplo n.º 2
0
def MakeMeshView(meshID,
                 viewMode=MEDCALC.VIEW_MODE_DEFAULT,
                 meshMode=MEDCALC.MESH_MODE_DEFAULT):
  # Create the presentation instance in CORBA engine
  # The engine in turn creates the ParaView pipeline elements
  params = MEDCALC.MeshViewParameters(meshID, meshMode)
  try:
    presentation_id = __manager.makeMeshView(params, viewMode)
    notifyGui_addPresentation(meshID, presentation_id)
    return presentation_id
  except SALOME.SALOME_Exception as e:
    notifyGui_error("An error occurred while creating the mesh view:\n" + e.details.text)
    raise Exception(e.details.text)
Exemplo n.º 3
0
def MakeContour(proxy,
                viewMode=MEDCALC.VIEW_MODE_DEFAULT,
                scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
                colorMap=MEDCALC.COLOR_MAP_DEFAULT,
                nbContours=MEDCALC.NB_CONTOURS_DEFAULT
                ):
  params = MEDCALC.ContourParameters(proxy.id, scalarBarRange, colorMap, nbContours)
  try:
    presentation_id = __manager.makeContour(params, viewMode)
    notifyGui_addPresentation(proxy.id, presentation_id)
    return presentation_id
  except SALOME.SALOME_Exception as e:
    notifyGui_error("An error occurred while creating the contour:\n" + e.details.text)
    raise Exception(e.details.text)
Exemplo n.º 4
0
def InterpolateField(fieldId, meshId, precision, defaultValue, reverse, method,
                     nature, intersectionType):
    params = MEDCALC.InterpolationParameters(precision, defaultValue, reverse,
                                             method, nature, intersectionType)
    try:
        dataManager = medcalc.medcorba.factory.getDataManager()
        fieldHandler = dataManager.interpolateField(fieldId, meshId, params)
        from medcalc.medevents import notifyGui_interpolateField
        notifyGui_interpolateField(fieldHandler.id)
        return fieldHandler.id
    except SALOME.SALOME_Exception as e:
        notifyGui_error("An error occurred while interpolating field:\n" +
                        e.details.text)
        raise Exception(e.details.text)
Exemplo n.º 5
0
def MakeVectorField(proxy,
                  viewMode=MEDCALC.VIEW_MODE_DEFAULT,
                  scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
                  colorMap=MEDCALC.COLOR_MAP_DEFAULT
                  ):
  # Create the presentation instance in CORBA engine
  # The engine in turn creates the ParaView pipeline elements
  params = MEDCALC.VectorFieldParameters(proxy.id, scalarBarRange, colorMap)
  try:
    presentation_id = __manager.makeVectorField(params, viewMode)
    notifyGui_addPresentation(proxy.id, presentation_id)
    return presentation_id
  except SALOME.SALOME_Exception as e:
    notifyGui_error("An error occurred while creating the vector field:\n" + e.details.text)
    raise Exception(e.details.text)
Exemplo n.º 6
0
def MakeSlices(proxy,
                viewMode=MEDCALC.VIEW_MODE_DEFAULT,
                displayedComponent=MEDCALC.DISPLAY_DEFAULT,
                scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
                colorMap=MEDCALC.COLOR_MAP_DEFAULT,
                sliceOrientation=MEDCALC.SLICE_ORIENTATION_DEFAULT,
                nbSlices=MEDCALC.NB_SLICES_DEFAULT):
  # Create the presentation instance in CORBA engine
  # The engine in turn creates the ParaView pipeline elements
  params = MEDCALC.SlicesParameters(proxy.id, displayedComponent,scalarBarRange, colorMap, 
                                    sliceOrientation, nbSlices)
  try:
    presentation_id = __manager.makeSlices(params, viewMode)
    notifyGui_addPresentation(proxy.id, presentation_id)
    return presentation_id
  except SALOME.SALOME_Exception as e:
    notifyGui_error("An error occurred while creating the slices:\n" + e.details.text)
    raise Exception(e.details.text)