Package org.jmol.export
Class JSExporter
- java.lang.Object
-
- org.jmol.export.___Exporter
-
- org.jmol.export.__CartesianExporter
-
- org.jmol.export.JSExporter
-
public class JSExporter extends __CartesianExporter
A class to output WebGL graphics. Only minimally fleshed out. No text, for instance. This class demonstrates a way of interacting with JavaScript that other classes in Jmol do not use. The methods here that start with "js" -- jsInitExport, jsEndExport, etc., are all implemented in JSmolGLmol.js -- that is, they are overridden in the JavaScript. The advantage to this is that this code references just the one line of JavaScript below, which is a static call and serves to extend the prototype. extendJSExporter is in JSmolGLmol.js.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Objecthtml5Appletprivate java.util.Map<java.lang.String,java.lang.Object[]>htObjectsprivate java.util.Map<java.lang.String,java.lang.Boolean>htSpheresRenderedprivate java.lang.String[]retprivate UseTableuseTable-
Fields inherited from class org.jmol.export.__CartesianExporter
canCapCylinders, noColor, sphereMatrix, viewpoint
-
Fields inherited from class org.jmol.export.___Exporter
apertureAngle, backgroundColix, cameraDistance, cameraPosition, center, commandLineOptions, commentChar, degreesPerRadian, depthZ, export3D, exportScale, exportType, fileName, fixedRotationCenter, gdata, lightSource, lineWidthMad, out, privateKey, referenceCenter, scalePixelsPerAngstrom, screenHeight, screenWidth, slabZ, solidOnly, tempP1, tempP2, tempP3, tempV1, tempV2, tm, vwr
-
-
Constructor Summary
Constructors Constructor Description JSExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.IntegergetColor(short colix)private int[]getColors(short[] colixes)private voidjsCylinder(java.lang.Object applet, java.lang.String id, boolean isNew, javajs.util.P3 pt1, javajs.util.P3 pt2, java.lang.Object[] o)private voidjsEndExport(java.lang.Object applet)private voidjsInitExport(java.lang.Object applet)private voidjsSphere(java.lang.Object applet, java.lang.String id, boolean isNew, javajs.util.T3 pt, java.lang.Object[] o)protected voidjsSurface(java.lang.Object applet, javajs.util.T3[] vertices, javajs.util.T3[] normals, int[][] indices, int nVertices, int nPolygons, int nFaces, BS bsPolygons, int faceVertexMax, int color, int[] vertexColors, int[] polygonColors)(package private) voidjsTriangle(java.lang.Object applet, int color, javajs.util.T3 pt1, javajs.util.T3 pt2, javajs.util.T3 pt3)protected voidoutput(javajs.util.T3 pt)protected voidoutputCircle(javajs.util.P3 pt1, javajs.util.P3 pt2, float radius, short colix, boolean doFill)protected voidoutputCone(javajs.util.P3 ptBase, javajs.util.P3 ptTip, float radius, short colix)protected booleanoutputCylinder(javajs.util.P3 ptCenter, javajs.util.P3 pt1, javajs.util.P3 pt2, short colix, byte endcaps, float radius, javajs.util.P3 ptX, javajs.util.P3 ptY, boolean checkRadius)protected voidoutputEllipsoid(javajs.util.P3 center, javajs.util.P3[] points, short colix)protected voidoutputFace(int[] is, int[] coordMap, int faceVertexMax)protected voidoutputFooter()protected voidoutputHeader()protected voidoutputSphere(javajs.util.P3 ptCenter, float radius, short colix, boolean checkRadius)protected voidoutputSurface(javajs.util.T3[] vertices, javajs.util.T3[] normals, short[] vertexColixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, int nTriangles, BS bsPolygons, int faceVertexMax, short colix, javajs.util.Lst<java.lang.Short> colorList, java.util.Map<java.lang.Short,java.lang.Integer> htColixes, javajs.util.P3 offset)protected voidoutputTextPixel(javajs.util.P3 pt, int argb)protected voidoutputTriangle(javajs.util.T3 pt1, javajs.util.T3 pt2, javajs.util.T3 pt3, short colix)(package private) voidplotImage(int x, int y, int z, java.lang.Object image, short bgcolix, int width, int height)(package private) voidplotText(int x, int y, int z, short colix, java.lang.String text, javajs.awt.Font font3d)-
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, outputSolidPlate, setSphereMatrix
-
Methods inherited from class org.jmol.export.___Exporter
drawFilledCircle, drawSurface, finalizeOutput, finalizeOutput2, fixScreenZ, getByteCount, getColorList, getConeMesh, getExportDate, getJmolPerspective, getRotationMatrix, getRotationMatrix, getTriad, getTriadC, initializeOutput, initOutput, opacityFractionalFromArgb, opacityFractionalFromColix, output, outputComment, outputJmolPerspective, outputVertex, outputVertices, rgbFractionalFromArgb, rgbFractionalFromColix, round, round, setTempVertex, translucencyFractionalFromColix
-
-
-
-
Field Detail
-
htSpheresRendered
private java.util.Map<java.lang.String,java.lang.Boolean> htSpheresRendered
-
htObjects
private java.util.Map<java.lang.String,java.lang.Object[]> htObjects
-
html5Applet
java.lang.Object html5Applet
-
useTable
private UseTable useTable
-
ret
private java.lang.String[] ret
-
-
Method Detail
-
jsInitExport
private void jsInitExport(java.lang.Object applet)
- Parameters:
applet-
-
jsEndExport
private void jsEndExport(java.lang.Object applet)
- Parameters:
applet-
-
jsCylinder
private void jsCylinder(java.lang.Object applet, java.lang.String id, boolean isNew, javajs.util.P3 pt1, javajs.util.P3 pt2, java.lang.Object[] o)- Parameters:
applet-id-isNew-pt1-pt2-o-
-
jsSphere
private void jsSphere(java.lang.Object applet, java.lang.String id, boolean isNew, javajs.util.T3 pt, java.lang.Object[] o)- Parameters:
applet-id-isNew-pt-o-
-
jsSurface
protected void jsSurface(java.lang.Object applet, javajs.util.T3[] vertices, javajs.util.T3[] normals, int[][] indices, int nVertices, int nPolygons, int nFaces, BS bsPolygons, int faceVertexMax, int color, int[] vertexColors, int[] polygonColors)- Parameters:
applet-vertices-normals-indices-nVertices-nPolygons-nFaces-bsPolygons-faceVertexMax-color-vertexColors-polygonColors-
-
jsTriangle
void jsTriangle(java.lang.Object applet, int color, javajs.util.T3 pt1, javajs.util.T3 pt2, javajs.util.T3 pt3)- Parameters:
applet-color-pt1-pt2-pt3-
-
outputHeader
protected void outputHeader()
- Specified by:
outputHeaderin class___Exporter
-
outputFooter
protected void outputFooter()
- Overrides:
outputFooterin class___Exporter
-
outputSphere
protected void outputSphere(javajs.util.P3 ptCenter, float radius, short colix, boolean checkRadius)- Specified by:
outputSpherein class__CartesianExporter
-
outputCylinder
protected boolean outputCylinder(javajs.util.P3 ptCenter, javajs.util.P3 pt1, javajs.util.P3 pt2, short colix, byte endcaps, float radius, javajs.util.P3 ptX, javajs.util.P3 ptY, boolean checkRadius)- Specified by:
outputCylinderin class__CartesianExporter
-
outputCircle
protected void outputCircle(javajs.util.P3 pt1, javajs.util.P3 pt2, float radius, short colix, boolean doFill)- Specified by:
outputCirclein class__CartesianExporter
-
outputEllipsoid
protected void outputEllipsoid(javajs.util.P3 center, javajs.util.P3[] points, short colix)- Specified by:
outputEllipsoidin class__CartesianExporter
-
outputCone
protected void outputCone(javajs.util.P3 ptBase, javajs.util.P3 ptTip, float radius, short colix)- Specified by:
outputConein class__CartesianExporter
-
getColor
private java.lang.Integer getColor(short colix)
-
outputSurface
protected void outputSurface(javajs.util.T3[] vertices, javajs.util.T3[] normals, short[] vertexColixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, int nTriangles, BS bsPolygons, int faceVertexMax, short colix, javajs.util.Lst<java.lang.Short> colorList, java.util.Map<java.lang.Short,java.lang.Integer> htColixes, javajs.util.P3 offset)- Overrides:
outputSurfacein class___Exporter- Parameters:
vertices- generally unique vertices [0:nVertices)normals- one per vertexvertexColixes- one per vertex, or nullindices- 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 = 4polygonColixes- face-based colixesnVertices- vertices[nVertices-1] is last vertexnPolygons- indices[nPolygons - 1] is last polygonnTriangles- number of triangular faces requiredbsPolygons- number of polygons (triangles or quads)faceVertexMax- (3) triangles only, indices[][i] may have more elements (4) triangles and quads; indices[][i].length determinescolix- overall (solid) color indexcolorList- list of unique color IDshtColixes- map of color IDs to colorList
-
outputTriangle
protected void outputTriangle(javajs.util.T3 pt1, javajs.util.T3 pt2, javajs.util.T3 pt3, short colix)- Specified by:
outputTrianglein class__CartesianExporter
-
outputTextPixel
protected void outputTextPixel(javajs.util.P3 pt, int argb)- Specified by:
outputTextPixelin class__CartesianExporter
-
outputFace
protected void outputFace(int[] is, int[] coordMap, int faceVertexMax)- Specified by:
outputFacein class__CartesianExporter
-
output
protected void output(javajs.util.T3 pt)
- Specified by:
outputin class___Exporter
-
plotImage
void plotImage(int x, int y, int z, java.lang.Object image, short bgcolix, int width, int height)- Overrides:
plotImagein class__CartesianExporter
-
plotText
void plotText(int x, int y, int z, short colix, java.lang.String text, javajs.awt.Font font3d)- Overrides:
plotTextin class__CartesianExporter
-
getColors
private int[] getColors(short[] colixes)
-
-