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

SoTimeCounter — timed integer counter

Description

       This  engine  is a counter that outputs numbers, starting at a minimum value, increasing by a step value,
       and ending with a number that does not exceed the maximum value. When the maximum number is  reached,  it
       starts counting from the beginning again.

       The difference between this engine and the SoCounter engine, is that this engine also has a timeIn input,
       which  allows  the  counting  cycles to be timed. This engine counts automatically over time; it does not
       need to be triggered to go to the next step. By default, the timeIn input is connected  to  the  realTime
       global field. It can, however, be connected to any time source.

       The  frequency  input  field controls how many min-to-max cycles are performed per second. For example, a
       frequency value of 0.5 means that it will take 2 seconds to complete a single min-to-max cycle.

       The steps in the count cycle do not necessarily all have the same duration. Using the duty  input  field,
       you can arbitrarily split the time period of the count cycle between the steps. For example, if there are
       5  steps in the cycle, a duty input of (1., 2., 2., 2., 1.) will make the second, third, and fourth steps
       take twice as long as the first and last steps.

       At any time the counter can be reset to a specific value. If you set the reset input field  to  a  value,
       the  engine  will continue counting from there. Note that the counter will always output numbers based on
       the min, max and step values, and setting the reset value does not affect the those input fields. If  the
       reset value is not a legal counter value, the counter will still behave as though it is:

          If reset is greater than max, the counter is set to max.
          If reset is less than min, the counter is set to min.
          If reset is between step values, the counter is set to the lower step.

     Each  time  a  counting  cycle  is  started,  the  syncOut  output is triggered. This output can be used to
     synchronize some other event with the counting cycle. Other events can  also  synchronize  the  counter  by
     triggering the syncIn input.

     You  can  pause  the  engine, by setting the on input to FALSE, and it will stop updating the output field.
     When you turn off the pause, by setting on to TRUE, it will start counting again from where it left off.

File Format/Defaults

TimeCounter{min0max1step1onTRUEfrequency1duty1timeIn<currenttime>syncInreset0}

Inherits From

       SoBase > SoFieldContainer > SoEngine > SoTimeCounter

Inputs

SoSFTimetimeIn
          Running time.

     SoSFShortmin
          Minimum value for the counter.

     SoSFShortmax
          Maximum value for the counter.

     SoSFShortstep
          Counter step value.

     SoSFBoolon
          Counter pauses if this is set to FALSE.

     SoSFFloatfrequency
          Number of min-to-max cycles per second.

     SoMFFloatduty
          Duty cycle values.

     SoSFShortreset
          Reset the counter to the specified value.

     SoSFTriggersyncIn
          Restart at the beginning of the cycle.

Methods

SoTimeCounter()
          Constructor

Name

       SoTimeCounter — timed integer counter

Outputs

(SoSFShort)output
          Counts min-to-max, in step increments.

     (SoSFTrigger)syncOut
          Triggers at cycle start.

See Also

SoCounter,SoElapsedTime,SoEngineOutputSoTimeCounter(3IV)()

Synopsis

#include<Inventor/engines/SoTimeCounter.h>

          Inputs from class SoTimeCounter:

     SoSFTimetimeInSoSFShortminSoSFShortmaxSoSFShortstepSoSFBoolonSoSFFloatfrequencySoMFFloatdutySoSFShortresetSoSFTriggersyncIn

          Outputs from class SoTimeCounter:

     (SoSFShort)output(SoSFTrigger)syncOut

          Methods from class SoTimeCounter:

                         SoTimeCounter()

          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