Commit fc33bdaf authored by Pierre Kraemer's avatar Pierre Kraemer

add fromUI refresh filter in surface deformation plugin

parent b5555790
......@@ -128,9 +128,9 @@ public slots:
void mapLinked(MapHandlerGen* m);
void mapUnlinked(MapHandlerGen* m);
void changeSelectedMap(View* view, MapHandlerGen* map);
void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute<PFP2::VEC3> attribute);
void changeVerticesSelectionMode(View* view, MapHandlerGen* map, SelectionMode m);
void changeSelectedMap(View* view, MapHandlerGen* map, bool fromUI = false);
void changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute<PFP2::VEC3> attribute, bool fromUI = false);
void changeVerticesSelectionMode(View* view, MapHandlerGen* map, SelectionMode m, bool fromUI = false);
void matchDiffCoord(View* view, MapHandlerGen* map);
void asRigidAsPossible(View* view, MapHandlerGen* map);
......
......@@ -441,7 +441,7 @@ void SurfaceDeformationPlugin::mapUnlinked(MapHandlerGen* m)
m_dockTab->refreshUI(params);
}
void SurfaceDeformationPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
void SurfaceDeformationPlugin::changeSelectedMap(View* view, MapHandlerGen* map, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
......@@ -458,11 +458,12 @@ void SurfaceDeformationPlugin::changeSelectedMap(View* view, MapHandlerGen* map)
selectionRadius = map->getBBdiagSize() / 50.0;
}
if(!fromUI)
m_dockTab->refreshUI(params);
}
}
void SurfaceDeformationPlugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute<PFP2::VEC3> attribute)
void SurfaceDeformationPlugin::changePositionAttribute(View* view, MapHandlerGen* map, VertexAttribute<PFP2::VEC3> attribute, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
PerMapParameterSet* perMap = params->perMap[map->getName()];
......@@ -470,16 +471,22 @@ void SurfaceDeformationPlugin::changePositionAttribute(View* view, MapHandlerGen
perMap->initParameters();
if(view->isCurrentView())
{
if(!fromUI)
m_dockTab->refreshUI(params);
}
}
void SurfaceDeformationPlugin::changeVerticesSelectionMode(View* view, MapHandlerGen* map, SelectionMode m)
void SurfaceDeformationPlugin::changeVerticesSelectionMode(View* view, MapHandlerGen* map, SelectionMode m, bool fromUI)
{
ParameterSet* params = h_viewParams[view];
params->perMap[map->getName()]->verticesSelectionMode = m;
if(view->isCurrentView())
{
if(!fromUI)
m_dockTab->refreshUI(params);
}
}
void SurfaceDeformationPlugin::matchDiffCoord(View* view, MapHandlerGen* mh)
......
......@@ -75,7 +75,7 @@ void SurfaceDeformationDockTab::selectedMapChanged()
{
QList<QListWidgetItem*> currentItems = mapList->selectedItems();
if(!currentItems.empty())
m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()));
m_plugin->changeSelectedMap(m_window->getCurrentView(), m_window->getMap(currentItems[0]->text()), true);
}
}
......@@ -85,7 +85,7 @@ void SurfaceDeformationDockTab::positionAttributeChanged(int index)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()));
m_plugin->changePositionAttribute(view, map, map->getAttribute<PFP2::VEC3, VERTEX>(combo_positionAttribute->currentText()), true);
}
}
......@@ -95,7 +95,7 @@ void SurfaceDeformationDockTab::selectLockedVertices(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVerticesSelectionMode(view, map, LOCKED);
m_plugin->changeVerticesSelectionMode(view, map, LOCKED, true);
}
}
......@@ -105,7 +105,7 @@ void SurfaceDeformationDockTab::selectHandleVertices(bool b)
{
View* view = m_window->getCurrentView();
MapHandlerGen* map = m_currentParams->selectedMap;
m_plugin->changeVerticesSelectionMode(view, map, HANDLE);
m_plugin->changeVerticesSelectionMode(view, map, HANDLE, 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