org.jmol.shapesurface
Class IsosurfaceMesh

java.lang.Object
  extended by org.jmol.util.MeshSurface
      extended by org.jmol.shape.Mesh
          extended by org.jmol.shapesurface.IsosurfaceMesh

public class IsosurfaceMesh
extends Mesh


Field Summary
private  java.util.Map<java.lang.Integer,java.lang.Integer> assocGridPointMap
           
private  java.util.Map<java.lang.Integer,javax.vecmath.Vector3f> assocGridPointNormals
           
(package private)  java.util.BitSet bsVdw
           
(package private)  java.lang.Object calculatedArea
           
(package private)  java.lang.Object calculatedVolume
           
(package private)  javax.vecmath.Point3f[] centers
           
(package private)  ColorEncoder colorEncoder
           
(package private)  short[] contourColixes
           
(package private)  float[] contourValues
           
(package private)  int dataType
           
(package private)  int firstRealVertex
           
(package private)  boolean hasGridPoints
           
(package private)  java.lang.Object info
           
(package private)  JvxlData jvxlData
           
private  int mergeAssociatedNormalCount
           
(package private)  int thisSet
           
(package private)  int vertexIncrement
           
(package private)  float volumeRenderPointSize
           
 
Fields inherited from class org.jmol.shape.Mesh
atomIndex, cappingObject, checkByteCount, color, colorCommand, colorDensity, connections, diameter, drawTriangles, fillTriangles, frontOnly, havePlanarContours, haveXyPoints, index, insideOut, isPolygonSet, isTwoSided, isValid, lattice, lighting, lineData, linkedMesh, meshColix, modelIndex, normixes, PREVIOUS_MESH_ID, ptCenter, q, recalcAltVertices, scale, scriptCommand, showContourLines, showPoints, showTriangles, slabbingObject, thisID, title, vAB, vAC, vertexColorMap, visibilityFlags, visible, vTemp, width, xmlProperties
 
Fields inherited from class org.jmol.util.MeshSurface
altVertices, bsDisplay, bsPolygons, bsSlabDisplay, bsSlabGhost, colix, haveQuads, iA, iB, iC, isColorSolid, isMerged, mergePolygonCount0, mergeVertexCount0, meshType, normalCount, normals, nSets, offset, polygonColixes, polygonCount, polygonCount0, polygonIndexes, ptOffset, scale3d, SEED_COUNT, slabColix, slabMeshType, slabOptions, surfaceSet, vertexColixes, vertexCount, vertexCount0, vertexSets, vertexSource, vertexValues, vertices
 
Constructor Summary
IsosurfaceMesh(java.lang.String thisID, Graphics3D g3d, short colix, int index)
           
 
Method Summary
private static void addColorToMap(java.util.Map<java.lang.String,java.util.BitSet> colorMap, java.lang.String color, java.util.BitSet bs)
          adds a set of specifically-colored vertices to the map, ensuring that no vertex is in two maps.
static void addContourPoints(java.util.List<java.lang.Object> v, java.util.BitSet bsContour, int i, java.lang.StringBuffer fData, javax.vecmath.Point3f[] vertices, float[] vertexValues, int iA, int iB, int iC, float value)
           
(package private)  int addVertexCopy(javax.vecmath.Point3f vertex, float value, int assocVertex, boolean associateNormals)
           
(package private)  void allocVertexColixes()
           
private static float checkPt(float[] vertexValues, int i, int j, float v)
          two values -- v1, and v2, which need not be ordered v1 < v2.
(package private)  void clear(java.lang.String meshType, boolean iAddGridPoints)
           
(package private)  void colorAtoms(short colix, java.util.BitSet bs)
          color a specific set of vertices based on a set of atoms
(package private)  void colorVertices(short colix, java.util.BitSet bs)
          color a specific set of vertices
private  void colorVertices(short colix, java.util.BitSet bs, boolean isAtoms)
          color a specific set of vertices a specific color
(package private)  void deleteContours()
           
private  void get3dContour(java.util.List<java.lang.Object> v, float value, short colix)
           
 javax.vecmath.Point3f[] getBoundingBox()
           
(package private)  javax.vecmath.Point3f[] getCenters()
           
(package private)  java.util.Map<java.lang.String,java.lang.Object> getContourList(Viewer viewer)
           
private static javax.vecmath.Point3f getContourPoint(javax.vecmath.Point3f[] vertices, int i, int j, float f)
           
(package private)  java.util.List<java.lang.Object>[] getContours()
          create a set of contour data.
(package private)  javax.vecmath.Point4f getFacePlane(int i, javax.vecmath.Vector3f vNorm)
           
protected  void merge(MeshData m)
           
