# Class _VrmlExporter

java.lang.Object
org.jmol.export.___Exporter
org.jmol.export.__CartesianExporter
org.jmol.export._VrmlExporter

Direct Known Subclasses:
  `_StlExporter, _X3dExporter`

public class _VrmlExporter extends __CartesianExporter
A basic VRML generator. Modified 10/2016 to no longer use high-level objects Cone, Sphere, and Cylinder. Makes substantial use of DEF and USE to reduce file size hugely.

Author:
  Bob Hanson

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String`
`fontChild`
`protected String`
`fontFace`
`protected float`
`fontSize`
`protected String`
`fontStyle`
`protected P3`
`tempQ1`
`protected P3`
`tempQ2`
`protected P3`
`tempQ3`
`protected org.jmol.export.UseTable`
`useTable`

### Fields inherited from class __CartesianExporter

`canCapCylinders, noColor, sphereMatrix, viewpoint`

### Fields inherited from class ___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
Constructor
Description
`_VrmlExporter()`

## Method Summary

Modifier and Type
Method
Description
`protected String`
`getDef(String key)`
`protected float`
`getViewpoint()`
`protected void`
`output(T3 pt)`
`protected void`
`outputAppearance(short colix, boolean isText)`
`protected void`
`outputAttr(String attr, float x, float y, float z)`
`protected void`
`outputAttrPt(String attr, T3 pt)`
`protected void`
`outputChildClose()`
`protected void`
`outputChildShapeClose()`
`protected void`
`outputChildShapeStart()`
`protected void`
`outputChildStart()`
`protected void`
`outputCircle(P3 pt1, P3 pt2, float radius, short colix, boolean doFill)`
`protected void`
`outputCloseTag()`
`protected void`
`outputColorIndices(int[][] indices, int nPolygons, BS bsPolygons, int faceVertexMax, Map<Short,Integer> htColixes, short[] colixes, short[] polygonColixes)`
`protected void`
`outputColors(Lst<Short> colorList)`
`protected void`
`outputCone(P3 ptBase, P3 ptTip, float radius, short colix)`
`protected boolean`
`outputCylinder(P3 ptCenter, P3 pt1, P3 pt2, short colix, byte endcaps, float radius, P3 ptX, P3 ptY, boolean checkRadius)`
`protected void`
`outputCylinderChildScaled(short colix, byte endcaps)`
`protected void`
`outputDefChildFaceSet(String child)`
`protected void`
`outputEllipsoid(P3 ptCenter, P3[] points, short colix)`
`protected void`
`outputFace(int[] face, int[] map, int faceVertexMax)`
`protected void`
`outputFaceSetClose()`
`protected void`
`outputFaceSetStart()`
`protected void`
`outputFooter()`
`protected void`
`outputGeometry(T3[] vertices, T3[] normals, short[] colixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, BS bsPolygons, int faceVertexMax, Lst<Short> colorList, Map<Short,Integer> htColixes, P3 offset)`
`protected void`
`outputHeader()`
`protected void`
`outputInitialTransform()`
`protected void`
`outputNormals(Lst<String> vNormals)`
`protected void`
`outputQuaternionFrame(P3 ptCenter, P3 ptX, P3 ptY, P3 ptZ, float xScale, float yScale, float zScale)`
`protected void`
`outputRotation(A4 a)`
`protected void`
`outputShapeClose()`
`protected void`
`outputShapeStart()`
`protected void`
`outputSolidPlate(P3 tempP1, P3 tempP2, P3 tempP3, short colix)`
`protected void`
`outputSphere(P3 ptCenter, float radius, short colix, boolean checkRadius)`
`protected void`
`outputSurface(T3[] vertices, T3[] normals, short[] colixes, 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 void`
`outputTextPixel(P3 pt, int argb)`
`protected void`
`outputTransRot(P3 pt1, P3 pt2, int x, int y, int z)`
`protected void`
`outputTriangle(T3 pt1, T3 pt2, T3 pt3, short colix)`
`protected void`
`outputUseChildClose(String child)`
`protected void`
`popMatrix()`
`protected void`
`pushMatrix()`

### Methods inherited from class __CartesianExporter

`fillTriangle, getCameraPosition, getCoordinateMap, getModelCenter, getNormalMap, outputIndices, setSphereMatrix`

### Methods inherited from class ___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`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### useTable

protected org.jmol.export.UseTable useTable

### tempQ1

protected P3 tempQ1

### tempQ2

protected P3 tempQ2

### tempQ3

protected P3 tempQ3

### fontSize

protected float fontSize

### fontFace

protected String fontFace

### fontStyle

protected String fontStyle

### fontChild

protected String fontChild

## Constructor Details

### _VrmlExporter

public _VrmlExporter()

## Method Details

### output

protected void output(T3 pt)

Specified by:
  `output` in class `___Exporter`

### outputHeader

protected void outputHeader()

Specified by:
  `outputHeader` in class `___Exporter`

### outputInitialTransform

protected void outputInitialTransform()

### getViewpoint

protected float getViewpoint()

### outputFooter

protected void outputFooter()

Overrides:
  `outputFooter` in class `___Exporter`

### outputAppearance

protected void outputAppearance(short colix, boolean isText)

### pushMatrix

protected void pushMatrix()

### popMatrix

protected void popMatrix()

### outputAttrPt

protected void outputAttrPt(String attr, T3 pt)

### outputAttr

protected void outputAttr(String attr, float x, float y, float z)

### outputRotation

protected void outputRotation(A4 a)

### outputTransRot

protected void outputTransRot(P3 pt1, P3 pt2, int x, int y, int z)

### outputQuaternionFrame

protected void outputQuaternionFrame(P3 ptCenter, P3 ptX, P3 ptY, P3 ptZ, float xScale, float yScale, float zScale)

### outputChildShapeStart

protected void outputChildShapeStart()

### outputChildStart

protected void outputChildStart()

### outputShapeStart

protected void outputShapeStart()

### outputDefChildFaceSet

protected void outputDefChildFaceSet(String child)

### outputFaceSetStart

protected void outputFaceSetStart()

### outputFaceSetClose

protected void outputFaceSetClose()

### outputUseChildClose

protected void outputUseChildClose(String child)

### outputChildShapeClose

protected void outputChildShapeClose()

### outputChildClose

protected void outputChildClose()

### outputShapeClose

protected void outputShapeClose()

### outputCloseTag

protected void outputCloseTag()

### outputCircle

protected void outputCircle(P3 pt1, P3 pt2, float radius, short colix, boolean doFill)

Specified by:
  `outputCircle` in class `__CartesianExporter`

### outputCone

protected void outputCone(P3 ptBase, P3 ptTip, float radius, short colix)

Specified by:
  `outputCone` in 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:
  `outputCylinder` in class `__CartesianExporter`

### outputCylinderChildScaled

protected void outputCylinderChildScaled(short colix, byte endcaps)

### outputSphere

protected void outputSphere(P3 ptCenter, float radius, short colix, boolean checkRadius)

Specified by:
  `outputSphere` in class `__CartesianExporter`

### outputEllipsoid

protected void outputEllipsoid(P3 ptCenter, P3[] points, short colix)

Specified by:
  `outputEllipsoid` in class `__CartesianExporter`

### outputSolidPlate

protected void outputSolidPlate(P3 tempP1, P3 tempP2, P3 tempP3, short colix)

Overrides:
  `outputSolidPlate` in class `__CartesianExporter`
Parameters:
  `tempP1` -
  `tempP2` -
  `tempP3` -
  `colix` -

### outputSurface

protected void outputSurface(T3[] vertices, T3[] normals, short[] colixes, 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:
  `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
  `nTriangles` - 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
  `offset` -

### outputGeometry

protected void outputGeometry(T3[] vertices, T3[] normals, short[] colixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, BS bsPolygons, int faceVertexMax, Lst<Short> colorList, Map<Short,Integer> htColixes, P3 offset)

### outputFace

protected void outputFace(int[] face, int[] map, int faceVertexMax)

Specified by:
  `outputFace` in class `__CartesianExporter`

### outputNormals

protected void outputNormals(Lst<String> vNormals)

### outputColors

protected void outputColors(Lst<Short> colorList)

### outputColorIndices

protected void outputColorIndices(int[][] indices, int nPolygons, BS bsPolygons, int faceVertexMax, Map<Short,Integer> htColixes, short[] colixes, short[] polygonColixes)

### outputTriangle

protected void outputTriangle(T3 pt1, T3 pt2, T3 pt3, short colix)

Specified by:
  `outputTriangle` in class `__CartesianExporter`

### outputTextPixel

protected void outputTextPixel(P3 pt, int argb)

Specified by:
  `outputTextPixel` in class `__CartesianExporter`

### getDef

protected String getDef(String key)