logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SoOneShot — timer that runs for a pre-set amount of time

Description

       This  engine  is  a  timer  that runs for a pre-set amount of time and then stops. By default, the timeIn
       input is connected to the realTime global field. It can, however, by connected to any other time source.

       The timer is started when the trigger input is touched. It then runs  for  the  specified  duration,  and
       updates  the  timeOut  output  with  the time that has elapsed. During that time, the ramp output is also
       updated. The ramp output starts at 0.0 at the beginning of the cycle, and  linearly  increases  until  it
       reaches 1.0 at the end of the cycle.

       You  can  disable  the timer by setting the disable input to TRUE. The output value remains 0.0 while the
       timer is disabled. If the timer is disabled in the middle of a cycle the output values  will  be  set  to
       0.0.

       The  flags input contains control flags. Using the flags you can set the timer to be retriggerable in the
       middle of a cycle, and set the output values to stay high after the cycle has been completed. By default,
       these flags are not set.

File Format/Defaults

OneShot{duration1triggerflags()disableFALSEtimeIn<currenttime>}

Inherits From

       SoBase > SoFieldContainer > SoEngine > SoOneShot

Inputs

SoSFTimetimeIn
          Running time.

     SoSFTimeduration
          Duration of the active cycle.

     SoSFTriggertrigger
          Start the cycle. The trigger will be ignored if it is touched  in  the  middle  of  a  cycle  and  the
          RETRIGGERABLE flag is not set.

     SoSFBitMaskflags
          Control flags.

     SoSFBooldisable
          If TRUE, the timer is disabled.

Methods

SoOneShot()
          Constructor

Name

       SoOneShot — timer that runs for a pre-set amount of time

Outputs

(SoSFTime)timeOut
          Elapsed time from the start.

     (SoSFBool)isActive
          Is TRUE during the active cycle.

     (SoSFFloat)ramp
          Ramps linearly from 0.0 to 1.0.

See Also

SoElapsedTime,SoEngineOutputSoOneShot(3IV)()

Synopsis

#include<Inventor/engines/SoOneShot.h>enumFlags{SoOneShot::RETRIGGERABLE  Can start over during the cycle
          SoOneShot::HOLD_FINAL     Output values stay high after cycle
     }

          Inputs from class SoOneShot:

     SoSFTimetimeInSoSFTimedurationSoSFTriggertriggerSoSFBitMaskflagsSoSFBooldisable

          Outputs from class SoOneShot:

     (SoSFTime)timeOut(SoSFBool)isActive(SoSFFloat)ramp

          Methods from class SoOneShot:

                         SoOneShot()

          Methods from class SoEngine:

     staticSoTypegetClassTypeId()virtualintgetOutputs(SoEngineOutputList&list)constSoEngineOutput*getOutput(constSbName&outputName)constSbBoolgetOutputName(constSoEngineOutput*output,SbName&outputName)constSoEngine*copy()conststaticSoEngine*getByName(constSbName&name)staticintgetByName(constSbName&name,SoEngineList&list)

          Methods from class SoFieldContainer:

     voidsetToDefaults()SbBoolhasDefaultValues()constSbBoolfieldsAreEqual(constSoFieldContainer*fc)constvoidcopyFieldValues(constSoFieldContainer*fc,SbBoolcopyConnections=FALSE)SbBoolset(constchar*fieldDataString)voidget(SbString&fieldDataString)virtualintgetFields(SoFieldList&resultList)constvirtualSoField*getField(constSbName&fieldName)constSbBoolgetFieldName(constSoField*field,SbName&fieldName)constSbBoolisNotifyEnabled()constSbBoolenableNotify(SbBoolflag)

          Methods from class SoBase:

     voidref()voidunref()constvoidunrefNoDelete()constvoidtouch()virtualSoTypegetTypeId()constSbBoolisOfType(SoTypetype)constvirtualvoidsetName(constSbName&name)virtualSbNamegetName()const

See Also