summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_ht/ftnoir_tracker_ht.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-12-30 11:03:00 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-12-30 11:03:00 +0100
commit60a8fd51ba9cd77b1944d10cab75e095db7b2815 (patch)
tree9189ba4078da0b63102c2ea33bfb1720f5ee4180 /ftnoir_tracker_ht/ftnoir_tracker_ht.h
parent2a3b4460da901256a60fc2e4bc90adc14284bbf3 (diff)
ht: reduce boilerplate
Diffstat (limited to 'ftnoir_tracker_ht/ftnoir_tracker_ht.h')
-rw-r--r--ftnoir_tracker_ht/ftnoir_tracker_ht.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
index 3140e99c..f45e54f9 100644
--- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h
+++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h
@@ -18,6 +18,26 @@
#include "facetracknoir/options.hpp"
using namespace options;
+struct settings {
+ pbundle b;
+ value<bool> enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ;
+ value<double> fov;
+ value<int> fps, camera_idx, resolution;
+ settings() :
+ b(bundle("HT-Tracker")),
+ enableTX(b, "enable-tx", true),
+ enableTY(b, "enable-ty", true),
+ enableTZ(b, "enable-tz", true),
+ enableRX(b, "enable-rx", true),
+ enableRY(b, "enable-ry", true),
+ enableRZ(b, "enable-rz", true),
+ fov(b, "fov", 56),
+ fps(b, "fps", 0),
+ camera_idx(b, "camera-index", 0),
+ resolution(b, "resolution", 0)
+ {}
+};
+
class Tracker : public QObject, public ITracker
{
Q_OBJECT
@@ -26,12 +46,9 @@ public:
virtual ~Tracker();
void StartTracker(QFrame* frame);
void GetHeadPoseData(double *data);
- pbundle b;
- value<bool> enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ;
- value<double> fov;
- value<int> fps, camera_idx, resolution;
void load_settings(ht_config_t* config);
private:
+ settings s;
PortableLockedShm lck_shm;
ht_shm_t* shm;
QProcess subprocess;
@@ -51,10 +68,7 @@ public:
private:
Ui::Form ui;
- pbundle b;
- value<bool> enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ;
- value<double> fov;
- value<int> fps, camera_idx, resolution;
+ settings s;
private slots:
void doOK();