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.
Hi John, > Is there a better way to generate shapes? I saw a class named > VisADGeometryArray, but I am not sure how to use the class. In VisAD you'd create shapes using ScalarMaps of RealTypes to Display.Shape. RealType values are quantized according to a 1-D Set and used as indices into an array of shapes, represented as VisADGeometryArrays (these are analogous to GeometryArray and its subclasses in Java3D). VisADGeometryArrays may be VisADPointArray, VisADLineArray, VisADLineStripArray, VisADTriangleArray, VisADTriangleStripArray, VisADIndexedTriangleStripArray, or VisADQuadArray8, for various types of geometry. You can control the color and scale of shapes by mapping other RealTypes to Display.RGB, Display.Red, etc, and Display.ShapeScale. There is not yet a Display.ShapeAngle for controlling orientation, but we are planning to create that and a Display.TextAngle. There are examples of how to use shapes in Test46.java and Test47.java in the visad/examples directory. If you want color to vary over the shape, you can do it by setting values into the colors array in VisADGeometryArray. If you want color to be determined by the value of a variable (i.e., a RealType) then you have to generate your shapes as FlatFields rather than using ScalarMaps to Display.Shape. For example, a surface in 3-D would be a FlatField whose domain Set is a Gridded3DSet or Irregular3DSet with manifold dimension = 2, and whose range RealTypes would be ScalarMap'ed to color DisplayRealTypes (Display.RGB, Display.Red, etc). > ... generate a shape, not to mention manipulating it. You can combine shape with direct manipulation DataRenderers, as in visad/rabin/Rain.java and visad/bom/TrackManipulation.java. Note in the latter a VisADLineArray is constantly recomputed in response to user manipulation and put into the display via a call to ShapeControl.setShape(). If you use FlatFields to represent your shapes, then to manipulate them the RealTuple tied to your DirectManipulationRenderer would trigger a CellImpl that would recompute the domain Set and FlatField and pass it to the setData() of a DataReference linked to the display. Note there are some examples a bit like this in visad/benjamin/Galaxy.java, notably 'CellImpl red_cursor_cell'. 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
visad
archives: