Click or drag to resize
SoVRMLTimeSensor Class

Note: This API is now obsolete.

Generates events as time passes.

Inheritance Hierarchy

Namespace: OIV.Inventor.VRMLnodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 9.9.36.0 (9.9.36.0)
Syntax
[ObsoleteAttribute("See documentation for more details")]
[EditorBrowsableAttribute(EditorBrowsableState.Never)]
public class SoVRMLTimeSensor : SoVRMLInterpolator

The SoVRMLTimeSensor type exposes the following members.

Constructors
  NameDescription
Public methodSoVRMLTimeSensor

Constructor.

Top
Methods
  NameDescription
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodCallback
(Inherited from SoNode.)
Public methodCopy

Creates and returns a copy of the VRML interpolator.

(Inherited from SoVRMLInterpolator.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
(Inherited from SoNode.)
Public methodStatic memberEnableEvents

Enables/disables events for all SoVRMLTimeSensor objects.

Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodEvaluateWrapper

Wrapper for the user's evaluate() interpolator.

(Inherited from SoVRMLInterpolator.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
(Inherited from SoNode.)
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetOutput

Returns the VRML interpolator output with the given name.

(Inherited from SoVRMLInterpolator.)
Public methodGetOutputName

Returns (in outputName ) the name of the given output.

(Inherited from SoVRMLInterpolator.)
Public methodGetOutputs

Returns a list of outputs in this VRML interpolator.

(Inherited from SoVRMLInterpolator.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
(Inherited from SoVRMLNode.)
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsBoundingBoxIgnoring

This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored.

(Inherited from SoNode.)
Public methodStatic memberIsEventsEnabled

Queries if events are enabled for all objects of this class.

Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override flag.

(Inherited from SoNode.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodPick
(Inherited from SoNode.)
Public methodRayPick
(Inherited from SoNode.)
Public methodSearch
(Inherited from SoNode.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Turns the override flag on or off.

(Inherited from SoNode.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Top
Properties
  NameDescription
Public propertycycleInterval

Time for each cycle in seconds.

Public propertyenabled

Enables (true) or disables (false) the sensor.

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyloop

Specifies whether a cycle should be repeated (true) or terminated (false) at the end of the cycle.

Public propertymetadata

Specifies the metadata node.

(Inherited from SoVRMLNode.)
Public propertypauseTime

(Note: Not implemented) Pause time.

Public propertyresumeTime

(Note: Not implemented) Resume time.

Public propertystartTime

Starting time of the cycle.

Public propertystopTime

Stop time of the cycle.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

SoVRMLTimeSensors generate events as time passes. SoVRMLTimeSensors can be used to drive continuous simulations and animations, periodic activities (e.g., one per minute), and/or single occurrence events such as an alarm clock.

<font color="#0000FF">NOTE:</font> This class does not exist in Open Inventor 10.0 and later.

VRML97 SPECIFICATION

This section describes the expected behavior of the node in a conforming VRML97 browser application. In some cases, the application is responsible for implementing portions of the expected behavior. Open Inventor viewer classes and IVF classes implement some of the application behaviors.

This section may reference portions of the VRML97 specification that are not present in this help file. The complete VRML97 spec is available at http://www.web3d.org.

SoVRMLTimeSensors generate events as time passes. SoVRMLTimeSensors can be used to drive continuous simulations and animations, periodic activities (e.g., one per minute), and/or single occurrence events such as an alarm clock. SoVRMLTimeSensor discrete eventOuts include: isActive , which becomes true when the SoVRMLTimeSensor begins running, and false when it stops running, and cycleTime , a time event at startTime and at the beginning of each new cycle (useful for synchronization with other time-based objects). The remaining outputs generate continuous events and consist of fraction_changed , which is an SFFloat in the closed interval [0,1] representing the completed fraction of the current cycle, and time , an SFTime event specifying the absolute time for a given simulation tick.

If the enabled exposedField is true, the SoVRMLTimeSensor is enabled and may be running. If a set_enabled false event is received while the SoVRMLTimeSensor is running, then the sensor should evaluate and send all relevant outputs, send a false value for isActive, and disable itself. However, events on the exposedFields of the SoVRMLTimeSensor (such as set_startTime) are processed and their corresponding eventOuts ( startTime_changed) are sent regardless of the state of enabled. The remaining discussion assumes enabled is true.

The loop, startTime, and stopTime exposedFields, and the isActive eventOut and their affects on the SoVRMLTimeSensor node, are discussed in detail in the "Concepts - Time Dependent Nodes" section. The "cycle" of an SoVRMLTimeSensor lasts for cycleInterval seconds. The value of cycleInterval must be greater than 0 (a value less than or equal to 0 produces undefined results). Because the SoVRMLTimeSensor is more complex than the abstract SoVRMLTimeDep node and generates continuous eventOuts, some of the information in the "Time Dependent Nodes" section is repeated here.

A cycleTime eventOut can be used for synchronization purposes, e.g., sound with animation. The value of a cycleTime eventOut will be equal to the time at the beginning of the current cycle. A cycleTime eventOut is generated at the beginning of every cycle, including the cycle starting at startTime. The first cycleTime eventOut for an SoVRMLTimeSensor node can be used as an alarm (single pulse at a specified time).

When an SoVRMLTimeSensor becomes active it will generate an isActive = true event and begin generating time , fraction_changed, and cycleTime events, which may be routed to other nodes to drive animation or simulated behaviors - (see below for behavior at read time). The time event outputs the absolute time for a given tick of the SoVRMLTimeSensor (time fields and events represent the number of seconds since midnight GMT January 1, 1970). fraction_changed events output a floating point value in the closed interval [0, 1], where 0 corresponds to startTime and 1 corresponds to startTime + N*cycleInterval, where N = 1, 2, ... . That is, the time and fraction_changed eventOuts can be computed as:

   time = now
  f = fmod(now - startTime, cycleInterval)
  if (f == 0.0 && now > startTime)
  fraction_changed = 1.0
  else
  fraction_changed = f / cycleInterval
A SoVRMLTimeSensor can be set up to be active at read time by specifying loop true (not the default) and stopTime <= startTime (satisfied by the default values). The time events output absolute times for each tick of the SoVRMLTimeSensor times must start at startTime and end with either startTime+cycleInterval, stopTime, or loop forever depending on the values of the other fields. An active SoVRMLTimeSensor must stop at the first simulation tick when time now >= stopTime > startTime.

No guarantees are made with respect to how often an SoVRMLTimeSensor will generate time events, but an SoVRMLTimeSensor should generate events at least at every simulation tick. SoVRMLTimeSensors are guaranteed to generate final time and fraction_changed events. If loop is false, the final time event will be generated with a value of (startTime+cycleInterval) or stopTime (if stopTime > startTime), whichever value is less. If loop is true at the completion of every cycle, then the final event will be generated as evaluated at stopTime (if stopTime > startTime) or never.

An active SoVRMLTimeSensor ignores set_cycleInterval , and set_startTime events. An active SoVRMLTimeSensor also ignores set_stopTime events for set_stopTime < startTime. For example, if a set_startTime event is received while an SoVRMLTimeSensor is active, then that set_startTime event is ignored (the startTime field is not changed, and a startTime_changed eventOut is not generated). If an active SoVRMLTimeSensor receives a set_stopTime event that is less than now and greater than or equal to startTime, it behaves as if the stopTime requested is now and sends the final events based on now (note that stopTime is set as specified in the eventIn).

FILE FORMAT/DEFAULT

VRMLTimeSensor {
cycleInterval 1
enabled true
loop false
pauseTime 0
resumeTime 0
startTime 0
stopTime 0
metadata NULL
}

EVENTS

eventIn

SoSFTimeset_cycleInterval
SoSFBoolset_enabled
SoSFBoolset_loop
SoSFTimeset_pauseTime (Note: Not implemented)
SoSFTimeset_resumeTime (Note: Not implemented)
SoSFTimeset_startTime
SoSFTimeset_stopTime
SoSFNodeset_metadata

eventOut

SoSFTimecycleTime
SoSFFloatfraction_changed
SoSFBoolisActive
SoSFBoolisPaused (Note: Not implemented)
SoSFTimetime
SoSFTimecycleInterval_changed
SoSFBoolenabled_changed
SoSFBoolloop_changed
SoSFTimepauseTime_changed (Note: Not implemented)
SoSFTimeresumeTime_changed (Note: Not implemented)
SoSFTimestartTime_changed
SoSFTimestopTime_changed
SoSFTimeelapsedTime
SoSFNodemetadata_changed
Obsoletesince Open Inventor 9500 The VRML API is no longer supported. See section http://oivdoc95.vsg3d.com/content/compatibility-notes-4#Deprecation of the Reference Manual.

See Also