private static int mergePolygons(MeshSurface m, int ipt, int vertexCount, int[][] newPolygons)
           
 void reinitializeLightingAndColor()
           
(package private)  void remapColors(ColorEncoder ce, float translucentLevel)
          remaps colors based on a new color scheme or translucency level
(package private)  void setColorCommand()
          just sets the color command for this isosurface.
(package private)  void setColorsFromJvxlData(int colorRgb)
          from Isosurface.notifySurfaceGenerationCompleted() starting with Jmol 12.1.50, JVXL files contain color, translucency, color scheme information, and vertex color mappings (as from COLOR ISOSURFACE {hydrophobic} WHITE), returning these settings when the JVXL file is opened.
static void setContourVector(java.util.List<java.lang.Object> v, int nPolygons, java.util.BitSet bsContour, float value, short colix, int color, java.lang.StringBuffer fData)
           
 void setDiscreteColixes(float[] values, short[] colixes)
           
(package private)  void setJvxlColorMap(boolean isAll)
          set up the jvxlData fields needed for either just the header (isAll = false) or the full file (isAll = true)
 void setMerged(boolean TF)
           
 void setTranslucent(boolean isTranslucent, float iLevel)
           
protected  void sumVertexNormals(javax.vecmath.Point3f[] vertices, javax.vecmath.Vector3f[] vectorSums)
           
 
Methods inherited from class org.jmol.shape.Mesh
checkWithin, clear, getNormals, getOffsetVertices, getRendering, getState, getVertexIndexFromNumber, initialize, setLighting, setShowWithin, setTokenProperty, setVisibilityFlags, updateCoordinates
 
Methods inherited from class org.jmol.util.MeshSurface
addQuad, addTriangle, addTriangleCheck, addVertexCopy, addVertexCopy, getCapSlabObject, getFaces, getIntersection, getSlabColor, getSlabObject, getSlabTranslucency, getSlabType, getSlabWithinRange, getSphericalInterpolationFraction, getVertices, invalidatePolygons, resetSlab, setABC, setColix, setPolygonCount, setSlab, slabPolygons, slabPolygons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jvxlData

JvxlData jvxlData

vertexIncrement

int vertexIncrement

firstRealVertex

int firstRealVertex

dataType

int dataType

hasGridPoints

boolean hasGridPoints

calculatedArea

java.lang.Object calculatedArea

calculatedVolume

java.lang.Object calculatedVolume

info

java.lang.Object info

assocGridPointMap

private java.util.Map<java.lang.Integer,java.lang.Integer> assocGridPointMap

assocGridPointNormals

private java.util.Map<java.lang.Integer,javax.vecmath.Vector3f> assocGridPointNormals

thisSet

int thisSet

mergeAssociatedNormalCount

private int mergeAssociatedNormalCount

centers

javax.vecmath.Point3f[] centers

contourValues

float[] contourValues

contourColixes

short[] contourColixes

colorEncoder

ColorEncoder colorEncoder

volumeRenderPointSize

float volumeRenderPointSize

bsVdw

java.util.BitSet bsVdw
Constructor Detail

IsosurfaceMesh

IsosurfaceMesh(java.lang.String thisID,
               Graphics3D g3d,
               short colix,
               int index)
Method Detail

clear

void clear(java.lang.String meshType,
           boolean iAddGridPoints)

allocVertexColixes

void allocVertexColixes()

addVertexCopy

int addVertexCopy(javax.vecmath.Point3f vertex,
                  float value,
                  int assocVertex,
                  boolean associateNormals)

setTranslucent

public void setTranslucent(boolean isTranslucent,
                           float iLevel)
Overrides:
setTranslucent in class Mesh

setMerged

public void setMerged(boolean TF)

sumVertexNormals

protected void sumVertexNormals(javax.vecmath.Point3f[] vertices,
                                javax.vecmath.Vector3f[] vectorSums)
Overrides:
sumVertexNormals in class Mesh

getCenters

javax.vecmath.Point3f[] getCenters()

getFacePlane

javax.vecmath.Point4f getFacePlane(int i,
                                   javax.vecmath.Vector3f vNorm)

getContours

java.util.List<java.lang.Object>[] getContours()
create a set of contour data. Each contour is a Vector containing: 0 Integer number of polygons (length of BitSet) 1 BitSet of critical triangles 2 Float value 3 int[] [colorArgb] 4 StringBuffer containing encoded data for each segment: char type ('3', '6', '5') indicating which two edges of the triangle are connected: '3' 0x011 AB-BC '5' 0x101 AB-CA '6' 0x110 BC-CA char fraction along first edge (jvxlFractionToCharacter) char fraction along second edge (jvxlFractionToCharacter) 5- stream of pairs of points for rendering

