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

New function visibility changed for plugins

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4956 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 37e0c711
......@@ -53,7 +53,7 @@
* You have to implement at least name and description for your plugin.
* All other functions and signals are optional. If you want to implement or use
* them just add them to your plugin header.
*
*
* See \ref pluginProgramming for a tutorial on plugin programming.
*
* Also see \ref dataFlow diagrams for a detailed overview of
......@@ -111,6 +111,15 @@ class BaseInterface {
*/
virtual void updatedObject(int ) {};
/** \brief An Object has been shown or hidden
*
* Emit this Signal, if youchanged the visibility of an object.
* This is required to reset the near and far plane for the viewers to provide
* an optimal view.
*
*/
virtual void visibilityChanged( ) {};
/** \brief The active object has been switched by this plugin
*
* This Signal is used to tell the other plugins that the active object has been changed.\n
......
......@@ -205,6 +205,9 @@ signals:
*/
void slotObjectUpdated(int _identifier);
/// Called when a plugin changes the visibility of an object
void slotVisibilityChanged();
/// Called by Plugins if they changed the active object
void slotActiveObjectChanged();
......
......@@ -96,6 +96,11 @@ void Core::slotObjectUpdated(int _identifier) {
updateView();
}
void Core::slotVisibilityChanged() {
resetScenegraph();
updateView();
}
/** This function is called if the active object has changed. The information is passed to all plugins.
*/
void Core::slotActiveObjectChanged()
......
......@@ -469,6 +469,8 @@ void Core::loadPlugin(QString filename, bool silent){
if ( checkSignal(plugin,"updatedObject(int)") )
connect(plugin,SIGNAL(updatedObject(int)),this,SLOT(slotObjectUpdated(int)), Qt::DirectConnection);
if ( checkSignal(plugin,"visibilityChanged()") )
connect(plugin,SIGNAL(visibilityChanged()),this,SLOT(slotVisibilityChanged), Qt::DirectConnection);
if ( checkSlot(plugin,"slotAllCleared()") )
......@@ -597,7 +599,6 @@ void Core::loadPlugin(QString filename, bool silent){
coreWidget_->setDockOptions(QMainWindow::AllowTabbedDocks | QMainWindow::VerticalTabs);
coreWidget_->addDockWidget(Qt::RightDockWidgetArea,dock);
// dock->resize(300,widget->height() );
connect(dock, SIGNAL( visibilityChanged (bool) ), coreWidget_ , SLOT( slotVisibilityChanged(bool) ));
info.widget = dock;
......
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