[vtkusers] removeActor() causes error ("wglMakeCurrent failed...")
Markus Ott
ott-markus at t-online.de
Wed Jun 30 03:06:02 EDT 2010
Hi Sebastien,
thank you for your quick reply. I already removed the repaint() thing,
this was a mistake.
Using SwingUtility.invokeLater(...) fixed my problem. I didn't have to
use it any time before but now i understand the problem. Thank you for
your answer. This would have taken me ages to find the bug by myself :)
Maybe i'm not the only one who was not aware of the EDT
http://www.javalobby.org/java/forums/t55004.html
So thank you very much for your help, now i understand the problem :)
Regards,
Markus
Sebastien Jourdain schrieb:
> Hi Marcus,
>
> Anyway, the main issue was that you overflow the EDT queue by calling
> repaint() inside a paintXXX method.
>
> What I meant before was, did you build your Swing components in the
> EDT as it should be ? Which means, did you used
> SwingUtility.invokeLater(....) ? And also is VTK is managed only by
> only one thread ??? Normaly, bad management of java thread with VTK
> imply a crash, but it could also have been a cause of paint error...
>
> Seb
>
> EDT = Event Dispatch Thread
>
>
>
> On Mon, Jun 28, 2010 at 8:58 AM, Markus Ott <ott-markus at t-online.de> wrote:
>> I'm calling removeActor() from the JPanel class to which the vtkCanvas
>> is added. The actor even gets removed from the canvas but nevertheless
>> the error occurs. What do you mean by "occur in the EDT"? I'm not
>> starting any other threads manually.
>>
>>
>> Sebastien Jourdain schrieb:
>>> Does the removeActor occurs in the EDT ?
>>>
>>> On Sat, Jun 26, 2010 at 11:44 AM, Markus Ott <ott-markus at t-online.de> wrote:
>>>> Hi vtkusers!
>>>>
>>>> We're using VTK within Java having a vtkCanvas containing some
>>>> vtkArrowSource Objects. Pushing them onto the canvas works fine but
>>>> removing them causes an error. We just call the method stated below:
>>>>
>>>> public void removeActor(vtkActor actor){
>>>> renWin.GetRenderer().RemoveActor(actor);
>>>> renWin.repaint();
>>>> }
>>>>
>>>> After that the vtkOutputWindow pops up (please see attached image) with
>>>> an error message which i can't read completely since the program crashed:
>>>>
>>>> "wglMakeCurrent failed ..."
>>>>
>>>> I can't see what we did wrong. Any ideas?
>>>>
>>>> Regards,
>>>> Markus
>>>>
>>>>
>>>> _______________________________________________
>>>> Powered by www.kitware.com
>>>>
>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>
>>>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>>>
>>
>
More information about the vtkusers
mailing list