[vtkusers] Using vtkRenderWindow::SetExitMethod to close vtkRenderWindow and not kill the application!

Anwar Upal upal at me.queensu.ca
Thu Oct 18 11:33:16 EDT 2001


Hi all:

I am using a SUN Solaris station.  I am using C++ for programming an 
application, and I am using V, a GUI library for the interface. My V 
interface gives control to VTK to render a model and I would like to gain 
control after the rendering is done. You had replied to a message from a 
user with the same problem but the details were missing. I have been unable 
to find any detailed documentation on the SetExitMethod and how to use it 
properly.

 From the postings I have pieced together the following code.  The 
newExitMethod method is defined in the class called carpus.  This class 
also includes the function which calls the vtkRenderWindowInteractor called 
iren.

     void carpus::newExitMethod(void *arg)
     {
     }


And the code in the class carpus which calls vtkRenderWindowInteractor is 
as shown below

     vtkRenderWindow* renWindow = vtkRenderWindow::New();
     ...
     vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
     iren->SetRenderWindow(renWindow);
     iren->SetExitMethod (newExitMethod,NULL);


gcc compiler gives the following error:

     carpus.cpp: In method `void carpus::carpalRender(char *)':
     carpus.cpp:1287: no matching function for call to 
`vtkRenderWindowInteractor::SetExitMethod (const char[14], NULL)'
      /usr/local/ces/sunos/include/vtk/graphics/vtkRenderWindowInteractor.h:212: 

           candidates are: void 
vtkRenderWindowInteractor::SetExitMethod(void (*)(void *), void *)

How can I fix this error?  And what should my custom method newExitMethod 
do to give me back control (and just close the vtk window instead of 
terminating my application and user interface).

Any help would be appreciated even if it is simply to refer me to a better 
source?  Thank you in advance.

Peace,
Anwar Upal




More information about the vtkusers mailing list