Commit 7c2a9e25 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps: VBO added signal used for UI update

parent f96d3d6f
......@@ -215,8 +215,7 @@ void RenderPlugin::mapUnlinked(MapHandlerGen* m)
void RenderPlugin::vboAdded(Utils::VBO* vbo)
{
MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
assert(h_viewParams[m_window->getCurrentView()]->selectedMap == map);
assert(h_viewParams[m_window->getCurrentView()]->selectedMap == static_cast<MapHandlerGen*>(QObject::sender()));
if(vbo->dataSize() == 3)
m_dockTab->addVBOToList(QString::fromStdString(vbo->name()));
}
......
......@@ -30,6 +30,8 @@ public slots:
void refreshUI(ParameterSet* params);
void selectedMapChanged();
void addVBOToList(QString name);
void removeVBOFromList(QString name);
void positionVBOChanged(int index);
void selectedVectorsVBOChanged();
void vectorsScaleFactorChanged(int i);
......
......@@ -149,7 +149,9 @@ void RenderVectorPlugin::mapUnlinked(MapHandlerGen* m)
void RenderVectorPlugin::vboAdded(Utils::VBO* vbo)
{
m_dockTab->refreshUI(h_viewParams[m_window->getCurrentView()]);
assert(h_viewParams[m_window->getCurrentView()]->selectedMap == static_cast<MapHandlerGen*>(QObject::sender()));
if(vbo->dataSize() == 3)
m_dockTab->addVBOToList(QString::fromStdString(vbo->name()));
}
void RenderVectorPlugin::vboRemoved(Utils::VBO* vbo)
......
......@@ -82,6 +82,23 @@ void RenderVectorDockTab::selectedMapChanged()
}
}
void RenderVectorDockTab::addVBOToList(QString name)
{
combo_positionVBO->addItem(name);
list_vectorVBO->addItem(name);
}
void RenderVectorDockTab::removeVBOFromList(QString name)
{
int itemIdx = combo_positionVBO->findText(name, Qt::MatchExactly);
if(itemIdx != -1)
combo_positionVBO->removeItem(itemIdx);
QList<QListWidgetItem*> items = list_vectorVBO->findItems(name, Qt::MatchExactly);
if(!items.empty())
delete items[0];
}
void RenderVectorDockTab::positionVBOChanged(int index)
{
if(!b_refreshingUI)
......
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