Fix deformation+selection bug

This commit is contained in:
Maxime Gimeno 2019-09-12 13:58:45 +02:00
parent 9383a7607c
commit fc41a09ace
2 changed files with 14 additions and 3 deletions

View File

@ -565,6 +565,10 @@ void Polyhedron_demo_edit_polyhedron_plugin::importSelection(Scene_polyhedron_se
edit_item->insert_roi_vertex(vh); edit_item->insert_roi_vertex(vh);
} }
edit_item->invalidateOpenGLBuffers(); edit_item->invalidateOpenGLBuffers();
if(selection_item->property("is_highlighting").toBool()){
selection_item->setProperty("need_hl_restore", true);
selection_item->set_highlighting(false);
}
selection_item->setVisible(false); selection_item->setVisible(false);
Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool())
v->update(); v->update();
@ -579,14 +583,19 @@ void Polyhedron_demo_edit_polyhedron_plugin::updateSelectionItems(Scene_facegrap
&& sel_item->polyhedron() == target->polyhedron()) && sel_item->polyhedron() == target->polyhedron())
{ {
sel_item->invalidateOpenGLBuffers(); sel_item->invalidateOpenGLBuffers();
if(!ui_widget.RemeshingCheckBox->isChecked()) if(!ui_widget.RemeshingCheckBox->isChecked()){
sel_item->setVisible(true); sel_item->setVisible(true);
if(sel_item->property("need_hl_restore").toBool()){
sel_item->set_highlighting(true);
sel_item->setProperty("need_hl_restore", false);
}
}
else else
scene->erase(scene->item_id(sel_item)); scene->erase(scene->item_id(sel_item));
} }
} }
} }
void Polyhedron_demo_edit_polyhedron_plugin::dispatchAction() void Polyhedron_demo_edit_polyhedron_plugin::dispatchAction()
{ {
if(applicable(actionDeformation)) if(applicable(actionDeformation))

View File

@ -1964,8 +1964,10 @@ void Scene_polyhedron_selection_item::validateMoveVertex()
viewer->setManipulatedFrame(NULL); viewer->setManipulatedFrame(NULL);
invalidateOpenGLBuffers(); invalidateOpenGLBuffers();
poly_item->itemChanged(); poly_item->itemChanged();
if(property("need_hl_restore").toBool()) if(property("need_hl_restore").toBool()){
set_highlighting(true); set_highlighting(true);
setProperty("need_hl_restore", false);
}
Q_EMIT updateInstructions("Select a vertex. (1/2)"); Q_EMIT updateInstructions("Select a vertex. (1/2)");
} }