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 TypeFieldDescriptionprivate String(package private) booleanprivate booleanprivate intprivate javajs.util.P3private intprivate float[]private shortprivate booleanprotected booleanprivate booleanprivate booleanprotected IsosurfaceMesh[]private booleanprivate booleanint[]private javajs.util.P4private static final intprivate shortprivate float[]private intprivate Stringprivate intprivate Stringprivate final javajs.util.P3iprivate floatprivate Stringprivate Stringprotected SurfaceGeneratorprotected IsosurfaceMeshprivate floatprivate javajs.util.Lst<javajs.util.P3>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, titleFields 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 voidaddMeshInfo(IsosurfaceMesh mesh, Map<String, Object> info) voidaddRequiredFile(String fileName) intaddTriangleCheck(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)intaddVertexCopy(javajs.util.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.voidjavajs.util.P3[]calculateGeodesicSurface(javajs.util.BS bsSelected, float envelopeRadius) private ObjectcalculateVolumeOrArea(IsosurfaceMesh mesh, boolean isArea) checkObjectClicked(int x, int y, int action, javajs.util.BS bsVisible, boolean drawPicking) booleancheckObjectHovered(int x, int y, javajs.util.BS bsVisible) protected voidclearSg()private voidcreateLcaoLobe(javajs.util.V3 lobeAxis, float factor, int nElectrons) protected voiddiscardTempData(boolean discardAll) private voiddrawLcaoCartoon(javajs.util.V3 z, javajs.util.V3 x, javajs.util.V3 rotAxis, int nElectrons, boolean reverseColor) private voidvoidfillMeshData(MeshData meshData, int mode, IsosurfaceMesh mesh) private StringfindValue(int x, int y, boolean isPicking, javajs.util.BS bsVisible) protected voidgetCapSlabInfo(String script) private Object[]getCapSlabObject(String s, boolean isCap) legacy -- for some scripts with early isosurface slabbinggetCmd(int index) private float[]getDataRange(IsosurfaceMesh mesh) private shortprivate ObjectgetFileReader(String fileName) private voidgetMeshCommand(javajs.util.SB sb, int i) float[]getPlane(int x) static StringgetPolygonColorData(int ccount, short[] colixes, int[][] polygons, javajs.util.BS bsSlabDisplay) getProperty(String property, int index) booleangetPropertyData(String property, Object[] data) protected Objectprivate booleangetScriptBitSets(String script, javajs.util.BS[] bsCmd) intgetSurfacePointIndexAndFraction(float cutoff, boolean isCutoffAbsolute, int x, int y, int z, javajs.util.P3i offset, int vA, int vB, float valueA, float valueB, javajs.util.T3 pointA, javajs.util.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.floatgetValue(int x, int y, int z, int ptyz) for readers onlyprotected Objectprotected ObjectgetVertices(Mesh mesh) private voidhoverKey(int x, int y) private voidvoidprivate voidvoidprivate booleanisPickable(IsosurfaceMesh m, javajs.util.BS bsVisible) protected voidnewSg()booleanvoidprivate voidsetBsVdw()private voidsetColorPhase(IsosurfaceMesh m, short colix0, short colix1) private voidsetIsoMeshColor(IsosurfaceMesh m, String color) private voidprivate voidsetMeshI()voidsetOutputChannel(javajs.api.GenericBinaryDocument binaryDoc, javajs.util.OC out) voidsetProperty(String propertyName, Object value, javajs.util.BS bs) private voidsetPropertySuper(String propertyName, Object value, javajs.util.BS bs) protected voidvoidsetRequiredFile(String oldName, String fileName) protected voidsetScriptInfo(String strCommand) protected voidslabPolygons(Object[] slabInfo) Methods inherited from class org.jmol.shape.MeshCollection
checkExplicit, clean, deleteMeshI, deleteMeshKey, getIndexFromName, getMesh, getMeshList, getPickedPoint, getPropDataMC, getPropMC, merge, resetObjects, setModelVisibilityFlags, setPropMC, setStatusPicked, setTitle, setTokenPropertyMethods 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, setPropS, setShapeSizeRD, setSize, setSizeRD, wasClicked
-
Field Details
-
isomeshes
-
thisMesh
-
actualID
-
iHaveBitSets
protected boolean iHaveBitSets -
explicitContours
private boolean explicitContours -
atomIndex
private int atomIndex -
moNumber
private int moNumber -
moLinearCombination
private float[] moLinearCombination -
colorType
private int colorType -
defaultColix
private short defaultColix -
meshColix
private short meshColix -
center
private javajs.util.P3 center -
scale3d
private float scale3d -
isPhaseColored
private boolean isPhaseColored -
isColorExplicit
private boolean isColorExplicit -
scriptAppendix
-
sg
-
withinDistance2
private float withinDistance2 -
isWithinNot
private boolean isWithinNot -
withinPoints
private javajs.util.Lst<javajs.util.P3> withinPoints -
cutoffRange
private float[] cutoffRange -
allowMesh
boolean allowMesh -
script
-
iHaveModelIndex
private boolean iHaveModelIndex -
nLCAO
private int nLCAO -
lcaoDir
private javajs.util.P4 lcaoDir -
associateNormals
private boolean associateNormals -
oldFileName
-
newFileName
-
MAX_OBJECT_CLICK_DISTANCE_SQUARED
private static final int MAX_OBJECT_CLICK_DISTANCE_SQUARED- See Also:
-
ptXY
private final javajs.util.P3i ptXY -
keyXy
public int[] keyXy
-
-
Constructor Details
-
Isosurface
public Isosurface()
-
-
Method Details
-
allocMesh
- Overrides:
allocMeshin classMeshCollection
-
initShape
public void initShape()- Overrides:
initShapein classMeshCollection
-
newSg
protected void newSg() -
clearSg
protected void clearSg() -
setProperty
- Specified by:
setPropertyin classShape
-
setPropI
-
getFileReader
-
setIsoMeshColor
-
setColorPhase
-
ensureMeshSource
private void ensureMeshSource() -
slabPolygons
-
setPropertySuper
-
getPropertyData
- Overrides:
getPropertyDatain classShape- Returns:
- true if serviced
-
getProperty
- Overrides:
getPropertyin classShape- Returns:
- true if serviced
-
getPropI
-
getDataRange
-
calculateVolumeOrArea
-
getPolygonColorData
public static String getPolygonColorData(int ccount, short[] colixes, int[][] polygons, javajs.util.BS bsSlabDisplay) -
getShapeState
- Specified by:
getShapeStatein classShape
-
getMeshCommand
private void getMeshCommand(javajs.util.SB sb, int i) -
getScriptBitSets
-
getCapSlabInfo
-
getCapSlabObject
legacy -- for some scripts with early isosurface slabbing- Parameters:
s-isCap-- Returns:
- slabInfo object
-
initializeIsosurface
private void initializeIsosurface() -
initState
private void initState() -
setMeshI
private void setMeshI() -
discardTempData
protected void discardTempData(boolean discardAll) -
getDefaultColix
private short getDefaultColix() -
drawLcaoCartoon
private void drawLcaoCartoon(javajs.util.V3 z, javajs.util.V3 x, javajs.util.V3 rotAxis, int nElectrons, boolean reverseColor) -
createLcaoLobe
private void createLcaoLobe(javajs.util.V3 lobeAxis, float factor, int nElectrons) -
invalidateTriangles
public void invalidateTriangles()- Specified by:
invalidateTrianglesin interfaceMeshDataServer
-
setOutputChannel
public void setOutputChannel(javajs.api.GenericBinaryDocument binaryDoc, javajs.util.OC out) - Specified by:
setOutputChannelin interfaceMeshDataServer
-
fillMeshData
- Specified by:
fillMeshDatain interfaceMeshDataServer
-
notifySurfaceGenerationCompleted
public boolean notifySurfaceGenerationCompleted()- Specified by:
notifySurfaceGenerationCompletedin interfaceMeshDataServer
-
notifySurfaceMappingCompleted
public void notifySurfaceMappingCompleted()- Specified by:
notifySurfaceMappingCompletedin interfaceMeshDataServer
-
setBsVdw
private void setBsVdw() -
calculateGeodesicSurface
public javajs.util.P3[] calculateGeodesicSurface(javajs.util.BS bsSelected, float envelopeRadius) - Specified by:
calculateGeodesicSurfacein interfaceMeshDataServer
-
getSurfacePointIndexAndFraction
public int getSurfacePointIndexAndFraction(float cutoff, boolean isCutoffAbsolute, int x, int y, int z, javajs.util.P3i offset, int vA, int vB, float valueA, float valueB, javajs.util.T3 pointA, javajs.util.V3 edgeVector, boolean isContourType, float[] fReturn) Description copied from interface:VertexDataServergetSurfacePointIndex 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:
getSurfacePointIndexAndFractionin interfaceVertexDataServervA- [0:7]vB- [0:7]edgeVector- vector from A to B- Returns:
- new vertex index or Integer.MAX_VALUE
-
addVertexCopy
public int addVertexCopy(javajs.util.T3 vertexXYZ, float value, int assocVertex, boolean asCopy) Description copied from interface:VertexDataServeraddVertexCopy 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:
addVertexCopyin interfaceVertexDataServerassocVertex- 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:VertexDataServeraddTriangleCheck 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:
addTriangleCheckin interfaceVertexDataServeriContour- TODO- Returns:
- polygon index or -1
-
setScriptInfo
-
addRequiredFile
- Specified by:
addRequiredFilein interfaceMeshDataServer
-
setRequiredFile
- Specified by:
setRequiredFilein interfaceMeshDataServer
-
setJvxlInfo
private void setJvxlInfo() -
getShapeDetail
- Overrides:
getShapeDetailin classShape
-
addMeshInfo
-
getPlane
public float[] getPlane(int x) - Specified by:
getPlanein interfaceVertexDataServer
-
getValue
public float getValue(int x, int y, int z, int ptyz) Description copied from interface:VertexDataServerfor readers only- Specified by:
getValuein interfaceVertexDataServer- Returns:
- value[x][y][z]
-
checkObjectHovered
public boolean checkObjectHovered(int x, int y, javajs.util.BS bsVisible) - Overrides:
checkObjectHoveredin classShape- Returns:
- T/F
-
hoverKey
private void hoverKey(int x, int y) -
checkObjectClicked
public Map<String,Object> checkObjectClicked(int x, int y, int action, javajs.util.BS bsVisible, boolean drawPicking) - Overrides:
checkObjectClickedin classShapedrawPicking- TODO- Returns:
- Hashtable containing information about pt clicked
-
isPickable
-
findValue
- Parameters:
x-y-isPicking- IGNOREDbsVisible-- Returns:
- value found
-
getCmd
-
getValues
- Overrides:
getValuesin classMeshCollection
-
getVertices
- Overrides:
getVerticesin classMeshCollection
-