Package org.web3d.vrml.export
Class X3DBinaryRetainedDirectExporter
java.lang.Object
org.web3d.vrml.export.Exporter
org.web3d.vrml.export.BaseRetainedExporter
org.web3d.vrml.export.X3DRetainedSAXExporter
org.web3d.vrml.export.X3DBinaryRetainedDirectExporter
- All Implemented Interfaces:
SceneGraphTraversalSimpleObserver
,BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
public class X3DBinaryRetainedDirectExporter
extends X3DRetainedSAXExporter
implements SceneGraphTraversalSimpleObserver
X3D binary exporter using a retained Scenegraph.
This will directly write to X3D binary instead of
reusing the XML code to generate an XML file in memory.
Known Issues:
Proto node fields are copied into instances
- Version:
- $Revision: 1.5 $
- Author:
- Alan Hudson
-
Field Summary
Fields inherited from class org.web3d.vrml.export.X3DRetainedSAXExporter
binary, BYTE_ALGORITHM_ID, compress, compressedAttWay, compressionMethod, currentCompressor, DELTA_ZLIB_INT_ARRAY_ALGORITHM_ID, EMPTY_MAP, filterWriter, handler, ignoreData, indent, INDENT_STRING, indentMap, indentString, METHOD_FASTEST_PARSING, METHOD_SMALLEST_LOSSY, METHOD_SMALLEST_NONLOSSY, METHOD_STRINGS, printDocType, printXML, protoDeclSet, protoMap, quantizeParam, root, traverser, usedNodes, useNC, x3dAtts
Fields inherited from class org.web3d.vrml.export.BaseRetainedExporter
builder, componentList, CONTAINER_PROPS_FILE, containerFields, convertOldContent, currentConnection, currentDefMap, currentIsMap, currentPrototypeDecl, defaultNode, defaultNodes, encodingTo, epToUrl, fieldReader, fieldRemap, geospatialFound, geospatialNodes, hanimFound, hanimNodes, isCache, nodeFactory, oldProtos, oStream, p, processingDocument, profile, protoCreator, scene, scriptPatterns, scriptReplacements, sigDigits, startTime, stripWhitespace, upgrading
Fields inherited from class org.web3d.vrml.export.Exporter
errorReporter, lastErrorCode, majorVersion, minorVersion
-
Constructor Summary
ConstructorsConstructorDescriptionX3DBinaryRetainedDirectExporter
(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter, int compressionMethod, float quantizeParam) Create a new exporter for the given spec versionX3DBinaryRetainedDirectExporter
(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter, int compressionMethod, float quantizeParam, boolean oldMethod) Create a new exporter for the given spec version -
Method Summary
Modifier and TypeMethodDescriptionprotected void
encodeDoubleArray
(double[] fval, int numElements, VRMLFieldDeclaration decl, String qName, com.sun.xml.fastinfoset.sax.AttributesHolder aholder, int ftype) Encode double array data.protected void
encodeFloatArray
(float[] fval, int numElements, VRMLFieldDeclaration decl, String qName, com.sun.xml.fastinfoset.sax.AttributesHolder aholder, int ftype) Encode float array data.void
setMinFloatArraySizeToEncode
(int len) Set the minimum float length array to using deltazlib encoding.Methods inherited from class org.web3d.vrml.export.X3DRetainedSAXExporter
createX3DString, createX3DString, createX3DString, endDocument, getPrintDocType, getPrintXML, observedNode, printComponents, printEndNode, printExporterInfo, printExports, printExternalPrototypeDecl, printHeader, printImports, printMetaData, printProfile, printPrototypeDecl, printROUTE, printStartNode, printStartScriptNode, setPrintDocType, setPrintXML, setX3DAttributes, traverse, writeScene
Methods inherited from class org.web3d.vrml.export.BaseRetainedExporter
componentDecl, convertFieldData, endExternProtoDecl, endField, endNode, endProtoBody, endProtoDecl, endScriptDecl, exportDecl, externProtoURI, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, findIS, getPublicId, getSystemId, importDecl, loadContainerProperties, metaDecl, printDefMap, printIS, profileDecl, protoFieldDecl, protoIsDecl, reverseMap, routeDecl, scriptFieldDecl, setConvertOldContent, setDocumentLocator, startDocument, startExternProtoDecl, startField, startNode, startProtoBody, startProtoDecl, startScriptDecl, useDecl
Methods inherited from class org.web3d.vrml.export.Exporter
getLastErrorCode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.nodes.SceneGraphTraversalSimpleObserver
observedNode
-
Constructor Details
-
X3DBinaryRetainedDirectExporter
public X3DBinaryRetainedDirectExporter(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter, int compressionMethod, float quantizeParam) Create a new exporter for the given spec version- Parameters:
os
- The stream to export the code tomajor
- The major version number of this sceneminor
- The minor version number of this sceneerrorReporter
- The error reporter to usecompressionMethod
- The strategy for choosing compressorsquantizeParam
- The maximum acceptable error for quantization
-
X3DBinaryRetainedDirectExporter
public X3DBinaryRetainedDirectExporter(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter, int compressionMethod, float quantizeParam, boolean oldMethod) Create a new exporter for the given spec version- Parameters:
os
- The stream to export the code tomajor
- The major version number of this sceneminor
- The minor version number of this sceneerrorReporter
- The error reporter to usecompressionMethod
- The strategy for choosing compressorsquantizeParam
- The maximum acceptable error for quantizationoldMethod
- Use the old method before ISO finalization
-
-
Method Details
-
setMinFloatArraySizeToEncode
public void setMinFloatArraySizeToEncode(int len) Set the minimum float length array to using deltazlib encoding. Under a certain length the algorithm increases size. This could be calculated but the runtime cost is pretty high.- Parameters:
len
-
-
encodeDoubleArray
protected void encodeDoubleArray(double[] fval, int numElements, VRMLFieldDeclaration decl, String qName, com.sun.xml.fastinfoset.sax.AttributesHolder aholder, int ftype) Encode double array data. This base version will just use a string rep.- Overrides:
encodeDoubleArray
in classX3DRetainedSAXExporter
- Parameters:
fval
- The parsed double array valuenumElements
- The number of elements per itemdecl
- The field declaration.qName
- The qualified nameaholder
- The current attributes holderftype
- The X3D field type, defined in FieldConstants
-
encodeFloatArray
protected void encodeFloatArray(float[] fval, int numElements, VRMLFieldDeclaration decl, String qName, com.sun.xml.fastinfoset.sax.AttributesHolder aholder, int ftype) Encode float array data. This base version will just use a string rep- Overrides:
encodeFloatArray
in classX3DRetainedSAXExporter
- Parameters:
fval
- The parsed float array valuenumElements
- The number of elements per itemdecl
- The field declaration.qName
- The qualified nameaholder
- The current attributes holderftype
- The X3D field type, defined in FieldConstants
-