# Class Isosurface

java.lang.Object
org.jmol.shape.Shape
org.jmol.shape.MeshCollection
org.jmol.shapesurface.Isosurface

All Implemented Interfaces:
  `MeshDataServer, VertexDataServer`

Direct Known Subclasses:
  `Contact, LcaoCartoon, MolecularOrbital, Pmesh`

public class Isosurface extends MeshCollection implements MeshDataServer

## Field Summary

Fields
Modifier and Type
Field
Description
`protected boolean`
`iHaveBitSets`
`protected IsosurfaceMesh[]`
`isomeshes`
`int[]`
`keyXy`
`protected SurfaceGenerator`
`sg`
`protected IsosurfaceMesh`
`thisMesh`

### Fields inherited from class MeshCollection

`bsDisplay, colix, color, connections, currentMesh, displayWithinDistance2, displayWithinPoints, explicitID, htObjects, isDisplayWithinNot, isFixed, jvxlData, linkedMesh, meshCount, meshes, modelIndex, nUnnamed, pickedMesh, pickedModel, pickedPt, pickedVertex, PREVIOUS_MESH_ID, previousMeshID, title`

### Fields inherited from class Shape

`bsColixSet, bsSizeSet, isBioShape, ms, myType, RADIUS_MAX, shapeID, translucentAllowed, translucentLevel, vf, vwr`

## Constructor Summary

Constructors
Constructor
Description
`Isosurface()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addMeshInfo(IsosurfaceMesh mesh, Map<String,Object> info)`
`void`
`addRequiredFile(String fileName)`
`int`
`addTriangleCheck(int iA, int iB, int iC, int check, int iContour, boolean isAbsolute, int color)`
addTriangleCheck adds a triangle along with a 3-bit check indicating which edges to draw in mesh mode: 1 (iA-iB) + 2 (iB-iC) + 4 (iC-iA)
`int`
`addVertexCopy(T3 vertexXYZ, float value, int assocVertex, boolean asCopy)`
addVertexCopy is used by the Marching Squares algorithm to uniquely identify a new vertex when an edge is crossed in the 2D plane.
`void`
`allocMesh(String thisID, Mesh m)`
`P3[]`
`calculateGeodesicSurface(BS bsSelected, float envelopeRadius)`
`Map<String,Object>`
`checkObjectClicked(int x, int y, int action, BS bsVisible, boolean drawPicking)`
`boolean`
`checkObjectHovered(int x, int y, BS bsVisible)`
`protected void`
`clearSg()`
`protected void`
`discardTempData(boolean discardAll)`
`void`
`fillMeshData(MeshData meshData, int mode, IsosurfaceMesh mesh)`
`protected void`
`getCapSlabInfo(String script)`
`String`
`getCmd(int index)`
`float[]`
`getPlane(int x)`
`static String`
`getPolygonColorData(int ccount, short[] colixes, int[][] polygons, BS bsSlabDisplay)`
`Object`
`getProperty(String property, int index)`
`boolean`
`getPropertyData(String property, Object[] data)`
`protected Object`
`getPropI(String property, int index)`
`Object`
`getShapeDetail()`
`String`
`getShapeState()`
`int`
`getSurfacePointIndexAndFraction(float cutoff, boolean isCutoffAbsolute, int x, int y, int z, P3i offset, int vA, int vB, float valueA, float valueB, T3 pointA, V3 edgeVector, boolean isContourType, float[] fReturn)`
////////// VertexDataServer interface methods ////////////////
`float`
`getValue(int x, int y, int z, int ptyz)`
for readers only
`protected Object`
`getValues(Mesh mesh)`
`protected Object`
`getVertices(Mesh mesh)`
`void`
`initShape()`
`void`
`invalidateTriangles()`
//////////// meshDataServer interface /////////////////
`protected void`
`newSg()`
`boolean`
`notifySurfaceGenerationCompleted()`
`void`
`notifySurfaceMappingCompleted()`
`void`
`setOutputChannel(GenericBinaryDocument binaryDoc, OC out)`
`void`
`setProperty(String propertyName, Object value, BS bs)`
`protected void`
`setPropI(String propertyName, Object value, BS bs)`
`void`
`setRequiredFile(String oldName, String fileName)`
`protected void`
`setScriptInfo(String strCommand)`
`protected void`
`slabPolygons(Object[] slabInfo)`

