H3D API
2.4.1
|
This abstract node type is the base node type from which all time-dependent nodes are derived. More...
#include <H3D/X3DTimeDependentNode.h>
Classes | |
class | StartTime |
The StartTime field is a specialization of the SFTime field so that the value cannot be changed when the isActive field of the X3DTimeDependentNode it resides in is true. More... | |
class | StopTime |
The StopTime field is a specialization of the SFTime field so that the value is ignored if the X3DTimeDependentNode is active and stopTime <= startTime as according to the X3D spec. More... | |
class | TimeHandler |
The TimeHandler field updates once per scene-graph loop to monitor the current time and updates the fields in the owner X3DTimeDependentNode if any state changes has to be made. More... | |
Public Member Functions | |
X3DTimeDependentNode (Inst< SFNode > _metadata=0, Inst< SFBool > _loop=0, Inst< SFTime > _pauseTime=0, Inst< SFTime > _resumeTime=0, Inst< StartTime > _startTime=0, Inst< StopTime > _stopTime=0, Inst< SFTime > _elapsedTime=0, Inst< SFBool > _isActive=0, Inst< SFBool > _isPaused=0, Inst< TimeHandler > _timeHandler=0) | |
Constructor. | |
virtual void | initialize () |
Activates the node if the conditions for a time node to be active from the start are met. More... | |
virtual void | onPause () |
This function will be called when the node is paused. | |
virtual void | onResume () |
This function will be called when the node is resumed after it has been in paused state. | |
virtual void | onStart () |
This function will be called when the time node is started. | |
virtual void | onStop () |
This function will be called when the time node is stopped. | |
![]() | |
X3DChildNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL) |
Returns a new instance of this node type with the same state as this one. More... | |
virtual | ~Node () |
Destructor. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More... | |
void | setProtoInstanceParent (X3DPrototypeInstance *p) |
Set the X3DPrototypeInstance this node is the the root node if applicaple. | |
virtual void | render () |
the render() function is used for the depth-first rendering traversal of the scene-graph. More... | |
virtual void | traverseSG (TraverseInfo &ti) |
traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More... | |
virtual bool | lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result) |
Detect intersection between a line segment and the Node. More... | |
virtual void | closestPoint (const Vec3f &p, NodeIntersectResult &result) |
Find closest point on Node to p. More... | |
virtual bool | movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result) |
Detect collision between a moving sphere and the Node. More... | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
virtual Field * | getField (const string &_name) const |
return a pointer to the field specified by name within this instance | |
int | addDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
int | removeDestructCallback (void(*func)(Node *, void *), void *args) |
Add a callback function to be run on destruction of node. More... | |
Public Attributes | |
H3DUniquePtr< SFBool > | loop |
If loop is TRUE at the end of a cycle, execution continues into the next cycle, otherwise it stops. More... | |
H3DUniquePtr< SFTime > | pauseTime |
A time at which to pause and stop generating events. More... | |
H3DUniquePtr< SFTime > | resumeTime |
A time at which to start generating events again after being paused. More... | |
H3DUniquePtr< StartTime > | startTime |
A time-dependent node is inactive until its startTime is reached. More... | |
H3DUniquePtr< StopTime > | stopTime |
An active time-dependent node will become inactive when stopTime is reached if stopTime > startTime. More... | |
H3DUniquePtr< SFTime > | elapsedTime |
The elapsedTime outputOnly field delivers the current elapsed time since the X3DTimeDependentNode was activated and running, cumulative in seconds and not counting any time while in a paused state. More... | |
H3DUniquePtr< SFBool > | isActive |
An isActive TRUE event is generated when the node becomes active and an isActive FALSE event is generated when it becomes inactive. More... | |
H3DUniquePtr< SFBool > | isPaused |
An isPaused TRUE event is generated when the node becomes paused and an isPaused FALSE event is generated when it is resumed. More... | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
static unsigned int | nrNodesAlive () |
Returns the nr of nodes currently alive, i.e. nodes created but not destructed. | |
static int | nrNodesCreated () |
Returns the number of nodes created in total since the start of the program. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
This abstract node type is the base node type from which all time-dependent nodes are derived.
|
virtual |
Activates the node if the conditions for a time node to be active from the start are met.
Reimplemented from H3DUtil::RefCountedClass.
References H3DUtil::RefCountedClass::initialize(), loop, startTime, and stopTime.
H3DUniquePtr< SFTime > H3D::X3DTimeDependentNode::elapsedTime |
The elapsedTime outputOnly field delivers the current elapsed time since the X3DTimeDependentNode was activated and running, cumulative in seconds and not counting any time while in a paused state.
Access type: outputOnly
Referenced by H3D::TimeSensor::TimeHandler::activate(), H3D::X3DTimeDependentNode::TimeHandler::activate(), H3D::X3DTimeDependentNode::TimeHandler::update(), and X3DTimeDependentNode().
H3DUniquePtr< SFBool > H3D::X3DTimeDependentNode::isActive |
An isActive TRUE event is generated when the node becomes active and an isActive FALSE event is generated when it becomes inactive.
These are the only times at which an isActive event is generated. In particular, isActive events are not sent at each tick of a simulation.
Access type: outputOnly
Referenced by H3D::X3DTimeDependentNode::TimeHandler::activate(), H3D::X3DTimeDependentNode::TimeHandler::deactivate(), H3D::X3DTimeDependentNode::StartTime::propagateEvent(), H3D::X3DTimeDependentNode::StartTime::setValue(), H3D::SimpleAudioClip::SimpleAudioClip(), H3D::TimeSensor::TimeHandler::update(), H3D::X3DSoundSourceNode::TimeHandler::update(), H3D::X3DTimeDependentNode::TimeHandler::update(), H3D::X3DTimeDependentNode::StopTime::update(), and X3DTimeDependentNode().
H3DUniquePtr< SFBool > H3D::X3DTimeDependentNode::isPaused |
An isPaused TRUE event is generated when the node becomes paused and an isPaused FALSE event is generated when it is resumed.
Access type: outputOnly
Referenced by H3D::X3DTimeDependentNode::TimeHandler::activate(), H3D::TimeSensor::TimeHandler::update(), H3D::X3DSoundSourceNode::TimeHandler::update(), H3D::X3DTimeDependentNode::TimeHandler::update(), and X3DTimeDependentNode().
H3DUniquePtr< SFBool > H3D::X3DTimeDependentNode::loop |
If loop is TRUE at the end of a cycle, execution continues into the next cycle, otherwise it stops.
Access type: inputOutput
Default value: FALSE
Referenced by H3D::X3DSoundSourceNode::initALBuffers(), initialize(), H3D::X3DSoundSourceNode::registerSoundNode(), H3D::TimeSensor::TimeHandler::update(), H3D::X3DSoundSourceNode::X3DSoundSourceNode(), and X3DTimeDependentNode().
H3DUniquePtr< SFTime > H3D::X3DTimeDependentNode::pauseTime |
A time at which to pause and stop generating events.
While an active time-dependent node is paused, it generates a TRUE isPaused event and ceases to generate all other output events, while maintaining (or "freezing") its state (holding the last output values and the clock's internal time when the pausing conditions are met).
Access type: inputOutput
Default value: 0
Referenced by H3D::X3DTimeDependentNode::TimeHandler::activate(), H3D::X3DTimeDependentNode::TimeHandler::update(), and X3DTimeDependentNode().
H3DUniquePtr< SFTime > H3D::X3DTimeDependentNode::resumeTime |
A time at which to start generating events again after being paused.
Access type: inputOutput
Default value: 0
Referenced by H3D::X3DTimeDependentNode::TimeHandler::activate(), H3D::X3DTimeDependentNode::TimeHandler::update(), and X3DTimeDependentNode().
H3DUniquePtr< StartTime > H3D::X3DTimeDependentNode::startTime |
A time-dependent node is inactive until its startTime is reached.
When current time becomes greater than or equal to startTime, an isActive TRUE event is generated and the time-dependent node becomes active.
Access type: inputOutput
Default value: 0
Referenced by H3D::TimeSensor::TimeHandler::activate(), H3D::X3DTimeDependentNode::TimeHandler::activate(), initialize(), H3D::TimeSensor::TimeHandler::update(), H3D::X3DTimeDependentNode::TimeHandler::update(), and X3DTimeDependentNode().
H3DUniquePtr< StopTime > H3D::X3DTimeDependentNode::stopTime |
An active time-dependent node will become inactive when stopTime is reached if stopTime > startTime.
The value of stopTime is ignored if stopTime = startTime.
Access type: inputOutput
Default value: 0
Referenced by initialize(), H3D::TimeSensor::TimeHandler::update(), H3D::X3DTimeDependentNode::TimeHandler::update(), and X3DTimeDependentNode().