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: Assigning color to a user defined grid

> . . .
> I have been able to draw the grid using the Gridded2DSet and the
> UnionSet constructs, similiar to the Rivers example (in
> visad/examples/Rivers.java). Each set of corners is used to form a 
> Gridded2DSet, and the UnionSet is used to form a disjoint set of
> these.
> 
> How do I now create a function from a Gridded2DSet, to a node and then
> from a node to a node value, then to RGB ? 

All current implementations of visad.Function assign values
to vertices rather than regions, so it is a little complex.

Rather than constructing a UnionSet of your Gridded2DSets,
construct each Gridded2DSet as the boundary of one node,
construct a FlatField with that Gridded2DSet as its domain
Set and range values that you can map to red, green and blue.

Then construct a FieldImpl whose range values are all the
FlatFields, and whose domain is a simple index. The MathType
of the FieldImpl would be something like:

  (index -> ((x, y) -> (r, g, b)))

and each FlatField would have MathType ((x, y) -> (r, g, b)).
Let the range r, g, b values be constant for each FlatField,
to give constant color to each node.

Good luck,
Bill



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