[vtkusers] checking to see if a vtkRenderWindow still exists from python

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Nov 28 16:09:09 EST 2001


I am writing a matlab style plot interface to vtkXYPlot in python and
want to emulate the 

figure(1)

figure(2)

behavior in matlab.  These functions create a new figure window if it
doesn't exist and will make the indicated figure current if it does. 

I am storing instances of vtkRenderWindows by figure number to
 implement this behavior.  I need to know if the window has been
 closed by the user, and I am trying to make this independent of the
 type of render window used.

Is there a way to find out if a render window is still available?

I tried 

  try:
    #__vtkPlotInfo is a global object to manage state
    __vtkPlotInfo.get_current_renwin().Render()
  except:
    #the window doesn't exist
    ...do something...

But this aborted execution; ie there was no exception thrown.

Any suggestions?  I also have access to the renderers and vtkXYPlot
objects.

Thanks,
John Hunter




More information about the vtkusers mailing list