diff options
Diffstat (limited to 'facetracknoir')
41 files changed, 4810 insertions, 5580 deletions
diff --git a/facetracknoir/clientfiles/FlightGear/Nasal/headtracker.xml b/facetracknoir/clientfiles/FlightGear/Nasal/headtracker.xml deleted file mode 100644 index d8bd1d0a..00000000 --- a/facetracknoir/clientfiles/FlightGear/Nasal/headtracker.xml +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0"?> - -<PropertyList> - <nasal> - <headtracker> - <script> - var Value = { - new: func(prop) { - var m = { parents: [Value] }; - m.prop = props.globals.getNode(prop, 1); - m.value = 0; - return m; - }, - apply: func(value) { - me.prop.setDoubleValue(me.prop.getValue() - me.value + value); - me.value = value; - }, - }; - - - var x = Value.new("/sim/current-view/x-offset-m"); - var y = Value.new("/sim/current-view/y-offset-m"); - var z = Value.new("/sim/current-view/z-offset-m"); - var h = Value.new("/sim/current-view/heading-offset-deg"); - var p = Value.new("/sim/current-view/pitch-offset-deg"); - var r = Value.new("/sim/current-view/roll-offset-deg"); - - - var resetting = 0; - var status = nil; - - var reset = func { - if (status != 1) { - setprop("/sim/headtracker/control", 1); - resetting = 1; - view.resetViewPos(); - view.resetViewDir(); - x.value = y.value = z.value = h.value = p.value = r.value = 0; - } - } - - setlistener("/sim/headtracker/status", func(n) { - var s = n.getValue(); - if (!status and s) { - setprop("/sim/headtracker/control", 0); - resetting = 0; - } - status = s; - }, 1, 0); - - - var loop = func { - if (!view.index and !resetting) { - x.apply(getprop("/sim/headtracker/x-m")); - y.apply(getprop("/sim/headtracker/y-m")); - z.apply(getprop("/sim/headtracker/z-m")); - - h.apply(getprop("/sim/headtracker/heading-deg")); - p.apply(getprop("/sim/headtracker/pitch-deg")); - r.apply(-1 * getprop("/sim/headtracker/roll-deg")); - } - settimer(loop, 0); - } - - loop(); - - </script> - </headtracker> - </nasal> - - <sim> - <headtracker> - <x-m type="double">0</x-m> - <y-m type="double">0</y-m> - <z-m type="double">0</z-m> - <heading-deg type="double">0</heading-deg> - <pitch-deg type="double">0</pitch-deg> - <roll-deg type="double">0</roll-deg> - <status type="int">0</status> - <control type="int">0</control> - </headtracker> - </sim> -</PropertyList> diff --git a/facetracknoir/clientfiles/FlightGear/Protocol/headtracker.xml b/facetracknoir/clientfiles/FlightGear/Protocol/headtracker.xml index cd1d0dad..8c14119a 100644 --- a/facetracknoir/clientfiles/FlightGear/Protocol/headtracker.xml +++ b/facetracknoir/clientfiles/FlightGear/Protocol/headtracker.xml @@ -11,57 +11,44 @@ <chunk> <name>x</name> <type>double</type> - <node>/sim/headtracker/x-m</node> + <node>/sim/current-view/x-offset-m</node> </chunk> <chunk> <name>y</name> <type>double</type> - <node>/sim/headtracker/y-m</node> + <node>/sim/current-view/y-offset-m</node> </chunk> <chunk> <name>z</name> <type>double</type> - <node>/sim/headtracker/z-m</node> + <node>/sim/current-view/z-offset-m</node> </chunk> <chunk> <name>heading</name> <type>double</type> - <node>/sim/headtracker/heading-deg</node> + <node>/sim/current-view/heading-offset-deg</node> </chunk> <chunk> <name>pitch</name> <type>double</type> - <node>/sim/headtracker/pitch-deg</node> + <node>/sim/current-view/pitch-offset-deg</node> </chunk> <chunk> <name>roll</name> <type>double</type> - <node>/sim/headtracker/roll-deg</node> + <node>/sim/current-view/roll-offset-deg</node> </chunk> <chunk> <name>status</name> <type>int</type> - <node>/sim/headtracker/status</node> + <node>/sim/current-view/headtracker-debug-status</node> </chunk> </input> - - <output> - <binary_mode>true</binary_mode> - <binary_footer>none</binary_footer> - <byte_order>host</byte_order> - <record_length>4</record_length> - - <chunk> - <name>control</name> - <type>int</type> - <node>/sim/headtracker/control</node> - </chunk> - </output> </generic> </PropertyList> diff --git a/facetracknoir/clientfiles/FlightGear/readme.txt b/facetracknoir/clientfiles/FlightGear/readme.txt index 75cbbcd2..0b3d9dfe 100644 --- a/facetracknoir/clientfiles/FlightGear/readme.txt +++ b/facetracknoir/clientfiles/FlightGear/readme.txt @@ -1,19 +1,8 @@ -FaceTrackNoIR for FlightGear. - -FaceTrackNoIR was made compatible with FlightGear with the help of Melchior Franz, who initially made a Linux headtracker. FaceTrackNoIR sends UDP-packets to FlightGear which contain 6DOF-data. The script and protocol provided by Melchior take care of receiving the data and moving 'the head' in-game. - -To make the FlightGear script work, copy the files in the subfolders to the corresponding folders in the FlightGear installation folder. Start FlightGear with the batch-file 'start_fg.bat'. - - -Please let us know if you like the program, if you have ideas for improvements or any questions you might have. - - - -The FaceTrackNoIR team: - -Wim Vriend -Ron Hendriks - - - -Disclaimer: For usage of 3rd party software like FlightGear, the FaceTrackNoIR team is not responsible. Use it at your own risk.
\ No newline at end of file +Copy Protocol/headtracker.xml to fgdata/Protocol/headtracker.xml
+
+$ fgfs --generic=socket,in,25,localhost,5542,udp,headtracker
+
+Adjust paths as necessary.
+
+cheers,
+-sh 20131008
diff --git a/facetracknoir/clientfiles/FlightGear/win32/start_fg.bat b/facetracknoir/clientfiles/FlightGear/win32/start_fg.bat deleted file mode 100644 index cd9829b5..00000000 --- a/facetracknoir/clientfiles/FlightGear/win32/start_fg.bat +++ /dev/null @@ -1 +0,0 @@ -fgfs --generic=socket,in,25,localhost,5550,udp,headtracker --generic=socket,out,10,localhost,5551,udp,headtracker --prop:browser=/sim/headtracker "c:\Program Files\FlightGear\data\Nasal\headtracker.xml"
\ No newline at end of file diff --git a/facetracknoir/clientfiles/aruco/test3.jpg b/facetracknoir/clientfiles/aruco/test3.jpg Binary files differnew file mode 100644 index 00000000..2ff6dbd0 --- /dev/null +++ b/facetracknoir/clientfiles/aruco/test3.jpg diff --git a/facetracknoir/clientfiles/vjoy/VJoy.dll b/facetracknoir/clientfiles/vjoy/VJoy.dll Binary files differnew file mode 100644 index 00000000..e3446675 --- /dev/null +++ b/facetracknoir/clientfiles/vjoy/VJoy.dll diff --git a/facetracknoir/curve-config.cpp b/facetracknoir/curve-config.cpp new file mode 100644 index 00000000..2bff009a --- /dev/null +++ b/facetracknoir/curve-config.cpp @@ -0,0 +1,117 @@ +#include "facetracknoir/facetracknoir.h" +#include "facetracknoir/curve-config.h" +#include <QDebug> +#include <QCheckBox> +CurveConfigurationDialog::CurveConfigurationDialog(FaceTrackNoIR *ftnoir, QWidget *parent) : + QWidget( parent, Qt::Dialog ), mainApp(ftnoir) +{ + ui.setupUi( this ); + setFont(qApp->font()); + + QPoint offsetpos(120, 30); + this->move(parent->pos() + offsetpos); + + // Connect Qt signals to member-functions + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); + + tie_setting(mainApp->s.a_x.altp, ui.tx_altp); + tie_setting(mainApp->s.a_y.altp, ui.ty_altp); + tie_setting(mainApp->s.a_z.altp, ui.tz_altp); + tie_setting(mainApp->s.a_yaw.altp, ui.rx_altp); + tie_setting(mainApp->s.a_pitch.altp, ui.ry_altp); + tie_setting(mainApp->s.a_roll.altp, ui.rz_altp); + + tie_setting(mainApp->s.tcomp_p, ui.tcomp_enable); + tie_setting(mainApp->s.tcomp_tz, ui.tcomp_rz); + + tie_setting(mainApp->s.a_x.zero, ui.pos_tx); + tie_setting(mainApp->s.a_y.zero, ui.pos_ty); + tie_setting(mainApp->s.a_z.zero, ui.pos_tz); + tie_setting(mainApp->s.a_yaw.zero, ui.pos_rx); + tie_setting(mainApp->s.a_pitch.zero, ui.pos_ry); + tie_setting(mainApp->s.a_roll.zero, ui.pos_rz); + + tie_setting(mainApp->s.a_yaw.invert, ui.chkInvertYaw); + tie_setting(mainApp->s.a_pitch.invert, ui.chkInvertPitch); + tie_setting(mainApp->s.a_roll.invert, ui.chkInvertRoll); + tie_setting(mainApp->s.a_x.invert, ui.chkInvertX); + tie_setting(mainApp->s.a_y.invert, ui.chkInvertY); + tie_setting(mainApp->s.a_z.invert, ui.chkInvertZ); + + // Load the settings from the current .INI-file + loadSettings(); +} + +void CurveConfigurationDialog::doOK() { + save(); + this->close(); +} + +void CurveConfigurationDialog::doCancel() { + mainApp->b->revert(); + loadSettings(); + close(); +} + +// +// Load the current Settings from the currently 'active' INI-file. +// +void CurveConfigurationDialog::loadSettings() { + QFunctionConfigurator* configs[6] = { + ui.txconfig, + ui.tyconfig, + ui.tzconfig, + ui.rxconfig, + ui.ryconfig, + ui.rzconfig + }; + + QFunctionConfigurator* alt_configs[6] = { + ui.txconfig_alt, + ui.tyconfig_alt, + ui.tzconfig_alt, + ui.rxconfig_alt, + ui.ryconfig_alt, + ui.rzconfig_alt + }; + + QSettings settings("opentrack"); + QString currentFile = settings.value("SettingsFile", + QCoreApplication::applicationDirPath() + "/settings/default.ini" ) + .toString(); + + for (int i = 0; i < 6; i++) + { + configs[i]->setConfig(&mainApp->axis(i).curve); + alt_configs[i]->setConfig(&mainApp->axis(i).curveAlt); + } +} + +// +// Save the current Settings to the currently 'active' INI-file. +// +void CurveConfigurationDialog::save() { + + qDebug() << "save() says: started"; + + QSettings settings("opentrack"); + QString currentFile = + settings.value("SettingsFile", + QCoreApplication::applicationDirPath() + "/settings/default.ini" ) + .toString(); + + ui.rxconfig->saveSettings(currentFile); + ui.ryconfig->saveSettings(currentFile); + ui.rzconfig->saveSettings(currentFile); + ui.txconfig->saveSettings(currentFile); + ui.tyconfig->saveSettings(currentFile); + ui.tzconfig->saveSettings(currentFile); + + ui.txconfig_alt->saveSettings(currentFile); + ui.tyconfig_alt->saveSettings(currentFile); + ui.tzconfig_alt->saveSettings(currentFile); + ui.rxconfig_alt->saveSettings(currentFile); + ui.ryconfig_alt->saveSettings(currentFile); + ui.rzconfig_alt->saveSettings(currentFile); +} diff --git a/facetracknoir/curve-config.h b/facetracknoir/curve-config.h new file mode 100644 index 00000000..0949cdc4 --- /dev/null +++ b/facetracknoir/curve-config.h @@ -0,0 +1,22 @@ +#pragma once +#include <QWidget> +#include <QPalette> +#include "ui_ftnoir_curves.h" + +class FaceTrackNoIR; + +class CurveConfigurationDialog: public QWidget +{ + Q_OBJECT +public: + CurveConfigurationDialog( FaceTrackNoIR *ftnoir, QWidget *parent ); + void loadSettings(); +private: + Ui::UICCurveConfigurationDialog ui; + void save(); + FaceTrackNoIR *mainApp; + +private slots: + void doOK(); + void doCancel(); +}; diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index bb0cef11..98c8c2c2 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -1,1604 +1,695 @@ -/********************************************************************************
-* 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) 2011 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/>. *
-*********************************************************************************/
-/*
- Modifications (last one on top):
- 20130101 - WVR: Added "None" to filter-listbox to remove "use advanced filtering".
- 20121209 - WVR: Pre-v170 DLLs will not be added to the Listbox. Initial selection was changed (made case-insensitive).
- 20121014 - WVR: Added second Tracker Source for Arduino solution. The two will be mutually exclusive.
- 20120929 - WVR: Disable button Filter-settings when StartTracker.
- 20120918 - WVR: When AutoStart is TRUE, the program is not directly minimized any more.
- This now depends on the AutoMinimize time. Fixed the 'not showing' of the MIB.
- Also disable combo and buttons after 'Start'.
- 20120917 - WVR: Added Mouse-buttons to ShortKeys.
- 20120717 - WVR: FunctionConfig is now used for the Curves, instead of BezierConfig.
- 20120427 - WVR: The Protocol-code was already in separate DLLs, but the ListBox was still filled 'statically'. Now, a Dir() of the
- EXE-folder is done, to locate Protocol-DLLs. The Icons were also moved to the DLLs
- 20120317 - WVR: The Filter and Tracker-code was moved to separate DLLs. The calling-method
- was changed accordingly. The save() and LoadSettings() functions were adapted.
- The face-tracker member-functions NotifyZeroed and refreshVideo were added, as
- requested by Stanislaw.
- 20110813 - WVR: Changed the presentation of the raw inputs: now a decimal digit will even show when '0'.
- 20110404 - WVR: Migrated the FlightGear protocol to a separate DLL. The rest must follow...
- 20110401 - WVR: The about-dialog was shown 'misplaced'. It was corrected.
- 20110328 - WVR: Added the display for output-pose.
- 20110207 - WVR: RadioButtons for 'Stop engine' added. It is now possible to choose Stop or Keep tracking.
- 20110109 - WVR: Added minimizeTaskBar option added. It is now possible to choose minimized or tray.
-*/
-#include "facetracknoir.h"
-#include "tracker.h"
-#include <ftnoir_tracker_ht/ht-api.h>
-#include <QDebug>
-
-#if defined(__WIN32) || defined(_WIN32)
-# include <windows.h>
-#endif
-
-#if defined(__APPLE__)
-# define SONAME "dylib"
-#elif defined(_WIN32) || defined(__WIN32)
-# define SONAME "dll"
-#else
-# define SONAME "so"
-#endif
-
-#include <iostream>
-
-#if defined(__WIN32) || defined(_WIN32)
-#undef DIRECTINPUT_VERSION
-#define DIRECTINPUT_VERSION 0x0800
-#include <dshow.h>
-#include <dinput.h>
-
-KeybindingWorkerDummy::~KeybindingWorkerDummy() {
- if (dinkeyboard) {
- dinkeyboard->Unacquire();
- dinkeyboard->Release();
- }
- if (din)
- din->Release();
-}
-
-KeybindingWorkerDummy::KeybindingWorkerDummy(FaceTrackNoIR& w, Key keyCenter)
-: kCenter(keyCenter), window(w), should_quit(true), din(0), dinkeyboard(0)
-{
- if (DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&din, NULL) != DI_OK) {
- qDebug() << "setup DirectInput8 Creation failed!" << GetLastError();
- return;
- }
- if (din->CreateDevice(GUID_SysKeyboard, &dinkeyboard, NULL) != DI_OK) {
- din->Release();
- din = 0;
- qDebug() << "setup CreateDevice function failed!" << GetLastError();
- return;
- }
- if (dinkeyboard->SetDataFormat(&c_dfDIKeyboard) != DI_OK) {
- qDebug() << "setup SetDataFormat function failed!" << GetLastError();
- dinkeyboard->Release();
- dinkeyboard = 0;
- din->Release();
- din = 0;
- return;
- }
-
- if (dinkeyboard->SetCooperativeLevel(window.winId(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) {
- dinkeyboard->Release();
- din->Release();
- din = 0;
- dinkeyboard = 0;
- qDebug() << "setup SetCooperativeLevel function failed!" << GetLastError();
- return;
- }
- if (dinkeyboard->Acquire() != DI_OK)
- {
- dinkeyboard->Release();
- din->Release();
- din = 0;
- dinkeyboard = 0;
- qDebug() << "setup dinkeyboard Acquire failed!" << GetLastError();
- return;
- }
- should_quit = false;
-}
-
-#define PROCESS_KEY(k, s) \
- if (isKeyPressed(&k, keystate) && (!k.ever_pressed ? (k.timer.start(), k.ever_pressed = true) : k.timer.restart() > 100)) \
- window.s();
-
-static bool isKeyPressed( const Key *key, const BYTE *keystate ) {
- bool shift;
- bool ctrl;
- bool alt;
-
- if (keystate[key->keycode] & 0x80) {
- shift = ( (keystate[DIK_LSHIFT] & 0x80) || (keystate[DIK_RSHIFT] & 0x80) );
- ctrl = ( (keystate[DIK_LCONTROL] & 0x80) || (keystate[DIK_RCONTROL] & 0x80) );
- alt = ( (keystate[DIK_LALT] & 0x80) || (keystate[DIK_RALT] & 0x80) );
-
- //
- // If one of the modifiers is needed and not pressed, return false.
- //
- if (key->shift && !shift) return false;
- if (key->ctrl && !ctrl) return false;
- if (key->alt && !alt) return false;
-
- //
- // All is well!
- //
- return true;
- }
- return false;
-}
-
-void KeybindingWorkerDummy::run() {
- BYTE keystate[256];
- while (!should_quit)
- {
- if (dinkeyboard->GetDeviceState(256, (LPVOID)keystate) != DI_OK) {
- qDebug() << "Tracker::run GetDeviceState function failed!" << GetLastError();
- Sleep(25);
- continue;
- }
-
- PROCESS_KEY(kCenter, shortcutRecentered);
-
- Sleep(25);
- }
-}
-#else
-#endif
-
-#ifdef _MSC_VER
-# define LIB_PREFIX ""
-#else
-# define LIB_PREFIX "lib"
-#endif
-
-//
-// Setup the Main Dialog
-//
-FaceTrackNoIR::FaceTrackNoIR(QWidget *parent, Qt::WFlags flags) :
- #if defined(__WIN32) || defined(_WIN32)
- keybindingWorker(NULL),
- #else
- keyCenter(0),
- #endif
- QMainWindow(parent, flags),
- pTrackerDialog(NULL),
- pSecondTrackerDialog(NULL),
- pProtocolDialog(NULL),
- pFilterDialog(NULL),
- looping(false),
- timUpdateHeadPose(this)
-{
- ui.setupUi(this);
- cameraDetected = false;
-
- //
- // Initialize Widget handles, to prevent memory-access errors.
- //
- _keyboard_shortcuts = 0;
- _curve_config = 0;
-
- tracker = 0;
-
- setupFaceTrackNoIR();
-
- //Q_INIT_RESOURCE(PoseWidget);
-
- ui.lblX->setVisible(false);
- ui.lblY->setVisible(false);
- ui.lblZ->setVisible(false);
- ui.lblRotX->setVisible(false);
- ui.lblRotY->setVisible(false);
- ui.lblRotZ->setVisible(false);
-
- ui.lcdNumOutputPosX->setVisible(false);
- ui.lcdNumOutputPosY->setVisible(false);
- ui.lcdNumOutputPosZ->setVisible(false);
- ui.lcdNumOutputRotX->setVisible(false);
- ui.lcdNumOutputRotY->setVisible(false);
- ui.lcdNumOutputRotZ->setVisible(false);
-}
-
-/** sets up all objects and connections to buttons */
-void FaceTrackNoIR::setupFaceTrackNoIR() {
- // if we simply place a global variable with THeadPoseData,
- // it gets initialized and pulls in QSettings before
- // main() starts. program can and will crash.
-
- ui.headPoseWidget->show();
- ui.video_frame->hide();
-
- // menu objects will be connected with the functions in FaceTrackNoIR class
- connect(ui.btnLoad, SIGNAL(clicked()), this, SLOT(open()));
- connect(ui.btnSave, SIGNAL(clicked()), this, SLOT(save()));
- connect(ui.btnSaveAs, SIGNAL(clicked()), this, SLOT(saveAs()));
-
- connect(ui.btnEditCurves, SIGNAL(clicked()), this, SLOT(showCurveConfiguration()));
- connect(ui.btnShortcuts, SIGNAL(clicked()), this, SLOT(showKeyboardShortcuts()));
- connect(ui.btnShowEngineControls, SIGNAL(clicked()), this, SLOT(showTrackerSettings()));
- connect(ui.btnShowSecondTrackerSettings, SIGNAL(clicked()), this, SLOT(showSecondTrackerSettings()));
- connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showServerControls()));
- connect(ui.btnShowFilterControls, SIGNAL(clicked()), this, SLOT(showFilterControls()));
-
- // Connect checkboxes
- connect(ui.chkInvertYaw, SIGNAL(stateChanged(int)), this, SLOT(setInvertYaw(int)));
- connect(ui.chkInvertRoll, SIGNAL(stateChanged(int)), this, SLOT(setInvertRoll(int)));
- connect(ui.chkInvertPitch, SIGNAL(stateChanged(int)), this, SLOT(setInvertPitch(int)));
- connect(ui.chkInvertX, SIGNAL(stateChanged(int)), this, SLOT(setInvertX(int)));
- connect(ui.chkInvertY, SIGNAL(stateChanged(int)), this, SLOT(setInvertY(int)));
- connect(ui.chkInvertZ, SIGNAL(stateChanged(int)), this, SLOT(setInvertZ(int)));
-
- // button methods connect with methods in this class
- connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker()));
- connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stopTracker()));
-
- //read the camera-name, using DirectShow
- GetCameraNameDX();
-
- //Create the system-tray and connect the events for that.
- createIconGroupBox();
-
- //Load the tracker-settings, from the INI-file
- loadSettings();
-
- connect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int)));
- connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int)));
- connect(ui.iconcomboTrackerSource, SIGNAL(currentIndexChanged(int)), this, SLOT(trackingSourceSelected(int)));
- connect(ui.iconcomboFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(filterSelected(int)));
-
- //Setup the timer for showing the headpose.
- connect(&timUpdateHeadPose, SIGNAL(timeout()), this, SLOT(showHeadPose()));
- ui.txtTracking->setVisible(false);
- settingsDirty = false;
-}
-
-/** destructor stops the engine and quits the faceapi **/
-FaceTrackNoIR::~FaceTrackNoIR() {
-
- //
- // Stop the tracker, by simulating a button-push
- //
- stopTracker();
- save();
-}
-
-//
-// Update the Settings, after a value has changed. This way, the Tracker does not have to re-start.
-//
-void FaceTrackNoIR::updateSettings() {
- if ( tracker != NULL ) {
- tracker->loadSettings();
- }
-}
-
-//
-// Get a pointer to the video-widget, to use in the DLL
-//
-QFrame *FaceTrackNoIR::get_video_widget() {
- return ui.video_frame;
-}
-
-/** read the name of the first video-capturing device at start up **/
-/** FaceAPI can only use this first one... **/
-void FaceTrackNoIR::GetCameraNameDX() {
-#if defined(_WIN32)
- ui.cameraName->setText("No video-capturing device was found in your system: check if it's connected!");
-
- // Create the System Device Enumerator.
- HRESULT hr;
- ICreateDevEnum *pSysDevEnum = NULL;
- hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum);
- if (FAILED(hr))
- {
- qDebug() << "GetWDM says: CoCreateInstance Failed!";
- return;
- }
-
- qDebug() << "GetWDM says: CoCreateInstance succeeded!";
-
- // Obtain a class enumerator for the video compressor category.
- IEnumMoniker *pEnumCat = NULL;
- hr = pSysDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnumCat, 0);
-
- if (hr == S_OK) {
- qDebug() << "GetWDM says: CreateClassEnumerator succeeded!";
-
- // Enumerate the monikers.
- IMoniker *pMoniker = NULL;
- ULONG cFetched;
- if (pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK) {
- IPropertyBag *pPropBag;
- hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag);
- if (SUCCEEDED(hr)) {
- // To retrieve the filter's friendly name, do the following:
- VARIANT varName;
- VariantInit(&varName);
- hr = pPropBag->Read(L"FriendlyName", &varName, 0);
- if (SUCCEEDED(hr))
- {
- // Display the name in your UI somehow.
- QString str((QChar*)varName.bstrVal, wcslen(varName.bstrVal));
- qDebug() << "GetWDM says: Moniker found:" << str;
- ui.cameraName->setText(str);
- }
- VariantClear(&varName);
-
- ////// To create an instance of the filter, do the following:
- ////IBaseFilter *pFilter;
- ////hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter,
- //// (void**)&pFilter);
- // Now add the filter to the graph.
- //Remember to release pFilter later.
- pPropBag->Release();
- }
- pMoniker->Release();
- }
- pEnumCat->Release();
- }
- pSysDevEnum->Release();
-#endif
-}
-
-//
-// Open an INI-file with the QFileDialog
-// If succesfull, the settings in it will be read
-//
-void FaceTrackNoIR::open() {
- QFileDialog dialog(this);
- dialog.setFileMode(QFileDialog::ExistingFile);
-
- QString fileName = dialog.getOpenFileName(
- this,
- tr("Select one FTNoir settings file"),
- QCoreApplication::applicationDirPath() + "/Settings/",
- tr("Settings file (*.ini);;All Files (*)"),
- NULL);
-
- //
- // If a file was selected, save it's name and read it's contents.
- //
- if (! fileName.isEmpty() ) {
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
- settings.setValue ("SettingsFile", QFileInfo(fileName).absoluteFilePath());
- loadSettings();
- }
-}
-
-//
-// Save the current Settings to the currently 'active' INI-file.
-//
-void FaceTrackNoIR::save() {
-
- 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)
-
- iniFile.beginGroup ( "Tracking" );
- iniFile.setValue ( "invertYaw", ui.chkInvertYaw->isChecked() );
- iniFile.setValue ( "invertPitch", ui.chkInvertPitch->isChecked() );
- iniFile.setValue ( "invertRoll", ui.chkInvertRoll->isChecked() );
- iniFile.setValue ( "invertX", ui.chkInvertX->isChecked() );
- iniFile.setValue ( "invertY", ui.chkInvertY->isChecked() );
- iniFile.setValue ( "invertZ", ui.chkInvertZ->isChecked() );
- iniFile.endGroup ();
-
- iniFile.beginGroup ( "GameProtocol" );
- {
- DynamicLibrary* proto = dlopen_protocols.value( ui.iconcomboProtocol->currentIndex(), (DynamicLibrary*) NULL);
- iniFile.setValue ( "DLL", proto == NULL ? "" : proto->filename);
- }
- iniFile.endGroup ();
-
- iniFile.beginGroup ( "TrackerSource" );
- {
- DynamicLibrary* tracker = dlopen_trackers.value( ui.iconcomboTrackerSource->currentIndex(), (DynamicLibrary*) NULL);
- iniFile.setValue ( "DLL", tracker == NULL ? "" : tracker->filename);
- }
- {
- DynamicLibrary* tracker = dlopen_trackers.value( ui.cbxSecondTrackerSource->currentIndex() - 1, (DynamicLibrary*) NULL);
- iniFile.setValue ( "2ndDLL", tracker == NULL ? "" : tracker->filename);
- }
- iniFile.endGroup ();
-
- //
- // Save the name of the filter in the INI-file.
- //
- iniFile.beginGroup ( "Filter" );
- {
- DynamicLibrary* filter = dlopen_filters.value( ui.iconcomboFilter->currentIndex(), (DynamicLibrary*) NULL);
- iniFile.setValue ( "DLL", filter == NULL ? "" : filter->filename);
- }
- iniFile.endGroup ();
-
- settingsDirty = false;
-}
-
-//
-// Get the new name of the INI-file and save the settings to it.
-//
-// The user may choose to overwrite an existing file. This will be deleted, before copying the current file to it.
-//
-void FaceTrackNoIR::saveAs()
-{
- //
- // Get the current filename of the INI-file.
- //
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
- QString oldFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
-
- //
- // Get the new filename of the INI-file.
- //
- QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"),
- oldFile,
-// QCoreApplication::applicationDirPath() + "/Settings",
- tr("Settings file (*.ini);;All Files (*)"));
- if (!fileName.isEmpty()) {
-
- //
- // Remove the file, if it already exists.
- //
- QFileInfo newFileInfo ( fileName );
- if ((newFileInfo.exists()) && (oldFile != fileName)) {
- QFile newFileFile ( fileName );
- newFileFile.remove();
- }
-
- //
- // Copy the current INI-file to the new name.
- //
- QFileInfo oldFileInfo ( oldFile );
- if (oldFileInfo.exists()) {
- QFile oldFileFile ( oldFile );
- oldFileFile.copy( fileName );
- }
-
- //
- // Write the new name to the Registry and save the other INI-values.
- //
- settings.setValue ("SettingsFile", fileName);
- save();
-
- //
- // Reload the settings, to get the GUI right again...
- //
- loadSettings();
- }
-}
-
-//
-// Load the current Settings from the currently 'active' INI-file.
-//
-void FaceTrackNoIR::loadSettings() {
- looping = true;
- qDebug() << "loadSettings says: Starting ";
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
-
- QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
- qDebug() << "Config file now" << currentFile;
- QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
-
- //
- // Put the filename in the window-title.
- //
- QFileInfo pathInfo ( currentFile );
- setWindowTitle ( "opentrack (1.8 alpha) - " + pathInfo.fileName() );
-
- //
- // Get a List of all the INI-files in the (currently active) Settings-folder.
- //
- QDir settingsDir( pathInfo.dir() );
- QStringList filters;
- filters << "*.ini";
- iniFileList.clear();
- iniFileList = settingsDir.entryList( filters, QDir::Files, QDir::Name );
-
- //
- // Add strings to the Listbox.
- //
- ui.iconcomboProfile->clear();
- for ( int i = 0; i < iniFileList.size(); i++) {
- ui.iconcomboProfile->addItem(QIcon(":/images/settings16.png"), iniFileList.at(i));
- if (iniFileList.at(i) == pathInfo.fileName()) {
- ui.iconcomboProfile->setItemIcon(i, QIcon(":/images/settingsopen16.png"));
- ui.iconcomboProfile->setCurrentIndex( i );
- }
- }
-
- qDebug() << "loadSettings says: iniFile = " << currentFile;
-
- iniFile.beginGroup ( "Tracking" );
- ui.chkInvertYaw->setChecked (iniFile.value ( "invertYaw", 0 ).toBool());
- ui.chkInvertPitch->setChecked (iniFile.value ( "invertPitch", 0 ).toBool());
- ui.chkInvertRoll->setChecked (iniFile.value ( "invertRoll", 0 ).toBool());
- ui.chkInvertX->setChecked (iniFile.value ( "invertX", 0 ).toBool());
- ui.chkInvertY->setChecked (iniFile.value ( "invertY", 0 ).toBool());
- ui.chkInvertZ->setChecked (iniFile.value ( "invertZ", 0 ).toBool());
- iniFile.endGroup ();
-
- // Read the currently selected Protocol from the INI-file.
- // If the setting "DLL" isn't found (pre-1.7 version of INI), then the setting 'Selection' is evaluated.
- //
- iniFile.beginGroup ( "GameProtocol" );
- QString selectedProtocolName = iniFile.value ( "DLL", "" ).toString();
- iniFile.endGroup ();
-
- //
- // Find the Index of the DLL and set the selection.
- //
- for ( int i = 0; i < dlopen_protocols.size(); i++) {
- if (dlopen_protocols.at(i)->filename.compare( selectedProtocolName, Qt::CaseInsensitive ) == 0) {
- ui.iconcomboProtocol->setCurrentIndex( i );
- break;
- }
- }
-
- //
- // Read the currently selected Tracker from the INI-file.
- // If the setting "DLL" isn't found (pre-1.7 version), then the setting 'Selection' is evaluated.
- //
- iniFile.beginGroup ( "TrackerSource" );
- QString selectedTrackerName = iniFile.value ( "DLL", "" ).toString();
- qDebug() << "loadSettings says: selectedTrackerName = " << selectedTrackerName;
- QString secondTrackerName = iniFile.value ( "2ndDLL", "None" ).toString();
- qDebug() << "loadSettings says: secondTrackerName = " << secondTrackerName;
- iniFile.endGroup ();
-
- for ( int i = 0; i < dlopen_trackers.size(); i++) {
- DynamicLibrary* foo = dlopen_trackers.at(i);
- if (foo && foo->filename.compare( selectedTrackerName, Qt::CaseInsensitive ) == 0) {
- ui.iconcomboTrackerSource->setCurrentIndex( i );
- }
- if (foo && foo->filename.compare( secondTrackerName, Qt::CaseInsensitive ) == 0) {
- ui.cbxSecondTrackerSource->setCurrentIndex( i + 1 );
- }
- }
-
- //
- // Read the currently selected Filter from the INI-file.
- //
- iniFile.beginGroup ( "Filter" );
- QString selectedFilterName = iniFile.value ( "DLL", "" ).toString();
- qDebug() << "createIconGroupBox says: selectedFilterName = " << selectedFilterName;
- iniFile.endGroup ();
-
- //
- // Find the Index of the DLL and set the selection.
- //
- for ( int i = 0; i < dlopen_filters.size(); i++) {
- DynamicLibrary* foo = dlopen_filters.at(i);
- if (foo && foo->filename.compare( selectedFilterName, Qt::CaseInsensitive ) == 0) {
- ui.iconcomboFilter->setCurrentIndex( i );
- break;
- }
- }
-
- settingsDirty = false;
- looping = false;
-}
-
-/** start tracking the face **/
-void FaceTrackNoIR::startTracker( ) {
- bindKeyboardShortcuts();
-
- //
- // Disable buttons
- //
- ui.iconcomboProfile->setEnabled ( false );
- ui.btnLoad->setEnabled ( false );
- ui.btnSave->setEnabled ( false );
- ui.btnSaveAs->setEnabled ( false );
- ui.btnShowFilterControls->setEnabled ( false );
-
- //
- // Create the Tracker and setup
- //
-
- if (Libraries)
- delete Libraries;
- Libraries = new SelectedLibraries(this);
-
- if (!Libraries->correct)
- {
- QMessageBox::warning(this, "Something went wrong", "Tracking can't be initialized, probably protocol prerequisites missing", QMessageBox::Ok, QMessageBox::NoButton);
- stopTracker();
- return;
- }
-
-#if defined(_WIN32) || defined(__WIN32)
- keybindingWorker = new KeybindingWorker(*this, keyCenter);
- keybindingWorker->start();
-#endif
-
- if (tracker) {
- tracker->wait();
- delete tracker;
- }
-
- 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)
-
- for (int i = 0; i < 6; i++)
- {
- axis(i).curve.loadSettings(iniFile);
- axis(i).curveAlt.loadSettings(iniFile);
- }
-
- static const char* names[] = {
- "tx_alt",
- "ty_alt",
- "tz_alt",
- "rx_alt",
- "ry_alt",
- "rz_alt",
- };
-
- static const char* invert_names[] = {
- "invertX",
- "invertY",
- "invertZ",
- "invertYaw",
- "invertPitch",
- "invertRoll"
- };
-
- iniFile.beginGroup("Tracking");
-
- for (int i = 0; i < 6; i++) {
- axis(i).altp = iniFile.value(names[i], false).toBool();
- axis(i).invert = iniFile.value(invert_names[i], false).toBool() ? 1 : -1;
- }
-
- iniFile.endGroup();
-
- tracker = new Tracker ( this );
-
- //
- // Setup the Tracker and send the settings.
- // This is necessary, because the events are only triggered 'on change'
- //
- tracker->setInvertAxis(Yaw, ui.chkInvertYaw->isChecked() );
- tracker->setInvertAxis(Pitch, ui.chkInvertPitch->isChecked() );
- tracker->setInvertAxis(Roll, ui.chkInvertRoll->isChecked() );
- tracker->setInvertAxis(TX, ui.chkInvertX->isChecked() );
- tracker->setInvertAxis(TY, ui.chkInvertY->isChecked() );
- tracker->setInvertAxis(TZ, ui.chkInvertZ->isChecked() );
-
- tracker->start();
-
- //
- // Register the Tracker instance with the Tracker Dialog (if open)
- //
- if (pTrackerDialog && Libraries->pTracker) {
- pTrackerDialog->registerTracker( Libraries->pTracker );
- }
-
- ui.headPoseWidget->show();
-
- //
- ui.btnStartTracker->setEnabled ( false );
- ui.btnStopTracker->setEnabled ( true );
-
- // Enable/disable Protocol-server Settings
- ui.iconcomboTrackerSource->setEnabled ( false );
- ui.cbxSecondTrackerSource->setEnabled ( false );
- ui.iconcomboProtocol->setEnabled ( false );
- ui.btnShowServerControls->setEnabled ( false );
- ui.iconcomboFilter->setEnabled ( false );
-
- //
- // Update the camera-name, FaceAPI can only use the 1st one found!
- //
- GetCameraNameDX();
-
- //
- // Start the timer to update the head-pose (digits and 'man in black')
- //
- timUpdateHeadPose.start(40);
-
- ui.lblX->setVisible(true);
- ui.lblY->setVisible(true);
- ui.lblZ->setVisible(true);
- ui.lblRotX->setVisible(true);
- ui.lblRotY->setVisible(true);
- ui.lblRotZ->setVisible(true);
-
- ui.lcdNumOutputPosX->setVisible(true);
- ui.lcdNumOutputPosY->setVisible(true);
- ui.lcdNumOutputPosZ->setVisible(true);
- ui.lcdNumOutputRotX->setVisible(true);
- ui.lcdNumOutputRotY->setVisible(true);
- ui.lcdNumOutputRotZ->setVisible(true);
-}
-
-/** stop tracking the face **/
-void FaceTrackNoIR::stopTracker( ) {
- ui.game_name->setText("Not connected");
-#if defined(_WIN32) || defined(__WIN32)
- if (keybindingWorker)
- {
- keybindingWorker->should_quit = true;
- keybindingWorker->wait();
- delete keybindingWorker;
- keybindingWorker = NULL;
- }
-#endif
- //
- // Stop displaying the head-pose.
- //
- timUpdateHeadPose.stop();
- ui.pose_display->rotateBy(0, 0, 0);
-
- ui.lblX->setVisible(false);
- ui.lblY->setVisible(false);
- ui.lblZ->setVisible(false);
- ui.lblRotX->setVisible(false);
- ui.lblRotY->setVisible(false);
- ui.lblRotZ->setVisible(false);
-
- ui.lcdNumOutputPosX->setVisible(false);
- ui.lcdNumOutputPosY->setVisible(false);
- ui.lcdNumOutputPosZ->setVisible(false);
- ui.lcdNumOutputRotX->setVisible(false);
- ui.lcdNumOutputRotY->setVisible(false);
- ui.lcdNumOutputRotZ->setVisible(false);
- ui.txtTracking->setVisible(false);
-
- //
- // Delete the tracker (after stopping things and all).
- //
- if ( tracker ) {
- qDebug() << "Done with tracking";
- tracker->should_quit = true;
- tracker->wait();
-
- qDebug() << "stopTracker says: Deleting tracker!";
- delete tracker;
- qDebug() << "stopTracker says: Tracker deleted!";
- tracker = 0;
- if (Libraries) {
- delete Libraries;
- Libraries = NULL;
- }
- }
-
- //
- // UnRegister the Tracker instance with the Tracker Dialog (if open)
- //
- if (pTrackerDialog) {
- pTrackerDialog->unRegisterTracker();
- }
- if (pProtocolDialog) {
- pProtocolDialog->unRegisterProtocol();
- }
- ui.btnStartTracker->setEnabled ( true );
- ui.btnStopTracker->setEnabled ( false );
-// ui.btnShowEngineControls->setEnabled ( false );
- ui.iconcomboProtocol->setEnabled ( true );
- ui.iconcomboTrackerSource->setEnabled ( true );
- ui.cbxSecondTrackerSource->setEnabled ( true );
- ui.iconcomboFilter->setEnabled ( true );
-
- // Enable/disable Protocol-server Settings
- ui.btnShowServerControls->setEnabled ( true );
- ui.video_frame->hide();
-
- //
- ui.iconcomboProfile->setEnabled ( true );
- ui.btnLoad->setEnabled ( true );
- ui.btnSave->setEnabled ( true );
- ui.btnSaveAs->setEnabled ( true );
- ui.btnShowFilterControls->setEnabled ( true );
-}
-
-/** set the invert from the checkbox **/
-void FaceTrackNoIR::setInvertAxis(Axis axis, int invert ) {
- if (tracker)
- tracker->setInvertAxis (axis, (invert != 0)?true:false );
- settingsDirty = true;
-}
-
-/** Show the headpose in the widget (triggered by timer) **/
-void FaceTrackNoIR::showHeadPose() {
- double newdata[6];
-
- ui.lblX->setVisible(true);
- ui.lblY->setVisible(true);
- ui.lblZ->setVisible(true);
- ui.lblRotX->setVisible(true);
- ui.lblRotY->setVisible(true);
- ui.lblRotZ->setVisible(true);
-
- ui.lcdNumOutputPosX->setVisible(true);
- ui.lcdNumOutputPosY->setVisible(true);
- ui.lcdNumOutputPosZ->setVisible(true);
- ui.lcdNumOutputRotX->setVisible(true);
- ui.lcdNumOutputRotY->setVisible(true);
- ui.lcdNumOutputRotZ->setVisible(true);
-
- //
- // Get the pose and also display it.
- // Updating the pose from within the Tracker-class caused crashes...
- //
- tracker->getHeadPose(newdata);
- ui.lcdNumX->display(QString("%1").arg(newdata[TX], 0, 'f', 1));
- ui.lcdNumY->display(QString("%1").arg(newdata[TY], 0, 'f', 1));
- ui.lcdNumZ->display(QString("%1").arg(newdata[TZ], 0, 'f', 1));
-
-
- ui.lcdNumRotX->display(QString("%1").arg(newdata[Yaw], 0, 'f', 1));
- ui.lcdNumRotY->display(QString("%1").arg(newdata[Pitch], 0, 'f', 1));
- ui.lcdNumRotZ->display(QString("%1").arg(newdata[Roll], 0, 'f', 1));
-
- ui.txtTracking->setVisible(tracker->getTrackingActive());
-
- //
- // Get the output-pose and also display it.
- //
- tracker->getOutputHeadPose(newdata);
-
- ui.pose_display->rotateBy(newdata[Yaw], newdata[Roll], newdata[Pitch]);
-
- ui.lcdNumOutputPosX->display(QString("%1").arg(newdata[TX], 0, 'f', 1));
- ui.lcdNumOutputPosY->display(QString("%1").arg(newdata[TY], 0, 'f', 1));
- ui.lcdNumOutputPosZ->display(QString("%1").arg(newdata[TZ], 0, 'f', 1));
-
-
- ui.lcdNumOutputRotX->display(QString("%1").arg(newdata[Yaw], 0, 'f', 1));
- ui.lcdNumOutputRotY->display(QString("%1").arg(newdata[Pitch], 0, 'f', 1));
- ui.lcdNumOutputRotZ->display(QString("%1").arg(newdata[Roll], 0, 'f', 1));
-
- //
- // Update the curves in the curve-configurator. This shows the ball with the red lines.
- //
- if (_curve_config) {
- _curve_config->update();
- }
- if (Libraries->pProtocol)
- {
- QString name = Libraries->pProtocol->getGameName();
- ui.game_name->setText(name);
- }
-}
-
-/** toggles Video Widget **/
-void FaceTrackNoIR::showVideoWidget() {
- if(ui.video_frame->isHidden())
- ui.video_frame->show();
- else
- ui.video_frame->hide();
-}
-
-/** toggles Video Widget **/
-void FaceTrackNoIR::showHeadPoseWidget() {
- if(ui.headPoseWidget->isHidden())
- ui.headPoseWidget->show();
- else
- ui.headPoseWidget->hide();
-}
-
-/** toggles Engine Controls Dialog **/
-void FaceTrackNoIR::showTrackerSettings() {
- if (pTrackerDialog) {
- delete pTrackerDialog;
- pTrackerDialog = NULL;
- }
-
- DynamicLibrary* lib = dlopen_trackers.value(ui.iconcomboTrackerSource->currentIndex(), (DynamicLibrary*) NULL);
-
- if (lib) {
- pTrackerDialog = (ITrackerDialog*) lib->Dialog();
- if (pTrackerDialog) {
- pTrackerDialog->Initialize(this);
- if (Libraries && Libraries->pTracker)
- pTrackerDialog->registerTracker(Libraries->pTracker);
- }
- }
-}
-
-// Show the Settings dialog for the secondary Tracker
-void FaceTrackNoIR::showSecondTrackerSettings() {
- if (pSecondTrackerDialog) {
- delete pSecondTrackerDialog;
- pSecondTrackerDialog = NULL;
- }
-
- DynamicLibrary* lib = dlopen_trackers.value(ui.cbxSecondTrackerSource->currentIndex() - 1, (DynamicLibrary*) NULL);
-
- if (lib) {
- pSecondTrackerDialog = (ITrackerDialog*) lib->Dialog();
- if (pSecondTrackerDialog) {
- pSecondTrackerDialog->Initialize(this);
- if (Libraries && Libraries->pSecondTracker)
- pSecondTrackerDialog->registerTracker(Libraries->pSecondTracker);
- }
- }
-}
-
-/** toggles Server Controls Dialog **/
-void FaceTrackNoIR::showServerControls() {
- if (pProtocolDialog) {
- delete pProtocolDialog;
- pProtocolDialog = NULL;
- }
-
- DynamicLibrary* lib = dlopen_protocols.value(ui.iconcomboProtocol->currentIndex(), (DynamicLibrary*) NULL);
-
- if (lib && lib->Dialog) {
- pProtocolDialog = (IProtocolDialog*) lib->Dialog();
- if (pProtocolDialog) {
- pProtocolDialog->Initialize(this);
- }
- }
-}
-
-/** toggles Filter Controls Dialog **/
-void FaceTrackNoIR::showFilterControls() {
- if (pFilterDialog) {
- delete pFilterDialog;
- pFilterDialog = NULL;
- }
-
- DynamicLibrary* lib = dlopen_filters.value(ui.iconcomboFilter->currentIndex(), (DynamicLibrary*) NULL);
-
- if (lib && lib->Dialog) {
- pFilterDialog = (IFilterDialog*) lib->Dialog();
- if (pFilterDialog) {
- pFilterDialog->Initialize(this, Libraries ? Libraries->pFilter : NULL);
- }
- }
-}
-/** toggles Keyboard Shortcut Dialog **/
-void FaceTrackNoIR::showKeyboardShortcuts() {
-
- // Create if new
- if (!_keyboard_shortcuts)
- {
- _keyboard_shortcuts = new KeyboardShortcutDialog( this, this, Qt::Dialog );
- }
-
- // Show if already created
- if (_keyboard_shortcuts) {
- _keyboard_shortcuts->show();
- _keyboard_shortcuts->raise();
- }
-}
-
-/** toggles Curve Configuration Dialog **/
-void FaceTrackNoIR::showCurveConfiguration() {
-
- // Create if new
- if (!_curve_config)
- {
- _curve_config = new CurveConfigurationDialog( this, this, Qt::Dialog );
- }
-
- // Show if already created
- if (_curve_config) {
- _curve_config->show();
- _curve_config->raise();
- }
-}
-
-/** exit application **/
-void FaceTrackNoIR::exit() {
- QCoreApplication::exit(0);
-}
-
-//
-// Setup the icons for the comboBoxes
-//
-void FaceTrackNoIR::createIconGroupBox()
-{
- QDir settingsDir( QCoreApplication::applicationDirPath() );
-
- {
- QStringList protocols = settingsDir.entryList( QStringList() << (LIB_PREFIX "opentrack-proto-*." SONAME), QDir::Files, QDir::Name );
- for ( int i = 0; i < protocols.size(); i++) {
- QIcon icon;
- QString longName;
- QString str = protocols.at(i);
- DynamicLibrary* lib = new DynamicLibrary(str);
- qDebug() << "Loading" << str;
- std::cout.flush();
- Metadata* meta;
- if (!lib->Metadata || ((meta = lib->Metadata()), !meta))
- {
- delete lib;
- continue;
- }
- meta->getFullName(&longName);
- meta->getIcon(&icon);
- delete meta;
- dlopen_protocols.push_back(lib);
- ui.iconcomboProtocol->addItem(icon, longName);
- }
- }
-
- {
- ui.cbxSecondTrackerSource->addItem(QIcon(), "None");
- QStringList trackers = settingsDir.entryList( QStringList() << (LIB_PREFIX "opentrack-tracker-*." SONAME), QDir::Files, QDir::Name );
- for ( int i = 0; i < trackers.size(); i++) {
- QIcon icon;
- QString longName;
- QString str = trackers.at(i);
- DynamicLibrary* lib = new DynamicLibrary(str);
- qDebug() << "Loading" << str;
- std::cout.flush();
- Metadata* meta;
- if (!lib->Metadata || ((meta = lib->Metadata()), !meta))
- {
- delete lib;
- continue;
- }
- meta->getFullName(&longName);
- meta->getIcon(&icon);
- delete meta;
- dlopen_trackers.push_back(lib);
- ui.iconcomboTrackerSource->addItem(icon, longName);
- ui.cbxSecondTrackerSource->addItem(icon, longName);
- }
- }
-
- {
- dlopen_filters.push_back((DynamicLibrary*) NULL);
- ui.iconcomboFilter->addItem(QIcon(), "None");
- QStringList filters = settingsDir.entryList( QStringList() << (LIB_PREFIX "opentrack-filter-*." SONAME), QDir::Files, QDir::Name );
- for ( int i = 0; i < filters.size(); i++) {
- QIcon icon;
- QString fullName;
- QString str = filters.at(i);
- DynamicLibrary* lib = new DynamicLibrary(str);
- qDebug() << "Loading" << str;
- std::cout.flush();
- Metadata* meta;
- if (!lib->Metadata || ((meta = lib->Metadata()), !meta))
- {
- delete lib;
- continue;
- }
- meta->getFullName(&fullName);
- meta->getIcon(&icon);
- delete meta;
- dlopen_filters.push_back(lib);
- ui.iconcomboFilter->addItem(icon, fullName);
- }
- }
-
- connect(ui.iconcomboProtocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolSelected(int)));
- connect(ui.iconcomboTrackerSource, SIGNAL(currentIndexChanged(int)), this, SLOT(trackingSourceSelected(int)));
- connect(ui.iconcomboFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(filterSelected(int)));
- connect(ui.cbxSecondTrackerSource, SIGNAL(currentIndexChanged(int)), this, SLOT(trackingSourceSelected(int)));
-}
-
-//
-// Handle changes of the Protocol selection
-//
-void FaceTrackNoIR::protocolSelected(int index)
-{
- settingsDirty = true;
- ui.btnShowServerControls->setEnabled ( true );
-
- //setWindowIcon(QIcon(":/images/FaceTrackNoIR.png"));
- //breaks with transparency -sh
- //ui.btnShowServerControls->setIcon(icon);]
-}
-
-//
-// Handle changes of the Tracking Source selection
-//
-void FaceTrackNoIR::trackingSourceSelected(int index)
-{
- settingsDirty = true;
- ui.btnShowEngineControls->setEnabled ( true );
-}
-
-//
-// Handle changes of the Profile selection
-//
-void FaceTrackNoIR::profileSelected(int index)
-{
- if (looping)
- return;
- //
- // Read the current INI-file setting, to get the folder in which it's located...
- //
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
- QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
- QFileInfo pathInfo ( currentFile );
-
- //
- // Save the name of the INI-file in the Registry.
- //
- settings.setValue ("SettingsFile", pathInfo.absolutePath() + "/" + iniFileList.value(ui.iconcomboProfile->currentIndex(), ""));
- loadSettings();
-}
-
-//
-// Handle changes of the Filter selection
-//
-void FaceTrackNoIR::filterSelected(int index)
-{
- settingsDirty = true;
-
- //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)
-
- ui.btnShowFilterControls->setEnabled ( true );
-}
-
-//**************************************************************************************************//
-//**************************************************************************************************//
-//
-// Constructor for Keyboard-shortcuts-dialog
-//
-KeyboardShortcutDialog::KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent, Qt::WindowFlags f ) :
-QWidget( parent , f)
-{
- ui.setupUi( this );
-
- QPoint offsetpos(100, 100);
- this->move(parent->pos() + offsetpos);
-
- mainApp = ftnoir; // Preserve a pointer to FTNoIR
-
- // Connect Qt signals to member-functions
- connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
- connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
-
- connect(ui.cbxCenterKey, SIGNAL(currentIndexChanged(int)), this, SLOT(keyChanged( int )));
- connect(ui.chkCenterShift, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
- connect(ui.chkCenterCtrl, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
- connect(ui.chkCenterAlt, SIGNAL(stateChanged(int)), this, SLOT(keyChanged(int)));
-
- // Clear the Lists with key-descriptions and keycodes and build the Lists
- // The strings will all be added to the ListBoxes for each Shortkey
- //
-
- // Add strings to the Listboxes.
- //
-
- for ( int i = 0; i < global_key_sequences.size(); i++) {
- ui.cbxCenterKey->addItem(global_key_sequences.at(i));
- }
-
- // Load the settings from the current .INI-file
- loadSettings();
-}
-
-//
-// Destructor for server-dialog
-//
-KeyboardShortcutDialog::~KeyboardShortcutDialog() {
- qDebug() << "~KeyboardShortcutDialog() says: started";
-}
-
-//
-// OK clicked on server-dialog
-//
-void KeyboardShortcutDialog::doOK() {
- save();
- this->close();
- mainApp->bindKeyboardShortcuts();
-}
-
-// override show event
-void KeyboardShortcutDialog::showEvent ( QShowEvent * event ) {
- loadSettings();
-}
-
-//
-// Cancel clicked on server-dialog
-//
-void KeyboardShortcutDialog::doCancel() {
- //
- // Ask if changed Settings should be saved
- //
- if (settingsDirty) {
- int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard );
-
- qDebug() << "doCancel says: answer =" << ret;
-
- switch (ret) {
- case QMessageBox::Save:
- save();
- this->close();
- break;
- case QMessageBox::Discard:
- this->close();
- break;
- case QMessageBox::Cancel:
- // Cancel was clicked
- break;
- default:
- // should never be reached
- break;
- }
- }
- else {
- this->close();
- }
-}
-
-void FaceTrackNoIR::bindKeyboardShortcuts()
-{
- 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)
- iniFile.beginGroup ( "KB_Shortcuts" );
- int idxCenter = iniFile.value("Key_index_Center", 0).toInt();
-
-#if !defined(_WIN32) && !defined(__WIN32)
- if (keyCenter) {
- delete keyCenter;
- keyCenter = NULL;
- }
-
- if (idxCenter > 0)
- {
- QString seq(global_key_sequences.value(idxCenter, ""));
- if (!seq.isEmpty())
- {
- if (iniFile.value("Shift_Center", false).toBool())
- seq = "Shift+" + seq;
- if (iniFile.value("Alt_Center", false).toBool())
- seq = "Alt+" + seq;
- if (iniFile.value("Ctrl_Center", false).toBool())
- seq = "Ctrl+" + seq;
- keyCenter = new QxtGlobalShortcut(QKeySequence(seq));
- connect(keyCenter, SIGNAL(activated()), this, SLOT(shortcutRecentered()));
- }
- }
-
-#else
- keyCenter.keycode = 0;
- keyCenter.shift = keyCenter.alt = keyCenter.ctrl = 0;
- if (idxCenter > 0 && idxCenter < global_windows_key_sequences.size())
- keyCenter.keycode = global_windows_key_sequences[idxCenter];
- keyCenter.shift = iniFile.value("Shift_Center", false).toBool();
- keyCenter.alt = iniFile.value("Alt_Center", false).toBool();
- keyCenter.ctrl = iniFile.value("Ctrl_Center", false).toBool();
-#endif
- iniFile.endGroup ();
-}
-
-//
-// Load the current Settings from the currently 'active' INI-file.
-//
-void KeyboardShortcutDialog::loadSettings() {
- qDebug() << "loadSettings says: Starting ";
- 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)
-
- qDebug() << "loadSettings says: iniFile = " << currentFile;
-
- iniFile.beginGroup ( "KB_Shortcuts" );
-
- ui.chkCenterShift->setChecked (iniFile.value ( "Shift_Center", 0 ).toBool());
- ui.chkCenterCtrl->setChecked (iniFile.value ( "Ctrl_Center", 0 ).toBool());
- ui.chkCenterAlt->setChecked (iniFile.value ( "Alt_Center", 0 ).toBool());
-
- ui.cbxCenterKey->setCurrentIndex(iniFile.value("Key_index_Center", 0).toInt());
-
- iniFile.endGroup ();
-
- settingsDirty = false;
-
-}
-
-//
-// Save the current Settings to the currently 'active' INI-file.
-//
-void KeyboardShortcutDialog::save() {
-
- qDebug() << "save() says: started";
-
- 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)
-
- iniFile.beginGroup ( "KB_Shortcuts" );
- iniFile.setValue ( "Key_index_Center", ui.cbxCenterKey->currentIndex() );
- iniFile.setValue ( "Shift_Center", ui.chkCenterShift->isChecked() );
- iniFile.setValue ( "Ctrl_Center", ui.chkCenterCtrl->isChecked() );
- iniFile.setValue ( "Alt_Center", ui.chkCenterAlt->isChecked() );
-
- iniFile.endGroup ();
-
- settingsDirty = false;
-
- //
- // Send a message to the main program, to update the Settings (for the tracker)
- //
- mainApp->updateSettings();
-}
-
-//**************************************************************************************************//
-//**************************************************************************************************//
-//
-// Constructor for Curve-configuration-dialog
-//
-CurveConfigurationDialog::CurveConfigurationDialog( FaceTrackNoIR *ftnoir, QWidget *parent, Qt::WindowFlags f ) :
-QWidget( parent , f)
-{
- ui.setupUi( this );
-
- QPoint offsetpos(120, 30);
- this->move(parent->pos() + offsetpos);
-
- mainApp = ftnoir; // Preserve a pointer to FTNoIR
-
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
- QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
-
- QFunctionConfigurator* configs[6] = {
- ui.txconfig,
- ui.tyconfig,
- ui.tzconfig,
- ui.rxconfig,
- ui.ryconfig,
- ui.rzconfig
- };
-
- QFunctionConfigurator* alt_configs[6] = {
- ui.txconfig_alt,
- ui.tyconfig_alt,
- ui.tzconfig_alt,
- ui.rxconfig_alt,
- ui.ryconfig_alt,
- ui.rzconfig_alt
- };
-
- QCheckBox* checkboxes[6] = {
- ui.rx_altp,
- ui.ry_altp,
- ui.rz_altp,
- ui.tx_altp,
- ui.ty_altp,
- ui.tz_altp
- };
-
- for (int i = 0; i < 6; i++)
- {
- configs[i]->setConfig(&mainApp->axis(i).curve, currentFile);
- alt_configs[i]->setConfig(&mainApp->axis(i).curveAlt, currentFile);
- connect(configs[i], SIGNAL(CurveChanged(bool)), this, SLOT(curveChanged(bool)));
- connect(alt_configs[i], SIGNAL(CurveChanged(bool)), this, SLOT(curveChanged(bool)));
- connect(checkboxes[i], SIGNAL(stateChanged(int)), this, SLOT(curveChanged(int)));
- }
-
- // Connect Qt signals to member-functions
- connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK()));
- connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel()));
-
- // Load the settings from the current .INI-file
- loadSettings();
-}
-
-//
-// Destructor for server-dialog
-//
-CurveConfigurationDialog::~CurveConfigurationDialog() {
- qDebug() << "~CurveConfigurationDialog() says: started";
-}
-
-//
-// OK clicked on server-dialog
-//
-void CurveConfigurationDialog::doOK() {
- save();
- this->close();
-}
-
-// override show event
-void CurveConfigurationDialog::showEvent ( QShowEvent * event ) {
- loadSettings();
-}
-
-//
-// Cancel clicked on server-dialog
-//
-void CurveConfigurationDialog::doCancel() {
- //
- // Ask if changed Settings should be saved
- //
- if (settingsDirty) {
- int ret = QMessageBox::question ( this, "Settings have changed", "Do you want to save the settings?", QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Discard );
-
- qDebug() << "doCancel says: answer =" << ret;
-
- switch (ret) {
- case QMessageBox::Save:
- save();
- this->close();
- break;
- case QMessageBox::Discard:
- this->close();
- break;
- case QMessageBox::Cancel:
- // Cancel was clicked
- break;
- default:
- // should never be reached
- break;
- }
- }
- else {
- this->close();
- }
-}
-
-//
-// Load the current Settings from the currently 'active' INI-file.
-//
-void CurveConfigurationDialog::loadSettings() {
- qDebug() << "loadSettings says: Starting ";
- 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)
-
- qDebug() << "loadSettings says: iniFile = " << currentFile;
-
- static const char* names[] = {
- "tx_alt",
- "ty_alt",
- "tz_alt",
- "rx_alt",
- "ry_alt",
- "rz_alt"
- };
-
- iniFile.beginGroup("Tracking");
-
- for (int i = 0; i < 6; i++)
- mainApp->axis(i).altp = iniFile.value(names[i], false).toBool();
-
- QCheckBox* widgets[] = {
- ui.tx_altp,
- ui.ty_altp,
- ui.tz_altp,
- ui.rx_altp,
- ui.ry_altp,
- ui.rz_altp
- };
-
- for (int i = 0; i < 6; i++)
- widgets[i]->setChecked(mainApp->axis(i).altp);
-
- QDoubleSpinBox* widgets2[] = {
- ui.pos_tx,
- ui.pos_ty,
- ui.pos_tz,
- ui.pos_tx,
- ui.pos_ry,
- ui.pos_rz
- };
-
- const char* names2[] = {
- "zero_tx",
- "zero_ty",
- "zero_tz",
- "zero_rx",
- "zero_ry",
- "zero_rz"
- };
-
- for (int i = 0; i < 6; i++)
- widgets2[i]->setValue(iniFile.value(names2[i], 0).toDouble());
-
- iniFile.endGroup();
-
- settingsDirty = false;
-}
-
-//
-// Save the current Settings to the currently 'active' INI-file.
-//
-void CurveConfigurationDialog::save() {
-
- qDebug() << "save() says: started";
-
- QSettings settings("opentrack"); // Registry settings (in HK_USER)
-
- QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/Settings/default.ini" ).toString();
-
- ui.rxconfig->saveSettings(currentFile);
- ui.ryconfig->saveSettings(currentFile);
- ui.rzconfig->saveSettings(currentFile);
- ui.txconfig->saveSettings(currentFile);
- ui.tyconfig->saveSettings(currentFile);
- ui.tzconfig->saveSettings(currentFile);
-
- ui.txconfig_alt->saveSettings(currentFile);
- ui.tyconfig_alt->saveSettings(currentFile);
- ui.tzconfig_alt->saveSettings(currentFile);
- ui.rxconfig_alt->saveSettings(currentFile);
- ui.ryconfig_alt->saveSettings(currentFile);
- ui.rzconfig_alt->saveSettings(currentFile);
-
- QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file)
-
- iniFile.beginGroup("Tracking");
-
- iniFile.setValue("rx_alt", ui.rx_altp->checkState() != Qt::Unchecked);
- iniFile.setValue("ry_alt", ui.ry_altp->checkState() != Qt::Unchecked);
- iniFile.setValue("rz_alt", ui.rz_altp->checkState() != Qt::Unchecked);
- iniFile.setValue("tx_alt", ui.tx_altp->checkState() != Qt::Unchecked);
- iniFile.setValue("ty_alt", ui.ty_altp->checkState() != Qt::Unchecked);
- iniFile.setValue("tz_alt", ui.tz_altp->checkState() != Qt::Unchecked);
-
- QDoubleSpinBox* widgets2[] = {
- ui.pos_tx,
- ui.pos_ty,
- ui.pos_tz,
- ui.pos_tx,
- ui.pos_ry,
- ui.pos_rz
- };
-
- const char* names2[] = {
- "zero_tx",
- "zero_ty",
- "zero_tz",
- "zero_rx",
- "zero_ry",
- "zero_rz"
- };
-
- for (int i = 0; i < 6; i++)
- iniFile.setValue(names2[i], widgets2[i]->value());
-
- iniFile.endGroup();
-
- settingsDirty = false;
-
- //
- // Send a message to the main program, to update the Settings (for the tracker)
- //
- mainApp->updateSettings();
-}
-
-void FaceTrackNoIR::shortcutRecentered()
-{
- if (tracker)
- {
-#if defined(__WIN32) || defined(_WIN32)
- MessageBeep(MB_OK);
-#else
- QApplication::beep();
-#endif
- qDebug() << "Center";
- tracker->do_center = true;
- }
-}
+/******************************************************************************** +* 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) 2011 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/>. * +*********************************************************************************/ +#include "facetracknoir.h" +#include "shortcuts.h" +#include "tracker.h" +#include "curve-config.h" +#include "opentrack-version.h" +#include <QDebug> + +#if defined(_WIN32) +# include <windows.h> +# include <dshow.h> +#endif + +#if defined(__APPLE__) +# define SONAME "dylib" +#elif defined(_WIN32) +# define SONAME "dll" +#else +# define SONAME "so" +#endif + +#include <iostream> + +#ifdef _MSC_VER +# define LIB_PREFIX "" +#else +# define LIB_PREFIX "lib" +#endif + +#if defined(__unix) || defined(__linux) || defined(__APPLE__) +# include <unistd.h> +#endif + +static bool get_metadata(DynamicLibrary* lib, QString& longName, QIcon& icon) +{ + Metadata* meta; + if (!lib->Metadata || ((meta = lib->Metadata()), !meta)) + return false; + meta->getFullName(&longName); + meta->getIcon(&icon); + delete meta; + return true; +} + +static void fill_combobox(const QString& filter, QList<DynamicLibrary*>& list, QComboBox* cbx, QComboBox* cbx2) +{ + QDir settingsDir( QCoreApplication::applicationDirPath() ); + QStringList filenames = settingsDir.entryList( QStringList() << (LIB_PREFIX + filter + SONAME), QDir::Files, QDir::Name ); + for ( int i = 0; i < filenames.size(); i++) { + QIcon icon; + QString longName; + QString str = filenames.at(i); + DynamicLibrary* lib = new DynamicLibrary(str); + qDebug() << "Loading" << str; + std::cout.flush(); + if (!get_metadata(lib, longName, icon)) + { + delete lib; + continue; + } + list.push_back(lib); + cbx->addItem(icon, longName); + if (cbx2) + cbx2->addItem(icon, longName); + } +} + +FaceTrackNoIR::FaceTrackNoIR(QWidget *parent) : + QMainWindow(parent), +#if defined(_WIN32) + keybindingWorker(NULL), +#else + keyCenter(this), + keyToggle(this), +#endif + b(bundle("opentrack-ui")), + s(b), + pose(std::vector<axis_opts*>{&s.a_x, &s.a_y, &s.a_z, &s.a_yaw, &s.a_pitch, &s.a_roll}), + timUpdateHeadPose(this), + pTrackerDialog(NULL), + pSecondTrackerDialog(NULL), + pProtocolDialog(NULL), + pFilterDialog(NULL), + kbd_quit(QKeySequence("Ctrl+Q"), this), + looping(false) +{ + ui.setupUi(this); + setFixedSize(size()); + + _keyboard_shortcuts = 0; + _curve_config = 0; + + tracker = 0; + + CurveConfigurationDialog* ccd; + + if (!_curve_config) + { + ccd = new CurveConfigurationDialog( this, this ); + _curve_config = ccd; + } else { + ccd = dynamic_cast<CurveConfigurationDialog*>(_curve_config); + } + + QDir::setCurrent(QCoreApplication::applicationDirPath()); + + fill_profile_cbx(); + + connect(ui.btnLoad, SIGNAL(clicked()), this, SLOT(open())); + connect(ui.btnSave, SIGNAL(clicked()), this, SLOT(save())); + connect(ui.btnSaveAs, SIGNAL(clicked()), this, SLOT(saveAs())); + + connect(ui.btnEditCurves, SIGNAL(clicked()), this, SLOT(showCurveConfiguration())); + connect(ui.btnShortcuts, SIGNAL(clicked()), this, SLOT(showKeyboardShortcuts())); + connect(ui.btnShowEngineControls, SIGNAL(clicked()), this, SLOT(showTrackerSettings())); + connect(ui.btnShowSecondTrackerSettings, SIGNAL(clicked()), this, SLOT(showSecondTrackerSettings())); + connect(ui.btnShowServerControls, SIGNAL(clicked()), this, SLOT(showServerControls())); + connect(ui.btnShowFilterControls, SIGNAL(clicked()), this, SLOT(showFilterControls())); + + ui.cbxSecondTrackerSource->addItem(QIcon(), ""); + dlopen_filters.push_back((DynamicLibrary*) NULL); + ui.iconcomboFilter->addItem(QIcon(), ""); + + fill_combobox("opentrack-proto-*.", dlopen_protocols, ui.iconcomboProtocol, NULL); + fill_combobox("opentrack-tracker-*.", dlopen_trackers, ui.iconcomboTrackerSource, ui.cbxSecondTrackerSource); + fill_combobox("opentrack-filter-*.", dlopen_filters, ui.iconcomboFilter, NULL); + + tie_setting(s.tracker_dll, ui.iconcomboTrackerSource); + tie_setting(s.tracker2_dll, ui.cbxSecondTrackerSource); + tie_setting(s.protocol_dll, ui.iconcomboProtocol); + tie_setting(s.filter_dll, ui.iconcomboFilter); + + connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker())); + connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stopTracker())); + + GetCameraNameDX(); + + connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int))); + connect(&timUpdateHeadPose, SIGNAL(timeout()), this, SLOT(showHeadPose())); + +#ifndef _WIN32 + connect(&keyCenter, SIGNAL(activated()), this, SLOT(shortcutRecentered())); + connect(&keyToggle, SIGNAL(activated()), this, SLOT(shortcutToggled())); +#endif + + connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); + kbd_quit.setEnabled(true); +} + +FaceTrackNoIR::~FaceTrackNoIR() { + + stopTracker(); + save(); + if (Libraries) + delete Libraries; +} + +QFrame* FaceTrackNoIR::get_video_widget() { + return ui.video_frame; +} + +void FaceTrackNoIR::GetCameraNameDX() { +#if defined(_WIN32) + ui.cameraName->setText("No video-capturing device was found in your system: check if it's connected!"); + + // Create the System Device Enumerator. + HRESULT hr; + ICreateDevEnum *pSysDevEnum = NULL; + hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum); + if (FAILED(hr)) + { + qDebug() << "GetWDM says: CoCreateInstance Failed!"; + return; + } + + qDebug() << "GetWDM says: CoCreateInstance succeeded!"; + + // Obtain a class enumerator for the video compressor category. + IEnumMoniker *pEnumCat = NULL; + hr = pSysDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnumCat, 0); + + if (hr == S_OK) { + qDebug() << "GetWDM says: CreateClassEnumerator succeeded!"; + + IMoniker *pMoniker = NULL; + ULONG cFetched; + if (pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK) { + IPropertyBag *pPropBag; + hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag); + if (SUCCEEDED(hr)) { + VARIANT varName; + VariantInit(&varName); + hr = pPropBag->Read(L"FriendlyName", &varName, 0); + if (SUCCEEDED(hr)) + { + QString str((QChar*)varName.bstrVal, wcslen(varName.bstrVal)); + qDebug() << "GetWDM says: Moniker found:" << str; + ui.cameraName->setText(str); + } + VariantClear(&varName); + + pPropBag->Release(); + } + pMoniker->Release(); + } + pEnumCat->Release(); + } + pSysDevEnum->Release(); +#else + for (int i = 0; i < 16; i++) { + char buf[128]; + sprintf(buf, "/dev/video%d", i); + if (access(buf, R_OK | W_OK) == 0) { + ui.cameraName->setText(QString(buf)); + break; + } + } +#endif +} + +void FaceTrackNoIR::open() { + QFileDialog dialog(this); + dialog.setFileMode(QFileDialog::ExistingFile); + + QString fileName = dialog.getOpenFileName( + this, + tr("Open the settings file"), + QCoreApplication::applicationDirPath() + "/settings/", + tr("Settings file (*.ini);;All Files (*)"), + NULL); + + if (! fileName.isEmpty() ) { + { + QSettings settings("opentrack"); + settings.setValue ("SettingsFile", QFileInfo(fileName).absoluteFilePath()); + } + looping = true; + fill_profile_cbx(); + loadSettings(); + looping = false; + } +} + +void FaceTrackNoIR::save() { + b->save(); + + QSettings settings("opentrack"); + + QString currentFile = + settings.value("SettingsFile", + QCoreApplication::applicationDirPath() + "/settings/default.ini") + .toString(); + +#if defined(__unix) || defined(__linux) + QByteArray bytes = QFile::encodeName(currentFile); + const char* filename_as_asciiz = bytes.constData(); + + if (access(filename_as_asciiz, R_OK | W_OK)) + { + QMessageBox::warning(this, "Something went wrong", "Check permissions and ownership for your .ini file!", QMessageBox::Ok, QMessageBox::NoButton); + } +#endif +} + +void FaceTrackNoIR::saveAs() +{ + looping = true; + QSettings settings("opentrack"); + QString oldFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + + QString fileName = QFileDialog::getSaveFileName(this, tr("Save file"), + oldFile, + tr("Settings file (*.ini);;All Files (*)")); + if (!fileName.isEmpty()) { + + QFileInfo newFileInfo ( fileName ); + if ((newFileInfo.exists()) && (oldFile != fileName)) { + QFile newFileFile ( fileName ); + newFileFile.remove(); + } + + QFileInfo oldFileInfo ( oldFile ); + if (oldFileInfo.exists()) { + QFile oldFileFile ( oldFile ); + oldFileFile.copy( fileName ); + } + + settings.setValue ("SettingsFile", fileName); + save(); + } + + looping = false; + fill_profile_cbx(); +} + +void FaceTrackNoIR::loadSettings() { + b->reload(); + (dynamic_cast<CurveConfigurationDialog*>(_curve_config))->loadSettings(); +} + +void FaceTrackNoIR::updateButtonState(bool running) +{ + bool e = !running; + ui.iconcomboProfile->setEnabled ( e ); + ui.btnLoad->setEnabled ( e ); + ui.btnSaveAs->setEnabled ( e ); + ui.btnStartTracker->setEnabled ( e ); + ui.btnStopTracker->setEnabled ( running ); + ui.iconcomboProtocol->setEnabled ( e ); + ui.btnShowServerControls->setEnabled ( e ); + ui.iconcomboFilter->setEnabled ( e ); + ui.iconcomboTrackerSource->setEnabled(e); + ui.cbxSecondTrackerSource->setEnabled(e); + + ui.btnStartTracker->setEnabled(e); + ui.btnStopTracker->setEnabled(running); +} + +void FaceTrackNoIR::startTracker( ) { + b->save(); + loadSettings(); + bindKeyboardShortcuts(); + + if (Libraries) + delete Libraries; + Libraries = new SelectedLibraries(this); + + if (!Libraries->correct) + { + QMessageBox::warning(this, "Something went wrong", "Tracking can't be initialized, probably protocol prerequisites missing", QMessageBox::Ok, QMessageBox::NoButton); + stopTracker(); + return; + } + +#if defined(_WIN32) + keybindingWorker = new KeybindingWorker(*this, keyCenter, keyToggle); + keybindingWorker->start(); +#endif + + if (tracker) { + delete tracker; + } + + { + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings iniFile( currentFile, QSettings::IniFormat ); + + for (int i = 0; i < 6; i++) + { + axis(i).curve.loadSettings(iniFile); + axis(i).curveAlt.loadSettings(iniFile); + } + } + + tracker = new Tracker ( this, s ); + + if (pTrackerDialog && Libraries->pTracker) { + pTrackerDialog->registerTracker( Libraries->pTracker ); + } + + if (pFilterDialog && Libraries->pFilter) + pFilterDialog->registerFilter(Libraries->pFilter); + + tracker->start(); + + ui.video_frame->show(); + + timUpdateHeadPose.start(50); + + updateButtonState(true); +} + +void FaceTrackNoIR::stopTracker( ) { + ui.game_name->setText("Not connected"); +#if defined(_WIN32) + if (keybindingWorker) + { + keybindingWorker->should_quit = true; + keybindingWorker->wait(); + delete keybindingWorker; + keybindingWorker = NULL; + } +#endif + timUpdateHeadPose.stop(); + ui.pose_display->rotateBy(0, 0, 0); + + if (pTrackerDialog) { + pTrackerDialog->unRegisterTracker(); + delete pTrackerDialog; + pTrackerDialog = nullptr; + } + if (pProtocolDialog) { + pProtocolDialog->unRegisterProtocol(); + delete pProtocolDialog; + pProtocolDialog = nullptr; + } + if (pFilterDialog) + { + pFilterDialog->unregisterFilter(); + delete pFilterDialog; + pFilterDialog = nullptr; + } + if (pSecondTrackerDialog) + { + pSecondTrackerDialog->unRegisterTracker(); + delete pSecondTrackerDialog; + pSecondTrackerDialog = nullptr; + } + + if ( tracker ) { + delete tracker; + tracker = 0; + if (Libraries) { + delete Libraries; + Libraries = NULL; + } + } + updateButtonState(false); +} + +void FaceTrackNoIR::showHeadPose() { + double newdata[6]; + + tracker->getHeadPose(newdata); + ui.lcdNumX->display(newdata[TX]); + ui.lcdNumY->display(newdata[TY]); + ui.lcdNumZ->display(newdata[TZ]); + + + ui.lcdNumRotX->display(newdata[Yaw]); + ui.lcdNumRotY->display(newdata[Pitch]); + ui.lcdNumRotZ->display(newdata[Roll]); + + tracker->getOutputHeadPose(newdata); + + ui.pose_display->rotateBy(newdata[Yaw], newdata[Roll], newdata[Pitch]); + + ui.lcdNumOutputPosX->display(newdata[TX]); + ui.lcdNumOutputPosY->display(newdata[TY]); + ui.lcdNumOutputPosZ->display(newdata[TZ]); + + ui.lcdNumOutputRotX->display(newdata[Yaw]); + ui.lcdNumOutputRotY->display(newdata[Pitch]); + ui.lcdNumOutputRotZ->display(newdata[Roll]); + + if (_curve_config) { + _curve_config->update(); + } + if (Libraries->pProtocol) + { + const QString name = Libraries->pProtocol->getGameName(); + ui.game_name->setText(name); + } +} + +void FaceTrackNoIR::showTrackerSettings() { + if (pTrackerDialog) { + delete pTrackerDialog; + pTrackerDialog = NULL; + } + + DynamicLibrary* lib = dlopen_trackers.value(ui.iconcomboTrackerSource->currentIndex(), (DynamicLibrary*) NULL); + + if (lib) { + pTrackerDialog = (ITrackerDialog*) lib->Dialog(); + if (pTrackerDialog) { + auto foo = dynamic_cast<QWidget*>(pTrackerDialog); + foo->setFixedSize(foo->size()); + if (Libraries && Libraries->pTracker) + pTrackerDialog->registerTracker(Libraries->pTracker); + dynamic_cast<QWidget*>(pTrackerDialog)->show(); + } + } +} + +void FaceTrackNoIR::showSecondTrackerSettings() { + if (pSecondTrackerDialog) { + delete pSecondTrackerDialog; + pSecondTrackerDialog = NULL; + } + + DynamicLibrary* lib = dlopen_trackers.value(ui.cbxSecondTrackerSource->currentIndex() - 1, (DynamicLibrary*) NULL); + + if (lib) { + pSecondTrackerDialog = (ITrackerDialog*) lib->Dialog(); + if (pSecondTrackerDialog) { + auto foo = dynamic_cast<QWidget*>(pSecondTrackerDialog); + foo->setFixedSize(foo->size()); + if (Libraries && Libraries->pSecondTracker) + pSecondTrackerDialog->registerTracker(Libraries->pSecondTracker); + dynamic_cast<QWidget*>(pSecondTrackerDialog)->show(); + } + } +} + +void FaceTrackNoIR::showServerControls() { + if (pProtocolDialog) { + delete pProtocolDialog; + pProtocolDialog = NULL; + } + + DynamicLibrary* lib = dlopen_protocols.value(ui.iconcomboProtocol->currentIndex(), (DynamicLibrary*) NULL); + + if (lib && lib->Dialog) { + pProtocolDialog = (IProtocolDialog*) lib->Dialog(); + if (pProtocolDialog) { + auto foo = dynamic_cast<QWidget*>(pProtocolDialog); + foo->setFixedSize(foo->size()); + dynamic_cast<QWidget*>(pProtocolDialog)->show(); + } + } +} + +void FaceTrackNoIR::showFilterControls() { + if (pFilterDialog) { + delete pFilterDialog; + pFilterDialog = NULL; + } + + DynamicLibrary* lib = dlopen_filters.value(ui.iconcomboFilter->currentIndex(), (DynamicLibrary*) NULL); + + if (lib && lib->Dialog) { + pFilterDialog = (IFilterDialog*) lib->Dialog(); + if (pFilterDialog) { + auto foo = dynamic_cast<QWidget*>(pFilterDialog); + foo->setFixedSize(foo->size()); + if (Libraries && Libraries->pFilter) + pFilterDialog->registerFilter(Libraries->pFilter); + dynamic_cast<QWidget*>(pFilterDialog)->show(); + } + } +} +void FaceTrackNoIR::showKeyboardShortcuts() { + + if (!_keyboard_shortcuts) + { + _keyboard_shortcuts = new KeyboardShortcutDialog( this, this ); + } + + _keyboard_shortcuts->show(); + _keyboard_shortcuts->raise(); +} +void FaceTrackNoIR::showCurveConfiguration() { + + if (!_curve_config) + { + _curve_config = new CurveConfigurationDialog( this, this ); + } + + if (_curve_config) { + _curve_config->show(); + _curve_config->raise(); + } +} + +void FaceTrackNoIR::exit() { + QCoreApplication::exit(0); +} + +void FaceTrackNoIR::fill_profile_cbx() +{ + if (looping) + return; + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + qDebug() << "Config file now" << currentFile; + QFileInfo pathInfo ( currentFile ); + setWindowTitle(QString( OPENTRACK_VERSION " :: ") + pathInfo.fileName()); + QDir settingsDir( pathInfo.dir() ); + QStringList filters; + filters << "*.ini"; + auto iniFileList = settingsDir.entryList( filters, QDir::Files, QDir::Name ); + ui.iconcomboProfile->clear(); + for ( int i = 0; i < iniFileList.size(); i++) { + ui.iconcomboProfile->addItem(QIcon(":/images/settings16.png"), iniFileList.at(i)); + if (iniFileList.at(i) == pathInfo.fileName()) { + ui.iconcomboProfile->setCurrentIndex( i ); + } + } +} + +void FaceTrackNoIR::profileSelected(int index) +{ + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QFileInfo pathInfo ( currentFile ); + settings.setValue ("SettingsFile", pathInfo.absolutePath() + "/" + ui.iconcomboProfile->itemText(index)); + loadSettings(); +} + +#if !defined(_WIN32) +void FaceTrackNoIR::bind_keyboard_shortcut(QxtGlobalShortcut& key, key_opts& k) +{ + key.setShortcut(QKeySequence::fromString("")); + key.setDisabled(); + const int idx = k.key_index; + if (idx > 0) + { + QString seq(global_key_sequences.value(idx, "")); + if (!seq.isEmpty()) + { + if (k.shift) + seq = "Shift+" + seq; + if (k.alt) + seq = "Alt+" + seq; + if (k.ctrl) + seq = "Ctrl+" + seq; + key.setShortcut(QKeySequence::fromString(seq, QKeySequence::PortableText)); + key.setEnabled(); + } else { + key.setDisabled(); + } + } +} +#else +static void bind_keyboard_shortcut(Key& key, key_opts& k) +{ + int idx = k.key_index; + if (idx > 0) + { + key.keycode = 0; + key.shift = key.alt = key.ctrl = 0; + if (idx < global_windows_key_sequences.size()) + key.keycode = global_windows_key_sequences[idx]; + key.shift = k.shift; + key.alt = k.alt; + key.ctrl = k.ctrl; + } +} +#endif + +void FaceTrackNoIR::bindKeyboardShortcuts() +{ +#if !defined(_WIN32) + bind_keyboard_shortcut(keyCenter, s.center_key); + bind_keyboard_shortcut(keyToggle, s.toggle_key); +#else + bind_keyboard_shortcut(keyCenter, s.center_key); + bind_keyboard_shortcut(keyToggle, s.toggle_key); +#endif + if (tracker) /* running already */ + { +#if defined(_WIN32) + if (keybindingWorker) + { + keybindingWorker->should_quit = true; + keybindingWorker->wait(); + delete keybindingWorker; + keybindingWorker = NULL; + } + keybindingWorker = new KeybindingWorker(*this, keyCenter, keyToggle); + keybindingWorker->start(); +#endif + } +} + +void FaceTrackNoIR::shortcutRecentered() +{ + QApplication::beep(); + + qDebug() << "Center"; + if (tracker) + tracker->do_center = true; +} + +void FaceTrackNoIR::shortcutToggled() +{ + QApplication::beep(); + qDebug() << "Toggle"; + if (tracker) + tracker->enabled = !tracker->enabled; +} diff --git a/facetracknoir/facetracknoir.h b/facetracknoir/facetracknoir.h index fd9c06a7..50a6e0ec 100644 --- a/facetracknoir/facetracknoir.h +++ b/facetracknoir/facetracknoir.h @@ -1,297 +1,165 @@ -/********************************************************************************
-* 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/>. *
-*********************************************************************************/
-
-#ifndef FaceTrackNoIR_H
-#define FaceTrackNoIR_H
-
-#undef FTNOIR_PROTOCOL_BASE_LIB
-#undef FTNOIR_TRACKER_BASE_LIB
-#undef FTNOIR_FILTER_BASE_LIB
-#define FTNOIR_PROTOCOL_BASE_EXPORT Q_DECL_IMPORT
-#define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_IMPORT
-#define FTNOIR_FILTER_BASE_EXPORT Q_DECL_IMPORT
-
-#include <QtGui/QMainWindow>
-#include <QApplication>
-#include <QFileDialog>
-#include <QListView>
-#include <QPainter>
-#include <QWidget>
-#include <QDialog>
-#include <QUrl>
-#include <QList>
-#include <QKeySequence>
-#include <QtGui>
-#include <QString>
-#if !defined(_WIN32) && !defined(__WIN32)
-# include <qxtglobalshortcut.h>
-#else
-# include <windows.h>
-#endif
-#include <QThread>
-#include <QDebug>
-#include <QElapsedTimer>
-
-
-#include "ui_facetracknoir.h"
-#include "ui_ftnoir_keyboardshortcuts.h"
-#include "ui_ftnoir_curves.h"
-
-#include "ftnoir_protocol_base/ftnoir_protocol_base.h"
-#include "ftnoir_tracker_base/ftnoir_tracker_base.h"
-#include "ftnoir_filter_base/ftnoir_filter_base.h"
-
-#include "global-settings.h"
-#include "tracker.h"
-
-class Tracker; // pre-define class to avoid circular includes
-class FaceTrackNoIR;
-
-class KeybindingWorker;
-
-#if defined(__WIN32) || defined(_WIN32)
-extern QList<int> global_windows_key_sequences;
-#undef DIRECTINPUT_VERSION
-#define DIRECTINPUT_VERSION 0x0800
-#include <dinput.h>
-struct Key {
- BYTE keycode;
- bool shift;
- bool ctrl;
- bool alt;
- bool ever_pressed;
- QElapsedTimer timer;
-public:
- Key() : keycode(0), shift(false), ctrl(false), alt(false), ever_pressed(false)
- {
- }
-};
-#else
-typedef unsigned char BYTE;
-struct Key { int foo; };
-#endif
-
-class FaceTrackNoIR : public QMainWindow, IDynamicLibraryProvider
-{
- Q_OBJECT
-
-public:
- FaceTrackNoIR(QWidget *parent = 0, Qt::WFlags flags = 0);
- ~FaceTrackNoIR();
-
- void updateSettings(); // Update the settings (let Tracker read INI-file).
-
- QFrame *get_video_widget(); // Get a pointer to the video-widget, to use in the DLL
- Tracker *tracker;
- void bindKeyboardShortcuts();
- DynamicLibrary* current_tracker1() {
- return dlopen_trackers.value(ui.iconcomboTrackerSource->currentIndex(), (DynamicLibrary*) NULL);
- }
- DynamicLibrary* current_tracker2() {
- return dlopen_trackers.value(ui.cbxSecondTrackerSource->currentIndex() - 1, (DynamicLibrary*) NULL);
- }
- DynamicLibrary* current_protocol() {
- return dlopen_protocols.value(ui.iconcomboProtocol->currentIndex(), (DynamicLibrary*) NULL);
- }
- DynamicLibrary* current_filter() {
- return dlopen_filters.value(ui.iconcomboFilter->currentIndex(), (DynamicLibrary*) NULL);
- }
- THeadPoseDOF& axis(int idx) {
- return *pose.axes[idx];
- }
-
-#if defined(_WIN32) || defined(__WIN32)
- Key keyCenter;
- KeybindingWorker* keybindingWorker;
-#else
- QxtGlobalShortcut* keyCenter;
-#endif
-public slots:
- void shortcutRecentered();
-
-private:
- HeadPoseData pose;
- Ui::FaceTrackNoIRClass ui;
- QTimer timUpdateHeadPose; // Timer to display headpose
- QStringList iniFileList; // List of INI-files, that are present in the Settings folder
-
- ITrackerDialog* pTrackerDialog; // Pointer to Tracker dialog instance (in DLL)
- ITrackerDialog* pSecondTrackerDialog; // Pointer to the second Tracker dialog instance (in DLL)
- IProtocolDialog* pProtocolDialog; // Pointer to Protocol dialog instance (in DLL)
- IFilterDialog* pFilterDialog; // Pointer to Filter dialog instance (in DLL)
-
- /** Widget variables **/
- QWidget *_keyboard_shortcuts;
- QWidget *_curve_config;
-
- void createIconGroupBox();
-// void createMessageGroupBox();
-
- /** helper **/
- bool cameraDetected;
- bool settingsDirty;
-
- void GetCameraNameDX();
- void loadSettings();
- void setupFaceTrackNoIR();
-
- QList<DynamicLibrary*> dlopen_filters;
- QList<DynamicLibrary*> dlopen_trackers;
- QList<DynamicLibrary*> dlopen_protocols;
-
- bool looping;
-
- private slots:
- //file menu
- void open();
- void save();
- void saveAs();
- void exit();
-// void setIcon(int index);
- void profileSelected(int index);
- void protocolSelected(int index);
- void filterSelected(int index);
- void trackingSourceSelected(int index);
-
- void showVideoWidget();
- void showHeadPoseWidget();
- void showTrackerSettings();
- void showSecondTrackerSettings();
-
- void showServerControls();
- void showFilterControls();
- void showKeyboardShortcuts();
- void showCurveConfiguration();
-
- void setInvertAxis( Axis axis, int invert );
- void setInvertYaw(int invert) {
- setInvertAxis(Yaw, invert);
- }
- void setInvertPitch(int invert) {
- setInvertAxis(Pitch, invert);
- }
- void setInvertRoll(int invert) {
- setInvertAxis(Roll, invert);
- }
- void setInvertX(int invert) {
- setInvertAxis(TX, invert);
- }
- void setInvertY(int invert) {
- setInvertAxis(TY, invert);
- }
- void setInvertZ(int invert) {
- setInvertAxis(TZ, invert);
- }
- void showHeadPose();
-
- void startTracker();
- void stopTracker();
-
-};
-
-class KeyboardShortcutDialog: public QWidget
-{
- Q_OBJECT
-public:
-
- explicit KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent=0, Qt::WindowFlags f=0 );
- virtual ~KeyboardShortcutDialog();
- void showEvent ( QShowEvent * event );
-
-private:
- Ui::UICKeyboardShortcutDialog ui;
- void loadSettings();
- void save();
-
- /** helper **/
- bool settingsDirty;
- FaceTrackNoIR *mainApp;
-
-private slots:
- void doOK();
- void doCancel();
- void keyChanged( int index ) { settingsDirty = true; }
- void keyChanged( bool index ) { settingsDirty = true; }
-};
-
-// Widget that has controls for Keyboard shortcuts.
-class CurveConfigurationDialog: public QWidget
-{
- Q_OBJECT
-public:
-
- explicit CurveConfigurationDialog( FaceTrackNoIR *ftnoir, QWidget *parent=0, Qt::WindowFlags f=0 );
- virtual ~CurveConfigurationDialog();
- void showEvent ( QShowEvent * event );
-
-private:
- Ui::UICCurveConfigurationDialog ui;
- void loadSettings();
- void save();
-
- /** helper **/
- bool settingsDirty;
- FaceTrackNoIR *mainApp;
-
-private slots:
- void doOK();
- void doCancel();
- void curveChanged( bool change ) { settingsDirty = true; }
- void curveChanged( int change ) { settingsDirty = true; }
-};
-
-#endif // FaceTrackNoIR_H
-
-extern QList<QString> global_key_sequences;
-#if defined(__WIN32) || defined(_WIN32)
-class KeybindingWorkerDummy {
-private:
- LPDIRECTINPUT8 din;
- LPDIRECTINPUTDEVICE8 dinkeyboard;
- Key kCenter;
- FaceTrackNoIR& window;
-public:
- volatile bool should_quit;
- ~KeybindingWorkerDummy();
- KeybindingWorkerDummy(FaceTrackNoIR& w, Key keyCenter);
- void run();
-};
-#else
-class KeybindingWorkerDummy {
-public:
- KeybindingWorkerDummy(FaceTrackNoIR& w, Key keyCenter);
- void run() {}
-};
-#endif
-
-class KeybindingWorker : public QThread, public KeybindingWorkerDummy {
- Q_OBJECT
-public:
- KeybindingWorker(FaceTrackNoIR& w, Key keyCenter) : KeybindingWorkerDummy(w, keyCenter)
- {
- }
- void run() {
- KeybindingWorkerDummy::run();
- }
-};
+/******************************************************************************** +* 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/>. * +*********************************************************************************/ + +#ifndef FaceTrackNoIR_H +#define FaceTrackNoIR_H + +#include <QMainWindow> +#include <QApplication> +#include <QFileDialog> +#include <QListView> +#include <QPainter> +#include <QWidget> +#include <QDialog> +#include <QUrl> +#include <QList> +#include <QKeySequence> +#include <QtGui> +#include <QString> +#include <QByteArray> +#include <QShortcut> +#include <vector> +#if !defined(_WIN32) +# include "qxt-mini/QxtGlobalShortcut" +#else +# include <windows.h> +#endif +#include <QThread> +#include <QDebug> + +#include "ui_facetracknoir.h" + +#include "facetracknoir/options.h" +using namespace options; + +#include "facetracknoir/main-settings.hpp" + +#include "global-settings.h" +#include "tracker.h" +#include "facetracknoir/shortcuts.h" + +#include "ftnoir_protocol_base/ftnoir_protocol_base.h" +#include "ftnoir_tracker_base/ftnoir_tracker_base.h" +#include "ftnoir_filter_base/ftnoir_filter_base.h" + +#include "opentrack-version.h" + +class Tracker; // pre-define class to avoid circular includes +class FaceTrackNoIR; + +class KeybindingWorker; + +class FaceTrackNoIR : public QMainWindow, IDynamicLibraryProvider +{ + Q_OBJECT + +public: + FaceTrackNoIR(QWidget *parent = 0); + ~FaceTrackNoIR(); + + QFrame *get_video_widget(); // Get a pointer to the video-widget, to use in the DLL + Tracker *tracker; + void bindKeyboardShortcuts(); + DynamicLibrary* current_tracker1() { + return dlopen_trackers.value(ui.iconcomboTrackerSource->currentIndex(), (DynamicLibrary*) NULL); + } + DynamicLibrary* current_tracker2() { + return dlopen_trackers.value(ui.cbxSecondTrackerSource->currentIndex() - 1, (DynamicLibrary*) NULL); + } + DynamicLibrary* current_protocol() { + return dlopen_protocols.value(ui.iconcomboProtocol->currentIndex(), (DynamicLibrary*) NULL); + } + DynamicLibrary* current_filter() { + return dlopen_filters.value(ui.iconcomboFilter->currentIndex(), (DynamicLibrary*) NULL); + } + THeadPoseDOF& axis(int idx) { + return *pose.axes[idx]; + } + +#if defined(_WIN32) + Key keyCenter; + Key keyToggle; + KeybindingWorker* keybindingWorker; +#else + QxtGlobalShortcut keyCenter; + QxtGlobalShortcut keyToggle; +#endif + pbundle b; + main_settings s; +public slots: + void shortcutRecentered(); + void shortcutToggled(); + +private: + HeadPoseData pose; + Ui::OpentrackUI ui; + QTimer timUpdateHeadPose; // Timer to display headpose + + ITrackerDialog* pTrackerDialog; // Pointer to Tracker dialog instance (in DLL) + ITrackerDialog* pSecondTrackerDialog; // Pointer to the second Tracker dialog instance (in DLL) + IProtocolDialog* pProtocolDialog; // Pointer to Protocol dialog instance (in DLL) + IFilterDialog* pFilterDialog; // Pointer to Filter dialog instance (in DLL) + + QWidget *_keyboard_shortcuts; + QWidget *_curve_config; + + void createIconGroupBox(); + + void GetCameraNameDX(); + void loadSettings(); + void updateButtonState(bool); + + QList<DynamicLibrary*> dlopen_filters; + QList<DynamicLibrary*> dlopen_trackers; + QList<DynamicLibrary*> dlopen_protocols; + QShortcut kbd_quit; + +#ifndef _WIN32 + void bind_keyboard_shortcut(QxtGlobalShortcut&, key_opts& k); +#endif + void fill_profile_cbx(); + bool looping; + +private slots: + void open(); + void save(); + void saveAs(); + void exit(); + void profileSelected(int index); + + void showTrackerSettings(); + void showSecondTrackerSettings(); + + void showServerControls(); + void showFilterControls(); + void showKeyboardShortcuts(); + void showCurveConfiguration(); + + void showHeadPose(); + + void startTracker(); + void stopTracker(); +}; + +#endif // FaceTrackNoIR_H diff --git a/facetracknoir/facetracknoir.ico b/facetracknoir/facetracknoir.ico Binary files differindex 5115066c..5cac8da1 100644 --- a/facetracknoir/facetracknoir.ico +++ b/facetracknoir/facetracknoir.ico diff --git a/facetracknoir/facetracknoir.ui b/facetracknoir/facetracknoir.ui index ee5fb5b0..b257ae30 100644 --- a/facetracknoir/facetracknoir.ui +++ b/facetracknoir/facetracknoir.ui @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>WVR</author>
- <class>FaceTrackNoIRClass</class>
- <widget class="QMainWindow" name="FaceTrackNoIRClass">
+ <class>OpentrackUI</class>
+ <widget class="QMainWindow" name="OpentrackUI">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
@@ -10,125 +10,41 @@ <rect>
<x>0</x>
<y>0</y>
- <width>874</width>
- <height>380</height>
+ <width>790</width>
+ <height>500</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>874</width>
- <height>380</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>874</width>
- <height>380</height>
+ <width>65536</width>
+ <height>65536</height>
</size>
</property>
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="windowTitle">
- <string>FaceTrackNoIR</string>
+ <string>opentrack</string>
</property>
<property name="windowIcon">
- <iconset resource="../ftnoir_protocol_ftn/ftn-protocol.qrc">
+ <iconset resource="main-facetracknoir.qrc">
<normaloff>:/images/facetracknoir.png</normaloff>:/images/facetracknoir.png</iconset>
</property>
<property name="toolTip">
<string/>
</property>
- <property name="styleSheet">
- <string notr="true">/* Customize any plain widget that is a child of a QMainWindow. */
-QMainWindow > .QWidget {
- background-color: rgb(100, 100, 100);
-}
-
-/* Set the selection colors for all widgets. */
-QWidget {
- selection-color: black;
- selection-background-color: Silver;
- color: black;
-}
-
-/* Specials for individual widget(s) */
-QWidget#widget {
-/* background-color: #484848;*/
- background-color: #595959;
- border-left: 1px solid #000;
-}
-
-/* Specials for individual widget(s) */
-QWidget#widget4logo {
- background-color: #000000;
-}
-
-/* Specials for individual widget(s) */
-QWidget#headPoseWidget {
- background-color: #595959;
-}
-
-QWidget#widget4video {
-/* background-color: #595959;*/
-}
-
-QWidget#Leftwidget {
- background-color: ;
-}
-
-QWidget#widgetTop {
- background-color: #595959;
- border-bottom: 1px solid #000;
-}
-
-/* Make text in message boxes selectable. */
-QMessageBox {
- /* LinksAccessibleByMouse | TextSelectableByMouse */
- messagebox-text-interaction-flags: 5;
-}
-
-/* Make the entire row selected in item views. */
-QAbstractItemView {
- show-decoration-selected: 1;
-}
-
-/* Nice WindowsXP-style password character for password line edits. */
-QLineEdit[echoMode="2"] {
- lineedit-password-character: 9679;
-}
-
-/* Customize tooltips. */
-QToolTip {
- background-color: rgb(170, 255, 127);
- opacity: 200;
-}
-
-/* Customize push buttons and comboboxes. Our read-only combobox
- is very similar to a push button, so they share the same border image. */
-
-QPushButton {
- min-width: 4em;
-}
-
-QCheckBox {
- background:none;
-}
-
-QPushButton:disabled {
- color: rgb(128, 128, 128);
-}
-
-QGroupBox {
- color: rgb(255, 255, 255);
-}</string>
- </property>
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
@@ -143,1888 +59,819 @@ QGroupBox { </property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>874</width>
- <height>380</height>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65535</width>
+ <height>65535</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
- <widget class="QWidget" name="widget" native="true">
- <property name="enabled">
- <bool>true</bool>
- </property>
+ <widget class="QFrame" name="video_frame">
<property name="geometry">
<rect>
- <x>250</x>
- <y>0</y>
- <width>671</width>
- <height>431</height>
+ <x>10</x>
+ <y>130</y>
+ <width>320</width>
+ <height>240</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>400</width>
- <height>419</height>
+ <width>250</width>
+ <height>187</height>
</size>
</property>
- <property name="palette">
- <palette>
- <active>
- <colorrole role="WindowText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Button">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Text">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="ButtonText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Base">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Window">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Highlight">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>192</red>
- <green>192</green>
- <blue>192</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="HighlightedText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="AlternateBase">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>72</red>
- <green>72</green>
- <blue>72</blue>
- </color>
- </brush>
- </colorrole>
- </active>
- <inactive>
- <colorrole role="WindowText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Button">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Text">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="ButtonText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Base">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Window">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Highlight">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>192</red>
- <green>192</green>
- <blue>192</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="HighlightedText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="AlternateBase">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>72</red>
- <green>72</green>
- <blue>72</blue>
- </color>
- </brush>
- </colorrole>
- </inactive>
- <disabled>
- <colorrole role="WindowText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Button">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Text">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="ButtonText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Base">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Window">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>89</red>
- <green>89</green>
- <blue>89</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="Highlight">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>192</red>
- <green>192</green>
- <blue>192</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="HighlightedText">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </brush>
- </colorrole>
- <colorrole role="AlternateBase">
- <brush brushstyle="SolidPattern">
- <color alpha="255">
- <red>72</red>
- <green>72</green>
- <blue>72</blue>
- </color>
- </brush>
- </colorrole>
- </disabled>
- </palette>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
</property>
- <property name="locale">
- <locale language="English" country="UnitedStates"/>
+ <property name="lineWidth">
+ <number>0</number>
</property>
- <widget class="QLabel" name="cameraName">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>10</y>
- <width>400</width>
- <height>25</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>400</width>
- <height>25</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>600</width>
- <height>30</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QGroupBox" name="groupBox_4">
- <property name="geometry">
- <rect>
- <x>320</x>
- <y>70</y>
- <width>221</width>
- <height>121</height>
- </rect>
- </property>
- <property name="title">
- <string>Axis inversion</string>
- </property>
- <widget class="QLabel" name="lblInvert1_2">
- <property name="geometry">
- <rect>
- <x>169</x>
- <y>24</y>
- <width>30</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>30</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Invert</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblInvert1_3">
- <property name="geometry">
- <rect>
- <x>72</x>
- <y>24</y>
- <width>30</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>30</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Invert</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblSensX">
- <property name="geometry">
- <rect>
- <x>108</x>
- <y>52</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>150</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>X</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblSensPitch">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>71</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>150</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Pitch</string>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkInvertPitch">
- <property name="geometry">
- <rect>
- <x>72</x>
- <y>71</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QLabel" name="lblSensY">
- <property name="geometry">
- <rect>
- <x>108</x>
- <y>71</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>150</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Y</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblSensZ">
- <property name="geometry">
- <rect>
- <x>108</x>
- <y>90</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>150</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Z</string>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkInvertZ">
- <property name="geometry">
- <rect>
- <x>169</x>
- <y>90</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkInvertY">
- <property name="geometry">
- <rect>
- <x>169</x>
- <y>71</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkInvertRoll">
- <property name="geometry">
- <rect>
- <x>72</x>
- <y>90</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkInvertX">
- <property name="geometry">
- <rect>
- <x>169</x>
- <y>52</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QLabel" name="lblSensYaw">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>52</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>150</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Yaw</string>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkInvertYaw">
- <property name="geometry">
- <rect>
- <x>72</x>
- <y>52</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
- <widget class="QLabel" name="lblSensRoll">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>90</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>25</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>150</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="layoutDirection">
- <enum>Qt::RightToLeft</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Roll</string>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupProfile">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>70</y>
- <width>271</width>
- <height>120</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>206</width>
- <height>120</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>65535</width>
- <height>65535</height>
- </size>
- </property>
- <property name="title">
- <string>Profile</string>
- </property>
- <widget class="QComboBox" name="iconcomboProfile">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>251</width>
- <height>22</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="maxVisibleItems">
- <number>10</number>
- </property>
- </widget>
- <widget class="QPushButton" name="btnSaveAs">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>80</y>
- <width>251</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Save the INI-file under another name</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Save As ...</string>
- </property>
- </widget>
- <widget class="QPushButton" name="btnLoad">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>111</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Load an INI-file from a folder</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Load</string>
- </property>
- </widget>
- <widget class="QPushButton" name="btnSave">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>130</x>
- <y>50</y>
- <width>131</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Save the current INI-file</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Save</string>
- </property>
- </widget>
- </widget>
- <widget class="QLabel" name="game_name">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>40</y>
- <width>411</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color:#ccc;
-background:none;</string>
- </property>
- <property name="text">
- <string>Not connected</string>
- </property>
- </widget>
- <widget class="QGroupBox" name="groupGameProtocol">
- <property name="geometry">
- <rect>
- <x>440</x>
- <y>201</y>
- <width>180</width>
- <height>80</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>180</width>
- <height>80</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>180</width>
- <height>80</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="title">
- <string>Game protocol</string>
- </property>
- <widget class="QComboBox" name="iconcomboProtocol">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>161</width>
- <height>22</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="maxVisibleItems">
- <number>7</number>
- </property>
- </widget>
- <widget class="QPushButton" name="btnShowServerControls">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>161</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Change game protocol settings</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Settings</string>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupTrackerSource">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>201</y>
- <width>200</width>
- <height>80</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="title">
- <string>Tracker Source(1st = Master)</string>
- </property>
- <widget class="QComboBox" name="iconcomboTrackerSource">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>180</width>
- <height>22</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="maxVisibleItems">
- <number>42</number>
- </property>
- </widget>
- <widget class="QPushButton" name="btnShowEngineControls">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>180</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Change tracker settings</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Settings</string>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupFilter">
- <property name="geometry">
- <rect>
- <x>230</x>
- <y>201</y>
- <width>200</width>
- <height>80</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>70</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="title">
- <string>Filter</string>
- </property>
- <widget class="QComboBox" name="iconcomboFilter">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>180</width>
- <height>22</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="maxVisibleItems">
- <number>7</number>
- </property>
- </widget>
- <widget class="QPushButton" name="btnShowFilterControls">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>180</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Change game protocol settings</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Settings</string>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupBox_3">
- <property name="geometry">
- <rect>
- <x>20</x>
- <y>289</y>
- <width>200</width>
- <height>80</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="title">
- <string>Tracker Source (2nd)</string>
- </property>
- <widget class="QPushButton" name="btnShowSecondTrackerSettings">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>50</y>
- <width>180</width>
- <height>23</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Change tracker settings</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Settings</string>
- </property>
- </widget>
- <widget class="QComboBox" name="cbxSecondTrackerSource">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>180</width>
- <height>22</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="currentIndex">
- <number>-1</number>
- </property>
- <property name="maxVisibleItems">
- <number>42</number>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupStartStop">
- <property name="geometry">
- <rect>
- <x>230</x>
- <y>289</y>
- <width>200</width>
- <height>80</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>200</width>
- <height>80</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>80</height>
- </size>
- </property>
- <property name="title">
- <string>GO!</string>
- </property>
- <widget class="QPushButton" name="btnStartTracker">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>30</y>
- <width>81</width>
- <height>21</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Start the Tracker</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Start</string>
- </property>
- </widget>
- <widget class="QPushButton" name="btnStopTracker">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="geometry">
- <rect>
- <x>100</x>
- <y>30</y>
- <width>81</width>
- <height>21</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Stop the Tracker</string>
- </property>
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="text">
- <string>Stop</string>
- </property>
- </widget>
- </widget>
- <widget class="QPushButton" name="btnShortcuts">
+ <widget class="QWidget" name="widget4video" native="true">
<property name="geometry">
<rect>
- <x>440</x>
- <y>288</y>
- <width>181</width>
- <height>38</height>
+ <x>0</x>
+ <y>0</y>
+ <width>320</width>
+ <height>240</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>54</width>
- <height>38</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="cursor">
- <cursorShape>PointingHandCursor</cursorShape>
- </property>
- <property name="toolTip">
- <string>Edit the Keyboard and mouse shortcuts</string>
- </property>
- <property name="text">
- <string>Shortcuts</string>
- </property>
- <property name="icon">
- <iconset resource="main-facetracknoir.qrc">
- <normaloff>:/uielements/tools.png</normaloff>:/uielements/tools.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>24</width>
- <height>24</height>
- </size>
- </property>
- </widget>
- <widget class="QPushButton" name="btnEditCurves">
- <property name="geometry">
- <rect>
- <x>440</x>
- <y>332</y>
- <width>181</width>
- <height>38</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>54</width>
- <height>38</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>200</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="cursor">
- <cursorShape>PointingHandCursor</cursorShape>
- </property>
- <property name="toolTip">
- <string>Edit the Curve settings</string>
- </property>
- <property name="layoutDirection">
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="styleSheet">
- <string notr="true">background:none;</string>
- </property>
- <property name="text">
- <string>Curves</string>
- </property>
- <property name="icon">
- <iconset resource="main-facetracknoir.qrc">
- <normaloff>:/uielements/curves.png</normaloff>:/uielements/curves.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>120</width>
- <height>24</height>
+ <width>65536</width>
+ <height>65536</height>
</size>
</property>
</widget>
</widget>
- <widget class="QFrame" name="video_frame">
+ <widget class="QGroupBox" name="groupBox4logo">
<property name="geometry">
<rect>
- <x>0</x>
- <y>89</y>
- <width>250</width>
- <height>187</height>
+ <x>100</x>
+ <y>10</y>
+ <width>229</width>
+ <height>121</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="title">
+ <string notr="true"/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_8">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <property name="horizontalSpacing">
+ <number>10</number>
+ </property>
+ <item row="2" column="0">
+ <widget class="QLabel" name="lblZ">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>TZ</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QLCDNumber" name="lcdNumOutputRotX">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>5</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="lblX">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>TX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLCDNumber" name="lcdNumOutputPosX">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>5</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="lblRotX">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>yaw</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLCDNumber" name="lcdNumOutputPosY">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>5</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLCDNumber" name="lcdNumOutputPosZ">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>5</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="lblRotZ">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>roll</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="lblY">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>TY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="lblRotY">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>pitch</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QLCDNumber" name="lcdNumOutputRotY">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>5</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLCDNumber" name="lcdNumOutputRotZ">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>13</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>5</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="GLWidget" name="pose_display" native="true">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>81</width>
+ <height>100</height>
</rect>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
- <width>250</width>
- <height>187</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>250</width>
- <height>187</height>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QGroupBox" name="groupGameProtocol">
+ <property name="geometry">
+ <rect>
+ <x>350</x>
+ <y>270</y>
+ <width>191</width>
+ <height>91</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>180</width>
+ <height>80</height>
</size>
</property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
</property>
- <property name="frameShadow">
- <enum>QFrame::Plain</enum>
+ <property name="styleSheet">
+ <string notr="true"/>
</property>
- <property name="lineWidth">
- <number>0</number>
+ <property name="title">
+ <string>Game protocol</string>
</property>
- <widget class="QWidget" name="widget4video" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>250</width>
- <height>187</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>250</width>
- <height>187</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>250</width>
- <height>187</height>
- </size>
- </property>
- </widget>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_6" rowstretch="6,6" columnstretch="6" rowminimumheight="6,6" columnminimumwidth="6">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QComboBox" name="iconcomboProtocol">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="currentIndex">
+ <number>-1</number>
+ </property>
+ <property name="maxVisibleItems">
+ <number>7</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="btnShowServerControls">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Change game protocol settings</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
- <widget class="QWidget" name="headPoseWidget" native="true">
+ <widget class="QPushButton" name="btnEditCurves">
<property name="geometry">
<rect>
- <x>0</x>
- <y>275</y>
- <width>261</width>
- <height>141</height>
+ <x>580</x>
+ <y>390</y>
+ <width>171</width>
+ <height>38</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>62</width>
+ <height>38</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="cursor">
+ <cursorShape>PointingHandCursor</cursorShape>
+ </property>
+ <property name="toolTip">
+ <string>Edit the Curve settings</string>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::LeftToRight</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>Mapping</string>
+ </property>
+ <property name="icon">
+ <iconset resource="main-facetracknoir.qrc">
+ <normaloff>:/uielements/curves.png</normaloff>:/uielements/curves.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>98</width>
+ <height>24</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QLabel" name="game_name">
+ <property name="geometry">
+ <rect>
+ <x>370</x>
+ <y>40</y>
+ <width>411</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Not connected</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" name="groupFilter">
+ <property name="geometry">
+ <rect>
+ <x>580</x>
+ <y>210</y>
+ <width>171</width>
+ <height>91</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
- <height>100</height>
+ <height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>16777215</width>
- <height>160</height>
+ <width>65536</width>
+ <height>65536</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
- <widget class="QGroupBox" name="groupBox">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>231</width>
- <height>169</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="title">
- <string>Raw Input</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <widget class="QLCDNumber" name="lcdNumRotZ">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>60</y>
- <width>71</width>
- <height>21</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="numDigits">
- <number>6</number>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumRotX">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>20</y>
- <width>71</width>
- <height>21</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="numDigits">
- <number>6</number>
- </property>
- </widget>
- <widget class="QLabel" name="label_4">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>21</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">border:none;
-color:white</string>
- </property>
- <property name="text">
- <string>X</string>
- </property>
- </widget>
- <widget class="QLabel" name="label_5">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>40</y>
- <width>21</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">border:none;
-color:white;</string>
- </property>
- <property name="text">
- <string>Y</string>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumZ">
- <property name="geometry">
- <rect>
- <x>30</x>
- <y>60</y>
- <width>61</width>
- <height>21</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- </widget>
- <widget class="QLabel" name="label_6">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>60</y>
- <width>21</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color:white;
-border:none;</string>
- </property>
- <property name="text">
- <string>Z</string>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumY">
- <property name="geometry">
- <rect>
- <x>30</x>
- <y>40</y>
- <width>61</width>
- <height>21</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- </widget>
- <widget class="QLabel" name="label_7">
- <property name="geometry">
- <rect>
- <x>108</x>
- <y>58</y>
- <width>31</width>
- <height>20</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">border:none;
-color:white;</string>
- </property>
- <property name="text">
- <string>roll</string>
- </property>
- </widget>
- <widget class="QLabel" name="label_8">
- <property name="geometry">
- <rect>
- <x>109</x>
- <y>38</y>
- <width>31</width>
- <height>20</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color:white;
-border:none;</string>
- </property>
- <property name="text">
- <string>pitch</string>
- </property>
- </widget>
- <widget class="QLabel" name="label_9">
- <property name="geometry">
- <rect>
- <x>108</x>
- <y>18</y>
- <width>31</width>
- <height>20</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">border:none;
-color:white;</string>
- </property>
- <property name="text">
- <string>yaw</string>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumRotY">
- <property name="geometry">
- <rect>
- <x>150</x>
- <y>40</y>
- <width>71</width>
- <height>21</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="numDigits">
- <number>6</number>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumX">
- <property name="geometry">
- <rect>
- <x>30</x>
- <y>20</y>
- <width>61</width>
- <height>21</height>
- </rect>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- </widget>
- </widget>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>0</y>
- <width>231</width>
- <height>50</height>
- </rect>
- </property>
- <property name="title">
- <string>Status</string>
- </property>
- <property name="flat">
- <bool>true</bool>
- </property>
- <widget class="QLabel" name="txtTracking">
- <property name="geometry">
- <rect>
- <x>110</x>
- <y>10</y>
- <width>101</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">border:none;
-color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>Tracking</string>
- </property>
- </widget>
- </widget>
+ <property name="title">
+ <string>Filter</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item row="0" column="0">
+ <widget class="QComboBox" name="iconcomboFilter">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="currentIndex">
+ <number>-1</number>
+ </property>
+ <property name="maxVisibleItems">
+ <number>7</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="btnShowFilterControls">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Change game protocol settings</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
- <widget class="QWidget" name="widget4logo" native="true">
+ <widget class="QGroupBox" name="groupTrackerSource">
<property name="geometry">
<rect>
- <x>90</x>
- <y>0</y>
- <width>160</width>
- <height>90</height>
+ <x>350</x>
+ <y>60</y>
+ <width>191</width>
+ <height>91</height>
</rect>
</property>
<property name="minimumSize">
<size>
- <width>160</width>
- <height>90</height>
+ <width>0</width>
+ <height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
- <width>16777215</width>
- <height>90</height>
+ <width>65536</width>
+ <height>65536</height>
</size>
</property>
- <widget class="QLCDNumber" name="lcdNumOutputRotX">
- <property name="geometry">
- <rect>
- <x>101</x>
- <y>19</y>
- <width>50</width>
- <height>21</height>
- </rect>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumOutputRotY">
- <property name="geometry">
- <rect>
- <x>101</x>
- <y>37</y>
- <width>50</width>
- <height>21</height>
- </rect>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumOutputRotZ">
- <property name="geometry">
- <rect>
- <x>101</x>
- <y>55</y>
- <width>50</width>
- <height>21</height>
- </rect>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumOutputPosX">
- <property name="geometry">
- <rect>
- <x>17</x>
- <y>19</y>
- <width>50</width>
- <height>21</height>
- </rect>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumOutputPosY">
- <property name="geometry">
- <rect>
- <x>17</x>
- <y>37</y>
- <width>50</width>
- <height>21</height>
- </rect>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- <widget class="QLCDNumber" name="lcdNumOutputPosZ">
- <property name="geometry">
- <rect>
- <x>17</x>
- <y>55</y>
- <width>50</width>
- <height>21</height>
- </rect>
- </property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="frameShape">
- <enum>QFrame::NoFrame</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <property name="numDigits">
- <number>5</number>
- </property>
- <property name="segmentStyle">
- <enum>QLCDNumber::Flat</enum>
- </property>
- </widget>
- <widget class="QLabel" name="lblX">
- <property name="geometry">
- <rect>
- <x>9</x>
- <y>20</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>X</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblY">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>40</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>Y</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblZ">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>59</y>
- <width>16</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>Z</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblRotZ">
- <property name="geometry">
- <rect>
- <x>69</x>
- <y>59</y>
- <width>20</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>roll</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblRotX">
- <property name="geometry">
- <rect>
- <x>71</x>
- <y>20</y>
- <width>20</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>yaw</string>
- </property>
- </widget>
- <widget class="QLabel" name="lblRotY">
- <property name="geometry">
- <rect>
- <x>69</x>
- <y>40</y>
- <width>25</width>
- <height>16</height>
- </rect>
- </property>
- <property name="styleSheet">
- <string notr="true">color: rgb(0, 255, 0);</string>
- </property>
- <property name="text">
- <string>pitch</string>
- </property>
- </widget>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="title">
+ <string>Main tracker</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <widget class="QComboBox" name="iconcomboTrackerSource">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="currentIndex">
+ <number>-1</number>
+ </property>
+ <property name="maxVisibleItems">
+ <number>42</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnShowEngineControls">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Change tracker settings</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
- <widget class="GLWidget" name="pose_display" native="true">
+ <widget class="QLabel" name="cameraName">
<property name="geometry">
<rect>
- <x>0</x>
- <y>0</y>
- <width>90</width>
- <height>90</height>
+ <x>370</x>
+ <y>10</y>
+ <width>411</width>
+ <height>25</height>
</rect>
</property>
<property name="sizePolicy">
@@ -2039,6 +886,829 @@ color: rgb(0, 255, 0);</string> <height>0</height>
</size>
</property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="geometry">
+ <rect>
+ <x>350</x>
+ <y>160</y>
+ <width>191</width>
+ <height>91</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Auxiliary tracker</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <item>
+ <widget class="QComboBox" name="cbxSecondTrackerSource">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="currentIndex">
+ <number>-1</number>
+ </property>
+ <property name="maxVisibleItems">
+ <number>42</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnShowSecondTrackerSettings">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Change tracker settings</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Settings</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QGroupBox" name="groupStartStop">
+ <property name="geometry">
+ <rect>
+ <x>350</x>
+ <y>400</y>
+ <width>190</width>
+ <height>65</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>GO!</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_9" rowstretch="0" columnstretch="0,0" rowminimumheight="0" columnminimumwidth="0,0">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QPushButton" name="btnStartTracker">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Start the Tracker</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Start</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QPushButton" name="btnStopTracker">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Stop the Tracker</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Stop</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QPushButton" name="btnShortcuts">
+ <property name="geometry">
+ <rect>
+ <x>580</x>
+ <y>340</y>
+ <width>171</width>
+ <height>38</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>62</width>
+ <height>38</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="cursor">
+ <cursorShape>PointingHandCursor</cursorShape>
+ </property>
+ <property name="toolTip">
+ <string>Edit the Keyboard and mouse shortcuts</string>
+ </property>
+ <property name="text">
+ <string>Keys</string>
+ </property>
+ <property name="icon">
+ <iconset resource="main-facetracknoir.qrc">
+ <normaloff>:/uielements/tools.png</normaloff>:/uielements/tools.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>98</width>
+ <height>24</height>
+ </size>
+ </property>
+ </widget>
+ <widget class="QGroupBox" name="groupProfile">
+ <property name="geometry">
+ <rect>
+ <x>550</x>
+ <y>60</y>
+ <width>231</width>
+ <height>123</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Profile</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5" rowstretch="6,6,6" columnstretch="6,6" rowminimumheight="6,6,6" columnminimumwidth="6,6">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="0" column="0" colspan="2">
+ <widget class="QComboBox" name="iconcomboProfile">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="currentIndex">
+ <number>-1</number>
+ </property>
+ <property name="maxVisibleItems">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QPushButton" name="btnLoad">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Load an INI-file from a folder</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Load</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="btnSave">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Save the current INI-file</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Save</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="2">
+ <widget class="QPushButton" name="btnSaveAs">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Save the INI-file under another name</string>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Save As ...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>380</y>
+ <width>141</width>
+ <height>106</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string>Raw translation</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignHCenter</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMaximumSize</enum>
+ </property>
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+ </property>
+ <property name="rowWrapPolicy">
+ <enum>QFormLayout::DontWrapRows</enum>
+ </property>
+ <property name="labelAlignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ <property name="formAlignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>TX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLCDNumber" name="lcdNumX">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>4</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>TY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLCDNumber" name="lcdNumY">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>4</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>TZ</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLCDNumber" name="lcdNumZ">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>4</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="geometry">
+ <rect>
+ <x>160</x>
+ <y>380</y>
+ <width>161</width>
+ <height>111</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string>Raw rotation</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignHCenter</set>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
+ <layout class="QFormLayout" name="formLayout_2">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMaximumSize</enum>
+ </property>
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::FieldsStayAtSizeHint</enum>
+ </property>
+ <property name="rowWrapPolicy">
+ <enum>QFormLayout::DontWrapRows</enum>
+ </property>
+ <property name="labelAlignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ <property name="formAlignment">
+ <set>Qt::AlignHCenter|Qt::AlignTop</set>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>yaw</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLCDNumber" name="lcdNumRotX">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>4</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>pitch</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLCDNumber" name="lcdNumRotY">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>4</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>roll</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLCDNumber" name="lcdNumRotZ">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>12</pointsize>
+ </font>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <property name="smallDecimalPoint">
+ <bool>false</bool>
+ </property>
+ <property name="digitCount">
+ <number>4</number>
+ </property>
+ <property name="segmentStyle">
+ <enum>QLCDNumber::Flat</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ <zorder>lcdNumRotZ</zorder>
+ <zorder>label_8</zorder>
+ <zorder>label_7</zorder>
+ <zorder>lcdNumRotY</zorder>
+ <zorder>lcdNumRotX</zorder>
+ <zorder>label_9</zorder>
</widget>
</widget>
</widget>
@@ -2050,15 +1720,7 @@ color: rgb(0, 255, 0);</string> <header>glwidget.h</header>
</customwidget>
</customwidgets>
- <tabstops>
- <tabstop>iconcomboTrackerSource</tabstop>
- <tabstop>btnStartTracker</tabstop>
- <tabstop>btnStopTracker</tabstop>
- <tabstop>btnShowEngineControls</tabstop>
- <tabstop>iconcomboProtocol</tabstop>
- </tabstops>
<resources>
- <include location="../ftnoir_protocol_ftn/ftn-protocol.qrc"/>
<include location="main-facetracknoir.qrc"/>
</resources>
<connections/>
diff --git a/facetracknoir/ftnoir_curves.ui b/facetracknoir/ftnoir_curves.ui index 9dc79326..195083b9 100644 --- a/facetracknoir/ftnoir_curves.ui +++ b/facetracknoir/ftnoir_curves.ui @@ -6,12 +6,18 @@ <rect>
<x>0</x>
<y>0</y>
- <width>1050</width>
- <height>667</height>
+ <width>970</width>
+ <height>655</height>
</rect>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="windowTitle">
- <string>FaceTrackNoIR tracking curves</string>
+ <string>Mapping properties</string>
</property>
<property name="windowIcon">
<iconset>
@@ -20,891 +26,919 @@ <property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
- <property name="autoFillBackground">
- <bool>false</bool>
- </property>
<property name="styleSheet">
- <string notr="true">background-color: rgb(240, 240, 240);
-/*
-QWidget#widgetTop {
-background-color: #595959;
-border-bottom: 1px solid #000;
-}
-*/
-
-/* Make text in message boxes selectable. */
-QMessageBox {
-/* LinksAccessibleByMouse | TextSelectableByMouse */
-messagebox-text-interaction-flags: 5;
-}
-/* Make the entire row selected in item views. */
-QAbstractItemView {
-show-decoration-selected: 1;
-}
-
-/* Nice WindowsXP-style password character for password line edits. */
-QLineEdit[echoMode="2"] {
-lineedit-password-character: 9679;
-}
-
-/* Customize tooltips. */
-QToolTip {
-background-color: rgb(170, 255, 127);
-opacity: 200;
-}
-
-/* Customize push buttons and comboboxes. Our read-only combobox
-is very similar to a push button, so they share the same border image. */
-
-QPushButton {
-min-width: 4em;
-}
-
-QPushButton:disabled {
-color: rgb(128, 128, 128);
-}
-
-QGroupBox {
-color: rgb(255, 255, 255);
-}</string>
+ <string notr="true">background-color: #ccc;</string>
</property>
- <layout class="QVBoxLayout" name="_vertical_layout">
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <item>
- <widget class="QTabWidget" name="tabWidget">
- <property name="styleSheet">
- <string notr="true"/>
- </property>
- <property name="currentIndex">
- <number>0</number>
- </property>
- <widget class="QWidget" name="tab">
- <attribute name="title">
- <string>rx</string>
- </attribute>
- <widget class="QFunctionConfigurator" name="rxconfig" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>921</width>
- <height>240</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>5</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>255</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- <widget class="QCheckBox" name="rx_altp">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>280</y>
- <width>166</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Use alternative</string>
- </property>
- </widget>
- <widget class="QFunctionConfigurator" name="rxconfig_alt" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>340</y>
- <width>921</width>
- <height>240</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>5</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>255</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="tab2">
- <attribute name="title">
- <string>ry</string>
- </attribute>
- <widget class="QFunctionConfigurator" name="ryconfig" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>595</width>
- <height>240</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>90</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>90</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>10</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>0</red>
- <green>255</green>
- <blue>0</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- <widget class="QCheckBox" name="ry_altp">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>280</y>
- <width>199</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Use alternative</string>
- </property>
- </widget>
- <widget class="QFunctionConfigurator" name="ryconfig_alt" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>340</y>
- <width>1013</width>
- <height>240</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>90</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>90</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>10</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>0</red>
- <green>255</green>
- <blue>0</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="tab3">
- <attribute name="title">
- <string>rz</string>
- </attribute>
- <widget class="QFunctionConfigurator" name="rzconfig" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>595</width>
- <height>240</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>5</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>1</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>0</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- <widget class="QCheckBox" name="rz_altp">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>280</y>
- <width>271</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Use alternative</string>
- </property>
- </widget>
- <widget class="QFunctionConfigurator" name="rzconfig_alt" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>340</y>
- <width>595</width>
- <height>240</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>180</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>5</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>1</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>0</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="tab4">
- <attribute name="title">
- <string>tx</string>
- </attribute>
- <widget class="QFunctionConfigurator" name="txconfig" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>555</width>
- <height>270</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>7</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>255</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- <widget class="QCheckBox" name="tx_altp">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>280</y>
- <width>228</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Use alternative</string>
- </property>
- </widget>
- <widget class="QFunctionConfigurator" name="txconfig_alt" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>310</y>
- <width>555</width>
- <height>160</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>7</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>255</red>
- <green>0</green>
- <blue>255</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="tab5">
- <attribute name="title">
- <string>ty</string>
- </attribute>
- <widget class="QFunctionConfigurator" name="tyconfig" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>555</width>
- <height>160</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>7</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>255</red>
- <green>255</green>
- <blue>0</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- <widget class="QCheckBox" name="ty_altp">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>280</y>
- <width>229</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Use alternative</string>
- </property>
- </widget>
- <widget class="QFunctionConfigurator" name="tyconfig_alt" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>310</y>
- <width>555</width>
- <height>160</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>7</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>255</red>
- <green>255</green>
- <blue>0</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="tab6">
- <attribute name="title">
- <string>tz</string>
- </attribute>
- <widget class="QFunctionConfigurator" name="tzconfig" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>555</width>
- <height>160</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>7</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>0</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- <widget class="QCheckBox" name="tz_altp">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>280</y>
- <width>263</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Use alternative</string>
- </property>
- </widget>
- <widget class="QFunctionConfigurator" name="tzconfig_alt" native="true">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>310</y>
- <width>555</width>
- <height>160</height>
- </rect>
- </property>
- <property name="maxInputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="maxOutputEGU" stdset="0">
- <number>100</number>
- </property>
- <property name="pixPerEGU_Input" stdset="0">
- <number>7</number>
- </property>
- <property name="pixPerEGU_Output" stdset="0">
- <number>2</number>
- </property>
- <property name="colorBezier" stdset="0">
- <color>
- <red>0</red>
- <green>255</green>
- <blue>255</blue>
- </color>
- </property>
- <property name="colorBackground" stdset="0">
- <color>
- <red>240</red>
- <green>240</green>
- <blue>240</blue>
- </color>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="tab_2">
- <attribute name="title">
- <string>Positions</string>
- </attribute>
- <widget class="QLabel" name="label">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>44</y>
- <width>35</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>RY</string>
- </property>
- </widget>
- <widget class="QLabel" name="label_2">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>10</y>
- <width>34</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>RX</string>
- </property>
- </widget>
- <widget class="QLabel" name="label_3">
- <property name="geometry">
- <rect>
- <x>9</x>
- <y>75</y>
- <width>33</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>RZ</string>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="pos_rx">
- <property name="geometry">
- <rect>
- <x>50</x>
- <y>10</y>
- <width>131</width>
- <height>22</height>
- </rect>
- </property>
- <property name="suffix">
- <string> deg.</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>-180.000000000000000</double>
- </property>
- <property name="maximum">
- <double>180.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="pos_ry">
- <property name="geometry">
- <rect>
- <x>50</x>
- <y>40</y>
- <width>131</width>
- <height>22</height>
- </rect>
- </property>
- <property name="suffix">
- <string> deg.</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>-180.000000000000000</double>
- </property>
- <property name="maximum">
- <double>180.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="pos_rz">
- <property name="geometry">
- <rect>
- <x>49</x>
- <y>71</y>
- <width>131</width>
- <height>22</height>
- </rect>
- </property>
- <property name="suffix">
- <string> deg.</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>-180.000000000000000</double>
- </property>
- <property name="maximum">
- <double>180.000000000000000</double>
- </property>
- </widget>
- <widget class="QLabel" name="label_4">
- <property name="geometry">
- <rect>
- <x>209</x>
- <y>10</y>
- <width>32</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>TX</string>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="pos_tx">
- <property name="geometry">
- <rect>
- <x>249</x>
- <y>10</y>
- <width>152</width>
- <height>22</height>
- </rect>
- </property>
- <property name="suffix">
- <string> cm</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>-100.000000000000000</double>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="pos_ty">
- <property name="geometry">
- <rect>
- <x>249</x>
- <y>40</y>
- <width>152</width>
- <height>22</height>
- </rect>
- </property>
- <property name="suffix">
- <string> cm</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>-100.000000000000000</double>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- </widget>
- <widget class="QDoubleSpinBox" name="pos_tz">
- <property name="geometry">
- <rect>
- <x>248</x>
- <y>71</y>
- <width>154</width>
- <height>22</height>
- </rect>
- </property>
- <property name="suffix">
- <string> cm</string>
- </property>
- <property name="decimals">
- <number>3</number>
- </property>
- <property name="minimum">
- <double>-100.000000000000000</double>
- </property>
- <property name="maximum">
- <double>100.000000000000000</double>
- </property>
- </widget>
- <widget class="QLabel" name="label_5">
- <property name="geometry">
- <rect>
- <x>209</x>
- <y>44</y>
- <width>32</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>TY</string>
- </property>
- </widget>
- <widget class="QLabel" name="label_6">
- <property name="geometry">
- <rect>
- <x>208</x>
- <y>75</y>
- <width>35</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text">
- <string>TZ</string>
- </property>
- </widget>
- </widget>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="styleSheet">
+ <string notr="true">background-color: #ccc;</string>
+ </property>
+ <property name="tabPosition">
+ <enum>QTabWidget::North</enum>
+ </property>
+ <property name="currentIndex">
+ <number>6</number>
+ </property>
+ <widget class="QWidget" name="tabWidgetPage1">
+ <attribute name="title">
+ <string>Yaw</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="rxconfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>5</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
</widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="1">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="2">
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="sizeConstraint">
- <enum>QLayout::SetDefaultConstraint</enum>
- </property>
- <item>
- <widget class="QPushButton" name="btnOK">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>OK</string>
- </property>
+ <widget class="QCheckBox" name="rx_altp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>260</y>
+ <width>166</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Asymmetric mapping below</string>
+ </property>
+ </widget>
+ <widget class="QFunctionConfigurator" name="rxconfig_alt" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>300</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>5</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage2">
+ <attribute name="title">
+ <string>Pitch</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="ryconfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>90</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>90</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>10</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="ry_altp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>260</y>
+ <width>199</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Asymmetric mapping below</string>
+ </property>
+ </widget>
+ <widget class="QFunctionConfigurator" name="ryconfig_alt" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>300</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>90</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>90</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>10</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage3">
+ <attribute name="title">
+ <string>Roll</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="rzconfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>5</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="rz_altp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>260</y>
+ <width>271</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Asymmetric mapping below</string>
+ </property>
+ </widget>
+ <widget class="QFunctionConfigurator" name="rzconfig_alt" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>300</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>180</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>5</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>1</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>0</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage4">
+ <attribute name="title">
+ <string>X</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="txconfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>28</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="tx_altp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>270</y>
+ <width>228</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Asymmetric mapping below</string>
+ </property>
+ </widget>
+ <widget class="QFunctionConfigurator" name="txconfig_alt" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>300</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>28</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage5">
+ <attribute name="title">
+ <string>Y</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="tyconfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>28</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="ty_altp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>270</y>
+ <width>229</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Asymmetric mapping below</string>
+ </property>
+ </widget>
+ <widget class="QFunctionConfigurator" name="tyconfig_alt" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>300</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>28</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage6">
+ <attribute name="title">
+ <string>Z</string>
+ </attribute>
+ <widget class="QFunctionConfigurator" name="tzconfig" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>28</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="tz_altp">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>270</y>
+ <width>263</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Asymmetric mapping below</string>
+ </property>
+ </widget>
+ <widget class="QFunctionConfigurator" name="tzconfig_alt" native="true">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>300</y>
+ <width>930</width>
+ <height>260</height>
+ </rect>
+ </property>
+ <property name="maxInputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="maxOutputEGU" stdset="0">
+ <number>100</number>
+ </property>
+ <property name="pixPerEGU_Input" stdset="0">
+ <number>28</number>
+ </property>
+ <property name="pixPerEGU_Output" stdset="0">
+ <number>2</number>
+ </property>
+ <property name="colorBezier" stdset="0">
+ <color>
+ <red>0</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ <property name="colorBackground" stdset="0">
+ <color>
+ <red>240</red>
+ <green>240</green>
+ <blue>240</blue>
+ </color>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tabWidgetPage7">
+ <attribute name="title">
+ <string>Options</string>
+ </attribute>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Center pose</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>RX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QDoubleSpinBox" name="pos_rx">
+ <property name="suffix">
+ <string> deg.</string>
+ </property>
+ <property name="decimals">
+ <number>3</number>
+ </property>
+ <property name="minimum">
+ <double>-180.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>180.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>TX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QDoubleSpinBox" name="pos_tx">
+ <property name="suffix">
+ <string> cm</string>
+ </property>
+ <property name="decimals">
+ <number>3</number>
+ </property>
+ <property name="minimum">
+ <double>-100.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>100.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>RY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="pos_ry">
+ <property name="suffix">
+ <string> deg.</string>
+ </property>
+ <property name="decimals">
+ <number>3</number>
+ </property>
+ <property name="minimum">
+ <double>-180.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>180.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>TY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QDoubleSpinBox" name="pos_ty">
+ <property name="suffix">
+ <string> cm</string>
+ </property>
+ <property name="decimals">
+ <number>3</number>
+ </property>
+ <property name="minimum">
+ <double>-100.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>100.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>TZ</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>RZ</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QDoubleSpinBox" name="pos_rz">
+ <property name="suffix">
+ <string> deg.</string>
+ </property>
+ <property name="decimals">
+ <number>3</number>
+ </property>
+ <property name="minimum">
+ <double>-180.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>180.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QDoubleSpinBox" name="pos_tz">
+ <property name="suffix">
+ <string> cm</string>
+ </property>
+ <property name="decimals">
+ <number>3</number>
+ </property>
+ <property name="minimum">
+ <double>-100.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>100.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
- <item>
- <widget class="QPushButton" name="btnCancel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="title">
+ <string>Translation compensation</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="tcomp_enable">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Enablement</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="tcomp_rz">
+ <property name="styleSheet">
+ <string notr="true"/>
+ </property>
+ <property name="text">
+ <string>Disable Z axis compensation</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QGroupBox" name="groupBox_4">
<property name="maximumSize">
<size>
- <width>100</width>
- <height>16777215</height>
+ <width>65536</width>
+ <height>65536</height>
</size>
</property>
- <property name="text">
- <string>Cancel</string>
- </property>
+ <property name="font">
+ <font>
+ <kerning>true</kerning>
+ </font>
+ </property>
+ <property name="title">
+ <string>Axis inversion</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4" rowstretch="6,6,6" columnstretch="6,6" rowminimumheight="6,6,6" columnminimumwidth="6,6">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinAndMaxSize</enum>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="chkInvertYaw">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>Yaw</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="chkInvertX">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>TX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="chkInvertPitch">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>Pitch</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="chkInvertY">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>TY</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="chkInvertRoll">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>Roll</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="chkInvertZ">
+ <property name="maximumSize">
+ <size>
+ <width>65536</width>
+ <height>65536</height>
+ </size>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background:none;</string>
+ </property>
+ <property name="text">
+ <string>TZ</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
</layout>
- </item>
- </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
</item>
</layout>
</widget>
@@ -915,25 +949,25 @@ color: rgb(255, 255, 255); <header>qfunctionconfigurator.h</header>
</customwidget>
</customwidgets>
+ <tabstops>
+ <tabstop>pos_rx</tabstop>
+ <tabstop>pos_ry</tabstop>
+ <tabstop>pos_rz</tabstop>
+ <tabstop>ry_altp</tabstop>
+ <tabstop>rz_altp</tabstop>
+ <tabstop>tx_altp</tabstop>
+ <tabstop>ty_altp</tabstop>
+ <tabstop>tz_altp</tabstop>
+ <tabstop>tcomp_enable</tabstop>
+ <tabstop>tabWidget</tabstop>
+ <tabstop>pos_tx</tabstop>
+ <tabstop>buttonBox</tabstop>
+ <tabstop>pos_ty</tabstop>
+ <tabstop>rx_altp</tabstop>
+ <tabstop>pos_tz</tabstop>
+ </tabstops>
<resources/>
<connections/>
- <designerdata>
- <property name="gridDeltaX">
- <number>10</number>
- </property>
- <property name="gridDeltaY">
- <number>10</number>
- </property>
- <property name="gridSnapX">
- <bool>false</bool>
- </property>
- <property name="gridSnapY">
- <bool>false</bool>
- </property>
- <property name="gridVisible">
- <bool>true</bool>
- </property>
- </designerdata>
<slots>
<slot>startEngineClicked()</slot>
<slot>stopEngineClicked()</slot>
diff --git a/facetracknoir/ftnoir_keyboardshortcuts.ui b/facetracknoir/ftnoir_keyboardshortcuts.ui index e70b7536..94d11734 100644 --- a/facetracknoir/ftnoir_keyboardshortcuts.ui +++ b/facetracknoir/ftnoir_keyboardshortcuts.ui @@ -6,16 +6,22 @@ <rect>
<x>0</x>
<y>0</y>
- <width>289</width>
- <height>81</height>
+ <width>371</width>
+ <height>131</height>
</rect>
</property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="windowTitle">
- <string>FaceTrackNoIR Keyboard and Mouse shortcuts</string>
+ <string>Keyboard shortcuts</string>
</property>
<property name="windowIcon">
<iconset>
- <normaloff>images/FaceTrackNoIR.png</normaloff>images/FaceTrackNoIR.png</iconset>
+ <normaloff>images/facetracknoir.png</normaloff>images/facetracknoir.png</iconset>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
@@ -23,194 +29,176 @@ <property name="autoFillBackground">
<bool>false</bool>
</property>
- <widget class="QPushButton" name="btnCancel">
- <property name="geometry">
- <rect>
- <x>180</x>
- <y>50</y>
- <width>100</width>
- <height>23</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- <widget class="QPushButton" name="btnOK">
- <property name="geometry">
- <rect>
- <x>74</x>
- <y>50</y>
- <width>100</width>
- <height>23</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- <widget class="QComboBox" name="cbxCenterKey">
- <property name="geometry">
- <rect>
- <x>179</x>
- <y>19</y>
- <width>101</width>
- <height>20</height>
- </rect>
- </property>
- <property name="minimumSize">
- <size>
- <width>90</width>
- <height>0</height>
- </size>
- </property>
- <property name="toolTip">
- <string>Select Number</string>
- </property>
- <property name="insertPolicy">
- <enum>QComboBox::InsertAlphabetically</enum>
- </property>
- </widget>
- <widget class="QLabel" name="textLabel2_4">
- <property name="geometry">
- <rect>
- <x>210</x>
- <y>0</y>
- <width>46</width>
- <height>16</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Keyboard</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignCenter</set>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkCenterAlt">
- <property name="geometry">
- <rect>
- <x>141</x>
- <y>21</y>
- <width>36</width>
- <height>17</height>
- </rect>
- </property>
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Alt</string>
- </property>
- </widget>
- <widget class="QLabel" name="textLabel2_3">
- <property name="geometry">
- <rect>
- <x>5</x>
- <y>23</y>
- <width>33</width>
- <height>16</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Center</string>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkCenterCtrl">
- <property name="geometry">
- <rect>
- <x>95</x>
- <y>21</y>
- <width>40</width>
- <height>17</height>
- </rect>
- </property>
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Ctrl</string>
- </property>
- </widget>
- <widget class="QCheckBox" name="chkCenterShift">
- <property name="geometry">
- <rect>
- <x>44</x>
- <y>21</y>
- <width>45</width>
- <height>17</height>
- </rect>
- </property>
- <property name="maximumSize">
- <size>
- <width>50</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Shift</string>
- </property>
- </widget>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="4">
+ <widget class="QLabel" name="textLabel2_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Keyboard</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="textLabel2_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Center</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="chkCenterShift">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Shift</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QCheckBox" name="chkCenterCtrl">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Ctrl</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="3">
+ <widget class="QCheckBox" name="chkCenterAlt">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Alt</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4">
+ <widget class="QComboBox" name="cbxCenterKey">
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Select Number</string>
+ </property>
+ <property name="insertPolicy">
+ <enum>QComboBox::InsertAlphabetically</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="textLabel2_5">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Toggle</string>
+ </property>
+ <property name="wordWrap">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="chkToggleShift">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Shift</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QCheckBox" name="chkToggleCtrl">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Ctrl</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QCheckBox" name="chkToggleAlt">
+ <property name="maximumSize">
+ <size>
+ <width>50</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Alt</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="4">
+ <widget class="QComboBox" name="cbxToggleKey">
+ <property name="minimumSize">
+ <size>
+ <width>90</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Select Number</string>
+ </property>
+ <property name="insertPolicy">
+ <enum>QComboBox::InsertAlphabetically</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="3" colspan="2">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
</widget>
<resources/>
<connections/>
diff --git a/facetracknoir/global-settings.cpp b/facetracknoir/global-settings.cpp index f605b591..3b627860 100644 --- a/facetracknoir/global-settings.cpp +++ b/facetracknoir/global-settings.cpp @@ -1,6 +1,6 @@ #include "global-settings.h" -#if !(defined(__WIN32) || defined(_WIN32)) +#if !(defined(_WIN32)) # include <dlfcn.h> #endif @@ -9,13 +9,6 @@ SelectedLibraries* Libraries = NULL; SelectedLibraries::~SelectedLibraries() { if (pTracker) { - pTracker->WaitForExit(); - } - if (pSecondTracker) { - pSecondTracker->WaitForExit(); - } - - if (pTracker) { delete pTracker; pTracker = NULL; } @@ -91,8 +84,8 @@ SelectedLibraries::SelectedLibraries(IDynamicLibraryProvider* mainApp) : DynamicLibrary::DynamicLibrary(const QString& filename) { this->filename = filename; +#if defined(_WIN32) QString fullPath = QCoreApplication::applicationDirPath() + "/" + this->filename; -#if defined(__WIN32) || defined(_WIN32) handle = new QLibrary(fullPath); Dialog = (SETTINGS_FUNCTION) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetDialog" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION); Constructor = (NULLARY_DYNAMIC_FUNCTION) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetConstructor" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION); @@ -102,6 +95,8 @@ DynamicLibrary::DynamicLibrary(const QString& filename) handle = dlopen(latin1.constData(), RTLD_NOW | # ifdef __linux RTLD_DEEPBIND +# elif defined(__APPLE__) + RTLD_LOCAL|RTLD_FIRST|RTLD_NOW # else 0 # endif @@ -128,7 +123,7 @@ DynamicLibrary::DynamicLibrary(const QString& filename) DynamicLibrary::~DynamicLibrary() { -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) handle->unload(); #else if (handle) diff --git a/facetracknoir/global-settings.h b/facetracknoir/global-settings.h index 29a8da62..6b04b73b 100644 --- a/facetracknoir/global-settings.h +++ b/facetracknoir/global-settings.h @@ -1,6 +1,6 @@ #pragma once -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) # define CALLING_CONVENTION_SUFFIX_VOID_FUNCTION "@0" # ifdef _MSC_VER # define MAYBE_STDCALL_UNDERSCORE "_" @@ -12,6 +12,14 @@ # define MAYBE_STDCALL_UNDERSCORE "" #endif +#ifdef _MSC_VER +# define virt_override +#else +# define virt_override override +#endif + +#include <cstdio> + #include <QWidget> #include <QDebug> #include <QString> @@ -21,7 +29,7 @@ #include "ftnoir_filter_base/ftnoir_filter_base.h" #include "ftnoir_protocol_base/ftnoir_protocol_base.h" -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) # define CALLING_CONVENTION __stdcall #else # define CALLING_CONVENTION @@ -57,7 +65,7 @@ public: METADATA_FUNCTION Metadata; QString filename; private: -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) QLibrary* handle; #else void* handle; diff --git a/facetracknoir/global-shortcuts.cpp b/facetracknoir/global-shortcuts.cpp index 286200c0..1c10b160 100644 --- a/facetracknoir/global-shortcuts.cpp +++ b/facetracknoir/global-shortcuts.cpp @@ -1,9 +1,12 @@ #include "facetracknoir/facetracknoir.h" -#if defined(__WIN32) || defined(_WIN32) -#include <windows.h> -#include <strmif.h> -#include <dshow.h> +#if defined(_WIN32) +# ifndef DIRECTINPUT_VERSION +# define DIRECTINPUT_VERSION 0x800 +# endif +# include <windows.h> +# include <dinput.h> + QList<int> global_windows_key_sequences = QList<int>() << 0 diff --git a/facetracknoir/images/facetracknoir.png b/facetracknoir/images/facetracknoir.png Binary files differindex b57724e0..41b54524 100644 --- a/facetracknoir/images/facetracknoir.png +++ b/facetracknoir/images/facetracknoir.png diff --git a/facetracknoir/images/settingsopen16.png b/facetracknoir/images/settingsopen16.png Binary files differdeleted file mode 100644 index 5bf65f0d..00000000 --- a/facetracknoir/images/settingsopen16.png +++ /dev/null diff --git a/facetracknoir/main-facetracknoir.qrc b/facetracknoir/main-facetracknoir.qrc index eb5ad991..6cb2e300 100644 --- a/facetracknoir/main-facetracknoir.qrc +++ b/facetracknoir/main-facetracknoir.qrc @@ -2,7 +2,6 @@ <qresource prefix="/"> <file>uielements/tools.png</file> <file>images/settings16.png</file> - <file>images/settingsopen16.png</file> <file>uielements/curves.png</file> <file>images/facetracknoir.png</file> </qresource> diff --git a/facetracknoir/main-settings.hpp b/facetracknoir/main-settings.hpp new file mode 100644 index 00000000..c9b5ff66 --- /dev/null +++ b/facetracknoir/main-settings.hpp @@ -0,0 +1,56 @@ +#pragma once + +#include <QString> +#include "facetracknoir/options.h" +using namespace options; + +struct key_opts { + value<int> key_index; + value<bool> ctrl, alt, shift; + key_opts(pbundle b, const QString& name) : + key_index(b, QString("key-index-%1").arg(name), 0), + ctrl(b, QString("key-ctrl-%1").arg(name), 0), + alt(b, QString("key-alt-%1").arg(name), 0), + shift(b, QString("key-shift-%1").arg(name), 0) + {} +}; + +struct axis_opts { + value<double> zero; + value<bool> invert, altp; + axis_opts(pbundle b, QString pfx) : + zero(b, n(pfx, "zero-pos"), 0), + invert(b, n(pfx, "invert-axis"), false), + altp(b, n(pfx, "alt-axis-sign"), false) + {} +private: + static inline QString n(QString pfx, QString name) { + return QString("%1-%2").arg(pfx, name); + } +}; + +struct main_settings { + pbundle b; + key_opts center_key; + key_opts toggle_key; + value<QString> tracker_dll, tracker2_dll, filter_dll, protocol_dll; + axis_opts a_x, a_y, a_z, a_yaw, a_pitch, a_roll; + value<bool> tcomp_p, tcomp_tz; + main_settings(pbundle b) : + b(b), + center_key(b, "center"), + toggle_key(b, "toggle"), + tracker_dll(b, "tracker-dll", ""), + tracker2_dll(b, "tracker2-dll", ""), + filter_dll(b, "filter-dll", ""), + protocol_dll(b, "protocol-dll", ""), + a_x(b, "x"), + a_y(b, "y"), + a_z(b, "z"), + a_yaw(b, "yaw"), + a_pitch(b, "pitch"), + a_roll(b, "roll"), + tcomp_p(b, "compensate-translation", true), + tcomp_tz(b, "compensate-translation-disable-z-axis", false) + {} +}; diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index fd0ca1cc..3143a093 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -1,62 +1,72 @@ -/********************************************************************************
-* 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/>. *
-*********************************************************************************/
-/*
- Modifications (last one on top):
- 20100520 - WVR: Added class FaceApp, to override winEventFilter. It receives
- messages from the Game.
-*/
-
-#include "facetracknoir.h"
-#include "tracker.h"
-#include <QtGui/QApplication>
-#include <QDesktopWidget>
-#include <QDebug>
-#include <QList>
-
-#if defined(_WIN32)
-#include <windows.h>
-//#pragma comment(linker, "/SUBSYSTEM:console /ENTRY:mainCRTStartup")
-#endif
-int main(int argc, char** argv)
-{
-#if defined(_WIN32)
- (void) timeBeginPeriod(1);
-#endif
- QApplication app(argc, argv);
- QFont font;
- font.setFamily(font.defaultFamily());
- font.setPointSize(9);
- app.setFont(font);
- FaceTrackNoIR w;
- //
- // Create the Main Window and DeskTop and Exec!
- //
- QDesktopWidget desktop;
- w.move(desktop.screenGeometry().width()/2-w.width()/2, 100);
- w.show();
- qApp->exec();
-
- return 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 <http://www.gnu.org/licenses/>. * +*********************************************************************************/ + +#include "facetracknoir.h" +#include "tracker.h" +#include <QApplication> +#include <QDesktopWidget> +#include <QDebug> +#include <QList> +#include <QDir> +#include <QStringList> +#include <memory> + +#if defined(_WIN32) && defined(_MSC_VER) +# include <windows.h> +# ifdef OPENTRACK_BREAKPAD +# include <exception_handler.h> +using namespace google_breakpad; +bool dumpCallback(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded) +{ + MessageBoxA(GetDesktopWindow(), + "Generating crash dump!\r\n" + "Please send the .dmp file to <sthalik@misaki.pl> to help us improve the code.", + "opentrack crashed :(", + MB_OK | MB_ICONERROR); + return succeeded; +} + +# endif +#endif + +int main(int argc, char** argv) +{ +#if defined(OPENTRACK_BREAKPAD) && defined(_MSC_VER) + auto handler = new ExceptionHandler(L".", nullptr, dumpCallback, nullptr, -1); +#endif + QApplication::setAttribute(Qt::AA_X11InitThreads, true); + QApplication app(argc, argv); + auto w = std::make_shared<FaceTrackNoIR>(); + + w->show(); + app.exec(); + + return 0; +} + diff --git a/facetracknoir/mingw-version-script.txt b/facetracknoir/mingw-version-script.txt new file mode 100644 index 00000000..fe20ad37 --- /dev/null +++ b/facetracknoir/mingw-version-script.txt @@ -0,0 +1,8 @@ +{ + global: + GetDialog?0; + GetConstructor?0; + GetMetadata?0; + local: + *; +}; diff --git a/facetracknoir/options.h b/facetracknoir/options.h new file mode 100644 index 00000000..3fd0e767 --- /dev/null +++ b/facetracknoir/options.h @@ -0,0 +1,319 @@ +/* Copyright (c) 2013 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#pragma once + +#include <QObject> +#include <QSettings> +#include <QMap> +#include <QString> +#include <QVariant> +#include <QMutex> +#include <QMutexLocker> +#include <memory> +#include <cassert> +#include <QWidget> +#include <QComboBox> +#include <QCheckBox> +#include <QDoubleSpinBox> +#include <QSpinBox> +#include <QSlider> +#include <QLineEdit> +#include <QLabel> +#include <QCoreApplication> + +#ifdef __GNUC__ +# define ov override +#else +# define ov +#endif + +#include <QDebug> + +namespace options { + template<typename T> + inline T qcruft_to_t (const QVariant& t); + + template<> + inline int qcruft_to_t<int>(const QVariant& t) + { + return t.toInt(); + } + + template<> + inline QString qcruft_to_t<QString>(const QVariant& t) + { + return t.toString(); + } + + template<> + inline bool qcruft_to_t<bool>(const QVariant& t) + { + return t.toBool(); + } + + template<> + inline double qcruft_to_t<double>(const QVariant& t) + { + return t.toDouble(); + } + + template<> + inline QVariant qcruft_to_t<QVariant>(const QVariant& t) + { + return t; + } + + // snapshot of qsettings group at given time + class group { + private: + QMap<QString, QVariant> map; + QString name; + public: + group(const QString& name) : name(name) + { + QSettings settings(group::org); + QString currentFile = + settings.value("SettingsFile", + QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings iniFile(currentFile, QSettings::IniFormat); + iniFile.beginGroup(name); + for (auto& k : iniFile.childKeys()) + map[k] = iniFile.value(k); + iniFile.endGroup(); + } + static constexpr const char* org = "opentrack"; + void save() { + QSettings settings(group::org); + QString currentFile = + settings.value("SettingsFile", + QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings s(currentFile, QSettings::IniFormat); + s.beginGroup(name); + for (auto& k : map.keys()) + s.setValue(k, map[k]); + s.endGroup(); + } + template<typename T> + T get(const QString& k) { + return qcruft_to_t<T>(map.value(k)); + } + + void put(const QString& s, const QVariant& d) + { + map[s] = d; + } + bool contains(const QString& s) + { + return map.contains(s); + } + }; + + class impl_bundle : public QObject { + Q_OBJECT + private: + QMutex mtx; + const QString group_name; + group saved; + group transient; + impl_bundle(const impl_bundle&) = delete; + impl_bundle& operator=(const impl_bundle&) = delete; + bool modified; + public: + impl_bundle(const QString& group_name) : + mtx(QMutex::Recursive), + group_name(group_name), + saved(group_name), + transient(saved), + modified(false) + { + } + void reload() { + QMutexLocker l(&mtx); + saved = group(group_name); + transient = saved; + emit reloaded(); + } + + std::shared_ptr<impl_bundle> make(const QString& name) { + return std::make_shared<impl_bundle>(name); + } + void store(const QString& name, const QVariant& datum) + { + QMutexLocker l(&mtx); + if (!transient.contains(name) || datum != transient.get<QVariant>(name)) + { + if (!modified) + qDebug() << name << transient.get<QVariant>(name) << datum; + modified = true; + transient.put(name, datum); + emit bundleChanged(); + } + } + bool contains(const QString& name) + { + QMutexLocker l(&mtx); + return transient.contains(name); + } + template<typename T> + T get(const QString& name) { + QMutexLocker l(&mtx); + return transient.get<T>(name); + } + void save() + { + QMutexLocker l(&mtx); + modified = false; + saved = transient; + transient.save(); + } + void revert() + { + QMutexLocker l(&mtx); + modified = false; + transient = saved; + emit bundleChanged(); + } + + bool modifiedp() { + QMutexLocker l(&mtx); + return modified; + } + signals: + void bundleChanged(); + void reloaded(); + }; + + typedef std::shared_ptr<impl_bundle> pbundle; + + class base_value : public QObject { + Q_OBJECT + public: + base_value(pbundle b, const QString& name) : b(b), self_name(name) { + connect(b.get(), SIGNAL(reloaded()), this, SLOT(reread_value())); + } + protected: + virtual QVariant operator=(const QVariant& datum) = 0; + pbundle b; + QString self_name; + public slots: + void reread_value() + { + this->operator=(b->get<QVariant>(self_name)); + } + public slots: +#define DEFINE_SLOT(t) void setValue(t datum) { this->operator=(qVariantFromValue(datum)); } + DEFINE_SLOT(double) + DEFINE_SLOT(int) + DEFINE_SLOT(QString) + DEFINE_SLOT(bool) + signals: +#define DEFINE_SIGNAL(t) void valueChanged(t); + DEFINE_SIGNAL(double) + DEFINE_SIGNAL(int) + DEFINE_SIGNAL(QString) + DEFINE_SIGNAL(bool) + }; + + template<typename T> + class value : public base_value { + protected: + QVariant operator=(const QVariant& datum) { + auto foo = qcruft_to_t<T>(datum); + b->store(self_name, qVariantFromValue<T>(foo)); + emit valueChanged(foo); + return datum; + } + public: + static constexpr const Qt::ConnectionType QT_CONNTYPE = Qt::UniqueConnection; + static constexpr const Qt::ConnectionType OPT_CONNTYPE = Qt::UniqueConnection; + value(pbundle b, const QString& name, T def) : + base_value(b, name) + { + if (!b->contains(name) || b->get<QVariant>(name).type() == QVariant::Invalid) + { + this->operator=(qVariantFromValue<T>(def)); + } + } + operator T() { return b->get<T>(self_name); } + QVariant operator=(const T& datum) + { + return this->operator =(qVariantFromValue<T>(datum)); + } + }; + + template<typename T, typename Q> + inline void tie_setting(value<T>&, Q*); + + template<> + inline void tie_setting(value<int>& v, QComboBox* cb) + { + cb->setCurrentIndex(v); + base_value::connect(cb, SIGNAL(currentIndexChanged(int)), &v, SLOT(setValue(int)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(int)), cb, SLOT(setCurrentIndex(int)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<QString>& v, QComboBox* cb) + { + cb->setCurrentText(v); + v = cb->currentText(); + base_value::connect(cb, SIGNAL(currentTextChanged(QString)), &v, SLOT(setValue(QString)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(QString)), cb, SLOT(setCurrentText(QString)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<bool>& v, QCheckBox* cb) + { + cb->setChecked(v); + base_value::connect(cb, SIGNAL(toggled(bool)), &v, SLOT(setValue(bool)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(bool)), cb, SLOT(setChecked(bool)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<double>& v, QDoubleSpinBox* dsb) + { + dsb->setValue(v); + base_value::connect(dsb, SIGNAL(valueChanged(double)), &v, SLOT(setValue(double)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(double)), dsb, SLOT(setValue(double)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<int>& v, QSpinBox* sb) + { + sb->setValue(v); + base_value::connect(sb, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(int)), sb, SLOT(setValue(int)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<int>& v, QSlider* sl) + { + sl->setValue(v); + base_value::connect(sl, SIGNAL(valueChanged(int)), &v, SLOT(setValue(int)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(int)), sl, SLOT(setValue(int)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<QString>& v, QLineEdit* le) + { + le->setText(v); + base_value::connect(le, SIGNAL(textChanged(QString)), &v, SLOT(setValue(QString)), v.QT_CONNTYPE); + base_value::connect(&v, SIGNAL(valueChanged(QString)),le, SLOT(setText(QString)), v.OPT_CONNTYPE); + } + + template<> + inline void tie_setting(value<QString>& v, QLabel* lb) + { + lb->setText(v); + base_value::connect(&v, SIGNAL(valueChanged(QString)), lb, SLOT(setText(QString)), v.OPT_CONNTYPE); + } + + inline pbundle bundle(const QString& group) { + return std::make_shared<impl_bundle>(group); + } +} diff --git a/facetracknoir/qt-moc.h b/facetracknoir/qt-moc.h new file mode 100644 index 00000000..8ccfffe8 --- /dev/null +++ b/facetracknoir/qt-moc.h @@ -0,0 +1,10 @@ +#include <QObject> + +// this file exists only such that cmake qt automoc is appeased + +class AutomocMe : public QObject { + Q_OBJECT +private: + virtual void foo() = 0; + AutomocMe() {} +}; diff --git a/facetracknoir/rotation.h b/facetracknoir/rotation.h index dd70ca77..22f35abb 100644 --- a/facetracknoir/rotation.h +++ b/facetracknoir/rotation.h @@ -1,64 +1,64 @@ -/* Copyright (c) 2012 Patrick Ruoff
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- */
-
-#ifndef ROTATION_H
-#define ROTATION_H
-#include <cmath>
-// ----------------------------------------------------------------------------
-class Rotation {
-
-public:
- Rotation() : a(1.0),b(0.0),c(0.0),d(0.0) {}
- Rotation(double yaw, double pitch, double roll) { fromEuler(yaw, pitch, roll); }
- Rotation(double a, double b, double c, double d) : a(a),b(b),c(c),d(d) {}
-
- Rotation inv(){ // inverse
- return Rotation(a,-b,-c, -d);
- }
-
-
- // conversions
- // see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
- void fromEuler(double yaw, double pitch, double roll)
- {
-
- double sin_phi = sin(roll/2.0);
- double cos_phi = cos(roll/2.0);
- double sin_the = sin(pitch/2.0);
- double cos_the = cos(pitch/2.0);
- double sin_psi = sin(yaw/2.0);
- double cos_psi = cos(yaw/2.0);
-
- a = cos_phi*cos_the*cos_psi + sin_phi*sin_the*sin_psi;
- b = sin_phi*cos_the*cos_psi - cos_phi*sin_the*sin_psi;
- c = cos_phi*sin_the*cos_psi + sin_phi*cos_the*sin_psi;
- d = cos_phi*cos_the*sin_psi - sin_phi*sin_the*cos_psi;
- }
-
- void toEuler(double& yaw, double& pitch, double& roll)
- {
- roll = atan2(2.0*(a*b + c*d), 1.0 - 2.0*(b*b + c*c));
- pitch = asin(2.0*(a*c - b*d));
- yaw = atan2(2.0*(a*d + b*c), 1.0 - 2.0*(c*c + d*d));
- }
-
- const Rotation operator*(const Rotation& B)
- {
- const Rotation& A = *this;
- return Rotation(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication
- A.a*B.b + A.b*B.a + A.c*B.d - A.d*B.c,
- A.a*B.c - A.b*B.d + A.c*B.a + A.d*B.b,
- A.a*B.d + A.b*B.c - A.c*B.b + A.d*B.a);
- }
-
-protected:
- double a,b,c,d; // quaternion coefficients
-};
-
-
-
-#endif //ROTATION_H
+/* Copyright (c) 2012 Patrick Ruoff + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + +#ifndef ROTATION_H +#define ROTATION_H +#include <cmath> +// ---------------------------------------------------------------------------- +class RotationType { + +public: + RotationType() : a(1.0),b(0.0),c(0.0),d(0.0) {} + RotationType(double yaw, double pitch, double roll) { fromEuler(yaw, pitch, roll); } + RotationType(double a, double b, double c, double d) : a(a),b(b),c(c),d(d) {} + + RotationType inv(){ // inverse + return RotationType(a,-b,-c, -d); + } + + + // conversions + // see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles + void fromEuler(double yaw, double pitch, double roll) + { + + double sin_phi = sin(roll/2.0); + double cos_phi = cos(roll/2.0); + double sin_the = sin(pitch/2.0); + double cos_the = cos(pitch/2.0); + double sin_psi = sin(yaw/2.0); + double cos_psi = cos(yaw/2.0); + + a = cos_phi*cos_the*cos_psi + sin_phi*sin_the*sin_psi; + b = sin_phi*cos_the*cos_psi - cos_phi*sin_the*sin_psi; + c = cos_phi*sin_the*cos_psi + sin_phi*cos_the*sin_psi; + d = cos_phi*cos_the*sin_psi - sin_phi*sin_the*cos_psi; + } + + void toEuler(double& yaw, double& pitch, double& roll) const + { + roll = atan2(2.0*(a*b + c*d), 1.0 - 2.0*(b*b + c*c)); + pitch = asin(2.0*(a*c - b*d)); + yaw = atan2(2.0*(a*d + b*c), 1.0 - 2.0*(c*c + d*d)); + } + + const RotationType operator*(const RotationType& B) const + { + const RotationType& A = *this; + return RotationType(A.a*B.a - A.b*B.b - A.c*B.c - A.d*B.d, // quaternion multiplication + A.a*B.b + A.b*B.a + A.c*B.d - A.d*B.c, + A.a*B.c - A.b*B.d + A.c*B.a + A.d*B.b, + A.a*B.d + A.b*B.c - A.c*B.b + A.d*B.a); + } + +protected: + double a,b,c,d; // quaternion coefficients +}; + + + +#endif //ROTATION_H diff --git a/facetracknoir/shortcuts.cpp b/facetracknoir/shortcuts.cpp new file mode 100644 index 00000000..a905be57 --- /dev/null +++ b/facetracknoir/shortcuts.cpp @@ -0,0 +1,150 @@ +#include "facetracknoir/facetracknoir.h" +#include "facetracknoir/shortcuts.h" + +KeyboardShortcutDialog::KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent ) + : QWidget( parent, Qt::Dialog) +{ + ui.setupUi( this ); + + QPoint offsetpos(100, 100); + this->move(parent->pos() + offsetpos); + + mainApp = ftnoir; // Preserve a pointer to FTNoIR + + // Connect Qt signals to member-functions + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); + + for ( int i = 0; i < global_key_sequences.size(); i++) { + ui.cbxCenterKey->addItem(global_key_sequences.at(i)); + ui.cbxToggleKey->addItem(global_key_sequences.at(i)); + } + + tie_setting(mainApp->s.center_key.key_index, ui.cbxCenterKey); + tie_setting(mainApp->s.center_key.alt, ui.chkCenterAlt); + tie_setting(mainApp->s.center_key.shift, ui.chkCenterShift); + tie_setting(mainApp->s.center_key.ctrl, ui.chkCenterCtrl); + + tie_setting(mainApp->s.toggle_key.key_index, ui.cbxToggleKey); + tie_setting(mainApp->s.toggle_key.alt, ui.chkToggleAlt); + tie_setting(mainApp->s.toggle_key.shift, ui.chkToggleShift); + tie_setting(mainApp->s.toggle_key.ctrl, ui.chkToggleCtrl); +} + +// +// OK clicked on server-dialog +// +void KeyboardShortcutDialog::doOK() { + mainApp->b->save(); + this->close(); + if (mainApp->tracker) + mainApp->bindKeyboardShortcuts(); +} + +void KeyboardShortcutDialog::doCancel() { + mainApp->b->revert(); + close(); +} + +#if defined(_WIN32) +#include <windows.h> + +KeybindingWorkerImpl::~KeybindingWorkerImpl() { + if (dinkeyboard) { + dinkeyboard->Unacquire(); + dinkeyboard->Release(); + } + if (din) + din->Release(); +} + +KeybindingWorkerImpl::KeybindingWorkerImpl(FaceTrackNoIR& w, Key keyCenter, Key keyToggle) +: din(0), dinkeyboard(0), kCenter(keyCenter), kToggle(keyToggle), window(w), should_quit(true) +{ + if (DirectInput8Create(GetModuleHandle(NULL), DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&din, NULL) != DI_OK) { + qDebug() << "setup DirectInput8 Creation failed!" << GetLastError(); + return; + } + if (din->CreateDevice(GUID_SysKeyboard, &dinkeyboard, NULL) != DI_OK) { + din->Release(); + din = 0; + qDebug() << "setup CreateDevice function failed!" << GetLastError(); + return; + } + if (dinkeyboard->SetDataFormat(&c_dfDIKeyboard) != DI_OK) { + qDebug() << "setup SetDataFormat function failed!" << GetLastError(); + dinkeyboard->Release(); + dinkeyboard = 0; + din->Release(); + din = 0; + return; + } + + if (dinkeyboard->SetCooperativeLevel((HWND) window.winId(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) != DI_OK) { + dinkeyboard->Release(); + din->Release(); + din = 0; + dinkeyboard = 0; + qDebug() << "setup SetCooperativeLevel function failed!" << GetLastError(); + return; + } + if (dinkeyboard->Acquire() != DI_OK) + { + dinkeyboard->Release(); + din->Release(); + din = 0; + dinkeyboard = 0; + qDebug() << "setup dinkeyboard Acquire failed!" << GetLastError(); + return; + } + should_quit = false; +} + +static bool isKeyPressed( const Key *key, const BYTE *keystate ) { + bool shift; + bool ctrl; + bool alt; + + if (keystate[key->keycode] & 0x80) { + shift = ( (keystate[DIK_LSHIFT] & 0x80) || (keystate[DIK_RSHIFT] & 0x80) ); + ctrl = ( (keystate[DIK_LCONTROL] & 0x80) || (keystate[DIK_RCONTROL] & 0x80) ); + alt = ( (keystate[DIK_LALT] & 0x80) || (keystate[DIK_RALT] & 0x80) ); + + // + // If one of the modifiers is needed and not pressed, return false. + // + if (key->shift && !shift) return false; + if (key->ctrl && !ctrl) return false; + if (key->alt && !alt) return false; + + // + // All is well! + // + return true; + } + return false; +} + +#define PROCESS_KEY(k, s) \ + if (isKeyPressed(&k, keystate) && (!k.ever_pressed ? (k.timer.start(), k.ever_pressed = true) : k.timer.restart() > 100)) \ + window.s(); + +void KeybindingWorkerImpl::run() { + BYTE keystate[256]; + while (!should_quit) + { + if (dinkeyboard->GetDeviceState(256, (LPVOID)keystate) != DI_OK) { + qDebug() << "Tracker::run GetDeviceState function failed!" << GetLastError(); + Sleep(25); + continue; + } + + PROCESS_KEY(kCenter, shortcutRecentered); + PROCESS_KEY(kToggle, shortcutToggled); + + Sleep(25); + } +} + +#else +#endif diff --git a/facetracknoir/shortcuts.h b/facetracknoir/shortcuts.h new file mode 100644 index 00000000..f8c34be7 --- /dev/null +++ b/facetracknoir/shortcuts.h @@ -0,0 +1,85 @@ +#pragma once +#include <QWidget> +#include <QElapsedTimer> +#include <QThread> +#include <QMessageBox> +#include <QCheckBox> +#include <QComboBox> +#include <QSettings> +#include "ui_ftnoir_keyboardshortcuts.h" + +class FaceTrackNoIR; + +class KeyboardShortcutDialog: public QWidget +{ + Q_OBJECT +public: + + KeyboardShortcutDialog( FaceTrackNoIR *ftnoir, QWidget *parent ); +private: + Ui::UICKeyboardShortcutDialog ui; + FaceTrackNoIR *mainApp; + +private slots: + void doOK(); + void doCancel(); +}; + +extern QList<QString> global_key_sequences; + +#if defined(_WIN32) +extern QList<int> global_windows_key_sequences; +# undef DIRECTINPUT_VERSION +# define DIRECTINPUT_VERSION 0x0800 +# include <windows.h> +# include <dinput.h> + +struct Key { + BYTE keycode; + bool shift; + bool ctrl; + bool alt; + bool ever_pressed; + QElapsedTimer timer; +public: + Key() : keycode(0), shift(false), ctrl(false), alt(false), ever_pressed(false) + { + } +}; +#else +typedef unsigned char BYTE; +struct Key { int foo; }; +#endif + +#if defined(_WIN32) +class KeybindingWorkerImpl { +private: + LPDIRECTINPUT8 din; + LPDIRECTINPUTDEVICE8 dinkeyboard; + Key kCenter; + Key kToggle; + FaceTrackNoIR& window; +public: + volatile bool should_quit; + ~KeybindingWorkerImpl(); + KeybindingWorkerImpl(FaceTrackNoIR& w, Key keyCenter, Key keyToggle); + void run(); +}; +#else +class KeybindingWorkerImpl { +public: + KeybindingWorkerImpl(FaceTrackNoIR& w, Key keyCenter, Key keyToggle); + void run() {} +}; +#endif + +class KeybindingWorker : public QThread, public KeybindingWorkerImpl { + Q_OBJECT +public: + KeybindingWorker(FaceTrackNoIR& w, Key keyCenter, Key keyToggle) : KeybindingWorkerImpl(w, keyCenter, keyToggle) + { + } + void run() { + KeybindingWorkerImpl::run(); + } +}; diff --git a/facetracknoir/timer.hpp b/facetracknoir/timer.hpp new file mode 100644 index 00000000..623836db --- /dev/null +++ b/facetracknoir/timer.hpp @@ -0,0 +1,66 @@ +#pragma once +#include <time.h> +#if defined (_WIN32) +# include <windows.h> +# define CLOCK_MONOTONIC 0 +static inline void clock_gettime(int, struct timespec* ts) +{ + static LARGE_INTEGER freq; + + if (!freq.QuadPart) + (void) QueryPerformanceFrequency(&freq); + + LARGE_INTEGER d; + + (void) QueryPerformanceCounter(&d); + + d.QuadPart *= 1000000000L; + d.QuadPart /= freq.QuadPart; + + ts->tv_sec = d.QuadPart / 1000000000L; + ts->tv_nsec = d.QuadPart % 1000000000L; +} + +#else +# if defined(__MACH__) +# define CLOCK_MONOTONIC 0 +# include <inttypes.h> +# include <mach/mach_time.h> +static inline void clock_gettime(int, struct timespec* ts) +{ + static mach_timebase_info_data_t sTimebaseInfo; + uint64_t state, nsec; + if ( sTimebaseInfo.denom == 0 ) { + (void) mach_timebase_info(&sTimebaseInfo); + } + state = mach_absolute_time(); + nsec = state * sTimebaseInfo.numer / sTimebaseInfo.denom; + ts->tv_sec = nsec / 1000000000L; + ts->tv_nsec = nsec % 1000000000L; +} +# endif +#endif +class Timer { +private: + struct timespec state; + int conv(const struct timespec& cur) + { + return (cur.tv_sec - state.tv_sec) * 1000L + (cur.tv_nsec - state.tv_nsec) / 1000000L; + } +public: + Timer() { + start(); + } + int start() { + struct timespec cur; + (void) clock_gettime(CLOCK_MONOTONIC, &cur); + int ret = conv(cur); + state = cur; + return ret; + } + int elapsed() { + struct timespec cur; + (void) clock_gettime(CLOCK_MONOTONIC, &cur); + return conv(cur); + } +}; diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index 7eedfea1..ebc8246d 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -1,210 +1,173 @@ -/********************************************************************************
-* 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) 2012 Wim Vriend (Developing) *
-* Ron Hendriks (Researching and Testing) *
-* *
-* Homepage: http://facetracknoir.sourceforge.net/home/default.htm *
-* *
-* 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/>. *
-*********************************************************************************/
+/* Copyright (c) 2012-2013 Stanislaw Halik <sthalik@misaki.pl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ */
+
/*
- Modifications (last one on top):
- 20121215 - WVR: Fixed crash after message: protocol not installed correctly... by terminating the thread.
- 20120921 - WVR: Fixed centering when no filter is selected.
- 20120917 - WVR: Added Mouse-buttons to ShortKeys.
- 20120827 - WVR: Signal tracking = false to Curve-widget(s) when quitting run(). Also when Alternative Pitch curve is used.
- 20120805 - WVR: The FunctionConfig-widget is used to configure the Curves. It was tweaked some more, because the Accela filter now also
- uses the Curve(s). ToDo: make the ranges configurable by the user. Development on the Toradex IMU makes us realize, that
- a fixed input-range may not be so handy after all..
- 20120427 - WVR: The Protocol-code was already in separate DLLs, but the ListBox was still filled �statically�. Now, a Dir() of the
- EXE-folder is done, to locate Protocol-DLLs. The Icons were also moved to the DLLs
- 20120317 - WVR: The Filter and Tracker-code was moved to separate DLLs. The calling-method
- was changed accordingly.
- The face-tracker member-functions NotifyZeroed and refreshVideo were added, as
- requested by Stanislaw.
- 20110411 - WVR: Finished moving all Protocols to separate C++ projects. Every protocol now
- has it's own Class, that's inside it's own DLL. This reduces the size of the program,
- makes it more structured and enables a more sophisticated installer.
- 20110328 - WVR: Changed the camera-structs into class-instances. This makes initialisation
- easier and hopefully solves the remaining 'start-up problem'.
- 20110313 - WVR: Removed 'set_initial'. Less is more.
- 20110109 - WVR: Added setZero option to define behaviour after STOP tracking via shortkey.
- 20110104 - WVR: Removed a few nasty bugs (it was impossible to stop tracker without crash).
- 20101224 - WVR: Removed the QThread inheritance of the Base Class for the protocol-servers.
- Again, this drastically simplifies the code in the protocols.
- 20101217 - WVR: Created Base Class for the protocol-servers. This drastically simplifies
- the code needed here.
- 20101024 - WVR: Added shortkey to disable/enable one or more axis during tracking.
- 20101021 - WVR: Added FSUIPC server for FS2004.
- 20101011 - WVR: Added SimConnect server.
- 20101007 - WVR: Created 6DOF-curves and drastically changed the tracker for that.
- Also eliminated a 'glitch' in the process.
- 20100607 - WVR: Re-installed Rotation Neutral Zone and improved reaction
- after 'start/stop'. MessageBeep when confidence is back...
- 20100604 - WVR: Created structure for DOF-data and changed timing of
- ReceiveHeadPose end run().
- 20100602 - WVR: Implemented EWMA-filtering, according to the example of
- Melchior Franz. Works like a charm...
- 20100601 - WVR: Added DirectInput keyboard-handling. '=' used for center,
- 'BACK' for start (+center)/stop.
- 20100517 - WVR: Added upstream command(s) from FlightGear
- 20100523 - WVR: Checkboxes to invert 6DOF's was implemented. Multiply by
- 1 or (-1).
-*/
+ * this file appeared originally in facetracknoir, was rewritten completely
+ * following opentrack fork.
+ *
+ * originally written by Wim Vriend.
+ */
+
#include "tracker.h"
#include "facetracknoir.h"
+#include <opencv2/core/core.hpp>
+#include <cmath>
+#include <algorithm>
+
+#if defined(_WIN32)
+# include <windows.h>
+#endif
-/** constructor **/
-Tracker::Tracker( FaceTrackNoIR *parent ) :
- confid(false),
+Tracker::Tracker(FaceTrackNoIR *parent , main_settings& s) :
+ mainApp(parent),
+ s(s),
should_quit(false),
- do_center(false)
+ do_center(false),
+ enabled(true)
{
- // Retieve the pointer to the parent
- mainApp = parent;
- // Load the settings from the INI-file
- loadSettings();
}
Tracker::~Tracker()
{
+ should_quit = true;
+ wait();
}
static void get_curve(double pos, double& out, THeadPoseDOF& axis) {
- bool altp = (pos < 0) && axis.altp;
+ bool altp = (pos < 0) && axis.opts.altp;
if (altp) {
- out = axis.invert * axis.curveAlt.getValue(pos);
+ out = (axis.opts.invert ? -1 : 1) * axis.curveAlt.getValue(pos);
axis.curve.setTrackingActive( false );
axis.curveAlt.setTrackingActive( true );
}
else {
- out = axis.invert * axis.curve.getValue(pos);
+ out = (axis.opts.invert ? -1 : 1) * axis.curve.getValue(pos);
axis.curve.setTrackingActive( true );
axis.curveAlt.setTrackingActive( false );
}
- out += axis.zero;
+ out += axis.opts.zero;
+}
+
+static void t_compensate(double* input, double* output, bool rz)
+{
+ const auto H = input[Yaw] * M_PI / -180;
+ const auto P = input[Pitch] * M_PI / -180;
+ const auto B = input[Roll] * M_PI / 180;
+
+ const auto cosH = cos(H);
+ const auto sinH = sin(H);
+ const auto cosP = cos(P);
+ const auto sinP = sin(P);
+ const auto cosB = cos(B);
+ const auto sinB = sin(B);
+
+ double foo[] = {
+ cosH * cosB - sinH * sinP * sinB,
+ - sinB * cosP,
+ sinH * cosB + cosH * sinP * sinB,
+ cosH * sinB + sinH * sinP * cosB,
+ cosB * cosP,
+ sinB * sinH - cosH * sinP * cosB,
+ - sinH * cosP,
+ - sinP,
+ cosH * cosP,
+ };
+
+ cv::Mat rmat(3, 3, CV_64F, foo);
+ const cv::Mat tvec(3, 1, CV_64F, input);
+ cv::Mat ret = rmat * tvec;
+
+ const int max = !rz ? 3 : 2;
+
+ for (int i = 0; i < max; i++)
+ output[i] = ret.at<double>(i);
}
/** QThread run method @override **/
void Tracker::run() {
- T6DOF current_camera; // Used for filtering
- T6DOF target_camera;
- T6DOF new_camera;
-
- /** Direct Input variables **/
T6DOF offset_camera;
- T6DOF gameoutput_camera;
-
- bool bTracker1Confid = false;
- bool bTracker2Confid = false;
-
- double newpose[6];
- double last_post_filter[6];
-
- forever
- {
+
+ double newpose[6] = {0};
+ int sleep_ms = 15;
+
+ if (Libraries->pTracker)
+ sleep_ms = std::min(sleep_ms, 1000 / Libraries->pTracker->preferredHz());
+
+ if (Libraries->pSecondTracker)
+ sleep_ms = std::min(sleep_ms, 1000 / Libraries->pSecondTracker->preferredHz());
+
+ qDebug() << "tracker Hz:" << 1000 / sleep_ms;
+
+#if defined(_WIN32)
+ (void) timeBeginPeriod(1);
+#endif
+
+ for (;;)
+ {
if (should_quit)
break;
- for (int i = 0; i < 6; i++)
- newpose[i] = 0;
-
- //
- // The second tracker serves as 'secondary'. So if an axis is written by the second tracker it CAN be overwritten by the Primary tracker.
- // This is enforced by the sequence below.
- //
if (Libraries->pSecondTracker) {
- bTracker2Confid = Libraries->pSecondTracker->GiveHeadPoseData(newpose);
+ Libraries->pSecondTracker->GetHeadPoseData(newpose);
}
if (Libraries->pTracker) {
- bTracker1Confid = Libraries->pTracker->GiveHeadPoseData(newpose);
+ Libraries->pTracker->GetHeadPoseData(newpose);
}
{
QMutexLocker foo(&mtx);
- confid = bTracker1Confid || bTracker2Confid;
-
- if ( confid ) {
- for (int i = 0; i < 6; i++)
- mainApp->axis(i).headPos = newpose[i];
- }
-
- //
- // If Center is pressed, copy the current values to the offsets.
- //
+
+ for (int i = 0; i < 6; i++)
+ mainApp->axis(i).headPos = newpose[i];
+
if (do_center) {
- //
- // Only copy valid values
- //
- if (confid) {
- for (int i = 0; i < 6; i++)
- offset_camera.axes[i] = mainApp->axis(i).headPos;
- }
-
- Tracker::do_center = false;
-
- if (Libraries->pTracker)
- Libraries->pTracker->NotifyCenter();
-
- if (Libraries->pSecondTracker)
- Libraries->pSecondTracker->NotifyCenter();
-
+ for (int i = 0; i < 6; i++)
+ offset_camera.axes[i] = mainApp->axis(i).headPos;
+
+ do_center = false;
+
if (Libraries->pFilter)
- Libraries->pFilter->Initialize();
+ Libraries->pFilter->reset();
}
-
- if (getTrackingActive()) {
- // get values
+
+ T6DOF target_camera, target_camera2, new_camera;
+
+ if (enabled)
+ {
for (int i = 0; i < 6; i++)
target_camera.axes[i] = mainApp->axis(i).headPos;
-
- // do the centering
- target_camera = target_camera - offset_camera;
-
- //
- // Use advanced filtering, when a filter was selected.
- //
- if (Libraries->pFilter) {
- for (int i = 0; i < 6; i++)
- last_post_filter[i] = gameoutput_camera.axes[i];
- Libraries->pFilter->FilterHeadPoseData(current_camera.axes, target_camera.axes, new_camera.axes, last_post_filter);
- }
- else {
- new_camera = target_camera;
- }
-
- for (int i = 0; i < 6; i++) {
- get_curve(new_camera.axes[i], output_camera.axes[i], mainApp->axis(i));
- }
-
- //
- // Send the headpose to the game
- //
- if (Libraries->pProtocol) {
- gameoutput_camera = output_camera;
- Libraries->pProtocol->sendHeadposeToGame( gameoutput_camera.axes, newpose ); // degrees & centimeters
- }
+
+ target_camera2 = target_camera - offset_camera;
+ }
+
+ if (Libraries->pFilter) {
+ Libraries->pFilter->FilterHeadPoseData(target_camera2.axes, new_camera.axes);
+ } else {
+ new_camera = target_camera2;
+ }
+
+ for (int i = 0; i < 6; i++) {
+ get_curve(new_camera.axes[i], output_camera.axes[i], mainApp->axis(i));
+ }
+
+ if (mainApp->s.tcomp_p)
+ t_compensate(output_camera.axes, output_camera.axes, mainApp->s.tcomp_tz);
+
+ if (Libraries->pProtocol) {
+ Libraries->pProtocol->sendHeadposeToGame( output_camera.axes ); // degrees & centimeters
}
}
-
- //for lower cpu load
- msleep(1);
+
+ msleep(sleep_ms);
}
+#if defined(_WIN32)
+ (void) timeEndPeriod(1);
+#endif
for (int i = 0; i < 6; i++)
{
@@ -213,9 +176,6 @@ void Tracker::run() { }
}
-//
-// Get the raw headpose, so it can be displayed.
-//
void Tracker::getHeadPose( double *data ) {
QMutexLocker foo(&mtx);
for (int i = 0; i < 6; i++)
@@ -224,42 +184,8 @@ void Tracker::getHeadPose( double *data ) { }
}
-//
-// Get the output-headpose, so it can be displayed.
-//
void Tracker::getOutputHeadPose( double *data ) {
QMutexLocker foo(&mtx);
for (int i = 0; i < 6; i++)
data[i] = output_camera.axes[i];
}
-
-//
-// Load the current Settings from the currently 'active' INI-file.
-//
-void Tracker::loadSettings() {
- qDebug() << "Tracker::loadSettings says: Starting ";
- 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)
-
- iniFile.beginGroup("Tracking");
-
- qDebug() << "loadSettings says: iniFile = " << currentFile;
-
- const char* names2[] = {
- "zero_tx",
- "zero_ty",
- "zero_tz",
- "zero_rx",
- "zero_ry",
- "zero_rz"
- };
-
- for (int i = 0; i < 6; i++)
- mainApp->axis(i).zero = iniFile.value(names2[i], 0).toDouble();
-
- iniFile.endGroup();
-}
-
-void Tracker::setInvertAxis(Axis axis, bool invert) { mainApp->axis(axis).invert = invert?-1.0f:1.0f; }
diff --git a/facetracknoir/tracker.h b/facetracknoir/tracker.h index f452395d..a33d8e0d 100644 --- a/facetracknoir/tracker.h +++ b/facetracknoir/tracker.h @@ -1,152 +1,100 @@ -/********************************************************************************
-* 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 - 2012 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/>. *
-*********************************************************************************/
-/*
- Modifications (last one on top):
- 20120717 - WVR: FunctionConfig is now used for the Curves, instead of BezierConfig.
-*/
-#ifndef __TRACKER_H__
-#define __TRACKER_H__
-
-#include <QThread>
-#include <QMessageBox>
-#include <QLineEdit>
-#include <QPoint>
-#include <QWaitCondition>
-#include <QList>
-#include <QPainterPath>
-#include <QDebug>
-#include <QMutex>
-#include "global-settings.h"
-#include <ftnoir_tracker_base/ftnoir_tracker_types.h>
-
-//#define DIRECTINPUT_VERSION 0x0800
-//#include <Dinput.h>
-#undef FTNOIR_PROTOCOL_BASE_LIB
-#undef FTNOIR_TRACKER_BASE_LIB
-#undef FTNOIR_FILTER_BASE_LIB
-#undef FTNOIR_PROTOCOL_BASE_EXPORT
-#undef FTNOIR_TRACKER_BASE_EXPORT
-#undef FTNOIR_FILTER_BASE_EXPORT
-#define FTNOIR_PROTOCOL_BASE_EXPORT Q_DECL_IMPORT
-#define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_IMPORT
-#define FTNOIR_FILTER_BASE_EXPORT Q_DECL_IMPORT
-
-#include <qfunctionconfigurator/functionconfig.h>
-#include "ftnoir_tracker_base/ftnoir_tracker_base.h"
-#include "ftnoir_protocol_base/ftnoir_protocol_base.h"
-#include "ftnoir_filter_base/ftnoir_filter_base.h"
-#include "tracker_types.h"
-
-class FaceTrackNoIR; // pre-define parent-class to avoid circular includes
-
-//
-// Structure to hold all variables concerning one of 6 DOF's
-//
-class THeadPoseDOF {
-private:
- THeadPoseDOF(const THeadPoseDOF &) {}
-public:
- 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 );
- curve.loadSettings(iniFile);
- curveAlt.loadSettings(iniFile);
-
- iniFile.beginGroup("Tracking");
- altp = iniFile.value(secondary).toBool();
- iniFile.endGroup();
- }
- double headPos; // Current position (from faceTracker, radials or meters)
- float invert; // Invert measured value (= 1.0f or -1.0f)
- FunctionConfig curve; // Function to translate input -> output
- FunctionConfig curveAlt;
- bool altp;
- double zero;
-};
-
-class Tracker : public QThread {
- Q_OBJECT
-
-private:
- FaceTrackNoIR *mainApp;
- QMutex mtx;
-
-protected:
- // qthread override run method
- void run();
-
-public:
- Tracker( FaceTrackNoIR *parent );
- ~Tracker();
- void loadSettings(); // Load settings from the INI-file
- bool getTrackingActive() { return confid; }
-
- void setInvertAxis(Axis axis, bool invert);
-
- void getHeadPose(double *data); // Return the current headpose data
- void getOutputHeadPose(double *data); // Return the current (processed) headpose data
-
- volatile bool should_quit;
- // following are now protected by hTrackMutex
- volatile bool do_center; // Center head-position, using the shortkey
- // Flags to start/stop/reset tracking
- volatile bool confid; // Tracker data is OK;
-
- T6DOF output_camera;
-};
-
-class HeadPoseData {
-public:
- THeadPoseDOF* axes[6];
- HeadPoseData()
- {
- 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[Yaw] = new THeadPoseDOF("rx", "rx_alt", 180, 180, 180, 180);
- axes[Pitch] = new THeadPoseDOF("ry", "ry_alt", 90, 90, 90, 90);
- axes[Roll] = new THeadPoseDOF("rz", "rz_alt", 180, 180, 180, 180);
- }
-};
-
-#endif
+#ifndef __TRACKER_H__ +#define __TRACKER_H__ + +#include <QThread> +#include <QMessageBox> +#include <QLineEdit> +#include <QPoint> +#include <QWaitCondition> +#include <QList> +#include <QPainterPath> +#include <QDebug> +#include <QMutex> +#include "global-settings.h" +#include <ftnoir_tracker_base/ftnoir_tracker_types.h> +#include <vector> + +#include <qfunctionconfigurator/functionconfig.h> +#include "tracker_types.h" +#include "facetracknoir/main-settings.hpp" +#include "facetracknoir/options.h" +using namespace options; + +class FaceTrackNoIR; // pre-define parent-class to avoid circular includes + +class THeadPoseDOF { +private: + THeadPoseDOF(const THeadPoseDOF &) = delete; + THeadPoseDOF& operator=(const THeadPoseDOF&) = delete; +public: + THeadPoseDOF(QString primary, + QString secondary, + int maxInput1, + int maxOutput1, + int maxInput2, + int maxOutput2, + axis_opts* opts) : + headPos(0), + curve(primary, maxInput1, maxOutput1), + curveAlt(secondary, maxInput2, maxOutput2), + opts(*opts) + { + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings iniFile( currentFile, QSettings::IniFormat ); + curve.loadSettings(iniFile); + curveAlt.loadSettings(iniFile); + } + volatile double headPos; + FunctionConfig curve; + FunctionConfig curveAlt; + axis_opts& opts; +}; + +class Tracker : protected QThread { + Q_OBJECT + +private: + FaceTrackNoIR *mainApp; + QMutex mtx; + main_settings& s; + volatile bool should_quit; +protected: + void run(); + +public: + Tracker( FaceTrackNoIR *parent, main_settings& s); + ~Tracker(); + + void getHeadPose(double *data); + void getOutputHeadPose(double *data); + volatile bool do_center; + volatile bool enabled; + + T6DOF output_camera; + + void start() { QThread::start(); } +}; + +class HeadPoseData { +public: + THeadPoseDOF* axes[6]; + HeadPoseData(std::vector<axis_opts*> opts) + { + axes[TX] = new THeadPoseDOF("tx","tx_alt", 100, 100, 100, 100, opts[TX]); + axes[TY] = new THeadPoseDOF("ty","ty_alt", 100, 100, 100, 100, opts[TY]); + axes[TZ] = new THeadPoseDOF("tz","tz_alt", 100, 100, 100, 100, opts[TZ]); + axes[Yaw] = new THeadPoseDOF("rx", "rx_alt", 180, 180, 180, 180, opts[Yaw]); + axes[Pitch] = new THeadPoseDOF("ry", "ry_alt", 90, 90, 90, 90, opts[Pitch]); + axes[Roll] = new THeadPoseDOF("rz", "rz_alt", 180, 180, 180, 180, opts[Roll]); + } + ~HeadPoseData() + { + for (int i = 0; i < 6; i++) + { + delete axes[i]; + } + } +}; + +#endif diff --git a/facetracknoir/tracker_types.cpp b/facetracknoir/tracker_types.cpp index 11adc985..dec4ff81 100644 --- a/facetracknoir/tracker_types.cpp +++ b/facetracknoir/tracker_types.cpp @@ -1,44 +1,44 @@ -#include "tracker_types.h"
-#include "rotation.h"
-
-#define PI 3.14159265358979323846264
-#define D2R PI/180.0
-#define R2D 180.0/PI
-
-T6DOF operator-(const T6DOF& A, const T6DOF& B)
-{
- Rotation R_A(A.axes[Yaw]*D2R, A.axes[Pitch]*D2R, A.axes[Roll]*D2R);
- Rotation R_B(B.axes[Yaw]*D2R, B.axes[Pitch]*D2R, B.axes[Roll]*D2R);
- Rotation R_C = R_A * R_B.inv();
-
- T6DOF C;
- R_C.toEuler(C.axes[Yaw], C.axes[Pitch], C.axes[Roll]);
- C.axes[Yaw] *= R2D;
- C.axes[Pitch] *= R2D;
- C.axes[Roll] *= R2D;
-
- C.axes[TX] = A.axes[TX] - B.axes[TX];
- C.axes[TY] = A.axes[TY] - B.axes[TY];
- C.axes[TZ] = A.axes[TZ] - B.axes[TZ];
- //C.frame_number?
- return C;
-}
-
-T6DOF operator+(const T6DOF& A, const T6DOF& B)
-{
- Rotation R_A(A.axes[Yaw]*D2R, A.axes[Pitch]*D2R, A.axes[Roll]*D2R);
- Rotation R_B(B.axes[Yaw]*D2R, B.axes[Pitch]*D2R, B.axes[Roll]*D2R);
- Rotation R_C = R_A * R_B;
-
- T6DOF C;
- R_C.toEuler(C.axes[Yaw], C.axes[Pitch], C.axes[Roll]);
- C.axes[Yaw] *= R2D;
- C.axes[Pitch] *= R2D;
- C.axes[Roll] *= R2D;
-
- C.axes[TX] = A.axes[TX] + B.axes[TX];
- C.axes[TY] = A.axes[TY] + B.axes[TY];
- C.axes[TZ] = A.axes[TZ] + B.axes[TZ];
- //C.frame_number?
- return C;
-}
+#include "tracker_types.h" +#include "rotation.h" + +#define PI 3.14159265358979323846264 +#define D2R PI/180.0 +#define R2D 180.0/PI + +T6DOF operator-(const T6DOF& A, const T6DOF& B) +{ + RotationType R_A(A.axes[Yaw]*D2R, A.axes[Pitch]*D2R, A.axes[Roll]*D2R); + RotationType R_B(B.axes[Yaw]*D2R, B.axes[Pitch]*D2R, B.axes[Roll]*D2R); + RotationType R_C = R_A * R_B.inv(); + + T6DOF C; + R_C.toEuler(C.axes[Yaw], C.axes[Pitch], C.axes[Roll]); + C.axes[Yaw] *= R2D; + C.axes[Pitch] *= R2D; + C.axes[Roll] *= R2D; + + C.axes[TX] = A.axes[TX] - B.axes[TX]; + C.axes[TY] = A.axes[TY] - B.axes[TY]; + C.axes[TZ] = A.axes[TZ] - B.axes[TZ]; + //C.frame_number? + return C; +} + +T6DOF operator+(const T6DOF& A, const T6DOF& B) +{ + RotationType R_A(A.axes[Yaw]*D2R, A.axes[Pitch]*D2R, A.axes[Roll]*D2R); + RotationType R_B(B.axes[Yaw]*D2R, B.axes[Pitch]*D2R, B.axes[Roll]*D2R); + RotationType R_C = R_A * R_B; + + T6DOF C; + R_C.toEuler(C.axes[Yaw], C.axes[Pitch], C.axes[Roll]); + C.axes[Yaw] *= R2D; + C.axes[Pitch] *= R2D; + C.axes[Roll] *= R2D; + + C.axes[TX] = A.axes[TX] + B.axes[TX]; + C.axes[TY] = A.axes[TY] + B.axes[TY]; + C.axes[TZ] = A.axes[TZ] + B.axes[TZ]; + //C.frame_number? + return C; +} diff --git a/facetracknoir/tracker_types.h b/facetracknoir/tracker_types.h index d77a0b87..a367371e 100644 --- a/facetracknoir/tracker_types.h +++ b/facetracknoir/tracker_types.h @@ -1,46 +1,19 @@ -/********************************************************************************
-* 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 - 2012 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/>. *
-*********************************************************************************/
-/*
- Modifications (last one on top):
- 20120924 - C14: Moved tracker types only used by Tracker to this file (should not be part of public interface)
- Modified operators to represent correct frame transitions
-*/
-#ifndef __TRACKER_TYPES_H__
-#define __TRACKER_TYPES_H__
-
-#include "ftnoir_tracker_base/ftnoir_tracker_types.h"
-
-struct T6DOF {
-public:
- double axes[6];
-
- T6DOF() {
- for (int i = 0; i < 6; i++)
- axes[i] = 0;
- }
-};
-
-T6DOF operator-(const T6DOF& A, const T6DOF& B); // get new pose with respect to reference pose B
-T6DOF operator+(const T6DOF& A, const T6DOF& B); // get new pose with respect to reference pose B^-1
-
-#endif //__TRACKER_TYPES_H__
+#ifndef __TRACKER_TYPES_H__ +#define __TRACKER_TYPES_H__ + +#include "ftnoir_tracker_base/ftnoir_tracker_types.h" + +struct T6DOF { +public: + double axes[6]; + + T6DOF() { + for (int i = 0; i < 6; i++) + axes[i] = 0; + } +}; + +T6DOF operator-(const T6DOF& A, const T6DOF& B); // get new pose with respect to reference pose B +T6DOF operator+(const T6DOF& A, const T6DOF& B); // get new pose with respect to reference pose B^-1 + +#endif //__TRACKER_TYPES_H__ diff --git a/facetracknoir/uielements/logo_facetracknoir_32px.jpg b/facetracknoir/uielements/logo_facetracknoir_32px.jpg Binary files differdeleted file mode 100644 index 73ead853..00000000 --- a/facetracknoir/uielements/logo_facetracknoir_32px.jpg +++ /dev/null diff --git a/facetracknoir/uielements/logo_facetracknoir_32px.png b/facetracknoir/uielements/logo_facetracknoir_32px.png Binary files differdeleted file mode 100644 index c4e63c76..00000000 --- a/facetracknoir/uielements/logo_facetracknoir_32px.png +++ /dev/null diff --git a/facetracknoir/uielements/logo_noir.png b/facetracknoir/uielements/logo_noir.png Binary files differdeleted file mode 100644 index bb654a07..00000000 --- a/facetracknoir/uielements/logo_noir.png +++ /dev/null diff --git a/facetracknoir/uielements/logo_noir_small.png b/facetracknoir/uielements/logo_noir_small.png Binary files differdeleted file mode 100644 index 5d49e0b1..00000000 --- a/facetracknoir/uielements/logo_noir_small.png +++ /dev/null diff --git a/facetracknoir/uielements/logo_noir_small_target.png b/facetracknoir/uielements/logo_noir_small_target.png Binary files differdeleted file mode 100644 index 4bbaf41f..00000000 --- a/facetracknoir/uielements/logo_noir_small_target.png +++ /dev/null diff --git a/facetracknoir/uielements/logo_noir_small_target90px.png b/facetracknoir/uielements/logo_noir_small_target90px.png Binary files differdeleted file mode 100644 index ecaa4e12..00000000 --- a/facetracknoir/uielements/logo_noir_small_target90px.png +++ /dev/null diff --git a/facetracknoir/uielements/logofacetracknoir.png b/facetracknoir/uielements/logofacetracknoir.png Binary files differdeleted file mode 100644 index a1a3407b..00000000 --- a/facetracknoir/uielements/logofacetracknoir.png +++ /dev/null diff --git a/facetracknoir/uielements/logofacetracknoir60px.png b/facetracknoir/uielements/logofacetracknoir60px.png Binary files differdeleted file mode 100644 index f01f6024..00000000 --- a/facetracknoir/uielements/logofacetracknoir60px.png +++ /dev/null |