Utility.h
Go to the documentation of this file.
1 // ***********************************************************************
2 // Assembly :
3 // Author : Administrator
4 // Created : 08-05-2021
5 //
6 // Last Modified By : Administrator
7 // Last Modified On : 08-05-2021
8 // ***********************************************************************
9 // <copyright file="Utility.h" company="Nokov">
10 // Copyright (c) Nokov. All rights reserved.
11 // </copyright>
12 // <summary>辅助功能头文件,提供速度,加速度的外部计算支持
13 // ***********************************************************************
14 
15 #pragma once
16 
17 #include <list>
18 #include <fstream>
19 #include <string>
20 #include <cmath>
21 
22 #define ERRORDATA (9999999.999999)
23 #define Mid(X) int(X/2)
24 #define FrameFactor 3 // 3,5,7
25 #define FPS 60
26 
27 #define IN //入参
28 #define OUT //出参
29 #define IN_OUT //入出参 struct Point { double x; double y; double z; std::string name; }; struct Vel //定义速度 { double Vx; double Vy; double Vz; double Vr;// |V| Vel() :Vx(0), Vy(0), Vz(0), Vr(0) {} friend std::ostream& operator << (std::ostream& os, const Vel& record) { os << "Vx:" << record.Vx << "\t"; os << "Vy:" << record.Vy << "\t"; os << "Vz:" << record.Vz << "\t"; os << "Vr:" << record.Vr << "\t"; os << std::endl; return os; } }; struct Accel //定义加速度 { double Ax; double Ay; double Az; double Ar; // |A| Accel() :Ax(0), Ay(0), Az(0), Ar(0) {} friend std::ostream& operator << (std::ostream& os, const Accel& record) { os << "Ax:" << record.Ax << "\t"; os << "Ay:" << record.Ay << "\t"; os << "Az:" << record.Az << "\t"; os << "Ar:" << record.Ar << "\t"; os << std::endl; return os; } }; // 封装的计算类,可派生自此基类实现自定义计算方式 template<class T> class CalculateMethod { public: typedef T ValueType; typedef T& ReferenceType; CalculateMethod(double FR, int FF) :m_Points(nullptr), m_FPS(FR), m_FrameFactor(FF) {}; int GetFrameFactor() const { return m_FrameFactor; }; int GetFrameFPS() const { return m_FPS; }; int tryToCalculate(IN Point* point, OUT ReferenceType variable) { if (nullptr == point) return 1; m_Points = point; if (m_FPS <= 0 || m_FPS >= 400) return 1; return calculate(variable); } protected: virtual int calculate(OUT ReferenceType variable) = 0; protected: Point* m_Points; double m_FPS; int m_FrameFactor; }; class CalculateVelocity : public CalculateMethod<Vel> { public: CalculateVelocity(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Vel& vel) override { int TR = m_FrameFactor / 2; vel.Vx = m_FPS * (m_Points[TR * 2].x - m_Points[0].x) / (2 * TR); vel.Vy = m_FPS * (m_Points[TR * 2].y - m_Points[0].y) / (2 * TR); vel.Vz = m_FPS * (m_Points[TR * 2].z - m_Points[0].z) / (2 * TR); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; // 两帧计算法,从第二帧起实时计算 class CalculateVelocityByTwoFrame : public CalculateMethod<Vel> { public: CalculateVelocityByTwoFrame(double FR) :CalculateMethod(FR, 2) {}; protected: virtual int calculate(OUT Vel& vel) override { vel.Vx = m_FPS * (m_Points[1].x - m_Points[0].x); vel.Vy = m_FPS * (m_Points[1].y - m_Points[0].y); vel.Vz = m_FPS * (m_Points[1].z - m_Points[0].z); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; class CalculateAcceleration : public CalculateMethod<Accel> { public: CalculateAcceleration(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Accel& accel) override { int TR = m_FrameFactor / 2; accel.Ax = m_FPS * m_FPS * (m_Points[TR * 2].x - 2 * m_Points[TR].x + m_Points[0].x) / (TR * TR); accel.Ay = m_FPS * m_FPS * (m_Points[TR * 2].y - 2 * m_Points[TR].y + m_Points[0].y) / (TR * TR); accel.Az = m_FPS * m_FPS * (m_Points[TR * 2].z - 2 * m_Points[TR].z + m_Points[0].z) / (TR * TR); accel.Ar = sqrt(accel.Ax * accel.Ax + accel.Ay * accel.Ay + accel.Az * accel.Az); return 0; } }; // 滑动帧数组,存储待计算的数据,保留原始指针类型 class SlideFrameArray { public: explicit SlideFrameArray() { clear(); } void clear() { _list.clear(); } size_t cache(const Point& point) { _list.push_back(point); return _list.size(); } size_t Cache(double x, double y, double z) { Point point = { 0 }; point.x = x; point.y = y; point.z = z; return cache(point); } template<class T> bool tryToCalculate(OUT T& data, CalculateMethod<T>& method) { Point* inArray = nullptr; if (!frameArray(inArray, method.GetFrameFactor())) { if (inArray) { delete[] inArray; inArray = nullptr; } return false; } int retCount = method.tryToCalculate(inArray, data); if (retCount != 0) { delete[] inArray; return false; } delete[] inArray; return true; } private: // the retArray need to be free by the user bool frameArray(OUT Point*& retArray, int frameFactor = FrameFactor) { if (_list.size() < frameFactor) return false; retArray = new Point[frameFactor]; int index = 0; for (auto itor = _list.begin(); itor != _list.end() && index < frameFactor; ++itor, ++index) { retArray[index] = *itor; } // 向后滑动一格 _list.pop_front(); return true; } private: std::list<Point> _list; };
30 
31 struct Point
32 {
33  double x;
34  double y;
35  double z;
36  std::string name;
37 };
38 
39 struct Vel //定义速度{ double Vx; double Vy; double Vz; double Vr;// |V| Vel() :Vx(0), Vy(0), Vz(0), Vr(0) {} friend std::ostream& operator << (std::ostream& os, const Vel& record) { os << "Vx:" << record.Vx << "\t"; os << "Vy:" << record.Vy << "\t"; os << "Vz:" << record.Vz << "\t"; os << "Vr:" << record.Vr << "\t"; os << std::endl; return os; } }; struct Accel //定义加速度 { double Ax; double Ay; double Az; double Ar; // |A| Accel() :Ax(0), Ay(0), Az(0), Ar(0) {} friend std::ostream& operator << (std::ostream& os, const Accel& record) { os << "Ax:" << record.Ax << "\t"; os << "Ay:" << record.Ay << "\t"; os << "Az:" << record.Az << "\t"; os << "Ar:" << record.Ar << "\t"; os << std::endl; return os; } }; // 封装的计算类,可派生自此基类实现自定义计算方式 template<class T> class CalculateMethod { public: typedef T ValueType; typedef T& ReferenceType; CalculateMethod(double FR, int FF) :m_Points(nullptr), m_FPS(FR), m_FrameFactor(FF) {}; int GetFrameFactor() const { return m_FrameFactor; }; int GetFrameFPS() const { return m_FPS; }; int tryToCalculate(IN Point* point, OUT ReferenceType variable) { if (nullptr == point) return 1; m_Points = point; if (m_FPS <= 0 || m_FPS >= 400) return 1; return calculate(variable); } protected: virtual int calculate(OUT ReferenceType variable) = 0; protected: Point* m_Points; double m_FPS; int m_FrameFactor; }; class CalculateVelocity : public CalculateMethod<Vel> { public: CalculateVelocity(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Vel& vel) override { int TR = m_FrameFactor / 2; vel.Vx = m_FPS * (m_Points[TR * 2].x - m_Points[0].x) / (2 * TR); vel.Vy = m_FPS * (m_Points[TR * 2].y - m_Points[0].y) / (2 * TR); vel.Vz = m_FPS * (m_Points[TR * 2].z - m_Points[0].z) / (2 * TR); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; // 两帧计算法,从第二帧起实时计算 class CalculateVelocityByTwoFrame : public CalculateMethod<Vel> { public: CalculateVelocityByTwoFrame(double FR) :CalculateMethod(FR, 2) {}; protected: virtual int calculate(OUT Vel& vel) override { vel.Vx = m_FPS * (m_Points[1].x - m_Points[0].x); vel.Vy = m_FPS * (m_Points[1].y - m_Points[0].y); vel.Vz = m_FPS * (m_Points[1].z - m_Points[0].z); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; class CalculateAcceleration : public CalculateMethod<Accel> { public: CalculateAcceleration(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Accel& accel) override { int TR = m_FrameFactor / 2; accel.Ax = m_FPS * m_FPS * (m_Points[TR * 2].x - 2 * m_Points[TR].x + m_Points[0].x) / (TR * TR); accel.Ay = m_FPS * m_FPS * (m_Points[TR * 2].y - 2 * m_Points[TR].y + m_Points[0].y) / (TR * TR); accel.Az = m_FPS * m_FPS * (m_Points[TR * 2].z - 2 * m_Points[TR].z + m_Points[0].z) / (TR * TR); accel.Ar = sqrt(accel.Ax * accel.Ax + accel.Ay * accel.Ay + accel.Az * accel.Az); return 0; } }; // 滑动帧数组,存储待计算的数据,保留原始指针类型 class SlideFrameArray { public: explicit SlideFrameArray() { clear(); } void clear() { _list.clear(); } size_t cache(const Point& point) { _list.push_back(point); return _list.size(); } size_t Cache(double x, double y, double z) { Point point = { 0 }; point.x = x; point.y = y; point.z = z; return cache(point); } template<class T> bool tryToCalculate(OUT T& data, CalculateMethod<T>& method) { Point* inArray = nullptr; if (!frameArray(inArray, method.GetFrameFactor())) { if (inArray) { delete[] inArray; inArray = nullptr; } return false; } int retCount = method.tryToCalculate(inArray, data); if (retCount != 0) { delete[] inArray; return false; } delete[] inArray; return true; } private: // the retArray need to be free by the user bool frameArray(OUT Point*& retArray, int frameFactor = FrameFactor) { if (_list.size() < frameFactor) return false; retArray = new Point[frameFactor]; int index = 0; for (auto itor = _list.begin(); itor != _list.end() && index < frameFactor; ++itor, ++index) { retArray[index] = *itor; } // 向后滑动一格 _list.pop_front(); return true; } private: std::list<Point> _list; };
40 {
41  double Vx;
42  double Vy;
43  double Vz;
44  double Vr;// |V|
45  Vel() :Vx(0), Vy(0), Vz(0), Vr(0) {}
46 
47  friend std::ostream& operator << (std::ostream& os, const Vel& record)
48  {
49  os << "Vx:" << record.Vx << "\t";
50  os << "Vy:" << record.Vy << "\t";
51  os << "Vz:" << record.Vz << "\t";
52  os << "Vr:" << record.Vr << "\t";
53  os << std::endl;
54 
55  return os;
56  }
57 };
58 
59 struct Accel //定义加速度{ double Ax; double Ay; double Az; double Ar; // |A| Accel() :Ax(0), Ay(0), Az(0), Ar(0) {} friend std::ostream& operator << (std::ostream& os, const Accel& record) { os << "Ax:" << record.Ax << "\t"; os << "Ay:" << record.Ay << "\t"; os << "Az:" << record.Az << "\t"; os << "Ar:" << record.Ar << "\t"; os << std::endl; return os; } }; // 封装的计算类,可派生自此基类实现自定义计算方式 template<class T> class CalculateMethod { public: typedef T ValueType; typedef T& ReferenceType; CalculateMethod(double FR, int FF) :m_Points(nullptr), m_FPS(FR), m_FrameFactor(FF) {}; int GetFrameFactor() const { return m_FrameFactor; }; int GetFrameFPS() const { return m_FPS; }; int tryToCalculate(IN Point* point, OUT ReferenceType variable) { if (nullptr == point) return 1; m_Points = point; if (m_FPS <= 0 || m_FPS >= 400) return 1; return calculate(variable); } protected: virtual int calculate(OUT ReferenceType variable) = 0; protected: Point* m_Points; double m_FPS; int m_FrameFactor; }; class CalculateVelocity : public CalculateMethod<Vel> { public: CalculateVelocity(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Vel& vel) override { int TR = m_FrameFactor / 2; vel.Vx = m_FPS * (m_Points[TR * 2].x - m_Points[0].x) / (2 * TR); vel.Vy = m_FPS * (m_Points[TR * 2].y - m_Points[0].y) / (2 * TR); vel.Vz = m_FPS * (m_Points[TR * 2].z - m_Points[0].z) / (2 * TR); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; // 两帧计算法,从第二帧起实时计算 class CalculateVelocityByTwoFrame : public CalculateMethod<Vel> { public: CalculateVelocityByTwoFrame(double FR) :CalculateMethod(FR, 2) {}; protected: virtual int calculate(OUT Vel& vel) override { vel.Vx = m_FPS * (m_Points[1].x - m_Points[0].x); vel.Vy = m_FPS * (m_Points[1].y - m_Points[0].y); vel.Vz = m_FPS * (m_Points[1].z - m_Points[0].z); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; class CalculateAcceleration : public CalculateMethod<Accel> { public: CalculateAcceleration(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Accel& accel) override { int TR = m_FrameFactor / 2; accel.Ax = m_FPS * m_FPS * (m_Points[TR * 2].x - 2 * m_Points[TR].x + m_Points[0].x) / (TR * TR); accel.Ay = m_FPS * m_FPS * (m_Points[TR * 2].y - 2 * m_Points[TR].y + m_Points[0].y) / (TR * TR); accel.Az = m_FPS * m_FPS * (m_Points[TR * 2].z - 2 * m_Points[TR].z + m_Points[0].z) / (TR * TR); accel.Ar = sqrt(accel.Ax * accel.Ax + accel.Ay * accel.Ay + accel.Az * accel.Az); return 0; } }; // 滑动帧数组,存储待计算的数据,保留原始指针类型 class SlideFrameArray { public: explicit SlideFrameArray() { clear(); } void clear() { _list.clear(); } size_t cache(const Point& point) { _list.push_back(point); return _list.size(); } size_t Cache(double x, double y, double z) { Point point = { 0 }; point.x = x; point.y = y; point.z = z; return cache(point); } template<class T> bool tryToCalculate(OUT T& data, CalculateMethod<T>& method) { Point* inArray = nullptr; if (!frameArray(inArray, method.GetFrameFactor())) { if (inArray) { delete[] inArray; inArray = nullptr; } return false; } int retCount = method.tryToCalculate(inArray, data); if (retCount != 0) { delete[] inArray; return false; } delete[] inArray; return true; } private: // the retArray need to be free by the user bool frameArray(OUT Point*& retArray, int frameFactor = FrameFactor) { if (_list.size() < frameFactor) return false; retArray = new Point[frameFactor]; int index = 0; for (auto itor = _list.begin(); itor != _list.end() && index < frameFactor; ++itor, ++index) { retArray[index] = *itor; } // 向后滑动一格 _list.pop_front(); return true; } private: std::list<Point> _list; };
60 {
61  double Ax;
62  double Ay;
63  double Az;
64  double Ar; // |A|
65  Accel() :Ax(0), Ay(0), Az(0), Ar(0) {}
66 
67  friend std::ostream& operator << (std::ostream& os, const Accel& record)
68  {
69  os << "Ax:" << record.Ax << "\t";
70  os << "Ay:" << record.Ay << "\t";
71  os << "Az:" << record.Az << "\t";
72  os << "Ar:" << record.Ar << "\t";
73  os << std::endl;
74 
75  return os;
76  }
77 };
78 
79 // 封装的计算类,可派生自此基类实现自定义计算方式
80 template<class T>
82 {
83 public:
84  typedef T ValueType;
85  typedef T& ReferenceType;
86 
87  CalculateMethod(double FR, int FF) :m_Points(nullptr), m_FPS(FR), m_FrameFactor(FF) {};
88 
89  int GetFrameFactor() const { return m_FrameFactor; };
90  int GetFrameFPS() const { return m_FPS; };
91 
92  int tryToCalculate(IN Point* point, OUT ReferenceType variable)
93  {
94  if (nullptr == point)
95  return 1;
96 
97  m_Points = point;
98 
99  if (m_FPS <= 0 || m_FPS >= 400)
100  return 1;
101 
102  return calculate(variable);
103  }
104 
105 protected:
106  virtual int calculate(OUT ReferenceType variable) = 0;
107 
108 protected:
110  double m_FPS;
112 };
113 
115 {
116 public:
117  CalculateVelocity(double FR, int FF) :CalculateMethod(FR, FF) {};
118 
119 protected:
120  virtual int calculate(OUT Vel& vel) override
121  {
122  int TR = m_FrameFactor / 2;
123 
124  vel.Vx = m_FPS * (m_Points[TR * 2].x - m_Points[0].x) / (2 * TR);
125  vel.Vy = m_FPS * (m_Points[TR * 2].y - m_Points[0].y) / (2 * TR);
126  vel.Vz = m_FPS * (m_Points[TR * 2].z - m_Points[0].z) / (2 * TR);
127  vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz);
128 
129  return 0;
130  }
131 };
132 
133 // 两帧计算法,从第二帧起实时计算class CalculateVelocityByTwoFrame : public CalculateMethod<Vel> { public: CalculateVelocityByTwoFrame(double FR) :CalculateMethod(FR, 2) {}; protected: virtual int calculate(OUT Vel& vel) override { vel.Vx = m_FPS * (m_Points[1].x - m_Points[0].x); vel.Vy = m_FPS * (m_Points[1].y - m_Points[0].y); vel.Vz = m_FPS * (m_Points[1].z - m_Points[0].z); vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz); return 0; } }; class CalculateAcceleration : public CalculateMethod<Accel> { public: CalculateAcceleration(double FR, int FF) :CalculateMethod(FR, FF) {}; protected: virtual int calculate(OUT Accel& accel) override { int TR = m_FrameFactor / 2; accel.Ax = m_FPS * m_FPS * (m_Points[TR * 2].x - 2 * m_Points[TR].x + m_Points[0].x) / (TR * TR); accel.Ay = m_FPS * m_FPS * (m_Points[TR * 2].y - 2 * m_Points[TR].y + m_Points[0].y) / (TR * TR); accel.Az = m_FPS * m_FPS * (m_Points[TR * 2].z - 2 * m_Points[TR].z + m_Points[0].z) / (TR * TR); accel.Ar = sqrt(accel.Ax * accel.Ax + accel.Ay * accel.Ay + accel.Az * accel.Az); return 0; } }; // 滑动帧数组,存储待计算的数据,保留原始指针类型 class SlideFrameArray { public: explicit SlideFrameArray() { clear(); } void clear() { _list.clear(); } size_t cache(const Point& point) { _list.push_back(point); return _list.size(); } size_t Cache(double x, double y, double z) { Point point = { 0 }; point.x = x; point.y = y; point.z = z; return cache(point); } template<class T> bool tryToCalculate(OUT T& data, CalculateMethod<T>& method) { Point* inArray = nullptr; if (!frameArray(inArray, method.GetFrameFactor())) { if (inArray) { delete[] inArray; inArray = nullptr; } return false; } int retCount = method.tryToCalculate(inArray, data); if (retCount != 0) { delete[] inArray; return false; } delete[] inArray; return true; } private: // the retArray need to be free by the user bool frameArray(OUT Point*& retArray, int frameFactor = FrameFactor) { if (_list.size() < frameFactor) return false; retArray = new Point[frameFactor]; int index = 0; for (auto itor = _list.begin(); itor != _list.end() && index < frameFactor; ++itor, ++index) { retArray[index] = *itor; } // 向后滑动一格 _list.pop_front(); return true; } private: std::list<Point> _list; };
135 {
136 public:
138 
139 protected:
140  virtual int calculate(OUT Vel& vel) override
141  {
142  vel.Vx = m_FPS * (m_Points[1].x - m_Points[0].x);
143  vel.Vy = m_FPS * (m_Points[1].y - m_Points[0].y);
144  vel.Vz = m_FPS * (m_Points[1].z - m_Points[0].z);
145  vel.Vr = sqrt(vel.Vx * vel.Vx + vel.Vy * vel.Vy + vel.Vz * vel.Vz);
146 
147  return 0;
148  }
149 };
150 
152 {
153 public:
154  CalculateAcceleration(double FR, int FF) :CalculateMethod(FR, FF) {};
155 protected:
156  virtual int calculate(OUT Accel& accel) override
157  {
158  int TR = m_FrameFactor / 2;
159 
160  accel.Ax = m_FPS * m_FPS * (m_Points[TR * 2].x - 2 * m_Points[TR].x + m_Points[0].x) / (TR * TR);
161  accel.Ay = m_FPS * m_FPS * (m_Points[TR * 2].y - 2 * m_Points[TR].y + m_Points[0].y) / (TR * TR);
162  accel.Az = m_FPS * m_FPS * (m_Points[TR * 2].z - 2 * m_Points[TR].z + m_Points[0].z) / (TR * TR);
163  accel.Ar = sqrt(accel.Ax * accel.Ax + accel.Ay * accel.Ay + accel.Az * accel.Az);
164 
165  return 0;
166  }
167 };
168 
169 // 滑动帧数组,存储待计算的数据,保留原始指针类型
171 {
172 public:
173 
174  explicit SlideFrameArray()
175  {
176  clear();
177  }
178 
179  void clear()
180  {
181  _list.clear();
182  }
183 
184  size_t cache(const Point& point)
185  {
186  _list.push_back(point);
187  return _list.size();
188  }
189 
190  size_t Cache(double x, double y, double z)
191  {
192  Point point = { 0 };
193  point.x = x;
194  point.y = y;
195  point.z = z;
196 
197  return cache(point);
198  }
199 
200  template<class T>
201  bool tryToCalculate(OUT T& data, CalculateMethod<T>& method)
202  {
203  Point* inArray = nullptr;
204  if (!frameArray(inArray, method.GetFrameFactor()))
205  {
206  if (inArray)
207  {
208  delete[] inArray;
209  inArray = nullptr;
210  }
211 
212  return false;
213  }
214 
215  int retCount = method.tryToCalculate(inArray, data);
216  if (retCount != 0)
217  {
218  delete[] inArray;
219  return false;
220  }
221 
222  delete[] inArray;
223  return true;
224  }
225 
226 private:
227  // the retArray need to be free by the user
228 
229  bool frameArray(OUT Point*& retArray, int frameFactor = FrameFactor)
230  {
231  if (_list.size() < frameFactor)
232  return false;
233 
234  retArray = new Point[frameFactor];
235 
236  int index = 0;
237  for (auto itor = _list.begin(); itor != _list.end() && index < frameFactor; ++itor, ++index)
238  {
239  retArray[index] = *itor;
240  }
241 
242  // 向后滑动一格 _list.pop_front(); return true; } private: std::list<Point> _list; };
243  _list.pop_front();
244 
245  return true;
246  }
247 
248 private:
249  std::list<Point> _list;
250 };
251 
252 
253 
254 
255 
256 
SlideFrameArray::tryToCalculate
bool tryToCalculate(OUT T &data, CalculateMethod< T > &method)
Definition: Utility.h:201
CalculateMethod::m_Points
Point * m_Points
Definition: Utility.h:109
CalculateMethod::GetFrameFPS
int GetFrameFPS() const
Definition: Utility.h:90
SlideFrameArray::Cache
size_t Cache(double x, double y, double z)
Definition: Utility.h:190
CalculateMethod::ValueType
T ValueType
Definition: Utility.h:84
Accel::Ay
double Ay
Definition: Utility.h:62
CalculateAcceleration::CalculateAcceleration
CalculateAcceleration(double FR, int FF)
Definition: Utility.h:154
Point::name
std::string name
Definition: Utility.h:36
CalculateMethod::ReferenceType
T & ReferenceType
Definition: Utility.h:85
Accel::Az
double Az
Definition: Utility.h:63
Vel::Vx
double Vx
Definition: Utility.h:41
CalculateAcceleration
Definition: Utility.h:151
Accel::operator<<
friend std::ostream & operator<<(std::ostream &os, const Accel &record)
Definition: Utility.h:67
Accel
Definition: Utility.h:59
IN
#define IN
Definition: Utility.h:27
Vel::operator<<
friend std::ostream & operator<<(std::ostream &os, const Vel &record)
Definition: Utility.h:47
CalculateMethod::m_FPS
double m_FPS
Definition: Utility.h:110
CalculateVelocity::calculate
virtual int calculate(OUT Vel &vel) override
Definition: Utility.h:120
CalculateMethod
Definition: Utility.h:81
SlideFrameArray::SlideFrameArray
SlideFrameArray()
Definition: Utility.h:174
Accel::Ar
double Ar
Definition: Utility.h:64
Accel::Accel
Accel()
Definition: Utility.h:65
Vel::Vel
Vel()
Definition: Utility.h:45
SlideFrameArray::cache
size_t cache(const Point &point)
Definition: Utility.h:184
Point::z
double z
Definition: Utility.h:35
SlideFrameArray
Definition: Utility.h:170
Point
Definition: Utility.h:31
CalculateVelocity
Definition: Utility.h:114
CalculateVelocityByTwoFrame
Definition: Utility.h:134
CalculateMethod::CalculateMethod
CalculateMethod(double FR, int FF)
Definition: Utility.h:87
OUT
#define OUT
Definition: Utility.h:28
CalculateMethod::m_FrameFactor
int m_FrameFactor
Definition: Utility.h:111
CalculateVelocityByTwoFrame::CalculateVelocityByTwoFrame
CalculateVelocityByTwoFrame(double FR)
Definition: Utility.h:137
SlideFrameArray::clear
void clear()
Definition: Utility.h:179
CalculateMethod::tryToCalculate
int tryToCalculate(IN Point *point, OUT ReferenceType variable)
Definition: Utility.h:92
Vel::Vz
double Vz
Definition: Utility.h:43
CalculateVelocity::CalculateVelocity
CalculateVelocity(double FR, int FF)
Definition: Utility.h:117
CalculateMethod::calculate
virtual int calculate(OUT ReferenceType variable)=0
Point::y
double y
Definition: Utility.h:34
Vel
Definition: Utility.h:39
Point::x
double x
Definition: Utility.h:33
Accel::Ax
double Ax
Definition: Utility.h:61
CalculateAcceleration::calculate
virtual int calculate(OUT Accel &accel) override
Definition: Utility.h:156
CalculateMethod::GetFrameFactor
int GetFrameFactor() const
Definition: Utility.h:89
SlideFrameArray::frameArray
bool frameArray(OUT Point *&retArray, int frameFactor=FrameFactor)
Definition: Utility.h:229
SlideFrameArray::_list
std::list< Point > _list
Definition: Utility.h:249
CalculateVelocityByTwoFrame::calculate
virtual int calculate(OUT Vel &vel) override
Definition: Utility.h:140
Vel::Vy
double Vy
Definition: Utility.h:42
Vel::Vr
double Vr
Definition: Utility.h:44
FrameFactor
#define FrameFactor
Definition: Utility.h:24


mocap_nokov
Author(s):
autogenerated on Mon Mar 3 2025 03:08:00