From 57742e5a37710457279fd9ce548df75652de05df Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 16 Jun 2025 16:21:03 +0200 Subject: [PATCH 2/3] reset colors and remove screenshot with cutplane --- .../Constrained_triangulation_3.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Constrained_triangulation_3/doc/Constrained_triangulation_3/Constrained_triangulation_3.txt b/Constrained_triangulation_3/doc/Constrained_triangulation_3/Constrained_triangulation_3.txt index 8fe80b225a6..4daa057002e 100644 --- a/Constrained_triangulation_3/doc/Constrained_triangulation_3/Constrained_triangulation_3.txt +++ b/Constrained_triangulation_3/doc/Constrained_triangulation_3/Constrained_triangulation_3.txt @@ -105,12 +105,11 @@ Delaunay triangulation constructed from a PLC. \cgalFigureAnchor{CT_3_plc2cdt_fig}
- +
\cgalFigureCaptionBegin{CT_3_plc2cdt_fig} Left: PLC (360 vertices); -Middle: CCDT (2452 vertices); -Right: the same CCDT seen with cutplane. +Right: CCDT (2452 vertices). \cgalFigureCaptionEnd From d034ff373c96c6ce0ff4a75889bfbc3f0476b8d2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 16 Jun 2025 17:06:53 +0200 Subject: [PATCH 3/3] reset surface patch colors to have the same patch ID everywhere --- Lab/demo/Lab/Scene_c3t3_item.cpp | 28 ++++++++++++++++++++++++++++ Lab/demo/Lab/Scene_c3t3_item.h | 1 + 2 files changed, 29 insertions(+) diff --git a/Lab/demo/Lab/Scene_c3t3_item.cpp b/Lab/demo/Lab/Scene_c3t3_item.cpp index fddd169491d..7e1999643ea 100644 --- a/Lab/demo/Lab/Scene_c3t3_item.cpp +++ b/Lab/demo/Lab/Scene_c3t3_item.cpp @@ -252,6 +252,13 @@ QMenu* Scene_c3t3_item::contextMenu() SIGNAL(triggered()), this, SLOT(export_facets_in_complex())); + QAction* actionResetSurfacePatches = menu->addAction(tr("Reset surface patches")); + actionResetSurfacePatches->setObjectName("actionResetSurfacePatches"); + connect(actionResetSurfacePatches, + SIGNAL(triggered()), + this, + SLOT(reset_surface_patches())); + menu->setProperty(prop_name, true); } return menu; @@ -331,6 +338,27 @@ void Scene_c3t3_item::export_facets_in_complex() this->setVisible(false); } +void Scene_c3t3_item::reset_surface_patches() +{ + if(c3t3().number_of_facets() == 0) + { + CGAL::Three::Three::warning(tr("There are no facets in the complex.")); + return; + } + + const C3t3::Facet first_facet = *c3t3().facets_in_complex_begin(); + const C3t3::Surface_patch_index first_index = c3t3().surface_patch_index(first_facet); + + for(auto f : c3t3().facets_in_complex()) + { + const auto mf = c3t3().triangulation().mirror_facet(f); + f.first->set_surface_patch_index(f.second, first_index); + mf.first->set_surface_patch_index(mf.second, first_index); + } + this->invalidateOpenGLBuffers(); + Q_EMIT itemChanged(); +} + void Scene_c3t3_item::drawEdges(Viewer_interface *viewer) const { Scene_triangulation_3_item::drawEdges(viewer); diff --git a/Lab/demo/Lab/Scene_c3t3_item.h b/Lab/demo/Lab/Scene_c3t3_item.h index d7277681a3d..4eb9f44e850 100644 --- a/Lab/demo/Lab/Scene_c3t3_item.h +++ b/Lab/demo/Lab/Scene_c3t3_item.h @@ -77,6 +77,7 @@ using namespace CGAL::Three; public Q_SLOTS: void show_cnc(bool); void export_facets_in_complex(); + void reset_surface_patches(); void initializeBuffers(Viewer_interface *) const override; void computeElements() const override; void set_sharp_edges_angle(double d);