SoCounter — triggered integer counter
Contents
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. It outputs the next number whenever the
trigger input is touched. When the maximum number is reached, it starts counting from the beginning
again.
At any time the counter can be reset to a specific value by setting the reset input field to that value.
The next time the counter is triggered it will start 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
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 steps, the counter is set to the lower step value.
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.
File Format/Defaults
Counter{min0max1step1triggerreset0}Inherits From
SoBase > SoFieldContainer > SoEngine > SoCounter
Inputs
SoSFShortmin
Minimum value for the counter.
SoSFShortmax
Maximum value for the counter.
SoSFShortstep
Counter step value.
SoSFTriggertrigger
Go to the next step.
SoSFShortreset
At the next trigger, reset the counter to the specified value.
Methods
SoCounter()
Constructor
Name
SoCounter — triggered integer counter
Outputs
(SoSFShort)output
Counts min-to-max in step increments.
(SoSFTrigger)syncOut
Triggers at cycle start.
See Also
SoTimeCounter,SoEngineOutputSoCounter(3IV)()
Synopsis
#include<Inventor/engines/SoCounter.h>
Inputs from class SoCounter:
SoSFShortminSoSFShortmaxSoSFShortstepSoSFTriggertriggerSoSFShortreset
Outputs from class SoCounter:
(SoSFShort)output(SoSFTrigger)syncOut
Methods from class SoCounter:
SoCounter()
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