MeshSurface
Date: 2019-10-22

org.jmol.util

## Class MeshSurface

- java.lang.Object
- - org.jmol.util.MeshSurface

- Direct Known Subclasses:
    Mesh, MeshData

      public class MeshSurface
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `javajs.util.T3[]` | `altVertices`
    `javajs.util.BS` | `bsDisplay`
    `javajs.util.BS` | `bsPolygons`
    `javajs.util.BS` | `bsSlabDisplay`
    `javajs.util.BS` | `bsSlabGhost`
    `short` | `colix`
    `short` | `colixBack`
    `boolean` | `colorsExplicit`
    `boolean` | `dataOnly`
    `boolean` | `haveQuads`
    `protected int` | `iA`
    `protected int` | `iB`
    `protected int` | `iC`
    `boolean` | `isColorSolid`
    `boolean` | `isDrawPolygon`
    `boolean` | `isMerged`
    `private short` | `lastColix`
    `private int` | `lastColor`
    `javajs.util.M4` | `mat4`
    `int` | `mergePolygonCount0`
    `int` | `mergeVertexCount0`
    `java.lang.String` | `meshType`
    `int` | `normalCount`
    `javajs.util.T3[]` | `normals`
    `javajs.util.V3[]` | `normalsTemp`
    `int` | `normixCount`
    `int` | `nSets`
    `javajs.util.V3[]` | `oabc`
    `javajs.util.P3` | `offset`
    `static int` | `P_CHECK`
    `static int` | `P_CONTOUR`
    `static int` | `P_EXPLICIT_COLOR`
    `int` | `pc` polygon count
    `short[]` | `pcs` polygon color index "colix" array
    `int[][]` | `pis` polygon indexes
    `int` | `polygonCount0`
    `protected static int` | `SEED_COUNT`
    `short` | `slabColix`
    `int` | `slabMeshType`
    `javajs.util.SB` | `slabOptions`
    `private MeshSlicer` | `slicer`
    `javajs.util.BS` | `surfaceAtoms`
    `javajs.util.BS[]` | `surfaceSet`
    `int` | `vc` vertex count
    `short[]` | `vcs` vertex color index "colix" array
    `int` | `vertexCount0`
    `int[]` | `vertexSets`
    `int[]` | `vertexSource`
    `javajs.util.T3[]` | `vs` vertices
    `float[]` | `vvs` vertex values
    `Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MeshSurface()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addPolygon(int[] polygon, javajs.util.BS bs)`
    `protected int` | `addPolygonC(int[] polygon, int color, javajs.util.BS bs, boolean isExplicit)`
    `(package private) int` | `addPolygonV3(int vertexA, int vertexB, int vertexC, int check, int iContour, int color, javajs.util.BS bs)`
    `void` | `addQuad(int vertexA, int vertexB, int vertexC, int vertexD)`
    `void` | `addTriangle(int vertexA, int vertexB, int vertexC)`
    `int` | `addTriangleCheck(int vertexA, int vertexB, int vertexC, int check, int iContour, int color)`
    `int` | `addV(javajs.util.T3 vertex, boolean asCopy)`
    `int` | `addVCVal(javajs.util.T3 vertex, float value, boolean asCopy)`
    `int[][]` | `getFaces()`
    `MeshSlicer` | `getMeshSlicer()`
    `float` | `getResolution()`
    `java.lang.String` | `getSlabColor()`
    `java.lang.String` | `getSlabType()`
    `static MeshSurface` | `getSphereData(int lvl)` Calculates the data (faces, vertices, normals) for a sphere.
    `static float` | `getSphericalInterpolationFraction(double r, double valueA, double valueB, double d)`
    `javajs.util.T3[]` | `getVertices()`
    `void` | `invalidatePolygons()`
    `static MeshSurface` | `newMesh(boolean isAlt, javajs.util.T3[] vertices, int vertexCount, int[][] polygonIndexes, javajs.util.T3[] normals, int nNormals)`
    `void` | `resetSlab()`
    `protected int[]` | `setABC(int i)`
    `void` | `setBoundingBox(javajs.util.P3[] boundBoxPoints)`
    `void` | `setBox(javajs.util.P3 xyzMin, javajs.util.P3 xyzMax)`
    `void` | `setColix(short colix)`
    `void` | `setColixBack(short colix)`
    `void` | `setPolygonCount(int polygonCount)`
    `void` | `setTranslucentVertices(javajs.util.BS bsVertices)` Must create bsTransPolygons, polygonTranslucencies, and new triangle set for partially translucent polygons
    `protected void` | `slabBrillouin(javajs.util.P3[] unitCellVectors)`
    `void` | `slabPolygonsList(javajs.util.Lst<java.lang.Object[]> slabInfo, boolean allowCap)`

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

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

