Package org.jmol.export
Class JSExporter
java.lang.Object
org.jmol.export.___Exporter
org.jmol.export.__CartesianExporter
org.jmol.export.JSExporter
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 inherited from class org.jmol.export.__CartesianExporter
canCapCylinders, noColor, sphereMatrix, viewpointFields inherited from class org.jmol.export.___Exporter
apertureAngle, backgroundColix, cameraDistance, cameraPosition, center, commandLineOptions, commentChar, degreesPerRadian, depthZ, export3D, exportScale, fileName, fixedRotationCenter, gdata, lightSource, lineWidthMad, out, privateKey, referenceCenter, scalePixelsPerAngstrom, screenHeight, screenWidth, slabZ, solidOnly, tempP1, tempP2, tempP3, tempV1, tempV2, tm, vwr -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidjsSurface(Object applet, T3[] vertices, T3[] normals, int[][] indices, int nVertices, int nPolygons, int nFaces, BS bsPolygons, int faceVertexMax, int color, int[] vertexColors, int[] polygonColors) protected voidprotected voidoutputCircle(P3 pt1, P3 pt2, float radius, short colix, boolean doFill) protected voidoutputCone(P3 ptBase, P3 ptTip, float radius, short colix) protected booleanoutputCylinder(P3 ptCenter, P3 pt1, P3 pt2, short colix, byte endcaps, float radius, P3 ptX, P3 ptY, boolean checkRadius) protected voidoutputEllipsoid(P3 center, P3[] points, short colix) protected voidoutputFace(int[] is, int[] coordMap, int faceVertexMax) protected voidprotected voidprotected voidoutputSphere(P3 ptCenter, float radius, short colix, boolean checkRadius) protected voidoutputSurface(T3[] vertices, T3[] normals, short[] vertexColixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, int nTriangles, BS bsPolygons, int faceVertexMax, short colix, Lst<Short> colorList, Map<Short, Integer> htColixes, P3 offset) protected voidoutputTextPixel(P3 pt, int argb) protected voidoutputTriangle(T3 pt1, T3 pt2, T3 pt3, short colix) Methods inherited from class org.jmol.export.__CartesianExporter
fillTriangle, getCameraPosition, getCoordinateMap, getModelCenter, getNormalMap, outputIndices, outputSolidPlate, setSphereMatrixMethods inherited from class org.jmol.export.___Exporter
finalizeOutput, finalizeOutput2, fixScreenZ, getByteCount, getColorList, getConeMesh, getExportDate, getJmolPerspective, getRotationMatrix, getRotationMatrix, getTriad, getTriadC, initOutput, opacityFractionalFromArgb, opacityFractionalFromColix, output, outputComment, outputJmolPerspective, outputVertex, outputVertices, rgbFractionalFromArgb, rgbFractionalFromColix, round, round, setTempVertex, translucencyFractionalFromColix
-
Constructor Details
-
JSExporter
public JSExporter()
-
-
Method Details
-
jsSurface
protected void jsSurface(Object applet, T3[] vertices, 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-
-
outputHeader
protected void outputHeader()- Specified by:
outputHeaderin class___Exporter
-
outputSphere
- Specified by:
outputSpherein class__CartesianExporter
-
outputCylinder
protected boolean outputCylinder(P3 ptCenter, P3 pt1, P3 pt2, short colix, byte endcaps, float radius, P3 ptX, P3 ptY, boolean checkRadius) - Specified by:
outputCylinderin class__CartesianExporter
-
outputCircle
- Specified by:
outputCirclein class__CartesianExporter
-
outputEllipsoid
- Specified by:
outputEllipsoidin class__CartesianExporter
-
outputCone
- Specified by:
outputConein class__CartesianExporter
-
outputSurface
protected void outputSurface(T3[] vertices, T3[] normals, short[] vertexColixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, int nTriangles, BS bsPolygons, int faceVertexMax, short colix, Lst<Short> colorList, Map<Short, Integer> htColixes, 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 colorListoffset-
-
outputTriangle
- Specified by:
outputTrianglein class__CartesianExporter
-
outputTextPixel
- Specified by:
outputTextPixelin class__CartesianExporter
-
outputFace
protected void outputFace(int[] is, int[] coordMap, int faceVertexMax) - Specified by:
outputFacein class__CartesianExporter
-
output
- Specified by:
outputin class___Exporter
-