org.jmol.export
Class _IdtfExporter

java.lang.Object
  extended by org.jmol.export.___Exporter
      extended by org.jmol.export.__CartesianExporter
          extended by org.jmol.export._IdtfExporter

public class _IdtfExporter
extends __CartesianExporter


Field Summary
private  javax.vecmath.Matrix4f cylinderMatrix
           
private  boolean haveCircle
           
private  boolean haveCone
           
private  boolean haveCylinder
           
private  boolean haveCylinderIn
           
private  boolean haveSphere
           
private  java.util.Map<java.lang.String,java.lang.Boolean> htDefs
           
private  java.util.Map<java.lang.String,java.util.List<java.lang.String>> htNodes
           
private  int iObj
           
private  javax.vecmath.Matrix4f m
           
private  java.lang.StringBuffer models
           
private  java.lang.StringBuffer modifiers
           
private  javax.vecmath.Point3f ptMax
           
private  javax.vecmath.Point3f ptMin
           
private  java.lang.StringBuffer resources
           
private  java.lang.StringBuffer sbTemp
           
private  int[][] triangleFace
           
 
Fields inherited from class org.jmol.export.__CartesianExporter
sphereMatrix, viewpoint
 
Fields inherited from class org.jmol.export.___Exporter
aperatureAngle, backgroundColix, bw, cameraDistance, cameraPosition, center, commandLineOptions, commentChar, degreesPerRadian, depthZ, exportType, fileName, fixedRotationCenter, g3d, isToFile, jmolRenderer, lightSource, lineWidthMad, nBytes, output, privateKey, referenceCenter, scalePixelsPerAngstrom, screenHeight, screenWidth, slabZ, tempA, tempP1, tempP2, tempP3, tempV1, tempV2, tempV3, viewer
 
Constructor Summary
_IdtfExporter()
           
 
Method Summary
private  void addColix(short colix, boolean haveColors)
           
private  void addMeshData(java.lang.String key, int nFaces, int nCoord, int nNormals, int nColors, java.lang.StringBuffer sbFaceCoordIndices, java.lang.StringBuffer sbFaceNormalIndices, java.lang.StringBuffer sbColorIndices, java.lang.StringBuffer sbCoords, java.lang.StringBuffer sbNormals, java.lang.StringBuffer sbColors)
           
private  void addShader(java.lang.String key, short colix)
           
private  void checkPoint(javax.vecmath.Tuple3f pt)
           
(package private)  java.lang.String finalizeOutput()
           
private  java.lang.String getAuxiliaryFileData()
           
private  java.lang.String getCircleResource()
           
private  java.lang.String getConeResource()
           
private  java.lang.String getCylinderResource(boolean inSide)
           
private  java.lang.String getMeshData(java.lang.String type, int[][] indices, javax.vecmath.Tuple3f[] vertexes, javax.vecmath.Tuple3f[] normals)
           
private  void getMeshHeader(java.lang.String type, int nFaces, int vertexCount, int normalCount, int colorCount, java.lang.StringBuffer sb)
           
private  java.lang.String getParentItem(java.lang.String name, javax.vecmath.Matrix4f m)
           
private  java.lang.String getSphereResource()
           
private  java.lang.String getTriangleResource(java.lang.String key, javax.vecmath.Point3f pt1, javax.vecmath.Point3f pt2, javax.vecmath.Point3f pt3)
           
protected  void output(javax.vecmath.Tuple3f pt)
           
private  void output(javax.vecmath.Tuple3f pt, java.lang.StringBuffer sb, boolean checkpt)
           
protected  void outputCircle(javax.vecmath.Point3f pt1, javax.vecmath.Point3f pt2, float radius, short colix, boolean doFill)
           
private  void outputCircle(javax.vecmath.Point3f ptCenter, javax.vecmath.Point3f ptPerp, short colix, float radius)
           
protected  void outputCone(javax.vecmath.Point3f ptBase, javax.vecmath.Point3f ptTip, float radius, short colix)
           
protected  boolean outputCylinder(javax.vecmath.Point3f ptCenter, javax.vecmath.Point3f pt1, javax.vecmath.Point3f pt2, short colix, byte endcaps, float radius, javax.vecmath.Point3f ptX, javax.vecmath.Point3f ptY)
           
private  boolean outputEllipse(javax.vecmath.Point3f ptCenter, javax.vecmath.Point3f ptZ, javax.vecmath.Point3f ptX, javax.vecmath.Point3f ptY, short colix)
           
private  void outputEllipsoid(javax.vecmath.Point3f center, javax.vecmath.Matrix4f sphereMatrix, short colix)
           
