mirror of https://github.com/CGAL/cgal
Merge pull request #4218 from maxGimeno/Demo-Fixes-GF
CGAL 3D Demo: Some more fixes
This commit is contained in:
commit
883b3e3d0d
|
|
@ -196,6 +196,11 @@ Polyhedron_demo_c3t3_binary_io_plugin::
|
||||||
save(QFileInfo fileinfo, QList<Scene_item *> &items)
|
save(QFileInfo fileinfo, QList<Scene_item *> &items)
|
||||||
{
|
{
|
||||||
Scene_item* item = items.front();
|
Scene_item* item = items.front();
|
||||||
|
if(!qobject_cast<Scene_c3t3_item*>(item)->is_valid())
|
||||||
|
{
|
||||||
|
QMessageBox::warning(CGAL::Three::Three::mainWindow(), "", "The c3t3_item is not valid. You cannot save it.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const Scene_c3t3_item* c3t3_item = qobject_cast<const Scene_c3t3_item*>(item);
|
const Scene_c3t3_item* c3t3_item = qobject_cast<const Scene_c3t3_item*>(item);
|
||||||
if ( NULL == c3t3_item )
|
if ( NULL == c3t3_item )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -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)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1354,8 +1354,8 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
QOpenGLShaderProgram* program = declare_program(name,
|
QOpenGLShaderProgram* program = declare_program(name,
|
||||||
":/cgal/Polyhedron_3/resources/solid_wireframe_shader.vert",
|
":/cgal/Polyhedron_3/resources/no_interpolation_shader.vert",
|
||||||
":/cgal/Polyhedron_3/resources/solid_wireframe_shader.frag");
|
":/cgal/Polyhedron_3/resources/no_interpolation_shader.frag");
|
||||||
program->setProperty("hasLight", true);
|
program->setProperty("hasLight", true);
|
||||||
program->setProperty("hasNormals", true);
|
program->setProperty("hasNormals", true);
|
||||||
program->setProperty("drawLinesAdjacency", true);
|
program->setProperty("drawLinesAdjacency", true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue