visad
Class Contour2D
- java.lang.Object
-
- visad.Contour2D
-
public class Contour2D extends java.lang.ObjectContour2D is a class equipped with a 2-D contouring function.
-
-
Field Summary
Fields Modifier and Type Field and Description static byteCLOCKWISEstatic byteCNTRCLOCKWISEstatic intDIFFICULTY_THRESHOLDstatic floatDIMENSION_THRESHOLDstatic byteSIDE_BOTTOMstatic byteSIDE_LEFTstatic byteSIDE_NONEstatic byteSIDE_RIGHTstatic byteSIDE_TOPstatic booleanTRUEVALUEstatic intvertexCnt
-
Constructor Summary
Constructors Constructor and Description Contour2D()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static visad.Contour2D.ContourOutputcontour(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, java.lang.Object labelFont, boolean sphericalDisplayCS, Gridded3DSet spatial_set)static voidcontour(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, java.lang.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.
-
-
-
Field Detail
-
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
-
-
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, java.lang.Object labelFont, boolean sphericalDisplayCS, Gridded3DSet spatial_set) throws VisADExceptionCompute 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
andV = 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 rowsnc- size of 2-D array in columns.interval- contour intervallowlimit- 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,vy1auxValues- colors corresponding to grid pointsswap-fill- true if filling contoursgrd_normals-interval_colors-lbl_vv- values for label line segmentslbl_cc- label color tripleslbl_loc- center points for label locationsscale_ratio-label_size-labelColor-spatial_set-- Throws:
VisADException
-
intervalToLevels
public static float[] intervalToLevels(float interval, float low, float high, float ba, boolean[] dash) throws VisADExceptionReturns 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, java.lang.Object labelFont, boolean sphericalDisplayCS, Gridded3DSet spatial_set) throws VisADException- Throws:
VisADException
-
getTriOrientation
public static int[] getTriOrientation(float[][] verts)
-
-
DMelt 3.0 © DataMelt by jWork.ORG