[vtkusers] [VTK + wxPython + Linux] bug : Reparent with widgetcontaining wxVTKRenderWindow
Benoit Regrain
benoit.regrain at creatis.insa-lyon.fr
Wed Feb 12 11:59:26 EST 2003
From: "Prabhu Ramachandran" <prabhu at aero.iitm.ernet.in>
> >>>>> "BR" == Benoit Regrain <benoit.regrain at creatis.insa-lyon.fr> writes:
>
> BR> I have made some tests concerning reparenting. With the method
> BR> SetNextWindowId placed in vtkXOpenGLRenderWindow we can change
> BR> properly the drawing window id. To use it in python, it is
> BR> necessary to have method SetNextWindowInfo, like we have
> BR> SetWindowInfo.
>
> It is possible to add a SetNextWindowInfo method to the
> vtkXOpenGLRenderWindow class but the question is will this be a cross
> platform solution or an X-only solution? How would you achieve
> re-parenting under Win32 or Mac OS X? Or is that already possible to
> do? In any case I think since vtkXOpenGLRenderWindow already provides
> a SetNextWindowId method, adding a SetNextWindowInfo should be fine.
>
> The other issue is that VTK is due for a 4.2 release shortly and I am
> not sure making this addition at this time is a good idea (although I
> don't see it introducing any new problems). So maybe after the 4.2
> release this can be added?
Concerning the method SetNextWindowId, it exists for Win32, WinCE and X platforms.
The SetNextWindowInfo will only make the same work than SetNextWindowId, as SetWindowInfo makes the same work than SetWindowId.
The variable modified by this method (variable this->NextWindowId) is afterused by WindowRemap, only.
Under Windows, it works perfectly without that mecanism. But under linux, we must use it to supprim errors.
Concerning Mac Carbon platform, the WindowRemap exists, but generates an error... (I don't have Mac environement to test it)
Therefore, add the SetWindowInfo in vtkRenderWindow class will not add problems.
I think it can be made for the 4.2 release.
>
> BR> I would know why you don't have write the method
> BR> SetNextWindowId in class vtkRenderWindow, and if you could
> BR> make that and add the method SetNextWindowInfo. What must I
> BR> make or send to you to have these modifications in the next
> BR> VTK nightly ???
>
> Nothing really. In this case I think the change should be fairly easy
> to make. You just need to get the attention of one of the
> developers. :)
>
> BR> I must work a little to python class wxVTKRenderWindow to have
> BR> properly code.
>
> The wxVTKRenderWindow class and the Interactor class are not perfect.
> Fixes are most welcome. :)
>
> cheers,
> prabhu
To combine with these little modifications, wxVTKRenderWindow must be modified :
- variable self.__Created is replaced by self.__Handle wich is the Handle id of current window used.
- test in Render method to verify the handle used by VTK. It is made her because a reparent on an ancestor of vtkRenderWindow will change Handle id
I remenber you a change that I had made before concerning the default size of vtkRenderWindow at creation of vwVTKRenderWindow...
After some tests, I have found an other error which is :
- when I reparent a wx widget wich have more than one vtkRenderWindow inside, I obtain a segmentation fault under linux (windows didn't have problems).
- the segmentation fault appears always in the same case depending of position and order of displays (in the window).
To solve that (and I don't know if it's the best method because I'm a beginner in XLib), I'm closing the display when the drawing context is destroyed.
I you can find files that I have modified and tested on windows2000 and Linux :
- vtkRenderWindow.h
- vtkXOpenGLRenderWindow.h
- vtkXOpenGLRenderWindow.cxx
- vtkWin32OpenGLRenderWindow.h
- vtkWin32OpenGLRenderWindow.cxx
- wxVTKRenderWindow.py
at the URL : www.creatis.insa-lyon.fr/~regrain/VTK/patch
I hope have omitted nothing. And if have any questions concerning that, I'm
to your disposal.
Greatings to consider that before the next release :-D
Benoit Regrain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030212/e7bb490c/attachment.htm>
More information about the vtkusers
mailing list