[wxVTK] wxVTK patch
Brought to you by:
malat
From: Sander N. <nie...@st...> - 2008-12-02 14:31:49
|
Dear all, We recently made some improvements to our wxVTK based application and in the process were able to solve several problems. This email contains a patch (against wxVTK 1.3) to wxVTKRenderWindowInteractor to solve those problems. * Timers work again First of all, we created a fix for the Timer creation problem (there were several mails about this on the list). The attached patch works correctly with VTK 5.2 and should still work correctly with previous VTK versions as well. The trick is to create implementations for the new InternalCreateTimer() and InternalDestroyTimer() functions. Note that this patch still assumes that we only have one timer associated with our interactor (having multiple timers for an interactor is a new VTK feature). It should not be too difficult to extend the patch to support multiple timers; this requires keeping a list of wxTimers in wxVTKRenderWindowInteractor. * GTK2 crashes or visualization problems Thanks to a colleague of mine we were also able to solve the issue that was discussed on January 2nd from this year. As Marco summarized back then, there were two non-working situations. --- with wxGTK 2.8 *without* your patches I have visualization problems (the ones I described in my previous emails) but the application does not crash; with wxGTK 2.8 *with* your patches the visualization is ok but the application crashes as with wxGTK 2.6; --- The 'your patches' was where we also use wxGLCanvas for wxWidgets 2.8 (whereas wxVTK 1.3 derives from wxWindow for wxWidgets 2.8). The solution is to start with the patch we already had (so, use wxGLCanvas as base class), and add a workaround to make sure that VTK does not crash anymore. The crash happened because VTK was destroying the X Display (which it shouldn't). The trick is to explicitly set the display on the vtkRenderWindowInteractor, thus telling VTK that it no longer 'owns' the X Display and is no longer responsible for its destruction. I would be interested to know if this patch works for other people on this list and if so, if this patch could be added to wxVTK CVS. Best regards, Sander Niemeijer |