Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

openvrml::vrml97_node::time_sensor_node Class Reference

TimeSensor node instances. More...

Inheritance diagram for openvrml::vrml97_node::time_sensor_node:

Inheritance graph
[legend]
Collaboration diagram for openvrml::vrml97_node::time_sensor_node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 time_sensor_node (const node_type &type, const scope_ptr &scope)
 Construct.

virtual ~time_sensor_node () throw ()
 Destroy.

virtual time_sensor_nodeto_time_sensor () const
 Cast to a time_sensor_node.

void update (double time)

Private Member Functions

virtual void do_initialize (double timestamp) throw (std::bad_alloc)
 Initialize.

virtual void do_shutdown (double timestamp) throw ()
 Shut down.

void process_set_cycleInterval (const field_value &value, double timestamp) throw (std::bad_cast)
 set_cycleInterval eventIn handler.

void process_set_enabled (const field_value &value, double timestamp) throw (std::bad_cast)
 set_enabled eventIn handler.

void process_set_loop (const field_value &value, double timestamp) throw (std::bad_cast)
 set_loop eventIn handler.

void process_set_startTime (const field_value &value, double timestamp) throw (std::bad_cast)
 set_startTime eventIn handler.

void process_set_stopTime (const field_value &value, double timestamp) throw (std::bad_cast)
 set_stopTime eventIn handler.


Private Attributes

sftime cycleInterval
 cycleInterval exposedField.

sfbool enabled
 enabled exposedField.

sfbool loop
 loop exposedField.

sftime startTime
 startTime exposedField.

sftime stopTime
 stopTime exposedField.

sftime cycleTime
 cycleTime eventOut.

sffloat fraction
 fraction_changed eventOut.

sfbool active
 isActive eventOut.

sftime time
 time eventOut.

double lastTime
 The timestamp previously received.


Friends

class time_sensor_class
 Class object for TimeSensor instances.


Detailed Description

TimeSensor node instances.


Constructor & Destructor Documentation

openvrml::vrml97_node::time_sensor_node::time_sensor_node const node_type type,
const scope_ptr scope
 

Construct.

Parameters:
type the node_type associated with the instance.
scope the scope that the new node will belong to.

Member Function Documentation

void openvrml::vrml97_node::time_sensor_node::do_initialize double  timestamp  )  throw (std::bad_alloc) [private, virtual]
 

Initialize.

Parameters:
timestamp the current time.
Exceptions:
std::bad_alloc if memory allocation fails.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::time_sensor_node::do_shutdown double  timestamp  )  throw () [private, virtual]
 

Shut down.

Parameters:
timestamp the current time.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::time_sensor_node::process_set_cycleInterval const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_cycleInterval eventIn handler.

Parameters:
value an sftime value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sftime.

void openvrml::vrml97_node::time_sensor_node::process_set_enabled const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_enabled eventIn handler.

Parameters:
value an sfbool value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfbool.

void openvrml::vrml97_node::time_sensor_node::process_set_loop const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_loop eventIn handler.

Parameters:
value an sfbool value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sfbool.

void openvrml::vrml97_node::time_sensor_node::process_set_startTime const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_startTime eventIn handler.

Parameters:
value an sftime value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sftime.

void openvrml::vrml97_node::time_sensor_node::process_set_stopTime const field_value value,
double  timestamp
throw (std::bad_cast) [private]
 

set_stopTime eventIn handler.

Parameters:
value an sftime value.
timestamp the current time.
Exceptions:
std::bad_cast if value is not an sftime.

time_sensor_node * openvrml::vrml97_node::time_sensor_node::to_time_sensor  )  const [virtual]
 

Cast to a time_sensor_node.

Returns:
a pointer to the object.

Reimplemented from openvrml::node.

void openvrml::vrml97_node::time_sensor_node::update double  time  ) 
 

Generate timer events. If necessary, events prior to the timestamp (inTime) are generated to respect stopTimes and cycleIntervals. The timestamp should never be increased. This assumes the event loop delivers pending events in order (ascending time stamps). Should inTime be modified? Should ensure continuous events are delivered before discrete ones (such as cycleTime, isActive).