Package org.xj3d.core.loading
Interface ContentLoadManager
- All Known Implementing Classes:
AbstractLoadManager
,DefaultLoadManager
,MemCacheLoadManager
public interface ContentLoadManager
An abstract definition of managers for loading files that are external to
the currently loading file eg Textures, inlines and protos.
The loader is given a scene and told to start loading the contents. During this time items progress from pending to loading to loaded. The load manager is cancelable so that a particular scene can be interrupted part way through loading. The manager is designed to load multiple scenes in parallel or to have parallel instances of this manager loading data.
- Version:
- $Revision: 1.2 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Force clearing all state from this manager now.int
Get the number of items that need to be loaded.void
Queue for loading a single externproto implementation.void
queueNodesLoad
(NodeArray nodes) Queue an arbitrary collection of nodes for loading.void
queueSceneLoad
(BasicScene scene) Start loading the contents of the given scene.void
setErrorReporter
(org.j3d.util.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
shutdown()
Notification that the manager needs to shut down all the currently running threads.void
stopSceneLoad
(BasicScene scene) Stop the named scene from loading.
-
Method Details
-
setErrorReporter
void setErrorReporter(org.j3d.util.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. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.- Parameters:
reporter
- The instance to use or null
-
queueExternProtoLoad
Queue for loading a single externproto implementation. Used as a way of getting externprotos in to load from the scripting APIs and their createProto or createVRMLFromString methods that have queued up content to load but have no other way of pushing it into the system.- Parameters:
proto
- The proto declaration that needs to be queued up
-
queueSceneLoad
Start loading the contents of the given scene. If there are other scenes already loading, this is placed in the queue behind them. If the scene does not contain any external nodes or is null then it is not queued for loading. This is not a recursive call through all the contained scenes. The caller is responsible for making sure all sub-scenes are loaded as required.- Parameters:
scene
- The scene to load content for
-
queueNodesLoad
Queue an arbitrary collection of nodes for loading.- Parameters:
nodes
- Array of nodes to add
-
stopSceneLoad
Stop the named scene from loading. If there are any loads in progress this action forces them to stop. If this is not a known scene then the request is ignored.- Parameters:
scene
- The scene to stop loading
-
clear
void clear()Force clearing all state from this manager now. This is used to indicate that a new world is about to be loaded and everything should be cleaned out now. -
shutdown
void shutdown()Notification that the manager needs to shut down all the currently running threads. Normally called when the application is exiting, so it is not expected that the manager needs to act sanely after this method has been called. -
getNumberInProgress
int getNumberInProgress()Get the number of items that need to be loaded.- Returns:
- The number of items queued.
-