import medcalc
import MEDCALC, SALOME
from medcalc.medevents import notifyGui_addPresentation, notifyGui_removePresentation, notifyGui_error, notifyGui_modifyPresentation
+from functools import reduce
__manager = medcalc.medcorba.factory.getPresentationManager()
#
def __GetGENERICParameters(tag, presentation_id):
- exec "params = __manager.get%sParameters(presentation_id)" % tag
+ exec("params = __manager.get%sParameters(presentation_id)" % tag)
return params
GetMeshViewParameters = lambda pres_id: __GetGENERICParameters("MeshView", pres_id)
def __UpdateGENERIC(tag, presentation_id, params):
- exec "__manager.update%s(presentation_id, params)" % tag
+ exec("__manager.update%s(presentation_id, params)" % tag)
notifyGui_modifyPresentation(presentation_id)
UpdateMeshView = lambda pres_id, params: __UpdateGENERIC("MeshView", pres_id, params)
@return the average cell size
"""
bb, nCells = obj.GetDataInformation().GetBounds(), obj.GetDataInformation().GetNumberOfCells()
- bb = zip(bb[::2], bb[1::2])
+ bb = list(zip(bb[::2], bb[1::2]))
deltas = [x[1]-x[0] for x in bb]
## Filter out null dimensions:
avgDelta = sum(deltas) / 3.0
@return the center of the domain as the central point of the bounding box
"""
bb = obj.GetDataInformation().GetBounds()
- bb = zip(bb[::2], bb[1::2])
+ bb = list(zip(bb[::2], bb[1::2]))
mids = [x[0] + 0.5*(x[1]-x[0]) for x in bb]
return mids
"""
from math import sqrt
bb = obj.GetDataInformation().GetBounds()
- bb = zip(bb[::2], bb[1::2])
+ bb = list(zip(bb[::2], bb[1::2]))
origin = [x[0] + 0.5*(x[1]-x[0]) for x in bb]
deltas = [x[1]-x[0] for x in bb]
# Compute extent of slices: