From ee53c49af9789553fb51987bd6003ce30344e173 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Fri, 28 Sep 2012 10:45:03 +0000 Subject: Added member-function to FunctionConfig, so it accepts default-settings from a QList of QFloats. Put Stanislaws' Accela-defaults in the Accela-filter: they work fine! git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@172 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h | 35 +++++++++++++++++++++ FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp | 15 +++++++-- .../ftnoir_filter_accela_dialog.cpp | 22 ++++++++----- FaceTrackNoIR/FaceTrackNoIR.vcproj | 18 ++++++++++- FaceTrackNoIR/tracker_types.cpp | 2 +- .../QFunctionConfigurator/FunctionConfig.cpp | Bin 14332 -> 17456 bytes .../QFunctionConfigurator/FunctionConfig.h | Bin 3756 -> 3894 bytes .../QFunctionConfigurator.vcproj | 4 +-- 8 files changed, 83 insertions(+), 13 deletions(-) diff --git a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h index fbc3804d..742b4d1e 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h +++ b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h @@ -30,6 +30,41 @@ #include "ui_FTNoIR_FilterControls.h" #include +const QPointF defScaleRotation[] = +{ + QPointF(0, 0), + QPointF(0.308900523560209, 0.0666666666666667), + QPointF(0.565445026178011, 0.226666666666667), + QPointF(0.769633507853403, 0.506666666666667), + QPointF(0.994764397905759, 1), + QPointF(1.23560209424084, 1.61333333333333), + QPointF(1.47643979057592, 2.37333333333333), + QPointF(1.66492146596859, 3.12), + QPointF(1.80628272251309, 3.92), + QPointF(1.91623036649215, 4.70666666666667), + QPointF(2.00523560209424, 5.44), + QPointF(2.07329842931937, 6) +}; + +const QPointF defScaleTranslation[] = +{ + QPointF(0, 0), + QPointF(0.282722513089005, 0.08), + QPointF(0.492146596858639, 0.306666666666667), + QPointF(0.764397905759162, 0.84), + QPointF(1.00523560209424, 1.62666666666667), + QPointF(1.17277486910995, 2.78666666666667), + QPointF(1.25130890052356, 3.6), + QPointF(1.31937172774869, 4.29333333333333), + QPointF(1.38219895287958, 4.90666666666667), + QPointF(1.43455497382199, 5.65333333333333) +}; + +// +// Macro to determine array-size +// +#define NUM_OF(x) (sizeof (x) / sizeof *(x)) + //******************************************************************************************************* // FaceTrackNoIR Filter class. //******************************************************************************************************* diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp index c71469c4..a6f9264b 100755 --- a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp +++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp @@ -36,13 +36,24 @@ void FTNoIR_Filter::Initialize() } void FTNoIR_Filter::loadSettings() { + QList defPoints; + QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - functionConfig.loadSettings(iniFile); - translationFunctionConfig.loadSettings(iniFile); + defPoints.clear(); + for (int i = 0; i < NUM_OF(defScaleRotation); i++) { // Get the default points (hardcoded!) + defPoints.append(defScaleRotation[i]); + } + functionConfig.loadSettings(iniFile, defPoints); + + defPoints.clear(); + for (int i = 0; i < NUM_OF(defScaleTranslation); i++) { // Get the default points (hardcoded!) + defPoints.append(defScaleTranslation[i]); + } + translationFunctionConfig.loadSettings(iniFile, defPoints); } void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget) diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp index b9a1724c..8af8a280 100644 --- a/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp +++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp @@ -133,21 +133,29 @@ void FilterControls::doCancel() { // Load the current Settings from the currently 'active' INI-file. // void FilterControls::loadSettings() { +QList defPoints; + QSettings settings("Abbequerque Inc.", "FaceTrackNoIR"); // Registry settings (in HK_USER) QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) - qDebug() << "FTNoIR_Filter::loadSettings says: iniFile = " << currentFile; + qDebug() << "FTNoIR_Filter::loadSettings2 says: iniFile = " << currentFile; + - //ui.scalingConfig->setBounds(0, 0, 4.0, 8, 0.25, 0.25); - //ui.scalingConfig->setSize(1000, 550); + qDebug() << "FTNoIR_Filter::loadSettings2 says: size = " << NUM_OF(defScaleRotation); - //ui.translationScalingConfig->setBounds(0, 0, 4.0, 8, 0.25, 0.25); - //ui.translationScalingConfig->setSize(1000, 550); + defPoints.clear(); + for (int i = 0; i < NUM_OF(defScaleRotation); i++) { // Get the default points (hardcoded!) + defPoints.append(defScaleRotation[i]); + } + functionConfig.loadSettings(iniFile, defPoints); - functionConfig.loadSettings(iniFile); - translationFunctionConfig.loadSettings(iniFile); + defPoints.clear(); + for (int i = 0; i < NUM_OF(defScaleTranslation); i++) { // Get the default points (hardcoded!) + defPoints.append(defScaleTranslation[i]); + } + translationFunctionConfig.loadSettings(iniFile, defPoints); ui.translationScalingConfig->setConfig(&translationFunctionConfig, currentFile); ui.scalingConfig->setConfig(&functionConfig, currentFile); diff --git a/FaceTrackNoIR/FaceTrackNoIR.vcproj b/FaceTrackNoIR/FaceTrackNoIR.vcproj index 8266d421..57755a93 100644 --- a/FaceTrackNoIR/FaceTrackNoIR.vcproj +++ b/FaceTrackNoIR/FaceTrackNoIR.vcproj @@ -151,7 +151,7 @@ /> + + + + + + @@ -329,6 +341,10 @@ /> + + @@ -236,7 +236,7 @@ -- cgit v1.2.3