From a1313961c0983fdfbeac16da45647e6173ef5ef4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 30 Aug 2012 11:31:46 +0200 Subject: [PATCH] 0000818: [PATCH] added new page to Customize dialog for space navigator --- .../GuiApplicationNativeEventAwareWin32.cpp | 5 +- src/Gui/CMakeLists.txt | 5 + src/Gui/DlgCustomizeSpNavSettings.cpp | 310 ++++++++++ src/Gui/DlgCustomizeSpNavSettings.h | 85 +++ src/Gui/DlgCustomizeSpNavSettings.ui | 534 ++++++++++++++++++ src/Gui/DlgCustomizeSpaceball.cpp | 2 +- src/Gui/GuiApplicationNativeEventAware.cpp | 5 +- src/Gui/Icons/SpNav-PanLR.png | Bin 0 -> 1977 bytes src/Gui/Icons/SpNav-PanUD.png | Bin 0 -> 1488 bytes src/Gui/Icons/SpNav-Roll.png | Bin 0 -> 2615 bytes src/Gui/Icons/SpNav-Spin.png | Bin 0 -> 2257 bytes src/Gui/Icons/SpNav-Tilt.png | Bin 0 -> 1929 bytes src/Gui/Icons/SpNav-Zoom.png | Bin 0 -> 2204 bytes src/Gui/Icons/resource.qrc | 6 + src/Gui/SpaceballEvent.cpp | 140 ++++- src/Gui/SpaceballEvent.h | 3 + src/Gui/resource.cpp | 2 + 17 files changed, 1080 insertions(+), 17 deletions(-) create mode 100644 src/Gui/DlgCustomizeSpNavSettings.cpp create mode 100644 src/Gui/DlgCustomizeSpNavSettings.h create mode 100644 src/Gui/DlgCustomizeSpNavSettings.ui create mode 100644 src/Gui/Icons/SpNav-PanLR.png create mode 100644 src/Gui/Icons/SpNav-PanUD.png create mode 100644 src/Gui/Icons/SpNav-Roll.png create mode 100644 src/Gui/Icons/SpNav-Spin.png create mode 100644 src/Gui/Icons/SpNav-Tilt.png create mode 100644 src/Gui/Icons/SpNav-Zoom.png diff --git a/src/Gui/3Dconnexion/GuiApplicationNativeEventAwareWin32.cpp b/src/Gui/3Dconnexion/GuiApplicationNativeEventAwareWin32.cpp index 425a7af7a3..4403fd22b4 100644 --- a/src/Gui/3Dconnexion/GuiApplicationNativeEventAwareWin32.cpp +++ b/src/Gui/3Dconnexion/GuiApplicationNativeEventAwareWin32.cpp @@ -202,8 +202,9 @@ void Gui::GUIApplicationNativeEventAware::Move3d(HANDLE device, std::vectorsetTranslations(x, y, z); - motionEvent->setRotations(rx, ry, rz); + //motionEvent->setTranslations(x, y, z); + //motionEvent->setRotations(rx, ry, rz); + motionEvent->setMotionData(x, y, z, rx, ry, rz); this->postEvent(currentWidget, motionEvent); } diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index b4bf7c5a5a..ed70b71d6d 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -104,6 +104,7 @@ set(Gui_MOC_HDRS DlgCommandsImp.h DlgCustomizeImp.h DlgCustomizeSpaceball.h + DlgCustomizeSpNavSettings.h DlgDisplayPropertiesImp.h DlgEditorImp.h DlgGeneralImp.h @@ -190,6 +191,7 @@ SET(Gui_UIC_SRCS DlgAuthorization.ui DlgChooseIcon.ui DlgCommands.ui + DlgCustomizeSpNavSettings.ui DlgDisplayProperties.ui DlgEditor.ui DlgGeneral.ui @@ -338,6 +340,7 @@ SET(Dialog_Customize_CPP_SRCS DlgCommandsImp.cpp DlgCustomizeImp.cpp DlgCustomizeSpaceball.cpp + DlgCustomizeSpNavSettings.cpp DlgKeyboardImp.cpp DlgToolbarsImp.cpp ) @@ -346,6 +349,7 @@ SET(Dialog_Customize_HPP_SRCS DlgCommandsImp.h DlgCustomizeImp.h DlgCustomizeSpaceball.h + DlgCustomizeSpNavSettings.h DlgKeyboardImp.h DlgToolbarsImp.h ) @@ -355,6 +359,7 @@ SET(Dialog_Customize_SRCS DlgActions.ui DlgChooseIcon.ui DlgCommands.ui + DlgCustomizeSpNavSettings.ui DlgKeyboard.ui DlgToolbars.ui ) diff --git a/src/Gui/DlgCustomizeSpNavSettings.cpp b/src/Gui/DlgCustomizeSpNavSettings.cpp new file mode 100644 index 0000000000..9a71137370 --- /dev/null +++ b/src/Gui/DlgCustomizeSpNavSettings.cpp @@ -0,0 +1,310 @@ +/*************************************************************************** + * Copyright (c) 2012 Petar Perisin * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + +#include "PreCompiled.h" + +#include "DlgCustomizeSpNavSettings.h" +#include "GuiApplicationNativeEventAware.h" +#include "Application.h" + + +using namespace Gui::Dialog; + +DlgCustomizeSpNavSettings::DlgCustomizeSpNavSettings(QWidget *parent) : + CustomizeActionPage(parent) +{ + GUIApplicationNativeEventAware *app = qobject_cast(QApplication::instance()); + + if (!app) + return; + if (!app->isSpaceballPresent()) + { + this->setWindowTitle(tr("Spaceball Motion")); + this->setMessage(tr("No Spaceball Present")); + return; + } + this->setupUi(this); + initialize(); +} + +DlgCustomizeSpNavSettings::~DlgCustomizeSpNavSettings() +{ +} + +void DlgCustomizeSpNavSettings::setMessage(const QString& message) +{ + QLabel *messageLabel = new QLabel(message,this); + QVBoxLayout *layout = new QVBoxLayout(); + QHBoxLayout *layout2 = new QHBoxLayout(); + layout2->addStretch(); + layout2->addWidget(messageLabel); + layout2->addStretch(); + layout->addItem(layout2); + this->setLayout(layout); +} + + +void DlgCustomizeSpNavSettings::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); +} + +ParameterGrp::handle DlgCustomizeSpNavSettings::spaceballMotionGroup() const +{ + static ParameterGrp::handle group = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Spaceball")->GetGroup("Motion"); + return group; +} + +void DlgCustomizeSpNavSettings::on_ButtonCalibrate_clicked() +{ + spaceballMotionGroup()->SetBool("Calibrate", true); +} + +void DlgCustomizeSpNavSettings::initialize() +{ + CBDominant->setChecked(spaceballMotionGroup()->GetBool("Dominant", false)); + CBFlipYZ->setChecked(spaceballMotionGroup()->GetBool("FlipYZ", false)); + CBRotations->setChecked(spaceballMotionGroup()->GetBool("Rotations", true)); + CBTranslations->setChecked(spaceballMotionGroup()->GetBool("Translations", true)); + SliderGlobal->setValue(spaceballMotionGroup()->GetInt("GlobalSensitivity", 0)); + + CBEnablePanLR ->setChecked(spaceballMotionGroup()->GetBool("PanLREnable", true)); + CBReversePanLR->setChecked(spaceballMotionGroup()->GetBool("PanLRReverse", false)); + SliderPanLR ->setValue(spaceballMotionGroup()->GetInt("PanLRSensitivity", 0)); + + CBEnablePanUD ->setChecked(spaceballMotionGroup()->GetBool("PanUDEnable", true)); + CBReversePanUD->setChecked(spaceballMotionGroup()->GetBool("PanUDReverse", false)); + SliderPanUD ->setValue(spaceballMotionGroup()->GetInt("PanUDSensitivity", 0)); + + CBEnableZoom ->setChecked(spaceballMotionGroup()->GetBool("ZoomEnable", true)); + CBReverseZoom->setChecked(spaceballMotionGroup()->GetBool("ZoomReverse", false)); + SliderZoom ->setValue(spaceballMotionGroup()->GetInt("ZoomSensitivity", 0)); + + CBEnableTilt ->setChecked(spaceballMotionGroup()->GetBool("TiltEnable", true)); + CBReverseTilt->setChecked(spaceballMotionGroup()->GetBool("TiltReverse", false)); + SliderTilt ->setValue(spaceballMotionGroup()->GetInt("TiltSensitivity", 0)); + + CBEnableRoll ->setChecked(spaceballMotionGroup()->GetBool("RollEnable", true)); + CBReverseRoll->setChecked(spaceballMotionGroup()->GetBool("RollReverse", false)); + SliderRoll ->setValue(spaceballMotionGroup()->GetInt("RollSensitivity", 0)); + + CBEnableSpin ->setChecked(spaceballMotionGroup()->GetBool("SpinEnable", true)); + CBReverseSpin->setChecked(spaceballMotionGroup()->GetBool("SpinReverse", false)); + SliderSpin ->setValue(spaceballMotionGroup()->GetInt("SpinSensitivity", 0)); + + CBEnableTilt ->setEnabled(CBRotations->isChecked()); + CBReverseTilt->setEnabled(CBRotations->isChecked() && CBEnableTilt->isChecked()); + SliderTilt ->setEnabled(CBRotations->isChecked() && CBEnableTilt->isChecked()); + CBEnableRoll ->setEnabled(CBRotations->isChecked()); + CBReverseRoll->setEnabled(CBRotations->isChecked() && CBEnableRoll->isChecked()); + SliderRoll ->setEnabled(CBRotations->isChecked() && CBEnableRoll->isChecked()); + CBEnableSpin ->setEnabled(CBRotations->isChecked()); + CBReverseSpin->setEnabled(CBRotations->isChecked() && CBEnableSpin->isChecked()); + SliderSpin ->setEnabled(CBRotations->isChecked() && CBEnableSpin->isChecked()); + + CBEnablePanLR ->setEnabled(CBTranslations->isChecked()); + CBReversePanLR->setEnabled(CBTranslations->isChecked() && CBEnablePanLR->isChecked()); + SliderPanLR ->setEnabled(CBTranslations->isChecked() && CBEnablePanLR->isChecked()); + CBEnablePanUD ->setEnabled(CBTranslations->isChecked()); + CBReversePanUD->setEnabled(CBTranslations->isChecked() && CBEnablePanUD->isChecked()); + SliderPanUD ->setEnabled(CBTranslations->isChecked() && CBEnablePanUD->isChecked()); + CBEnableZoom ->setEnabled(CBTranslations->isChecked()); + CBReverseZoom ->setEnabled(CBTranslations->isChecked() && CBEnableZoom->isChecked()); + SliderZoom ->setEnabled(CBTranslations->isChecked() && CBEnableZoom->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_ButtonDefaultSpNavMotions_clicked() +{ + spaceballMotionGroup()->Clear(); + initialize(); +} + +void DlgCustomizeSpNavSettings::on_CBDominant_clicked() +{ + spaceballMotionGroup()->SetBool("Dominant", CBDominant->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBFlipYZ_clicked() +{ + spaceballMotionGroup()->SetBool("FlipYZ", CBFlipYZ->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBRotations_clicked() +{ + spaceballMotionGroup()->SetBool("Rotations", CBRotations->isChecked()); + + CBEnableTilt ->setEnabled(CBRotations->isChecked()); + CBReverseTilt->setEnabled(CBRotations->isChecked() && CBEnableTilt->isChecked()); + SliderTilt ->setEnabled(CBRotations->isChecked() && CBEnableTilt->isChecked()); + CBEnableRoll ->setEnabled(CBRotations->isChecked()); + CBReverseRoll->setEnabled(CBRotations->isChecked() && CBEnableRoll->isChecked()); + SliderRoll ->setEnabled(CBRotations->isChecked() && CBEnableRoll->isChecked()); + CBEnableSpin ->setEnabled(CBRotations->isChecked()); + CBReverseSpin->setEnabled(CBRotations->isChecked() && CBEnableSpin->isChecked()); + SliderSpin ->setEnabled(CBRotations->isChecked() && CBEnableSpin->isChecked()); + +} + +void DlgCustomizeSpNavSettings::on_CBTranslations_clicked() +{ + spaceballMotionGroup()->SetBool("Translations", CBTranslations->isChecked()); + + CBEnablePanLR ->setEnabled(CBTranslations->isChecked()); + CBReversePanLR->setEnabled(CBTranslations->isChecked() && CBEnablePanLR->isChecked()); + SliderPanLR ->setEnabled(CBTranslations->isChecked() && CBEnablePanLR->isChecked()); + CBEnablePanUD ->setEnabled(CBTranslations->isChecked()); + CBReversePanUD->setEnabled(CBTranslations->isChecked() && CBEnablePanUD->isChecked()); + SliderPanUD ->setEnabled(CBTranslations->isChecked() && CBEnablePanUD->isChecked()); + CBEnableZoom ->setEnabled(CBTranslations->isChecked()); + CBReverseZoom ->setEnabled(CBTranslations->isChecked() && CBEnableZoom->isChecked()); + SliderZoom ->setEnabled(CBTranslations->isChecked() && CBEnableZoom->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderGlobal_sliderReleased() +{ + spaceballMotionGroup()->SetInt("GlobalSensitivity", SliderGlobal->value()); +} + +void DlgCustomizeSpNavSettings::on_CBEnablePanLR_clicked() +{ + spaceballMotionGroup()->SetBool("PanLREnable", CBEnablePanLR->isChecked()); + + CBReversePanLR->setEnabled(CBEnablePanLR->isChecked()); + SliderPanLR ->setEnabled(CBEnablePanLR->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBReversePanLR_clicked() +{ + spaceballMotionGroup()->SetBool("PanLRReverse", CBReversePanLR->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderPanLR_sliderReleased() +{ + spaceballMotionGroup()->SetInt("PanLRSensitivity", SliderPanLR->value()); +} + +void DlgCustomizeSpNavSettings::on_CBEnablePanUD_clicked() +{ + spaceballMotionGroup()->SetBool("PanUDEnable", CBEnablePanUD->isChecked()); + + CBReversePanUD->setEnabled(CBEnablePanUD->isChecked()); + SliderPanUD ->setEnabled(CBEnablePanUD->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBReversePanUD_clicked() +{ + spaceballMotionGroup()->SetBool("PanUDReverse", CBReversePanUD->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderPanUD_sliderReleased() +{ + spaceballMotionGroup()->SetInt("PanUDSensitivity", SliderPanUD->value()); +} + +void DlgCustomizeSpNavSettings::on_CBEnableZoom_clicked() +{ + spaceballMotionGroup()->SetBool("ZoomEnable", CBEnableZoom->isChecked()); + + CBReverseZoom ->setEnabled(CBEnableZoom->isChecked()); + SliderZoom ->setEnabled(CBEnableZoom->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBReverseZoom_clicked() +{ + spaceballMotionGroup()->SetBool("ZoomReverse", CBReverseZoom->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderZoom_sliderReleased() +{ + spaceballMotionGroup()->SetInt("ZoomSensitivity", SliderZoom->value()); +} + +void DlgCustomizeSpNavSettings::on_CBEnableTilt_clicked() +{ + spaceballMotionGroup()->SetBool("TiltEnable", CBEnableTilt->isChecked()); + + CBReverseTilt->setEnabled(CBEnableTilt->isChecked()); + SliderTilt ->setEnabled(CBEnableTilt->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBReverseTilt_clicked() +{ + spaceballMotionGroup()->SetBool("TiltReverse", CBReverseTilt->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderTilt_sliderReleased() +{ + spaceballMotionGroup()->SetInt("TiltSensitivity", SliderTilt->value()); +} + +void DlgCustomizeSpNavSettings::on_CBEnableRoll_clicked() +{ + spaceballMotionGroup()->SetBool("RollEnable", CBEnableRoll->isChecked()); + + CBReverseRoll->setEnabled(CBEnableRoll->isChecked()); + SliderRoll ->setEnabled(CBEnableRoll->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBReverseRoll_clicked() +{ + spaceballMotionGroup()->SetBool("RollReverse", CBReverseRoll->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderRoll_sliderReleased() +{ + spaceballMotionGroup()->SetInt("RollSensitivity", SliderRoll->value()); +} + +void DlgCustomizeSpNavSettings::on_CBEnableSpin_clicked() +{ + spaceballMotionGroup()->SetBool("SpinEnable", CBEnableSpin->isChecked()); + + CBReverseSpin->setEnabled(CBEnableSpin->isChecked()); + SliderSpin ->setEnabled(CBEnableSpin->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_CBReverseSpin_clicked() +{ + spaceballMotionGroup()->SetBool("SpinReverse", CBReverseSpin->isChecked()); +} + +void DlgCustomizeSpNavSettings::on_SliderSpin_sliderReleased() +{ + spaceballMotionGroup()->SetInt("SpinSensitivity", SliderSpin->value()); +} + +void DlgCustomizeSpNavSettings::onAddMacroAction(const QByteArray ¯oName) +{ + //don't think I need to do anything here. +} + +void DlgCustomizeSpNavSettings::onRemoveMacroAction(const QByteArray ¯oName) +{ + //don't think I need to do anything here. +} + +void DlgCustomizeSpNavSettings::onModifyMacroAction(const QByteArray ¯oName) +{ + //don't think I need to do anything here. +} + +#include "moc_DlgCustomizeSpNavSettings.cpp" \ No newline at end of file diff --git a/src/Gui/DlgCustomizeSpNavSettings.h b/src/Gui/DlgCustomizeSpNavSettings.h new file mode 100644 index 0000000000..6966094d5c --- /dev/null +++ b/src/Gui/DlgCustomizeSpNavSettings.h @@ -0,0 +1,85 @@ +/*************************************************************************** + * Copyright (c) 2012 Petar Perisin * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef DLGCUSTOMIZESPNAVSETTINGS_H +#define DLGCUSTOMIZESPNAVSETTINGS_H + +#include "ui_DlgCustomizeSpNavSettings.h" +#include "PropertyPage.h" +#include + +namespace Gui +{ + namespace Dialog + { + class DlgCustomizeSpNavSettings : public CustomizeActionPage, public Ui_DlgCustomizeSpNavSettings + { + Q_OBJECT + + public: + explicit DlgCustomizeSpNavSettings(QWidget *parent = 0); + ~DlgCustomizeSpNavSettings(); + + + protected Q_SLOTS: + void onAddMacroAction(const QByteArray&); + void onRemoveMacroAction(const QByteArray&); + void onModifyMacroAction(const QByteArray&); + void on_CBDominant_clicked(); + void on_CBFlipYZ_clicked(); + void on_CBRotations_clicked(); + void on_CBTranslations_clicked(); + void on_SliderGlobal_sliderReleased(); + void on_CBEnablePanLR_clicked(); + void on_CBReversePanLR_clicked(); + void on_SliderPanLR_sliderReleased(); + void on_CBEnablePanUD_clicked(); + void on_CBReversePanUD_clicked(); + void on_SliderPanUD_sliderReleased(); + void on_CBEnableZoom_clicked(); + void on_CBReverseZoom_clicked(); + void on_SliderZoom_sliderReleased(); + void on_CBEnableTilt_clicked(); + void on_CBReverseTilt_clicked(); + void on_SliderTilt_sliderReleased(); + void on_CBEnableRoll_clicked(); + void on_CBReverseRoll_clicked(); + void on_SliderRoll_sliderReleased(); + void on_CBEnableSpin_clicked(); + void on_CBReverseSpin_clicked(); + void on_SliderSpin_sliderReleased(); + void on_ButtonDefaultSpNavMotions_clicked(); + void on_ButtonCalibrate_clicked(); + + protected: + void changeEvent(QEvent *e); + + private: + ParameterGrp::handle spaceballMotionGroup() const; + void setMessage(const QString& message); + void initialize(); + }; + } +} + +#endif // DLGCUSTOMIZESPNAVSETTINGS_H diff --git a/src/Gui/DlgCustomizeSpNavSettings.ui b/src/Gui/DlgCustomizeSpNavSettings.ui new file mode 100644 index 0000000000..504468780f --- /dev/null +++ b/src/Gui/DlgCustomizeSpNavSettings.ui @@ -0,0 +1,534 @@ + + + DlgCustomizeSpNavSettings + + + + 0 + 0 + 439 + 537 + + + + Spaceball Motion + + + + + + + + Global Sensitivity: + + + + + + + -50 + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + + + + + + + Dominant Mode + + + + + + + Flip Y/Z + + + + + + + + + + + Enable Translations + + + true + + + + + + + Enable Rotations + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Calibrate + + + + + + + Default + + + + + + + + + Qt::Vertical + + + + 20 + 116 + + + + + + + + + + + + + + + :/icons/SpNav-PanLR.png + + + + + + + + + + :/icons/SpNav-PanUD.png + + + + + + + + + + :/icons/SpNav-Zoom.png + + + + + + + + + + :/icons/SpNav-Tilt.png + + + + + + + + + + :/icons/SpNav-Roll.png + + + + + + + + + + :/icons/SpNav-Spin.png + + + + + + + + + 20 + + + + + 0 + + + + + Enable + + + true + + + + + + + Reverse + + + + + + + + + 0 + + + + + Enable + + + true + + + + + + + Reverse + + + + + + + + + 0 + + + + + Enable + + + true + + + + + + + Reverse + + + + + + + + + 0 + + + + + Enable + + + true + + + + + + + Reverse + + + + + + + + + 0 + + + + + Enable + + + true + + + + + + + Reverse + + + + + + + + + 0 + + + + + Enable + + + true + + + + + + + Reverse + + + + + + + + + + + 30 + + + + + -50 + + + 50 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + -50 + + + 50 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + -50 + + + 50 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + -50 + + + 50 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + -50 + + + 50 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + -50 + + + 50 + + + 1 + + + 1 + + + 0 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 10 + + + + + + + + + + + + + + + diff --git a/src/Gui/DlgCustomizeSpaceball.cpp b/src/Gui/DlgCustomizeSpaceball.cpp index 4fa00ba4e2..8a7dc5aaea 100644 --- a/src/Gui/DlgCustomizeSpaceball.cpp +++ b/src/Gui/DlgCustomizeSpaceball.cpp @@ -525,7 +525,7 @@ DlgCustomizeSpaceball::DlgCustomizeSpaceball(QWidget *parent) : CustomizeActionPage(parent), buttonView(0), buttonModel(0), commandView(0), commandModel(0), clearButton(0), printReference(0) { - this->setWindowTitle(tr("Spaceball")); + this->setWindowTitle(tr("Spaceball Buttons")); GUIApplicationNativeEventAware *app = qobject_cast(QApplication::instance()); if (!app) return; diff --git a/src/Gui/GuiApplicationNativeEventAware.cpp b/src/Gui/GuiApplicationNativeEventAware.cpp index f14beb3bb0..6f9485ee1d 100644 --- a/src/Gui/GuiApplicationNativeEventAware.cpp +++ b/src/Gui/GuiApplicationNativeEventAware.cpp @@ -143,8 +143,9 @@ bool Gui::GUIApplicationNativeEventAware::x11EventFilter(XEvent *event) if (navEvent.type == SPNAV_EVENT_MOTION) { Spaceball::MotionEvent *motionEvent = new Spaceball::MotionEvent(); - motionEvent->setTranslations(navEvent.motion.x, navEvent.motion.y, navEvent.motion.z); - motionEvent->setRotations(navEvent.motion.rx, navEvent.motion.ry, navEvent.motion.rz); + // motionEvent->setTranslations(navEvent.motion.x, navEvent.motion.y, navEvent.motion.z); + // motionEvent->setRotations(navEvent.motion.rx, navEvent.motion.ry, navEvent.motion.rz); + motionEvent->setMotionData(navEvent.motion.x, navEvent.motion.y, navEvent.motion.z, navEvent.motion.rx, navEvent.motion.ry, navEvent.motion.rz); this->postEvent(currentWidget, motionEvent); return true; } diff --git a/src/Gui/Icons/SpNav-PanLR.png b/src/Gui/Icons/SpNav-PanLR.png new file mode 100644 index 0000000000000000000000000000000000000000..c70a16f58c60a8e3e92618e1f203429213e78504 GIT binary patch literal 1977 zcmV;q2S)gbP)KRM zRG~b;OA!=R1;Gmi`VLe?yr2pJ2~vf)6{Sj=LK`J+YP(6iMT!(DQlvcd56x7v*yK)=^5aShQDHS5E^NB_b7)5N|gkB|;7W zG{cLT7p0V6DVNK?h)%#wOGW444@m9UYz1)6+}aIS#R%FAHaji0*GiNL(@N zW+_2Y@k0pFY%7(@m$qB&{}U;r_mAE&&^OSv!7U3y2#$6>+J@&zNBnxybJ3QW-)z;1 zy`S1U4j>a%^7|&GP$)FdyU>*ze{%e}{m<@S%pT01HJ%x3^_(&0%b^KLT5Xb)5Wf~z zQ(SdK#6b}JpZ`BWH*m>o^j}Kg%_}av8i+2_Ghf3Z(x_j$6r8r*1%)e)vgpEBu z_Lwu`d`4#FLD?=xgi{}&@eEAG7|{BhW8N&m&=thnM__v31(h5*m&-UUkjg! zo*QF8M9^BJTCJk8RN1%Z(LImsx_j5R0jzr=NrKEu0s$N_f~8=AeSXcq&y6czo$zSkC`L!%G1?`i+KGvquVZ<7Gm?PdMV4Yt|@M4L!dnO@cafLg8gb7uaQ zWm&Lod(D8O`5`Hxh6;<`8=m{V58w9@1OdFjJ1rdXi0V=sFB)7YNOh@hB6`psus=EW zv$5wZla=>Y&#(TdGF5qL`sDOtV))ntcCP1{o|m1^IuF$B8rMp-a0V%9W;emF!r2W6 z;`=_d*3eq78N8GdQc5VLpp(^9DuHSQtN^N0!Ds{1ZW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UD.png b/src/Gui/Icons/SpNav-PanUD.png new file mode 100644 index 0000000000000000000000000000000000000000..c1ba44fc94288b6bf7a3564fc4eef77a52679bd3 GIT binary patch literal 1488 zcmV;>1uy!EP)zjN-~@uN<#iS4)*$SMk@P?|z31f>fE2&oGsq#{uv#0s%MY`bE^ zk`4a=0#-;Bs){PQ1BxoTq;1revY{d(m70eqj+@3wY|rDcu*V%woTiIZv8(%&M)zjM z8PEN6&Uelo0|tY^U@#aA27|$1Fc=I5!{fm2-Maw*<;n6uJdd?gUtFFnW9G&T0ATc$ z(Szgr#@~0B+>5w@KXzIa+Nm$j=CVlI$vveHOJ`EgrH%m*5U6>(d8hho^~B2b%H^e{ zC3);c$>;NB-}m1E@EU;U?I-Qm!GN?x#1$e<0tS&LG%L-U0ImU;QcC?^tyXUgwJ4=h z3G?&wp%D8;AR+(|>P(`DNY6Yx0Dy?T0r2g}$jJ4XnHjHGETU4W3{Rv? zOiXaCR+|EFfQYPqLiEw3N0{gsIRXH4TI=JLO6BIzL`tDhI3OZdi6}ut(q2FHh_IO; zn~Bm#94MtuIF55J8kqwpO89WaV(|)q!_=m)7+Xcj!-xVPSX^9G10N~na#=STjaInu zxCjr5kgdF>pU(hz&vBgd+qnjQ1fqBVz|6wTAR@%aa2`LxYtieQ&6&H8erLPaz}uZZ zmo8lr5jho4orm$0%_3`)a}or>ImdCX4t)BIkB{Tty?alj)9J-TB4H_|q9wIEM$;oM zOqd?=&qY#48jS|ETCJDT>GXBSafYKLkB*N1Xj#@ttu<`h?i(Hb7Txb!baY)8tyT-J z>o!(bS5w2b_c;sTWDo>sHk&=3p_JT5Ki^;6A^*u zc@IpX&H9uWe-51}%)GasVTNKb^9HYpFW&ck5D|hP=n=8=`Dcet6cKqbUP|NQgbVFw zz@cza(U`d_5P%~?w@c3Day6}WHZDw$01!YTa{%2T(x8Q25_*h?i0iuKd0q*?!rI!} zU`I+en}vwHs+7tSkuWpG1+kyDk^dmS<-L|KE~9>>-XmluTBsxTyY+hg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zO8Ko4o*6cVADWwtsQn_4i=~_xG7Q@8E z1VW+EEx~%_f5}r$Q}>)w2T3U*gxHzO`5C*@Jd zYwS1$z+~clB6UO2{?`uW#)b{Uk6XGRpQzR*+pp;^* zb(V-$Mk0~%h59JAVDd>OlOUp6Aw*5NADM}W@+vr(!A_gt%ykch5Rg)m5Mr5O7;6^t zE1_6OOA$g$NGY>K#53)W%#_Xt*(XuR)h%S>- z&RG@DRv~-I*(tS8kSNcuJTx>kbk~wj-qPtb8X6jqPN%=?y6%>IKHsUewgZddnKqK< z+HCU1aex@dw(Tz0b+-=>4}ZO}v2p1qZvl%zB9RcT>oy4?ZX%*Ph-kfG81SQ#5Q59+ z;BQiEt;vrvuIoZ;-AzOfyRQ3qI2=w63=F9H`g#lx51$>R%;AhJrPKxhn*p>CQ9Thw z0aOKs6|~k907jU(7r=X=Q0UzgCr)JX|Bll|i-n9P6;x0`1r=0KK?N05P(cM1R8YZu Z@n6do1a#|Z>M#HR002ovPDHLkV1iG=-d+Fz literal 0 HcmV?d00001 diff --git a/src/Gui/Icons/SpNav-Spin.png b/src/Gui/Icons/SpNav-Spin.png new file mode 100644 index 0000000000000000000000000000000000000000..8d198097b9c2459ed6786a16e885ad0238691bbc GIT binary patch literal 2257 zcmV;?2rl=DP)arcsinY7$i{AV7WSON9c6i$F*e9{NXJ%&ZE>gly4-E|s1Nb^KKgY}#5kUxnC=pSFq(s}y+%y2b z5aKx^`i*Vd(}RP9n4O*7_@spHlF#SAqm(*AL{>lmQ@}z<#_f>OXfg%o(lCsl*|z;` z+&xzU#!8b?sZ@~9=fADB{)K3Ogb)xyP^c6ly2(QIBz+cnh9dV8Gk>h7r$^4r%)DJF z6i}&DHoW_AR1I-u#1#_9EffQ-b@Q5S+bcc>u?oR;Uu=e3?50_{#kC}IqwgIW8hZ4u z2(%+3BaRRv6G}d=jyqLK&}OBSwr$(o&`K#5ivR$n)RRd;HQr8AP}2QL&j27PXpmd}I`O=5yI)BIgW z3K5M((`R@L2bF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%- z%~^76Y1A_md^f>$|NElnVSc%;b4R3v(yY}!I10FR*PUR`y9grU*6hNIWr`(|Lv7M8 zvF~4j>rOIYNGYA4NBg%fJ8!eIAC~+2h6|a@wnL`b1t~95rSkp{0Z%Gb*=iU$gQzRw zO5s8{DNb-CMMt+1h!K=(%yszwzu|eMH(mE%&jUS=S=L?=YP5GJ8xmf z_wWDl_3rLH{mdGtPk&~6xr|Ey(A$fxV`I-eZkpr!Of&zWW$hdgBHIO!*)XIU{a_tY z6$7dcu&ecK-S;oom700KUO)9tsdV%W$7#G9z~I9VzjsZD3|#lPJaOW?>6p*1&nDC6 z&6@)^I`sk(zE-c7zL3deOXYGU{L|j$vuBU|I;zgm(cM-i^N?X#qlRJR4WbljT?^6? z1Mu1R&&%1_-+9-rHKT1jp24=KuFucEaxjzGam;bf9S5M-;*Wy26LcwB$E@M^HdTKo f!L@@9ZXf>xQ8II4@zB`S00000NkvXXu0mjfOIIfk literal 0 HcmV?d00001 diff --git a/src/Gui/Icons/SpNav-Tilt.png b/src/Gui/Icons/SpNav-Tilt.png new file mode 100644 index 0000000000000000000000000000000000000000..73f072ec404e9b5e6539df03b8623ba05e51dcd0 GIT binary patch literal 1929 zcmV;42X^?0P)cg6JB{>6i99~KjW$N7vvh54?pL2W%s%Rae!z(n-{55OT*{c5b)32nY|H@fKDkZGHUR-R zLXZX^&dki$bt-jCE0t%@d)--Bc*2e}DPv>zyg!}3a20@)%~Hp8pDtNjg0(ghJP%X~ zvjSjF6^oyJ6F>?u6ONPlD1etoniQf8Gf$2a=?ows%7G{ct!02+`fa2@v^A#G^g97S z!~=7NN8Ua}0)QwClqe0NBLM7e2no7Jv>v$|A4(oPa8lOSfBA;%zVw4ss_VJGgc0r*PdCg0f$* zy1Gh3uat7Re42tZZmU=0>D}yM~{92%qOAsqun{s?H?VG2YB8kh+M(a(p--$5fNjI zU0q$(L#>pshA_rFMBS(Z#b_)q{~pG?2G6_LB}DFEia_wZ$3XNlYPER~Z7T!-`M&?~ z;96+Nl#)P9rVx-J0NWHNaUz$xGN!yy&SjArwn7#~l=m_;b{ zK?G|o)Mpuj>wXu&3#ixUx{FPKF$P;(TX0<$#+Vl!$N7opdHZgEg#$t=l>#$=hM6HE zFvh@I3lT!I`7dNLX#i_b>U>Wb+X}f1U=}xS{1wJn_`VO%^I(htfbM1M+kNLo6&4{jB>JItyNzr%JG}OB90$2v?tZ1z&$QM;L=@(d!DQ?RbYSl2w@>7_ zh{%T%iNu@DX7kmdv`@8Kh39!kMC7_sYJ!<5tWBc9i^vWV29@>Ue$+PMupZi~JH(4I z#v!6(>+9=lLua2_tp*~RWadmXj|>900 zN~ujElHDxRZ;hzELSpVD4|T5*rBoZh;(o5(?psc2Hk)X*T3Ztn6U5B-?UhGD3q|b{ zRY`bG|M3CyBO;>jH5!fQn$6~LCfahjjOFF!tLb!l1Hi|%*1Nv#y^?51T4<~Oi6Rlf z7z1O>lZ{5>oB4bmola+X>y&D>idwCPVzF2xqUVyy$i=^b P00000NkvXXu0mjfO}~G@ literal 0 HcmV?d00001 diff --git a/src/Gui/Icons/SpNav-Zoom.png b/src/Gui/Icons/SpNav-Zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..39686bca445d42828d5a90dd78a99b9937bacfb0 GIT binary patch literal 2204 zcmV;N2xIq&P)(23A?(Xw`pXd4Bdk3t?daTE4j$|^q4q+}J?GLuE1F@sysgB)S z4{RMy)F-M}!ug2hI&j;gZPV&_qP;n?E%G;i)L-AUujxudV?$uMQ)=0u^#7$F)u^rs zw}#);x9xbwKb&i`dR1C}vK%nTv|Geb5?GJFPy#zOlewUG;>?~h(f zb*7LV&aS@5m(E;5`xEU)gZBiFnGc(gnAp>k z13d$t7GBSwTs?Octq--{U$eF5ms*F$>J}Aja^;N;!1rw*af*@Lo$P74w<&aJ@Q`Ov z$g>vw`L@l~+pGJHW`q3){eA2v%cis^yWEm%IStDHJ1YMDZw~59n$AhMrl-KH4?yrZH-ijIS6l zH<;CHE`6eiwq=p+2Y}8$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zm>NGd{#h$$-6lb#-PHQJ_jiA%D4hMLa+0000Tree_Dimension.svg Tree_Python.svg spaceball_button.svg + SpNav-PanLR.png + SpNav-PanUD.png + SpNav-Roll.png + SpNav-Spin.png + SpNav-Tilt.png + SpNav-Zoom.png diff --git a/src/Gui/SpaceballEvent.cpp b/src/Gui/SpaceballEvent.cpp index 55efa7a27a..7b93ade1ae 100644 --- a/src/Gui/SpaceballEvent.cpp +++ b/src/Gui/SpaceballEvent.cpp @@ -22,6 +22,7 @@ #include "PreCompiled.h" #include "SpaceballEvent.h" +#include "Application.h" using namespace Spaceball; @@ -40,15 +41,132 @@ MotionEvent::MotionEvent() : EventBase(static_cast(MotionEventType MotionEvent::MotionEvent(const MotionEvent& in) : EventBase(static_cast(MotionEventType)) { - xTrans = in.xTrans; - yTrans = in.yTrans; - zTrans = in.zTrans; - xRot = in.xRot; - yRot = in.yRot; - zRot = in.zRot; + int motionDataArray[6] = {in.xTrans, in.yTrans, in.zTrans, in.xRot, in.yRot, in.zRot}; + importSettings(motionDataArray); handled = in.handled; } +float MotionEvent::convertPrefToSensitivity(int value) +{ + if (value < 0) + { + return ((0.6/50)*float(value) + 1); + } + else + { + return ((1.1/50)*float(value) + 1); + } +} + +void MotionEvent::importSettings(int* motionDataArray) +{ + ParameterGrp::handle group = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Spaceball")->GetGroup("Motion"); + + // here I import settings from a dialog. For now they are set as is + bool dominant = group->GetBool("Dominant"); // Is dominant checked + bool flipXY = group->GetBool("FlipYZ");; // Is Flip X/Y checked + float generalSensitivity = convertPrefToSensitivity(group->GetInt("GlobalSensitivity")); + + // array that has stored info about "Enabled" checkboxes of all axes + bool enabled[6]; + enabled[0] = group->GetBool("Translations", true) && group->GetBool("PanLREnable", true); + enabled[1] = group->GetBool("Translations", true) && group->GetBool("PanUDEnable", true); + enabled[2] = group->GetBool("Translations", true) && group->GetBool("ZoomEnable", true); + enabled[3] = group->GetBool("Rotations", true) && group->GetBool("TiltEnable", true); + enabled[4] = group->GetBool("Rotations", true) && group->GetBool("RollEnable", true); + enabled[5] = group->GetBool("Rotations", true) && group->GetBool("SpinEnable", true); + + // array that has stored info about "Reversed" checkboxes of all axes + bool reversed[6]; + reversed[0] = group->GetBool("PanLRReverse"); + reversed[1] = group->GetBool("PanUDReverse"); + reversed[2] = group->GetBool("ZoomReverse"); + reversed[3] = group->GetBool("TiltReverse"); + reversed[4] = group->GetBool("RollReverse"); + reversed[5] = group->GetBool("SpinReverse"); + + // array that has stored info about sliders - on each slider you need to use method DlgSpaceballSettings::GetValuefromSlider + // which will convert <-50, 50> linear integers from slider to <0.1, 10> exponential floating values + float sensitivity[6]; + sensitivity[0] = convertPrefToSensitivity(group->GetInt("PanLRSensitivity")); + sensitivity[1] = convertPrefToSensitivity(group->GetInt("PanUDSensitivity")); + sensitivity[2] = convertPrefToSensitivity(group->GetInt("ZoomSensitivity")); + sensitivity[3] = convertPrefToSensitivity(group->GetInt("TiltSensitivity")); + sensitivity[4] = convertPrefToSensitivity(group->GetInt("RollSensitivity")); + sensitivity[5] = convertPrefToSensitivity(group->GetInt("SpinSensitivity")); + + int i; + + if (group->GetBool("Calibrate")) + { + group->SetInt("CalibrationX",motionDataArray[0]); + group->SetInt("CalibrationY",motionDataArray[1]); + group->SetInt("CalibrationZ",motionDataArray[2]); + group->SetInt("CalibrationXr",motionDataArray[3]); + group->SetInt("CalibrationYr",motionDataArray[4]); + group->SetInt("CalibrationZr",motionDataArray[5]); + + group->RemoveBool("Calibrate"); + + return; + } + else + { + motionDataArray[0] = motionDataArray[0] - group->GetInt("CalibrationX"); + motionDataArray[1] = motionDataArray[1] - group->GetInt("CalibrationY"); + motionDataArray[2] = motionDataArray[2] - group->GetInt("CalibrationZ"); + motionDataArray[3] = motionDataArray[3] - group->GetInt("CalibrationXr"); + motionDataArray[4] = motionDataArray[4] - group->GetInt("CalibrationYr"); + motionDataArray[5] = motionDataArray[5] - group->GetInt("CalibrationZr"); + } + + if (dominant) { // if dominant is checked + int max = 0; + bool flag = false; + for (i = 0; i < 6; ++i) { + if (abs(motionDataArray[i]) > abs(max)) max = motionDataArray[i]; + } + for (i = 0; i < 6; ++i) { + if ((motionDataArray[i] != max) || (flag)) { + motionDataArray[i] = 0; + } else if (motionDataArray[i] == max){ + flag = true; + } + } + } + + if (flipXY) { + int temp = motionDataArray[1]; + motionDataArray[1] = motionDataArray[2]; + motionDataArray[2] = - temp; + } + + for (i = 0; i < 6; ++i) { + if (motionDataArray[i] != 0) { + if (enabled[i] == false) + motionDataArray[i] = 0; + else { + if (reversed[i] == true) + motionDataArray[i] = - motionDataArray[i]; + motionDataArray[i] = (int)((float)(motionDataArray[i]) * sensitivity[i] * generalSensitivity); + } + } + } + + xTrans = motionDataArray[0]; + yTrans = motionDataArray[1]; + zTrans = motionDataArray[2]; + xRot = motionDataArray[3]; + yRot = motionDataArray[4]; + zRot = motionDataArray[5]; +} + + +void MotionEvent::setMotionData(int &xTransIn, int &yTransIn, int &zTransIn, int &xRotIn, int &yRotIn, int &zRotIn){ + int motionDataArray[6] = {xTransIn, yTransIn, zTransIn, xRotIn, yRotIn, zRotIn}; + importSettings(motionDataArray); +} + void MotionEvent::translations(int &xTransOut, int &yTransOut, int &zTransOut) { xTransOut = xTrans; @@ -58,9 +176,8 @@ void MotionEvent::translations(int &xTransOut, int &yTransOut, int &zTransOut) void MotionEvent::setTranslations(const int &xTransIn, const int &yTransIn, const int &zTransIn) { - xTrans = xTransIn; - yTrans = yTransIn; - zTrans = zTransIn; + int motionDataArray[6] = {xTransIn, yTransIn, zTransIn, xRot, yRot, zRot}; + importSettings(motionDataArray); } void MotionEvent::rotations(int &xRotOut, int &yRotOut, int &zRotOut) @@ -72,9 +189,8 @@ void MotionEvent::rotations(int &xRotOut, int &yRotOut, int &zRotOut) void MotionEvent::setRotations(const int &xRotIn, const int &yRotIn, const int &zRotIn) { - xRot = xRotIn; - yRot = yRotIn; - zRot = zRotIn; + int motionDataArray[6] = {xTrans, yTrans, zTrans, xRotIn, yRotIn, zRotIn}; + importSettings(motionDataArray); } diff --git a/src/Gui/SpaceballEvent.h b/src/Gui/SpaceballEvent.h index b07113e56a..4f506a0b04 100644 --- a/src/Gui/SpaceballEvent.h +++ b/src/Gui/SpaceballEvent.h @@ -56,6 +56,7 @@ namespace Spaceball int rotationY(){return yRot;} int rotationZ(){return zRot;} + void setMotionData(int &xTransOut, int &yTransOut, int &zTransOut, int &xRotOut, int &yRotOut, int &zRotOut); static int MotionEventType; private: @@ -66,6 +67,8 @@ namespace Spaceball int yRot; int zRot; bool handled; + void importSettings(int* motionDataArray); + float convertPrefToSensitivity(int value); }; class ButtonEvent : public EventBase diff --git a/src/Gui/resource.cpp b/src/Gui/resource.cpp index b7f3ce8fbd..8a72ca0463 100644 --- a/src/Gui/resource.cpp +++ b/src/Gui/resource.cpp @@ -45,6 +45,7 @@ #include "DlgCommandsImp.h" #include "DlgKeyboardImp.h" #include "DlgCustomizeSpaceball.h" +#include "DlgCustomizeSpNavSettings.h" using namespace Gui; using namespace Gui::Dialog; @@ -75,6 +76,7 @@ WidgetFactorySupplier::WidgetFactorySupplier() new CustomPageProducer; //new CustomPageProducer; new CustomPageProducer; + new CustomPageProducer; new CustomPageProducer; // ADD YOUR PREFERENCE WIDGETS HERE