CylinderRenderer
Date: 2019-10-22

org.jmol.g3d

## Class CylinderRenderer

- java.lang.Object
- - org.jmol.g3d.CylinderRenderer

-     class CylinderRenderer
      extends java.lang.Object

  Draws shaded cylinders in 3D.

  Cylinders are used to draw bonds.

  Author:
    Miguel, miguel@jmol.org

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `argbEndcap`
    `private boolean` | `clipped`
    `private short` | `colixA`
    `private short` | `colixB`
    `private short` | `colixEndcap`
    `private float` | `cosPhi`
    `private float` | `cosTheta`
    `private int` | `diameter`
    `private int` | `dxB`
    `private float` | `dxBf`
    `private int` | `dyB`
    `private float` | `dyBf`
    `private int` | `dzB`
    `private float` | `dzBf`
    `private boolean` | `endCapHidden`
    `private byte` | `endcaps`
    `private int` | `endcapShadeIndex`
    `private Graphics3D` | `g3d`
    `private LineRenderer` | `line3d`
    `private javajs.util.P3` | `ptA0`
    `private javajs.util.P3i` | `ptA0i`
    `private javajs.util.P3` | `ptB0`
    `private javajs.util.P3i` | `ptB0i`
    `private float` | `radius`
    `private float` | `radius2`
    `private int` | `rasterCount`
    `private Shader` | `shader`
    `private int[]` | `shadesA`
    `private int[]` | `shadesB`
    `private float` | `sinPhi`
    `private boolean` | `tEvenDiameter`
    `private int` | `xA`
    `private float` | `xAf`
    `private int` | `xEndcap`
    `private float` | `xTip`
    `private int[][]` | `xyzfRaster`
    `private float[][]` | `xyztRaster`
    `private int` | `yA`
    `private float` | `yAf`
    `private int` | `yEndcap`
    `private float` | `yTip`
    `private int` | `zA`
    `private float` | `zAf`
    `private int` | `zEndcap`
    `private float` | `zTip`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CylinderRenderer(Graphics3D g3d)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private int` | `allocRaster(boolean isPrecision, int[][] xyzf, float[][] xyzt)`
    `private void` | `calcArgbEndcap(boolean tCylinder, boolean isFloat)`
    `private void` | `calcCosSin(float dx, float dy, float dz)`
    `private void` | `calcPoints(int count, boolean isPrecise)`
    `private void` | `calcRotatedPoint(float t, int i, boolean isPrecision, int[][] xyzf, float[][] xyzt)`
    `private void` | `generateBaseEllipsePrecisely(boolean isBarb)`
    `private void` | `interpolate(int iLower, int iUpper, int[][] xyzf, float[][] xyzt)`
    `private void` | `interpolatePrecisely(int iLower, int iUpper, int[][] xyzf, float[][] xyzt)`
    `(package private) void` | `renderBits(short colixA, short colixB, int screen, byte endcaps, int diameter, javajs.util.P3i ptA, javajs.util.P3i ptB)`
    `(package private) void` | `renderBitsFloat(short colixA, short colixB, int screen, byte endcaps, int diameter, javajs.util.P3 ptA, javajs.util.P3 ptB)`
    `(package private) void` | `renderConeOld(short colix, byte endcap, int diameter, float xa, float ya, float za, float xtip, float ytip, float ztip, boolean doFill, boolean isBarb)`
    `private void` | `renderFlatEndcap(boolean isCylinder, boolean isPrecise, int[][] xyzf)`
    `(package private) void` | `renderOld(short colixA, short colixB, int screen, byte endcaps, int diameter, int xa, int ya, int za, int xb, int yb, int zb)`
    `private void` | `renderSphericalEndcaps()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### g3d

          private final Graphics3D g3d

    - #### line3d

          private final LineRenderer line3d

    - #### shader

          private final Shader shader

    - #### colixA

          private short colixA

    - #### colixB

          private short colixB

    - #### shadesA

          private int[] shadesA

    - #### shadesB

          private int[] shadesB

    - #### xA

          private int xA

    - #### yA

          private int yA

    - #### zA

          private int zA

    - #### dxB

          private int dxB

    - #### dyB

          private int dyB

    - #### dzB

          private int dzB

    - #### xAf

          private float xAf

    - #### yAf

          private float yAf

    - #### zAf

          private float zAf

    - #### dxBf

          private float dxBf

    - #### dyBf

          private float dyBf

    - #### dzBf

          private float dzBf

    - #### tEvenDiameter

          private boolean tEvenDiameter

    - #### diameter

          private int diameter

    - #### endcaps

          private byte endcaps

    - #### endCapHidden

          private boolean endCapHidden

    - #### xEndcap

          private int xEndcap

    - #### yEndcap

          private int yEndcap

    - #### zEndcap

          private int zEndcap

    - #### argbEndcap

          private int argbEndcap

    - #### colixEndcap

          private short colixEndcap

    - #### endcapShadeIndex

          private int endcapShadeIndex

    - #### radius

          private float radius

    - #### radius2

          private float radius2

    - #### cosTheta

          private float cosTheta

    - #### cosPhi

          private float cosPhi

    - #### sinPhi

          private float sinPhi

    - #### clipped

          private boolean clipped

    - #### rasterCount

          private int rasterCount

    - #### xyztRaster

          private float[][] xyztRaster

    - #### xyzfRaster

          private int[][] xyzfRaster

    - #### ptA0

          private javajs.util.P3 ptA0

    - #### ptB0

          private javajs.util.P3 ptB0

    - #### ptA0i

          private javajs.util.P3i ptA0i

    - #### ptB0i

          private javajs.util.P3i ptB0i

    - #### xTip

          private float xTip

    - #### yTip

          private float yTip

    - #### zTip

          private float zTip

  - ### Constructor Detail

    - #### CylinderRenderer

          CylinderRenderer(Graphics3D g3d)

  - ### Method Detail

    - #### renderOld

          void renderOld(short colixA,
                         short colixB,
                         int screen,
                         byte endcaps,
                         int diameter,
                         int xa,
                         int ya,
                         int za,
                         int xb,
                         int yb,
                         int zb)

    - #### renderBitsFloat

          void renderBitsFloat(short colixA,
                               short colixB,
                               int screen,
                               byte endcaps,
                               int diameter,
                               javajs.util.P3 ptA,
                               javajs.util.P3 ptB)

    - #### renderBits

          void renderBits(short colixA,
                          short colixB,
                          int screen,
                          byte endcaps,
                          int diameter,
                          javajs.util.P3i ptA,
                          javajs.util.P3i ptB)

    - #### renderConeOld

          void renderConeOld(short colix,
                             byte endcap,
                             int diameter,
                             float xa,
                             float ya,
                             float za,
                             float xtip,
                             float ytip,
                             float ztip,
                             boolean doFill,
                             boolean isBarb)

    - #### generateBaseEllipsePrecisely

          private void generateBaseEllipsePrecisely(boolean isBarb)

    - #### calcPoints

          private void calcPoints(int count,
                                  boolean isPrecise)

    - #### calcCosSin

          private void calcCosSin(float dx,
                                  float dy,
                                  float dz)

    - #### calcRotatedPoint

          private void calcRotatedPoint(float t,
                                        int i,
                                        boolean isPrecision,
                                        int[][] xyzf,
                                        float[][] xyzt)

    - #### allocRaster

          private int allocRaster(boolean isPrecision,
                                  int[][] xyzf,
                                  float[][] xyzt)

    - #### interpolate

          private void interpolate(int iLower,
                                   int iUpper,
                                   int[][] xyzf,
                                   float[][] xyzt)

    - #### interpolatePrecisely

          private void interpolatePrecisely(int iLower,
                                            int iUpper,
                                            int[][] xyzf,
                                            float[][] xyzt)

    - #### renderFlatEndcap

          private void renderFlatEndcap(boolean isCylinder,
                                        boolean isPrecise,
                                        int[][] xyzf)

    - #### renderSphericalEndcaps

          private void renderSphericalEndcaps()

    - #### calcArgbEndcap

          private void calcArgbEndcap(boolean tCylinder,
                                      boolean isFloat)