|
Xj3D VRML/X3D Code API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.web3d.ogl.loaders.BaseLoader
Common base implementation Aviatrix3D file loader implementation for reading loading files and building a Aviatrix3D 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 runtime, then we will still load nodes that need a runtime system to work, 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 runtime 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 VRMLScene |
parsedScene
The high-level VRML scene that was parsed to create the OGL scene |
protected VRMLParserFactory |
parserFactory
The parser factory that we are going to use. |
protected boolean |
vrml97Only
Flag to say if the scene builder factory should only use VRML97 |
| Constructor Summary | |
protected |
BaseLoader()
Construct a default loader implementation with no flags set. |
| Method Summary | |
int |
getLoadFlags()
Get the current set collection of load flags. |
boolean |
getNavigationEnabled()
Get the currently set navigation state. |
boolean |
isInternalModelKept()
Check to see whether the loader should be currently keeping the internal model. |
void |
keepInternalModel(boolean enable)
Define whether this loader should also keep around it's internal representation of the file format, if it has one. |
AVModel |
load(java.io.File file)
Load a model from the given file. |
AVModel |
load(java.io.InputStream stream)
Load a model from the given input stream. |
AVModel |
load(java.net.URL url)
Load a model from the given URL. |
void |
registerURNLocation(java.lang.String prefix,
java.lang.String directory)
Add a prefix and directory to the URN resolution system. |
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 |
setLoadFlags(int flags)
Set the flags for which parts of the file that should be loaded. |
void |
setNavigationEnabled(boolean state)
Enable or disable navigation processing sub-section of the user input processing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected VRMLParserFactory parserFactory
protected boolean vrml97Only
protected ErrorReporter errorReporter
protected VRMLScene parsedScene
| Constructor Detail |
protected BaseLoader()
setFlags() method.
| Method Detail |
public AVModel load(java.net.URL url)
throws java.io.IOException
url - The url to load the model from
java.io.IOException - something went wrong while reading the file
public AVModel load(java.io.InputStream stream)
throws java.io.IOException
Reader interface, then use the
InputStreamReader to convert this stream to the desired
type. The caller will be responsible for closing down the stream at the
end of this process.
stream - The stream to load the model from
java.io.IOException - something went wrong while reading the file
public AVModel load(java.io.File file)
throws java.io.IOException
file - The file instance to load the model from
java.io.IOException - something went wrong while reading the filepublic void setLoadFlags(int flags)
flags - The collection of flags to usepublic int getLoadFlags()
public void keepInternalModel(boolean enable)
AVModel#getRawModel() method and cast to
the appropriate class type.
enable - true to enable keeping the raw model, false otherwisepublic boolean isInternalModelKept()
public boolean getNavigationEnabled()
public void setNavigationEnabled(boolean state)
state - true to enable navigationpublic 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 | ||||||||||