Package org.xj3d.core.loading
Interface SceneBuilder
- All Superinterfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
- All Known Implementing Classes:
NRVRMLSceneBuilder
,OGLVRMLSceneBuilder
public interface SceneBuilder
extends StringContentHandler, BinaryContentHandler, ProtoHandler, RouteHandler, ScriptHandler
Definition of a class that is used to build scenes from parsed content.
The interface is used to define a complete system that can be passed to a VRMLReader instance and create a complete scene graph so that it can be used within scripts.
- Version:
- $Revision: 1.2 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
allowVRML97Only
(boolean enabled) Change the builder to recognise only VRML97 content or allow any version to be loaded.getScene()
Get the scene that was last built by this scene handler.void
Release any references to the scene that was last built by this scene handler.void
reset()
Reset the builder.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Set the error handler instance used by this instance of the builder.void
Set the frame state manager to use for the builder after this point.Methods inherited from interface org.web3d.vrml.sav.BinaryContentHandler
fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue
Methods inherited from interface org.web3d.vrml.sav.ContentHandler
componentDecl, endDocument, endField, endNode, exportDecl, importDecl, metaDecl, profileDecl, setDocumentLocator, startDocument, startField, startNode, useDecl
Methods inherited from interface org.web3d.vrml.sav.ProtoHandler
endExternProtoDecl, endProtoBody, endProtoDecl, externProtoURI, protoFieldDecl, protoIsDecl, startExternProtoDecl, startProtoBody, startProtoDecl
Methods inherited from interface org.web3d.vrml.sav.RouteHandler
routeDecl
Methods inherited from interface org.web3d.vrml.sav.ScriptHandler
endScriptDecl, scriptFieldDecl, startScriptDecl
Methods inherited from interface org.web3d.vrml.sav.StringContentHandler
fieldValue, fieldValue
-
Method Details
-
setErrorReporter
void setErrorReporter(org.j3d.util.ErrorReporter reporter) Set the error handler instance used by this instance of the builder. The handler is used to report errors at the higher level. A value of null will clear the current instance and return to the default handling.- Parameters:
reporter
- The handler instance to use or null to clear
-
reset
void reset()Reset the builder. This is used to make sure that the builder has been reset after a parsing run just in case the last parsing run exited abnormally and left us in an odd state. Sometimes this can prevent us from parsing again. This method should be called just before theVRMLReader.parse(org.web3d.vrml.sav.InputSource)
method is called. -
setFrameStateManager
Set the frame state manager to use for the builder after this point. Set a value of null it will clear the currently set items.- Parameters:
fsm
- The state manager to use
-
allowVRML97Only
void allowVRML97Only(boolean enabled) Change the builder to recognise only VRML97 content or allow any version to be loaded.- Parameters:
enabled
- true to restrict content to VRML97 only
-
getScene
VRMLScene getScene()Get the scene that was last built by this scene handler. If none of the methods have been called yet, this will return a null reference. The scene instance returned by this builder will not have had any external references resolved. Externprotos, scripts, Inlines and all other nodes that reference part of their data as a URL will need to be loaded separately.- Returns:
- The last built scene
-
releaseScene
void releaseScene()Release any references to the scene that was last built by this scene handler. This should be called by the loader after a reference to the scene has been retrieved using the getScene() method.
-