Commit ad631239 authored by Sylvain Thery's avatar Sylvain Thery

update views from selector change

parent 938b9d3a
......@@ -182,7 +182,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
break;
}
case WithinSphere : {
PFP2::MAP* m = static_cast<MapHandler<PFP2>*>(map)->getMap();
// PFP2::MAP* m = static_cast<MapHandler<PFP2>*>(map)->getMap();
std::vector<PFP2::VEC3> selectionPoint;
selectionPoint.push_back(p.positionAttribute[m_selectingEdge.dart]);
m_selectionSphereVBO->updateData(selectionPoint);
......@@ -234,7 +234,7 @@ void Surface_Selection_Plugin::drawMap(View* view, MapHandlerGen* map)
break;
}
case WithinSphere : {
PFP2::MAP* m = static_cast<MapHandler<PFP2>*>(map)->getMap();
// PFP2::MAP* m = static_cast<MapHandler<PFP2>*>(map)->getMap();
std::vector<PFP2::VEC3> selectionPoint;
selectionPoint.push_back(p.positionAttribute[m_selectingFace.dart]);
......@@ -549,8 +549,8 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
{
unsigned int orbit = m_schnapps->getCurrentOrbit();
CellSelectorGen* selector = m_schnapps->getSelectedSelector(orbit);
if (selector == NULL)
return;
if (selector != NULL)
{
switch(orbit)
{
case VERTEX : {
......@@ -571,7 +571,7 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
m_selectedEdgesDrawer->newList(GL_COMPILE);
m_selectedEdgesDrawer->lineWidth(3.0f);
// m_selectedEdgesDrawer->color3f(1.0f, 0.0f, 0.0f);
// m_selectedEdgesDrawer->color3f(1.0f, 0.0f, 0.0f);
m_selectedEdgesDrawer->color3f(p.color.redF(), p.color.greenF(), p.color.blueF());
m_selectedEdgesDrawer->begin(GL_LINES);
for(std::vector<Edge>::const_iterator e = selectedCells.begin(); e != selectedCells.end(); ++e)
......@@ -613,9 +613,14 @@ void Surface_Selection_Plugin::updateSelectedCellsRendering()
}
}
}
}
const QList<View*>& lv = this->getLinkedViews();
foreach(View* v, lv)
{
v->updateGL();
}
}
void Surface_Selection_Plugin::updateRemovedSelector(unsigned int orbit, const QString& name)
{
updateSelectedCellsRendering();
......
......@@ -235,12 +235,12 @@ void ControlDock_MapTab::selectedSelectorChanged()
if (!items.empty())
{
m_selectedSelector[orbit] = m_selectedMap->getCellSelector(orbit, items[0]->text());
m_schnapps->notifySelectedCellSelectorChanged(m_selectedSelector[orbit]);
QTextStream* rec = m_schnapps->pythonStreamRecorder();
if (rec)
*rec << "schnapps.setSelectedSelectorCurrentMap(" << orbit << ", \"" << items[0]->text() << "\");" << endl;
}
m_schnapps->notifySelectedCellSelectorChanged(m_selectedSelector[orbit]); // notify even if nothing selected !
}
}
......
......@@ -806,6 +806,7 @@ void SCHNApps::setSelectedSelectorCurrentMap(unsigned int orbit, const QString&
case FACE: items = m_controlMapTab->list_faceSelectors->findItems(name, Qt::MatchExactly); break;
case VOLUME: items = m_controlMapTab->list_volumeSelectors->findItems(name, Qt::MatchExactly); break;
}
m_controlMapTab->tabWidget_mapInfo->setCurrentIndex(orbit);
if (!items.empty())
items[0]->setSelected(true);
}
......
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