### Methods inherited from class MeshCollection

`checkExplicit, clean, deleteMeshI, deleteMeshKey, getIndexFromName, getMesh, getMeshList, getPickedPoint, getPropDataMC, getPropMC, merge, resetObjects, setMeshColor, setModelVisibilityFlags, setPropMC, setStatusPicked, setTitle, setTokenProperty`

### Methods inherited from class Shape

`appendCmd, checkBoundsMinMax, checkObjectDragged, coordinateInRange, encodeColor, findNearestAtomIndex, getColix, getColixA, getColixB, getColixI, getColorCommand, getColorCommandUnk, getFontCommand, getPropShape, getSize, getSizeG, getTranslucentLabel, initializeShape, initModelSet, replaceGroup, setAtomClickability, setModelSet, setProperties, setPropS, setShapeSizeRD, setSize, setSizeRD, wasClicked`

### Methods inherited from class Object

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

## Field Details

### isomeshes

protected IsosurfaceMesh[] isomeshes

### thisMesh

protected IsosurfaceMesh thisMesh

### iHaveBitSets

protected boolean iHaveBitSets

### sg

protected SurfaceGenerator sg

### keyXy

public int[] keyXy

## Constructor Details

### Isosurface

public Isosurface()

## Method Details

### allocMesh

public void allocMesh(String thisID, Mesh m)

Overrides:
  `allocMesh` in class `MeshCollection`

### initShape

public void initShape()

Overrides:
  `initShape` in class `MeshCollection`

### newSg

protected void newSg()

### clearSg

protected void clearSg()

### setProperty

public void setProperty(String propertyName, Object value, BS bs)

Specified by:
  `setProperty` in class `Shape`

### setPropI

protected void setPropI(String propertyName, Object value, BS bs)

### slabPolygons

protected void slabPolygons(Object[] slabInfo)

### getPropertyData

public boolean getPropertyData(String property, Object[] data)

Overrides:
  `getPropertyData` in class `Shape`
Parameters:
  `property` -
  `data` -
Returns:
  true if serviced

### getProperty

public Object getProperty(String property, int index)

Overrides:
  `getProperty` in class `Shape`
Parameters:
  `property` -
  `index` -
Returns:
  true if serviced

### getPropI

protected Object getPropI(String property, int index)

### getPolygonColorData

public static String getPolygonColorData(int ccount, short[] colixes, int[][] polygons, BS bsSlabDisplay)

### getShapeState

public String getShapeState()

Specified by:
  `getShapeState` in class `Shape`

### getCapSlabInfo

protected void getCapSlabInfo(String script)

### discardTempData

protected void discardTempData(boolean discardAll)

### invalidateTriangles

public void invalidateTriangles()
//////////// meshDataServer interface /////////////////

Specified by:
  `invalidateTriangles` in interface `MeshDataServer`

### setOutputChannel

public void setOutputChannel(GenericBinaryDocument binaryDoc, OC out)

Specified by:
  `setOutputChannel` in interface `MeshDataServer`

### fillMeshData

public void fillMeshData(MeshData meshData, int mode, IsosurfaceMesh mesh)

Specified by:
  `fillMeshData` in interface `MeshDataServer`

### notifySurfaceGenerationCompleted

public boolean notifySurfaceGenerationCompleted()

Specified by:
  `notifySurfaceGenerationCompleted` in interface `MeshDataServer`

### notifySurfaceMappingCompleted

public void notifySurfaceMappingCompleted()

Specified by:
  `notifySurfaceMappingCompleted` in interface `MeshDataServer`

### calculateGeodesicSurface

public P3[] calculateGeodesicSurface(BS bsSelected, float envelopeRadius)

Specified by:
  `calculateGeodesicSurface` in interface `MeshDataServer`

