From 8303597a865400a363ae574ccde819302495f498 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 2 Apr 2013 18:41:01 +0200 Subject: Just put everything new in. Conflict resolution will be later --- ftnoir_tracker_sm/ftnoir_sm_controls.ui | 4 +- ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp | 88 ++++++++++----------- .../ftnoir_tracker_faceapi_dialog.cpp | 7 +- ftnoir_tracker_sm/ftnoir_tracker_faceapi_dll.cpp | 7 +- ftnoir_tracker_sm/ftnoir_tracker_sm.h | 8 +- ftnoir_tracker_sm/images/sm.ico | Bin 0 -> 37798 bytes 6 files changed, 56 insertions(+), 58 deletions(-) create mode 100644 ftnoir_tracker_sm/images/sm.ico (limited to 'ftnoir_tracker_sm') diff --git a/ftnoir_tracker_sm/ftnoir_sm_controls.ui b/ftnoir_tracker_sm/ftnoir_sm_controls.ui index 93befd19..06ebc9ca 100644 --- a/ftnoir_tracker_sm/ftnoir_sm_controls.ui +++ b/ftnoir_tracker_sm/ftnoir_sm_controls.ui @@ -15,7 +15,7 @@ - images/FaceTrackNoIR.icoimages/FaceTrackNoIR.ico + images/sm.pngimages/sm.png Qt::LeftToRight @@ -103,7 +103,7 @@ Enable Axis - + 10 diff --git a/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp b/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp index 624e35a0..35d3a3db 100644 --- a/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp +++ b/ftnoir_tracker_sm/ftnoir_tracker_faceapi.cpp @@ -24,6 +24,7 @@ ********************************************************************************/ #include "ftnoir_tracker_sm.h" #include +#include "facetracknoir/global-settings.h" FTNoIR_Tracker::FTNoIR_Tracker() { @@ -49,67 +50,60 @@ FTNoIR_Tracker::~FTNoIR_Tracker() hSMMemMap = 0; } -void FTNoIR_Tracker::Initialize( QFrame *videoframe ) -{ - qDebug() << "FTNoIR_Tracker::Initialize says: Starting "; - - if (SMCreateMapping()) { - qDebug() << "FTNoIR_Tracker::Initialize Mapping created."; - } - else { - QMessageBox::warning(0,"FaceTrackNoIR Error","Memory mapping not created!",QMessageBox::Ok,QMessageBox::NoButton); - } - - loadSettings(); - - if ( pMemData != NULL ) { - pMemData->command = 0; // Reset any and all commands - if (videoframe != NULL) { - pMemData->handle = videoframe->winId(); // Handle of Videoframe widget - } - else { - pMemData->handle = NULL; // reset Handle of Videoframe widget - } - } - - // - // Start FTNoIR_FaceAPI_EXE.exe. The exe contains all faceAPI-stuff and is non-Qt... - // - QString program = "FTNoIR_FaceAPI_EXE.exe"; - faceAPI = new QProcess(0); - faceAPI->start(program); - - // Show the video widget - qDebug() << "FTNoIR_Tracker::Initialize says: videoframe = " << videoframe; - - if (videoframe != NULL) { - videoframe->show(); - } - return; -} - -void FTNoIR_Tracker::StartTracker( HWND parent_window ) +void FTNoIR_Tracker::StartTracker(QFrame *videoframe ) { + qDebug() << "FTNoIR_Tracker::Initialize says: Starting "; + + if (SMCreateMapping()) { + qDebug() << "FTNoIR_Tracker::Initialize Mapping created."; + } + else { + QMessageBox::warning(0,"FaceTrackNoIR Error","Memory mapping not created!",QMessageBox::Ok,QMessageBox::NoButton); + } + + loadSettings(); + + if ( pMemData != NULL ) { + pMemData->command = 0; // Reset any and all commands + if (videoframe != NULL) { + pMemData->handle = videoframe->winId(); // Handle of Videoframe widget + } + else { + pMemData->handle = NULL; // reset Handle of Videoframe widget + } + } + + // + // Start FTNoIR_FaceAPI_EXE.exe. The exe contains all faceAPI-stuff and is non-Qt... + // + // XXX TODO isolate it into separate directory + faceAPI = new QProcess(); + faceAPI->setWorkingDirectory(QCoreApplication::applicationDirPath() + "/faceapi"); + faceAPI->start("\"" + QCoreApplication::applicationDirPath() + "/faceapi/ftnoir-faceapi-wrapper" + "\""); + // Show the video widget + qDebug() << "FTNoIR_Tracker::Initialize says: videoframe = " << videoframe; + + if (videoframe != NULL) { + videoframe->show(); + } if ( pMemData != NULL ) { pMemData->command = FT_SM_START; // Start command } - return; } -void FTNoIR_Tracker::StopTracker( bool exit ) +void FTNoIR_Tracker::WaitForExit() { qDebug() << "FTNoIR_Tracker::StopTracker says: Starting "; // stops the faceapi engine if ( pMemData != NULL ) { // if (exit == true) { - pMemData->command = (exit) ? FT_SM_EXIT : FT_SM_STOP; // Issue 'stop' command + pMemData->command = FT_SM_EXIT; //} //else { // pMemData->command = FT_SM_STOP; // Issue 'stop' command //} } - return; } bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data) @@ -246,9 +240,9 @@ bool FTNoIR_Tracker::SMCreateMapping() // GetTracker - Undecorated name, which can be easily used with GetProcAddress // Win32 API function. // _GetTracker@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetTracker=_GetTracker@0") +//#pragma comment(linker, "/export:GetTracker=_GetTracker@0") -FTNOIR_TRACKER_BASE_EXPORT ITrackerPtr __stdcall GetTracker() +extern "C" FTNOIR_TRACKER_BASE_EXPORT void* CALLING_CONVENTION GetConstructor() { - return new FTNoIR_Tracker; + return (ITracker*) new FTNoIR_Tracker; } diff --git a/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dialog.cpp b/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dialog.cpp index 5c422402..b62f652c 100644 --- a/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dialog.cpp +++ b/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dialog.cpp @@ -24,6 +24,7 @@ ********************************************************************************/ #include "ftnoir_tracker_sm.h" #include +#include "facetracknoir/global-settings.h" //******************************************************************************************************* // faceAPI Client Settings-dialog. @@ -338,9 +339,9 @@ void TrackerControls::doCommand(int command, int value) // GetTrackerDialog - Undecorated name, which can be easily used with GetProcAddress // Win32 API function. // _GetTrackerDialog@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0") +//#pragma comment(linker, "/export:GetTrackerDialog=_GetTrackerDialog@0") -FTNOIR_TRACKER_BASE_EXPORT ITrackerDialogPtr __stdcall GetTrackerDialog( ) +extern "C" FTNOIR_TRACKER_BASE_EXPORT void* CALLING_CONVENTION GetDialog() { - return new TrackerControls; + return (ITrackerDialog*) new TrackerControls; } diff --git a/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dll.cpp b/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dll.cpp index 5f01568f..70326499 100644 --- a/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dll.cpp +++ b/ftnoir_tracker_sm/ftnoir_tracker_faceapi_dll.cpp @@ -32,6 +32,7 @@ */ #include "ftnoir_tracker_sm.h" #include +#include "facetracknoir/global-settings.h" FTNoIR_TrackerDll::FTNoIR_TrackerDll() { //populate the description strings @@ -67,7 +68,7 @@ void FTNoIR_TrackerDll::getDescription(QString *strToBeFilled) void FTNoIR_TrackerDll::getIcon(QIcon *icon) { - *icon = QIcon(":/images/SeeingMachines.ico"); + *icon = QIcon(":/images/sm.png"); }; //////////////////////////////////////////////////////////////////////////////// @@ -77,9 +78,9 @@ void FTNoIR_TrackerDll::getIcon(QIcon *icon) // GetTrackerDll - Undecorated name, which can be easily used with GetProcAddress // Win32 API function. // _GetTrackerDll@0 - Common name decoration for __stdcall functions in C language. -#pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0") +//#pragma comment(linker, "/export:GetTrackerDll=_GetTrackerDll@0") -FTNOIR_TRACKER_BASE_EXPORT ITrackerDllPtr __stdcall GetTrackerDll() +extern "C" FTNOIR_TRACKER_BASE_EXPORT Metadata* CALLING_CONVENTION GetMetadata() { return new FTNoIR_TrackerDll; } diff --git a/ftnoir_tracker_sm/ftnoir_tracker_sm.h b/ftnoir_tracker_sm/ftnoir_tracker_sm.h index b7aed1d0..39997970 100644 --- a/ftnoir_tracker_sm/ftnoir_tracker_sm.h +++ b/ftnoir_tracker_sm/ftnoir_tracker_sm.h @@ -31,6 +31,8 @@ #include #include "Windows.h" #include "math.h" +#include "facetracknoir/global-settings.h" +#include using namespace std; @@ -40,10 +42,10 @@ public: FTNoIR_Tracker(); ~FTNoIR_Tracker(); - void Initialize( QFrame *videoframe ); - void StartTracker( HWND parent_window ); + void StartTracker( QFrame* parent_window ); void StopTracker( bool exit ); bool GiveHeadPoseData(THeadPoseData *data); // Returns true if confidence is good + void WaitForExit(); void loadSettings(); bool SMCreateMapping(); @@ -137,7 +139,7 @@ signals: //******************************************************************************************************* // FaceTrackNoIR Tracker DLL. Functions used to get general info on the Tracker //******************************************************************************************************* -class FTNoIR_TrackerDll : public ITrackerDll +class FTNoIR_TrackerDll : public Metadata { public: FTNoIR_TrackerDll(); diff --git a/ftnoir_tracker_sm/images/sm.ico b/ftnoir_tracker_sm/images/sm.ico new file mode 100644 index 00000000..19b24c84 Binary files /dev/null and b/ftnoir_tracker_sm/images/sm.ico differ -- cgit v1.2.3