[vtkusers] Problems with vtkPanel (Java) under Windows

Jeff Lee jeff at cdnorthamerica.com
Tue Mar 29 06:50:47 EST 2005



Christopher Auer wrote:

>Hello!
>
>We are currently doing our thesis about an application using VTK under
>Java. We are usually displaying more than one vtkPanel on a Frame (but
>the problem I am going to describe here also raises its head with only
>one vtkPanel in use). For our GUI we are using the SWT
>(http://www.eclipse.org) which is a Java library with bindings to the
>native GUI library (via a DLL/.so for MFC/GTK+/Motif etc.). Under SWT
>there is a SWT-AWT bridge to display AWT/Swing components under SWT -
>this usually works very fine and seems not to be the root of the problem
>(the problem does also occur with pure AWT application). We are using
>Java 1.5.
>
>But to shorten the story, here is my problem: When I start up the
>application everything is working fine. All the vtkPanels behave the way
>they should do (rotating and other user interactions work). I am
>currently just displaying the surface of the objects - so nothing
>special. In my application the user is able to change the displayed
>object (e.g. Sphere -> Plane). So what I do is to remove the old actor
>(e.g. Sphere) from the scene and then add the new actor (e.g. Plane).
>But after that the vtkPanel does not react anymore. Instead the
>vtkOutputWindow raises, with always the same error message:
>
>ERROR: In C:\VTK\Rendering\vtkWin32OpenGLRenderWindow.cxx ...
>...wglMakeCurrent... 
>
>The rest of the error message is hidden and I cannot resize the
>vtkOutputWindow. But I know that the error message has something to do
>we already used resources or something like that.
>
>To me it seems that there are several concurrent accesses to the
>vtkPanel object, but I am running out of ideas (and time!).
>  
>
Hi Christopher,
If you haven't already done this, make sure that the thread doing the 
add/remove is the event thread.  Can you post your awt example which 
exhibits the problem?
-Jeff

>What I've tried so far:
>
>* created my own vtkPanel which derives from vtkPanel provides its own
>removeActor/addActor-method with Lock()/UnLock()-calls wrapped around
>the actual Remove/AddActor-calls (I tried also to use Lock/UnLock only
>for the RemoveActor-method)
>* I tried VTK4.2 and VTK4.4-latest-release (both with exactly the same
>result)
>* Created pure AWT-Frames
>
>The only (impure) solution is to set the actors invisible instead of
>removing them. But the errors also occurs after calling
>vtkPanel.Render() to update the display after a change.
>
>The searched the vtk mailinglists and the internet and tried the
>solutions (see above). So my last hope is this mailinglist.
>
>Has anyone an idea how to solve the problem?
>
>Thanks in advance!
>
>
>
>Christopher Auer
>  
>



More information about the vtkusers mailing list