summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_base
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2014-06-12 14:53:43 +1000
committerDonovan Baarda <abo@minkirri.apana.org.au>2014-06-12 14:53:43 +1000
commit0669a40347ffa233bc6042b0f65d244509a61394 (patch)
tree36a4577bdaa1ed28ca1ad222a54777012dd2dda8 /ftnoir_tracker_base
parent72540e0a96a3120a5d02271e714aba29e136ab78 (diff)
parent7454496476ba17ea622781d280606161581c9544 (diff)
Merge branch 'master' of https://github.com/opentrack/opentrack into dev/ewma2
Resolved conflicts manually in files: ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp ftnoir_filter_ewma2/ftnoir_filter_ewma2.h
Diffstat (limited to 'ftnoir_tracker_base')
-rw-r--r--ftnoir_tracker_base/ftnoir_tracker_base.h166
-rw-r--r--ftnoir_tracker_base/ftnoir_tracker_base_global.h30
-rw-r--r--ftnoir_tracker_base/ftnoir_tracker_ma_types.h33
-rw-r--r--ftnoir_tracker_base/ftnoir_tracker_sm_types.h36
-rw-r--r--ftnoir_tracker_base/ftnoir_tracker_types.h41
5 files changed, 87 insertions, 219 deletions
diff --git a/ftnoir_tracker_base/ftnoir_tracker_base.h b/ftnoir_tracker_base/ftnoir_tracker_base.h
index 182a364c..09723d84 100644
--- a/ftnoir_tracker_base/ftnoir_tracker_base.h
+++ b/ftnoir_tracker_base/ftnoir_tracker_base.h
@@ -1,101 +1,65 @@
-/********************************************************************************
-* 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 <http://www.gnu.org/licenses/>. *
-* This class implements a tracker-base *
-*********************************************************************************/
-/*
- Modifications (last one on top):
- 20122109 - C14: Replaced Release with virtual destructor
- 20120009 - WVR: Removed AutoClosePtr (seemed like it didn't work OK)
- 20110415 - WVR: Added overloaded operator - and -=
-*/
-#ifndef FTNOIR_TRACKER_BASE_H
-#define FTNOIR_TRACKER_BASE_H
-
-#include "ftnoir_tracker_base_global.h"
-#include "ftnoir_tracker_types.h"
-#include <QtGui/QWidget>
-#include <QtGui/QFrame>
-#include <QWaitCondition>
-#include <QMutex>
-#include <QFrame>
-
-////////////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-# define EXTERN_C extern "C"
-#else
-# define EXTERN_C
-#endif // __cplusplus
-
-////////////////////////////////////////////////////////////////////////////////
-// 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 ITracker
-{
- virtual ~ITracker() {}
- virtual void StartTracker( QFrame* frame ) = 0;
- virtual bool GiveHeadPoseData(double *data) = 0;
-
- virtual void WaitForExit() = 0;
-
- virtual void NotifyCenter() {}
-};
-
-typedef ITracker* ITrackerPtr;
-
-////////////////////////////////////////////////////////////////////////////////
-// 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 ITrackerDialog
-{
- virtual ~ITrackerDialog() {}
- virtual void Initialize(QWidget *parent) = 0;
- virtual void registerTracker(ITracker *tracker) = 0;
- virtual void unRegisterTracker() = 0;
-};
-
-
-////////////////////////////////////////////////////////////////////////////////
-// 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 ITrackerDll
-{
- virtual ~ITrackerDll() {}
- virtual void Initialize() = 0;
-
- virtual void getFullName(QString *strToBeFilled) = 0;
- virtual void getShortName(QString *strToBeFilled) = 0;
- virtual void getDescription(QString *strToBeFilled) = 0;
- virtual void getIcon(QIcon *icon) = 0;
-};
-
-
-#endif // FTNOIR_TRACKER_BASE_H
+/********************************************************************************
+* 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 <http://www.gnu.org/licenses/>. *
+* This class implements a tracker-base *
+*********************************************************************************/
+#ifndef FTNOIR_TRACKER_BASE_H
+#define FTNOIR_TRACKER_BASE_H
+
+#include "ftnoir_tracker_base_global.h"
+#include "ftnoir_tracker_types.h"
+#include <QWidget>
+#include <QFrame>
+#include <QWaitCondition>
+#include <QMutex>
+#include <QFrame>
+
+////////////////////////////////////////////////////////////////////////////////
+// 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 ITracker
+{
+ virtual ~ITracker() = 0;
+ virtual void StartTracker( QFrame* frame ) = 0;
+ virtual void GetHeadPoseData(double *data) = 0;
+ virtual int preferredHz() { return 200; }
+};
+
+inline ITracker::~ITracker() { }
+
+////////////////////////////////////////////////////////////////////////////////
+// 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 ITrackerDialog
+{
+ virtual ~ITrackerDialog() {}
+ virtual void registerTracker(ITracker *tracker) = 0;
+ virtual void unRegisterTracker() = 0;
+};
+
+#endif // FTNOIR_TRACKER_BASE_H
diff --git a/ftnoir_tracker_base/ftnoir_tracker_base_global.h b/ftnoir_tracker_base/ftnoir_tracker_base_global.h
index a449c282..e717d845 100644
--- a/ftnoir_tracker_base/ftnoir_tracker_base_global.h
+++ b/ftnoir_tracker_base/ftnoir_tracker_base_global.h
@@ -1,12 +1,18 @@
-#ifndef FTNOIR_TRACKER_BASE_GLOBAL_H
-#define FTNOIR_TRACKER_BASE_GLOBAL_H
-
-#include <QtGlobal>
-
-#ifdef FTNOIR_TRACKER_BASE_LIB
-# define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_EXPORT
-#else
-# define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // FTNOIR_TRACKER_BASE_GLOBAL_H
+#ifndef FTNOIR_TRACKER_BASE_GLOBAL_H
+#define FTNOIR_TRACKER_BASE_GLOBAL_H
+
+#include <QtGlobal>
+
+#ifndef FTNOIR_TRACKER_BASE_EXPORT
+# ifndef OPENTRACK_MAIN
+# if !defined(_MSC_VER)
+# define FTNOIR_TRACKER_BASE_EXPORT __attribute__ ((visibility ("default")))
+# else
+# define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_EXPORT
+# endif
+# else
+# define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_IMPORT
+# endif
+#endif
+
+#endif // FTNOIR_TRACKER_BASE_GLOBAL_H
diff --git a/ftnoir_tracker_base/ftnoir_tracker_ma_types.h b/ftnoir_tracker_base/ftnoir_tracker_ma_types.h
deleted file mode 100644
index b3101ad3..00000000
--- a/ftnoir_tracker_base/ftnoir_tracker_ma_types.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Definitions for the Shared Memory to send the data to FaceTrackNoIR
-//
-#define MA_MM_DATA "MA_SharedMem"
-#define MA_FACEAPI "MA_FaceAPI"
-#define MA_MUTEX "MA_Mutex"
-
-struct TFaceData {
- int DataID;
-// smEngineHeadPoseData new_pose;
-};
-typedef TFaceData * PFaceData;
-
-struct SMMemMap {
- int command; // Command from FaceTrackNoIR
- int status; // Status from faceAPI
- TFaceData data;
- HANDLE handle;
- int state;
- int par_val_int; // Value of parameter, indicated by 'command'
- int par_val_float;
- int initial_filter_level; // Internal faceAPI Filter level
- int handshake;
-};
-typedef SMMemMap * PSMMemMap;
-
-enum FTNoIR_Tracker_Command {
- FT_MA_START = 10,
- FT_MA_STOP = 20,
- FT_MA_SHOW_CAM = 30,
- FT_MA_SET_PAR_FILTER = 50,
- FT_MA_EXIT = 100
-};
diff --git a/ftnoir_tracker_base/ftnoir_tracker_sm_types.h b/ftnoir_tracker_base/ftnoir_tracker_sm_types.h
deleted file mode 100644
index 1faf893f..00000000
--- a/ftnoir_tracker_base/ftnoir_tracker_sm_types.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Definitions for the Shared Memory to send the data to FaceTrackNoIR
-//
-#define SM_MM_DATA "SM_SharedMem"
-#define SM_FACEAPI "SM_FaceAPI"
-#define SM_MUTEX "SM_Mutex"
-
-#include "faceapi/stdafx.h"
-#include <sm_api.h>
-
-struct TFaceData {
- int DataID;
- smEngineHeadPoseData new_pose;
-};
-typedef TFaceData * PFaceData;
-
-struct SMMemMap {
- int command; // Command from FaceTrackNoIR
- int status; // Status from faceAPI
- TFaceData data;
- HANDLE handle;
- int state;
- int par_val_int; // Value of parameter, indicated by 'command'
- int par_val_float;
- int initial_filter_level; // Internal faceAPI Filter level
- int handshake;
-};
-typedef SMMemMap * PSMMemMap;
-
-enum FTNoIR_Tracker_Command {
- FT_SM_START = 10,
- FT_SM_STOP = 20,
- FT_SM_SHOW_CAM = 30,
- FT_SM_SET_PAR_FILTER = 50,
- FT_SM_EXIT = 100
-};
diff --git a/ftnoir_tracker_base/ftnoir_tracker_types.h b/ftnoir_tracker_base/ftnoir_tracker_types.h
index 8bf12990..d38baee4 100644
--- a/ftnoir_tracker_base/ftnoir_tracker_types.h
+++ b/ftnoir_tracker_base/ftnoir_tracker_types.h
@@ -1,37 +1,4 @@
-/********************************************************************************
-* 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 <http://www.gnu.org/licenses/>. *
-* This class implements a tracker-base *
-*********************************************************************************/
-/*
- Modifications (last one on top):
- 20120924 - C14: Moved T6DOF to separate file (not pulic interface)
- 20110415 - WVR: Added overloaded operator - and -=
-*/
-#ifndef FTNOIR_TRACKER_TYPES_H
-#define FTNOIR_TRACKER_TYPES_H
-
-
-enum Axis {
- TX = 0, TY, TZ, Yaw, Pitch, Roll};
-
-#endif // FTNOIR_TRACKER_TYPES_H
+#pragma once
+enum Axis {
+ TX = 0, TY, TZ, Yaw, Pitch, Roll
+};