Package org.web3d.vrml.export
Class X3DClassicRetainedExporter
java.lang.Object
org.web3d.vrml.export.Exporter
org.web3d.vrml.export.BaseRetainedExporter
org.web3d.vrml.export.X3DClassicRetainedExporter
- All Implemented Interfaces:
SceneGraphTraversalSimpleObserver,BinaryContentHandler,ContentHandler,ProtoHandler,RouteHandler,ScriptHandler,StringContentHandler
public class X3DClassicRetainedExporter
extends BaseRetainedExporter
implements SceneGraphTraversalSimpleObserver
X3D Classic exporter using a retained Scenegraph.
Known Issues: Proto node fields are copied into instances
- Version:
- $Revision: 1.25 $
- Author:
- Alan Hudson
-
Field Summary
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, upgradingFields inherited from class org.web3d.vrml.export.Exporter
errorReporter, lastErrorCode, majorVersion, minorVersion -
Constructor Summary
ConstructorsConstructorDescriptionX3DClassicRetainedExporter(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter) Create a new exporter for the given spec versionX3DClassicRetainedExporter(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter, int sigDigits) Create a new exporter for the given spec version -
Method Summary
Modifier and TypeMethodDescriptionvoidDeclaration of the end of the document.voidobservedNode(VRMLNodeType parent, VRMLNodeType child, int field, boolean used) Notification of a child node.voidprintComponents(ComponentInfo[] comps) Print the component declvoidprintEndNode(VRMLNodeType node) Print the end of a node.voidPrint identifying information about this exportervoidprintExports(Map<String, String> exports) Print Exports.voidPrint an external proto declaration.voidprintHeader(int major, int minor) Print the header.voidprintImports(Map<String, VRMLNode> imports) Print Imports.voidprintMetaData(Map<String, String> meta) Print the MetaData.voidprintProfile(String profile) Print the profile decl.voidprintPrototypeDecl(PrototypeDecl proto) Print a proto declaration.voidprintROUTE(ROUTE route, Map<VRMLNode, String> defMap) Print a ROUTE statement.voidprintStartNode(VRMLNodeType node, boolean use, Map<VRMLNode, String> defMap, Map<Integer, List<ProtoFieldInfo>> isMap) Print the start of a node, and all its non node fields.voidprintStartScriptNode(AbstractDynamicFieldNode node, boolean use, Map<VRMLNode, String> defMap, Map<Integer, List<ProtoFieldInfo>> isMap) Print the start of a node, and all its non node fields.voidPrint a node and its children.voidwriteScene(VRMLScene scene) Write a scene out.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, useDeclMethods inherited from class org.web3d.vrml.export.Exporter
getLastErrorCode
-
Constructor Details
-
X3DClassicRetainedExporter
public X3DClassicRetainedExporter(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter) 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 use
-
X3DClassicRetainedExporter
public X3DClassicRetainedExporter(OutputStream os, int major, int minor, org.j3d.util.ErrorReporter errorReporter, int sigDigits) 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 usesigDigits- The number of significant digits to use in printing floats
-
-
Method Details
-
writeScene
-
endDocument
Declaration of the end of the document. There will be no further parsing and hence events after this.- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classBaseRetainedExporter- Throws:
SAVException- This call is taken at the wrong time in the structure of the document.VRMLException- This call is taken at the wrong time in the structure of the document.
-
printHeader
public void printHeader(int major, int minor) Print the header.- Specified by:
printHeaderin classBaseRetainedExporter- Parameters:
major- The major versionminor- The minor version
-
printExporterInfo
public void printExporterInfo()Description copied from class:BaseRetainedExporterPrint identifying information about this exporter- Specified by:
printExporterInfoin classBaseRetainedExporter
-
printProfile
Print the profile decl.- Specified by:
printProfilein classBaseRetainedExporter- Parameters:
profile- The profile
-
printComponents
Print the component decl- Specified by:
printComponentsin classBaseRetainedExporter- Parameters:
comps- The component list
-
printMetaData
Print the MetaData.- Specified by:
printMetaDatain classBaseRetainedExporter- Parameters:
meta- The scene Metadata map
-
printROUTE
Print a ROUTE statement.- Specified by:
printROUTEin classBaseRetainedExporter- Parameters:
route- The ROUTE to printdefMap- The DEF map
-
printExports
Print Exports.- Specified by:
printExportsin classBaseRetainedExporter- Parameters:
exports- A map of exports(name,AS).
-
printImports
Print Imports.- Specified by:
printImportsin classBaseRetainedExporter- Parameters:
imports- A map of imports(exported, String[] {def, as}.
-
traverse
Print a node and its children.- Parameters:
source- The root nodeignoreFirst- Should we ignore the first node. Used for WorldRoot and ProtoBody
-
printStartScriptNode
public void printStartScriptNode(AbstractDynamicFieldNode node, boolean use, Map<VRMLNode, String> defMap, Map<Integer, List<ProtoFieldInfo>> isMap) Print the start of a node, and all its non node fields.- Parameters:
node- The node to printuse- Is it a USEdefMap- The current mapping of nodes to DEF namesisMap- The current mapping of fields to IS names
-
printStartNode
public void printStartNode(VRMLNodeType node, boolean use, Map<VRMLNode, String> defMap, Map<Integer, List<ProtoFieldInfo>> isMap) Print the start of a node, and all its non node fields.- Parameters:
node- The node to printuse- Is it a USEdefMap- The current mapping of nodes to DEF namesisMap- The current mapping of fields to IS names
-
printEndNode
-
observedNode
Notification of a child node.- Specified by:
observedNodein interfaceSceneGraphTraversalSimpleObserver- Parameters:
parent- The parent node of this nodechild- The child node that is being observedfield- The index of the child field in its parent nodeused- true if the node reference is actually a USE
-
printPrototypeDecl
Print a proto declaration.- Specified by:
printPrototypeDeclin classBaseRetainedExporter- Parameters:
proto- The decl to print
-
printExternalPrototypeDecl
Print an external proto declaration.- Parameters:
proto- The decl to print
-