TriangleRenderer
Date: 2019-10-22

org.jmol.g3d

## Class TriangleRenderer

- java.lang.Object
- - org.jmol.g3d.PrecisionRenderer
  - - org.jmol.g3d.TriangleRenderer

- All Implemented Interfaces:
    G3DRenderer

      public class TriangleRenderer
      extends PrecisionRenderer
      implements G3DRenderer

  renders triangles

  currently only renders flat triangles

  will probably need performance tuning

  Author:
    Miguel, miguel@jmol.org

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private float[]` | `aa`
    `private int[]` | `ax`
    `private int[]` | `axE`
    `private int[]` | `axW`
    `private int[]` | `ay`
    `private int[]` | `az`
    `private int[]` | `azE`
    `private int[]` | `azW`
    `private float[]` | `bb`
    `private static int` | `DEFAULT`
    `private Graphics3D` | `g3d`
    `private Rgb16[]` | `rgb16sE`
    `private Rgb16[]` | `rgb16sGouraud`
    `private Rgb16[]` | `rgb16sW`
    `private Rgb16` | `rgb16t1`
    `private Rgb16` | `rgb16t2`

    - ### Fields inherited from class org.jmol.g3d.PrecisionRenderer

      `a, b, isOrthographic`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TriangleRenderer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `fillTriangle(javajs.util.P3i screenA, javajs.util.P3i screenB, javajs.util.P3i screenC, boolean useGouraud)`
    `private void` | `generateRaster(int dy, int iN, int iS, int[] axRaster, int[] azRaster, int iRaster, Rgb16[] gouraud)`
    `private Rgb16[]` | `reallocRgb16s(Rgb16[] rgb16s, int n)`
    `G3DRenderer` | `set(JmolRendererInterface g3d, GData gdata)`
    `(package private) void` | `setGouraud(int rgbA, int rgbB, int rgbC)`

    - ### Methods inherited from class org.jmol.g3d.PrecisionRenderer

      `getZCurrent, setRastAB, setRastABFloat`

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

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

- - ### Field Detail

    - #### g3d

          private Graphics3D g3d

    - #### DEFAULT

          private static final int DEFAULT

      See Also:
        Constant Field Values

    - #### ax

          private int[] ax

    - #### ay

          private int[] ay

    - #### az

          private int[] az

    - #### aa

          private float[] aa

    - #### bb

          private float[] bb

    - #### axW

          private int[] axW

    - #### azW

          private int[] azW

    - #### axE

          private int[] axE

    - #### azE

          private int[] azE

    - #### rgb16sW

          private Rgb16[] rgb16sW

    - #### rgb16sE

          private Rgb16[] rgb16sE

    - #### rgb16sGouraud

          private Rgb16[] rgb16sGouraud

    - #### rgb16t1

          private final Rgb16 rgb16t1

    - #### rgb16t2

          private final Rgb16 rgb16t2

  - ### Constructor Detail

    - #### TriangleRenderer

          public TriangleRenderer()

  - ### Method Detail

    - #### set

          public G3DRenderer set(JmolRendererInterface g3d,
                                 GData gdata)

      Specified by:
        `set` in interface `G3DRenderer`

    - #### reallocRgb16s

          private Rgb16[] reallocRgb16s(Rgb16[] rgb16s,
                                        int n)

    - #### setGouraud

          void setGouraud(int rgbA,
                          int rgbB,
                          int rgbC)

    - #### fillTriangle

          void fillTriangle(javajs.util.P3i screenA,
                            javajs.util.P3i screenB,
                            javajs.util.P3i screenC,
                            boolean useGouraud)

    - #### generateRaster

          private void generateRaster(int dy,
                                      int iN,
                                      int iS,
                                      int[] axRaster,
                                      int[] azRaster,
                                      int iRaster,
                                      Rgb16[] gouraud)