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

Move scenegraphDialog control to CoreWidget

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4481 383ad7c9-94d9-4d36-a494-682f7c89f535
parent ff561c2b
......@@ -74,6 +74,8 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
logWidget_(0),
recentFilesMenu_(0),
pluginsMenu_(0),
helpMenu_(0),
sceneGraphDialog_(0),
fileMenu_(0),
viewMenu_(0),
fileMenuEnd_(0),
......@@ -365,7 +367,7 @@ CoreWidget( QVector<ViewMode*>& _viewModes,
"<li><b>dialog</b>: own dialog window</li></ul>"
"This button toggles between these modi.");
QObject::connect( sceneGraphButton, SIGNAL( clicked() ),
examiner_widgets_[0], SLOT( showSceneGraphDialog() ) );
this, SLOT( slotShowSceneGraphDialog() ) );
viewerToolbar_->addWidget( sceneGraphButton)->setText( "SceneGraph" );
......@@ -624,4 +626,29 @@ void CoreWidget::showOptionsWidget() {
}
void
CoreWidget::slotShowSceneGraphDialog()
{
if ( PluginFunctions::getSceneGraphRootNode() )
{
if (!sceneGraphDialog_)
{
sceneGraphDialog_ = new ACG::QtWidgets::QtSceneGraphDialog( this, PluginFunctions::getSceneGraphRootNode() );
for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i ) {
connect(examiner_widgets_[i], SIGNAL(signalSceneGraphChanged(ACG::SceneGraph::BaseNode*)),
sceneGraphDialog_, SLOT(update(ACG::SceneGraph::BaseNode*)));
connect(sceneGraphDialog_, SIGNAL(signalNodeChanged(ACG::SceneGraph::BaseNode*)),
examiner_widgets_[i], SLOT(slotNodeChanged(ACG::SceneGraph::BaseNode*)));
}
}
sceneGraphDialog_->show();
}
}
//=============================================================================
......@@ -74,6 +74,8 @@
#include <OpenFlipper/Core/PluginInfo.hh>
#include <ACG/QtWidgets/QtSceneGraphWidget.hh>
struct ViewMode{
QString name;
......@@ -364,9 +366,18 @@ public:
/// Help Menu
QMenu* helpMenu_;
// widget showing the scenegraph
ACG::QtWidgets::QtSceneGraphDialog* sceneGraphDialog_;
/** @} */
private slots:
/** Creates and shows the Scenegraph Dialog
*/
void slotShowSceneGraphDialog();
/** Display a log message in the Mainwidget
* @param _type Type of Message (OUT,WARN,ERR)
* @param _message The message to be displayed
......
......@@ -44,7 +44,6 @@
#include "QtBaseViewer.hh"
#include "QtGLGraphicsScene.hh"
#include "QtGLGraphicsView.hh"
#include <ACG/QtWidgets/QtSceneGraphWidget.hh>
#include <ACG/QtWidgets/QtWheel.hh>
#include <ACG/Scenegraph/DrawModes.hh>
#include <ACG/GL/gl.hh>
......@@ -122,7 +121,6 @@ QtBaseViewer::QtBaseViewer( QWidget* _parent,
updateLocked_(false),
projectionUpdateLocked_(false),
blending_(true),
sceneGraphDialog_(0),
snapshotName_("snap.png"),
snapshotCounter_(0),
snapshot_(0),
......@@ -212,7 +210,6 @@ QtBaseViewer::~QtBaseViewer()
{
delete snapshot_;
delete glstate_;
delete sceneGraphDialog_;
}
......@@ -1519,34 +1516,6 @@ QPoint QtBaseViewer::glMapToGlobal( const QPoint& _pos ) const {
//-----------------------------------------------------------------------------
void
QtBaseViewer::showSceneGraphDialog()
{
if (sceneGraphRoot_)
{
if (!sceneGraphDialog_)
{
sceneGraphDialog_ = new ACG::QtWidgets::QtSceneGraphDialog( this, sceneGraphRoot_ );
connect(this,
SIGNAL(signalSceneGraphChanged(ACG::SceneGraph::BaseNode*)),
sceneGraphDialog_,
SLOT(update(ACG::SceneGraph::BaseNode*)));
connect(sceneGraphDialog_,
SIGNAL(signalNodeChanged(ACG::SceneGraph::BaseNode*)),
this,
SLOT(slotNodeChanged(ACG::SceneGraph::BaseNode*)));
}
sceneGraphDialog_->show();
}
}
//-----------------------------------------------------------------------------
void
QtBaseViewer::slotNodeChanged(ACG::SceneGraph::BaseNode* _node)
{
......
......@@ -467,8 +467,6 @@ public slots:
void projectionModeChanged( bool _ortho );
public slots:
/// show scenegraph widget
virtual void showSceneGraphDialog();
/// set view, used for synchronizing
virtual void setView( const ACG::GLMatrixd& _modelview,
......@@ -707,8 +705,7 @@ private:
bool blending_;
// widget showing the scenegraph
ACG::QtWidgets::QtSceneGraphDialog* sceneGraphDialog_;
// gl widget used as drawing area to paint the graphics scene
......
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