org.jmol.util
Class MeshSurface

java.lang.Object
  extended by org.jmol.util.MeshSurface
Direct Known Subclasses:
Mesh, MeshData

public class MeshSurface
extends java.lang.Object


Field Summary
 javax.vecmath.Tuple3f[] altVertices
           
 java.util.BitSet bsDisplay
           
 java.util.BitSet bsPolygons
           
 java.util.BitSet bsSlabDisplay
           
 java.util.BitSet bsSlabGhost
           
private  int checkCount
           
 short colix
           
private  boolean doCap
           
private  boolean doClear
           
private  boolean doGhost
           
 boolean haveQuads
           
protected  int iA
           
protected  int iB
           
protected  int iC
           
private  int iD
           
private  int iE
           
 boolean isColorSolid
           
 boolean isMerged
           
private  short lastColix
           
private  int lastColor
           
 int mergePolygonCount0
           
 int mergeVertexCount0
           
 java.lang.String meshType
           
 int normalCount
           
 javax.vecmath.Tuple3f[] normals
           
 int nSets
           
 javax.vecmath.Point3f offset
           
 short[] polygonColixes
           
 int polygonCount
           
 int polygonCount0
           
 int[][] polygonIndexes
           
 javax.vecmath.Point3f ptOffset
           
 float scale3d
           
protected static int SEED_COUNT
           
 short slabColix
           
 int slabMeshType
           
 java.lang.StringBuffer slabOptions
           
 java.util.BitSet[] surfaceSet
           
 short[] vertexColixes
           
 int vertexCount
           
 int vertexCount0
           
 int[] vertexSets
           
 int[] vertexSource
           
 float[] vertexValues
           
 javax.vecmath.Point3f[] vertices
           
 
Constructor Summary
MeshSurface()
           
MeshSurface(int[][] polygonIndexes, javax.vecmath.Tuple3f[] vertices, int nVertices, javax.vecmath.Tuple3f[] normals, int nNormals)
           
MeshSurface(javax.vecmath.Point3f[] vertices, float[] vertexValues, int vertexCount, int[][] polygonIndexes, int polygonCount, int checkCount)
           
 
Method Summary
private  int addIntersectionVertex(javax.vecmath.Point3f vertex, float value, int source, java.util.Map<java.lang.String,java.lang.Integer> mapEdge, int i1, int i2)
           
private  int addPolygon(int[] polygon, java.util.BitSet bs)
           
private  int addPolygon(int[] polygon, int color, java.util.BitSet bs)
           
private  int addPolygon(int vertexA, int vertexB, int vertexC, int check, int check2, int color, java.util.BitSet bs)
           
 void addQuad(int vertexA, int vertexB, int vertexC, int vertexD)
           
 void addTriangle(int vertexA, int vertexB, int vertexC)
           
 int addTriangleCheck(int vertexA, int vertexB, int vertexC, int check, int check2, int color)
           
 int addVertexCopy(javax.vecmath.Point3f vertex)
           
 int addVertexCopy(javax.vecmath.Point3f vertex, float value)
           
private static float checkSlab(int tokType, javax.vecmath.Point3f v, float val, float distance, javax.vecmath.Point4f plane, javax.vecmath.Point3f[] ptCenters)
           
static java.lang.Object[] getCapSlabObject(java.lang.String s, boolean isCap)
          legacy -- for some scripts with early isosurface slabbing
private  boolean getDE(float[] fracs, int fD, int i1, int i2, int i3, boolean toss23)
           
 int[][] getFaces()
           
 void getIntersection(float distance, javax.vecmath.Point4f plane, javax.vecmath.Point3f[] ptCenters, java.util.List<javax.vecmath.Point3f[]> vData, float[] fData, MeshSurface meshSurface, boolean andCap, boolean doClean, int tokType, boolean isGhost)
           
 java.lang.String getSlabColor()
           
static java.lang.Object[] getSlabObject(int tok, java.lang.Object data, boolean isCap, java.lang.Object colorData)
           
 java.lang.String getSlabTranslucency()
           
 java.lang.String getSlabType()
           
static java.lang.Object[] getSlabWithinRange(float min, float max)
           
static float getSphericalInterpolationFraction(double r, double valueA, double valueB, double d)
           
 javax.vecmath.Tuple3f[] getVertices()
           
private static javax.vecmath.Point3f interpolateFraction(javax.vecmath.Point3f v1, javax.vecmath.Point3f v2, float f, float val1, float val2, float[] values, float[] fracs, int i)
           
