BioMeshRenderer
Date: 2019-10-22

org.jmol.renderbio

## Class BioMeshRenderer

- java.lang.Object
- - org.jmol.render.ShapeRenderer
  - - org.jmol.render.MeshRenderer
    - - org.jmol.renderbio.BioMeshRenderer

-     public class BioMeshRenderer
      extends MeshRenderer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private javajs.util.A4` | `aa`
    `private static int` | `ABSOLUTE_MIN_MESH_SIZE`
    `private BioShapeRenderer` | `bsr`
    `private javajs.util.BS` | `bsRenderMesh`
    `private javajs.util.BS` | `bsTemp`
    `private javajs.util.P3[]` | `controlHermites`
    `private boolean` | `doCap0`
    `private boolean` | `doCap1`
    `private javajs.util.M3` | `mat`
    `private Mesh[]` | `meshes`
    `private boolean[]` | `meshReady`
    `private static int` | `MIN_MESH_RENDER_SIZE`
    `private static int` | `MODE_ELLIPTICAL`
    `private static int` | `MODE_FLAT`
    `private static int` | `MODE_NONELLIPTICAL`
    `private static int` | `MODE_TUBE`
    `private javajs.util.V3` | `norm`
    `private javajs.util.V3` | `norml`
    `private javajs.util.P3` | `pt`
    `private javajs.util.P3` | `pt1`
    `private javajs.util.P3` | `ptNext`
    `private javajs.util.P3` | `ptPrev`
    `private javajs.util.P3[]` | `radiusHermites`
    `private javajs.util.V3` | `wing`
    `private javajs.util.V3` | `wing1`
    `private javajs.util.V3[]` | `wingHermites`
    `private javajs.util.V3` | `wingT`

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

      `antialias, bsPolygons, bsPolygonsToExport, diameter, exportPass, forceShowTriangles, frontOnly, haveBsDisplay, imageFontScaling, isGhostPass, isShell, isTranslucent, isTranslucentInherit, latticeOffset, mesh, meshSlabValue, needTranslucent, normixes, p3Screens, pt1f, pt1i, pt2f, pt2i, pt3i, renderLow, scalePixelsPerMicron, screens, selectedPolyOnly, thePlane, transformedVectors, vertexCount, vertices, volumeRender, width`

    - ### 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
    `BioMeshRenderer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `adjustCartoonSeamNormals(int i, int nPer)` Matches normals for adjacent mesh sections to create a seamless overall mesh.
    `boolean` | `check(boolean doCap0, boolean doCap1)`
    `private boolean` | `checkDiameter(int d)`
    `private boolean` | `createMesh(int i, int madBeg, int madMid, int madEnd, float aspectRatio, int tension)` Cartoon meshes are triangulated objects.
    `void` | `initBS()`
    `void` | `initialize(ShapeRenderer bsr, BioShape bioShape, int monomerCount)`
    `protected boolean` | `render()`
    `private void` | `renderBioMesh(Mesh mesh)`
    `void` | `renderMeshes()`
    `void` | `setFancyArrowHead(int i)`
    `void` | `setFancyConic(int i, int tension)`
    `void` | `setFancyRibbon(int i)`

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

      `checkFront, drawEdge, drawTriangle, exportSurface, isPolygonDisplayable, isVisibleNormix, render2, render2b, renderMesh2, renderPoints, renderTriangles, setColix`

    - ### 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

    - #### meshes

          private Mesh[] meshes

    - #### meshReady

          private boolean[] meshReady

    - #### bsRenderMesh

          private javajs.util.BS bsRenderMesh

    - #### bsr

          private BioShapeRenderer bsr

    - #### doCap0

          private boolean doCap0

    - #### doCap1

          private boolean doCap1

    - #### ABSOLUTE_MIN_MESH_SIZE

          private static final int ABSOLUTE_MIN_MESH_SIZE

      See Also:
        Constant Field Values

    - #### MIN_MESH_RENDER_SIZE

          private static final int MIN_MESH_RENDER_SIZE

      See Also:
        Constant Field Values

    - #### controlHermites

          private javajs.util.P3[] controlHermites

    - #### wingHermites

          private javajs.util.V3[] wingHermites

    - #### radiusHermites

          private javajs.util.P3[] radiusHermites

    - #### norm

          private javajs.util.V3 norm

    - #### wing

          private final javajs.util.V3 wing

    - #### wing1

          private final javajs.util.V3 wing1

    - #### wingT

          private final javajs.util.V3 wingT

    - #### aa

          private final javajs.util.A4 aa

    - #### pt

          private final javajs.util.P3 pt

    - #### pt1

          private final javajs.util.P3 pt1

    - #### ptPrev

          private final javajs.util.P3 ptPrev

    - #### ptNext

          private final javajs.util.P3 ptNext

    - #### mat

          private final javajs.util.M3 mat

    - #### MODE_TUBE

          private static final int MODE_TUBE

      See Also:
        Constant Field Values

    - #### MODE_FLAT

          private static final int MODE_FLAT

      See Also:
        Constant Field Values

    - #### MODE_ELLIPTICAL

          private static final int MODE_ELLIPTICAL

      See Also:
        Constant Field Values

    - #### MODE_NONELLIPTICAL

          private static final int MODE_NONELLIPTICAL

      See Also:
        Constant Field Values

    - #### bsTemp

          private javajs.util.BS bsTemp

    - #### norml

          private final javajs.util.V3 norml

  - ### Constructor Detail

    - #### BioMeshRenderer

          public BioMeshRenderer()

  - ### Method Detail

    - #### render

          protected boolean render()

      Specified by:
        `render` in class `ShapeRenderer`

    - #### initialize

          public void initialize(ShapeRenderer bsr,
                                 BioShape bioShape,
                                 int monomerCount)

    - #### renderBioMesh

          private void renderBioMesh(Mesh mesh)

    - #### setFancyRibbon

          public void setFancyRibbon(int i)

    - #### setFancyConic

          public void setFancyConic(int i,
                                    int tension)

    - #### setFancyArrowHead

          public void setFancyArrowHead(int i)

    - #### createMesh

          private boolean createMesh(int i,
                                     int madBeg,
                                     int madMid,
                                     int madEnd,
                                     float aspectRatio,
                                     int tension)

      Cartoon meshes are triangulated objects.
      Parameters:
        `i` -
        `madBeg` -
        `madMid` -
        `madEnd` -
        `aspectRatio` -
        `tension` -
      Returns:
        true if deferred rendering is required due to normals averaging

    - #### adjustCartoonSeamNormals

          void adjustCartoonSeamNormals(int i,
                                        int nPer)

      Matches normals for adjacent mesh sections to create a seamless overall mesh. We use temporary normals here. We will convert normals to normixes later.
      Parameters:
        `i` -
        `nPer` -

    - #### renderMeshes

          public void renderMeshes()

    - #### initBS

          public void initBS()

    - #### check

          public boolean check(boolean doCap0,
                               boolean doCap1)

    - #### checkDiameter

          private boolean checkDiameter(int d)