Commit aa6af50f authored by Jan Möbius's avatar Jan Möbius
Browse files

Provide settings for stereo mode in OpenFlipper

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4282 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8af70735
......@@ -3,6 +3,8 @@
#include <OpenFlipper/BasePlugin/KeyInterface.hh>
#include <OpenFlipper/BasePlugin/BaseInterface.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
//-----------------------------------------------------------------------------
KeyBinding CoreWidget::getKeyBinding(QObject* _plugin, int _keyIndex ){
......@@ -265,6 +267,8 @@ void CoreWidget::registerCoreKeys() {
emit registerKey(Qt::Key_L , Qt::ControlModifier, "Show/Hide Logger");
emit registerKey(Qt::Key_T , Qt::ControlModifier, "Show/Hide Toolbox");
emit registerKey(Qt::Key_F , Qt::ControlModifier, "Toggle Fullscreen");
emit registerKey(Qt::Key_E , Qt::ControlModifier | Qt::AltModifier, "Adjust Eye distance for stereo mode");
emit registerKey(Qt::Key_F , Qt::ControlModifier | Qt::AltModifier, "Adjust Focal distance for stereo mode");
emit registerKey(Qt::Key_Escape , Qt::NoModifier, "Switch to last action mode ( Move,Picking,Light or Info Mode)");
}
......@@ -273,8 +277,54 @@ void CoreWidget::registerCoreKeys() {
void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
if (_e->modifiers() & Qt::ControlModifier ) {
switch (_e->key())
{
if (_e->modifiers() & Qt::AltModifier )
if ( OpenFlipper::Options::stereo() ) {
switch (_e->key()) {
// Stereo seeing: eye distance
case Qt::Key_E:
{
bool ok(false);
double val = QInputDialog::getDouble( this, "Eye Dist", "Eye Dist:",
examiner_widgets_[0]->eyeDistance(),
0.0, 100.0, 10,
&ok);
if (ok) {
for ( uint i = 0 ; i < examiner_widgets_.size(); ++i)
examiner_widgets_[i]->setEyeDistance(val);
}
break;
}
// Stereo setting: focal length
case Qt::Key_F:
{
bool ok(false);
double val = QInputDialog::getDouble( this, "Focal Dist", "Focal Dist:",
examiner_widgets_[0]->focalDistance(),
0.0, 100.0, 10,
&ok);
if (ok) {
for ( uint i = 0 ; i < examiner_widgets_.size(); ++i)
examiner_widgets_[i]->setFocalDistance(val);
}
break;
}
default:
break;
}
} else
emit log(LOGWARN,"Activate stereo mode to change stereo settings");
else
switch (_e->key()) {
case Qt::Key_F :
toggleFullscreen();
return;
......@@ -295,7 +345,8 @@ void CoreWidget::coreKeyPressEvent (QKeyEvent* _e){
default:
return;
}
}
}
switch (_e->key()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment