org.jmol.util
Class MeshSurface
java.lang.Object
org.jmol.util.MeshSurface
- Direct Known Subclasses:
- Mesh, MeshData
public class MeshSurface
- extends java.lang.Object
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 |
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
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)
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 pointplane
- a slabbing planeptCenters
- a set of atoms to measure distance fromvData
- when not null, this is a query, not an actual slabbingfData
- vertex values or other data to overlaymeshSurface
- second surface; not implemented -- still some problems thereandCap
- to cap this off, crudely onlydoClean
- compact set - draw onlytokType
- type of slabisGhost
- 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)