Commit f0664c11 authored by Jan Möbius's avatar Jan Möbius

Moved picking rendering status to Viewercontrol

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4516 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9df0b47a
......@@ -100,7 +100,7 @@ void Core::applyOptions(){
coreWidget_->examiner_widgets_[i]->setWheelZoomFactorShift(OpenFlipper::Options::wheelZoomFactorShift());
// Picking Debugger
coreWidget_->examiner_widgets_[i]->renderPicking(OpenFlipper::Options::renderPicking(), target );
PluginFunctions::viewerProperties(i).renderPicking(OpenFlipper::Options::renderPicking(), target );
// Background color
PluginFunctions::viewerProperties(i).backgroundColor( ACG::Vec4f(c.redF(),c.greenF(),c.blueF(),1.0f) );
......
......@@ -49,7 +49,10 @@ namespace Viewer {
lastActionMode_(Viewer::PickingMode),
snapshotName_("snap.png"),
snapshotCounter_(0),
CCWFront_(true)
CCWFront_(true),
backgroundColor_(0.0f,0.0f,0.0f,0.0f),
renderPicking_(false),
pickRendererMode_(ACG::SceneGraph::PICK_ANYTHING)
{
}
......
......@@ -49,6 +49,7 @@
#include <QObject>
#include <ACG/Math/VectorT.hh>
#include <ACG/Scenegraph/SceneGraph.hh>
namespace Viewer {
......@@ -136,10 +137,13 @@ namespace Viewer {
/** @} */
//===========================================================================
//===========================================================================
/** @name Rendering Settings
* @{ */
//===========================================================================
//===========================================================================
public slots:
/** true if counter clockwise orientation should be used to define front facing orientation.
*/
......@@ -153,6 +157,9 @@ namespace Viewer {
private:
bool CCWFront_;
//===========================================================================
public slots:
/// Get current background color
......@@ -165,6 +172,37 @@ namespace Viewer {
private:
ACG::Vec4f backgroundColor_;
//===========================================================================
public slots:
/// Render picking or not
bool renderPicking() { return renderPicking_; };
/// Mode used for the picking renderer
ACG::SceneGraph::PickTarget renderPickingMode() { return pickRendererMode_; };
void renderPickin(bool _mode ) { renderPicking_ = _mode; emit updated(); };
/** Use this function to switch the viewer to visualize picking.
* When you set this function to true the renderer will render the picking
* elements rather then the scene
*/
void renderPicking(bool _renderPicking, ACG::SceneGraph::PickTarget _mode) {
pickRendererMode_ = _mode ; renderPicking_ = _renderPicking; emit updated();
}
private:
/** This variable controls if the scene is rendered in normal or in picking mode
*/
bool renderPicking_;
/** If rendering is in picking mode, this variable controls which picking targets
* will be rendered. ( see renderPicking_ , renderPicking(bool _renderPicking, PickRendererMode _mode) ,
* and ACG::SceneGraph::PickTarget
*/
ACG::SceneGraph::PickTarget pickRendererMode_;
/** @} */
signals:
......
......@@ -122,9 +122,7 @@ glViewer::glViewer( QWidget* _parent,
projectionUpdateLocked_(false),
blending_(true),
pick_mode_name_(""),
pick_mode_idx_(-1),
renderPicking_(false),
pickRendererMode_(ACG::SceneGraph::PICK_ANYTHING)
pick_mode_idx_(-1)
{
// check for OpenGL support
......@@ -629,7 +627,7 @@ void glViewer::drawScene_mono()
if (sceneGraphRoot_)
{
if (! renderPicking_ ) {
if (! properties_.renderPicking() ) {
ACG::SceneGraph::DrawAction action(curDrawMode_, false);
ACG::SceneGraph::traverse(sceneGraphRoot_, action, *glstate_, curDrawMode_);
......@@ -649,7 +647,7 @@ void glViewer::drawScene_mono()
glPushName((GLuint) 0);
// do the picking
ACG::SceneGraph::PickAction action(pickRendererMode_);
ACG::SceneGraph::PickAction action(properties_.renderPickingMode());
ACG::SceneGraph::traverse(sceneGraphRoot_, action, *glstate_);
glEnable(GL_LIGHTING);
......
......@@ -851,12 +851,6 @@ private:
*/
void pickMode( int _id );
/** Use this function to switch the viewer to visualize picking.
* When you set this function to true the renderer will render the picking
* elements rather then the scene
*/
void renderPicking(bool _renderPicking, ACG::SceneGraph::PickTarget _mode);
public slots:
/** \brief set a new cursor for the pick mode
......@@ -917,15 +911,8 @@ private:
*/
int pick_mode_idx_;
/** This variable controls if the scene is rendered in normal or in picking mode
*/
bool renderPicking_;
/** If rendering is in picking mode, this variable controls which picking targets
* will be rendered. ( see renderPicking_ , renderPicking(bool _renderPicking, PickRendererMode _mode) ,
* and ACG::SceneGraph::PickTarget
*/
ACG::SceneGraph::PickTarget pickRendererMode_;
/** @} */
......
......@@ -55,14 +55,6 @@ static const unsigned int NAME_STACK_SIZE = 2;
//== IMPLEMENTATION ==========================================================
void glViewer::renderPicking(bool _renderPicking, ACG::SceneGraph::PickTarget _mode) {
renderPicking_ = _renderPicking;
pickRendererMode_ = _mode;
}
//-----------------------------------------------------------------------------
bool glViewer::pick( ACG::SceneGraph::PickTarget _pickTarget,
const QPoint& _mousePos,
unsigned int& _nodeIdx,
......
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