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

Added slotSceneDrawn to Baseinterface, including documentation. Gets triggered...

Added slotSceneDrawn to Baseinterface, including documentation. Gets triggered after gl update. closes #449 

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13866 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 80ded775
......@@ -219,6 +219,18 @@ class BaseInterface {
*/
virtual void slotViewChanged() {};
/** \brief triggered after a scene has been drawn
*
* This slot will be triggered every time, the OpenGl draw of one frame is completed.
* Every time you emit an updateView, a scene redraw will be triggered (except, if
* the minimal time between two frames is not yet reached). After drawing the scene, the
* core will call this slot to inform the plugins, that a new view is visible.
*
* You can use this slot, if you need to control special updates in your plugin, that
* react on the fps.
*/
virtual void slotSceneDrawn() {};
/** \brief A viewer changed its draw mode
*
* @param _viewerId Id of the viewer that changed its draw mode
......@@ -407,6 +419,7 @@ If the view (viewer position /viewing direction) has been changed, the slot Base
rendered. If you need to modify renderings or anything else depending on the current view, you can use this slot and adapt
to the new view (e.g. modifying a shader).
\note Be careful, not to change the view in this function or you get an endless loop!
After the complete scene has been drawn, the core will inform the plugins via the BaseINterface::slotSceneRedrawn().
\section baseInterfaceManagementFunctions Management Functions
There are some basic functions for managing plugins. The BaseInterface::description() function can be used
......
......@@ -859,7 +859,12 @@ void Core::updateView()
for (unsigned int i = 0; i < OpenFlipper::Options::examinerWidgets(); ++i)
coreWidget_->examiner_widgets_[i]->updateGL();
// Inform plugins of the scene update
emit pluginSceneDrawn();
}
}
......
......@@ -183,6 +183,9 @@ signals:
/// This signal is emitted if one of the viewers updated its view
void pluginViewChanged();
/// This signal is emitted after the scene has been drawn
void pluginSceneDrawn();
/// The texture with the given name and filename has been added
void addTexture( QString, QString , uint, int );
......
......@@ -881,6 +881,9 @@ void Core::loadPlugin(QString filename, bool silent, QString& _licenseErrors, QO
if ( checkSlot( plugin , "slotViewChanged()" ) )
connect(this,SIGNAL(pluginViewChanged()),plugin,SLOT(slotViewChanged()), Qt::DirectConnection);
if ( checkSlot( plugin , "slotSceneDrawn()" ) )
connect(this,SIGNAL(pluginSceneDrawn()),plugin,SLOT(slotSceneDrawn()), Qt::DirectConnection);
if ( checkSlot( plugin , "slotDrawModeChanged(int)" ) )
connect(coreWidget_,SIGNAL(drawModeChanged(int)),plugin,SLOT(slotDrawModeChanged(int)), Qt::DirectConnection);
......
......@@ -51,7 +51,10 @@ text centered, text=black, text width=3.5cm]
\textbf{slot BaseInterface::slotViewChanged()}
};
\node (slotSceneDrawn)[abstract, rectangle, below=of slotViewChanged, yshift=-2.4cm ]
{
\textbf{slot BaseInterface::slotSceneDrawn()}
};
\node (coreUpdateHandling) [abstract, rectangle, left= of signalUpdateView, xshift=-1.6cm ]
......@@ -91,6 +94,7 @@ text centered, text=black, text width=3.5cm]
\node [label=above:per plugin,yshift=-3] (X) at ($ (viewManagement)!.78!(slotViewChanged.west) $) {};
\node [label=right:update time reached] (X) at ($ (viewManagement)!.57!(redraw) $) {};
\node [label=left:too many updates] (X) at ($ (viewManagement)!.4!(timer) $) {};
\node [label=above:per plugin,yshift=-3] (X) at ($ (redraw.south)!.78!(slotSceneDrawn.west) $) {};
\draw[flow] (pluginViewChange.west) -- ++(0,0) -| (viewManagement.north);
\draw[flow] (userViewChange.south) -- ++(0,-0.5cm) -| (viewManagement.north);
......@@ -101,10 +105,11 @@ text centered, text=black, text width=3.5cm]
\draw[flow] (viewManagement.south) -- ++(0,-0.9) -| (timer.north);
\draw[flow] (signalUpdateView.west) -- ++(0,0) |- (coreUpdateHandling.east);
\draw[flow] (timer.south) -- ++(0,-0.4) -| (redraw.north);
\draw[flow] (redraw.south) -- ++(0,0) |- (slotSceneDrawn.west);
\begin{pgfonlayer}{background}
\node[CoreGroup,fit=(Core) (redraw) (userViewChange) ] (Core) {};
\node[PluginGroup,fit=(Plugins) (signalUpdatedObject) (slotViewChanged) ] (Plugin) {};
\node[PluginGroup,fit=(Plugins) (signalUpdatedObject) (slotSceneDrawn) ] (Plugin) {};
\end{pgfonlayer}
......
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