Re: Weird display problem

One more note-

What platform are you running under?  If Windows, are you using
Direct-X or Open-GL.  I've seen some flakiness like what you see
under Windows running JDK 1.4 and the Direct-X version of Java 3D.
I haven't pinned down the exact way this happens, but sometimes
I lose all toggling.

Don

Tennessee James Leeuwenburg wrote:
Hi all,

I'd like to understand a little more about how DisplayImpl's do their
threading.

I am adding layers - that is a (scalarmap, datareference) - to the
display in batches. In terms of my application a model is made up of a
number of layers. Models get added or removed, and as this happens each
layer also gets added and removed.

The strange behaviour that I am getting is some data is becoming
inaccessible. If I add the layers for one model, I am able to toggle
them on and off with renderer.toggle(). Which is great. However, if I
add a second model, the new layers cannot be toggled until I remove the
first model.

Which is odd. So, I am suspicious that there is a deadlock or thread
conflict occurring which is preventing the data from displaying, but I
don't understand the execution logic of DisplayImpl nearly well enough.
My procedure for adding a model is to loop over the list of layers, and
add each one to the display. There is also some GUI logic in there, but
I can replicate the error even with the GUI stuff stripped out. VisAD is
definately getting the data and the scalarmaps, because I am printing
out Dispay.getMapVector() and getting results. And, as soon as I remove
the reference to all the layers from the new model, the data appears all
of a sudden.

I'm totally baffled, and can't see why this might be occurring. Is there
anything I should be aware of in terms of having multiple renderers
floating around, or some common problems that people run into with VisAD
threading?

Sorry if this is all very vague, but like I said, I'm baffled. As far as
my code is concerned, adding a new model is as simple as adding some
more layers - models are a concept that VisAD is not aware of! So, why
would it work for multiple layers in one model?

--
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************