diff --git a/SCHNApps/include/view.h b/SCHNApps/include/view.h index 940225b6de3d588806d2349580c3e1a5f9e4fac4..5450c60e43392f249beff60ecb6d47d973a2cd0b 100644 --- a/SCHNApps/include/view.h +++ b/SCHNApps/include/view.h @@ -83,7 +83,7 @@ private: glm::mat4 getCurrentProjectionMatrix() const; glm::mat4 getCurrentModelViewProjectionMatrix() const; - void updateViewBB(); + void updateCurrentCameraBB(); private slots: void ui_verticalSplitView(int x, int y, int globalX, int globalY); diff --git a/SCHNApps/src/schnapps.cpp b/SCHNApps/src/schnapps.cpp index dd39ad61ec1b62f68b9d1b210dd4ffcf5006c6d1..190578d0ed3e483f13fc28f2aa1a6c31a6cd384b 100644 --- a/SCHNApps/src/schnapps.cpp +++ b/SCHNApps/src/schnapps.cpp @@ -413,7 +413,15 @@ void SCHNApps::addPluginDockTab(Plugin* plugin, QWidget* tabWidget, const QStrin int idx = m_pluginDockTabWidget->addTab(tabWidget, tabText); m_pluginDock->setVisible(true); - m_pluginDockTabWidget->setTabEnabled(idx, true); + + PluginInteraction* pi = dynamic_cast(plugin); + if(pi) + { + if(pi->isLinkedToView(m_selectedView)) + m_pluginDockTabWidget->setTabEnabled(idx, true); + else + m_pluginDockTabWidget->setTabEnabled(idx, false); + } if(currentTab != -1) m_pluginDockTabWidget->setCurrentIndex(currentTab); diff --git a/SCHNApps/src/view.cpp b/SCHNApps/src/view.cpp index dd5115114c754395411bd75409701e67bec0db49..50e47d96251bb335cce34dc50df0cd92fa2cf08a 100644 --- a/SCHNApps/src/view.cpp +++ b/SCHNApps/src/view.cpp @@ -67,6 +67,7 @@ void View::setCurrentCamera(Camera* c) emit(currentCameraChanged(prev, c)); + updateCurrentCameraBB(); updateGL(); } } @@ -131,7 +132,7 @@ void View::linkMap(MapHandlerGen* map) l_maps.push_back(map); map->linkView(this); emit(mapLinked(map)); - updateViewBB(); + updateCurrentCameraBB(); updateGL(); } } @@ -149,7 +150,7 @@ void View::unlinkMap(MapHandlerGen* map) { map->unlinkView(this); emit(mapUnlinked(map)); - updateViewBB(); + updateCurrentCameraBB(); updateGL(); } } @@ -397,7 +398,7 @@ glm::mat4 View::getCurrentModelViewProjectionMatrix() const return mvpm; } -void View::updateViewBB() +void View::updateCurrentCameraBB() { qglviewer::Vec bbMin(0,0,0); qglviewer::Vec bbMax(1,1,1);