BioShapeRenderer
Date: 2019-10-22

org.jmol.renderbio

## Class BioShapeRenderer

- java.lang.Object
- - org.jmol.render.ShapeRenderer
  - - org.jmol.renderbio.BioShapeRenderer

- Direct Known Subclasses:
    BackboneRenderer, StrandsRenderer

      abstract class BioShapeRenderer
      extends ShapeRenderer

  Author:
    Alexander Rose, Bob Hanson

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) float` | `aspectRatio`
    `(package private) BioShape` | `bioShape`
    `protected javajs.util.BS` | `bsVisible`
    `protected boolean` | `cartoonsFancy`
    `(package private) short` | `colixBack`
    `protected short[]` | `colixes`
    `protected short[]` | `colixesBack`
    `protected javajs.util.P3[]` | `controlPoints`
    `protected javajs.util.P3[]` | `controlPointScreens`
    `(package private) int` | `diameterBeg`
    `(package private) int` | `diameterEnd`
    `(package private) int` | `diameterMid`
    `private boolean` | `haveControlPointScreens`
    `(package private) int` | `hermiteLevel`
    `(package private) int` | `iNext`
    `(package private) int` | `iNext2`
    `(package private) int` | `iNext3`
    `private boolean` | `invalidateMesh`
    `private boolean` | `invalidateSheets`
    `(package private) int` | `iPrev`
    `protected boolean` | `isCarbohydrate`
    `private boolean` | `isCyclic`
    `(package private) boolean` | `isHighRes`
    `protected boolean` | `isNucleic`
    `protected boolean` | `isPhosphorusOnly`
    `private boolean` | `isTraceAlpha`
    `protected int[]` | `leadAtomIndices`
    `(package private) short` | `madBeg`
    `(package private) short` | `madEnd`
    `(package private) short` | `madMid`
    `protected short[]` | `mads`
    `(package private) BioMeshRenderer` | `meshRenderer`
    `protected int` | `monomerCount`
    `protected Monomer[]` | `monomers`
    `private boolean` | `needTranslucent`
    `private javajs.util.P3` | `pointT`
    `private javajs.util.BS` | `reversed`
    `private boolean` | `ribbonBorder`
    `protected javajs.util.P3[]` | `ribbonBottomScreens`
    `protected javajs.util.P3[]` | `ribbonTopScreens`
    `private javajs.util.P3` | `screenArrowBot`
    `private javajs.util.P3` | `screenArrowBotPrev`
    `private javajs.util.P3` | `screenArrowTop`
    `private javajs.util.P3` | `screenArrowTopPrev`
    `private float` | `sheetSmoothing`
    `protected STR[]` | `structureTypes`
    `protected javajs.util.V3[]` | `wingVectors`
    `protected boolean` | `wireframeOnly`

    - ### Fields inherited from class org.jmol.render.ShapeRenderer

      `colix, exportType, g3d, isExport, mad, ms, myVisibilityFlag, shape, shapeID, tm, vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BioShapeRenderer()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `calc1Screen(javajs.util.P3 center, javajs.util.V3 vector, short mad, float offset_1000, javajs.util.P3 screen)`
    `protected void` | `calcScreenControlPoints()`
    `protected javajs.util.P3[]` | `calcScreens(float offsetFraction, short[] mads)` calculate screen points based on control points and wing positions (cartoon, strand, meshRibbon, and ribbon)
    `protected void` | `drawSegmentAB(Atom atomA, Atom atomB, short colixA, short colixB, float max)`
    `private void` | `freeTempArrays()`
    `protected short` | `getLeadColix(int i)`
    `protected short` | `getLeadColixBack(int i)`
    `private boolean` | `initializePolymer(BioShape bioShape)`
    `protected boolean` | `render()`
    `protected abstract void` | `renderBioShape(BioShape bioShape)`
    `protected void` | `renderHermiteArrowHead(int i)`
    `protected void` | `renderHermiteConic(int i, boolean thisTypeOnly, int tension)`
    `protected void` | `renderHermiteCylinder(javajs.util.P3[] screens, int i)`
    `protected void` | `renderHermiteRibbon(boolean doFill, int i, boolean thisTypeOnly)`
    `private void` | `renderShapes()`
    `protected boolean` | `setBioColix(short colix)`
    `protected boolean` | `setColix(short colix)`
    `private void` | `setGlobals()`
    `private boolean` | `setMads(int i, boolean thisTypeOnly)` set diameters for a bioshape
    `(package private) void` | `setNeighbors(int i)`
    `private void` | `setStructureTypes()`

    - ### Methods inherited from class org.jmol.render.ShapeRenderer

      `initRenderer, isVisibleForMe, renderShape, setup, setViewerG3dShapeID`

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

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