private static javax.vecmath.Point3f interpolatePoint(javax.vecmath.Point3f v1, javax.vecmath.Point3f v2, float d1, float d2, float val1, float val2, float[] values, float[] fracs, int i)
           
private  javax.vecmath.Point3f interpolateSphere(javax.vecmath.Point3f v1, javax.vecmath.Point3f v2, float d1, float d2, double absD, float val1, float val2, float[] values, float[] fracs, int i)
           
 void invalidatePolygons()
           
private static float minDist(javax.vecmath.Point3f pt, javax.vecmath.Point3f[] ptCenters)
           
 void resetSlab()
           
protected  boolean setABC(int i)
           
 void setColix(short colix)
           
private static int setPoint(float[] fracs, int i, int i0, int i1)
           
private  void setPolygonColix(int index, short colix)
           
 void setPolygonCount(int polygonCount)
           
 void setSlab(java.util.BitSet bsDisplay, java.util.BitSet bsGhost, java.lang.String type, java.lang.String color, float translucency)
           
 void slabPolygons(java.util.List<java.lang.Object[]> slabInfo, boolean allowCap)
           
 boolean slabPolygons(java.lang.Object[] slabObject, boolean allowCap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEED_COUNT

protected static final int SEED_COUNT
See Also:
Constant Field Values

meshType

public java.lang.String meshType

vertexCount

public int vertexCount

vertices

public javax.vecmath.Point3f[] vertices

vertexValues

public float[] vertexValues

vertexSource

public int[] vertexSource

polygonCount

public int polygonCount

polygonIndexes

public int[][] polygonIndexes

haveQuads

public boolean haveQuads

colix

public short colix

isColorSolid

public boolean isColorSolid

offset

public javax.vecmath.Point3f offset

altVertices

public javax.vecmath.Tuple3f[] altVertices

polygonColixes

public short[] polygonColixes

vertexColixes

public short[] vertexColixes

normals

public javax.vecmath.Tuple3f[] normals

normalCount

public int normalCount

bsPolygons

public java.util.BitSet bsPolygons

ptOffset

public javax.vecmath.Point3f ptOffset

scale3d

public float scale3d

surfaceSet

public java.util.BitSet[] surfaceSet

vertexSets

public int[] vertexSets

nSets

public int nSets

checkCount

private int checkCount

lastColor

private int lastColor

lastColix

private short lastColix

iA

protected int iA

iB

protected int iB

iC

protected int iC

polygonCount0

public int polygonCount0

vertexCount0

public int vertexCount0

bsSlabDisplay

public java.util.BitSet bsSlabDisplay

bsSlabGhost

public java.util.BitSet bsSlabGhost

slabMeshType

public int slabMeshType

slabColix

public short slabColix

bsDisplay

public java.util.BitSet bsDisplay

slabOptions

public java.lang.StringBuffer slabOptions

doClear

private boolean doClear

doGhost

private boolean doGhost

doCap

private boolean doCap

iD

private int iD

iE

private int iE

mergeVertexCount0

public int mergeVertexCount0

mergePolygonCount0

public int mergePolygonCount0

isMerged

public boolean isMerged
Constructor Detail

MeshSurface

public MeshSurface()

MeshSurface

public MeshSurface(int[][] polygonIndexes,
                   javax.vecmath.Tuple3f[] vertices,
                   int nVertices,
                   javax.vecmath.Tuple3f[] normals,
                   int nNormals)

MeshSurface

public MeshSurface(javax.vecmath.Point3f[] vertices,
                   float[] vertexValues,
                   int vertexCount,
                   int[][] polygonIndexes,
                   int polygonCount,
                   int checkCount)
Method Detail

getVertices

public javax.vecmath.Tuple3f[] getVertices()
Returns:
The vertices.

getFaces

public int[][] getFaces()
Returns:
faces, if defined (in exporter), otherwise polygonIndexes

setColix

public void setColix(short colix)

addVertexCopy

public int addVertexCopy(javax.vecmath.Point3f vertex)

addTriangle

public void addTriangle(int vertexA,
                        int vertexB,
                        int vertexC)

addQuad

public void addQuad(int vertexA,
                    int vertexB,
                    int vertexC,
                    int vertexD)

setPolygonCount

public void setPolygonCount(int polygonCount)

addVertexCopy

public int addVertexCopy(javax.vecmath.Point3f vertex,
                         float value)

addTriangleCheck

public int addTriangleCheck(int vertexA,
                            int vertexB,
                            int vertexC,
                            int check,
                            int check2,
                            int color)

addPolygon

private int addPolygon(int vertexA,
                       int vertexB,
                       int vertexC,
                       int check,
                       int check2,
                       int color,
                       java.util.BitSet bs)

addPolygon

private int addPolygon(int[] polygon,
                       int color,
                       java.util.BitSet bs)

addPolygon

private int addPolygon(int[] polygon,
                       java.util.BitSet bs)

setPolygonColix

private void setPolygonColix(int index,
                             short colix)

invalidatePolygons

public void invalidatePolygons()

setABC

protected boolean setABC(int i)

setSlab

public void setSlab(java.util.BitSet bsDisplay,
                    java.util.BitSet bsGhost,
                    java.lang.String type,
                    java.lang.String color,
                    float translucency)

getSlabColor

public java.lang.String getSlabColor()

getSlabTranslucency

public java.lang.String getSlabTranslucency()

getSlabType

public java.lang.String getSlabType()

getSlabWithinRange

public static java.lang.Object[] getSlabWithinRange(float min,
                                                    float max)

resetSlab

public void resetSlab()

getSlabObject

public static java.lang.Object[] getSlabObject(int tok,
                                               java.lang.Object data,
                                               boolean isCap,
                                               java.lang.Object colorData)

getCapSlabObject

public static java.lang.Object[] getCapSlabObject(java.lang.String s,
                                                  boolean isCap)
legacy -- for some scripts with early isosurface slabbing

Parameters:
s -
isCap -
Returns:
slabInfo object

slabPolygons

public void slabPolygons(java.util.List<java.lang.Object[]> slabInfo,
                         boolean allowCap)

slabPolygons

public boolean slabPolygons(java.lang.Object[] slabObject,
                            boolean allowCap)

addIntersectionVertex

private int addIntersectionVertex(javax.vecmath.Point3f vertex,
                                  float value,
                                  int source,
                                  java.util.Map<java.lang.String,java.lang.Integer> mapEdge,
                                  int i1,
                                  int i2)

getIntersection

public void getIntersection(float distance,
                            javax.vecmath.Point4f plane,
                            javax.vecmath.Point3f[] ptCenters,
                            java.util.List<javax.vecmath.Point3f[]> vData,
                            float[] fData,
                            MeshSurface meshSurface,
                            boolean andCap,
                            boolean doClean,
                            int tokType,
                            boolean isGhost)
Parameters:
distance - a distance from a plane or point
plane - a slabbing plane
ptCenters - a set of atoms to measure distance from
vData - when not null, this is a query, not an actual slabbing
fData - vertex values or other data to overlay
meshSurface - second surface; not implemented -- still some problems there
andCap - to cap this off, crudely only
doClean - compact set - draw only
tokType - type of slab
isGhost - translucent slab, so we mark slabbed triangles

setPoint

private static int setPoint(float[] fracs,
                            int i,
                            int i0,
                            int i1)

getDE

private boolean getDE(float[] fracs,
                      int fD,
                      int i1,
                      int i2,
                      int i3,
                      boolean toss23)

checkSlab

private static float checkSlab(int tokType,
                               javax.vecmath.Point3f v,
                               float val,
                               float distance,
                               javax.vecmath.Point4f plane,
                               javax.vecmath.Point3f[] ptCenters)

minDist

private static float minDist(javax.vecmath.Point3f pt,
                             javax.vecmath.Point3f[] ptCenters)

interpolateSphere

private javax.vecmath.Point3f interpolateSphere(javax.vecmath.Point3f v1,
                                                javax.vecmath.Point3f v2,
                                                float d1,
                                                float d2,
                                                double absD,
                                                float val1,
                                                float val2,
                                                float[] values,
                                                float[] fracs,
                                                int i)

interpolatePoint

private static javax.vecmath.Point3f interpolatePoint(javax.vecmath.Point3f v1,
                                                      javax.vecmath.Point3f v2,
                                                      float d1,
                                                      float d2,
                                                      float val1,
                                                      float val2,
                                                      float[] values,
                                                      float[] fracs,
                                                      int i)

interpolateFraction

private static javax.vecmath.Point3f interpolateFraction(javax.vecmath.Point3f v1,
                                                         javax.vecmath.Point3f v2,
                                                         float f,
                                                         float val1,
                                                         float val2,
                                                         float[] values,
                                                         float[] fracs,
                                                         int i)

getSphericalInterpolationFraction

public static float getSphericalInterpolationFraction(double r,
                                                      double valueA,
                                                      double valueB,
                                                      double d)