SOCOUNTER(3iv)

πŸ’– SoCounter β€” triggered integer counter πŸ’–

okay bestie, welcome to the SoCounter(3IV) page, section 3 of the IV manuals, and no you're not dreaming, this is genuinely one of the cutest little engines in the whole Inventor situation. it counts. it goes up. it loops. it's giving ✨clockwork fairy✨. let's get into it 🫢


🌸 INHERITS FROM 🌸

SoBase > SoFieldContainer > SoEngine > SoCounter

so yes, she has ancestors. she's got the whole family tree behind her. main character lineage fr fr πŸ‘‘


✨ SYNOPSIS ✨

#include <Inventor/engines/SoCounter.h>

πŸŽ€ Inputs from class SoCounter:

SoSFShort           min
SoSFShort           max
SoSFShort           step
SoSFTrigger         trigger
SoSFShort           reset

πŸŽ€ Outputs from class SoCounter:

(SoSFShort)         output
(SoSFTrigger)       syncOut

πŸŽ€ Methods from class SoCounter:

                    SoCounter()

πŸŽ€ 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 πŸ¦‹

so what even is this. it's an engine that spits out numbers β€” literally just a counter. it starts at a minimum value, goes up by a step value, and stops before it would exceed the maximum value. every time the trigger input gets touched, it outputs the next number. and the moment it hits the maximum? it loops all the way back to the beginning and starts over. iconic circular behavior, honestly. πŸ”

at any point you can reset the counter to a specific value by setting the reset input field to that value. then, the next time the counter gets triggered, it starts counting from there. important though β€” the counter will always output numbers based on the min, max and step values, and setting the reset value does not change those input fields. no cap. and if the reset value isn't a legal counter value? the counter still acts like it is. she's unbothered. πŸ’…

  • 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 starts, the syncOut output gets triggered. use it to synchronize some other event with the counting cycle. it's giving "we move as one" 🫢✨


πŸ’œ INPUTS πŸ’œ

  • SoSFShort min β€” the minimum value for the counter. the floor. the ground level. she will not go below it bestie.
  • SoSFShort max β€” the maximum value for the counter. the ceiling. the moment she hits it, she loops back around.
  • SoSFShort step β€” the counter step value. how big of a jump she takes every single time.
  • SoSFTrigger trigger β€” go to the next step. that's it. that's the whole job. touch her and she moves. ⚑
  • SoSFShort reset β€” at the next trigger, reset the counter to the specified value. so like, a little redirect before the next count. 🎯

🌈 OUTPUTS 🌈

  • (SoSFShort) output β€” counts min-to-max in step increments. this is the number you came here for. πŸ’–
  • (SoSFTrigger) syncOut β€” triggers at cycle start. perfect for syncing other stuff up with the counting cycle, iykyk.

πŸ‘‘ METHODS πŸ‘‘

  • SoCounter() β€” constructor. the birth of a counter. tiny. fresh. ready to count. 🐣

πŸ“ FILE FORMAT/DEFAULTS πŸ“

Counter {
   min      0
   max      1
   step     1
   trigger
   reset    0
}
lowkey just copy this vibe and you're set. defaults are defaults, don't come for me. πŸ™ˆ

⭐ SEE ALSO ⭐

SoTimeCounter, SoEngineOutput

go read those too, bestie, they're the extended universe. 🧚


and that's the whole page!! this was the SoCounter(3IV)() manual, version/date footer and all, and honestly? she ate. slay. periodt. πŸ’…βœ¨πŸŽ€