Package org.jmol.shapesurface
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected IsosurfaceMesh[]
int[]
protected SurfaceGenerator
protected IsosurfaceMesh
Fields inherited from class org.jmol.shape.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 org.jmol.shape.Shape
bsColixSet, bsSizeSet, isBioShape, ms, myType, RADIUS_MAX, shapeID, translucentAllowed, translucentLevel, vf, vwr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
P3[]
calculateGeodesicSurface
(BS bsSelected, float envelopeRadius) 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) getCmd
(int index) float[]
getPlane
(int x) static String
getPolygonColorData
(int ccount, short[] colixes, int[][] polygons, BS bsSlabDisplay) getProperty
(String property, int index) boolean
getPropertyData
(String property, Object[] data) protected Object
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) getSurfacePointIndex is used by the Marching Cubes algorithm and must return a unique integer identifier for a vertex created by the Marching Cube algorithm when it finds an edge.float
getValue
(int x, int y, int z, int ptyz) for readers onlyprotected Object
protected Object
getVertices
(Mesh mesh) void
void
protected void
newSg()
boolean
void
void
setOutputChannel
(GenericBinaryDocument binaryDoc, OC out) void
setProperty
(String propertyName, Object value, BS bs) protected void
void
setRequiredFile
(String oldName, String fileName) protected void
setScriptInfo
(String strCommand) protected void
slabPolygons
(Object[] slabInfo) Methods inherited from class org.jmol.shape.MeshCollection
checkExplicit, clean, deleteMeshI, deleteMeshKey, getIndexFromName, getMesh, getMeshList, getPickedPoint, getPropDataMC, getPropMC, merge, resetObjects, setMeshColor, setModelVisibilityFlags, setPropMC, setStatusPicked, setTitle, setTokenProperty
Methods inherited from class org.jmol.shape.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
-
Field Details
-
isomeshes
-
thisMesh
-
iHaveBitSets
protected boolean iHaveBitSets -
sg
-
keyXy
public int[] keyXy
-
-
Constructor Details
-
Isosurface
public Isosurface()
-
-
Method Details
-
allocMesh
- Overrides:
allocMesh
in classMeshCollection
-
initShape
public void initShape()- Overrides:
initShape
in classMeshCollection
-
newSg
protected void newSg() -
clearSg
protected void clearSg() -
setProperty
- Specified by:
setProperty
in classShape
-
setPropI
-
slabPolygons
-
getPropertyData
- Overrides:
getPropertyData
in classShape
- Returns:
- true if serviced
-
getProperty
- Overrides:
getProperty
in classShape
- Returns:
- true if serviced
-
getPropI
-
getPolygonColorData
-
getShapeState
- Specified by:
getShapeState
in classShape
-
getCapSlabInfo
-
discardTempData
protected void discardTempData(boolean discardAll) -
invalidateTriangles
public void invalidateTriangles()- Specified by:
invalidateTriangles
in interfaceMeshDataServer
-
setOutputChannel
- Specified by:
setOutputChannel
in interfaceMeshDataServer
-
fillMeshData
- Specified by:
fillMeshData
in interfaceMeshDataServer
-
notifySurfaceGenerationCompleted
public boolean notifySurfaceGenerationCompleted()- Specified by:
notifySurfaceGenerationCompleted
in interfaceMeshDataServer
-
notifySurfaceMappingCompleted
public void notifySurfaceMappingCompleted()- Specified by:
notifySurfaceMappingCompleted
in interfaceMeshDataServer
-
calculateGeodesicSurface
- Specified by:
calculateGeodesicSurface
in interfaceMeshDataServer
-
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) Description copied from interface:VertexDataServer
getSurfacePointIndex is used by the Marching Cubes algorithm and must return a unique integer identifier for a vertex created by the Marching Cube algorithm when it finds an edge. If a vertex is discarded, then Integer.MAX_VALUE should be returned. the 3D coordinate of the point can be calculated using surfacePoint.scaleAdd(fraction, edgeVector, pointA); where fraction is generally calculated as: fraction = (cutoff - valueA) / (valueB - valueA); if (isCutoffAbsolute && (fraction < 0 || fraction > 1)) fraction = (-cutoff - valueA) / (valueB - valueA); This method is also used by MarchingCubes to deliver the appropriate oblique planar coordinate to MarchingSquares for later contouring.- Specified by:
getSurfacePointIndexAndFraction
in interfaceVertexDataServer
vA
- [0:7]vB
- [0:7]edgeVector
- vector from A to B- Returns:
- new vertex index or Integer.MAX_VALUE
-
addVertexCopy
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 interfaceVertexDataServer
assocVertex
- unique association vertex or -1- 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 interfaceVertexDataServer
iContour
- TODO- Returns:
- polygon index or -1
-
setScriptInfo
-
addRequiredFile
- Specified by:
addRequiredFile
in interfaceMeshDataServer
-
setRequiredFile
- Specified by:
setRequiredFile
in interfaceMeshDataServer
-
getShapeDetail
- Overrides:
getShapeDetail
in classShape
-
addMeshInfo
-
getPlane
public float[] getPlane(int x) - Specified by:
getPlane
in interfaceVertexDataServer
-
getValue
public float getValue(int x, int y, int z, int ptyz) Description copied from interface:VertexDataServer
for readers only- Specified by:
getValue
in interfaceVertexDataServer
- Returns:
- value[x][y][z]
-
checkObjectHovered
- Overrides:
checkObjectHovered
in classShape
- Returns:
- T/F
-
checkObjectClicked
public Map<String,Object> checkObjectClicked(int x, int y, int action, BS bsVisible, boolean drawPicking) - Overrides:
checkObjectClicked
in classShape
drawPicking
- TODO- Returns:
- Hashtable containing information about pt clicked
-
getCmd
-
getValues
- Overrides:
getValues
in classMeshCollection
-
getVertices
- Overrides:
getVertices
in classMeshCollection
-