Merge remote-tracking branch 'refs/remotes/lrineau/Triangulation_3-CDT_3-lrineau' into Triangulation_3-CDT_3-lrineau

This commit is contained in:
Laurent Rineau 2025-06-16 17:14:32 +02:00
commit 2be776e74f
3 changed files with 31 additions and 3 deletions

View File

@ -103,12 +103,11 @@ Delaunay triangulation constructed from a PLC.
\cgalFigureAnchor{CT_3_plc2cdt_fig}
<center>
<img src="plc_to_cdt.png" style="max-width:90%;"/>
<img src="plc_to_cdt.png" style="max-width:70%;"/>
</center>
\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

View File

@ -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);

View File

@ -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);