SOTIMECOUNTER(3iv)

πŸ’– SoTimeCounter β€” timed integer counter πŸ’–

okay bestie, welcome to SoTimeCounter(3IV) β€” yes she's a section 3IV manpage, yes she's iconic, and yes we're gonna get through this together. grab a boba, we're counting πŸ’…


🌸 INHERITS FROM 🌸

SoBase > SoFieldContainer > SoEngine > SoTimeCounter

like... look at that family tree. she gets it from her ancestors, fr fr.


✨ SYNOPSIS ✨

#include <Inventor/engines/SoTimeCounter.h>

πŸŽ€ Inputs from class SoTimeCounter

SoSFTime            timeIn
SoSFShort           min
SoSFShort           max
SoSFShort           step
SoSFBool            on
SoSFFloat           frequency
SoMFFloat           duty
SoSFShort           reset
SoSFTrigger         syncIn

πŸ¦‹ Outputs from class SoTimeCounter

(SoSFShort)         output
(SoSFTrigger)       syncOut

🌈 Methods from class SoTimeCounter

                    SoTimeCounter()

πŸ’œ Methods from class SoEngine

static SoType       getClassTypeId()
virtual int         getOutputs(SoEngineOutputList &list) const
SoEngineOutput *    getOutput(const SbName &outputName) const
SbBool              getOutputName(const SoEngineOutput *output, SbName
                         &outputName) const
SoEngine *          copy() const
static SoEngine *   getByName(const SbName &name)
static int          getByName(const SbName &name, SoEngineList &list)

πŸ“ Methods from class SoFieldContainer

void                setToDefaults()
SbBool              hasDefaultValues() const
SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
void                copyFieldValues(const SoFieldContainer *fc, SbBool
                         copyConnections = FALSE)
SbBool              set(const char *fieldDataString)
void                get(SbString &fieldDataString)
virtual int         getFields(SoFieldList &resultList) const
virtual SoField *   getField(const SbName &fieldName) const
SbBool              getFieldName(const SoField *field, SbName &fieldName)
                         const
SbBool              isNotifyEnabled() const
SbBool              enableNotify(SbBool flag)

🧚 Methods from class SoBase

void                ref()
void                unref() const
void                unrefNoDelete() const
void                touch()
virtual SoType      getTypeId() const
SbBool              isOfType(SoType type) const
virtual void        setName(const SbName &name)
virtual SbName      getName() const

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so picture this: this engine is literally just a counter. it outputs numbers, starting at a minimum value, going up by a step value, and stopping at a number that does not exceed the maximum value. the moment it hits max? it starts all the way over from the beginning. periodt.

now here's the tea β€” the difference between this engine and the SoCounter engine is that this one has a timeIn input, which lets the counting cycles 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. but bestie, it can be connected to any time source you want. main character energy: flexible.

the frequency input field controls how many min-to-max cycles are performed per second. for example, a frequency value of 0.5 means it will take 2 seconds to complete a single min-to-max cycle. math ate, ngl.

and 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. she said "not all steps are equal" and honestly? slay.

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 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. it's giving collaboration ✨

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. nap time over, back to work πŸ’…


🫢 INPUTS 🫢

  • SoSFTime timeIn β€” running time. the clock that keeps everything moving, iykyk.
  • SoSFShort min β€” minimum value for the counter. the floor, the starting line, the bottom.
  • SoSFShort max β€” maximum value for the counter. the ceiling, the finish line, the top.
  • SoSFShort step β€” counter step value. how big each lil hop is.
  • SoSFBool on β€” counter pauses if this is set to FALSE. set it back to TRUE and she's awake again.
  • SoSFFloat frequency β€” number of min-to-max cycles per second. how fast the whole loop goes around.
  • SoMFFloat duty β€” duty cycle values. the vibes-per-step breakdown.
  • SoSFShort reset β€” reset the counter to the specified value. snap back to a chosen number.
  • SoSFTrigger syncIn β€” restart at the beginning of the cycle. do it again, but from the top.

⭐ OUTPUTS ⭐

  • (SoSFShort) output β€” counts min-to-max, in step increments. the actual number, bestie.
  • (SoSFTrigger) syncOut β€” triggers at cycle start. the "we're so back" signal.

πŸŽ€ METHODS πŸŽ€

  • SoTimeCounter() β€” constructor. she's born ✨

πŸ’œ FILE FORMAT/DEFAULTS πŸ’œ

TimeCounter {
   min        0
   max        1
   step       1
   on         TRUE
   frequency  1
   duty       1
   timeIn     <current time>
   syncIn
   reset      0
}

look at those defaults. min 0, max 1, step 1, on TRUE, frequency 1, duty 1, timeIn <current time>, syncIn, reset 0. immaculate. no notes. 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

SoCounter, SoElapsedTime, SoEngineOutput

go read those too, bestie, they're in the group chat.


lowkey obsessed with you for reading all the way down here. that's real.

this has been SoTimeCounter(3IV)() β€” yeah that's the source and version tag and honestly she's serving it πŸ’… β€” signing off, stay counting, stay cunty, no cap πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ‘‘