org.jmol.g3d
Class Line3D

java.lang.Object
  extended by org.jmol.g3d.Line3D

final class Line3D
extends java.lang.Object


Field Summary
(package private)  int cc1
           
(package private)  int cc2
           
(package private)  Graphics3D g3d
           
(package private)  java.util.BitSet lineBits
           
(package private)  java.util.Hashtable lineCache
           
(package private)  boolean lineTypeX
           
(package private)  int nBits
           
(package private)  int nCached
           
(package private)  int nFound
           
(package private)  float slope
           
(package private)  java.lang.Float slopeKey
           
(package private) static int VISIBILITY_CLIPPED
           
(package private) static int VISIBILITY_OFFSCREEN
           
(package private) static int VISIBILITY_UNCLIPPED
           
(package private)  int x1t
           
(package private)  int x2t
           
(package private) static int xGT
           
(package private) static int xLT
           
(package private)  int y1t
           
(package private)  int y2t
           
(package private) static int yGT
           
(package private) static int yLT
           
(package private)  int z1t
           
(package private)  int z2t
           
(package private) static int zGT
           
(package private) static int zLT
           
 
Constructor Summary
Line3D(Graphics3D g3d)
           
 
Method Summary
(package private)  int clipCode(int x, int y, int z)
           
(package private)  boolean getCachedLine()
           
(package private)  int getTrimmedLine()
           Cohen-Sutherland line clipping used to check visibility.
(package private)  void plotDashedLine(int argb, boolean tScreened, int run, int rise, int xA, int yA, int zA, int xB, int yB, int zB, boolean notClipped)
           
(package private)  void plotLine(int argbA, boolean tScreenedA, int argbB, boolean tScreenedB, int xA, int yA, int zA, int xB, int yB, int zB, boolean notClipped)
           
private  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)
           
private  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)
           
private  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)
           
(package private)  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)
           
(package private)  void plotLineDelta(int argbA, boolean tScreenedA, int argbB, boolean tScreenedB, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean notClipped)
           
(package private)  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)
           
(package private)  void setLineBits(float dx, float dy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

g3d

Graphics3D g3d

lineBits

java.util.BitSet lineBits

slope

float slope

lineTypeX

boolean lineTypeX

nBits

int nBits

nCached

int nCached

nFound

int nFound

lineCache

java.util.Hashtable lineCache

slopeKey

java.lang.Float slopeKey

VISIBILITY_UNCLIPPED

static final int VISIBILITY_UNCLIPPED
See Also:
Constant Field Values

VISIBILITY_CLIPPED

static final int VISIBILITY_CLIPPED
See Also:
Constant Field Values

VISIBILITY_OFFSCREEN

static final int VISIBILITY_OFFSCREEN
See Also:
Constant Field Values

x1t

int x1t

y1t

int y1t

z1t

int z1t

x2t

int x2t

y2t

int y2t

z2t

int z2t

cc1

int cc1

cc2

int cc2

zLT

static final int zLT
See Also:
Constant Field Values

zGT

static final int zGT
See Also:
Constant Field Values

xLT

static final int xLT
See Also:
Constant Field Values

xGT

static final int xGT
See Also:
Constant Field Values

yLT

static final int yLT
See Also:
Constant Field Values

yGT

static final int yGT
See Also:
Constant Field Values
Constructor Detail

Line3D

Line3D(Graphics3D g3d)
Method Detail

setLineBits

void setLineBits(float dx,
                 float dy)

getCachedLine

boolean getCachedLine()

getTrimmedLine

int getTrimmedLine()

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);

clipCode

final int clipCode(int x,
                   int y,
                   int z)

plotLine

void plotLine(int argbA,
              boolean tScreenedA,
              int argbB,
              boolean tScreenedB,
              int xA,
              int yA,
              int zA,
              int xB,
              int yB,
              int zB,
              boolean notClipped)

plotLineDelta

void plotLineDelta(int argbA,
                   boolean tScreenedA,
                   int argbB,
                   boolean tScreenedB,
                   int xA,
                   int yA,
                   int zA,
                   int dxBA,
                   int dyBA,
                   int dzBA,
                   boolean notClipped)

plotLineDelta

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)

plotLineDeltaBits

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)

plotDashedLine

void plotDashedLine(int argb,
                    boolean tScreened,
                    int run,
                    int rise,
                    int xA,
                    int yA,
                    int zA,
                    int xB,
                    int yB,
                    int zB,
                    boolean notClipped)

plotLineClipped

private 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)

plotLineClipped

private 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)

plotLineClippedBits

private 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)