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
static byte CLOCKWISE
           
static byte CNTRCLOCKWISE
           
protected  int cols
           
protected  Contour2D con
           
static int DIFFICULTY_THRESHOLD
           
static float DIMENSION_THRESHOLD
           
protected  int[] num1
           
protected  int[] num2
           
protected  int[] num3
           
protected  int[] num4
           
protected  int rows
           
protected  int scale
           
protected  boolean showgrid
           
static byte SIDE_BOTTOM
           
static byte SIDE_LEFT
           
static byte SIDE_NONE
           
static byte SIDE_RIGHT
           
static byte SIDE_TOP
           
static boolean TRUEVALUE
           
static int vertexCnt
           
protected  float[][] vx1
           
protected  float[][] vy1
           
protected  int whichlabels
           
 
Constructor Summary
Contour2D()
           
 
Method Summary
static visad.Contour2D.ContourOutput contour(float[] g, int nr, int nc, float[] values, float lowlimit, float highlimit, float base, boolean dash, byte[][] auxValues, boolean[] swap, boolean fill, float[][][] grd_normals, byte[][] interval_colors, double[] scale, double scale_ratio, int label_freq, int label_line_skip, double label_size, boolean labelAlign, byte[] labelColor, Object labelFont, boolean sphericalDisplayCS, Gridded3DSet spatial_set)
           
static void contour(float[] g, int nr, int nc, float interval, float lowlimit, float highlimit, float base, float[][] vx1, float[][] vy1, int[] numv1, byte[][] auxValues, boolean[] swap, boolean fill, float[][][] grd_normals, byte[][] interval_colors, float[][][][] lbl_vv, byte[][][][] lbl_cc, float[][][] lbl_loc, double[] scale, double scale_ratio, int label_freq, int label_line_skip, double label_size, boolean labelAlign, byte[] labelColor, Object labelFont, boolean sphericalDisplayCS, Gridded3DSet spatial_set)
          Compute contour lines for a 2-D array.
static int[] getTriOrientation(float[][] verts)
           
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

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

SIDE_LEFT

public static final byte SIDE_LEFT
See Also:
Constant Field Values

SIDE_RIGHT

public static final byte SIDE_RIGHT
See Also:
Constant Field Values

SIDE_TOP

public static final byte SIDE_TOP
See Also:
Constant Field Values

SIDE_BOTTOM

public static final byte SIDE_BOTTOM
See Also:
Constant Field Values

SIDE_NONE

public static final byte SIDE_NONE
See Also:
Constant Field Values

CLOCKWISE

public static final byte CLOCKWISE
See Also:
Constant Field Values

CNTRCLOCKWISE

public static final byte CNTRCLOCKWISE
See Also:
Constant Field Values

vertexCnt

public static int vertexCnt

TRUEVALUE

public static boolean TRUEVALUE
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,
                           int[] numv1,
                           byte[][] auxValues,
                           boolean[] swap,
                           boolean fill,
                           float[][][] grd_normals,
                           byte[][] interval_colors,
                           float[][][][] lbl_vv,
                           byte[][][][] lbl_cc,
                           float[][][] lbl_loc,
                           double[] scale,
                           double scale_ratio,
                           int label_freq,
                           int label_line_skip,
                           double label_size,
                           boolean labelAlign,
                           byte[] labelColor,
                           Object labelFont,
                           boolean sphericalDisplayCS,
                           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)
numv1 - pointer to int to return number of vertices in vx1,vy1
auxValues - colors corresponding to grid points
swap -
fill - true if filling contours
grd_normals -
interval_colors -
lbl_vv - values for label line segments
lbl_cc - label color triples
lbl_loc - center points for label locations
scale_ratio -
label_size -
labelColor -
spatial_set -
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.
dash -
Returns:
Levels array
Throws:
VisADException - The contour interval is zero or too small.

contour

public static visad.Contour2D.ContourOutput contour(float[] g,
                                                    int nr,
                                                    int nc,
                                                    float[] values,
                                                    float lowlimit,
                                                    float highlimit,
                                                    float base,
                                                    boolean dash,
                                                    byte[][] auxValues,
                                                    boolean[] swap,
                                                    boolean fill,
                                                    float[][][] grd_normals,
                                                    byte[][] interval_colors,
                                                    double[] scale,
                                                    double scale_ratio,
                                                    int label_freq,
                                                    int label_line_skip,
                                                    double label_size,
                                                    boolean labelAlign,
                                                    byte[] labelColor,
                                                    Object labelFont,
                                                    boolean sphericalDisplayCS,
                                                    Gridded3DSet spatial_set)
                                             throws VisADException
Throws:
VisADException

getTriOrientation

public static int[] getTriOrientation(float[][] verts)