summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/tracker.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-04-29 23:30:37 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-04-29 23:30:37 +0200
commitd9c4dade582e506e8b7af5534399bd3a712be2b1 (patch)
treee9826ef16044a082ad76063d03126c54f33faec9 /facetracknoir/tracker.h
parentd54a040cf1ce51641bd74d3d83eae52fd70ec1b6 (diff)
Fix breakage introduced in latest commits
Diffstat (limited to 'facetracknoir/tracker.h')
-rw-r--r--facetracknoir/tracker.h115
1 files changed, 39 insertions, 76 deletions
diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h
index be39e14f..1b5baf3d 100644
--- a/facetracknoir/tracker.h
+++ b/facetracknoir/tracker.h
@@ -57,88 +57,51 @@
#include "ftnoir_filter_base/ftnoir_filter_base.h"
#include "tracker_types.h"
-// include the DirectX Library files
-//#pragma comment (lib, "dinput8.lib")
-//#pragma comment (lib, "dxguid.lib")
-
-enum AngleName {
- PITCH = 0,
- YAW = 1,
- ROLL = 2,
- X = 3,
- Y = 4,
- Z = 5
-};
-
-enum FTNoIR_Client {
- FREE_TRACK = 0,
- FLIGHTGEAR = 1,
- FTNOIR = 2,
- PPJOY = 3,
- TRACKIR = 4,
- SIMCONNECT = 5,
- FSUIPC = 6,
- MOUSE = 7
-};
-
-//enum FTNoIR_Face_Tracker {
-// FT_SM_FACEAPI = 0,
-// FT_FTNOIR = 1,
-// FT_VISAGE = 2
-//};
-
-enum FTNoIR_Tracker_Status {
- TRACKER_OFF = 0,
- TRACKER_ON = 1
-};
-
class FaceTrackNoIR; // pre-define parent-class to avoid circular includes
-struct HeadPoseData;
-extern HeadPoseData* GlobalPose;
-
//
// Structure to hold all variables concerning one of 6 DOF's
//
class THeadPoseDOF {
+private:
+ THeadPoseDOF(const THeadPoseDOF &) {}
public:
- THeadPoseDOF(QString primary = "", QString secondary= "", int maxInput1 = 50, int maxOutput1 = 180, int maxInput2 = 50, int maxOutput2 = 90) {
- curvePtr = NULL;
- curvePtrAlt = NULL;
+ THeadPoseDOF() :
+ headPos(0),
+ invert(0),
+ altp(false),
+ zero(0)
+ {
+ }
+
+ THeadPoseDOF(QString primary,
+ QString secondary,
+ int maxInput1,
+ int maxOutput1,
+ int maxInput2,
+ int maxOutput2) :
+ curve(primary, maxInput1, maxOutput1),
+ curveAlt(secondary, maxInput2, maxOutput2),
+ headPos(0),
+ invert(1),
+ zero(0)
+ {
QSettings settings("opentrack"); // 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)
-
- if (primary != "")
- {
- curvePtr = new FunctionConfig(primary, maxInput1, maxOutput1); // Create the Function-config for input-output translation
- curvePtr->loadSettings(iniFile); // Load the settings from the INI-file
- }
-
- if (secondary != "")
- {
- curvePtrAlt = new FunctionConfig(secondary, maxInput2, maxOutput2);
- curvePtrAlt->loadSettings(iniFile);
- iniFile.beginGroup("Tracking");
- altp = iniFile.value(secondary).toBool();
- iniFile.endGroup();
- }
- headPos = 0.0f;
- invert = 1;
- zero = 0;
+ QSettings iniFile( currentFile, QSettings::IniFormat );
+ curve.loadSettings(iniFile);
+ curveAlt.loadSettings(iniFile);
+
+ iniFile.beginGroup("Tracking");
+ altp = iniFile.value(secondary).toBool();
+ iniFile.endGroup();
}
float headPos; // Current position (from faceTracker, radials or meters)
float invert; // Invert measured value (= 1.0f or -1.0f)
- FunctionConfig* curvePtr; // Function to translate input -> output
- FunctionConfig* curvePtrAlt;
+ FunctionConfig curve; // Function to translate input -> output
+ FunctionConfig curveAlt;
bool altp;
float zero;
- ~THeadPoseDOF() {
- if (curvePtr)
- delete curvePtr;
- if (curvePtrAlt)
- delete curvePtrAlt;
- }
};
class Tracker : public QThread {
@@ -171,17 +134,17 @@ public:
T6DOF output_camera;
};
-struct HeadPoseData {
+class HeadPoseData {
public:
- THeadPoseDOF axes[6];
+ THeadPoseDOF* axes[6];
HeadPoseData()
{
- axes[TX] = THeadPoseDOF("tx","tx_alt", 100, 100, 100, 100);
- axes[TY] = THeadPoseDOF("ty","ty_alt", 100, 100, 100, 100);
- axes[TZ] = THeadPoseDOF("tz","tz_alt", 100, 100, 100, 100);
- axes[RX] = THeadPoseDOF("rx", "rx_alt", 180, 180, 180, 180);
- axes[RY] = THeadPoseDOF("ry", "ry_alt", 180, 180, 180, 180);
- axes[RZ] = THeadPoseDOF("rz", "rz_alt", 180, 180, 180, 180);
+ axes[TX] = new THeadPoseDOF("tx","tx_alt", 100, 100, 100, 100);
+ axes[TY] = new THeadPoseDOF("ty","ty_alt", 100, 100, 100, 100);
+ axes[TZ] = new THeadPoseDOF("tz","tz_alt", 100, 100, 100, 100);
+ axes[RX] = new THeadPoseDOF("rx", "rx_alt", 180, 180, 180, 180);
+ axes[RY] = new THeadPoseDOF("ry", "ry_alt", 180, 180, 180, 180);
+ axes[RZ] = new THeadPoseDOF("rz", "rz_alt", 180, 180, 180, 180);
}
};