### getSurfacePointIndexAndFraction

public int getSurfacePointIndexAndFraction(float cutoff, boolean isCutoffAbsolute, int x, int y, int z, P3i offset, int vA, int vB, float valueA, float valueB, T3 pointA, V3 edgeVector, boolean isContourType, float[] fReturn)
////////// VertexDataServer interface methods ////////////////

Specified by:
  `getSurfacePointIndexAndFraction` in interface `VertexDataServer`
Parameters:
  `cutoff` -
  `isCutoffAbsolute` -
  `x` -
  `y` -
  `z` -
  `offset` -
  `vA` - [0:7]
  `vB` - [0:7]
  `valueA` -
  `valueB` -
  `pointA` -
  `edgeVector` - vector from A to B
  `isContourType` -
  `fReturn` -
Returns:
  new vertex index or Integer.MAX_VALUE

### addVertexCopy

public int addVertexCopy(T3 vertexXYZ, float value, int assocVertex, boolean asCopy)
Description copied from interface: `VertexDataServer`
addVertexCopy is used by the Marching Squares algorithm to uniquely identify a new vertex when an edge is crossed in the 2D plane. The implementing method should COPY the Point3f using Point3f.set(). The data consumer can use the association key to group this vertex with others near the same gridpoint.

Specified by:
  `addVertexCopy` in interface `VertexDataServer`
Parameters:
  `vertexXYZ` -
  `value` -
  `assocVertex` - unique association vertex or -1
  `asCopy` -
Returns:
  new vertex index

### addTriangleCheck

public int addTriangleCheck(int iA, int iB, int iC, int check, int iContour, boolean isAbsolute, int color)
Description copied from interface: `VertexDataServer`
addTriangleCheck adds a triangle along with a 3-bit check indicating which edges to draw in mesh mode: 1 (iA-iB) + 2 (iB-iC) + 4 (iC-iA)

Specified by:
  `addTriangleCheck` in interface `VertexDataServer`
Parameters:
  `iA` -
  `iB` -
  `iC` -
  `check` -
  `iContour` - TODO
  `isAbsolute` -
  `color` -
Returns:
  polygon index or -1

### setScriptInfo

protected void setScriptInfo(String strCommand)

### addRequiredFile

public void addRequiredFile(String fileName)

Specified by:
  `addRequiredFile` in interface `MeshDataServer`

### setRequiredFile

public void setRequiredFile(String oldName, String fileName)

Specified by:
  `setRequiredFile` in interface `MeshDataServer`

### getShapeDetail

public Object getShapeDetail()

Overrides:
  `getShapeDetail` in class `Shape`

### addMeshInfo

protected void addMeshInfo(IsosurfaceMesh mesh, Map<String,Object> info)

### getPlane

public float[] getPlane(int x)

Specified by:
  `getPlane` in interface `VertexDataServer`

### getValue

public float getValue(int x, int y, int z, int ptyz)
Description copied from interface: `VertexDataServer`
for readers only

Specified by:
  `getValue` in interface `VertexDataServer`
Parameters:
  `x` -
  `y` -
  `z` -
  `ptyz` -
Returns:
  value[x][y][z]

### checkObjectHovered

public boolean checkObjectHovered(int x, int y, BS bsVisible)

Overrides:
  `checkObjectHovered` in class `Shape`
Parameters:
  `x` -
  `y` -
  `bsVisible` -
Returns:
  T/F

### checkObjectClicked

public Map<String,Object> checkObjectClicked(int x, int y, int action, BS bsVisible, boolean drawPicking)

Overrides:
  `checkObjectClicked` in class `Shape`
Parameters:
  `x` -
  `y` -
  `action` -
  `bsVisible` -
  `drawPicking` - TODO
Returns:
  Hashtable containing information about pt clicked

### getCmd

public String getCmd(int index)

### getValues

protected Object getValues(Mesh mesh)

Overrides:
  `getValues` in class `MeshCollection`

### getVertices

protected Object getVertices(Mesh mesh)

Overrides:
  `getVertices` in class `MeshCollection`