[vtkusers] Abort a rendering process in java

avtkuser at arcor.de avtkuser at arcor.de
Wed Dec 1 06:28:45 EST 2010


Hello VTK users,

I want to abort a rendering process by clicking into the scene with the mouse to start or continue the interaction.

I am using VTK in a java environment and I added my own java mouse listeners to the vtkPanel.

My problem is, that the vtkFixedPointVolumeRayCastMapper downsamples the volume during interaction, but it takes a very long time to resample the volume after releasing the mouse button.
During this time no further interaction is possible.

I found some old posts in the mailing list concerning this issue.
But I couldn't find a useful answer.

I tried to add an observer to the renderWindow 
       
                renWin.AddObserver("AbortCheckEvent", this, "checkAbortRender");

and implemented the checkAbortRender method:

                void checkAbortRender() {
                      if (renWin.GetEventPending() != 0) {
                           renWin.SetAbortRender(1);
                      }
                }

But this doesn't work. GetEventPending always returns 0.
I also tried to use the java MouseClickHandler.isLeftMouseButtonPressed() instead of GetEventPending.
Then the SetAbortRender method is called, but the mouse interaction has still no effect on the scene until the render process is done.

My OS is Windows 7 (64 bit). 
Are there any other ways to abort a rendering process?

Thanks in advance for any kind of help.

Michael



More information about the vtkusers mailing list