Re: reAutoScale

> > toggle(false) should not remove a DataRenderer and its data
> > from the auto-scaling logic.
> Are you saying that the correct behavior is that toggle(false) NOT
> affect the auto scaling?


> I want to be able to turn data visibility on and off and have the axes
> scaled to fit the visible data. I could write some code to enforce this,
> but I thought that toggling the data off should have the same effect. I
> could add/remove the DataReferences but that is less efficient.
> If toggle(false) won't do what I want, what is the best way to determine
> min/max ranges of Fields? Does VisAD have a convenient method for doing
> this?

Yes, there is the following method in visad.Data:

  public double[][] computeRanges(RealType[] reals);

which returns low and hi ranges for reals in a double[2][nreals]
array. But its more efficient if you can just compute data ranges
yourself, which is pretty easy for simple data like FlatFields.

> Would I be better off going back to add/removing DataReferences?

As Don says, you can setData(null) to remove the Data from
auto-scaling (you might also want to call the suppressExceptions(true)
method of your DataRenderer), then call setData(data) when you
want to see the data again. That would save you removing and
adding DataReferences.

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738

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