Re: Text/Shape Question

Hi Bill, thanks for that.

I have copied the getLongitudes() out of VisADGeometry array and changed it so the VisADGeomtery is passed to the method. I am also passing the real type I would like and after a rough first cut it appears to be working okay. My method signature looks something like:

public static float [] getValues(DataRenderer renderer, boolean bulk, VisADGeometryArray array, RealType type) throws VisADException

if anyone is interested in using this code I can email it along when I have finsihed.

By the way, I also finished writing the offscreen rendering stuff and it works fine in versions of java3d >= 1.2.1. How it basicaly works is it attaches an offscreen canvas to the same view as the onscreen canvas. Then when you need to capture an image, the onscreen canvas tells the offscreen canvas to render and hey presto you have a beautiful image captured offscreen. No effects from overlaying dialogs or anything.

again if anyone is interested I can write back with a more in depth explanation and code.

Thanks again for help,

Luke.


Bill Hibbard wrote:

Hi LUke,

At the moment we have a need to determine the bounding box of text
rendered on the display. At the moment I have explored
PlotText.render_font(). But I have got stuck converting the shape
coordinates back into lat/lons. So my question is this, Is there any way
to convert a coordinate in a VisADGeometryArray to the coordinate system
used on the display?

There's an example of doing this in the getLongitudes() method
of visad/VisADGeometryArray.java. But note this isn't for the
most general case, which may include a CoordinateSystem on the
data side (it does show how to deal with a CoordinateSystem on
the display side, and how to deal with ScalarMap scaling). But
usually (lat, lon) are the reference of a data side
CoordinateSystem, in which case it isn't necessary to deal
with the data side CoordinateSystem.

Cheers,
Bill