| Home | Download | Screen shots | Discussion | Documentation |
|---|
Represents a VRML Script node. More...
#include <openvrml/browser.h>

Classes | |
| class | eventout |
An event_emitter along with the emitted value. More... | |
Public Types | |
| typedef std::map< std::string, boost::shared_ptr< field_value > > | field_value_map_t |
A std::map that keys field values on their field name. More... | |
| typedef boost::shared_ptr < eventout > | eventout_ptr |
Reference-counted smart pointer to an eventout. More... | |
| typedef std::map< std::string, eventout_ptr > | eventout_map_t |
Map of eventout instances. More... | |
Public Member Functions | |
| script_node (script_node_metatype &class_, const boost::shared_ptr< openvrml::scope > &scope, const node_interface_set &interfaces, const initial_value_map &initial_values) throw ( unsupported_interface , std::bad_cast , std::bad_alloc , std::invalid_argument ) | |
| Construct. More... | |
| virtual | ~script_node () throw () |
| Destroy. More... | |
| void | update (double current_time) |
| Update the script_node for the current time. More... | |
| const event_listener_map_t & | event_listener_map () const throw () |
| Event listener map accessor. More... | |
| const field_value_map_t & | field_value_map () const throw () |
| Field value map accessor. More... | |
| const eventout_map_t & | eventout_map () const throw () |
eventOut map accessor. More... | |
Public Member Functions inherited from openvrml::child_node | |
| virtual | ~child_node ()=0 throw () |
| Destructor. More... | |
| void | relocate () throw ( std::bad_alloc ) |
| Called when the node is relocated to a new position in the scene graph. More... | |
| void | render_child (viewer &v, rendering_context context) |
| Render the node. More... | |
Public Member Functions inherited from openvrml::bounded_volume_node | |
| virtual | ~bounded_volume_node () throw () |
| Destroy. More... | |
| const openvrml::bounding_volume & | bounding_volume () const |
| Get this node's bounding volume. More... | |
Public Member Functions inherited from openvrml::node | |
| virtual | ~node ()=0 throw () |
| Destructor. More... | |
| void | add_ref () const throw () |
| Increment the reference count. More... | |
| void | remove_ref () const throw () |
| Decrement the reference count. More... | |
| void | release () const throw () |
| Decrement the reference count; destroy the instance if the count drops to zero. More... | |
| size_t | use_count () const throw () |
| The number of owning references to the instance. More... | |
| const node_type & | type () const throw () |
The type information object for the node. More... | |
| const std::string & | id () const throw () |
Retrieve the name of this node. More... | |
| void | id (const std::string &node_id) throw ( std::bad_alloc ) |
Set the name of the node. More... | |
| const openvrml::scope & | scope () const throw () |
Get the scope to which the node belongs. More... | |
| openvrml::scene * | scene () const throw () |
Get the scene with which the node is associated. More... | |
| const std::vector < boost::intrusive_ptr< node > > & | impl_nodes () const throw () |
Get the implementation nodes of a PROTO instance. More... | |
| std::ostream & | print (std::ostream &out, size_t indent) const |
| Pretty print. More... | |
| void | initialize (openvrml::scene &scene, double timestamp) throw ( std::bad_alloc ) |
| Initialize the node. More... | |
| std::auto_ptr< field_value > | field (const std::string &id) const throw ( unsupported_interface , std::bad_alloc ) |
| Generalized field accessor. More... | |
| openvrml::event_listener & | event_listener (const std::string &id) throw ( unsupported_interface ) |
| Get an event listener. More... | |
| openvrml::event_emitter & | event_emitter (const std::string &id) throw ( unsupported_interface ) |
| Get an event emitter. More... | |
| void | shutdown (double timestamp) throw () |
| Shut down the node. More... | |
| bool | modified () const throw ( boost::thread_resource_error ) |
Determine whether the node has been modified. More... | |
| void | modified (bool value) throw ( boost::thread_resource_error ) |
| Set the modified flag. More... | |
Private Member Functions | |
| virtual void | do_initialize (double timestamp) throw ( std::bad_alloc ) |
| Initialize. More... | |
| virtual const field_value & | do_field (const std::string &id) const throw ( unsupported_interface ) |
| Get the value of a field. More... | |
| virtual openvrml::event_listener & | do_event_listener (const std::string &id) throw ( unsupported_interface ) |
| Get an event listener. More... | |
| virtual openvrml::event_emitter & | do_event_emitter (const std::string &id) throw ( unsupported_interface ) |
| Get an event emitter. More... | |
| virtual void | do_shutdown (double timestamp) throw () |
Called by node::shutdown. More... | |
| virtual void | do_render_child (viewer &v, rendering_context context) |
node::render_child implementation. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from openvrml::node | |
| static const boost::intrusive_ptr< node > | self_tag |
Special value used when initializing a script_node. More... | |
Protected Member Functions inherited from openvrml::child_node | |
| child_node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw () | |
| Constructor. More... | |
Protected Member Functions inherited from openvrml::bounded_volume_node | |
| bounded_volume_node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw () | |
| Construct. More... | |
| void | bounding_volume_dirty (bool value) |
| Set whether the node's bounding volume needs to be recalculated. More... | |
| bool | bounding_volume_dirty () const |
| Whether the node's bounding volume needs to be recalculated. More... | |
| virtual const openvrml::bounding_volume & | do_bounding_volume () const |
Called by bounding_volume. More... | |
Protected Member Functions inherited from openvrml::node | |
| node (const node_type &type, const boost::shared_ptr< openvrml::scope > &scope) throw () | |
| Construct. More... | |
| boost::shared_mutex & | scene_mutex () |
The scene mutex. More... | |
Static Protected Member Functions inherited from openvrml::node | |
| static void | emit_event (openvrml::event_emitter &emitter, double timestamp) throw ( std::bad_alloc ) |
| Emit an event. More... | |
Related Functions inherited from openvrml::node | |
| To * | node_cast (node *n) |
Downcast a node to one of the abstract node types. More... | |
| void | intrusive_ptr_add_ref (const node *n) |
| Increment the reference count. More... | |
| void | intrusive_ptr_release (const node *n) |
| Decrement the reference count. More... | |
| bool | is_proto_instance (const node &n) |
Check whether a node is a PROTO instance. More... | |
Represents a VRML Script node.
A std::map that keys field values on their field name.
Reference-counted smart pointer to an eventout.
Map of eventout instances.
| openvrml::script_node::script_node | ( | script_node_metatype & | class_, |
| const boost::shared_ptr< openvrml::scope > & | scope, | ||
| const node_interface_set & | interfaces, | ||
| const initial_value_map & | initial_values | ||
| ) | |||
| throw | ( | unsupported_interface , | |
| std::bad_cast , | |||
| std::bad_alloc , | |||
| std::invalid_argument | |||
| ) | |||
Construct.
Unlike other concrete node types, which are always instantiated via node_type::create_node, the script_node constructor is called directly when creating a new script_node from scratch. However, a script_node can be duplicated (or “cloned”) by calling node_type::create_node on type of a script_node instance. This provides a consistent interface for cloning any node, regardless of its type. OpenVRML uses this internally when instantiating PROTOs.
| [in] | class_ | the script_node_metatype. Typically there is one script_node_metatype per browser instance. |
| [in] | scope | the scope to which the node should belong. |
| [in] | interfaces | a node_interface_set containing specifications of user-defined fields, eventIns, and eventOuts particular to the script_node instance. |
| [in] | initial_values | a map of initial values for fields of the script_node. |
| unsupported_interface | if initial_values specifies a field that is not supported by the script_node. |
| std::bad_cast | if initial_values includes a field value that is the wrong type for the specified field. |
| std::bad_alloc | if memory allocation fails. |
| std::invalid_argument | if:
|
|
virtual | |||||||||||||
Destroy.
| void openvrml::script_node::update | ( | double | current_time | ) |
Update the script_node for the current time.
| [in] | current_time | the current time. |
| const openvrml::script_node::event_listener_map_t & openvrml::script_node::event_listener_map | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Event listener map accessor.
| const openvrml::script_node::field_value_map_t & openvrml::script_node::field_value_map | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Field value map accessor.
field value map.
| const openvrml::script_node::eventout_map_t & openvrml::script_node::eventout_map | ( | ) | const | |
| throw | ( | |||
| ) | ||||
eventOut map accessor.
eventOut map.
eventOut map.
|
privatevirtual | ||||||||||||||
Initialize.
| [in] | timestamp | the current time. |
| std::bad_alloc | if memory allocation fails. |
Reimplemented from openvrml::node.
|
privatevirtual | ||||||||||||||
Get the value of a field.
| [in] | id | the name of the field to get. |
id.| unsupported_interface | if the node has no field id. |
Implements openvrml::node.
|
privatevirtual | ||||||||||||||
Get an event listener.
This method is called by node::event_listener. Subclasses must implement this method.
| [in] | id | eventIn identifier. |
| unsupported_interface | if the node has no eventIn id. |
Implements openvrml::node.
|
privatevirtual | ||||||||||||||
Get an event emitter.
This method is called by node::event_emitter.
| [in] | id | eventOut identifier. |
| unsupported_interface | if the node has no eventOut id. |
Implements openvrml::node.
|
privatevirtual | ||||||||||||||
Called by node::shutdown.
| [in] | timestamp | the current time. |
Reimplemented from openvrml::node.
|
privatevirtual |
node::render_child implementation.
| [in,out] | v | viewer implementation responsible for actually doing the drawing. |
| [in] | context | generic context argument; holds things like the accumulated modelview transform. |
Reimplemented from openvrml::child_node.