#include <value_smoother.h>
Nevrax France
Definition at line 137 of file value_smoother.h.
Public Member Functions | |
| void | addValue (bool dt) |
| add a new value to be smoothed. | |
| CValueSmootherTemplate (uint n=1) | |
| Constructor. | |
| const std::vector< bool > & | getLastFrames () const |
| uint | getNumFrame () const |
| bool | getSmoothValue () const |
| get the smoothed value. | |
| void | init (uint n) |
| reset the ValueSmoother, and set the number of frame to smooth. | |
| void | reset () |
| reset only the ValueSmoother | |
Private Attributes | |
| std::vector< bool > | _LastFrames |
| uint | _NumFrame |
|
|
add a new value to be smoothed.
Definition at line 167 of file value_smoother.h.
00168 {
00169 if(_NumFrame>0)
00170 _LastFrames[0] = dt;
00171 }
|
|
|
Constructor.
Definition at line 142 of file value_smoother.h. References NLMISC::CValueSmootherTemplate< T >::init(), and uint.
00143 {
00144 init(n);
00145 }
|
|
|
Definition at line 187 of file value_smoother.h.
00188 {
00189 return _LastFrames;
00190 }
|
|
|
Definition at line 182 of file value_smoother.h. References uint.
00183 {
00184 return _NumFrame;
00185 }
|
|
|
get the smoothed value.
Definition at line 174 of file value_smoother.h.
00175 {
00176 if(_NumFrame>0)
00177 return _LastFrames[0];
00178 else
00179 return false;
00180 }
|
|
|
reset the ValueSmoother, and set the number of frame to smooth.
Definition at line 148 of file value_smoother.h. References uint.
00149 {
00150 // reset all the array to 0.
00151 _LastFrames.clear();
00152
00153 if (n>0)
00154 _LastFrames.resize(n, false);
00155
00156 _NumFrame = 0;
00157 }
|
|
|
reset only the ValueSmoother
Definition at line 160 of file value_smoother.h.
00161 {
00162 std::fill(_LastFrames.begin(), _LastFrames.end(), false);
00163 _NumFrame = 0;
00164 }
|
|
|
Definition at line 193 of file value_smoother.h. |
|
|
Definition at line 194 of file value_smoother.h. |
1.3.6