Xj3D VRML/X3D Code API

org.web3d.vrml.nodes.loader
Interface SceneBuilder

All Superinterfaces:
BinaryContentHandler, ContentHandler, ProtoHandler, RouteHandler, ScriptHandler, StringContentHandler
All Known Implementing Classes:
J3DVRMLSceneBuilder, 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.4 $
Author:
Justin Couch

Method Summary
 void allowVRML97Only(boolean enabled)
          Change the builder to recognise only VRML97 content or allow any version to be loaded.
 VRMLScene getScene()
          Get the scene that was last built by this scene handler.
 void reset()
          Reset the builder.
 void setErrorReporter(ErrorReporter reporter)
          Set the error handler instance used by this instance of the builder.
 void setFrameStateManager(FrameStateManager fsm)
          Set the frame state manager to use for the builder after this point.
 
Methods inherited from interface org.web3d.vrml.sav.StringContentHandler
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.BinaryContentHandler
fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue
 
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
 

Method Detail

setErrorReporter

public void setErrorReporter(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

public 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 the VRMLReader.parse(org.web3d.vrml.sav.InputSource) method is called.


setFrameStateManager

public void setFrameStateManager(FrameStateManager fsm)
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

public 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

public 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

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium