From 1d8435db31efec251417e88816f609c6ad73b0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 10 Sep 2009 13:03:13 +0000 Subject: [PATCH] Added viewChanged slot to baseinterface git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7040 383ad7c9-94d9-4d36-a494-682f7c89f535 --- BasePlugin/BaseInterface.hh | 10 ++++++++++ Core/Core.cc | 3 +++ Core/Core.hh | 3 +++ Core/PluginLoader.cc | 3 +++ Core/Video.cc | 3 ++- widgets/glWidget/QtBaseViewer.cc | 2 -- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/BasePlugin/BaseInterface.hh b/BasePlugin/BaseInterface.hh index a5529742..8dacc355 100644 --- a/BasePlugin/BaseInterface.hh +++ b/BasePlugin/BaseInterface.hh @@ -146,6 +146,7 @@ class BaseInterface { * */ virtual void objectPropertiesChanged( int /*_identifier*/ ) {}; + private slots: @@ -195,6 +196,15 @@ class BaseInterface { * */ virtual void slotObjectPropertiesChanged( int /*_identifier*/ ) {}; + + /** \brief View has changed + * + * This slot is called when the view in one of the viewers changed + * ( Viewing direction/viewer position ) + * !! Be carefull to not change the view in this slot !! + * !! This will of course lead to an endless loop !! + */ + virtual void slotViewChanged() {}; /** @} */ diff --git a/Core/Core.cc b/Core/Core.cc index 94360be2..08fb002d 100644 --- a/Core/Core.cc +++ b/Core/Core.cc @@ -480,6 +480,9 @@ Core::init() { connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewUpdated() ), this, SLOT( viewUpdated()) ,Qt::DirectConnection); + + connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewUpdated() ), + this, SIGNAL( pluginViewChanged() ) ,Qt::DirectConnection); } } diff --git a/Core/Core.hh b/Core/Core.hh index e84916c6..b6988091 100644 --- a/Core/Core.hh +++ b/Core/Core.hh @@ -163,6 +163,9 @@ signals: /// This signal is emitted if the object has been changed (source/target) void objectSelectionChanged( int ); + + /// This signal is emitted if one of the viewers updated its view + void pluginViewChanged(); /// The texture with the given name and filename has been added void addTexture( QString, QString , uint, int ); diff --git a/Core/PluginLoader.cc b/Core/PluginLoader.cc index b1728232..1288a69d 100644 --- a/Core/PluginLoader.cc +++ b/Core/PluginLoader.cc @@ -482,6 +482,9 @@ void Core::loadPlugin(QString filename, bool silent){ if ( checkSignal(plugin,"objectPropertiesChanged(int)")) connect(plugin,SIGNAL(objectPropertiesChanged(int)),this,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection); + + if ( checkSlot( plugin , "slotViewChanged()" ) ) + connect(this,SIGNAL(pluginViewChanged()),plugin,SLOT(slotViewChanged()), Qt::DirectConnection); if ( checkSlot(plugin,"slotObjectPropertiesChanged(int)")) connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection); diff --git a/Core/Video.cc b/Core/Video.cc index 225c2aa4..0b9b0948 100644 --- a/Core/Video.cc +++ b/Core/Video.cc @@ -113,7 +113,8 @@ void Core::stopVideoCapture() { } } -void Core::viewUpdated() { +void Core::viewUpdated( ) { + if ( capture_ ) captureVideo(); } diff --git a/widgets/glWidget/QtBaseViewer.cc b/widgets/glWidget/QtBaseViewer.cc index dec0758b..3c47d47c 100644 --- a/widgets/glWidget/QtBaseViewer.cc +++ b/widgets/glWidget/QtBaseViewer.cc @@ -1755,8 +1755,6 @@ void glViewer::treatFirstPersonNavigation( QMouseEvent* _event) { ACG::Vec3d yaxis = glstate_->modelview().transform_vector(glstate_->up()); ACG::Vec3d xaxis = glstate_->modelview().transform_vector(glstate_->right()); - ACG::Vec3d eye = glstate_->eye(); - rotate(yaxis, -diffx * 90, glstate_->eye()); rotate(xaxis, diffy * 90, glstate_->eye()); -- GitLab