summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--FTNoIR_Filter_Accela/FTNoIR_FilterControls.ui27
-rw-r--r--FTNoIR_Filter_Accela/FTNoIR_Filter_accela.h43
-rw-r--r--FTNoIR_Filter_Accela/FTNoIR_Filter_accela.vcproj4
-rw-r--r--FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp22
-rw-r--r--FTNoIR_Filter_Accela/ftnoir_filter_accela_dialog.cpp32
-rw-r--r--FTNoIR_Filter_Base/ftnoir_filter_base.h31
-rw-r--r--FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h39
-rw-r--r--FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj4
-rw-r--r--FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp22
-rw-r--r--FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp27
10 files changed, 102 insertions, 149 deletions
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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>518</width>
+ <width>321</width>
<height>349</height>
</rect>
</property>
@@ -43,13 +43,13 @@
</property>
<property name="minimumSize">
<size>
- <width>500</width>
+ <width>300</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>500</width>
+ <width>300</width>
<height>300</height>
</size>
</property>
@@ -63,8 +63,8 @@
<widget class="QFunctionConfigurator" name="scalingConfig">
<property name="geometry">
<rect>
- <x>80</x>
- <y>30</y>
+ <x>20</x>
+ <y>20</y>
<width>215</width>
<height>220</height>
</rect>
@@ -102,10 +102,13 @@
</color>
</property>
<property name="stringInputEGU" stdset="0">
- <string>Input Yaw (degr.)</string>
+ <string>Input</string>
</property>
<property name="stringOutputEGU" stdset="0">
- <string>Output Yaw (degr.)</string>
+ <string>Output</string>
+ </property>
+ <property name="stringCaption" stdset="0">
+ <string>Translation</string>
</property>
</widget>
</widget>
@@ -116,7 +119,7 @@
<widget class="QFunctionConfigurator" name="translationScalingConfig">
<property name="geometry">
<rect>
- <x>30</x>
+ <x>20</x>
<y>20</y>
<width>215</width>
<height>220</height>
@@ -142,8 +145,8 @@
</property>
<property name="colorBezier">
<color>
- <red>255</red>
- <green>170</green>
+ <red>85</red>
+ <green>255</green>
<blue>0</blue>
</color>
</property>
@@ -155,10 +158,10 @@
</color>
</property>
<property name="stringInputEGU" stdset="0">
- <string>Input Yaw (degr.)</string>
+ <string>Input</string>
</property>
<property name="stringOutputEGU" stdset="0">
- <string>Output Yaw (degr.)</string>
+ <string>Output</string>
</property>
</widget>
</widget>
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 <FunctionConfig.h>
-//#include <FunctionEditorFrame.h>
+//*******************************************************************************************************
+// 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"
>
</File>
+ <File
+ RelativePath=".\ftnoir_filter_accela_dll.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
diff --git a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp
index fce05f33..7b1b7008 100644
--- a/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp
+++ b/FTNoIR_Filter_Accela/ftnoir_filter_accela.cpp
@@ -19,11 +19,6 @@ FTNoIR_Filter::FTNoIR_Filter() :
functionConfig("Accela-Scaling-Rotation", 4, 8),
translationFunctionConfig("Accela-Scaling-Translation", 4, 8)
{
- //populate the description strings
- filterFullName = "Accela Filter mkII";
- filterShortName = "Accela mkII";
- filterDescription = "Accela filter mkII";
-
first_run = true;
loadSettings(); // Load the Settings
}
@@ -155,23 +150,6 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T
current_camera_position->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.
diff --git a/FTNoIR_Filter_Base/ftnoir_filter_base.h b/FTNoIR_Filter_Base/ftnoir_filter_base.h
index 3d617abc..600243fc 100644
--- a/FTNoIR_Filter_Base/ftnoir_filter_base.h
+++ b/FTNoIR_Filter_Base/ftnoir_filter_base.h
@@ -22,10 +22,6 @@ struct IFilter
virtual void Release() = 0;
virtual void Initialize() = 0;
virtual void FilterHeadPoseData(THeadPoseData *current_camera_position, THeadPoseData *target_camera_position, THeadPoseData *new_camera_position, bool newTarget) = 0;
-
- virtual void getFullName(QString *strToBeFilled) = 0;
- virtual void getShortName(QString *strToBeFilled) = 0;
- virtual void getDescription(QString *strToBeFilled) = 0;
};
// Handle type. In C++ language the interface type is used.
@@ -58,6 +54,27 @@ struct IFilterDialog
{
virtual void Release() = 0; // Member required to enable Auto-remove
virtual void Initialize(QWidget *parent, IFilterPtr ptr) = 0;
+};
+
+// Handle type. In C++ language the interface type is used.
+typedef IFilterDialog* FILTERDIALOGHANDLE;
+
+// Factory function that creates instances of the Filter object.
+EXTERN_C
+FTNOIR_FILTER_BASE_EXPORT
+FILTERDIALOGHANDLE
+__stdcall
+GetFilterDialog(void);
+
+// COM-Like abstract interface.
+// This interface doesn't require __declspec(dllexport/dllimport) specifier.
+// Method calls are dispatched via virtual table.
+// Any C++ compiler can use it.
+// Instances are obtained via factory function.
+struct IFilterDll
+{
+ virtual void Release() = 0; // Member required to enable Auto-remove
+ virtual void Initialize() = 0;
virtual void getFullName(QString *strToBeFilled) = 0;
virtual void getShortName(QString *strToBeFilled) = 0;
@@ -66,14 +83,14 @@ struct IFilterDialog
};
// Handle type. In C++ language the interface type is used.
-typedef IFilterDialog* FILTERDIALOGHANDLE;
+typedef IFilterDll* FILTERDLLHANDLE;
// Factory function that creates instances of the Filter object.
EXTERN_C
FTNOIR_FILTER_BASE_EXPORT
-FILTERDIALOGHANDLE
+FILTERDLLHANDLE
__stdcall
-GetFilterDialog(void);
+GetFilterDll(void);
#endif // FTNOIR_FILTER_BASE_H
diff --git a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h
index bd90c1f8..f313d154 100644
--- a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h
+++ b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.h
@@ -45,10 +45,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
@@ -63,11 +59,6 @@ private:
float kMinSmoothing;
float kMaxSmoothing;
float kSmoothingScaleCurve;
-
- QString filterFullName; // Filters' name and description
- QString filterShortName;
- QString filterDescription;
-
};
//*******************************************************************************************************
@@ -86,10 +77,6 @@ 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;
@@ -99,9 +86,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
private slots:
@@ -111,6 +95,29 @@ private slots:
void settingChanged( int ) { 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_EWMA2/FTNoIR_Filter_EWMA2.vcproj b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj
index 918f8b28..28cf8a82 100644
--- a/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj
+++ b/FTNoIR_Filter_EWMA2/FTNoIR_Filter_EWMA2.vcproj
@@ -174,6 +174,10 @@
RelativePath=".\ftnoir_filter_ewma2_dialog.cpp"
>
</File>
+ <File
+ RelativePath=".\ftnoir_filter_ewma_dll.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Header Files"
diff --git a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp
index 99a4bd98..965cfd73 100644
--- a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp
+++ b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2.cpp
@@ -36,11 +36,6 @@
FTNoIR_Filter::FTNoIR_Filter()
{
- //populate the description strings
- filterFullName = "EWMA Filter Mk2";
- filterShortName = "EWMA";
- filterDescription = "Exponentially Weighted Moving Average filter with dynamic smoothing parameter";
-
first_run = true;
alpha_smoothing = 0.02f; // this is a constant for now, might be a parameter later
loadSettings(); // Load the Settings
@@ -226,23 +221,6 @@ void FTNoIR_Filter::FilterHeadPoseData(THeadPoseData *current_camera_position, T
return;
}
-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_EWMA2/ftnoir_filter_ewma2_dialog.cpp b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp
index 7ffe8bb9..9653d4bc 100644
--- a/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp
+++ b/FTNoIR_Filter_EWMA2/ftnoir_filter_ewma2_dialog.cpp
@@ -37,11 +37,6 @@ QWidget()
{
ui.setupUi( this );
- //populate the description strings
- filterFullName = "EWMA Filter Mk2";
- filterShortName = "EWMA";
- filterDescription = "Exponentially Weighted Moving Average filter with dynamic smoothing parameter";
-
QPoint offsetpos(100, 100);
//if (parent) {
// this->move(parent->pos() + offsetpos);
@@ -187,28 +182,6 @@ void FilterControls::save() {
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.