org.jmol.g3d
Class Line3D

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

final class Line3D
extends Object


Field Summary
(package private)  int cc1
           
(package private)  int cc2
           
(package private)  Graphics3D g3d
           
(package private)  BitSet lineBits
           
(package private)  Hashtable lineCache
           
(package private)  boolean lineTypeX
           
(package private)  int nBits
           
(package private)  int nCached
           
(package private)  int nFound
           
(package private)  float slope
           
(package private)  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)  int y1t
           
(package private)  int y2t
           
(package private)  int z1t
           
(package private)  int z2t
           
 
Constructor Summary
Line3D(Graphics3D g3d)
           
 
Method Summary
(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 clipped)
           
(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 clipped)
           
private  void plotLineClipped(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int shadeIndex, int x, int y, int z, int dx, int dy, int dz, boolean clipped, 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 clipped, int run, int rise)
           
private  void plotLineClippedBits(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int shadeIndex, int x, int y, int z, int dx, int dy, int dz, int run, int rise)
           
(package private)  void plotLineDelta(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int shadeIndex, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean clipped)
           
(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 clipped)
           
(package private)  void plotLineDeltaBits(int[] shades1, boolean tScreened1, int[] shades2, boolean tScreened2, int shadeIndex, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean clipped)
           
(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

BitSet lineBits

slope

float slope

lineTypeX

boolean lineTypeX

nBits

int nBits

nCached

int nCached

nFound

int nFound

lineCache

Hashtable lineCache

slopeKey

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

plotLine

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

plotLineDelta

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

plotLineDelta

void plotLineDelta(int[] shades1,
                   boolean tScreened1,
                   int[] shades2,
                   boolean tScreened2,
                   int shadeIndex,
                   int xA,
                   int yA,
                   int zA,
                   int dxBA,
                   int dyBA,
                   int dzBA,
                   boolean clipped)

plotLineDeltaBits

void plotLineDeltaBits(int[] shades1,
                       boolean tScreened1,
                       int[] shades2,
                       boolean tScreened2,
                       int shadeIndex,
                       int xA,
                       int yA,
                       int zA,
                       int dxBA,
                       int dyBA,
                       int dzBA,
                       boolean clipped)

plotDashedLine

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

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 clipped,
                             int run,
                             int rise)

plotLineClipped

private void plotLineClipped(int[] shades1,
                             boolean tScreened1,
                             int[] shades2,
                             boolean tScreened2,
                             int shadeIndex,
                             int x,
                             int y,
                             int z,
                             int dx,
                             int dy,
                             int dz,
                             boolean clipped,
                             int run,
                             int rise)

plotLineClippedBits

private void plotLineClippedBits(int[] shades1,
                                 boolean tScreened1,
                                 int[] shades2,
                                 boolean tScreened2,
                                 int shadeIndex,
                                 int x,
                                 int y,
                                 int z,
                                 int dx,
                                 int dy,
                                 int dz,
                                 int run,
                                 int rise)