Hi Harry,
We have a similar situation and have the following solutions.
1) Keep the DataRenderer that pass to display.addReferences(). When you
want to turn the visibility on or off, call renderer.toggle(boolean);
2) There is no method in displayImpl to add multiple references at once
if you want to be able to inidividually turn references on or off. For
each reference that you want to be able to toggle, you will need a
seperate call to DisplayImpl.addReferences.
A tactic that we use to spped up the adding multiple references is to
call display.disableAction() at the start of when we want to do some
bulk manipulation of the display and display.enableAction() when you
have finished.
Hope this helps,
Luke Matthews.
PS: Adding and removing references can be the solution if you have
memory problems and toggling does not occur too often.
--------------------
Luke Matthews
Bureau of Meteorology, Australia.
l.matthews AT bom.gov.au
Harry Hochheiser wrote:
I have a VisAD scene with a significant number (> 400) of
DataReferenceImpl objects. Based on user interactions, i'd like to
selectively toggle the visibility of individual items in this set.
Currently, I'm doing this by calling display.removeReference() when I
want to make a reference invisible, and addReference() when I want it
to reappear.
This works fine, but it is a bit slow, particularly when - as is often
the case - i want to adjust the visibility of multiple
DataReferenceImpls all at once.
So, two questions:
1) is this the appropriate way to adjust the visibility of
DataReferenceImpl objects? if not, what is?
2) is there any way to do a bulk adding/removing of references?
thanks,
harry