Re: performance issue with multiple data

Hi Mathias,

There are two stages in "rendering" a DataReference:
1. Transforming the Data to a scene graph, and
2. Java3D's rendering of the scene graph to the JPanel.
When you call the setData() method of selected
DataReferences, only those DataReferences should be
re-transformed, unless you are constantly re-autoscaling
(which can happen if there are ScalarMaps whose RealType
values are always missing).

Re-transforming is usually a lot slower than re-rendering
by Java3D, so if your application is slow then your map
outlines may be re-transformed. Are you calling setData()
for your map outlines, when you are updating your other
DataReferences? Or are you always re-autoscaling?

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


On Mon, 8 Oct 2001, Mathias [ISO-8859-1] Stü wrote:

> Hi there,
> 
> A small question about performance issues today. I have a DisplayImplJ3D
> with three different DataReferences linked to it. The first one is data from a
> BaseMapAdapter that represents a world map. The others represent the orbit of
> a satellite. The orbit is devided into small lines called GeoLocations. These
> GeoLocations are selectable via a RubberBandBoxRendererJ3D. I want to color
> the selected GeoLocations in red, the others in blue therefore I use two
> DataReferences and add them with two ConstantMap arrays.
> 
> The problem is that everytime I have a change of the selection I have to
> draw every GeoLocation and even the world map which lasts about a few seconds.
> Is there an easier way to handle this issue. Or is there a way to only update
> the two DataReferences which represent the orbit and not the one which
> represents the world map? Here's an excerpt of my code which generates the two
> orbit-references:
> 
> public void redrawGeoLocations() throws VisADException, RemoteException {
> 
>     FunctionType lonlatFunction = new FunctionType(RealType.Longitude,
> RealType.Latitude);
>     RealType indexType = RealType.getRealType("index");
>     FunctionType geoLocationsFunction = new FunctionType(indexType,
> lonlatFunction);
> 
>     // process unselected data
>     if (unselectedGeoLocations.size() > 0) {
>       FlatField[] unselectedData = new
> FlatField[unselectedGeoLocations.size()];
>       Iterator iterator = unselectedGeoLocations.iterator();
>       int i = 0;
>       while (iterator.hasNext()) {
>         GeoLocation geoLocation = (GeoLocation)iterator.next();
>         double first = (double)geoLocation.getFirstMeasurePoint().getPosX();
>         double last = (double)geoLocation.getLastMeasurePoint().getPosX();
>         Linear1DSet set = new Linear1DSet(RealType.Longitude, first, last,
> 2);
>         float[][] values = new float[][] { {
>           geoLocation.getFirstMeasurePoint().getPosY(),
>           geoLocation.getLastMeasurePoint().getPosY()
>         } };
>         unselectedData[i] = new FlatField(lonlatFunction, set);
>         unselectedData[i++].setSamples(values);
>       }
>       Integer1DSet unselectedSet = new
> Integer1DSet(unselectedGeoLocations.size());
>       FieldImpl unselectedField = new FieldImpl(geoLocationsFunction,
> unselectedSet);
>       unselectedField.setSamples(unselectedData, false);
>       unselectedReference.setData(unselectedField);
>     } else {
>       unselectedReference.setData(null);
>     }
> 
>     // process selected data
>     if (selectedGeoLocations.size() > 0) {
>       FlatField[] selectedData = new FlatField[selectedGeoLocations.size()];
>       Iterator iterator = selectedGeoLocations.iterator();
>       int i = 0;
>       while (iterator.hasNext()) {
>         GeoLocation geoLocation = (GeoLocation)iterator.next();
>         double first = (double)geoLocation.getFirstMeasurePoint().getPosX();
>         double last = (double)geoLocation.getLastMeasurePoint().getPosX();
>         Linear1DSet set = new Linear1DSet(RealType.Longitude, first, last,
> 2);
>         float[][] values = new float[][] { {
>           geoLocation.getFirstMeasurePoint().getPosY(),
>           geoLocation.getLastMeasurePoint().getPosY()
>         } };
>         selectedData[i] = new FlatField(lonlatFunction, set);
>         selectedData[i++].setSamples(values);
>       }
>       Integer1DSet selectedSet = new
> Integer1DSet(selectedGeoLocations.size());
>       FieldImpl selectedField = new FieldImpl(geoLocationsFunction,
> selectedSet);
>       selectedField.setSamples(selectedData, false);
>       selectedReference.setData(selectedField);
>     } else {
>       selectedReference.setData(null);
>     }
>   }
> 
> Thanks in advance, Mathias
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> 


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: