Commit 83c2da4e authored by Jan Möbius's avatar Jan Möbius

Use QSettings for gl and stereo mouse settings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8096 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4e637613
......@@ -208,20 +208,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
OpenFlipper::Options::anaglyphRightEyeColorMatrix(set);
}
//============================================================================
// Load stereo mouse picking behavior
//============================================================================
bool stereoMousePick = false;
if ( _ini.get_entry( stereoMousePick, "Options" , "StereoMousePick") )
OpenFlipper::Options::stereoMousePick(stereoMousePick);
//============================================================================
// Load gl mouse painting behavior
//============================================================================
bool glMouse = false;
if ( _ini.get_entry( glMouse, "Options" , "GlMouse") )
OpenFlipper::Options::glMouse(glMouse);
//============================================================================
// Load the setting for the loger window
//============================================================================
......@@ -585,10 +571,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
_ini.add_entry("Options" , "CustomAnaglyphLeftEye", OpenFlipper::Options::anaglyphLeftEyeColorMatrix() );
_ini.add_entry("Options" , "CustomAnaglyphRightEye", OpenFlipper::Options::anaglyphRightEyeColorMatrix() );
_ini.add_entry("Options", "StereoMousePick", OpenFlipper::Options::stereoMousePick() );
_ini.add_entry("Options", "GlMouse", OpenFlipper::Options::glMouse() );
}
emit saveOnExit(_ini);
......
......@@ -86,8 +86,8 @@ void Core::applyOptions(){
coreWidget_->showLogger( OpenFlipper::Options::loggerState() );
// gl mouse cursor
coreWidget_->setGlCursor( OpenFlipper::Options::glMouse() );
coreWidget_->setGlCursor( OpenFlipperSettings().value("Core/Gui/glViewer/glMouse",true).toBool() );
// Prepare Picking Debugger Flag
ACG::SceneGraph::PickTarget target;
if ( OpenFlipper::Options::pickingRenderMode() == "PICK_ANYHING") {
......
......@@ -135,9 +135,6 @@ static StereoMode stereoMode_ = OpenGL;
static std::vector<float> anaglyphLeftEyeColors_ = std::vector<float> (9, 0.0);
static std::vector<float> anaglyphRightEyeColors_ = std::vector<float> (9, 0.0);
/// mouse cursor depth picking in stereo mode
static bool stereoMousePick_ = true;
/// Store the synchronization mode
static bool synchronization_ = false;
......@@ -168,9 +165,6 @@ static bool drawModesInContextMenu_ = true;
/// Set if a grid should be drawn in every viewer
static bool gridVisible_ = false;
/// Should OpenGL be used to draw the mouse cursor
static bool glMouse_ = true;
/// Store the toolbox gui Mode mode
static bool hideToolbox_ = false;
......@@ -486,16 +480,6 @@ std::vector<float> anaglyphRightEyeColorMatrix( )
return anaglyphRightEyeColors_;
}
/// Enables/Disables mouse cursor depth picking during stereo mode
void stereoMousePick( bool _stereoMousePick ) {
stereoMousePick_ = _stereoMousePick;
}
/// mouse cursor depth picking during stereo mode
bool stereoMousePick( ) {
return stereoMousePick_;
}
/// Store synchronization mode setting
void synchronization( bool _synchronization ) {
synchronization_ = _synchronization;
......@@ -599,16 +583,6 @@ unsigned int examinerWidgets() {
return 1;
}
/// Store Gl based cursor painting
void glMouse( bool _glMouse ) {
glMouse_ = _glMouse;
}
/// Should the mouse cursor be painted with gl
bool glMouse( ) {
return glMouse_;
}
/// Set to current
void loggerState( LoggerState _state) {
loggerState_ = _state;
......
......@@ -87,6 +87,8 @@
* <b>User Interface Settings</b>
* * Core/Gui/glViewer/defaultBackgroundColor This controls the default background color of the glViewer (QColor)
* * Core/Gui/glViewer/showControlWheels This setting controls if the control wheels should be visible in the glViewer (bool)
* * Core/Gui/glViewer/glMouse This setting controls if the mouse is rendered in OpenGL or in the window manager
* * Core/Gui/glViewer/stereoMousePick This setting controls if the mouse depth is picked in stereo mode
* * Core/Gui/splash This setting controls if the splash screen is shown at startup(bool)
*
* <b>Log Settings</b>
......@@ -433,14 +435,6 @@ QString helpDirStr();
DLLEXPORT
std::vector<float> anaglyphRightEyeColorMatrix( );
/// Enables/Disables mouse cursor depth picking during stereo mode
DLLEXPORT
void stereoMousePick( bool _stereoPick );
/// mouse cursor depth picking during stereo mode
DLLEXPORT
bool stereoMousePick( );
/// Store synchronization setting
DLLEXPORT
void synchronization( bool _synchronization );
......@@ -521,14 +515,6 @@ QString helpDirStr();
DLLEXPORT
void gridVisible(bool _visible);
/// Store Gl based cursor painting
DLLEXPORT
void glMouse( bool _glMouse );
/// Should the mouse cursor be painted with gl
DLLEXPORT
bool glMouse( );
/** @} */
//===========================================================================
......
......@@ -182,7 +182,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
// gl widget as parent to make sure that the CursorPainter will be deleted before
cursorPainter_ = new CursorPainter (glWidget_);
cursorPainter_->setForceNative (!OpenFlipper::Options::glMouse ());
cursorPainter_->setForceNative (!OpenFlipperSettings().value("Core/Gui/glViewer/glMouse",true).toBool() );
cursorPainter_->setEnabled (stereoActive_);
glScene_->setCursorPainter (cursorPainter_);
......
......@@ -2270,7 +2270,7 @@ void glViewer::updateCursorPosition (QPointF _scenePos)
cursorPositionValid_ = false;
}
// only do real pick in stereo mode
else if (stereo_ && OpenFlipper::Options::stereoMousePick() &&
else if (stereo_ && OpenFlipperSettings().value("Core/Gui/glViewer/stereoMousePick",true).toBool() &&
pick (ACG::SceneGraph::PICK_ANYTHING, _scenePos.toPoint(), nodeIdx, targetIdx, &tmp))
{
// the point we get back will contain the view transformation and we have to revert it
......
......@@ -73,7 +73,7 @@ SimpleGLGraphicsScene::SimpleGLGraphicsScene () :
initialized_(false)
{
cursorPainter_ = new CursorPainter (this);
cursorPainter_->setEnabled (OpenFlipper::Options::glMouse ());
cursorPainter_->setEnabled( OpenFlipperSettings().value("Core/Gui/glViewer/glMouse",true).toBool() );
}
......
......@@ -306,9 +306,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
rcm7->setValue (mat[7]);
rcm8->setValue (mat[8]);
noMousePick->setChecked (!OpenFlipper::Options::stereoMousePick());
nativeMouse->setChecked (!OpenFlipper::Options::glMouse());
noMousePick->setChecked ( !OpenFlipperSettings().value("Core/Gui/glViewer/stereoMousePick",true).toBool() );
nativeMouse->setChecked ( !OpenFlipperSettings().value("Core/Gui/glViewer/glMouse",true).toBool() );
// plugin options
initPluginOptions();
......@@ -580,8 +579,6 @@ void OptionsWidget::slotApply() {
OpenFlipperSettings().setValue("Core/Stereo/EyeDistance",eyeDistance->value ());
OpenFlipperSettings().setValue("Core/Stereo/FocalDistance",double(focalDistance->value() / 1000.0));
OpenFlipper::Options::stereoMousePick(!noMousePick->isChecked ());
// Set option entries for philips stereo mode
// Set option entries
OpenFlipperSettings().setValue("Core/Stereo/Philips/Content",headerContentType->currentIndex());
......@@ -613,8 +610,9 @@ void OptionsWidget::slotApply() {
mat[8] = rcm8->value ();
OpenFlipper::Options::anaglyphRightEyeColorMatrix (mat);
OpenFlipper::Options::glMouse(!nativeMouse->isChecked ());
OpenFlipperSettings().setValue("Core/Gui/glViewer/stereoMousePick",!noMousePick->isChecked ());
OpenFlipperSettings().setValue("Core/Gui/glViewer/glMouse",!nativeMouse->isChecked ());
// updates
OpenFlipper::Options::updateUrl( updateURL->text() );
......
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