protected  void outputEllipsoid(javax.vecmath.Point3f center, javax.vecmath.Point3f[] points, short colix)
           
protected  void outputFace(int[] face, int[] map, int faceVertexMax)
           
protected  void outputFooter()
           
protected  void outputHeader()
           
private  void outputNodes()
           
protected  void outputSphere(javax.vecmath.Point3f center, float radius, short colix)
           
protected  void outputSurface(javax.vecmath.Point3f[] vertices, javax.vecmath.Vector3f[] normals, short[] colixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, int nFaces, java.util.BitSet bsPolygons, int faceVertexMax, short colix, java.util.List<java.lang.Short> colorList, java.util.Map<java.lang.Short,java.lang.Integer> htColixes, javax.vecmath.Point3f offset)
           
protected  void outputTextPixel(javax.vecmath.Point3f pt, int argb)
           
protected  void outputTriangle(javax.vecmath.Point3f pt1, javax.vecmath.Point3f pt2, javax.vecmath.Point3f pt3, short colix)
           
 
Methods inherited from class org.jmol.export.__CartesianExporter
drawAtom, drawCircle, drawCylinder, drawEllipse, drawPixel, drawTextPixel, fillConeScreen, fillCylinderScreen, fillCylinderScreenMad, fillEllipsoid, fillSphere, fillTriangle, getCameraPosition, getCoordinateMap, getModelCenter, getNormalMap, outputIndices, plotImage, plotText, setSphereMatrix
 
Methods inherited from class org.jmol.export.___Exporter
drawFilledCircle, drawSurface, getColorList, getConeMesh, getExportDate, getJmolPerspective, getRotationMatrix, getRotationMatrix, initializeOutput, opacityFractionalFromArgb, opacityFractionalFromColix, output, outputComment, outputJmolPerspective, outputVertex, outputVertices, rgbFractionalFromArgb, rgbFractionalFromColix, round, round, setRenderer, setTempVertex, translucencyFractionalFromColix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

haveSphere

private boolean haveSphere

haveCylinder

private boolean haveCylinder

haveCylinderIn

private boolean haveCylinderIn

haveCone

private boolean haveCone

haveCircle

private boolean haveCircle

ptMin

private javax.vecmath.Point3f ptMin

ptMax

private javax.vecmath.Point3f ptMax

iObj

private int iObj

htDefs

private java.util.Map<java.lang.String,java.lang.Boolean> htDefs

m

private final javax.vecmath.Matrix4f m

models

private final java.lang.StringBuffer models

resources

private final java.lang.StringBuffer resources

modifiers

private final java.lang.StringBuffer modifiers

htNodes

private java.util.Map<java.lang.String,java.util.List<java.lang.String>> htNodes

cylinderMatrix

private javax.vecmath.Matrix4f cylinderMatrix

sbTemp

private java.lang.StringBuffer sbTemp

triangleFace

private int[][] triangleFace
Constructor Detail

_IdtfExporter

public _IdtfExporter()
Method Detail

output

protected void output(javax.vecmath.Tuple3f pt)
Specified by:
output in class ___Exporter

output

private void output(javax.vecmath.Tuple3f pt,
                    java.lang.StringBuffer sb,
                    boolean checkpt)

checkPoint

private void checkPoint(javax.vecmath.Tuple3f pt)

outputHeader

protected void outputHeader()
Specified by:
outputHeader in class ___Exporter

finalizeOutput

java.lang.String finalizeOutput()
Overrides:
finalizeOutput in class ___Exporter

getAuxiliaryFileData

private java.lang.String getAuxiliaryFileData()

getParentItem

private java.lang.String getParentItem(java.lang.String name,
                                       javax.vecmath.Matrix4f m)

addColix

private void addColix(short colix,
                      boolean haveColors)

addShader

private void addShader(java.lang.String key,
                       short colix)

outputFooter

protected void outputFooter()
Overrides:
outputFooter in class ___Exporter

outputNodes

private void outputNodes()

outputEllipsoid

protected void outputEllipsoid(javax.vecmath.Point3f center,
                               javax.vecmath.Point3f[] points,
                               short colix)
Specified by:
outputEllipsoid in class __CartesianExporter

outputEllipsoid

private void outputEllipsoid(javax.vecmath.Point3f center,
                             javax.vecmath.Matrix4f sphereMatrix,
                             short colix)

getSphereResource

private java.lang.String getSphereResource()

getMeshData

private java.lang.String getMeshData(java.lang.String type,
                                     int[][] indices,
                                     javax.vecmath.Tuple3f[] vertexes,
                                     javax.vecmath.Tuple3f[] normals)

