Commit 82f8f7ae authored by Jan Möbius's avatar Jan Möbius

Enabled Picking Mode debugger in OpenFLipper

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@3588 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 19c7a8b8
......@@ -259,6 +259,17 @@ void Core::readApplicationOptions(INIFile& _ini) {
if( _ini.get_entry(doSlotDebugging, "Options", "SlotDebugging") )
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);
//============================================================================
// Update information
//============================================================================
......@@ -350,9 +361,14 @@ void Core::writeApplicationOptions(INIFile& _ini) {
//============================================================================
// Debugging
//============================================================================
// max Framerate
_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
//============================================================================
......@@ -525,7 +541,7 @@ void Core::writeIniFile(QString _filename, bool _relativePaths, bool _targetOnly
PluginFunctions::IteratorRestriction restriction;
if ( _targetOnly )
restriction = PluginFunctions::TARGET_OBJECTS;
else
else
restriction = PluginFunctions::ALL_OBJECTS;
QString keyName;
......
......@@ -81,6 +81,22 @@ void Core::applyOptions(){
coreWidget_->examiner_widget_->setWheelZoomFactor(OpenFlipper::Options::wheelZoomFactor());
coreWidget_->examiner_widget_->setWheelZoomFactorShift(OpenFlipper::Options::wheelZoomFactorShift());
// Picking Debugger
ACG::SceneGraph::PickTarget target;
if ( OpenFlipper::Options::pickingRenderMode() == "PICK_ANYHING") {
target = ACG::SceneGraph::PICK_ANYTHING;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_VERTEX") {
target = ACG::SceneGraph::PICK_VERTEX;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_EDGE") {
target = ACG::SceneGraph::PICK_EDGE;
} else if ( OpenFlipper::Options::pickingRenderMode() == "PICK_FACE") {
target = ACG::SceneGraph::PICK_FACE;
} else {
target = ACG::SceneGraph::PICK_ANYTHING;
}
coreWidget_->examiner_widget_->renderPicking(OpenFlipper::Options::renderPicking(), target );
//hideToolbox
if (OpenFlipper::Options::hideToolbox()) {
//hide all toolWidgets
......@@ -105,7 +121,7 @@ void Core::applyOptions(){
}
}
}
//set defaultBackgroundColor
QColor c = QColor( OpenFlipper::Options::defaultBackgroundColor() );
PluginFunctions::setBackColor( OpenMesh::Vec4f(c.redF(),c.greenF(),c.blueF(),0.0f) );
......
......@@ -169,6 +169,12 @@ static bool loadingSettings_ = false;
/// Currently saving Settings?
static bool savingSettings_ = false;
/// Enable picking renderer?
static bool renderPicking_ = false;
/// picking Renderer Mode
static QString pickingRenderMode_ = "PICK_ANYTHING";
static int* argc_;
static char *** argv_;
......@@ -623,6 +629,22 @@ QString coreVersion() {
return QString("0.9.1");
}
void pickingRenderMode( QString _target ) {
pickingRenderMode_ = _target;
}
QString pickingRenderMode( ) {
return pickingRenderMode_;
}
void renderPicking(bool _enable) {
renderPicking_ = _enable;
}
bool renderPicking( ) {
return renderPicking_;
}
}
}
......
......@@ -53,7 +53,7 @@
#else
#define DLLEXPORT
#endif
#endif
#endif
#include <QDir>
#include <QStringList>
......@@ -624,6 +624,33 @@ QString updatePassword( );
DLLEXPORT
QString coreVersion();
/** @} */
//===========================================================================
/** @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( );
/** @} */
}
}
......
......@@ -137,8 +137,10 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
// debugging
slotDebugging->setChecked(OpenFlipper::Options::doSlotDebugging());
//set drawmodes
renderPicking->setChecked(OpenFlipper::Options::renderPicking);
int itemIndex = pickingRenderMode->findText( OpenFlipper::Options::pickingRenderMode() );
if ( itemIndex != -1 )
pickingRenderMode->setCurrentIndex(itemIndex);
//keyBindings
keyTree->clear();
......@@ -360,6 +362,9 @@ void OptionsWidget::slotApply() {
// Debugging
OpenFlipper::Options::doSlotDebugging(slotDebugging->isChecked());
OpenFlipper::Options::renderPicking(renderPicking->isChecked());
OpenFlipper::Options::pickingRenderMode( pickingRenderMode->currentText() );
//standardDrawMode
std::vector< QString > mode;
......
......@@ -23,7 +23,7 @@ You can select multiple modes at the same time.</string>
<string/>
</property>
<property name="currentIndex" >
<number>4</number>
<number>5</number>
</property>
<property name="usesScrollButtons" >
<bool>true</bool>
......@@ -34,7 +34,7 @@ You can select multiple modes at the same time.</string>
<x>0</x>
<y>0</y>
<width>462</width>
<height>685</height>
<height>677</height>
</rect>
</property>
<attribute name="title" >
......@@ -134,7 +134,7 @@ You can select multiple modes at the same time.</string>
<x>0</x>
<y>0</y>
<width>462</width>
<height>685</height>
<height>677</height>
</rect>
</property>
<attribute name="title" >
......@@ -550,13 +550,13 @@ You can select multiple modes at the same time.</string>
<x>0</x>
<y>0</y>
<width>462</width>
<height>685</height>
<height>677</height>
</rect>
</property>
<attribute name="title" >
<string>Debug</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_12" >
<layout class="QVBoxLayout" name="verticalLayout_10" >
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7" >
<item>
......@@ -592,6 +592,59 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9" >
<item>
<widget class="QCheckBox" name="renderPicking" >
<property name="toolTip" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Arial'; font-size:11pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Print information about plugins calling specific slots&lt;br />Currently supported slots:&lt;br />- updateView()&lt;/p>
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- updated_objects( id )&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="statusTip" >
<string>Print information about plugins calling specific slots</string>
</property>
<property name="text" >
<string>render picking</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="pickingRenderMode" >
<item>
<property name="text" >
<string>PICK_ANYTHING</string>
</property>
</item>
<item>
<property name="text" >
<string>PICK_VERTEX</string>
</property>
</item>
<item>
<property name="text" >
<string>PICK_EDGE</string>
</property>
</item>
<item>
<property name="text" >
<string>PICK_FACE</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3" >
<property name="orientation" >
......
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