From e883e08c569d50f1eb0bd800167dd06167ab9bda Mon Sep 17 00:00:00 2001 From: Wim Vriend Date: Sat, 22 Sep 2012 14:44:47 +0000 Subject: Removed Excel-server git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@158 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb --- FaceTrackNoIR/AutoClosePtr.h | 89 -------------- FaceTrackNoIR/ExcelServer.cpp | 102 ---------------- FaceTrackNoIR/ExcelServer.h | 65 ----------- FaceTrackNoIR/FTNoIR_cxx_protocolserver.h | 130 --------------------- .../FaceTrackNoIR.exe.intermediate.manifest | 13 --- FaceTrackNoIR/Release/FaceTrackNoIR.res | Bin 23864 -> 0 bytes 6 files changed, 399 deletions(-) delete mode 100644 FaceTrackNoIR/AutoClosePtr.h delete mode 100644 FaceTrackNoIR/ExcelServer.cpp delete mode 100644 FaceTrackNoIR/ExcelServer.h delete mode 100644 FaceTrackNoIR/FTNoIR_cxx_protocolserver.h delete mode 100644 FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest delete mode 100644 FaceTrackNoIR/Release/FaceTrackNoIR.res (limited to 'FaceTrackNoIR') diff --git a/FaceTrackNoIR/AutoClosePtr.h b/FaceTrackNoIR/AutoClosePtr.h deleted file mode 100644 index 690d2c62..00000000 --- a/FaceTrackNoIR/AutoClosePtr.h +++ /dev/null @@ -1,89 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Auto pointer template. - -#if !defined(AUTOCLOSEPTR_H) -#define AUTOCLOSEPTR_H - -////////////////////////////////////////////////////////////////////////////// -// T auto pointer (not suitable for containers). -// This auto pointer uses T's member function to perform clean up, rather -// than `operator Closeete'. -// -template -class AutoClosePtr -{ -public: - explicit AutoClosePtr(T* p = NULL) - : m_p(p) - { // construct from object pointer - } - - AutoClosePtr(AutoClosePtr& Other) - : m_p(Other.Release()) - { // construct from Other AutoClosePtr - } - - AutoClosePtr& operator=(AutoClosePtr& Other) - { // assign Other - Reset(Other.Release()); - return (*this); - } - - ~AutoClosePtr() - { // close and destroy - if(m_p) - { - (m_p->*Close)(); - m_p = NULL; - } - } - - T& operator*() const - { // return T - return (*m_p); - } - - T** operator&() - { // return the address of the wrapped pointer - Reset(); - return &m_p; - } - - T* operator->() const - { // return wrapped pointer - return Get(); - } - - operator bool() const - { // check wrapped pointer for NULL - return m_p != NULL; - } - - T* Get() const - { // return wrapped pointer - return m_p; - } - - T* Release() - { // return wrapped pointer and give up ownership - T* pTmp = m_p; - m_p = NULL; - return pTmp; - } - - void Reset(T* p = NULL) - { // destroy the object and store new pointer - if(p != m_p) - { - if(m_p) - (m_p->*Close)(); - } - - m_p = p; - } - -private: - T* m_p; // the wrapped raw pointer -}; - -#endif // AUTOCLOSEPTR_H \ No newline at end of file diff --git a/FaceTrackNoIR/ExcelServer.cpp b/FaceTrackNoIR/ExcelServer.cpp deleted file mode 100644 index 0f046e98..00000000 --- a/FaceTrackNoIR/ExcelServer.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of the some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* Homepage * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the * -* Free Software Foundation; either version 3 of the License, or (at your * -* option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but * -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program; if not, see . * -* * -* ExcelServer ExcelServer is the Class, that communicates headpose-data * -* to Excel, for analysing purposes. * -********************************************************************************/ -/* - Modifications (last one on top): - 20101224 - WVR: Base class is no longer inheriting QThread. sendHeadposeToGame - is called from run() of Tracker.cpp -*/ -#include -#include "ExcelServer.h" -#include "Tracker.h" -#include - -/** constructor **/ -ExcelServer::ExcelServer( Tracker *parent ) { - - // Save the parent - headTracker = parent; -} - -/** destructor **/ -ExcelServer::~ExcelServer() { -} - -// -// Update Headpose in Game. -// -void ExcelServer::sendHeadposeToGame() { -SYSTEMTIME now; - - // - // Get the System-time and substract the time from the previous call. - // dT will be used for the EWMA-filter. - // - GetSystemTime ( &now ); - long newHeadPoseTime = (((now.wHour * 3600) + (now.wMinute * 60) + now.wSecond) * 1000) + now.wMilliseconds; - - // Use this for some debug-output to file... - QFile data(QCoreApplication::applicationDirPath() + "\\output.txt"); - if (data.open(QFile::WriteOnly | QFile::Append)) { - QTextStream out(&data); - out << newHeadPoseTime << "\t" << newSample << "\t" << confidence << "\t" << dT << "\t" << smoothvalue << "\t" << headRotX << "\t" << virtRotX << "\t" << prev_value << '\n'; - } -} - -// -// Check if the Client DLL exists and load it (to test it), if so. -// Returns 'true' if all seems OK. -// -bool ExcelServer::checkServerInstallationOK( HANDLE handle ) -{ - // Use this for some debug-output to file... - QFile data(QCoreApplication::applicationDirPath() + "\\output.txt"); - if (data.open(QFile::WriteOnly)) { - - - // - // Get the settings for the header - // - 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) - - iniFile.beginGroup ( "Tracking" ); - int smoothing = iniFile.value ( "Smooth", 10 ).toInt(); - bool useEWMA = iniFile.value ( "useEWMA", 1 ).toBool(); - iniFile.endGroup (); - - QTextStream out(&data); - out << "Smoothing = \t" << smoothing << "\n" << "EWMA used = \t" << useEWMA << "\n" << "\n"; - out << "Time" << "\t" << "New Sample" << "\t" << "Confidence" << "\t" << "dT" << "\t" << "Smoothed" << "\t" << "RotX (Pitch)" << "\t" << "RotX (Pitch)" << "\t" << "Previous" << '\n'; - out << "(long)" << "\t" << "(bool)" << "\t" << "(float)" << "\t" << "(float)" << "\t" << "(float)" << "\t" << "Raw" << "\t" << "Filtered" << "\t" << "-" << '\n'; - } - - return true; -} - -//END diff --git a/FaceTrackNoIR/ExcelServer.h b/FaceTrackNoIR/ExcelServer.h deleted file mode 100644 index 434591e8..00000000 --- a/FaceTrackNoIR/ExcelServer.h +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of the some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* Homepage * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the * -* Free Software Foundation; either version 3 of the License, or (at your * -* option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but * -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program; if not, see . * -* * -* ExcelServer ExcelServer is the Class, that communicates headpose-data * -* to Excel, for analysing purposes. * -********************************************************************************/ -#pragma once -#ifndef INCLUDED_EXCELSERVER_H -#define INCLUDED_EXCELSERVER_H - -#include "FTNoIR_cxx_protocolserver.h" -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace v4friend::ftnoir; - -class Tracker; // pre-define parent-class to avoid circular includes - -class ExcelServer : public ProtocolServerBase { - Q_OBJECT - -public: - - // public member methods - ExcelServer( Tracker *parent ); - ~ExcelServer(); - - // protected member methods -protected: - bool checkServerInstallationOK( HANDLE handle ); - void sendHeadposeToGame(); - -private: - Tracker *headTracker; // For upstream messages... -}; - -#endif//INCLUDED_EXCELSERVER_H -//END diff --git a/FaceTrackNoIR/FTNoIR_cxx_protocolserver.h b/FaceTrackNoIR/FTNoIR_cxx_protocolserver.h deleted file mode 100644 index 39e50e44..00000000 --- a/FaceTrackNoIR/FTNoIR_cxx_protocolserver.h +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************** -* FTNoIR_cxx_protocolserver is the base Class for Game-protocol-servers. * -* Using this, the tracker only needs to create one * -* server and can use the same functions to * -* communicate with it. * -* * -* Copyright (C) 2010 Wim Vriend (Developing) * -* Ron Hendriks (Testing and Research) * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the * -* Free Software Foundation; either version 3 of the License, or (at your * -* option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but * -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program; if not, see . * -* * -********************************************************************************/ -#ifndef FTNOIR_CXX_PROTOCOLSERVER_H -#define FTNOIR_CXX_PROTOCOLSERVER_H - -#include "Windows.h" -//#include -#include - -namespace v4friend -{ - namespace ftnoir - { - class ProtocolServerBase : public QObject // : public QThread - { - Q_OBJECT - public: - - virtual ~ProtocolServerBase() {} - - //! @return true if the engine will produce data. - /*! @see smEngineIsLicensed() */ - virtual bool isLicensed() const { return true; }; - virtual QString GetProgramName() { return QString("Test"); }; - - virtual bool checkServerInstallationOK ( HANDLE handle ) { return true; } - virtual void sendHeadposeToGame() {} - virtual void setVirtRotX(float rot) { virtRotX = rot; } - virtual void setVirtRotY(float rot) { virtRotY = rot; } - virtual void setVirtRotZ(float rot) { virtRotZ = rot; } - virtual void setVirtPosX(float pos) { virtPosX = pos / 100.0f; } - virtual void setVirtPosY(float pos) { virtPosY = pos / 100.0f; } - virtual void setVirtPosZ(float pos) { virtPosZ = pos / 100.0f; } - - virtual void setHeadRotX(float x) { headRotX = x; } - virtual void setHeadRotY(float y) { headRotY = y; } - virtual void setHeadRotZ(float z) { headRotZ = z; } - virtual void setHeadPosX(float x) { headPosX = x; } - virtual void setHeadPosY(float y) { headPosY = y; } - virtual void setHeadPosZ(float z) { headPosZ = z; } - - virtual void resetProperties() { - virtPosX = 0.0f; - virtPosY = 0.0f; - virtPosZ = 0.0f; - virtRotX = 0.0f; - virtRotY = 0.0f; - virtRotZ = 0.0f; - - headPosX = 0.0f; - headPosY = 0.0f; - headPosZ = 0.0f; - headRotX = 0.0f; - headRotY = 0.0f; - headRotZ = 0.0f; - - prevPosX = 0.0f; - prevPosY = 0.0f; - prevPosZ = 0.0f; - prevRotX = 0.0f; - prevRotY = 0.0f; - prevRotZ = 0.0f; - } - - protected: - ProtocolServerBase() {}; - - public: - /** member variables for saving the head pose **/ - float virtPosX; - float virtPosY; - float virtPosZ; - - float virtRotX; - float virtRotY; - float virtRotZ; - - float headPosX; - float headPosY; - float headPosZ; - - float headRotX; - float headRotY; - float headRotZ; - - float prevPosX; - float prevPosY; - float prevPosZ; - float prevRotX; - float prevRotY; - float prevRotZ; - - // - // Values for analysis of tracking... - // - float confidence; - float smoothvalue; - float prev_value; - bool newSample; - float dT; - - private: - ProtocolServerBase(const ProtocolServerBase &); - ProtocolServerBase &operator=(const ProtocolServerBase &); - bool operator==(const ProtocolServerBase &) const; - }; - } -} -#endif diff --git a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest b/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest deleted file mode 100644 index 9ae90f83..00000000 --- a/FaceTrackNoIR/Release/FaceTrackNoIR.exe.intermediate.manifest +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/FaceTrackNoIR/Release/FaceTrackNoIR.res b/FaceTrackNoIR/Release/FaceTrackNoIR.res deleted file mode 100644 index c126bb6c..00000000 Binary files a/FaceTrackNoIR/Release/FaceTrackNoIR.res and /dev/null differ -- cgit v1.2.3