Open Inventor Reference
SoCounter Class Reference

Triggered integer counter. More...

#include <Inventor/engines/SoCounter.h>

Inheritance diagram for SoCounter:
SoEngine SoFieldContainer SoBase

List of all members.

Public Member Functions

 SoCounter ()
 Constructor.

Static Public Member Functions

static void initClass ()
 Initializes base engine class.

Public Attributes

Inputs
SoSFShort min
 Minimum value for the counter.
SoSFShort max
 Maximum value for the counter.
SoSFShort step
 Counter step value.
SoSFTrigger trigger
 Go to the next step.
SoSFShort reset
 At the next trigger, reset the counter to the specified value.
Outputs
SoEngineOutput output
 Counts min-to-max in step increments.
SoEngineOutput syncOut
 Triggers at cycle start.

Protected Member Functions

virtual void inputChanged (SoField *whichInput)
 This is called whenever the value of an input is changed.

Detailed 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/Default
Counter {
  min 0
  max 1
  step 1
  reset 0
}
See Also
SoTimeCounter, SoEngineOutput

Definition at line 114 of file SoCounter.h.


Constructor & Destructor Documentation

SoCounter::SoCounter ( )

Member Function Documentation

static void SoCounter::initClass ( ) [static]

Reimplemented from SoEngine.

virtual void SoCounter::inputChanged ( SoField whichField) [protected, virtual]

The default method does nothing. Subclasses can override this to detect when a specific field is changed.

Reimplemented from SoEngine.


Member Data Documentation

Definition at line 126 of file SoCounter.h.

Definition at line 123 of file SoCounter.h.

Definition at line 143 of file SoCounter.h.

Definition at line 135 of file SoCounter.h.

Definition at line 129 of file SoCounter.h.

Definition at line 146 of file SoCounter.h.

Definition at line 132 of file SoCounter.h.


The documentation for this class was generated from the following file: