[vtkusers] vtkScalarBarActor & Disappearing actors.

Ron Inbar ron at mediguide.co.il
Mon Mar 10 12:42:58 EST 2003


Hi Mike and Joey,

If I understand the problem correctly, I think I know what causes it and how
to deal with it.  It has to do with VTK's OpenGL implementation.

Each vtkRenderWindow has an OpenGL context associated with it.
Among other stuff, the OpenGL context holds display lists, texture objects
and color maps.

Display lists are OpenGL objects that encapsulate geometrical objects of
arbitrary complexity.  vtkOpenGLPolyDataMapper maps vtkPolyData objects into
OpenGL display lists, and then renders those display lists.  OpenGL
identifies each display list by an integer.

The problem is this: by default, display lists are not shared among
different OpenGL contexts; so if you render the same vtkPolyData in two
different vtkRenderWindows, you will end up with two display lists, which,
most probably, will not have the same identifier.  But
vtkOpenGLPolyDataMapper assumes (incorrectly) that the same identifier will
work every time, so sometimes it attempts to render a display list using an
identifier from the wrong context.  This usually leads to the wrong object
popping up in the window, and in other cases to objects disappearing.
OpenGL has a ready-made solution to this problem: there is a mechanism that
enables all contexts (i.e., windows) to share the same display lists and to
identify them using the same numbers.  The only trouble is that VTK, for
reasons unknown to me, doesn't use this list-sharing mechanism.

I successfully patched VTK 3.1 to fix this bug.  As soon as I find some free
time I will do the same for VTK 4.x, and then I'll send you the patched
sources.  I hope they will make it into the next release.

-----Original Message-----
From: Michael Bonner [mailto:bonner10 at llnl.gov] 
Sent: Thursday, March 06, 2003 10:23 PM
To: Joey Mukherjee
Cc: vtkusers at public.kitware.com
Subject: Re: [vtkusers] vtkScalarBarActor & Disappearing actors.


Yes. I have two look up tables, one for block actors and one for cylinder 
actors. All actors that represent blocks share a common lut, and each 
vtkDataArray that is created to contain block scalars uses that lut.

Are you sharing a look up table among your actors?

-Mike

At 01:11 PM 3/6/2003 -0600, Joey Mukherjee wrote:

>On Thursday, March 6, 2003, at 12:43  PM, Michael Bonner wrote:
>
>>My problem is that some blocks or cylinders are just not visible 
>>sometimes. If I change data array & rebuild the table more blocks or 
>>cylinders may disappear, or they may be restored. There does not seem to 
>>be any ryhme or reason to what is happening. Sometimes, if I change the 
>>array & rebuild, a rectangle of color appears in another(unrelated) 
>>renderer in another section of the view port.
>>
>>I have been dealing with this problem for a while and my current working 
>>solution is to keep the scalar bars in another vtkRenderWindow. If I do 
>>this their are no problems whatsoever.
>
>>Currently I have no idea why this is happening. If anybody at all has any 
>>idea or has seen any thing similar I would greatly appreciate it.
>
>I am seeing something similar.  Are you sharing lookup tables among your 
>actors?
>
>Joey


_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

This e-mail message has been sent by MediGuide
and is for the use of the intended recipients only.
The message may contain privileged or confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
and notify the sender immediately.



More information about the vtkusers mailing list