summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/curve-config.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-04 17:28:49 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-04 17:28:49 +0200
commit97bd173ee4b6f30c12ca590e213b21bbc83f8617 (patch)
tree41c6c2dc601ef78816c1fc27af1f0ba8b4d4ed0d /facetracknoir/curve-config.cpp
parentb8c5e24223988c84331693371bb9b0d71b7ef821 (diff)
flush before windows breaks and data lossage
Diffstat (limited to 'facetracknoir/curve-config.cpp')
-rw-r--r--facetracknoir/curve-config.cpp71
1 files changed, 36 insertions, 35 deletions
diff --git a/facetracknoir/curve-config.cpp b/facetracknoir/curve-config.cpp
index abf03a5e..886e40fa 100644
--- a/facetracknoir/curve-config.cpp
+++ b/facetracknoir/curve-config.cpp
@@ -1,12 +1,13 @@
-#include "facetracknoir/facetracknoir.h"
-#include "facetracknoir/curve-config.h"
-CurveConfigurationDialog::CurveConfigurationDialog(FaceTrackNoIR *ftnoir, QWidget *parent) :
- QWidget( parent, Qt::Dialog ), mainApp(ftnoir)
+#include "./facetracknoir.h"
+#include "./curve-config.h"
+#include "./main-settings.hpp"
+CurveConfigurationDialog::CurveConfigurationDialog(Mappings& m, main_settings& s, QWidget *parent) : QWidget(parent, Qt::Dialog),
+ m(m)
{
ui.setupUi( this );
// rest of mapping settings taken care of by options::value<t>
- mainApp->load_mappings();
+ m.load_mappings();
{
struct {
@@ -34,8 +35,8 @@ CurveConfigurationDialog::CurveConfigurationDialog(FaceTrackNoIR *ftnoir, QWidge
for (int i = 0; qfcs[i].qfc; i++)
{
const bool altp = qfcs[i].altp;
- THeadPoseDOF& axis = mainApp->axis(qfcs[i].axis);
- FunctionConfig* conf = altp ? &axis.curveAlt : &axis.curve;
+ Mapping& axis = m(qfcs[i].axis);
+ Map* conf = altp ? &axis.curveAlt : &axis.curve;
const auto& name = qfcs[i].altp ? axis.name2 : axis.name1;
qfcs[i].qfc->setConfig(conf, name);
@@ -49,36 +50,36 @@ CurveConfigurationDialog::CurveConfigurationDialog(FaceTrackNoIR *ftnoir, QWidge
connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK()));
connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel()));
- tie_setting(mainApp->s.a_x.altp, ui.tx_altp);
- tie_setting(mainApp->s.a_y.altp, ui.ty_altp);
- tie_setting(mainApp->s.a_z.altp, ui.tz_altp);
- tie_setting(mainApp->s.a_yaw.altp, ui.rx_altp);
- tie_setting(mainApp->s.a_pitch.altp, ui.ry_altp);
- tie_setting(mainApp->s.a_roll.altp, ui.rz_altp);
+ tie_setting(s.a_x.altp, ui.tx_altp);
+ tie_setting(s.a_y.altp, ui.ty_altp);
+ tie_setting(s.a_z.altp, ui.tz_altp);
+ tie_setting(s.a_yaw.altp, ui.rx_altp);
+ tie_setting(s.a_pitch.altp, ui.ry_altp);
+ tie_setting(s.a_roll.altp, ui.rz_altp);
- tie_setting(mainApp->s.tcomp_p, ui.tcomp_enable);
- tie_setting(mainApp->s.tcomp_tz, ui.tcomp_rz);
+ tie_setting(s.tcomp_p, ui.tcomp_enable);
+ tie_setting(s.tcomp_tz, ui.tcomp_rz);
- tie_setting(mainApp->s.a_x.zero, ui.pos_tx);
- tie_setting(mainApp->s.a_y.zero, ui.pos_ty);
- tie_setting(mainApp->s.a_z.zero, ui.pos_tz);
- tie_setting(mainApp->s.a_yaw.zero, ui.pos_rx);
- tie_setting(mainApp->s.a_pitch.zero, ui.pos_ry);
- tie_setting(mainApp->s.a_roll.zero, ui.pos_rz);
+ tie_setting(s.a_x.zero, ui.pos_tx);
+ tie_setting(s.a_y.zero, ui.pos_ty);
+ tie_setting(s.a_z.zero, ui.pos_tz);
+ tie_setting(s.a_yaw.zero, ui.pos_rx);
+ tie_setting(s.a_pitch.zero, ui.pos_ry);
+ tie_setting(s.a_roll.zero, ui.pos_rz);
- tie_setting(mainApp->s.a_yaw.invert, ui.invert_yaw);
- tie_setting(mainApp->s.a_pitch.invert, ui.invert_pitch);
- tie_setting(mainApp->s.a_roll.invert, ui.invert_roll);
- tie_setting(mainApp->s.a_x.invert, ui.invert_x);
- tie_setting(mainApp->s.a_y.invert, ui.invert_y);
- tie_setting(mainApp->s.a_z.invert, ui.invert_z);
+ tie_setting(s.a_yaw.invert, ui.invert_yaw);
+ tie_setting(s.a_pitch.invert, ui.invert_pitch);
+ tie_setting(s.a_roll.invert, ui.invert_roll);
+ tie_setting(s.a_x.invert, ui.invert_x);
+ tie_setting(s.a_y.invert, ui.invert_y);
+ tie_setting(s.a_z.invert, ui.invert_z);
- tie_setting(mainApp->s.a_yaw.src, ui.src_yaw);
- tie_setting(mainApp->s.a_pitch.src, ui.src_pitch);
- tie_setting(mainApp->s.a_roll.src, ui.src_roll);
- tie_setting(mainApp->s.a_x.src, ui.src_x);
- tie_setting(mainApp->s.a_y.src, ui.src_y);
- tie_setting(mainApp->s.a_z.src, ui.src_z);
+ tie_setting(s.a_yaw.src, ui.src_yaw);
+ tie_setting(s.a_pitch.src, ui.src_pitch);
+ tie_setting(s.a_roll.src, ui.src_roll);
+ tie_setting(s.a_x.src, ui.src_x);
+ tie_setting(s.a_y.src, ui.src_y);
+ tie_setting(s.a_z.src, ui.src_z);
}
void CurveConfigurationDialog::doOK() {
@@ -87,10 +88,10 @@ void CurveConfigurationDialog::doOK() {
}
void CurveConfigurationDialog::doCancel() {
- mainApp->load_mappings();
+ m.load_mappings();
this->close();
}
void CurveConfigurationDialog::save() {
- mainApp->save_mappings();
+ m.save_mappings();
}