You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defGetObserverPriority(vtk_object, event_name: str) ->int:
'''Given a vtk object and an event name, return the priority of the observer In Python it is impossible to get an observer from the object programmatically, but the string representation of the object contains the observers with priority. This code reads the string representation and returns the priority as integer. '''string=str(vtk_object)
ss=string.split("vtkObserver")
eventObservers= []
forsinss:
lines=s.split("\n")
eo= {}
forlineinlines:
try:
k,v=line.split(":")
k=k.strip()
v=v.strip()
ifkin ['Event', 'EventName', 'Command', 'Priority', 'Tag']:
eo[k] =veventObservers.append(eo)
except:
passforelineventObservers:
ifel['EventName'] ==event_name:
returnint(el['Priority'])
The text was updated successfully, but these errors were encountered:
We should add this code in the utils for vtk. See https://discourse.vtk.org/t/consume-a-vtk-event-in-python/13052/3
The text was updated successfully, but these errors were encountered: