summaryrefslogtreecommitdiff
path: root/MuscleEMGProfile.h
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2012-12-05 21:14:14 +0100
committerTobias Klauser <tklauser@distanz.ch>2012-12-05 21:14:14 +0100
commitad6a598de4025321a5227edf2a676c0f3397927c (patch)
tree0f17b56ca26f13f7f3c36a7204295865b2c280a5 /MuscleEMGProfile.h
parentedb2cdf6b9fc0c94cce910c9d488e69200402c57 (diff)
Basic infrastructure to read muscle activation profiles from CSV
Diffstat (limited to 'MuscleEMGProfile.h')
-rw-r--r--MuscleEMGProfile.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/MuscleEMGProfile.h b/MuscleEMGProfile.h
new file mode 100644
index 0000000..2d31f27
--- /dev/null
+++ b/MuscleEMGProfile.h
@@ -0,0 +1,49 @@
+#ifndef MUSCLE_EMG_PROFILE_H_
+#define MUSCLE_EMG_PROFILE_H_
+
+#include <ostream>
+#include <string>
+#include <vector>
+
+class MuscleEMGProfile {
+public:
+ MuscleEMGProfile(const std::string &name, unsigned capacity)
+ : _name(const_cast<std::string &>(name))
+ {
+ if (capacity == 0)
+ capacity = 100;
+ _x.reserve(capacity);
+ _y.reserve(capacity);
+ }
+
+ MuscleEMGProfile& operator=(const MuscleEMGProfile &m)
+ {
+ _name = m._name;
+ _x = m._x;
+ _y = m._y;
+
+ return *this;
+ }
+
+ unsigned getIdx() { return _x.size(); }
+ unsigned getCapacity() { return _x.max_size(); }
+ const std::string &getName() { return _name; }
+
+ void addData(double x, double y);
+
+private:
+ std::string _name;
+ std::vector<double> _x;
+ std::vector<double> _y;
+
+// friend std::ostream& operator<<(std::ostream &s, const MuscleEMGProfile &m);
+};
+
+/*
+std::ostream& operator<<(std::ostream &s, const MuscleEMGProfile &m)
+{
+ return s << "MuscleEMGProfile(" << m._name << ", " << m._idx << "/" << m._capacity << ")" << std::endl;
+}
+*/
+
+#endif /* MUSCLE_EMG_PROFILE_H_ */ \ No newline at end of file