Returns:
contour vector set

get3dContour

private void get3dContour(java.util.List<java.lang.Object> v,
                          float value,
                          short colix)

setContourVector

public static void setContourVector(java.util.List<java.lang.Object> v,
                                    int nPolygons,
                                    java.util.BitSet bsContour,
                                    float value,
                                    short colix,
                                    int color,
                                    java.lang.StringBuffer fData)

addContourPoints

public static void addContourPoints(java.util.List<java.lang.Object> v,
                                    java.util.BitSet bsContour,
                                    int i,
                                    java.lang.StringBuffer fData,
                                    javax.vecmath.Point3f[] vertices,
                                    float[] vertexValues,
                                    int iA,
                                    int iB,
                                    int iC,
                                    float value)

checkPt

private static float checkPt(float[] vertexValues,
                             int i,
                             int j,
                             float v)
two values -- v1, and v2, which need not be ordered v1 < v2. v == v1 --> 0 v == v2 --> 1 v1 < v < v2 --> f in (0,1) v2 < v < v1 --> f in (0,1) i.e. (v1 < v) == (v < v2) We check AB, then (usually) BC, then (sometimes) CA. What if two end points are identical values? So, for example, if v = 1.0 and: A 1.0 0.5 1.0 1.0 / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ C-----B 1.0--0.5 1.0--1.0 0.5--1.0 1.0---1.0 case I case II case III case IV case I: AB[0] and BC[1], type == 3 --> CA not tested. case II: AB[1] and CA[0]; f1 == 1.0 --> BC not tested. case III: AB[0] and BC[0], type == 3 --> CA not tested. case IV: AB[0] and BC[0], type == 3 --> CA not tested. what if v = 0.5? case I: AB[1]; BC not tested --> type == 1, invalid. case II: AB[0]; type == 1, f1 == 0.0 --> CA not tested. case III: BC[1]; f2 == 1.0 --> CA not tested.

Parameters:
vertexValues -
i -
j -
v -
Returns:
fraction along the edge or NaN

getContourPoint

private static javax.vecmath.Point3f getContourPoint(javax.vecmath.Point3f[] vertices,
                                                     int i,
                                                     int j,
                                                     float f)

setDiscreteColixes

public void setDiscreteColixes(float[] values,
                               short[] colixes)

getContourList

java.util.Map<java.lang.String,java.lang.Object> getContourList(Viewer viewer)
Parameters:
viewer -
Returns:
a Hashtable containing "values" and "colors"

deleteContours

void deleteContours()

colorAtoms

void colorAtoms(short colix,
                java.util.BitSet bs)
color a specific set of vertices based on a set of atoms

Parameters:
colix -
bs -

colorVertices

void colorVertices(short colix,
                   java.util.BitSet bs)
color a specific set of vertices

Parameters:
colix -
bs -

colorVertices

private void colorVertices(short colix,
                           java.util.BitSet bs,
                           boolean isAtoms)
color a specific set of vertices a specific color

Parameters:
colix -
bs -
isAtoms -

addColorToMap

private static void addColorToMap(java.util.Map<java.lang.String,java.util.BitSet> colorMap,
                                  java.lang.String color,
                                  java.util.BitSet bs)
adds a set of specifically-colored vertices to the map, ensuring that no vertex is in two maps.

Parameters:
colorMap -
color -
bs -

setJvxlColorMap

void setJvxlColorMap(boolean isAll)
set up the jvxlData fields needed for either just the header (isAll = false) or the full file (isAll = true)

Parameters:
isAll -

setColorCommand

void setColorCommand()
just sets the color command for this isosurface.


setColorsFromJvxlData

void setColorsFromJvxlData(int colorRgb)
from Isosurface.notifySurfaceGenerationCompleted() starting with Jmol 12.1.50, JVXL files contain color, translucency, color scheme information, and vertex color mappings (as from COLOR ISOSURFACE {hydrophobic} WHITE), returning these settings when the JVXL file is opened.

Parameters:
colorRgb -

remapColors

void remapColors(ColorEncoder ce,
                 float translucentLevel)
remaps colors based on a new color scheme or translucency level

Parameters:
ce -
translucentLevel -

reinitializeLightingAndColor

public void reinitializeLightingAndColor()

getBoundingBox

public javax.vecmath.Point3f[] getBoundingBox()
Overrides:
getBoundingBox in class Mesh

merge

protected void merge(MeshData m)

mergePolygons

private static int mergePolygons(MeshSurface m,
                                 int ipt,
                                 int vertexCount,
                                 int[][] newPolygons)