visad
Class Contour2D

java.lang.Object
  extended by visad.Contour2D

public class Contour2D
extends Object

Contour2D is a class equipped with a 2-D contouring function.


Field Summary
protected  int cols
           
protected  Contour2D con
           
static int DIFFICULTY_THRESHOLD
           
static float DIMENSION_THRESHOLD
           
static int EASY
           
static int HARD
           
protected  int[] num1
           
protected  int[] num2
           
protected  int[] num3
           
protected  int[] num4
           
protected  int rows
           
protected  int scale
           
protected  boolean showgrid
           
protected  float[][] vx1
           
protected  float[][] vx2
           
protected  float[][] vx3
           
protected  float[][] vx4
           
protected  float[][] vy1
           
protected  float[][] vy2
           
protected  float[][] vy3
           
protected  float[][] vy4
           
protected  int whichlabels
           
 
Constructor Summary
Contour2D()
           
 
Method Summary
static void contour(float[] g, int nr, int nc, float[] values, float lowlimit, float highlimit, float base, boolean dash, float[][] vx1, float[][] vy1, float[][] vz1, int maxv1, int[] numv1, float[][] vx2, float[][] vy2, float[][] vz2, int maxv2, int[] numv2, float[][] vx3, float[][] vy3, float[][] vz3, int maxv3, int[] numv3, float[][] vx4, float[][] vy4, float[][] vz4, int maxv4, int[] numv4, byte[][] auxValues, byte[][] auxLevels1, byte[][] auxLevels2, byte[][] auxLevels3, boolean[] swap, boolean fill, float[][] tri, byte[][] tri_color, float[][][] grd_normals, float[][] tri_normals, byte[][] interval_colors, float[][][][] lbl_vv, byte[][][][] lbl_cc, float[][][] lbl_loc, double scale_ratio, double label_size, byte[] labelColor, Gridded3DSet spatial_set)
          Compute contour lines for a 2-D array.
static void contour(float[] g, int nr, int nc, float interval, float lowlimit, float highlimit, float base, float[][] vx1, float[][] vy1, float[][] vz1, int maxv1, int[] numv1, float[][] vx2, float[][] vy2, float[][] vz2, int maxv2, int[] numv2, float[][] vx3, float[][] vy3, float[][] vz3, int maxv3, int[] numv3, float[][] vx4, float[][] vy4, float[][] vz4, int maxv4, int[] numv4, byte[][] auxValues, byte[][] auxLevels1, byte[][] auxLevels2, byte[][] auxLevels3, boolean[] swap, boolean fill, float[][] tri, byte[][] tri_color, float[][][] grd_normals, float[][] tri_normals, byte[][] interval_colors, float[][][][] lbl_vv, byte[][][][] lbl_cc, float[][][] lbl_loc, double scale_ratio, double label_size, byte[] labelColor, Gridded3DSet spatial_set)
          Compute contour lines for a 2-D array.
static float[] intervalToLevels(float interval, float low, float high, float ba, boolean[] dash)
          Returns an array of contour values and an indication on whether to use dashed lines below the base value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

con

protected Contour2D con

whichlabels

protected int whichlabels

showgrid

protected boolean showgrid

rows

protected int rows

cols

protected int cols

scale

protected int scale

num1

protected int[] num1

num2

protected int[] num2

num3

protected int[] num3

num4

protected int[] num4

vx1

protected float[][] vx1

vy1

protected float[][] vy1

vx2

protected float[][] vx2

vy2

protected float[][] vy2

vx3

protected float[][] vx3

vy3

protected float[][] vy3

vx4

protected float[][] vx4

vy4

protected float[][] vy4

EASY

public static final int EASY
See Also:
Constant Field Values

HARD

public static final int HARD
See Also:
Constant Field Values

DIFFICULTY_THRESHOLD

public static final int DIFFICULTY_THRESHOLD
See Also:
Constant Field Values

DIMENSION_THRESHOLD

public static final float DIMENSION_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

Contour2D

public Contour2D()
Method Detail

contour

public static void contour(float[] g,
                           int nr,
                           int nc,
                           float interval,
                           float lowlimit,
                           float highlimit,
                           float base,
                           float[][] vx1,
                           float[][] vy1,
                           float[][] vz1,
                           int maxv1,
                           int[] numv1,
                           float[][] vx2,
                           float[][] vy2,
                           float[][] vz2,
                           int maxv2,
                           int[] numv2,
                           float[][] vx3,
                           float[][] vy3,
                           float[][] vz3,
                           int maxv3,
                           int[] numv3,
                           float[][] vx4,
                           float[][] vy4,
                           float[][] vz4,
                           int maxv4,
                           int[] numv4,
                           byte[][] auxValues,
                           byte[][] auxLevels1,
                           byte[][] auxLevels2,
                           byte[][] auxLevels3,
                           boolean[] swap,
                           boolean fill,
                           float[][] tri,
                           byte[][] tri_color,
                           float[][][] grd_normals,
                           float[][] tri_normals,
                           byte[][] interval_colors,
                           float[][][][] lbl_vv,
                           byte[][][][] lbl_cc,
                           float[][][] lbl_loc,
                           double scale_ratio,
                           double label_size,
                           byte[] labelColor,
                           Gridded3DSet spatial_set)
                    throws VisADException
Compute contour lines for a 2-D array. If the interval is negative, then contour lines less than base will be drawn as dashed lines. The contour lines will be computed for all V such that:
lowlimit <= V <= highlimit
and V = base + n*interval for some integer n
Note that the input array, g, should be in column-major (FORTRAN) order.

