# Class MeshSurface

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

Direct Known Subclasses:
  `Mesh, MeshData`

public class MeshSurface extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`T3[]`
`altVertices`
`BS`
`bsDisplay`
`BS`
`bsPolygons`
`BS`
`bsSlabDisplay`
`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`
`M4`
`mat4`
`int`
`mergePolygonCount0`
`int`
`mergeVertexCount0`
`String`
`meshType`
`int`
`normalCount`
`T3[]`
`normals`
`V3[]`
`normalsTemp`
`int`
`normixCount`
`int`
`nSets`
`V3[]`
`oabc`
`P3`
`offset`
`static final int`
`P_CHECK`
`static final int`
`P_CONTOUR`
`static final int`
`P_EXPLICIT_COLOR`
`int`
`pc`
polygon count
`short[]`
`pcs`
polygon color index "colix" array
`int[][]`
`pis`
polygon indexes
`int`
`polygonCount0`
`protected static final int`
`SEED_COUNT`
`short`
`slabColix`
`int`
`slabMeshType`
`SB`
`slabOptions`
`BS`
`surfaceAtoms`
`BS[]`
`surfaceSet`
`int`
`vc`
vertex count
`short[]`
`vcs`
vertex color index "colix" array
`int`
`vertexCount0`
`int[]`
`vertexSets`
`int[]`
`vertexSource`
`T3[]`
`vs`
vertices
`float[]`
`vvs`
vertex values
`Viewer`
`vwr`

## Constructor Summary

Constructors
Constructor
Description
`MeshSurface()`

## Method Summary

Modifier and Type
Method
Description
`int`
`addPolygon(int[] polygon, BS bs)`
`protected int`
`addPolygonC(int[] polygon, int color, BS bs, boolean isExplicit)`
`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(T3 vertex, boolean asCopy)`
`int`
`addVCVal(T3 vertex, float value, boolean asCopy)`
`int[][]`
`getFaces()`
`MeshSlicer`
`getMeshSlicer()`
`float`
`getResolution()`
`String`
`getSlabColor()`
`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)`
`T3[]`
`getVertices()`
`void`
`invalidatePolygons()`
`static MeshSurface`
`newMesh(boolean isAlt, T3[] vertices, int vertexCount, int[][] polygonIndexes, T3[] normals, int nNormals)`
`void`
`resetSlab()`
`protected int[]`
`setABC(int i)`
`void`
`setBoundingBox(P3[] boundBoxPoints)`
`void`
`setBox(P3 xyzMin, P3 xyzMax)`
`void`
`setColix(short colix)`
`void`
`setColixBack(short colix)`
`void`
`setPolygonCount(int polygonCount)`
`void`
`setTranslucentVertices(BS bsVertices)`
Must create bsTransPolygons, polygonTranslucencies, and new triangle set for partially translucent polygons
`protected void`
`slabBrillouin(P3[] unitCellVectors)`
`void`
`slabPolygonsList(Lst<Object[]> slabInfo, boolean allowCap)`

### Methods inherited from class Object

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

## Field Details

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

### oabc

public V3[] oabc

### meshType

public String meshType

### vc

public int vc
vertex count

### vs

public T3[] vs
vertices

### vvs

public float[] vvs
vertex values

### vertexSource

public int[] vertexSource

### surfaceAtoms

public 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 P3 offset

### altVertices

public T3[] altVertices

### pcs

public short[] pcs
polygon color index "colix" array

### vcs

public short[] vcs
vertex color index "colix" array

### normals

public T3[] normals

### normalsTemp

public V3[] normalsTemp

### normalCount

public int normalCount

### normixCount

public int normixCount

### bsPolygons

public BS bsPolygons

### mat4

public M4 mat4

### surfaceSet

public BS[] surfaceSet

### vertexSets

public int[] vertexSets

### nSets

public int nSets

### dataOnly

public boolean dataOnly

### iA

protected int iA

### iB

protected int iB

### iC

protected int iC

### polygonCount0

public int polygonCount0

### vertexCount0

public int vertexCount0

### bsSlabDisplay

public BS bsSlabDisplay

### bsSlabGhost

public BS bsSlabGhost

### slabMeshType

public int slabMeshType

### slabColix

public short slabColix

### bsDisplay

public BS bsDisplay

### slabOptions

public SB slabOptions

### mergeVertexCount0

public int mergeVertexCount0

### mergePolygonCount0

public int mergePolygonCount0

### isMerged

public boolean isMerged

## Constructor Details

### MeshSurface

public MeshSurface()

## Method Details

### getMeshSlicer

public MeshSlicer getMeshSlicer()

### newMesh

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

### getVertices

public 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(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(T3 vertex, float value, boolean asCopy)

### addTriangleCheck

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

### addPolygonC

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

### addPolygon

public int addPolygon(int[] polygon, BS bs)

### invalidatePolygons

public void invalidatePolygons()

### setABC

protected int[] setABC(int i)

### setTranslucentVertices

public void setTranslucentVertices(BS bsVertices)
Must create bsTransPolygons, polygonTranslucencies, and new triangle set for partially translucent polygons

Parameters:
  `bsVertices` -

### getSlabColor

public String getSlabColor()

### getSlabType

public String getSlabType()

### resetSlab

public void resetSlab()

### slabPolygonsList

public void slabPolygonsList(Lst<Object[]> slabInfo, boolean allowCap)

### slabBrillouin

protected void slabBrillouin(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(P3 xyzMin, P3 xyzMax)

### setBoundingBox

public void setBoundingBox(P3[] boundBoxPoints)

Parameters:
  `boundBoxPoints` -

### getSphericalInterpolationFraction

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