Re: RangeControl for double precision values

Hi Don,

There's no good way to change the default DataRenderers to use
doubles without making everything doubles in them. I actually
tried that back in 1998 when VisAD was new, but memory use was
outrageous.

One possibility is a custom DataRenderer, but that's a lot of
work.

You can't just use a Time Unit with an epoch other than 1 Jan
1970, since values are converted to default Units for RealTypes
inside the default DataRenderers (this is necessary so that
ScalarMaps can be applied uniformly to RealType values with
different Units).

So it may come down to a hack: adding a new RealType, say Time2,
to your Data with default Unit that is seconds since some epoch
that makes float values work, and values for this new RealType
that are redundant with the Time values.

Another possibility is a scaled version of Display.SelectRange.
SelectRange itself is not scaled, so values of RealTypes are
simply copied to SelectRange values by ScalarMaps. However, an
alternate, "ScaledSelectRange" would allow applications to map
an interval of double values to the float ScaledSelectRange
values, which could then be selected. This would be a significant
job.

So I think the easiest solution, if it can work for you, would
be a new Time2 RealType.

Cheers,
Bill

On Thu, 6 Jan 2005, Don Murray wrote:

> Hi-
>
> I'm trying to use the RangeControl with some data in a
> FlatField that is stored as doubles (DoubleSet used for RangeSets).
> These are time values and need to have the double precision.
> I use double values to setRange on RangeControl, but it looks
> like the range is being set using float versions.  What happens
> is that my data depicted by the RangeControl does not always
> match up with a position indicator that is controlled by the
> animation (which does use doubles).  Looking through the
> Shadow classes assembleSelect passes in floats and uses the
> getRange method on RangeControl which returns float range
> values.
>
> Is there any way around this problem?
>
> Don
> *************************************************************
> Don Murray                               UCAR Unidata Program
> dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
> (303) 497-8628                              Boulder, CO 80307
> http://www.unidata.ucar.edu/staff/donm
> "There's someone in my head, but it's not me"    Roger Waters
> *************************************************************
>
>
>