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:
- LcaoCartoon, MolecularOrbital, Pmesh
public class Isosurface
- extends MeshCollection
- implements MeshDataServer
Fields inherited from class org.jmol.shape.MeshCollection |
allowContourLines, allowMesh, colix, currentMesh, explicitID, haveContours, htObjects, iHaveModelIndex, isFixed, linkedMesh, meshCount, meshes, modelCount, modelIndex, myType, nUnnamed, previousMeshID, script, title |
Method Summary |
void |
addTriangleCheck(int iA,
int iB,
int iC,
int check,
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(javax.vecmath.Point3f vertexXYZ,
float value,
int assocVertex)
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(java.lang.String thisID)
|
javax.vecmath.Point3f[] |
calculateGeodesicSurface(java.util.BitSet bsSelected,
float envelopeRadius)
|
Point3fi |
checkObjectClicked(int x,
int y,
int modifiers,
java.util.BitSet bsVisible)
|
boolean |
checkObjectHovered(int x,
int y,
java.util.BitSet bsVisible)
|
protected void |
clearSg()
|
private void |
createLcaoLobe(javax.vecmath.Vector3f lobeAxis,
float factor,
int nElectrons)
|
private void |
discardTempData(boolean discardAll)
|
private void |
drawLcaoCartoon(javax.vecmath.Vector3f z,
javax.vecmath.Vector3f x,
javax.vecmath.Vector3f rotAxis,
int nElectrons)
|
void |
fillMeshData(MeshData meshData,
int mode)
|
private java.lang.String |
findValue(int x,
int y,
boolean isPicking,
java.util.BitSet bsVisible)
|
private boolean |
getClosestNormal(IsosurfaceMesh m,
javax.vecmath.Point3f toPt,
javax.vecmath.Point3f ptRet,
javax.vecmath.Vector3f normalRet)
|
private void |
getClosestPoint(IsosurfaceMesh m,
int imin,
javax.vecmath.Point3f toPt,
javax.vecmath.Point3f ptRet,
javax.vecmath.Vector3f normalRet)
|
int |
getColixArgb(short colix)
|
protected void |
getColorState(java.lang.StringBuffer sb,
Mesh mesh)
|
private short |
getDefaultColix()
|
java.lang.Object |
getProperty(java.lang.String property,
int index)
|
private boolean |
getScriptBitSets(java.lang.String script,
java.util.BitSet[] bsCmd)
|
java.util.Vector |
getShapeDetail()
|
int |
getSurfacePointIndexAndFraction(float cutoff,
boolean isCutoffAbsolute,
int x,
int y,
int z,
javax.vecmath.Point3i offset,
int vA,
int vB,
float valueA,
float valueB,
javax.vecmath.Point3f pointA,
javax.vecmath.Vector3f 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. |
private java.lang.String |
getUserColorScheme(java.lang.String schemeName)
|
float |
getValue(int x,
int y,
int z)
for readers only |
private void |
initializeIsosurface()
|
void |
initShape()
|
private void |
initState()
|
void |
invalidateTriangles()
|
private void |
navigate(int dz)
|
private void |
newSg()
|
void |
notifySurfaceGenerationCompleted()
|
void |
notifySurfaceMappingCompleted()
|
protected void |
remapColors()
|
private void |
setHeading(javax.vecmath.Point3f pt,
javax.vecmath.Vector3f vNorm,
int nSeconds)
|
private void |
setJvxlInfo()
|
private void |
setModelIndex()
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bs)
|
private void |
setPropertySuper(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bs)
|
protected void |
setScriptInfo()
|
Methods inherited from class org.jmol.shape.Shape |
appendCmd, checkBoundsMinMax, checkObjectDragged, coordinateInRange, findNearestAtomIndex, getColix, getColorCommand, getColorCommand, getFontCommand, getProperty, getShapeCommands, getShapeCommands, getViewer, initializeShape, initModelSet, setColix, setColix, setColix, setModelClickability, setModelSet, setSize, setSize, setStateInfo, setStateInfo, wasClicked |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
isomeshes
private IsosurfaceMesh[] isomeshes
thisMesh
private IsosurfaceMesh thisMesh
lighting
private int lighting
iHaveBitSets
private boolean iHaveBitSets
explicitContours
private boolean explicitContours
atomIndex
private int atomIndex
moNumber
private int moNumber
defaultColix
private short defaultColix
center
private javax.vecmath.Point3f center
isPhaseColored
private boolean isPhaseColored
isColorExplicit
private boolean isColorExplicit
sg
protected SurfaceGenerator sg
jvxlData
private JvxlData jvxlData
colorEncoder
private ColorEncoder colorEncoder
indexColorPositive
private int indexColorPositive
indexColorNegative
private int indexColorNegative
nLCAO
private int nLCAO
lcaoDir
private javax.vecmath.Point4f lcaoDir
associateNormals
private boolean associateNormals
MAX_OBJECT_CLICK_DISTANCE_SQUARED
private static final int MAX_OBJECT_CLICK_DISTANCE_SQUARED
- See Also:
- Constant Field Values
ptXY
private final javax.vecmath.Point3i ptXY
Isosurface
public Isosurface()
allocMesh
public void allocMesh(java.lang.String thisID)
- Overrides:
allocMesh
in class MeshCollection
initShape
public void initShape()
- Overrides:
initShape
in class MeshCollection
newSg
private void newSg()
clearSg
protected void clearSg()
setProperty
public void setProperty(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bs)
- Overrides:
setProperty
in class MeshCollection
setPropertySuper
private void setPropertySuper(java.lang.String propertyName,
java.lang.Object value,
java.util.BitSet bs)
getProperty
public java.lang.Object getProperty(java.lang.String property,
int index)
- Overrides:
getProperty
in class MeshCollection
getColorState
protected void getColorState(java.lang.StringBuffer sb,
Mesh mesh)
- Overrides:
getColorState
in class MeshCollection
getScriptBitSets
private boolean getScriptBitSets(java.lang.String script,
java.util.BitSet[] bsCmd)
initializeIsosurface
private void initializeIsosurface()
initState
private void initState()
discardTempData
private void discardTempData(boolean discardAll)
getDefaultColix
private short getDefaultColix()
drawLcaoCartoon
private void drawLcaoCartoon(javax.vecmath.Vector3f z,
javax.vecmath.Vector3f x,
javax.vecmath.Vector3f rotAxis,
int nElectrons)
createLcaoLobe
private void createLcaoLobe(javax.vecmath.Vector3f lobeAxis,
float factor,
int nElectrons)
invalidateTriangles
public void invalidateTriangles()
- Specified by:
invalidateTriangles
in interface MeshDataServer
fillMeshData
public void fillMeshData(MeshData meshData,
int mode)
- Specified by:
fillMeshData
in interface MeshDataServer
notifySurfaceGenerationCompleted
public void notifySurfaceGenerationCompleted()
- Specified by:
notifySurfaceGenerationCompleted
in interface MeshDataServer
notifySurfaceMappingCompleted
public void notifySurfaceMappingCompleted()
- Specified by:
notifySurfaceMappingCompleted
in interface MeshDataServer
calculateGeodesicSurface
public javax.vecmath.Point3f[] calculateGeodesicSurface(java.util.BitSet bsSelected,
float envelopeRadius)
- Specified by:
calculateGeodesicSurface
in interface MeshDataServer
getSurfacePointIndexAndFraction
public int getSurfacePointIndexAndFraction(float cutoff,
boolean isCutoffAbsolute,
int x,
int y,
int z,
javax.vecmath.Point3i offset,
int vA,
int vB,
float valueA,
float valueB,
javax.vecmath.Point3f pointA,
javax.vecmath.Vector3f 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 interface VertexDataServer
vA
- [0:7]vB
- [0:7]edgeVector
- vector from A to B
- Returns:
- new vertex index or Integer.MAX_VALUE
addVertexCopy
public int addVertexCopy(javax.vecmath.Point3f vertexXYZ,
float value,
int assocVertex)
- 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
assocVertex
- unique association vertex or -1
- Returns:
- new vertex index
addTriangleCheck
public void addTriangleCheck(int iA,
int iB,
int iC,
int check,
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
setModelIndex
private void setModelIndex()
setScriptInfo
protected void setScriptInfo()
setJvxlInfo
private void setJvxlInfo()
getShapeDetail
public java.util.Vector getShapeDetail()
- Overrides:
getShapeDetail
in class Shape
remapColors
protected void remapColors()
- Overrides:
remapColors
in class Shape
getUserColorScheme
private java.lang.String getUserColorScheme(java.lang.String schemeName)
getValue
public float getValue(int x,
int y,
int z)
- Description copied from interface:
VertexDataServer
- for readers only
- Specified by:
getValue
in interface VertexDataServer
- Returns:
- value[x][y][z]
checkObjectHovered
public boolean checkObjectHovered(int x,
int y,
java.util.BitSet bsVisible)
- Overrides:
checkObjectHovered
in class Shape
checkObjectClicked
public Point3fi checkObjectClicked(int x,
int y,
int modifiers,
java.util.BitSet bsVisible)
- Overrides:
checkObjectClicked
in class Shape
navigate
private void navigate(int dz)
setHeading
private void setHeading(javax.vecmath.Point3f pt,
javax.vecmath.Vector3f vNorm,
int nSeconds)
getClosestNormal
private boolean getClosestNormal(IsosurfaceMesh m,
javax.vecmath.Point3f toPt,
javax.vecmath.Point3f ptRet,
javax.vecmath.Vector3f normalRet)
getClosestPoint
private void getClosestPoint(IsosurfaceMesh m,
int imin,
javax.vecmath.Point3f toPt,
javax.vecmath.Point3f ptRet,
javax.vecmath.Vector3f normalRet)
findValue
private java.lang.String findValue(int x,
int y,
boolean isPicking,
java.util.BitSet bsVisible)
getColixArgb
public int getColixArgb(short colix)
- Specified by:
getColixArgb
in interface MeshDataServer