[vtkusers] wxVTKRenderWindowInteractor + vtkImageViewer2

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Wed Sep 3 13:09:48 EDT 2003


Charl P. Botha wrote:
> On Wed, 2003-09-03 at 14:43, Mathieu Malaterre wrote:
> 
>>	To sum up quickly the problem, wxWindows need a special vtkRenderWindow 
>>which is build within wxVTKRWI. Whereas vtkImageViewer2 built its own 
>>too and override the one previously build. I first thought of adding a 
>>method: vtkImageViewer2::SetWindowInfo, but I found it ugly for 
>>vtk-users -furthermore it would introduce differences between a standart 
>>vtkRWI-.
> 
> 
> Is there a reason why you had to move the SetWindowInfo() code out of
> the constructor to the OnPaint()?

	If you look at vtkImageViewer2::SetupInteractor, you'll see that the 
renderwindow is set in this method. So I had to find a method called
after that -and still invisible for vtk-users-.
	Furthermore, for my c++ class I had so many problems if I set the 
window ID too early that's why I decided to set it up only on the very 
last minute (=during the OnPaint call).

But as I said, I am open to any other suggestion, the conditions are:

* There shouldn't be any explicit call to SetWindowInfo outside of wxVTKRWI

* Allow other VTK filters to set their own vtkRenderWindow

I also thought of adding a 'def SetRenderWindow (...):' but we have to
be very carefull not to collide with the '__getattr__(self, attr)' ...

> 
>>	Therefore I change the wxVTKRWI.py code so that it uses the 
>>vtkRenderWindow from the vtkGenericRWI, even if it has been set by 
>>another filter, for example vtkImageViewer2.
> 
> 
> Okay, this sounds okay.  The essential change you have made is that
> wxVTKRWI doesn't keep its own binding to the RenderWindow, right?

exactly.

> Ps. Have you thought of a solution for the vtkImageViewer2 parallel
> projection problem yet?

Well, I left on my web site a patch:

http://www.creatis.insa-lyon.fr/~malaterre/vtk/iv2.patch

I am still convinced that ParallelProjectionOn has nothing to do with
texture mapping, or else could someone shed some light on it ?

Thanks,
Mathieu





More information about the vtkusers mailing list