Home | Download | Screen shots | Discussion | Documentation |
---|
Inheritance diagram for openvrml::script_node:
Public Types | |
typedef std::map< std::string, field_value_ptr > | field_value_map_t |
A std::map that keys field values on their field name. | |
typedef std::map< std::string, polled_eventout_value > | eventout_value_map_t |
A std::map that keys eventOut values on their eventOut name. | |
Public Member Functions | |
script_node (script_node_class &class_, const scope_ptr &scope) throw () | |
Construct. | |
virtual | ~script_node () throw () |
Destroy. | |
void | url (const mfstring &value, double timestamp) |
set_url eventIn handler. | |
const mfstring & | url () const |
url exposedField. | |
void | add_eventin (field_value::type_id type, const std::string &id) throw (std::invalid_argument, std::bad_alloc) |
Add an eventIn. | |
void | add_eventout (field_value::type_id type, const std::string &id) throw (std::invalid_argument, std::bad_alloc) |
Add an eventOut. | |
void | add_field (const std::string &id, const field_value_ptr &default_val) throw (std::invalid_argument, std::bad_alloc) |
Add a field. | |
void | update (double current_time) |
Update the script_node for the current time. | |
void | eventout (const std::string &id, const field_value &value) throw (unsupported_interface, std::bad_cast, std::bad_alloc) |
Set the value of one of the node's eventOuts. | |
const field_value_map_t & | field_value_map () const throw () |
field value map. | |
const eventout_value_map_t & | eventout_value_map () const throw () |
eventOut value map. | |
virtual const script_node * | to_script () const throw () |
Return a pointer to this script_node. | |
virtual script_node * | to_script () throw () |
Return a pointer to this script_node. | |
Private Member Functions | |
script * | create_script () |
Create a script object. | |
void | assign_with_self_ref_check (const sfnode &, sfnode &) const throw () |
Special assignment function to take into account the fact that Script nodes can be self referential. | |
void | assign_with_self_ref_check (const mfnode &, mfnode &) const throw () |
Special assignment function to take into account the fact that Script nodes can be self referential. | |
virtual void | do_initialize (double timestamp) throw (std::bad_alloc) |
Initialize. | |
virtual void | do_field (const std::string &id, const field_value &value) throw (unsupported_interface, std::bad_cast, std::bad_alloc) |
Set the value of one of the node's fields. | |
virtual const field_value & | do_field (const std::string &id) const throw (unsupported_interface) |
Get the value of a field. | |
virtual void | do_process_event (const std::string &id, const field_value &value, double timestamp) throw (unsupported_interface, std::bad_cast, std::bad_alloc) |
Process an event. | |
virtual const field_value & | do_eventout (const std::string &id) const throw (unsupported_interface) |
Called by node::eventout to get an eventOut value. | |
virtual void | do_shutdown (double timestamp) throw () |
Called by node::shutdown. | |
Private Attributes | |
script_node_type | type |
Type object for the script_node instance. | |
sfbool | direct_output |
directOutput field. | |
sfbool | must_evaluate |
mustEvaluate field. | |
mfstring | url_ |
url exposedField. | |
field_value_map_t | field_value_map_ |
Maps user-defined field names to their values. | |
eventout_value_map_t | eventout_value_map_ |
Maps user-defined eventOut names to their values. | |
script * | script_ |
A pointer to a script object. | |
int | events_received |
A count of the number of events received since script_node::update was called. | |
Friends | |
class | script_node_type |
Type information object. |
|
Construct.
|
|
Add an eventIn.
|
|
Add an eventOut.
|
|
Add a field.
|
|
Special assignment function to take into account the fact that Script nodes can be self referential. "Undo" the refcounting appropriately: decrement the refcount on any self-references we acquire ownership of, and increment the refcount on any self-references for which ownership is relinquished.
|
|
Special assignment function to take into account the fact that Script nodes can be self referential. "Undo" the refcounting appropriately: decrement the refcount on any self-references we acquire ownership of, and increment the refcount on any self-references for which ownership is relinquished.
|
|
Create a script object.
|
|
Called by node::eventout to get an eventOut value.
Implements openvrml::node. |
|
Get the value of a field.
Implements openvrml::node. |
|
Set the value of one of the node's fields.
Implements openvrml::node. |
|
Initialize.
Reimplemented from openvrml::node. |
|
Process an event.
Implements openvrml::node. |
|
Called by node::shutdown.
Reimplemented from openvrml::node. |
|
Set the value of one of the node's eventOuts. This method is intended to be used by scripting language bindings to set the value of eventOuts in response to script code.
|
|
eventOut value map.
|
|
field value map.
|
|
Return a pointer to this script_node.
Reimplemented from openvrml::node. |
|
Return a pointer to this script_node.
Reimplemented from openvrml::node. |
|
Update the script_node for the current time.
|
|
url exposedField.
|
|
set_url eventIn handler.
|
|
Type object for the script_node instance. Script node node_types are significantly different from other node_types. While most node_types are shared by the node instances they spawn, the script_node_type is unique to a script_node instance, and it* shares the script_node's lifetime. This reflects the fact that Script nodes in VRML get their functionality by the addition of fields, eventIns, and eventOuts on a per-instance basis. For script_node instances, node::node_type is an alias for the script_node_type object. Reimplemented from openvrml::node. |