1SoOneShot(3IV)() SoOneShot(3IV)()
2
3
4
6 SoOneShot — timer that runs for a pre-set amount of time
7
9 SoBase > SoFieldContainer > SoEngine > SoOneShot
10
12 #include <Inventor/engines/SoOneShot.h>
13
14 enum Flags {
15 SoOneShot::RETRIGGERABLE Can start over during the cycle
16 SoOneShot::HOLD_FINAL Output values stay high after cycle
17 }
18
19 Inputs from class SoOneShot:
20
21 SoSFTime timeIn
22 SoSFTime duration
23 SoSFTrigger trigger
24 SoSFBitMask flags
25 SoSFBool disable
26
27 Outputs from class SoOneShot:
28
29 (SoSFTime) timeOut
30 (SoSFBool) isActive
31 (SoSFFloat) ramp
32
33 Methods from class SoOneShot:
34
35 SoOneShot()
36
37 Methods from class SoEngine:
38
39 static SoType getClassTypeId()
40 virtual int getOutputs(SoEngineOutputList &list) const
41 SoEngineOutput * getOutput(const SbName &outputName) const
42 SbBool getOutputName(const SoEngineOutput *output, SbName
43 &outputName) const
44 SoEngine * copy() const
45 static SoEngine * getByName(const SbName &name)
46 static int getByName(const SbName &name, SoEngineList &list)
47
48 Methods from class SoFieldContainer:
49
50 void setToDefaults()
51 SbBool hasDefaultValues() const
52 SbBool fieldsAreEqual(const SoFieldContainer *fc) const
53 void copyFieldValues(const SoFieldContainer *fc, SbBool
54 copyConnections = FALSE)
55 SbBool set(const char *fieldDataString)
56 void get(SbString &fieldDataString)
57 virtual int getFields(SoFieldList &resultList) const
58 virtual SoField * getField(const SbName &fieldName) const
59 SbBool getFieldName(const SoField *field, SbName &fieldName)
60 const
61 SbBool isNotifyEnabled() const
62 SbBool enableNotify(SbBool flag)
63
64 Methods from class SoBase:
65
66 void ref()
67 void unref() const
68 void unrefNoDelete() const
69 void touch()
70 virtual SoType getTypeId() const
71 SbBool isOfType(SoType type) const
72 virtual void setName(const SbName &name)
73 virtual SbName getName() const
74
75
77 This engine is a timer that runs for a pre-set amount of time and then
78 stops. By default, the timeIn input is connected to the realTime global
79 field. It can, however, by connected to any other time source.
80
81 The timer is started when the trigger input is touched. It then runs
82 for the specified duration, and updates the timeOut output with the
83 time that has elapsed. During that time, the ramp output is also
84 updated. The ramp output starts at 0.0 at the beginning of the cycle,
85 and linearly increases until it reaches 1.0 at the end of the cycle.
86
87 You can disable the timer by setting the disable input to TRUE. The
88 output value remains 0.0 while the timer is disabled. If the timer is
89 disabled in the middle of a cycle the output values will be set to 0.0.
90
91 The flags input contains control flags. Using the flags you can set the
92 timer to be retriggerable in the middle of a cycle, and set the output
93 values to stay high after the cycle has been completed. By default,
94 these flags are not set.
95
97 SoSFTime timeIn
98 Running time.
99
100 SoSFTime duration
101 Duration of the active cycle.
102
103 SoSFTrigger trigger
104 Start the cycle. The trigger will be ignored if it is touched in the
105 middle of a cycle and the RETRIGGERABLE flag is not set.
106
107 SoSFBitMask flags
108 Control flags.
109
110 SoSFBool disable
111 If TRUE, the timer is disabled.
112
113
115 (SoSFTime) timeOut
116 Elapsed time from the start.
117
118 (SoSFBool) isActive
119 Is TRUE during the active cycle.
120
121 (SoSFFloat) ramp
122 Ramps linearly from 0.0 to 1.0.
123
124
126 SoOneShot()
127 Constructor
128
129
131 OneShot {
132 duration 1
133 trigger
134 flags ()
135 disable FALSE
136 timeIn <current time>
137 }
138
140 SoElapsedTime, SoEngineOutput
141
142
143
144
145 SoOneShot(3IV)()