|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sun.j3d.loaders.LoaderBase
org.web3d.j3d.loaders.BaseLoader
A Java3D file loader implementation for reading X3D utf8 files only and building a Java3D scenegraph with them.
The loader considers sensor handling and routing to be behaviours. Some asynchronous loading of files for textures is performed. Sound file loading is performed if audio clips are asked for. For example, if behaviours are not requested then Inlines will not have their content loaded.
If the loader asks for no behaviors, then we will still load nodes that use behaviors, but will disable their use. For example, a LOD will still need to have all of the geometry loaded, just not shown or activated because the LOD's internal behavior is disabled. Scripts are considered to be behaviours, and they will not be loaded at all if behaviour loading is disabled.
The implementation only makes use of two behaviours. One is a per-frame
behaviour for the event model evaluation. The other is a handler for
trapping user input events. If you disable behaviours, you loose both
of these. For content other than static geometry, such as animations,
turning off behaviours will result in no animations. However, every loaded
scene will be attempting to do work like navigation. This will become quite
CPU intensive because every model will be performing picking operations.
To cut down on this CPU usage, the navigation processing is turned off
by default. If you want the loaded code to also do the navigation of the
viewpoints, then you can call the setNavigationEnable() method.
The default setup for runtime activities is
ListsRouterFactory and
MemCacheLoadManager
| Field Summary | |
protected ErrorReporter |
errorReporter
Class that represents the external reporter |
protected java.util.Map |
overrideCapBitsMap
The map of the override capability bit settings |
protected java.util.Map |
overrideFreqBitsMap
The map of the override capability bit settings |
protected VRMLScene |
parsedScene
The high-level VRML scene that was parsed to create the J3D scene |
protected VRMLParserFactory |
parserFactory
The parser factory that we are going to use. |
protected java.util.Map |
requiredCapBitsMap
The map of the required capability bit settings |
protected java.util.Map |
requiredFreqBitsMap
The map of the required capability bit settings |
protected boolean |
vrml97Only
Flag to say if the scene builder factory should only use VRML97 |
| Fields inherited from class com.sun.j3d.loaders.LoaderBase |
basePath, baseUrl, loadFlags |
| Fields inherited from interface com.sun.j3d.loaders.Loader |
LOAD_ALL, LOAD_BACKGROUND_NODES, LOAD_BEHAVIOR_NODES, LOAD_FOG_NODES, LOAD_LIGHT_NODES, LOAD_SOUND_NODES, LOAD_VIEW_GROUPS |
| Constructor Summary | |
protected |
BaseLoader()
Construct a default loader implementation with no flags set. |
|
BaseLoader(int flags)
Construct a loader with the given flags set. |
| Method Summary | |
boolean |
getNavigationEnabled()
Get the currently set navigation state. |
VRMLScene |
getVRMLScene()
Fetch the high-level Scene from the last parsed file that Xj3D uses to represent the VRML scene graph. |
com.sun.j3d.loaders.Scene |
load(java.io.Reader reader)
Load the scene from the given reader. |
com.sun.j3d.loaders.Scene |
load(java.lang.String filename)
Load a scene from the given filename. |
com.sun.j3d.loaders.Scene |
load(java.net.URL url)
Load a scene from the named URL. |
void |
registerURNLocation(java.lang.String prefix,
java.lang.String directory)
Add a prefix and directory to the URN resolution system. |
void |
setCapabilityOverrideMap(java.util.Map capBits,
java.util.Map freqBits)
Provide the set of mappings that override anything that the loader might set. |
void |
setCapabilityRequiredMap(java.util.Map capBits,
java.util.Map freqBits)
Set the mapping of capability bits that the user would like to make sure is set. |
void |
setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. |
void |
setNavigationEnabled(boolean state)
Enable or disable navigation processing sub-section of the user input processing. |
| Methods inherited from class com.sun.j3d.loaders.LoaderBase |
getBasePath, getBaseUrl, getFlags, setBasePath, setBaseUrl, setFlags |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.j3d.loaders.Loader |
getBasePath, getBaseUrl, getFlags, setBasePath, setBaseUrl, setFlags |
| Field Detail |
protected VRMLParserFactory parserFactory
protected boolean vrml97Only
protected java.util.Map overrideCapBitsMap
protected java.util.Map requiredCapBitsMap
protected java.util.Map overrideFreqBitsMap
protected java.util.Map requiredFreqBitsMap
protected ErrorReporter errorReporter
protected VRMLScene parsedScene
| Constructor Detail |
protected BaseLoader()
setFlags() method.
public BaseLoader(int flags)
flags - The flag values to be used
java.lang.RuntimeException - The factory for loading VRML content could
not be found| Method Detail |
public com.sun.j3d.loaders.Scene load(java.io.Reader reader)
throws com.sun.j3d.loaders.IncorrectFormatException,
com.sun.j3d.loaders.ParsingErrorException
load in interface com.sun.j3d.loaders.Loaderreader - The source of input characters
com.sun.j3d.loaders.IncorrectFormatException - The file is not one our loader
understands (VRML 1.0 or X3D content)
com.sun.j3d.loaders.ParsingErrorException - An error parsing the file
public com.sun.j3d.loaders.Scene load(java.lang.String filename)
throws java.io.FileNotFoundException,
com.sun.j3d.loaders.IncorrectFormatException,
com.sun.j3d.loaders.ParsingErrorException
load in interface com.sun.j3d.loaders.Loaderfilename - The name of the file to load
java.io.FileNotFoundException - The reader can't find the file
com.sun.j3d.loaders.IncorrectFormatException - The file is not one our loader
understands (VRML 1.0 or X3D content)
com.sun.j3d.loaders.ParsingErrorException - An error parsing the file
public com.sun.j3d.loaders.Scene load(java.net.URL url)
throws java.io.FileNotFoundException,
com.sun.j3d.loaders.IncorrectFormatException,
com.sun.j3d.loaders.ParsingErrorException
load in interface com.sun.j3d.loaders.Loaderurl - The URL instance to load data from
java.io.FileNotFoundException - The reader can't find the file
com.sun.j3d.loaders.IncorrectFormatException - The file is not one our loader
understands (VRML 1.0 or X3D content)
com.sun.j3d.loaders.ParsingErrorException - An error parsing the file
public void setCapabilityOverrideMap(java.util.Map capBits,
java.util.Map freqBits)
If the key is set, but the value is null or zero length, then all capabilities on that node will be disabled. If the key is set the values override all settings that the loader may wish to normally make. This can be very dangerous if the loader is used for a file format that includes its own internal animation engine, so be very careful with this request.
setCapabilityOverrideMap in interface org.j3d.renderer.java3d.loaders.ManagedLoadercapBits - The capability bits to be setfreqBits - The frequency bits to be set
public void setCapabilityRequiredMap(java.util.Map capBits,
java.util.Map freqBits)
If the map contains a key, but the value is null or zero length, the request is ignored.
setCapabilityRequiredMap in interface org.j3d.renderer.java3d.loaders.ManagedLoadercapBits - The capability bits to be setfreqBits - The frequency bits to be setpublic boolean getNavigationEnabled()
public void setNavigationEnabled(boolean state)
state - true to enable navigationpublic VRMLScene getVRMLScene()
public void setErrorReporter(ErrorReporter reporter)
reporter - The instance to use or null
public void registerURNLocation(java.lang.String prefix,
java.lang.String directory)
throws java.lang.IllegalArgumentException
prefix - The subspace prefix to usedirectory - The directory that GeoVRML is installed in
java.lang.IllegalArgumentException - The directory is not valid
|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||