Package org.xj3d.core.eventmodel
Interface ViewpointManager
- All Known Implementing Classes:
DefaultViewpointManager
public interface ViewpointManager
An abstract representation of a class that would be responsible for
performing Viewpoint management.
This interface represents a further abstracted view of viewpoint management
handling beyond the BrowserCore
. This gives you
all the handling that is normally seen at a user interface level. You should
use one or the other, but not both as implementations of this class will
also interact with BrowserCore.
- Version:
- $Revision: 1.7 $
- Author:
- Alan Hudson
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener for viewpoint status messages.void
clear()
Force clearing all currently managed nodes from this manager now.void
Go to the first declared viewpoint at the next available opportunity.void
firstViewpoint
(int layer) Go to the first declared viewpoint in the specified layer at the next available opportunity.Gets the viewpoints for the currently active layer.void
Go to the last declared viewpoint at the next available opportunity.void
lastViewpoint
(int layer) Go to the last declared viewpoint of the specified layer at the next available opportunity.void
Go to the next viewpoint at the next available opportunity.void
nextViewpoint
(int layer) Go to the next viewpoint at the next available opportunity.void
Go to the previous viewpoint at the next available opportunity.void
previousViewpoint
(int layer) Go to the previous viewpoint at the next available opportunity.void
Remove a listener for viewpoint status messages.void
Reset the viewpoint back to its original values.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
setViewpoint
(VRMLViewpointNodeType viewpoint) Set the current viewpoint to an arbitrary instance.void
shutdown()
Shutdown the node manager now.void
updateViewpoint
(long time) Update the viewpoint.
-
Method Details
-
updateViewpoint
void updateViewpoint(long time) Update the viewpoint. Called at the beginning of the event model.- Parameters:
time
- The time of the current event model.
-
shutdown
void shutdown()Shutdown the node manager now. If this is using any external resources it should remove those now as the entire application is about to die -
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
-
setViewpoint
Set the current viewpoint to an arbitrary instance.- Parameters:
viewpoint
- The new current viewpoint.
-
firstViewpoint
void firstViewpoint()Go to the first declared viewpoint at the next available opportunity. This corresponds to the SAI Browser.firstViewpoint() call. -
firstViewpoint
void firstViewpoint(int layer) Go to the first declared viewpoint in the specified layer at the next available opportunity. This corresponds to the SAI Browser.firstViewpoint() call.- Parameters:
layer
- The ID of the layer. Must be between 0 and the maximum layer number
-
lastViewpoint
void lastViewpoint()Go to the last declared viewpoint at the next available opportunity. This corresponds to the SAI Browser.lastViewpoint() call. -
lastViewpoint
void lastViewpoint(int layer) Go to the last declared viewpoint of the specified layer at the next available opportunity. This corresponds to the SAI Browser.lastViewpoint() call.- Parameters:
layer
- The ID of the layer. Must be between 0 and the maximum layer number
-
resetViewpoint
void resetViewpoint()Reset the viewpoint back to its original values. -
nextViewpoint
void nextViewpoint()Go to the next viewpoint at the next available opportunity. It looks at the added list for the index of the current viewpoint and moves to the next index it can find. This corresponds to the SAI Browser.nextViewpoint() call. -
nextViewpoint
void nextViewpoint(int layer) Go to the next viewpoint at the next available opportunity. It looks at the added list for the index of the current viewpoint and moves to the next index it can find for the specific layer ID. This corresponds to the SAI Browser.previousViewpoint() call.- Parameters:
layer
- The ID of the layer. Must be between 0 and the maximum layer number
-
previousViewpoint
void previousViewpoint()Go to the previous viewpoint at the next available opportunity. It looks at the added list for the index of the current viewpoint and moves to the previous index it can find. This corresponds to the SAI Browser.previousViewpoint() call. -
previousViewpoint
void previousViewpoint(int layer) Go to the previous viewpoint at the next available opportunity. It looks at the added list for the index of the current viewpoint and moves to the previous index it can find for the specific layer ID. This corresponds to the SAI Browser.previousViewpoint() call.- Parameters:
layer
- The ID of the layer. Must be between 0 and the maximum layer number
-
clear
void clear()Force clearing all currently managed nodes 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. -
getActiveViewpoints
List<VRMLViewpointNodeType> getActiveViewpoints()Gets the viewpoints for the currently active layer.- Returns:
- A list of the viewpoint nodes for the currently active layer
-
addViewpointListener
Add a listener for viewpoint status messages. Adding the same listener instance more than once will be silently ignored. Null values are ignored.- Parameters:
l
- The listener instance to add
-
removeViewpointListener
Remove a listener for viewpoint status messages. If this listener is not currently registered, the request will be silently ignored.- Parameters:
l
- The listener instance to remove
-