Home | Download | Screen shots | Discussion | Documentation | Links |
---|
Public Types | |
typedef void(* | SceneCB )(CBReason reason) |
A pointer to a browser callback function. | |
enum | CBReason { DESTROY_WORLD, REPLACE_WORLD } |
Valid reasons for browser callback. More... | |
Public Methods | |
Browser (std::ostream &out, std::ostream &err) throw (std::bad_alloc) | |
Constructor. | |
virtual | ~Browser () throw () |
Destructor. | |
const MFNode & | getRootNodes () const throw () |
Get the root nodes for the browser. | |
virtual const char * | getName () const throw () |
Get the browser name. | |
virtual const char * | getVersion () const throw () |
Get the browser version. | |
const std::string | getWorldURI () const throw (std::bad_alloc) |
Get the URI for the world. | |
void | replaceWorld (const MFNode &nodes) |
virtual void | loadURI (const MFString &uri, const MFString ¶meter) throw (std::bad_alloc) |
Load a resource into the browser. | |
virtual void | setDescription (const std::string &description) |
Send a string to the user interface. | |
const MFNode | createVrmlFromStream (std::istream &in) |
Generate nodes from a stream of VRML syntax. | |
void | createVrmlFromURI (const MFString &uri, const NodePtr &node, const std::string &event) |
void | addWorldChangedCallback (SceneCB) |
Add a callback function to be called when the world changes. | |
void | sensitiveEvent (Node *object, double timeStamp, bool isOver, bool isActive, double *point) |
void | queueEvent (double timeStamp, FieldValue *value, const NodePtr &toNode, const std::string &toEventIn) |
Queue an event for a node. | |
bool | eventsPending () |
Check if any events are waiting to be distributed. | |
void | flushEvents () |
Discard all pending events. | |
double | getFrameRate () const |
Get the current frame rate. | |
bool | update (double currentTime=-1.0) |
Process events (update the browser). | |
void | render (Viewer &viewer) |
Draw this browser into the specified viewer. | |
void | setModified () |
Indicate that the browser state has changed; need to rerender. | |
void | clearModified () |
Clear the "modified" flag for the browser. | |
bool | isModified () const |
Check if the browser has been modified. | |
void | setDelta (double d) |
Set the time until the next update is needed. | |
double | getDelta () const |
Get the time interval between browser updates. | |
void | addNavigationInfo (Vrml97Node::NavigationInfo &) |
Add a NavigationInfo node to the list of NavigationInfo nodes for the browser. | |
void | removeNavigationInfo (Vrml97Node::NavigationInfo &) |
Remove a NavigationInfo node from the list of NavigationInfo nodes for the browser. | |
Vrml97Node::NavigationInfo * | bindableNavigationInfoTop () |
Get the active node on the bound NavigationInfo stack. | |
void | bindablePush (Vrml97Node::NavigationInfo *) |
Push a NavigationInfo node onto the bound NavigationInfo node stack. | |
void | bindableRemove (Vrml97Node::NavigationInfo *) |
Remove a NavigationInfo node from the bound NavigationInfo node stack. | |
void | addViewpoint (Vrml97Node::Viewpoint &) |
Add a Viewpoint node to the list of Viewpoint nodes for the browser. | |
void | removeViewpoint (Vrml97Node::Viewpoint &) |
Remove a Viewpoint node from the list of Viewpoint nodes for the browser. | |
Vrml97Node::Viewpoint * | bindableViewpointTop () |
Get the active node on the bound Viewpoint stack. | |
void | bindablePush (Vrml97Node::Viewpoint *) |
Push a Viewpoint node onto the bound Viewpoint node stack. | |
void | bindableRemove (Vrml97Node::Viewpoint *) |
Remove a Viewpoint node from the bound Viewpoint node stack. | |
void | nextViewpoint () |
Bind to the next Viewpoint in the list. | |
void | prevViewpoint () |
Bind to the previous Viewpoint in the list. | |
size_t | nViewpoints () |
Get the number of Viewpoint nodes in the browser. | |
void | getViewpoint (size_t index, std::string &name, std::string &description) |
Get the name and description of a Viewpoint. | |
void | setViewpoint (const std::string &name) |
Bind to a specific Viewpoint. | |
void | setViewpoint (size_t index) |
Bind to a Viewpoint with a particular index. | |
void | addScopedLight (Vrml97Node::AbstractLight &) |
Add a scoped light node to the browser. | |
void | removeScopedLight (Vrml97Node::AbstractLight &) |
Remove a scoped light node from the browser. | |
void | addTimeSensor (Vrml97Node::TimeSensor &) |
Add a TimeSensor node to the browser. | |
void | removeTimeSensor (Vrml97Node::TimeSensor &) |
Remove a TimeSensor node from the browser. | |
void | addAudioClip (Vrml97Node::AudioClip &) |
Add an AudioClip node to the browser. | |
void | removeAudioClip (Vrml97Node::AudioClip &) |
Remove an AudioClip node from the browser. | |
void | addMovie (Vrml97Node::MovieTexture &) |
Add a MovieTexture node to the browser. | |
void | removeMovie (Vrml97Node::MovieTexture &) |
Remove a MovieTexture node from the browser. | |
void | addProto (ProtoNode &node) |
Add a PROTO instance to the browser. | |
void | removeProto (ProtoNode &node) |
Remove a PROTO instance from the browser. | |
void | addScript (ScriptNode &) |
Add a Script node to the browser. | |
void | removeScript (ScriptNode &) |
Remove a Script node from the browser. | |
void | updateFlags () |
Propagate the bvolume dirty flag from children to ancestors. | |
Public Attributes | |
std::ostream & | out |
Output stream, generally for console output. | |
std::ostream & | err |
Error output stream. | |
bool | d_flags_need_updating |
Set by Node::setBVolumeDirty on any node in this browser graph, cleared by updateFlags. | |
Protected Types | |
typedef std::list< SceneCB > | SceneCBList |
List of functions to call when the world is changed. | |
enum | { MAXEVENTS = 400 } |
Protected Methods | |
bool | headlightOn () |
void | doCallbacks (CBReason reason) |
Execute browser callback functions. | |
const NodePtr | bindableTop (const BindStack &stack) |
Get the top node of a BindStack. | |
void | bindablePush (BindStack &stack, const NodePtr &node) |
Push a node onto a BindStack. | |
void | bindableRemove (BindStack &stack, const NodePtr &node) |
Remove a node from a BindStack. | |
Protected Attributes | |
SceneCBList | d_sceneCallbacks |
List of functions to call when the world is changed. | |
double | d_frameRate |
Frame rate. | |
Event | d_eventMem [MAXEVENTS] |
The event queue. | |
size_t | d_firstEvent |
size_t | d_lastEvent |
Private Types | |
typedef std::map< std::string, NodeClassPtr > | NodeClassMap |
Maps URIs to NodeClasses. | |
typedef std::list< NodePtr > | BindStack |
A list of bound nodes. | |
Private Methods | |
Browser (const Browser &) | |
Browser & | operator= (const Browser &) |
void | initNodeClassMap () |
Initialize the NodeClass map with the available node implementations. | |
Private Attributes | |
NodeClassMap | nodeClassMap |
A map of URIs to node implementations. | |
ScriptNodeClass | scriptNodeClass |
NodeClass for Script nodes in the browser. | |
Scene * | scene |
Pointer to the root Scene. | |
BindStack | d_navigationInfoStack |
The stack of bound NavigationInfo nodes. | |
BindStack | d_viewpointStack |
The stack of bound Viewpoint nodes. | |
std::list< Node * > | d_navigationInfos |
A list of all the NavigationInfo nodes in the browser. | |
std::list< Node * > | d_viewpoints |
A list of all the Viewpoint nodes in the browser. | |
std::list< Node * > | d_scopedLights |
A list of all the scoped light nodes in the browser. | |
std::list< ScriptNode * > | d_scripts |
A list of all the Script nodes in the browser. | |
std::list< Node * > | d_timers |
A list of all the TimeSensor nodes in the browser. | |
std::list< Node * > | d_audioClips |
A list of all the AudioClip nodes in the browser. | |
std::list< Node * > | d_movies |
A list of all the MovieTexture nodes in the browser. | |
std::list< ProtoNode * > | protoNodeList |
A list of all the prototype nodes in the browser. | |
bool | d_modified |
Flag to indicate whether the browser has been modified. | |
bool | d_newView |
Flag to indicate if the user has changed to a new view. | |
double | d_deltaTime |
Time elapsed since the last update. | |
Friends | |
class | Vrml97Parser |
VRML97 parser generated by ANTLR. | |
class | ProtoNodeClass |
Class object for ProtoNodes. | |
class | Vrml97RootScope |
|
A list of bound nodes.
|
|
Maps URIs to NodeClasses.
|
|
A pointer to a browser callback function. The callback function provoides a way to let the app know when a world is loaded, changed, etc. |
|
List of functions to call when the world is changed.
|
|
|
Valid reasons for browser callback.
|
|
Constructor.
|
|
Destructor.
|
|
Add an AudioClip node to the browser.
|
|
Add a MovieTexture node to the browser.
|
|
Add a NavigationInfo node to the list of NavigationInfo nodes for the browser.
|
|
Add a PROTO instance to the browser.
|
|
Add a scoped light node to the browser.
|
|
Add a Script node to the browser.
|
|
Add a TimeSensor node to the browser.
|
|
Add a Viewpoint node to the list of Viewpoint nodes for the browser.
|
|
Add a callback function to be called when the world changes.
|
|
Get the active node on the bound NavigationInfo stack.
|
|
Push a node onto a BindStack.
|
|
Push a Viewpoint node onto the bound Viewpoint node stack.
|
|
Push a NavigationInfo node onto the bound NavigationInfo node stack.
|
|
Remove a node from a BindStack.
|
|
Remove a Viewpoint node from the bound Viewpoint node stack.
|
|
Remove a NavigationInfo node from the bound NavigationInfo node stack.
|
|
Get the top node of a BindStack.
|
|
Get the active node on the bound Viewpoint stack.
|
|
Clear the "modified" flag for the browser.
|
|
Generate nodes from a stream of VRML syntax. In addition to the exceptions listed, this method may throw any exception that may result from reading the input stream.
|
|
|
|
Execute browser callback functions.
|
|
Check if any events are waiting to be distributed.
|
|
Discard all pending events.
|
|
Get the time interval between browser updates.
|
|
Get the current frame rate.
|
|
Get the browser name.
|
|
Get the root nodes for the browser.
|
|
Get the browser version.
|
|
Get the name and description of a Viewpoint.
|
|
Get the URI for the world.
|
|
Initialize the NodeClass map with the available node implementations.
|
|
Check if the browser has been modified.
|
|
Load a resource into the browser.
The default implementation of this method simply loads a VRML world into the Browser. If the resource at Implementations should override this method to handle non-VRML resources, handing them off to a Web browser or other appropriate handler.
|
|
Bind to the next Viewpoint in the list.
|
|
Get the number of Viewpoint nodes in the browser.
|
|
Bind to the previous Viewpoint in the list.
|
|
Queue an event for a node. Current events are in the array d_eventMem[d_firstEvent,d_lastEvent). If d_firstEvent == d_lastEvent, the queue is empty. There is a fixed maximum number of events. If we are so far behind that the queue is filled, the oldest events get overwritten. |
|
Remove an AudioClip node from the browser.
|
|
Remove a MovieTexture node from the browser.
|
|
Remove a NavigationInfo node from the list of NavigationInfo nodes for the browser.
|
|
Remove a PROTO instance from the browser.
|
|
Remove a scoped light node from the browser.
|
|
Remove a Script node from the browser.
|
|
Remove a TimeSensor node from the browser.
|
|
Remove a Viewpoint node from the list of Viewpoint nodes for the browser.
|
|
Draw this browser into the specified viewer.
|
|
|
|
Set the time until the next update is needed.
|
|
Send a string to the user interface.
The default implementation of this method simply prints
|
|
Indicate that the browser state has changed; need to rerender.
|
|
Bind to a Viewpoint with a particular index.
index is not a valid index, this method has no effect. |
|
Bind to a specific Viewpoint.
name. If no such Viewpoint is available, this method has no effect. |
|
Process events (update the browser). This method should be called after each frame is rendered.
|
|
Propagate the bvolume dirty flag from children to ancestors. The invariant is that if a node's bounding volume is out of date, then the bounding volumes of all that nodes's ancestors must be out of date. However, Node does not maintain a parent pointer. So we must do a traversal of the entire browser graph to do the propagation.
|
|
Class object for ProtoNodes.
|
|
VRML97 parser generated by ANTLR.
|
|
A list of all the AudioClip nodes in the browser.
|
|
Time elapsed since the last update.
|
|
The event queue.
|
|
Set by Node::setBVolumeDirty on any node in this browser graph, cleared by updateFlags.
|
|
Frame rate.
|
|
Flag to indicate whether the browser has been modified.
|
|
A list of all the MovieTexture nodes in the browser.
|
|
A list of all the NavigationInfo nodes in the browser.
|
|
The stack of bound NavigationInfo nodes.
|
|
Flag to indicate if the user has changed to a new view.
|
|
List of functions to call when the world is changed.
|
|
A list of all the scoped light nodes in the browser.
|
|
A list of all the Script nodes in the browser.
|
|
A list of all the TimeSensor nodes in the browser.
|
|
A list of all the Viewpoint nodes in the browser.
|
|
The stack of bound Viewpoint nodes.
|
|
Error output stream.
|
|
A map of URIs to node implementations.
|
|
Output stream, generally for console output.
|
|
A list of all the prototype nodes in the browser.
|
|
Pointer to the root Scene.
|
|
NodeClass for Script nodes in the browser.
|