Parameters:
g - the 2-D array to contour.
nr - size of 2-D array in rows
nc - size of 2-D array in columns.
interval - contour interval
lowlimit - the lower limit on values to contour.
highlimit - the upper limit on values to contour.
base - base value to start contouring at.
vx1 - array to put contour line vertices (x value)
vy1 - array to put contour line vertices (y value)
maxv1 - size of vx1, vy1 arrays
numv1 - pointer to int to return number of vertices in vx1,vy1
vx2 - array to put 'hidden' contour line vertices (x value)
vy2 - array to put 'hidden' contour line vertices (y value)
maxv2 - size of vx2, vy2 arrays
numv2 - pointer to int to return number of vertices in vx2,vy2
vx3 - array to put contour label vertices (x value)
vy3 - array to put contour label vertices (y value)
maxv3 - size of vx3, vy3 arrays
numv3 - pointer to int to return number of vertices in vx3,vy3
vx4 - array to put contour label vertices, inverted (x value)
vy4 - array to put contour label vertices, inverted (y value)
** see note for VxB and VyB in PlotDigits.java **
maxv4 - size of vx4, vy4 arrays
numv4 - pointer to int to return number of vertices in vx4,vy4
Throws:
VisADException

intervalToLevels

public static float[] intervalToLevels(float interval,
                                       float low,
                                       float high,
                                       float ba,
                                       boolean[] dash)
                                throws VisADException
Returns an array of contour values and an indication on whether to use dashed lines below the base value.

Parameters:
interval - The contouring interval. Must be non-zero. If the interval is negative, then contour lines less than the base will be drawn as dashed lines. Must not be NaN.
low - The minimum contour value. The returned array will not contain a value below this. Must not be NaN.
high - The maximum contour value. The returned array will not contain a value above this. Must not be NaN.
ba - The base contour value. The returned values will be integer multiples of the interval away from this this value. Must not be NaN. dash Whether or not contour lines less than the base should be drawn as dashed lines. This is a computed and returned value.
Throws:
VisADException - The contour interval is zero or too small.

contour

public static void contour(float[] g,
                           int nr,
                           int nc,
                           float[] values,
                           float lowlimit,
                           float highlimit,
                           float base,
                           boolean dash,
                           float[][] vx1,
                           float[][] vy1,
                           float[][] vz1,
                           int maxv1,
                           int[] numv1,
                           float[][] vx2,
                           float[][] vy2,
                           float[][] vz2,
                           int maxv2,
                           int[] numv2,
                           float[][] vx3,
                           float[][] vy3,
                           float[][] vz3,
                           int maxv3,
                           int[] numv3,
                           float[][] vx4,
                           float[][] vy4,
                           float[][] vz4,
                           int maxv4,
                           int[] numv4,
                           byte[][] auxValues,
                           byte[][] auxLevels1,
                           byte[][] auxLevels2,
                           byte[][] auxLevels3,
                           boolean[] swap,
                           boolean fill,
                           float[][] tri,
                           byte[][] tri_color,
                           float[][][] grd_normals,
                           float[][] tri_normals,
                           byte[][] interval_colors,
                           float[][][][] lbl_vv,
                           byte[][][][] lbl_cc,
                           float[][][] lbl_loc,
                           double scale_ratio,
                           double label_size,
                           byte[] labelColor,
                           Gridded3DSet spatial_set)
                    throws VisADException
Compute contour lines for a 2-D array. If the interval is negative, then contour lines less than base will be drawn as dashed lines. The contour lines will be computed for all V such that:
lowlimit <= V <= highlimit
and V = base + n*interval for some integer n
Note that the input array, g, should be in column-major (FORTRAN) order.

Parameters:
g - the 2-D array to contour.
nr - size of 2-D array in rows
nc - size of 2-D array in columns.
values - the values to be plotted
lowlimit - the lower limit on values to contour.
highlimit - the upper limit on values to contour.
base - base value to start contouring at.
dash - boolean to dash contours below base or not
vx1 - array to put contour line vertices (x value)
vy1 - array to put contour line vertices (y value)
vz1 -
maxv1 - size of vx1, vy1 arrays
numv1 - pointer to int to return number of vertices in vx1,vy1
vx2 - array to put 'hidden' contour line vertices (x value)
vy2 - array to put 'hidden' contour line vertices (y value)
vz2 -
maxv2 - size of vx2, vy2 arrays
numv2 - pointer to int to return number of vertices in vx2,vy2
vx3 - array to put contour label vertices (x value)
vy3 - array to put contour label vertices (y value)
vz3 -
maxv3 - size of vx3, vy3 arrays
numv3 - pointer to int to return number of vertices in vx3,vy3
vx4 - array to put contour label vertices, inverted (x value)
vy4 - array to put contour label vertices, inverted (y value)
** see note for VxB and VyB in PlotDigits.java **
vz4 -
maxv4 - size of vx4, vy4 arrays
numv4 - pointer to int to return number of vertices in vx4,vy4
auxValues -
auxLevels1 -
auxLevels2 -
auxLevels3 -
swap -
fill -
tri -
tri_color -
grd_normals -
tri_normals -
interval_colors -
lbl_vv -
lbl_cc -
lbl_loc -
scale_ratio -
label_size -
labelColor - RGB label color byte array
spatial_set -
Throws:
VisADException