Commit 1de1a94c authored by Jan Möbius's avatar Jan Möbius

Remember picking mode from options

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8846 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 556df42e
...@@ -303,17 +303,6 @@ void Core::readApplicationOptions(INIFile& _ini) { ...@@ -303,17 +303,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
if( _ini.get_entry(doSlotDebugging, "Options", "SlotDebugging") ) if( _ini.get_entry(doSlotDebugging, "Options", "SlotDebugging") )
OpenFlipper::Options::doSlotDebugging(doSlotDebugging); OpenFlipper::Options::doSlotDebugging(doSlotDebugging);
//============================================================================
// Load Picking debugger state
//============================================================================
bool renderPicking = false;
if( _ini.get_entry(renderPicking, "Options", "RenderPicking") )
OpenFlipper::Options::renderPicking(renderPicking);
QString pickingRenderMode = "";
if( _ini.get_entry(renderPicking, "Options", "PickingRenderMode") )
OpenFlipper::Options::pickingRenderMode(pickingRenderMode);
//============================================================================ //============================================================================
// ViewerProperties // ViewerProperties
//============================================================================ //============================================================================
...@@ -496,12 +485,6 @@ void Core::writeApplicationOptions(INIFile& _ini) { ...@@ -496,12 +485,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
//============================================================================ //============================================================================
_ini.add_entry("Options","SlotDebugging",OpenFlipper::Options::doSlotDebugging() ); _ini.add_entry("Options","SlotDebugging",OpenFlipper::Options::doSlotDebugging() );
//============================================================================
// Write Picking debugger state
//============================================================================
_ini.add_entry("Options","RenderPicking",OpenFlipper::Options::renderPicking() );
_ini.add_entry("Options","PickingRenderMode",OpenFlipper::Options::pickingRenderMode() );
//============================================================================ //============================================================================
// Update information // Update information
//============================================================================ //============================================================================
......
...@@ -95,21 +95,24 @@ void Core::applyOptions(){ ...@@ -95,21 +95,24 @@ void Core::applyOptions(){
// gl mouse cursor // gl mouse cursor
coreWidget_->setForceNativeCursor( OpenFlipperSettings().value("Core/Gui/glViewer/nativeMouse",false).toBool() ); coreWidget_->setForceNativeCursor( OpenFlipperSettings().value("Core/Gui/glViewer/nativeMouse",false).toBool() );
QString pickRenderMode = OpenFlipperSettings().value("Core/Debug/Picking/RenderPickingMode",QString("PICK_ANYTHING")).toString();
// Prepare Picking Debugger Flag // Prepare Picking Debugger Flag
ACG::SceneGraph::PickTarget target; ACG::SceneGraph::PickTarget target;
if ( OpenFlipper::Options::pickingRenderMode() == "PICK_ANYHING") { if ( pickRenderMode == "PICK_ANYTHING") {
target = ACG::SceneGraph::PICK_ANYTHING; target = ACG::SceneGraph::PICK_ANYTHING;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_VERTEX") { } else if ( pickRenderMode == "PICK_VERTEX") {
target = ACG::SceneGraph::PICK_VERTEX; target = ACG::SceneGraph::PICK_VERTEX;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_EDGE") { } else if ( pickRenderMode == "PICK_EDGE") {
target = ACG::SceneGraph::PICK_EDGE; target = ACG::SceneGraph::PICK_EDGE;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_FACE") { } else if ( pickRenderMode == "PICK_FACE") {
target = ACG::SceneGraph::PICK_FACE; target = ACG::SceneGraph::PICK_FACE;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_FRONT_VERTEX") { } else if ( pickRenderMode == "PICK_FRONT_VERTEX") {
target = ACG::SceneGraph::PICK_FRONT_VERTEX; target = ACG::SceneGraph::PICK_FRONT_VERTEX;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_FRONT_EDGE") { } else if ( pickRenderMode == "PICK_FRONT_EDGE") {
target = ACG::SceneGraph::PICK_FRONT_EDGE; target = ACG::SceneGraph::PICK_FRONT_EDGE;
} else { } else {
std::cerr << "Error : optionHandling unable to find pick mode!!! " << pickRenderMode.toStdString() << std::endl;
target = ACG::SceneGraph::PICK_ANYTHING; target = ACG::SceneGraph::PICK_ANYTHING;
} }
...@@ -146,7 +149,7 @@ void Core::applyOptions(){ ...@@ -146,7 +149,7 @@ void Core::applyOptions(){
PluginFunctions::viewerProperties(i).wheelZoomFactorShift( OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactorShift").toDouble() ); PluginFunctions::viewerProperties(i).wheelZoomFactorShift( OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactorShift").toDouble() );
// Picking Debugger // Picking Debugger
PluginFunctions::viewerProperties(i).renderPicking(OpenFlipper::Options::renderPicking(), target ); PluginFunctions::viewerProperties(i).renderPicking( OpenFlipperSettings().value("Core/Debug/Picking/RenderPicking",false).toBool() , target );
} }
//hideToolbox //hideToolbox
......
...@@ -117,6 +117,10 @@ ...@@ -117,6 +117,10 @@
* * Core/Stereo/Philips/Offset Philips stereo header offset cc (int)\n * * Core/Stereo/Philips/Offset Philips stereo header offset cc (int)\n
* * Core/Stereo/Philips/Select Philips stereo header select (int)\n * * Core/Stereo/Philips/Select Philips stereo header select (int)\n
* \n * \n
* <b>Rendering debugger Settings<b>\n
* * Core/Debug/Picking/RenderPicking Enable picking rendering\n
* * Core/Debug/Picking/RenderPickingMode The Mode used for picking rendering\n
* \n
* Anaglyph stereo mode settings:\n * Anaglyph stereo mode settings:\n
*/ */
DLLEXPORT DLLEXPORT
...@@ -782,32 +786,6 @@ QString compilerInfo(); ...@@ -782,32 +786,6 @@ QString compilerInfo();
/** @} */ /** @} */
//===========================================================================
/** @name Picking Debugger
* @{ */
//===========================================================================
/** Set rendering Mode for Picking Debugger
*/
DLLEXPORT
void pickingRenderMode( QString _target );
/** Get rendering Mode for Picking Debugger
*/
DLLEXPORT
QString pickingRenderMode( );
/** Enable/Disable Picking Debugger
*/
DLLEXPORT
void renderPicking(bool _enable);
/** Get Picking Debugger state
*/
DLLEXPORT
bool renderPicking( );
/** @} */
/// Internal function called by the core to connect to the program options /// Internal function called by the core to connect to the program options
DLLEXPORT DLLEXPORT
......
...@@ -330,8 +330,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) { ...@@ -330,8 +330,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
// debugging // debugging
slotDebugging->setChecked(OpenFlipper::Options::doSlotDebugging()); slotDebugging->setChecked(OpenFlipper::Options::doSlotDebugging());
renderPicking->setChecked(OpenFlipper::Options::renderPicking()); renderPicking->setChecked( OpenFlipperSettings().value("Core/Debug/Picking/RenderPicking",false).toBool() );
int itemIndex = pickingRenderMode->findText( OpenFlipper::Options::pickingRenderMode() ); int itemIndex = pickingRenderMode->findText( OpenFlipperSettings().value("Core/Debug/Picking/RenderPickingMode",QString("PICK_ANYTHING")).toString() );
if ( itemIndex != -1 ) if ( itemIndex != -1 )
pickingRenderMode->setCurrentIndex(itemIndex); pickingRenderMode->setCurrentIndex(itemIndex);
...@@ -639,8 +639,8 @@ void OptionsWidget::slotApply() { ...@@ -639,8 +639,8 @@ void OptionsWidget::slotApply() {
// Debugging // Debugging
OpenFlipper::Options::doSlotDebugging(slotDebugging->isChecked()); OpenFlipper::Options::doSlotDebugging(slotDebugging->isChecked());
OpenFlipper::Options::renderPicking(renderPicking->isChecked()); OpenFlipperSettings().setValue("Core/Debug/Picking/RenderPicking",renderPicking->isChecked() );
OpenFlipper::Options::pickingRenderMode( pickingRenderMode->currentText() ); OpenFlipperSettings().setValue("Core/Debug/Picking/RenderPickingMode",pickingRenderMode->currentText() );
//viewer defaults //viewer defaults
for (int i=0; i < PluginFunctions::viewers(); i++){ for (int i=0; i < PluginFunctions::viewers(); i++){
......
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