Open Inventor Reference
|
Basic controllable time source. More...
#include <Inventor/engines/SoElapsedTime.h>
Public Member Functions | |
SoElapsedTime () | |
Constructor. | |
Static Public Member Functions | |
static void | initClass () |
Initializes base engine class. | |
Public Attributes | |
SoEngineOutput | timeOut |
While the engine is on, it keeps track of 'clock' time. | |
Inputs | |
SoSFTime | timeIn |
Running time. | |
SoSFFloat | speed |
Scale factor for time. | |
SoSFBool | on |
TRUE to start running, FALSE to stop. | |
SoSFBool | pause |
TRUE to freeze, FALSE to continue running. | |
SoSFTrigger | reset |
Reset the base time. | |
Protected Member Functions | |
virtual void | inputChanged (SoField *whichInput) |
Detects when the running time input changed. | |
virtual void | writeInstance (SoOutput *out) |
Writes instance to SoOutput. | |
virtual SbBool | readInstance (SoInput *in, unsigned short flags) |
Reads stuff into instance. |
This engine functions as a stopwatch; it outputs the time that has elapsed since it started running. By default, the timeIn input is connected to the realTime global field. It can, however, be connected to any other time source.
The ouput from the engine is the time that has elapsed since it started running, or since the reset input was last triggered. You can affect the speed of the output time by setting the speed scale factor. A value greater than 1.0 will speed up the output, and a value less than 1.0 will slow it down.
If you pause the engine, by setting the pause input to TRUE, it stops updating the timeOut output. When you turn off the pause, it jumps to its current position without losing time. Alternatively, if you want to stop the engine for a while, and then restart it from where it left off, use the on input field.
Definition at line 109 of file SoElapsedTime.h.
SoElapsedTime::SoElapsedTime | ( | ) |
static void SoElapsedTime::initClass | ( | ) | [static] |
Reimplemented from SoEngine.
virtual void SoElapsedTime::inputChanged | ( | SoField * | whichInput | ) | [protected, virtual] |
Reimplemented from SoEngine.
virtual SbBool SoElapsedTime::readInstance | ( | SoInput * | in, |
unsigned short | flags | ||
) | [protected, virtual] |
Works around a problem with old files that contain explicit references to the default connection to realTime.
Reimplemented from SoEngine.
virtual void SoElapsedTime::writeInstance | ( | SoOutput * | out | ) | [protected, virtual] |
Takes care of not writing out connection to realTime that is created in constructor.
Reimplemented from SoEngine.
Definition at line 124 of file SoElapsedTime.h.
Definition at line 127 of file SoElapsedTime.h.
Definition at line 130 of file SoElapsedTime.h.
Definition at line 121 of file SoElapsedTime.h.
Definition at line 118 of file SoElapsedTime.h.
This is the amount of real time that passes multiplied by the speed. If the speed input varies while the engine is on, then 'clock' time advances non-uniformly.
Pausing the engine will freeze the timeOut value, but internally the 'clock' time will continue to advance. Unpause the engine and the timeOut will jump forward to display 'clock' time.
Stop the engine (by setting 'on' to FALSE) to freeze both the timeOut value and the 'clock' time. Re-start (by setting 'on' to TRUE) and both timeOut and 'clock' will continue from where they were at the time the engine was stopped.
Definition at line 149 of file SoElapsedTime.h.