diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 17ec86d1207..9db867b1a6e 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1493,6 +1493,7 @@ void MainWindow::showSceneContextMenu(int selectedItemIndex, } } menu->addMenu(ui->menuOperations); + if(menu) menu->exec(global_pos); } @@ -1755,6 +1756,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) { QAction* saveas = menu.addAction(tr("&Save as...")); connect(saveas, SIGNAL(triggered()), this, SLOT(on_actionSaveAs_triggered())); + menu.addMenu(ui->menuOperations); menu.exec(sender->mapToGlobal(p)); return; } @@ -2189,7 +2191,7 @@ void MainWindow::on_actionShowHide_triggered() item->redraw(); } scene->setUpdatesEnabled(true); - updateViewersBboxes(false); +// updateViewersBboxes(false); //Not usable :when the scene changes scale, smaller items disappear. } void MainWindow::on_actionSetPolyhedronA_triggered() diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp index 269eb121ae4..4d92aeb7867 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Basic_generator_plugin.cpp @@ -766,7 +766,7 @@ struct Point_generator { return Point(bl.x() + i*(ur.x()-bl.x())/(w-1), bl.y() + j*(ur.y()-bl.y())/(h-1), - 0); + bl.z() + j*(ur.z()-bl.z())/(h-1)); } }; template diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp index 265507b8a9c..6d2d062e002 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp @@ -223,8 +223,8 @@ void Polyhedron_demo_orient_soup_plugin::apply_shuffle( Item* root_item, item->load(root_item); item->shuffle_orientations(); item->setColor(root_item->color()); - scene->replaceItem(index, item); - delete root_item; + scene->replaceItem(index, item, true); + root_item->deleteLater(); QApplication::restoreOverrideCursor(); } diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 5425285d9ed..4730d595adb 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -143,6 +143,7 @@ Scene::replaceItem(Scene::Item_id index, CGAL::Three::Scene_item* item, bool emi if(emit_item_about_to_be_destroyed) { Q_EMIT itemAboutToBeDestroyed(item); + item->aboutToBeDestroyed(); } Q_EMIT updated(); diff --git a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp index 9ad4cfa9dc2..2c383d3b8ed 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_c3t3_item.cpp @@ -1453,6 +1453,7 @@ void Scene_c3t3_item_priv::computeElements() } positions_poly.clear(); + positions_grid.clear(); normals.clear(); f_colors.clear(); positions_lines.clear();