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 Maohai, > i have written a class to define a few shapes in visad. > currently the supported shapes are: > DOT (a pixel), STAR3 (three-point skeletal star), STAR4 > or CROSS, STAR5 (five-point), OPEN_TRIANGLE, > SOLID_TRIANGLE, OPEN_SQUARE, SOLID_SQUARE, > OPEN_CIRCLE (actually a decagon). > > > A test class, TestP.java, is adapted from Test46.java > > The classes are attached. Maybe someone will find > this useful. Great. Thanks. > A problem I find is that I wrote a class for solid decagon > using VisADQuadArray.java as a template: > > package herschel.spire.qla.plot; > import visad.VisADGeometryArray; > > public class VisAD10Array extends VisADGeometryArray { > public Object clone() { > VisAD10Array array = new VisAD10Array(); > copy(array); > return array; > } > } > > > But I get this complaint at runtime: > visad.VisADError: VisADCanvasJ2D.render: bad array class > at visad.java2d.VisADCanvasJ2D.render(VisADCanvasJ2D.java:1098) > at visad.java2d.VisADCanvasJ2D.render(VisADCanvasJ2D.java:577) > > apparently adding new shapes of this kind needs extra > work on the renderer side. Does VisAD provide a > way to make arbitrary solid shapes easily (i.e. only > define the look of it)? By far the easiest way to handle this is to decompose your decagon into triangles, and use a VisADTriangleArray. Cheers, Bill
visad
archives: