org.jmol.g3d
final class Line3D extends Object
Implements 3D line drawing routines.
A number of line drawing routines, most of which are used to implement higher-level shapes. Triangles and cylinders are drawn as a series of lines
Field Summary | |
---|---|
int | cc1 |
int | cc2 |
Graphics3D | g3d |
BitSet | lineBits |
Hashtable | lineCache |
boolean | lineTypeX |
int | nBits |
int | nCached |
int | nFound |
float | slope |
Float | slopeKey |
static int | VISIBILITY_CLIPPED |
static int | VISIBILITY_OFFSCREEN |
static int | VISIBILITY_UNCLIPPED |
int | x1t |
int | x2t |
static int | xGT |
static int | xLT |
int | y1t |
int | y2t |
static int | yGT |
static int | yLT |
int | z1t |
int | z2t |
static int | zGT |
static int | zLT |
Constructor Summary | |
---|---|
Line3D(Graphics3D g3d) |
Method Summary | |
---|---|
int | clipCode(int x, int y, int z) |
boolean | getCachedLine() |
int | getTrimmedLine() Cohen-Sutherland line clipping used to check visibility. |
void | plotDashedLine(int argb, boolean tScreened, int run, int rise, int xA, int yA, int zA, int xB, int yB, int zB, boolean notClipped) |
void | plotLine(int argbA, boolean tScreenedA, int argbB, boolean tScreenedB, int xA, int yA, int zA, int xB, int yB, int zB, boolean notClipped) |
void | plotLineClipped(int argb1, boolean tScreened1, int argb2, boolean tScreened2, int x, int y, int z, int dx, int dy, int dz, boolean notClipped, int run, int rise) |
void | plotLineClipped(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int intensity, int x, int y, int z, int dx, int dy, int dz, boolean notClipped, int run, int rise) |
void | plotLineClippedBits(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int intensity, int x, int y, int z, int dx, int dy, int dz, boolean notClipped, int run, int rise) |
void | plotLineDelta(int argbA, boolean tScreenedA, int argbB, boolean tScreenedB, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean notClipped) |
void | plotLineDelta(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int intensity, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean notClipped) |
void | plotLineDeltaBits(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int intensity, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean notClipped) |
void | setLineBits(float dx, float dy) |
Cohen-Sutherland line clipping used to check visibility.
Note that this routine is only used for visibility checking. To avoid integer rounding errors which cause cracking to occur in 'solid' surfaces, the lines are actually drawn from their original end-points. The nuance is that this algorithm doesn't just deliver a boolean. It delivers the trimmed line. Although we need to start the raster loop at the origin for good surfaces, we can save lots of time by saving the known endpoints as globals variables. -- Bob Hanson 7/06
Returns: Visibility (see VISIBILITY_... constants);