Package org.jmol.g3d

Class LineRenderer


final class LineRenderer extends PrecisionRenderer
  • Field Details

    • g3d

      private final Graphics3D g3d
    • shader

      private final Shader shader
    • lineBits

      private javajs.util.BS lineBits
    • slope

      private float slope
    • lineTypeX

      private boolean lineTypeX
    • nBits

      private int nBits
    • lineCache

      private Map<Float,javajs.util.BS> lineCache
    • slopeKey

      private Float slopeKey
    • VISIBILITY_UNCLIPPED

      private static final int VISIBILITY_UNCLIPPED
      See Also:
    • VISIBILITY_CLIPPED

      private static final int VISIBILITY_CLIPPED
      See Also:
    • VISIBILITY_OFFSCREEN

      private static final int VISIBILITY_OFFSCREEN
      See Also:
    • x1t

      private int x1t
    • y1t

      private int y1t
    • z1t

      private int z1t
    • x2t

      private int x2t
    • y2t

      private int y2t
    • z2t

      private int z2t
  • Constructor Details

  • Method Details

    • setLineBits

      void setLineBits(float dx, float dy)
    • clearLineCache

      void clearLineCache()
    • plotLineOld

      void plotLineOld(int argbA, int argbB, int xA, int yA, int zA, int xB, int yB, int zB)
    • plotLineDeltaOld

      void plotLineDeltaOld(int argbA, int argbB, int xA, int yA, int zA, int dxBA, int dyBA, int dzBA, boolean clipped)
      low-resolution linear z
      Parameters:
      argbA -
      argbB -
      xA -
      yA -
      zA -
      dxBA -
      dyBA -
      dzBA -
      clipped -
    • plotLineDeltaAOld

      void plotLineDeltaAOld(int[] shades1, int[] shades2, int screenMask, int shadeIndex, int x, int y, int z, int dx, int dy, int dz, boolean clipped)
      low-precision old-style linear z, even in perspective mode
      Parameters:
      shades1 -
      shades2 -
      screenMask -
      shadeIndex -
      x -
      y -
      z -
      dx -
      dy -
      dz -
      clipped -
    • plotLineDeltaABitsFloat

      void plotLineDeltaABitsFloat(int[] shades1, int[] shades2, int shadeIndex, javajs.util.P3 ptA, javajs.util.P3 ptB, int screenMask, boolean clipped)
    • plotLineDeltaABitsInt

      void plotLineDeltaABitsInt(int[] shades1, int[] shades2, int shadeIndex, javajs.util.P3i ptA, javajs.util.P3i ptB, int screenMask, boolean clipped)
    • plotLineBits

      void plotLineBits(int argbA, int argbB, javajs.util.P3i ptA, javajs.util.P3i ptB, int run, int rise, boolean andClip)
    • getTrimmedLineImpl

      private int getTrimmedLineImpl()

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

      private void plotLineClippedOld(int argb1, int argb2, int x, int y, int z, int dx, int dy, int dz, boolean clipped, int run, int rise)
      low-resolution linear z-buffer (old style)
      Parameters:
      argb1 -
      argb2 -
      x -
      y -
      z -
      dx -
      dy -
      dz -
      clipped -
      run -
      rise -