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

Added viewChanged slot to baseinterface

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7040 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7e6ead89
...@@ -146,6 +146,7 @@ class BaseInterface { ...@@ -146,6 +146,7 @@ class BaseInterface {
* *
*/ */
virtual void objectPropertiesChanged( int /*_identifier*/ ) {}; virtual void objectPropertiesChanged( int /*_identifier*/ ) {};
private slots: private slots:
...@@ -195,6 +196,15 @@ class BaseInterface { ...@@ -195,6 +196,15 @@ class BaseInterface {
* *
*/ */
virtual void slotObjectPropertiesChanged( int /*_identifier*/ ) {}; 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() {};
/** @} */ /** @} */
......
...@@ -480,6 +480,9 @@ Core::init() { ...@@ -480,6 +480,9 @@ Core::init() {
connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewUpdated() ), connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewUpdated() ),
this, SLOT( viewUpdated()) ,Qt::DirectConnection); this, SLOT( viewUpdated()) ,Qt::DirectConnection);
connect( coreWidget_->examiner_widgets_[i], SIGNAL( viewUpdated() ),
this, SIGNAL( pluginViewChanged() ) ,Qt::DirectConnection);
} }
} }
......
...@@ -163,6 +163,9 @@ signals: ...@@ -163,6 +163,9 @@ signals:
/// This signal is emitted if the object has been changed (source/target) /// This signal is emitted if the object has been changed (source/target)
void objectSelectionChanged( int ); 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 /// The texture with the given name and filename has been added
void addTexture( QString, QString , uint, int ); void addTexture( QString, QString , uint, int );
......
...@@ -482,6 +482,9 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -482,6 +482,9 @@ void Core::loadPlugin(QString filename, bool silent){
if ( checkSignal(plugin,"objectPropertiesChanged(int)")) if ( checkSignal(plugin,"objectPropertiesChanged(int)"))
connect(plugin,SIGNAL(objectPropertiesChanged(int)),this,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection); 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)")) if ( checkSlot(plugin,"slotObjectPropertiesChanged(int)"))
connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection); connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection);
......
...@@ -113,7 +113,8 @@ void Core::stopVideoCapture() { ...@@ -113,7 +113,8 @@ void Core::stopVideoCapture() {
} }
} }
void Core::viewUpdated() { void Core::viewUpdated( ) {
if ( capture_ ) if ( capture_ )
captureVideo(); captureVideo();
} }
......
...@@ -1755,8 +1755,6 @@ void glViewer::treatFirstPersonNavigation( QMouseEvent* _event) { ...@@ -1755,8 +1755,6 @@ void glViewer::treatFirstPersonNavigation( QMouseEvent* _event) {
ACG::Vec3d yaxis = glstate_->modelview().transform_vector(glstate_->up()); ACG::Vec3d yaxis = glstate_->modelview().transform_vector(glstate_->up());
ACG::Vec3d xaxis = glstate_->modelview().transform_vector(glstate_->right()); ACG::Vec3d xaxis = glstate_->modelview().transform_vector(glstate_->right());
ACG::Vec3d eye = glstate_->eye();
rotate(yaxis, -diffx * 90, glstate_->eye()); rotate(yaxis, -diffx * 90, glstate_->eye());
rotate(xaxis, diffy * 90, glstate_->eye()); rotate(xaxis, diffy * 90, glstate_->eye());
......
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