getMeshHeader

private void getMeshHeader(java.lang.String type,
                           int nFaces,
                           int vertexCount,
                           int normalCount,
                           int colorCount,
                           java.lang.StringBuffer sb)

outputCylinder

protected boolean outputCylinder(javax.vecmath.Point3f ptCenter,
                                 javax.vecmath.Point3f pt1,
                                 javax.vecmath.Point3f pt2,
                                 short colix,
                                 byte endcaps,
                                 float radius,
                                 javax.vecmath.Point3f ptX,
                                 javax.vecmath.Point3f ptY)
Specified by:
outputCylinder in class __CartesianExporter

outputCircle

protected void outputCircle(javax.vecmath.Point3f pt1,
                            javax.vecmath.Point3f pt2,
                            float radius,
                            short colix,
                            boolean doFill)
Specified by:
outputCircle in class __CartesianExporter

outputEllipse

private boolean outputEllipse(javax.vecmath.Point3f ptCenter,
                              javax.vecmath.Point3f ptZ,
                              javax.vecmath.Point3f ptX,
                              javax.vecmath.Point3f ptY,
                              short colix)

outputCircle

private void outputCircle(javax.vecmath.Point3f ptCenter,
                          javax.vecmath.Point3f ptPerp,
                          short colix,
                          float radius)

getCylinderResource

private java.lang.String getCylinderResource(boolean inSide)

outputFace

protected void outputFace(int[] face,
                          int[] map,
                          int faceVertexMax)
Specified by:
outputFace in class __CartesianExporter

outputSurface

protected void outputSurface(javax.vecmath.Point3f[] vertices,
                             javax.vecmath.Vector3f[] normals,
                             short[] colixes,
                             int[][] indices,
                             short[] polygonColixes,
                             int nVertices,
                             int nPolygons,
                             int nFaces,
                             java.util.BitSet bsPolygons,
                             int faceVertexMax,
                             short colix,
                             java.util.List<java.lang.Short> colorList,
                             java.util.Map<java.lang.Short,java.lang.Integer> htColixes,
                             javax.vecmath.Point3f offset)
Overrides:
outputSurface in class ___Exporter
Parameters:
vertices - generally unique vertices [0:nVertices)
normals - one per vertex
colixes - one per vertex, or null
indices - one per triangular or quad polygon; may have additional elements beyond vertex indices if faceVertexMax = 3 triangular if faceVertexMax == 3; 3 or 4 if face VertexMax = 4
polygonColixes - face-based colixes
nVertices - vertices[nVertices-1] is last vertex
nPolygons - indices[nPolygons - 1] is last polygon
nFaces - number of triangular faces required
bsPolygons - number of polygons (triangles or quads)
faceVertexMax - (3) triangles only, indices[][i] may have more elements (4) triangles and quads; indices[][i].length determines
colix - overall (solid) color index
colorList - list of unique color IDs
htColixes - map of color IDs to colorList

addMeshData

private void addMeshData(java.lang.String key,
                         int nFaces,
                         int nCoord,
                         int nNormals,
                         int nColors,
                         java.lang.StringBuffer sbFaceCoordIndices,
                         java.lang.StringBuffer sbFaceNormalIndices,
                         java.lang.StringBuffer sbColorIndices,
                         java.lang.StringBuffer sbCoords,
                         java.lang.StringBuffer sbNormals,
                         java.lang.StringBuffer sbColors)

outputCone

protected void outputCone(javax.vecmath.Point3f ptBase,
                          javax.vecmath.Point3f ptTip,
                          float radius,
                          short colix)
Specified by:
outputCone in class __CartesianExporter

getConeResource

private java.lang.String getConeResource()

getCircleResource

private java.lang.String getCircleResource()

outputSphere

protected void outputSphere(javax.vecmath.Point3f center,
                            float radius,
                            short colix)
Specified by:
outputSphere in class __CartesianExporter

outputTextPixel

protected void outputTextPixel(javax.vecmath.Point3f pt,
                               int argb)
Specified by:
outputTextPixel in class __CartesianExporter

outputTriangle

protected void outputTriangle(javax.vecmath.Point3f pt1,
                              javax.vecmath.Point3f pt2,
                              javax.vecmath.Point3f pt3,
                              short colix)
Specified by:
outputTriangle in class __CartesianExporter

getTriangleResource

private java.lang.String getTriangleResource(java.lang.String key,
                                             javax.vecmath.Point3f pt1,
                                             javax.vecmath.Point3f pt2,
                                             javax.vecmath.Point3f pt3)