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
(package private)  Hashtable assocGridPointMap
           
(package private)  Hashtable assocGridPointNormals
           
(package private)  Object calculatedArea
           
(package private)  Object calculatedVolume
           
(package private)  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
           
 boolean isSolvent
           
(package private)  JvxlData jvxlData
           
(package private)  int thisSet
           
(package private)  int vertexIncrement
           
 
Fields inherited from class org.jmol.shape.Mesh
atomIndex, bitsets, cappingObject, checkByteCount, colorCommand, colorDensity, diameter, drawTriangles, fillTriangles, frontOnly, havePlanarContours, haveXyPoints, index, insideOut, isPolygonSet, isTwoSided, isValid, lattice, lighting, lineData, linkedMesh, meshColix, meshType, modelIndex, normixes, PREVIOUS_MESH_ID, ptCenter, scale, scriptCommand, showContourLines, showPoints, showTriangles, slabbingObject, thisID, title, vAB, vAC, visibilityFlags, visible, vTemp, width, xmlProperties
 
Fields inherited from class org.jmol.util.MeshSurface
bsFaces, colix, haveQuads, iA, iB, iC, isColorSolid, nSets, offsetVertices, polygonColixes, polygonCount, polygonIndexes, ptOffset, scale3d, SEED_COUNT, surfaceSet, vertexColixes, vertexCount, vertexNormals, vertexSets, vertexValues, vertices
 
Constructor Summary
IsosurfaceMesh(String thisID, Graphics3D g3d, short colix, int index)
           
 
Method Summary
static void addContourPoints(List v, BitSet bsContour, int i, StringBuffer fData, Point3f[] vertices, float[] vertexValues, int iA, int iB, int iC, float value)
           
(package private)  int addVertexCopy(Point3f vertex, float value, int assocVertex, boolean associateNormals)
           
(package private)  void allocVertexColixes()
           
(package private)  Object calculateArea()
           
(package private)  Object calculateVolume()
           
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(String meshType, boolean iAddGridPoints)
           
private  void get3dContour(List v, float value, short colix)
           
(package private)  Point3f[] getCenters()
           
(package private)  Hashtable getContourList(Viewer viewer)
           
private static Point3f getContourPoint(Point3f[] vertices, int i, int j, float f)
           
(package private)  List[] getContours()
          create a set of contour data.
(package private)  Point4f getFacePlane(int i, Vector3f vNorm)
           
static void setContourVector(List v, int nPolygons, BitSet bsContour, float value, short colix, int color, StringBuffer fData)
           
 void setDiscreteColixes(float[] values, short[] colixes)
           
 void setTranslucent(boolean isTranslucent, float iLevel)
           
protected  void sumVertexNormals(Point3f[] vertices, Vector3f[] vectorSums)
           
 
Methods inherited from class org.jmol.shape.Mesh
clear, getNormals, getOffsetVertices, getState, getVertexIndexFromNumber, initialize, setLighting, setVisibilityFlags
 
Methods inherited from class org.jmol.util.MeshSurface
addPolygon, addQuad, addTriangle, addTriangleCheck, addVertexCopy, addVertexCopy, getIntersection, invalidatePolygons, setABC, setColix, setPolygonCount, 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

Object calculatedArea

calculatedVolume

Object calculatedVolume

isSolvent

public boolean isSolvent

assocGridPointMap

Hashtable assocGridPointMap

assocGridPointNormals

Hashtable assocGridPointNormals

thisSet

int thisSet

centers

Point3f[] centers

contourValues

float[] contourValues

contourColixes

short[] contourColixes

colorEncoder

ColorEncoder colorEncoder
Constructor Detail

IsosurfaceMesh

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

clear

void clear(String meshType,
           boolean iAddGridPoints)

allocVertexColixes

void allocVertexColixes()

addVertexCopy

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

setTranslucent

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

calculateArea

Object calculateArea()

calculateVolume

Object calculateVolume()

sumVertexNormals

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

getCenters

Point3f[] getCenters()

getFacePlane

Point4f getFacePlane(int i,
                     Vector3f vNorm)

getContours

List[] getContours()
create a set of contour data. Each contour is a List 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(List v,
                          float value,
                          short colix)

setContourVector

public static void setContourVector(List v,
                                    int nPolygons,
                                    BitSet bsContour,
                                    float value,
                                    short colix,
                                    int color,
                                    StringBuffer fData)

addContourPoints

public static void addContourPoints(List v,
                                    BitSet bsContour,
                                    int i,
                                    StringBuffer fData,
                                    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 Point3f getContourPoint(Point3f[] vertices,
                                       int i,
                                       int j,
                                       float f)

setDiscreteColixes

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

getContourList

Hashtable getContourList(Viewer viewer)
Parameters:
viewer -
Returns:
a Hashtable containing "values" and "colors"