- - ### Field Detail

    - #### invalidateMesh

          private boolean invalidateMesh

    - #### invalidateSheets

          private boolean invalidateSheets

    - #### isTraceAlpha

          private boolean isTraceAlpha

    - #### ribbonBorder

          private boolean ribbonBorder

    - #### haveControlPointScreens

          private boolean haveControlPointScreens

    - #### aspectRatio

          float aspectRatio

    - #### hermiteLevel

          int hermiteLevel

    - #### sheetSmoothing

          private float sheetSmoothing

    - #### cartoonsFancy

          protected boolean cartoonsFancy

    - #### monomerCount

          protected int monomerCount

    - #### monomers

          protected Monomer[] monomers

    - #### isNucleic

          protected boolean isNucleic

    - #### isPhosphorusOnly

          protected boolean isPhosphorusOnly

    - #### isCarbohydrate

          protected boolean isCarbohydrate

    - #### bsVisible

          protected javajs.util.BS bsVisible

    - #### ribbonTopScreens

          protected javajs.util.P3[] ribbonTopScreens

    - #### ribbonBottomScreens

          protected javajs.util.P3[] ribbonBottomScreens

    - #### controlPoints

          protected javajs.util.P3[] controlPoints

    - #### controlPointScreens

          protected javajs.util.P3[] controlPointScreens

    - #### leadAtomIndices

          protected int[] leadAtomIndices

    - #### wingVectors

          protected javajs.util.V3[] wingVectors

    - #### mads

          protected short[] mads

    - #### colixes

          protected short[] colixes

    - #### colixesBack

          protected short[] colixesBack

    - #### structureTypes

          protected STR[] structureTypes

    - #### isHighRes

          boolean isHighRes

    - #### wireframeOnly

          protected boolean wireframeOnly

    - #### needTranslucent

          private boolean needTranslucent

    - #### meshRenderer

          BioMeshRenderer meshRenderer

    - #### bioShape

          BioShape bioShape

    - #### pointT

          private final javajs.util.P3 pointT

    - #### iPrev

          int iPrev

    - #### iNext

          int iNext

    - #### iNext2

          int iNext2

    - #### iNext3

          int iNext3

    - #### diameterBeg

          int diameterBeg

    - #### diameterMid

          int diameterMid

    - #### diameterEnd

          int diameterEnd

    - #### madBeg

          short madBeg

    - #### madMid

          short madMid

    - #### madEnd

          short madEnd

    - #### colixBack

          short colixBack

    - #### reversed

          private javajs.util.BS reversed

    - #### isCyclic

          private boolean isCyclic

    - #### screenArrowTop

          private final javajs.util.P3 screenArrowTop

    - #### screenArrowTopPrev

          private final javajs.util.P3 screenArrowTopPrev

    - #### screenArrowBot

          private final javajs.util.P3 screenArrowBot

    - #### screenArrowBotPrev

          private final javajs.util.P3 screenArrowBotPrev

  - ### Constructor Detail

    - #### BioShapeRenderer

          BioShapeRenderer()

  - ### Method Detail

    - #### renderBioShape

          protected abstract void renderBioShape(BioShape bioShape)

    - #### render

          protected boolean render()

      Specified by:
        `render` in class `ShapeRenderer`

    - #### setGlobals

          private void setGlobals()

    - #### renderShapes

          private void renderShapes()

    - #### setBioColix

          protected boolean setBioColix(short colix)

    - #### freeTempArrays

          private void freeTempArrays()

    - #### initializePolymer

          private boolean initializePolymer(BioShape bioShape)

    - #### setStructureTypes

          private void setStructureTypes()

    - #### calcScreenControlPoints

          protected void calcScreenControlPoints()

    - #### calcScreens

          protected javajs.util.P3[] calcScreens(float offsetFraction,
                                                 short[] mads)

      calculate screen points based on control points and wing positions (cartoon, strand, meshRibbon, and ribbon)
      Parameters:
        `offsetFraction` -
        `mads` -
      Returns:
        Point3i array THAT MUST BE LATER FREED

    - #### calc1Screen

          private void calc1Screen(javajs.util.P3 center,
                                   javajs.util.V3 vector,
                                   short mad,
                                   float offset_1000,
                                   javajs.util.P3 screen)

    - #### getLeadColix

          protected short getLeadColix(int i)

    - #### getLeadColixBack

          protected short getLeadColixBack(int i)

    - #### setNeighbors

          void setNeighbors(int i)

    - #### setColix

          protected boolean setColix(short colix)

    - #### setMads

          private boolean setMads(int i,
                                  boolean thisTypeOnly)

      set diameters for a bioshape
      Parameters:
        `i` -
        `thisTypeOnly` - true for Cartoon but not MeshRibbon
      Returns:
        true if a mesh is needed

    - #### renderHermiteCylinder

          protected void renderHermiteCylinder(javajs.util.P3[] screens,
                                               int i)

    - #### renderHermiteConic

          protected void renderHermiteConic(int i,
                                            boolean thisTypeOnly,
                                            int tension)

    - #### renderHermiteRibbon

          protected void renderHermiteRibbon(boolean doFill,
                                             int i,
                                             boolean thisTypeOnly)

      Parameters:
        `doFill` -
        `i` -
        `thisTypeOnly` - true for Cartoon but not MeshRibbon

    - #### renderHermiteArrowHead

          protected void renderHermiteArrowHead(int i)

    - #### drawSegmentAB

          protected void drawSegmentAB(Atom atomA,
                                       Atom atomB,
                                       short colixA,
                                       short colixB,
                                       float max)