diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-08 06:51:51 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-08 06:51:51 +0200 |
commit | 027fd0f8b4efcf005a0bba850109089737f40a3f (patch) | |
tree | 44261588d2024e3704b1acc9111682ad091dccff | |
parent | ab47eac174db02710a7fa6c194e00c31cef755a4 (diff) |
retab and reformat only
27 files changed, 550 insertions, 555 deletions
@@ -9,18 +9,18 @@ class CSV { public: - QString readLine(); - QStringList parseLine(); - static QStringList parseLine(QString line); + QString readLine(); + QStringList parseLine(); + static QStringList parseLine(QString line); - void setCodec(const char* codecName); + void setCodec(const char* codecName); static void getGameData(const int gameID, unsigned char* table, QString& gamename); private: - QIODevice *m_device; - QTextCodec *m_codec; - QString m_string; - int m_pos; - QRegExp m_rx; + QIODevice *m_device; + QTextCodec *m_codec; + QString m_string; + int m_pos; + QRegExp m_rx; CSV(QIODevice * device); - CSV(QString &string); + CSV(QString &string); }; diff --git a/ftnoir_protocol_fg/fgtypes.h b/ftnoir_protocol_fg/fgtypes.h index 0f29be3d..2e493f46 100644 --- a/ftnoir_protocol_fg/fgtypes.h +++ b/ftnoir_protocol_fg/fgtypes.h @@ -1,14 +1,14 @@ /******************************************************************************** -* 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 * -* * -* Type definitions for the FlightGear server. * +* 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 * +* * +* Type definitions for the FlightGear server. * ********************************************************************************/ #pragma once #ifndef INCLUDED_FGTYPES_H @@ -19,8 +19,8 @@ // #pragma pack(push, 2) struct TFlightGearData { - double x, y, z, h, p, r; - int status; + double x, y, z, h, p, r; + int status; }; #pragma pack(pop) diff --git a/ftnoir_protocol_fg/ftnoir_protocol_fg.h b/ftnoir_protocol_fg/ftnoir_protocol_fg.h index 88b24a09..da0d1836 100644 --- a/ftnoir_protocol_fg/ftnoir_protocol_fg.h +++ b/ftnoir_protocol_fg/ftnoir_protocol_fg.h @@ -1,29 +1,29 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2013 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/>. * -* * -* FGServer FGServer is the Class, that communicates headpose-data * -* to FlightGear, using UDP. * -* It is based on the (Linux) example made by Melchior FRANZ. * +* FaceTrackNoIR This program is a private project of some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2013 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/>. * +* * +* FGServer FGServer is the Class, that communicates headpose-data * +* to FlightGear, using UDP. * +* It is based on the (Linux) example made by Melchior FRANZ. * ********************************************************************************/ #pragma once #include "ui_ftnoir_fgcontrols.h" @@ -68,19 +68,19 @@ class FGControls: public IProtocolDialog Q_OBJECT public: FGControls(); - void register_protocol(IProtocol *) {} - void unregister_protocol() {} + void register_protocol(IProtocol *) {} + void unregister_protocol() {} private: - Ui::UICFGControls ui; + Ui::UICFGControls ui; settings s; private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); }; class FTNoIR_ProtocolDll : public Metadata { public: QString name() { return QString("FlightGear"); } - QIcon icon() { return QIcon(":/images/flightgear.png"); } + QIcon icon() { return QIcon(":/images/flightgear.png"); } }; diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h index f477ee2a..35558794 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h +++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h @@ -1,28 +1,28 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010-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/>. * -* * -* FSUIPCServer FSUIPCServer is the Class, that communicates headpose-data * -* to games, using the FSUIPC.dll. * +* FaceTrackNoIR This program is a private project of some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2010-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/>. * +* * +* FSUIPCServer FSUIPCServer is the Class, that communicates headpose-data * +* to games, using the FSUIPC.dll. * ********************************************************************************/ #pragma once #ifndef INCLUDED_FSUIPCSERVER_H @@ -53,18 +53,18 @@ struct settings : opts { {} }; -#pragma pack(push,1) // All fields in structure must be byte aligned. +#pragma pack(push,1) // All fields in structure must be byte aligned. typedef struct { - int Control; // Control identifier - int Value; // Value of DOF + int Control; // Control identifier + int Value; // Value of DOF } TFSState; #pragma pack(pop) class FTNoIR_Protocol : public IProtocol { public: - FTNoIR_Protocol(); + FTNoIR_Protocol(); ~FTNoIR_Protocol() override; bool correct(); void pose(const double* headpose); @@ -72,9 +72,9 @@ public: return "Microsoft Flight Simulator X"; } private: - QLibrary FSUIPCLib; + QLibrary FSUIPCLib; double prevPosX, prevPosY, prevPosZ, prevRotX, prevRotY, prevRotZ; - static int scale2AnalogLimits( float x, float min_x, float max_x ); + static int scale2AnalogLimits( float x, float min_x, float max_x ); settings s; }; @@ -86,12 +86,12 @@ public: void register_protocol(IProtocol *) {} void unregister_protocol() {} private: - Ui::UICFSUIPCControls ui; + Ui::UICFSUIPCControls ui; settings s; private slots: - void doOK(); - void doCancel(); - void getLocationOfDLL(); + void doOK(); + void doCancel(); + void getLocationOfDLL(); }; class FTNoIR_ProtocolDll : public Metadata diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.h b/ftnoir_protocol_ft/ftnoir_protocol_ft.h index 3fe9952d..b7506c75 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.h +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.h @@ -1,28 +1,28 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of 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/>. * -* * -* FTServer FTServer is the Class, that communicates headpose-data * -* to games, using the FreeTrackClient.dll. * +* FaceTrackNoIR This program is a private project of 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/>. * +* * +* FTServer FTServer is the Class, that communicates headpose-data * +* to games, using the FreeTrackClient.dll. * ********************************************************************************/ #pragma once #include "ui_ftnoir_ftcontrols.h" diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index 1c204abf..9c91f057 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -1,29 +1,29 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010-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/>. * -* * -* FTNServer FTNServer is the Class, that communicates headpose-data * -* to FlightGear, using UDP. * -* It is based on the (Linux) example made by Melchior FRANZ. * +* FaceTrackNoIR This program is a private project of some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2010-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/>. * +* * +* FTNServer FTNServer is the Class, that communicates headpose-data * +* to FlightGear, using UDP. * +* It is based on the (Linux) example made by Melchior FRANZ. * ********************************************************************************/ #pragma once @@ -51,7 +51,7 @@ struct settings : opts { class FTNoIR_Protocol : public IProtocol { public: - FTNoIR_Protocol(); + FTNoIR_Protocol(); bool correct(); void pose(const double *headpose); QString game_name() { @@ -71,11 +71,11 @@ public: void register_protocol(IProtocol *) {} void unregister_protocol() {} private: - Ui::UICFTNControls ui; + Ui::UICFTNControls ui; settings s; private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); }; class FTNoIR_ProtocolDll : public Metadata diff --git a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h index 9ea9664e..ecb3b201 100644 --- a/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h +++ b/ftnoir_protocol_libevdev/ftnoir_protocol_libevdev.h @@ -18,7 +18,7 @@ extern "C" { class FTNoIR_Protocol : public IProtocol { public: - FTNoIR_Protocol(); + FTNoIR_Protocol(); ~FTNoIR_Protocol() override; bool correct() { return dev != NULL; @@ -38,15 +38,15 @@ class LibevdevControls: public IProtocolDialog public: LibevdevControls(); void register_protocol(IProtocol *) {} - void unregister_protocol() {} + void unregister_protocol() {} private: Ui::UICLibevdevControls ui; - void save(); + void save(); private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); }; class FTNoIR_ProtocolDll : public Metadata diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h index 0738278a..06405e69 100644 --- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h +++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h @@ -1,30 +1,30 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010-2011 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* 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/>. * -* * -* FTNoIR_Protocol_Mouse The Class, that communicates headpose-data by * -* generating Mouse commands. * -* Many games (like FPS's) support Mouse-look features, * -* but no face-tracking. * +* FaceTrackNoIR This program is a private project of some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2010-2011 Wim Vriend (Developing) * +* Ron Hendriks (Researching and Testing) * +* * +* 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/>. * +* * +* FTNoIR_Protocol_Mouse The Class, that communicates headpose-data by * +* generating Mouse commands. * +* Many games (like FPS's) support Mouse-look features, * +* but no face-tracking. * ********************************************************************************/ #pragma once #ifndef INCLUDED_MOUSESERVER_H diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index 7c32d014..cbdee7de 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -1,30 +1,30 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010-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/>. * -* * -* SCServer SCServer is the Class, that communicates headpose-data * -* to games, using the SimConnect.dll. * -* SimConnect.dll is a so called 'side-by-side' assembly, so it * -* must be treated as such... * +* FaceTrackNoIR This program is a private project of some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2010-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/>. * +* * +* SCServer SCServer is the Class, that communicates headpose-data * +* to games, using the SimConnect.dll. * +* SimConnect.dll is a so called 'side-by-side' assembly, so it * +* must be treated as such... * ********************************************************************************/ #pragma once #undef _WIN32_WINNT @@ -66,7 +66,7 @@ struct settings : opts { class FTNoIR_Protocol : public IProtocol, private QThread { public: - FTNoIR_Protocol(); + FTNoIR_Protocol(); ~FTNoIR_Protocol() override; bool correct(); void pose(const double* headpose); @@ -77,22 +77,22 @@ public: private: void run() override; volatile bool should_stop; - - volatile float virtSCPosX; - volatile float virtSCPosY; - volatile float virtSCPosZ; - volatile float virtSCRotX; - volatile float virtSCRotY; - volatile float virtSCRotZ; - importSimConnect_Open simconnect_open; // SimConnect function(s) in DLL - importSimConnect_Close simconnect_close; - importSimConnect_CameraSetRelative6DOF simconnect_set6DOF; - importSimConnect_CallDispatch simconnect_calldispatch; - importSimConnect_SubscribeToSystemEvent simconnect_subscribetosystemevent; + volatile float virtSCPosX; + volatile float virtSCPosY; + volatile float virtSCPosZ; + volatile float virtSCRotX; + volatile float virtSCRotY; + volatile float virtSCRotZ; - HANDLE hSimConnect; // Handle to SimConnect - static void CALLBACK processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext); + importSimConnect_Open simconnect_open; // SimConnect function(s) in DLL + importSimConnect_Close simconnect_close; + importSimConnect_CameraSetRelative6DOF simconnect_set6DOF; + importSimConnect_CallDispatch simconnect_calldispatch; + importSimConnect_SubscribeToSystemEvent simconnect_subscribetosystemevent; + + HANDLE hSimConnect; // Handle to SimConnect + static void CALLBACK processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext); settings s; QLibrary SCClientLib; }; diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index a9e8ed6e..2eeb4734 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -1,29 +1,29 @@ /******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2013 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/>. * -* * -* FGServer FGServer is the Class, that communicates headpose-data * -* to FlightGear, using UDP. * -* It is based on the (Linux) example made by Melchior FRANZ. * +* FaceTrackNoIR This program is a private project of some enthusiastic * +* gamers from Holland, who don't like to pay much for * +* head-tracking. * +* * +* Copyright (C) 2013 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/>. * +* * +* FGServer FGServer is the Class, that communicates headpose-data * +* to FlightGear, using UDP. * +* It is based on the (Linux) example made by Melchior FRANZ. * ********************************************************************************/ #pragma once #include "ui_ftnoir_vjoy_controls.h" @@ -35,7 +35,7 @@ class FTNoIR_Protocol : public IProtocol { public: - FTNoIR_Protocol(); + FTNoIR_Protocol(); ~FTNoIR_Protocol() override; bool correct() { return true; @@ -53,17 +53,17 @@ class VJoyControls: public IProtocolDialog Q_OBJECT public: - explicit VJoyControls(); + explicit VJoyControls(); void register_protocol(IProtocol *) {} - void unregister_protocol() {} + void unregister_protocol() {} private: - Ui::UICVJoyControls ui; - void save(); + Ui::UICVJoyControls ui; + void save(); private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); }; class FTNoIR_ProtocolDll : public Metadata @@ -83,17 +83,17 @@ public: typedef struct _JOYSTICK_STATE { - UCHAR ReportId; // Report Id - SHORT XAxis; // X Axis - SHORT YAxis; // Y Axis - SHORT ZAxis; // Z Axis - SHORT XRotation; // X Rotation - SHORT YRotation; // Y Rotation - SHORT ZRotation; // Z Rotation - SHORT Slider; // Slider - SHORT Dial; // Dial - USHORT POV; // POV - UINT32 Buttons; // 32 Buttons + UCHAR ReportId; // Report Id + SHORT XAxis; // X Axis + SHORT YAxis; // Y Axis + SHORT ZAxis; // Z Axis + SHORT XRotation; // X Rotation + SHORT YRotation; // Y Rotation + SHORT ZRotation; // Z Rotation + SHORT Slider; // Slider + SHORT Dial; // Dial + USHORT POV; // POV + UINT32 Buttons; // 32 Buttons } JOYSTICK_STATE, * PJOYSTICK_STATE; #ifndef _MSC_VER diff --git a/ftnoir_tracker_aruco/ar_video_widget.h b/ftnoir_tracker_aruco/ar_video_widget.h index 8c51382b..638b0ab4 100644 --- a/ftnoir_tracker_aruco/ar_video_widget.h +++ b/ftnoir_tracker_aruco/ar_video_widget.h @@ -21,8 +21,7 @@ // ---------------------------------------------------------------------------- class ArucoVideoWidget : public QWidget { - Q_OBJECT - + Q_OBJECT private: QMutex mtx; QImage texture; diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h index ffcd3eca..ac393bfb 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco_dll.h @@ -10,9 +10,9 @@ //----------------------------------------------------------------------------- class TrackerDll : public Metadata { - // ITrackerDll interface - void getFullName(QString *strToBeFilled); - void getShortName(QString *strToBeFilled); - void getDescription(QString *strToBeFilled); - void getIcon(QIcon *icon); + // ITrackerDll interface + void getFullName(QString *strToBeFilled); + void getShortName(QString *strToBeFilled); + void getDescription(QString *strToBeFilled); + void getIcon(QIcon *icon); }; diff --git a/ftnoir_tracker_aruco/trans_calib.cpp b/ftnoir_tracker_aruco/trans_calib.cpp index 369de449..a562763a 100644 --- a/ftnoir_tracker_aruco/trans_calib.cpp +++ b/ftnoir_tracker_aruco/trans_calib.cpp @@ -12,33 +12,33 @@ using namespace cv; //----------------------------------------------------------------------------- TranslationCalibrator::TranslationCalibrator() { - reset(); + reset(); } void TranslationCalibrator::reset() { - P = Matx66f::zeros(); - y = Vec6f(0,0,0, 0,0,0); + P = Matx66f::zeros(); + y = Vec6f(0,0,0, 0,0,0); } void TranslationCalibrator::update(const Matx33d& R_CM_k, const Vec3d& t_CM_k) { - Matx<double, 6,3> H_k_T = Matx<double, 6,3>::zeros(); - for (int i=0; i<3; ++i) { - for (int j=0; j<3; ++j) { - H_k_T(i,j) = R_CM_k(j,i); - } - } - for (int i=0; i<3; ++i) - { - H_k_T(3+i,i) = 1.0; - } - P += H_k_T * H_k_T.t(); - y += H_k_T * t_CM_k; + Matx<double, 6,3> H_k_T = Matx<double, 6,3>::zeros(); + for (int i=0; i<3; ++i) { + for (int j=0; j<3; ++j) { + H_k_T(i,j) = R_CM_k(j,i); + } + } + for (int i=0; i<3; ++i) + { + H_k_T(3+i,i) = 1.0; + } + P += H_k_T * H_k_T.t(); + y += H_k_T * t_CM_k; } Vec3f TranslationCalibrator::get_estimate() { - Vec6f x = P.inv() * y; + Vec6f x = P.inv() * y; return Vec3f(x[0], x[1], x[2]); } diff --git a/ftnoir_tracker_aruco/trans_calib.h b/ftnoir_tracker_aruco/trans_calib.h index 5a2d7c0f..3d1e56fa 100644 --- a/ftnoir_tracker_aruco/trans_calib.h +++ b/ftnoir_tracker_aruco/trans_calib.h @@ -32,8 +32,8 @@ public: cv::Vec3f get_estimate(); private: - cv::Matx66f P; // normalized precision matrix = inverse covariance - cv::Vec6f y; // P*(-t_MH, t_CH) + cv::Matx66f P; // normalized precision matrix = inverse covariance + cv::Vec6f y; // P*(-t_MH, t_CH) }; #endif //TRANSCALIB_H diff --git a/ftnoir_tracker_hatire/ftnoir_arduino_type.h b/ftnoir_tracker_hatire/ftnoir_arduino_type.h index efcee05c..57afed63 100644 --- a/ftnoir_tracker_hatire/ftnoir_arduino_type.h +++ b/ftnoir_tracker_hatire/ftnoir_arduino_type.h @@ -7,24 +7,24 @@ #pragma pack(push,2) struct TArduinoData { - quint16 Begin; // Header trame 0xAAAA; - quint16 Code; // 0->999 Num Trame >=2000 Info >=3000 Init >=5000 Start Command >=9000 Error - float Rot[3]; - float Trans[3]; - quint16 End; // End trame 0x5555; + quint16 Begin; // Header trame 0xAAAA; + quint16 Code; // 0->999 Num Trame >=2000 Info >=3000 Init >=5000 Start Command >=9000 Error + float Rot[3]; + float Trans[3]; + quint16 End; // End trame 0x5555; } ; #pragma pack(pop) inline QDataStream & operator >> ( QDataStream& in, TArduinoData& out ) { - in.setFloatingPointPrecision(QDataStream::SinglePrecision ); + in.setFloatingPointPrecision(QDataStream::SinglePrecision ); in >> out.Begin >> out.Code >> out.Rot[0] >> out.Rot[1] >> out.Rot[2] >> out.Trans[0] >> out.Trans[1] >> out.Trans[2] >> out.End; - return in; + return in; } diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h index d9dd0694..9471ebfb 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.h @@ -4,7 +4,7 @@ #ifdef OPENTRACK_API # include "opentrack/plugin-support.hpp" #else -# include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" +# include "..\ftnoir_tracker_base\ftnoir_tracker_base.h" #endif #include "ftnoir_tracker_hat_settings.h" #include "ftnoir_arduino_type.h" @@ -22,11 +22,11 @@ #define VER_FILEVERSION_STR "Version 2.1.1\0" class FTNoIR_Tracker : public QObject, public ITracker -{ - Q_OBJECT +{ + Q_OBJECT public: - FTNoIR_Tracker(); - ~FTNoIR_Tracker(); + FTNoIR_Tracker(); + ~FTNoIR_Tracker(); #ifdef OPENTRACK_API void start_tracker(QFrame*); @@ -40,77 +40,77 @@ public: bool GiveHeadPoseData(THeadPoseData *data); void notifyCenter(); #endif - void applysettings(const TrackerSettings& settings); - bool notifyZeroed(); - void reset(); - void SerialInfo(); - void sendcmd(const QByteArray &cmd); - void get_info( int *tps ); + void applysettings(const TrackerSettings& settings); + bool notifyZeroed(); + void reset(); + void SerialInfo(); + void sendcmd(const QByteArray &cmd); + void get_info( int *tps ); private Q_SLOTS: void SerialRead(); - void Log(QString message); + void Log(QString message); signals: void sendMsgInfo(const QByteArray &MsgInfo); private: - QSerialPort *ComPort; + QSerialPort *ComPort; TArduinoData ArduinoData, HAT ; // Trame from Arduino QByteArray dataRead; QByteArray dataToSend; - QByteArray Begin; + QByteArray Begin; QByteArray End; - QMutex mutex; - int frame_cnt; + QMutex mutex; + int frame_cnt; bool new_frame; TrackerSettings settings; - bool bEnableRoll; - bool bEnablePitch; - bool bEnableYaw; - bool bEnableX; - bool bEnableY; - bool bEnableZ; - - bool bInvertRoll; - bool bInvertPitch; - bool bInvertYaw; - bool bInvertX; - bool bInvertY; - bool bInvertZ; - bool bEnableLogging; - - int iRollAxe; - int iPitchAxe; - int iYawAxe; - int iXAxe; - int iYAxe; - int iZAxe; - - QByteArray sCmdStart; - QByteArray sCmdStop; - QByteArray sCmdInit; - QByteArray sCmdReset; - QByteArray sCmdCenter; - QByteArray sCmdZero; - - int iDelayInit; - int iDelayStart; - int iDelaySeq; - - bool bBigEndian; - - QString sSerialPortName; - QSerialPort::BaudRate iBaudRate; - QSerialPort::DataBits iDataBits; - QSerialPort::Parity iParity; - QSerialPort::StopBits iStopBits; - QSerialPort::FlowControl iFlowControl; - - QFile flDiagnostics; + bool bEnableRoll; + bool bEnablePitch; + bool bEnableYaw; + bool bEnableX; + bool bEnableY; + bool bEnableZ; + + bool bInvertRoll; + bool bInvertPitch; + bool bInvertYaw; + bool bInvertX; + bool bInvertY; + bool bInvertZ; + bool bEnableLogging; + + int iRollAxe; + int iPitchAxe; + int iYawAxe; + int iXAxe; + int iYAxe; + int iZAxe; + + QByteArray sCmdStart; + QByteArray sCmdStop; + QByteArray sCmdInit; + QByteArray sCmdReset; + QByteArray sCmdCenter; + QByteArray sCmdZero; + + int iDelayInit; + int iDelayStart; + int iDelaySeq; + + bool bBigEndian; + + QString sSerialPortName; + QSerialPort::BaudRate iBaudRate; + QSerialPort::DataBits iDataBits; + QSerialPort::Parity iParity; + QSerialPort::StopBits iStopBits; + QSerialPort::FlowControl iFlowControl; + + QFile flDiagnostics; #ifdef OPENTRACK_API int iFpsArduino; #endif @@ -125,33 +125,33 @@ private: //******************************************************************************************************* class TrackerDll : #if defined(OPENTRACK_API) - public Metadata +public Metadata #else - public ITrackerDll +public ITrackerDll #endif { public: - TrackerDll(); - ~TrackerDll(); + TrackerDll(); + ~TrackerDll(); #ifndef OPENTRACK_API - void Initialize(); + void Initialize(); #endif - + #ifdef OPENTRACK_API QString name(); QIcon icon(); #else - void getFullName(QString *strToBeFilled); - void getShortName(QString *strToBeFilled); - void getDescription(QString *strToBeFilled); - void getIcon(QIcon *icon); + void getFullName(QString *strToBeFilled); + void getShortName(QString *strToBeFilled); + void getDescription(QString *strToBeFilled); + void getIcon(QIcon *icon); #endif private: - QString trackerFullName; // Trackers' name and description - QString trackerShortName; - QString trackerDescription; + QString trackerFullName; // Trackers' name and description + QString trackerShortName; + QString trackerDescription; }; diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h index 5d3e2c36..7d0fcd83 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_dialog.h @@ -19,13 +19,13 @@ // Widget that has controls for FTNoIR protocol client-settings. #ifdef OPENTRACK_API class TrackerControls: public ITrackerDialog -#else + #else class TrackerControls: public QWidget, public ITrackerDialog -#endif + #endif { Q_OBJECT public: - explicit TrackerControls(); + explicit TrackerControls(); virtual ~TrackerControls(); #ifdef OPENTRACK_API void Initialize(QWidget *parent) ; // unused @@ -38,76 +38,76 @@ public: #endif private: - Ui::UIHATControls ui; - FTNoIR_Tracker *theTracker; - QTime last_time; - + Ui::UIHATControls ui; + FTNoIR_Tracker *theTracker; + QTime last_time; + public slots: void WriteMsgInfo(const QByteArray &MsgInfo); protected slots: - void set_mod_port(const QString & val) { settings.SerialPortName =val; settings_changed(); } - void set_ena_roll(bool val) { settings.EnableRoll = val; settings_changed(); } - void set_ena_pitch(bool val) { settings.EnablePitch = val; settings_changed(); } - void set_ena_yaw(bool val) { settings.EnableYaw = val; settings_changed(); } - void set_ena_x(bool val) { settings.EnableX = val; settings_changed(); } - void set_ena_y(bool val) { settings.EnableY = val; settings_changed(); } - void set_ena_z(bool val) { settings.EnableZ = val; settings_changed(); } - - void set_inv_roll(bool val) { settings.InvertRoll = val; settings_changed(); } - void set_inv_pitch(bool val) { settings.InvertPitch = val; settings_changed(); } - void set_inv_yaw(bool val) { settings.InvertYaw = val; settings_changed(); } - void set_inv_x(bool val) { settings.InvertX = val; settings_changed(); } - void set_inv_y(bool val) { settings.InvertY = val; settings_changed(); } - void set_inv_z(bool val) { settings.InvertZ = val; settings_changed(); } - - void set_diag_logging(bool val) { settings.EnableLogging = val; settings_changed(); } - - - void set_rot_roll(int val) { settings.RollAxe = val; settings_changed(); } - void set_rot_pitch(int val) { settings.PitchAxe = val; settings_changed(); } - void set_rot_yaw(int val) { settings.YawAxe = val; settings_changed(); } - void set_acc_x(int val) { settings.XAxe = val; settings_changed(); } - void set_acc_y(int val) { settings.YAxe = val; settings_changed(); } - void set_acc_z(int val) { settings.ZAxe = val; settings_changed(); } - - void set_cmd_start(const QString &val) { settings.CmdStart = val; settings_changed(); } - void set_cmd_stop(const QString &val) { settings.CmdStop = val; settings_changed(); } - void set_cmd_init(const QString &val) { settings.CmdInit = val; settings_changed(); } - void set_cmd_reset(const QString &val) { settings.CmdReset = val; settings_changed(); } - void set_cmd_center(const QString &val) { settings.CmdCenter = val; settings_changed(); } - void set_cmd_zero(const QString &val) { settings.CmdZero = val; settings_changed(); } - - void set_DelayInit(int val) { settings.DelayInit = val; settings_changed(); } - void set_DelayStart(int val) { settings.DelayStart = val; settings_changed(); } - void set_DelaySeq(int val) { settings.DelaySeq = val; settings_changed(); } - - void set_endian(bool val) { settings.BigEndian = val; settings_changed(); } + void set_mod_port(const QString & val) { settings.SerialPortName =val; settings_changed(); } + void set_ena_roll(bool val) { settings.EnableRoll = val; settings_changed(); } + void set_ena_pitch(bool val) { settings.EnablePitch = val; settings_changed(); } + void set_ena_yaw(bool val) { settings.EnableYaw = val; settings_changed(); } + void set_ena_x(bool val) { settings.EnableX = val; settings_changed(); } + void set_ena_y(bool val) { settings.EnableY = val; settings_changed(); } + void set_ena_z(bool val) { settings.EnableZ = val; settings_changed(); } + + void set_inv_roll(bool val) { settings.InvertRoll = val; settings_changed(); } + void set_inv_pitch(bool val) { settings.InvertPitch = val; settings_changed(); } + void set_inv_yaw(bool val) { settings.InvertYaw = val; settings_changed(); } + void set_inv_x(bool val) { settings.InvertX = val; settings_changed(); } + void set_inv_y(bool val) { settings.InvertY = val; settings_changed(); } + void set_inv_z(bool val) { settings.InvertZ = val; settings_changed(); } + + void set_diag_logging(bool val) { settings.EnableLogging = val; settings_changed(); } + + + void set_rot_roll(int val) { settings.RollAxe = val; settings_changed(); } + void set_rot_pitch(int val) { settings.PitchAxe = val; settings_changed(); } + void set_rot_yaw(int val) { settings.YawAxe = val; settings_changed(); } + void set_acc_x(int val) { settings.XAxe = val; settings_changed(); } + void set_acc_y(int val) { settings.YAxe = val; settings_changed(); } + void set_acc_z(int val) { settings.ZAxe = val; settings_changed(); } + + void set_cmd_start(const QString &val) { settings.CmdStart = val; settings_changed(); } + void set_cmd_stop(const QString &val) { settings.CmdStop = val; settings_changed(); } + void set_cmd_init(const QString &val) { settings.CmdInit = val; settings_changed(); } + void set_cmd_reset(const QString &val) { settings.CmdReset = val; settings_changed(); } + void set_cmd_center(const QString &val) { settings.CmdCenter = val; settings_changed(); } + void set_cmd_zero(const QString &val) { settings.CmdZero = val; settings_changed(); } + + void set_DelayInit(int val) { settings.DelayInit = val; settings_changed(); } + void set_DelayStart(int val) { settings.DelayStart = val; settings_changed(); } + void set_DelaySeq(int val) { settings.DelaySeq = val; settings_changed(); } + + void set_endian(bool val) { settings.BigEndian = val; settings_changed(); } #ifdef OPENTRACK_API - void set_Fps(int val) { settings.FPSArduino = val; settings_changed(); } + void set_Fps(int val) { settings.FPSArduino = val; settings_changed(); } #endif - void set_mod_baud(int val) { settings.pBaudRate = static_cast<QSerialPort::BaudRate>(ui.QCB_Serial_baudRate->itemData(val).toInt()) ; settings_changed(); } - void set_mod_dataBits(int val) { settings.pDataBits = static_cast<QSerialPort::DataBits>(ui.QCB_Serial_dataBits->itemData(val).toInt()) ; settings_changed(); } - void set_mod_parity(int val) { settings.pParity = static_cast<QSerialPort::Parity>(ui.QCB_Serial_parity->itemData(val).toInt()) ; settings_changed(); } - void set_mod_stopBits(int val) { settings.pStopBits = static_cast<QSerialPort::StopBits>(ui.QCB_Serial_stopBits->itemData(val).toInt()); settings_changed(); } - void set_mod_flowControl(int val) { settings.pFlowControl = static_cast<QSerialPort::FlowControl>(ui.QCB_Serial_flowControl->itemData(val).toInt()) ; settings_changed(); } - - void doOK(); - void doCancel(); - void doSave(); - void doReset(); - void doCenter(); - void doZero(); - void doSend(); - void poll_tracker_info(); - void doSerialInfo(); + void set_mod_baud(int val) { settings.pBaudRate = static_cast<QSerialPort::BaudRate>(ui.QCB_Serial_baudRate->itemData(val).toInt()) ; settings_changed(); } + void set_mod_dataBits(int val) { settings.pDataBits = static_cast<QSerialPort::DataBits>(ui.QCB_Serial_dataBits->itemData(val).toInt()) ; settings_changed(); } + void set_mod_parity(int val) { settings.pParity = static_cast<QSerialPort::Parity>(ui.QCB_Serial_parity->itemData(val).toInt()) ; settings_changed(); } + void set_mod_stopBits(int val) { settings.pStopBits = static_cast<QSerialPort::StopBits>(ui.QCB_Serial_stopBits->itemData(val).toInt()); settings_changed(); } + void set_mod_flowControl(int val) { settings.pFlowControl = static_cast<QSerialPort::FlowControl>(ui.QCB_Serial_flowControl->itemData(val).toInt()) ; settings_changed(); } + + void doOK(); + void doCancel(); + void doSave(); + void doReset(); + void doCenter(); + void doZero(); + void doSend(); + void poll_tracker_info(); + void doSerialInfo(); protected: - bool settingsDirty; - void settings_changed(); - TrackerSettings settings; - QTimer timer; + bool settingsDirty; + void settings_changed(); + TrackerSettings settings; + QTimer timer; private slots: void on_lineSend_returnPressed(); diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.h b/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.h index 5754da8c..ade46d54 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.h +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat_settings.h @@ -12,59 +12,56 @@ //----------------------------------------------------------------------------- struct TrackerSettings -{ - - void load_ini(); - void save_ini() const; - - bool EnableRoll; - bool EnablePitch; - bool EnableYaw; - bool EnableX; - bool EnableY; - bool EnableZ; - - bool InvertRoll; - bool InvertPitch; - bool InvertYaw; - bool InvertX; - bool InvertY; - bool InvertZ; - - - int RollAxe; - int PitchAxe; - int YawAxe; - int XAxe; - int YAxe; - int ZAxe; - - QString CmdStart; - QString CmdStop; - QString CmdInit; - QString CmdReset; - QString CmdCenter; - QString CmdZero; - - int DelayInit; - int DelayStart; - int DelaySeq; - - bool BigEndian; - bool EnableLogging; - - QString SerialPortName; - QSerialPort::BaudRate pBaudRate; - QSerialPort::DataBits pDataBits; - QSerialPort::Parity pParity; - QSerialPort::StopBits pStopBits; - QSerialPort::FlowControl pFlowControl; +{ + void load_ini(); + void save_ini() const; + + bool EnableRoll; + bool EnablePitch; + bool EnableYaw; + bool EnableX; + bool EnableY; + bool EnableZ; + + bool InvertRoll; + bool InvertPitch; + bool InvertYaw; + bool InvertX; + bool InvertY; + bool InvertZ; + + + int RollAxe; + int PitchAxe; + int YawAxe; + int XAxe; + int YAxe; + int ZAxe; + + QString CmdStart; + QString CmdStop; + QString CmdInit; + QString CmdReset; + QString CmdCenter; + QString CmdZero; + + int DelayInit; + int DelayStart; + int DelaySeq; + + bool BigEndian; + bool EnableLogging; + + QString SerialPortName; + QSerialPort::BaudRate pBaudRate; + QSerialPort::DataBits pDataBits; + QSerialPort::Parity pParity; + QSerialPort::StopBits pStopBits; + QSerialPort::FlowControl pFlowControl; #ifdef OPENTRACK_API int FPSArduino; #endif - - }; diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h index 25839039..348fc246 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h @@ -37,7 +37,7 @@ class Tracker : public QObject, public ITracker { Q_OBJECT public: - Tracker(); + Tracker(); ~Tracker() override; void start_tracker(QFrame* frame); void data(double *data); @@ -46,9 +46,9 @@ private: settings s; PortableLockedShm lck_shm; ht_shm_t* shm; - QProcess subprocess; + QProcess subprocess; HTVideoWidget* videoWidget; - QHBoxLayout* layout; + QHBoxLayout* layout; }; // Widget that has controls for FTNoIR protocol client-settings. @@ -56,17 +56,17 @@ class TrackerControls : public ITrackerDialog, protected camera_dialog<Tracker> { Q_OBJECT public: - explicit TrackerControls(); + explicit TrackerControls(); void register_tracker(ITracker *) {} void unregister_tracker() {} private: - Ui::Form ui; + Ui::Form ui; settings s; private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); void camera_settings(); }; diff --git a/ftnoir_tracker_ht/ht-api.h b/ftnoir_tracker_ht/ht-api.h index 77903bac..4f88a6a3 100644 --- a/ftnoir_tracker_ht/ht-api.h +++ b/ftnoir_tracker_ht/ht-api.h @@ -14,20 +14,20 @@ struct ht_context; typedef struct ht_context headtracker_t; typedef struct ht_config { - float field_of_view; - float classification_delay; - int pyrlk_pyramids; - int pyrlk_win_size_w; - int pyrlk_win_size_h; + float field_of_view; + float classification_delay; + int pyrlk_pyramids; + int pyrlk_win_size_w; + int pyrlk_win_size_h; float ransac_max_inlier_error; float ransac_max_reprojection_error; - int max_keypoints; - float keypoint_distance; + int max_keypoints; + float keypoint_distance; int force_width; - int force_height; - int force_fps; - int camera_index; - bool debug; + int force_height; + int force_fps; + int camera_index; + bool debug; int ransac_num_iters; float ransac_min_features; float ransac_max_mean_error; @@ -39,7 +39,7 @@ typedef struct ht_config { typedef struct { double rotx, roty, rotz; double tx, ty, tz; - bool filled; + bool filled; } ht_result_t; HT_API(headtracker_t*) ht_make_context(const ht_config_t* config, const char* filename); diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h index b9aba4a6..7e75d2a4 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt_dialog.h @@ -26,30 +26,30 @@ // The dialog that shows up when the user presses "Settings" class TrackerDialog_PT : public ITrackerDialog, protected camera_dialog<Tracker_PT> { - Q_OBJECT + Q_OBJECT public: - TrackerDialog_PT(); - void register_tracker(ITracker *tracker) override; - void unregister_tracker() override; + TrackerDialog_PT(); + void register_tracker(ITracker *tracker) override; + void unregister_tracker() override; void save(); - void trans_calib_step(); + void trans_calib_step(); public slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); - void startstop_trans_calib(bool start); - void poll_tracker_info(); + void startstop_trans_calib(bool start); + void poll_tracker_info(); void camera_settings(); private: settings_pt s; - Tracker_PT* tracker; - QTimer timer; + Tracker_PT* tracker; + QTimer timer; - TranslationCalibrator trans_calib; - bool trans_calib_running; + TranslationCalibrator trans_calib; + bool trans_calib_running; - Ui::UICPTClientControls ui; + Ui::UICPTClientControls ui; }; #endif //FTNOIR_TRACKER_PT_DIALOG_H diff --git a/ftnoir_tracker_pt/point_tracker.h b/ftnoir_tracker_pt/point_tracker.h index 935e2eaa..7c710704 100644 --- a/ftnoir_tracker_pt/point_tracker.h +++ b/ftnoir_tracker_pt/point_tracker.h @@ -63,22 +63,22 @@ class PointModel public: static constexpr int N_POINTS = 3; - cv::Vec3f M01; // M01 in model frame - cv::Vec3f M02; // M02 in model frame + cv::Vec3f M01; // M01 in model frame + cv::Vec3f M02; // M02 in model frame - cv::Vec3f u; // unit vector perpendicular to M01,M02-plane + cv::Vec3f u; // unit vector perpendicular to M01,M02-plane cv::Matx22f P; enum Model { Clip = 0, Cap = 1, Custom = 2 }; - + PointModel(settings_pt& s) { set_model(s); // calculate u u = M01.cross(M02); u /= norm(u); - + // calculate projection matrix on M01,M02 plane float s11 = M01.dot(M01); float s12 = M01.dot(M02); @@ -140,8 +140,8 @@ private: Affine X_CM; // trafo from model to camera - Timer t; - bool init_phase; + Timer t; + bool init_phase; }; #endif //POINTTRACKER_H diff --git a/ftnoir_tracker_pt/trans_calib.h b/ftnoir_tracker_pt/trans_calib.h index c2c02b38..e20fc767 100644 --- a/ftnoir_tracker_pt/trans_calib.h +++ b/ftnoir_tracker_pt/trans_calib.h @@ -32,8 +32,8 @@ public: cv::Vec3f get_estimate(); private: - cv::Matx66f P; // normalized precision matrix = inverse covariance - cv::Vec6f y; // P*(-t_MH, t_CH) + cv::Matx66f P; // normalized precision matrix = inverse covariance + cv::Vec6f y; // P*(-t_MH, t_CH) }; #endif //TRANSCALIB_H diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.h b/ftnoir_tracker_udp/ftnoir_tracker_udp.h index 160e4352..95a3fb4f 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.h +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.h @@ -22,12 +22,12 @@ struct settings : opts { class FTNoIR_Tracker : public ITracker, protected QThread { public: - FTNoIR_Tracker(); + FTNoIR_Tracker(); ~FTNoIR_Tracker(); void start_tracker(QFrame *); void data(double *data); protected: - void run() override; + void run() override; private: QUdpSocket sock; double last_recv_pose[6]; @@ -40,15 +40,15 @@ class TrackerControls: public ITrackerDialog { Q_OBJECT public: - TrackerControls(); + TrackerControls(); void register_tracker(ITracker *) {} void unregister_tracker() {} private: - Ui::UICFTNClientControls ui; + Ui::UICFTNClientControls ui; settings s; private slots: - void doOK(); - void doCancel(); + void doOK(); + void doCancel(); }; class FTNoIR_TrackerDll : public Metadata diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 0d4d8c2c..fae0e8a2 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -113,10 +113,10 @@ void Tracker::logic() { for (int i = 0; i < 6; i++) if (fabs(newpose[i]) != 0) - { - can_center = true; - break; - } + { + can_center = true; + break; + } } if (can_center) diff --git a/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.h b/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.h index bc637338..ca68e0e2 100644 --- a/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.h +++ b/qfunctionconfigurator/broken/qfunctionconfiguratorplugin.h @@ -11,27 +11,26 @@ class QFunctionConfiguratorPlugin : public QObject, public QDesignerCustomWidgetInterface { - Q_OBJECT + Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetInterface" FILE "analogclock.json") Q_INTERFACES(QDesignerCustomWidgetInterface) public: - QFunctionConfiguratorPlugin(QObject *parent = 0); - - bool isContainer() const; - bool isInitialized() const; - QIcon icon() const; - QString domXml() const; - QString group() const; - QString includeFile() const; - QString name() const; - QString toolTip() const; - QString whatsThis() const; - QWidget *createWidget(QWidget *parent); - void initialize(QDesignerFormEditorInterface *core); + QFunctionConfiguratorPlugin(QObject *parent = 0); + bool isContainer() const; + bool isInitialized() const; + QIcon icon() const; + QString domXml() const; + QString group() const; + QString includeFile() const; + QString name() const; + QString toolTip() const; + QString whatsThis() const; + QWidget *createWidget(QWidget *parent); + void initialize(QDesignerFormEditorInterface *core); private: - bool initialized; + bool initialized; }; #endif // QFUNCTIONCONFIGURATORPLUGIN_H diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index ac9b52e2..5b75d84d 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -1,5 +1,5 @@ /* Copyright (c) 2011-2014 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. @@ -17,12 +17,12 @@ class QFunctionConfigurator : public QWidget { - Q_OBJECT + Q_OBJECT Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier) public: - QFunctionConfigurator(QWidget *parent = 0); + QFunctionConfigurator(QWidget *parent = 0); - Map* config(); + Map* config(); void setConfig(Map* config, const QString &name); QColor colorBezier() const @@ -35,18 +35,18 @@ public: update(); } protected slots: - void paintEvent(QPaintEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); + void paintEvent(QPaintEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); private: void drawBackground(); - void drawFunction(); - void drawPoint(QPainter *painter, const QPointF &pt, QColor colBG ); - void drawLine(QPainter *painter, const QPointF &start, const QPointF &end, QPen& pen); + void drawFunction(); + void drawPoint(QPainter *painter, const QPointF &pt, QColor colBG ); + void drawLine(QPainter *painter, const QPointF &start, const QPointF &end, QPen& pen); bool point_within_pixel(const QPointF& pt, const QPointF& pixel); protected: - void resizeEvent(QResizeEvent *) override; + void resizeEvent(QResizeEvent *) override; private: void update_range(); @@ -56,14 +56,14 @@ private: Map* _config; // bounds of the rectangle user can interact with - QRectF pixel_bounds; + QRectF pixel_bounds; int moving_control_point_idx; QPointF c; - QColor spline_color; + QColor spline_color; - QPixmap _background; - QPixmap _function; + QPixmap _background; + QPixmap _function; bool _draw_function; }; |