- - ### Field Detail

    - #### SEED_COUNT

          protected static final int SEED_COUNT

      See Also:
        Constant Field Values

    - #### P_CHECK

          public static final int P_CHECK

      See Also:
        Constant Field Values

    - #### P_CONTOUR

          public static final int P_CONTOUR

      See Also:
        Constant Field Values

    - #### P_EXPLICIT_COLOR

          public static final int P_EXPLICIT_COLOR

      See Also:
        Constant Field Values

    - #### vwr

          public Viewer vwr

    - #### slicer

          private MeshSlicer slicer

    - #### oabc

          public javajs.util.V3[] oabc

    - #### meshType

          public java.lang.String meshType

    - #### vc

          public int vc

      vertex count

    - #### vs

          public javajs.util.T3[] vs

      vertices

    - #### vvs

          public float[] vvs

      vertex values

    - #### vertexSource

          public int[] vertexSource

    - #### surfaceAtoms

          public javajs.util.BS surfaceAtoms

    - #### pc

          public int pc

      polygon count

    - #### pis

          public int[][] pis

      polygon indexes

    - #### colorsExplicit

          public boolean colorsExplicit

    - #### isDrawPolygon

          public boolean isDrawPolygon

    - #### haveQuads

          public boolean haveQuads

    - #### colix

          public short colix

    - #### colixBack

          public short colixBack

    - #### isColorSolid

          public boolean isColorSolid

    - #### offset

          public javajs.util.P3 offset

    - #### altVertices

          public javajs.util.T3[] altVertices

    - #### pcs

          public short[] pcs

      polygon color index "colix" array

    - #### vcs

          public short[] vcs

      vertex color index "colix" array

    - #### normals

          public javajs.util.T3[] normals

    - #### normalsTemp

          public javajs.util.V3[] normalsTemp

    - #### normalCount

          public int normalCount

    - #### normixCount

          public int normixCount

    - #### bsPolygons

          public javajs.util.BS bsPolygons

    - #### mat4

          public javajs.util.M4 mat4

    - #### surfaceSet

          public javajs.util.BS[] surfaceSet

    - #### vertexSets

          public int[] vertexSets

    - #### nSets

          public int nSets

    - #### dataOnly

          public boolean dataOnly

    - #### lastColor

          private int lastColor

    - #### lastColix

          private short lastColix

    - #### iA

          protected int iA

    - #### iB

          protected int iB

    - #### iC

          protected int iC

    - #### polygonCount0

          public int polygonCount0

    - #### vertexCount0

          public int vertexCount0

    - #### bsSlabDisplay

          public javajs.util.BS bsSlabDisplay

    - #### bsSlabGhost

          public javajs.util.BS bsSlabGhost

    - #### slabMeshType

          public int slabMeshType

    - #### slabColix

          public short slabColix

    - #### bsDisplay

          public javajs.util.BS bsDisplay

    - #### slabOptions

          public javajs.util.SB slabOptions

    - #### mergeVertexCount0

          public int mergeVertexCount0

    - #### mergePolygonCount0

          public int mergePolygonCount0

    - #### isMerged

          public boolean isMerged

  - ### Constructor Detail

    - #### MeshSurface

          public MeshSurface()

  - ### Method Detail

    - #### getMeshSlicer

          public MeshSlicer getMeshSlicer()

    - #### newMesh

          public static MeshSurface newMesh(boolean isAlt,
                                            javajs.util.T3[] vertices,
                                            int vertexCount,
                                            int[][] polygonIndexes,
                                            javajs.util.T3[] normals,
                                            int nNormals)

    - #### getVertices

          public javajs.util.T3[] getVertices()

      Returns:
        The vertices.

    - #### getFaces

          public int[][] getFaces()

      Returns:
        faces, if defined (in exporter), otherwise polygonIndexes

    - #### setColix

          public void setColix(short colix)

    - #### setColixBack

          public void setColixBack(short colix)

    - #### addV

          public int addV(javajs.util.T3 vertex,
                          boolean asCopy)

    - #### addTriangle

          public void addTriangle(int vertexA,
                                  int vertexB,
                                  int vertexC)

    - #### addQuad

          public void addQuad(int vertexA,
                              int vertexB,
                              int vertexC,
                              int vertexD)

    - #### setPolygonCount

          public void setPolygonCount(int polygonCount)

    - #### addVCVal

          public int addVCVal(javajs.util.T3 vertex,
                              float value,
                              boolean asCopy)

    - #### addTriangleCheck

          public int addTriangleCheck(int vertexA,
                                      int vertexB,
                                      int vertexC,
                                      int check,
                                      int iContour,
                                      int color)

    - #### addPolygonV3

          int addPolygonV3(int vertexA,
                           int vertexB,
                           int vertexC,
                           int check,
                           int iContour,
                           int color,
                           javajs.util.BS bs)

    - #### addPolygonC

          protected int addPolygonC(int[] polygon,
                                    int color,
                                    javajs.util.BS bs,
                                    boolean isExplicit)

    - #### addPolygon

          public int addPolygon(int[] polygon,
                                javajs.util.BS bs)

    - #### invalidatePolygons

          public void invalidatePolygons()

    - #### setABC

          protected int[] setABC(int i)

    - #### setTranslucentVertices

          public void setTranslucentVertices(javajs.util.BS bsVertices)

      Must create bsTransPolygons, polygonTranslucencies, and new triangle set for partially translucent polygons
      Parameters:
        `bsVertices` -

    - #### getSlabColor

          public java.lang.String getSlabColor()

    - #### getSlabType

          public java.lang.String getSlabType()

    - #### resetSlab

          public void resetSlab()

    - #### slabPolygonsList

          public void slabPolygonsList(javajs.util.Lst<java.lang.Object[]> slabInfo,
                                       boolean allowCap)

    - #### slabBrillouin

          protected void slabBrillouin(javajs.util.P3[] unitCellVectors)

      Parameters:
        `unitCellVectors` -

    - #### getResolution

          public float getResolution()

    - #### getSphereData

          public static MeshSurface getSphereData(int lvl)

      Calculates the data (faces, vertices, normals) for a sphere.
      Parameters:
        `lvl` -
      Returns:
        The data.

    - #### setBox

          public void setBox(javajs.util.P3 xyzMin,
                             javajs.util.P3 xyzMax)

    - #### setBoundingBox

          public void setBoundingBox(javajs.util.P3[] boundBoxPoints)

      Parameters:
        `boundBoxPoints` -

    - #### getSphericalInterpolationFraction

          public static float getSphericalInterpolationFraction(double r,
                                                                double valueA,
                                                                double valueB,
                                                                double d)