From 3f082dbee43e6dbdb5d88fceec49298d0d2bce18 Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Wed, 5 Sep 2012 17:29:23 +0000 Subject: Put extra class in the DLL, which only return the name, description(s) and Icon. Loading the Settings dialog for these resulted in loading the entire Settings-window (without showing it). Unwanted behavior... git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@125 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui | 27 ++++++++------ FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h | 43 ++++++++++++++-------- FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj | 4 ++ FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp | 22 ----------- .../ftnoir_filter_accela_dialog.cpp | 32 ++-------------- 5 files changed, 51 insertions(+), 77 deletions(-) (limited to 'FTNoIR_Filter_Accela') diff --git a/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui b/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui index 50599e4d..6171defe 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui +++ b/FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui @@ -9,7 +9,7 @@ 0 0 - 518 + 321 349 @@ -43,13 +43,13 @@ - 500 + 300 300 - 500 + 300 300 @@ -63,8 +63,8 @@ - 80 - 30 + 20 + 20 215 220 @@ -102,10 +102,13 @@ - Input Yaw (degr.) + Input - Output Yaw (degr.) + Output + + + Translation @@ -116,7 +119,7 @@ - 30 + 20 20 215 220 @@ -142,8 +145,8 @@ - 255 - 170 + 85 + 255 0 @@ -155,10 +158,10 @@ - Input Yaw (degr.) + Input - Output Yaw (degr.) + Output diff --git a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h index 4b918f5a..fbc3804d 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h +++ b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h @@ -29,8 +29,10 @@ #include "..\ftnoir_filter_base\ftnoir_filter_base.h" #include "ui_FTNoIR_FilterControls.h" #include -//#include +//******************************************************************************************************* +// FaceTrackNoIR Filter class. +//******************************************************************************************************* class FTNoIR_Filter : public IFilter { public: @@ -42,10 +44,6 @@ public: void StartFilter(); void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget); - void getFullName(QString *strToBeFilled); - void getShortName(QString *strToBeFilled); - void getDescription(QString *strToBeFilled); - private: void loadSettings(); // Load the settings from the INI-file THeadPoseData newHeadPose; // Structure with new headpose @@ -54,9 +52,6 @@ private: double kFactor, kFactorTranslation; double kSensitivity, kSensitivityTranslation; - QString filterFullName; // Filters' name and description - QString filterShortName; - QString filterDescription; FunctionConfig functionConfig; FunctionConfig translationFunctionConfig; }; @@ -77,10 +72,7 @@ public: void Release(); // Member functions which are accessible from outside the DLL void Initialize(QWidget *parent, IFilterPtr ptr); - void getFullName(QString *strToBeFilled); - void getShortName(QString *strToBeFilled); - void getDescription(QString *strToBeFilled); - void getIcon(QIcon *icon); + private: Ui::UICFilterControls ui; void loadSettings(); @@ -89,9 +81,6 @@ private: /** helper **/ bool settingsDirty; - QString filterFullName; // Filters' name and description - QString filterShortName; - QString filterDescription; IFilterPtr pFilter; // If the filter was active when the dialog was opened, this will hold a pointer to the Filter instance FunctionConfig functionConfig; FunctionConfig translationFunctionConfig; @@ -102,6 +91,30 @@ private slots: void settingChanged(bool) { settingsDirty = true; }; }; +//******************************************************************************************************* +// FaceTrackNoIR Filter DLL. Functions used to get general info on the Filter +//******************************************************************************************************* +class FTNoIR_FilterDll : public IFilterDll +{ +public: + FTNoIR_FilterDll(); + ~FTNoIR_FilterDll(); + + void Release(); + void Initialize(); + + void getFullName(QString *strToBeFilled); + void getShortName(QString *strToBeFilled); + void getDescription(QString *strToBeFilled); + void getIcon(QIcon *icon); + +private: + QString filterFullName; // Filters' name and description + QString filterShortName; + QString filterDescription; +}; + + #endif //INCLUDED_FTN_FILTER_H //END diff --git a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj index 74d39021..b715adba 100644 --- a/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj +++ b/FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj @@ -175,6 +175,10 @@ RelativePath=".\ftnoir_filter_accela_dialog.cpp" > + + roll=output[5]; } -void FTNoIR_Filter::getFullName(QString *strToBeFilled) -{ - *strToBeFilled = filterFullName; -}; - - -void FTNoIR_Filter::getShortName(QString *strToBeFilled) -{ - *strToBeFilled = filterShortName; -}; - - -void FTNoIR_Filter::getDescription(QString *strToBeFilled) -{ - *strToBeFilled = filterDescription; -}; - //////////////////////////////////////////////////////////////////////////////// // Factory function that creates instances if the Filter object. diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp index 44d0292e..4f7a478b 100644 --- a/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp +++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp @@ -39,10 +39,6 @@ FilterControls::FilterControls() : { ui.setupUi( this ); - //populate the description strings - filterFullName = "Accela Filter"; - filterShortName = "Accela"; - filterDescription = "Accela Filter"; // Load the settings from the current .INI-file loadSettings(); connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); @@ -153,8 +149,8 @@ void FilterControls::loadSettings() { functionConfig.loadSettings(iniFile); translationFunctionConfig.loadSettings(iniFile); - ui.translationScalingConfig->setConfig(&translationFunctionConfig); - ui.scalingConfig->setConfig(&functionConfig); + ui.translationScalingConfig->setConfig(&translationFunctionConfig, currentFile); + ui.scalingConfig->setConfig(&functionConfig, currentFile); settingsDirty = false; } @@ -168,34 +164,14 @@ void FilterControls::save() { QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString(); QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) + qDebug() << "FTNoIR_Filter::save() says: iniFile = " << currentFile; + functionConfig.saveSettings(iniFile); translationFunctionConfig.saveSettings(iniFile); settingsDirty = false; } -void FilterControls::getFullName(QString *strToBeFilled) -{ - *strToBeFilled = filterFullName; -}; - - -void FilterControls::getShortName(QString *strToBeFilled) -{ - *strToBeFilled = filterShortName; -}; - - -void FilterControls::getDescription(QString *strToBeFilled) -{ - *strToBeFilled = filterDescription; -}; - -void FilterControls::getIcon(QIcon *icon) -{ - *icon = QIcon(":/images/filter-16.png"); -}; - //////////////////////////////////////////////////////////////////////////////// // Factory function that creates instances if the Filter-settings dialog object. -- cgit v1.2.3