NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: user-defined color tables; cross sections

Si Stu,

> First, please remind me how to create a set of pre-defined
> color tables, and apply them to a display. I found this
> much in the mail list archive:
> 
> "you could try computing a color table:
> 
>   ColorControl control = (ColorControl) cmap.getControl();
>   float[][] table = new float[3][256];
>   for (int j=0; j<256; j++) {
>     table[0][j] = ... // j-th red
>     table[1][j] = ... // j-th green
>     table[2][j] = ... // j-th blue
>   }
>   control.setTable(table);"
> 
> then how do I use a ColorControl?

  ScalarMap rgbMap = new ScalarMap(yourRealType, Display.RGB);
  display.addMap(rgbMap);
  ColorControl control = (ColorControl) rgbMap.getControl();

> And is there a VisAD example that shows how to
> create a cross section (2D display) for a plane
> across a 3D display?  Are there pre-defined cross-sections
> like the old drafting elevation-plan-section, or is the
> cross section on an arbitrary plane?

There is no example in the distribution.  You create a
Gridded2DSet with manifold dimension = 2 that defines a
grid of points on your plane slice, then resample() your
FlatField to that Gridded2DSet, then display the FlatField
returned by resample().  I think Doug Lindholm has done it
so you might talk to him - I know you guys work across the
street from each other ;)

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


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