1SoTimeCounter(3IV)() SoTimeCounter(3IV)()
2
3
4
6 SoTimeCounter — timed integer counter
7
9 SoBase > SoFieldContainer > SoEngine > SoTimeCounter
10
12 #include <Inventor/engines/SoTimeCounter.h>
13
14 Inputs from class SoTimeCounter:
15
16 SoSFTime timeIn
17 SoSFShort min
18 SoSFShort max
19 SoSFShort step
20 SoSFBool on
21 SoSFFloat frequency
22 SoMFFloat duty
23 SoSFShort reset
24 SoSFTrigger syncIn
25
26 Outputs from class SoTimeCounter:
27
28 (SoSFShort) output
29 (SoSFTrigger) syncOut
30
31 Methods from class SoTimeCounter:
32
33 SoTimeCounter()
34
35 Methods from class SoEngine:
36
37 static SoType getClassTypeId()
38 virtual int getOutputs(SoEngineOutputList &list) const
39 SoEngineOutput * getOutput(const SbName &outputName) const
40 SbBool getOutputName(const SoEngineOutput *output, SbName
41 &outputName) const
42 SoEngine * copy() const
43 static SoEngine * getByName(const SbName &name)
44 static int getByName(const SbName &name, SoEngineList &list)
45
46 Methods from class SoFieldContainer:
47
48 void setToDefaults()
49 SbBool hasDefaultValues() const
50 SbBool fieldsAreEqual(const SoFieldContainer *fc) const
51 void copyFieldValues(const SoFieldContainer *fc, SbBool
52 copyConnections = FALSE)
53 SbBool set(const char *fieldDataString)
54 void get(SbString &fieldDataString)
55 virtual int getFields(SoFieldList &resultList) const
56 virtual SoField * getField(const SbName &fieldName) const
57 SbBool getFieldName(const SoField *field, SbName &fieldName)
58 const
59 SbBool isNotifyEnabled() const
60 SbBool enableNotify(SbBool flag)
61
62 Methods from class SoBase:
63
64 void ref()
65 void unref() const
66 void unrefNoDelete() const
67 void touch()
68 virtual SoType getTypeId() const
69 SbBool isOfType(SoType type) const
70 virtual void setName(const SbName &name)
71 virtual SbName getName() const
72
73
75 This engine is a counter that outputs numbers, starting at a minimum
76 value, increasing by a step value, and ending with a number that does
77 not exceed the maximum value. When the maximum number is reached, it
78 starts counting from the beginning again.
79
80 The difference between this engine and the SoCounter engine, is that
81 this engine also has a timeIn input, which allows the counting cycles
82 to be timed. This engine counts automatically over time; it does not
83 need to be triggered to go to the next step. By default, the timeIn
84 input is connected to the realTime global field. It can, however, be
85 connected to any time source.
86
87 The frequency input field controls how many min-to-max cycles are per‐
88 formed per second. For example, a frequency value of 0.5 means that it
89 will take 2 seconds to complete a single min-to-max cycle.
90
91 The steps in the count cycle do not necessarily all have the same dura‐
92 tion. Using the duty input field, you can arbitrarily split the time
93 period of the count cycle between the steps. For example, if there are
94 5 steps in the cycle, a duty input of (1., 2., 2., 2., 1.) will make
95 the second, third, and fourth steps take twice as long as the first and
96 last steps.
97
98 At any time the counter can be reset to a specific value. If you set
99 the reset input field to a value, the engine will continue counting
100 from there. Note that the counter will always output numbers based on
101 the min, max and step values, and setting the reset value does not
102 affect the those input fields. If the reset value is not a legal
103 counter value, the counter will still behave as though it is:
104
105 If reset is greater than max, the counter is set to max.
106 If reset is less than min, the counter is set to min.
107 If reset is between step values, the counter is set to the lower step.
108
109 Each time a counting cycle is started, the syncOut output is triggered.
110 This output can be used to synchronize some other event with the counting
111 cycle. Other events can also synchronize the counter by triggering the
112 syncIn input.
113
114 You can pause the engine, by setting the on input to FALSE, and it will
115 stop updating the output field. When you turn off the pause, by setting
116 on to TRUE, it will start counting again from where it left off.
117
119 SoSFTime timeIn
120 Running time.
121
122 SoSFShort min
123 Minimum value for the counter.
124
125 SoSFShort max
126 Maximum value for the counter.
127
128 SoSFShort step
129 Counter step value.
130
131 SoSFBool on
132 Counter pauses if this is set to FALSE.
133
134 SoSFFloat frequency
135 Number of min-to-max cycles per second.
136
137 SoMFFloat duty
138 Duty cycle values.
139
140 SoSFShort reset
141 Reset the counter to the specified value.
142
143 SoSFTrigger syncIn
144 Restart at the beginning of the cycle.
145
146
148 (SoSFShort) output
149 Counts min-to-max, in step increments.
150
151 (SoSFTrigger) syncOut
152 Triggers at cycle start.
153
154
156 SoTimeCounter()
157 Constructor
158
159
161 TimeCounter {
162 min 0
163 max 1
164 step 1
165 on TRUE
166 frequency 1
167 duty 1
168 timeIn <current time>
169 syncIn
170 reset 0
171 }
172
174 SoCounter, SoElapsedTime, SoEngineOutput
175
176
177
178
179 SoTimeCounter(3IV)()