Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: LineStripArray

Hi Doug,

> How do I create a VisADLineStripArray? I have a list of coordinates and
> I want a shape that connects the dots. I have used a VisADLineArray but
> I have to list each coordinate twice:
> 
> shape.coordinates = new float[] {x1,y1,z1, x2,y2,z2,
>                                  x2,y2,z2, x3,y3,z3};
> 
> Will a VisADLineStripArray allow me to do something like
> 
> shape.coordinates = new float[] {x1,y1,z1, x2,y2,z2, x3,y3,z3};
> 
> and if so, what should I use for vertexCount?
> 
> When I do the latter with vertexCount = 3, I get an error:
> 
> java.lang.NullPointerException:
> . . .

Did you fill in VisADLineStripArray.stripVertexCounts?  Like this:

  ((VisADLineStripArray) array).stripVertexCounts = new int[1];
  ((VisADLineStripArray) array).stripVertexCounts[0] = array.vertexCount;

If there is more than one strip in the array (i.e., lift the pen
between strips) then the values in stripVertexCounts should sum
to vertexCount.

Please let me know if this does not solve your problem.

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

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690