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, upgrading
Fields 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 TypeMethodDescriptionvoid
Declaration of the end of the document.void
observedNode
(VRMLNodeType parent, VRMLNodeType child, int field, boolean used) Notification of a child node.void
printComponents
(ComponentInfo[] comps) Print the component declvoid
printEndNode
(VRMLNodeType node) Print the end of a node.void
Print identifying information about this exportervoid
printExports
(Map<String, String> exports) Print Exports.void
Print an external proto declaration.void
printHeader
(int major, int minor) Print the header.void
printImports
(Map<String, VRMLNode> imports) Print Imports.void
printMetaData
(Map<String, String> meta) Print the MetaData.void
printProfile
(String profile) Print the profile decl.void
printPrototypeDecl
(PrototypeDecl proto) Print a proto declaration.void
printROUTE
(ROUTE route, Map<VRMLNode, String> defMap) Print a ROUTE statement.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.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.void
Print a node and its children.void
writeScene
(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, useDecl
Methods 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:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in 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:
printHeader
in classBaseRetainedExporter
- Parameters:
major
- The major versionminor
- The minor version
-
printExporterInfo
public void printExporterInfo()Description copied from class:BaseRetainedExporter
Print identifying information about this exporter- Specified by:
printExporterInfo
in classBaseRetainedExporter
-
printProfile
Print the profile decl.- Specified by:
printProfile
in classBaseRetainedExporter
- Parameters:
profile
- The profile
-
printComponents
Print the component decl- Specified by:
printComponents
in classBaseRetainedExporter
- Parameters:
comps
- The component list
-
printMetaData
Print the MetaData.- Specified by:
printMetaData
in classBaseRetainedExporter
- Parameters:
meta
- The scene Metadata map
-
printROUTE
Print a ROUTE statement.- Specified by:
printROUTE
in classBaseRetainedExporter
- Parameters:
route
- The ROUTE to printdefMap
- The DEF map
-
printExports
Print Exports.- Specified by:
printExports
in classBaseRetainedExporter
- Parameters:
exports
- A map of exports(name,AS).
-
printImports
Print Imports.- Specified by:
printImports
in 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:
observedNode
in 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:
printPrototypeDecl
in classBaseRetainedExporter
- Parameters:
proto
- The decl to print
-
printExternalPrototypeDecl
Print an external proto declaration.- Parameters:
proto
- The decl to print
-