[vtkusers] wxVTKRenderWindow + vtk3DWidget + vtkGenericRenderWindowInteractor

Charl P. Botha c.p.botha at its.tudelft.nl
Mon May 13 09:22:21 EDT 2002


It seems the problem was in vtkGenericRenderWindowInteractor.h.  Could one
of the developers please apply the attached diff?

The vtkTypeRevisionMacro call has vtkObject as the superclass instead of
vtkRenderWindowInteractor, which is why the Python code refuses to accept it
as parameter to vtk3DWidget::SetInteractor()

Thanks,
Charl

On Mon, May 13, 2002 at 02:42:56PM +0200, Charl P. Botha wrote:
> I'm trying to use vtk3DWidgets with the wxVTKRenderWindow.  Because the
> wxVTKRenderWindow doesn't make use of a RenderWindowInteractor at all, using
> interactor styles or vtk3DWidgets is not possible by default.  However, some
> kind soul wrote vtkGenericRenderWindowInteractor to remedy this problem (I
> think).
> 
> Now, I tried to setup a vtkPlaneWidget (in Python) to use with the
> wxVTKRenderWindow.  Following an extract:
> 
> # cur_pipe['vtkActor3'] is an actor which has already been added to a renderer
> # self._rws[0] is the wxVTKRenderWindow that we're working with
> pw = vtk.vtkPlaneWidget()
> pw.SetProp3D(cur_pipe['vtkActor3'])
> pw.PlaceWidget()
> rwi = vtk.vtkGenericRenderWindowInteractor()
> rwi.SetRenderWindow(self._rws[0].GetRenderWindow())
> pw.SetInteractor(rwi)
> pw.On()
> 
> The problem is that at the line pw.SetInteractor(rwi) I get:
> 14:32:02:     pw.SetInteractor(rwi)
> 14:32:02:  ValueError: method requires a vtkRenderWindowInteractor, a
> vtkGenericRenderWindowInteractor was provided.
> 
> Does anyone have any ideas how I could go about to fix this?
> 
> I've been thinking of writing a real wxwindows vtk RenderWindowInteractor
> (in the style of cpbotha.net/vtkFlRenderWindowInteractor) and wrap that.
> However, I'd prefer using the available code.

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
-------------- next part --------------
--- vtkGenericRenderWindowInteractor.h~	Tue Apr 16 16:13:17 2002
+++ vtkGenericRenderWindowInteractor.h	Mon May 13 15:15:20 2002
@@ -34,7 +34,7 @@
 {
 public:
   static vtkGenericRenderWindowInteractor *New();
-  vtkTypeRevisionMacro(vtkGenericRenderWindowInteractor,vtkObject);
+  vtkTypeRevisionMacro(vtkGenericRenderWindowInteractor,vtkRenderWindowInteractor);
   void PrintSelf(ostream& os, vtkIndent indent);
   
   // Description:


More information about the vtkusers mailing list