[vtkusers] Problem with vtkPanel
Antoine Boivin
a.boivin at m2m-ndt.com
Thu Apr 28 08:05:05 EDT 2005
Thanks for your help Jeff, Your solution are more secure but the problem
is not here. The use memory continue to increase during running of program.
I have make many test and I thinks that is the "Lock()" function of vtkPanel
which use memory and make the program instable.
I have modified vtkPanel.java for not use this function but I don't
understand
the goal of this function.
My program run correctly, it's the main thing.
----- Original Message -----
From: "Jeff Lee" <jeff at cdnorthamerica.com>
To: "VTK-User" <vtkusers at vtk.org>
Sent: Wednesday, April 27, 2005 5:37 PM
Subject: Re: [vtkusers] Problem with vtkPanel
> Hi Antoine,
> When you change the texture on one thread and render on the event
> thread, you have the potential for a render to occur while you are
> changing the texture. For example, say you start your UpdateImage
> thread, and it runs and schedules the Render on the event thread. The
> render hasn't yet occured, and then you start the UpdateImage thread
> again. Now you have the potential for a render to occur while you are
> changing the pipeline on another thread - bad things can happen. I
> would guess that if you did something like
>
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> for (int isurf = 0; isurf<vue.getSurfaces().size(); isurf++)
> {
> ((Surface)view.getSurfaces().get(isurf)).updateTabImage();
> }
> view.Render();
> }
> });
> then things would behave better, but your performance might degrade. A
> more advanced solution would be to mutex the Render method with the
> method which updates the textures. i.e. you cannot render while the
> textures are being updated. You only have to mutex the part of
> updateTabImages which touch the vtk pipeline. HTH,
> -Jeff
>
> Antoine Boivin wrote:
>
>> Hi vtk users!
>> I use vtk with Java and I use a vtkPanel.
>> In the renderer of this vtkPanel I insert a surface with a texture.
>> In an other thread, I update this texture every time.
>> This program run correctly with a good frame rate
>> but some minutes ago, the surface disappear of the view.
>> I notice an increase of the memory use by the program
>> when the function "Render" of the vtkPanel are call.
>> That is the problem?
>> I don't understand what occurs and why the texture disappear?
>> This is the source of my Thread :
>> public class UpdateImage extends Thread
>> {
>> private view3D view; //view3D extends vtkPanel
>> public boolean running=true;
>> public boolean visu=true;
>> public UpdateImage(View3D _view)
>> {
>> view = _view;
>> }
>> public void run()
>> { try
>> {
>> while(running)
>> {
>> for (int isurf = 0; isurf<vue.getSurfaces().size(); isurf++)
>> {
>> ((Surface)view.getSurfaces().get(isurf)).updateTabImage();
>> }
>> SwingUtilities.invokeAndWait(new Runnable()
>> {
>> public void run()
>> {
>> view.Render();
>> }
>> });
>> }
>> }
>> catch (Exception e){
>> System.out.println("Exception="+e);
>> }
>> }
>> }
>> Thanks for your help!
>> Antoine
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>This is the private VTK discussion list. Please keep messages on-topic.
>>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>Follow this link to subscribe/unsubscribe:
>>http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages on-topic.
> Check the 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