|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.JCNumberUtil | +--com.klg.jclass.chart3d.JCChart3dUtil
JCChartUtil
is a collection of static methods and static
variables that are used throughout JClass Chart 3D.
Field Summary | |
static double |
roundOffEpsilon
Value to add to values to combat round off error. |
Fields inherited from class com.klg.jclass.util.JCNumberUtil |
DECIMAL, DEFAULT_FLOAT, DEGREES, GRADS, LOG_TEN_BASE_E, M_2PI, M_PI, M_PI_2, M_SQRT2, RADIANS, XBYX1, XBYX2, XINSIDE, YBYORIGIN, YBYTOP, YINSIDE |
Constructor Summary | |
JCChart3dUtil()
|
Method Summary | |
static boolean |
backfacing(int[] xPoints,
int[] yPoints)
Determines if the convex polygon is backfacing. |
static double |
biLinearInterp(com.klg.jclass.chart3d.Chart3dGridData data,
int xIndex,
int yIndex,
double x,
double y)
Performs bi-linear interpolation within a grid facet to return the z value. |
static void |
booleanfill(boolean[] array,
boolean value)
Uses the system method arraycopy to copy over larger blocks of values to fill a boolean array efficiently. |
static double |
ceil(double value)
Returns the ceiling of this value. |
static Rectangle |
computeBoundingRectangle(Rectangle r1,
Rectangle r2)
Computes the bounding rectangle for two Rectangles. |
static Point4d[] |
constructBarPlane(com.klg.jclass.chart3d.Chart3dGridData data,
int x,
int y)
Calculates the x/y extents of the bar (in data space) constuct a flat plane of these values. |
static double |
distanceToEye(com.klg.jclass.chart3d.JCChart3d chart3d,
double x,
double y,
double z)
Finds the distance of the point (x, y, z) to the eye position. |
static double |
floor(double value)
Returns the floor of this value. |
static void |
getScreenPoint(com.klg.jclass.chart3d.JCChart3d chart3d,
double x,
double y,
double z,
double zAlternate,
com.klg.jclass.chart3d.ScreenPoint screenPoint)
Transforms the point (x, y, z) based on the current transformation defined in the chart. |
static boolean |
gridBackfacing(com.klg.jclass.chart3d.ScreenPoint p1,
com.klg.jclass.chart3d.ScreenPoint p2,
com.klg.jclass.chart3d.ScreenPoint p3)
Computes whether the plane defined by the three screen points is backfacing. |
static boolean |
holeInFacet(com.klg.jclass.chart3d.Chart3dGridData data,
int x,
int y)
Is there a hole in the facet with bottom-left corner (x, y)? There is a hole if any of the four corners (x,y), (x,y+1), (x+1, y), (x+1,y+1), have a z value which is the hole value. |
static int |
max4(int a,
int b,
int c,
int d)
Finds the max of the four given integers. |
static int |
min4(int a,
int b,
int c,
int d)
Finds the min of the four given integers. |
static int |
nDigits(double value)
Returns the number of decimal places after the decimal point the significant digit occurs. |
static double |
niceNum(double x,
boolean round)
The following two routines implement Heckbert's algorithm for finding 'nice' numbers for labelling graphs (see Graphics Gems, "Nice Numbers for Graph Labels" by Paul Heckbert). |
protected static void |
printAxisExtents(com.klg.jclass.chart3d.JCAxis axis)
Prints the min/max, the anno min/max, and the dataport min/max for a given axis. |
static void |
printMatrix(Matrix4d m)
Utility debugging function that prints a given 4D matrix. |
Methods inherited from class com.klg.jclass.util.JCNumberUtil |
abs, abs, boundAngle, brighter, calcError, clamp, clamp, clamp, colorsNear, convertAngle, convertFromSN, countInString, darker, degToRad, distance, distance, distance, distTrap, fmod, format, fudgeItalicLabel, getDecimalPointChar, iceil, ifloor, internalFormat, intLog10, isHTML, locateX, locateXY, locateY, log10, logFormat, max, min, nicePrecision, pointsToPolygon, pow10, precCeil, precCorrect, precFloor, radToDeg, tickBasedPrecision, trace, validUnit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double roundOffEpsilon
Constructor Detail |
public JCChart3dUtil()
Method Detail |
public static boolean backfacing(int[] xPoints, int[] yPoints)
xPoints
- the xPoints array of the polygonyPoints
- the yPoints array of the polygon
public static boolean gridBackfacing(com.klg.jclass.chart3d.ScreenPoint p1, com.klg.jclass.chart3d.ScreenPoint p2, com.klg.jclass.chart3d.ScreenPoint p3)
p1
- the first pointp2
- the second pointp3
- the third point
public static void getScreenPoint(com.klg.jclass.chart3d.JCChart3d chart3d, double x, double y, double z, double zAlternate, com.klg.jclass.chart3d.ScreenPoint screenPoint)
chart3d
- the chart which has the transformationx
- the x coordinate of the pointy
- the y coordinate of the pointz
- the z coordinate of the pointzAlternate
- the alternate z value to use if a hole is encounteredscreenPoint
- the screen point to store the transformed valuepublic static double distanceToEye(com.klg.jclass.chart3d.JCChart3d chart3d, double x, double y, double z)
chart3d
- the chart for which the distance to eye is neededx
- the x coordinate of the pointy
- the y coordinate of the pointz
- the z coordinate of the point
public static void printMatrix(Matrix4d m)
m
- the matrix to be printedprotected static void printAxisExtents(com.klg.jclass.chart3d.JCAxis axis)
axis
- the axis for which the extents are to be printedpublic static void booleanfill(boolean[] array, boolean value)
array
- the array to fillvalue
- the value with which to fill itpublic static int min4(int a, int b, int c, int d)
a
- the first integerb
- the second integerc
- the third integerd
- the fourth integer
public static int max4(int a, int b, int c, int d)
a
- the first integerb
- the second integerc
- the third integerd
- the fourth integer
public static double floor(double value)
roundOffEpsilon
to it to combat round off
near integers.
value
- the value for which to find the floor
public static double ceil(double value)
roundOffEpsilon
from it to combat
round off near integers.
value
- the value for which to find the ceil
public static int nDigits(double value)
value
- the value for which to find the significant digits
public static double niceNum(double x, boolean round)
x
- the number for which a nice number is neededround
- if true
, do rounding
public static Point4d[] constructBarPlane(com.klg.jclass.chart3d.Chart3dGridData data, int x, int y)
data
- the internal grid data sourcex
- the x grid coordinatey
- the y grid coordinate
public static boolean holeInFacet(com.klg.jclass.chart3d.Chart3dGridData data, int x, int y)
data
- the grid data sourcex
- the x coordinate of the bottom left cornery
- the y coordinate of the bottom left corner
public static double biLinearInterp(com.klg.jclass.chart3d.Chart3dGridData data, int xIndex, int yIndex, double x, double y)
data
- the internal grid data objectxIndex
- the index of the x grid value for this facetyIndex
- the index of the y grid value for this facetx
- the x location in data spacey
- the y location in data space
public static Rectangle computeBoundingRectangle(Rectangle r1, Rectangle r2)
r1
- the first rectangler2
- the second rectangle
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |