From d2d114cf2473839693d0aba3cef6408d6c7affe9 Mon Sep 17 00:00:00 2001 From: Guillaume Damiand Date: Mon, 20 Nov 2023 09:33:28 +0100 Subject: [PATCH] Update code to follow last api --- Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp | 2 +- .../examples/Basic_viewer/draw_surface_mesh_small_faces.cpp | 2 +- Basic_viewer/include/CGAL/Graphics_scene.h | 6 +++--- Basic_viewer/include/CGAL/Qt/Basic_viewer.h | 4 ++-- Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h | 2 +- Nef_3/include/CGAL/draw_nef_3.h | 2 +- .../include/CGAL/draw_periodic_2_triangulation_2.h | 2 +- Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp index 945680df147..e1680f30ecc 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_several_windows.cpp @@ -71,7 +71,7 @@ int main(void) CGAL::Qt::Basic_viewer bv1(mainWindow, scene1); CGAL::Qt::Basic_viewer bv2(mainWindow, scene2); - bv1.set_draw_vertices(true); + bv1.draw_vertices(true); layout->addWidget(&bv1); layout->addWidget(&bv2); diff --git a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp index aba2a0e1b03..555363d7271 100644 --- a/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp +++ b/Basic_viewer/examples/Basic_viewer/draw_surface_mesh_small_faces.cpp @@ -106,7 +106,7 @@ int main(int argc, char* argv[]) if(app) { app.basic_viewer().on_key_pressed= - [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Basic_viewer_qt* basic_viewer) -> bool + [&sm, &gsosm, &buffer] (QKeyEvent* e, CGAL::Qt::Basic_viewer* basic_viewer) -> bool { const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_I) && (modifiers == ::Qt::NoButton)) diff --git a/Basic_viewer/include/CGAL/Graphics_scene.h b/Basic_viewer/include/CGAL/Graphics_scene.h index 4caddad0343..fd9b2bd9ed7 100644 --- a/Basic_viewer/include/CGAL/Graphics_scene.h +++ b/Basic_viewer/include/CGAL/Graphics_scene.h @@ -239,7 +239,7 @@ public: void face_begin() { - if (is_a_face_started()) + if (a_face_started()) { std::cerr << "You cannot start a new face before to finish the previous one." @@ -251,7 +251,7 @@ public: void face_begin(const CGAL::IO::Color &acolor) { - if (is_a_face_started()) + if (a_face_started()) { std::cerr << "You cannot start a new face before to finish the previous one." @@ -342,7 +342,7 @@ public: // Returns true if the data structure lies on a XY or XZ or YZ plane bool is_two_dimensional() const { - return (!is_empty() && (has_zero_x() || has_zero_y() || has_zero_z())); + return (!empty() && (has_zero_x() || has_zero_y() || has_zero_z())); } void clear() diff --git a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h index 73cb5a2f9e6..82187ce85ae 100644 --- a/Basic_viewer/include/CGAL/Qt/Basic_viewer.h +++ b/Basic_viewer/include/CGAL/Qt/Basic_viewer.h @@ -155,7 +155,7 @@ public: resize(CGAL_BASIC_VIEWER_INIT_SIZE_X, CGAL_BASIC_VIEWER_INIT_SIZE_Y); if (inverse_normal) - { reverse_normals(); } + { reverse_all_normals(); } } ~Basic_viewer() @@ -1254,7 +1254,7 @@ protected: } else if ((e->key()==::Qt::Key_N) && (modifiers==::Qt::NoButton)) { - reverse_normals(); + reverse_all_normals(); displayMessage(QString("Inverse normal=%1.").arg(m_inverse_normal?"true":"false")); redraw(); } diff --git a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h index d95561e83e0..0d83d0a4a52 100644 --- a/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h +++ b/Boolean_set_operations_2/include/CGAL/draw_polygon_set_2.h @@ -164,7 +164,7 @@ public: */ virtual void add_elements() { - this->clear(); + graphics_scene.clear(); std::vector pwhs; m_ps.polygons_with_holes(std::back_inserter(pwhs)); for (const auto& pwh : pwhs) diff --git a/Nef_3/include/CGAL/draw_nef_3.h b/Nef_3/include/CGAL/draw_nef_3.h index 452185e26c4..833db0d0188 100644 --- a/Nef_3/include/CGAL/draw_nef_3.h +++ b/Nef_3/include/CGAL/draw_nef_3.h @@ -232,7 +232,7 @@ void compute_elements(const Nef_Polyhedron &nef, { nef.visit_shell_objects(SFace_const_handle(it), V); } } - graphics_scene.negate_all_normals(); + graphics_scene.reverse_all_normals(); } } // namespace draw_function_for_nef_polyhedron diff --git a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h index 7a423e66fae..aca45e789d1 100644 --- a/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/draw_periodic_2_triangulation_2.h @@ -41,7 +41,7 @@ struct Graphics_scene_options_periodic_2_triangulation_2 : { return m_draw_domain; } void set_draw_domain(bool b) { m_draw_domain=b; } - void negate_draw_domain() + void toggle_draw_domain() { m_draw_domain=!m_draw_domain; } typename DS::Iterator_type current_display_type() const diff --git a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h index d7831e8ccdf..831a6681084 100644 --- a/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h +++ b/Voronoi_diagram_2/include/CGAL/draw_voronoi_diagram_2.h @@ -46,12 +46,12 @@ struct Graphics_scene_options_voronoi : void disable_voronoi_vertices() { m_draw_voronoi_vertices=false; } void enable_voronoi_vertices() { m_draw_voronoi_vertices=true; } bool are_voronoi_vertices_enabled() const { return m_draw_voronoi_vertices; } - void negate_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; } + void toggle_draw_voronoi_vertices() { m_draw_voronoi_vertices=!m_draw_voronoi_vertices; } void disable_dual_vertices() { m_draw_dual_vertices=false; } void enable_dual_vertices() { m_draw_dual_vertices=true; } bool are_dual_vertices_enabled() const { return m_draw_dual_vertices; } - void negate_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } + void toggle_draw_dual_vertices() { m_draw_dual_vertices=!m_draw_dual_vertices; } CGAL::IO::Color dual_vertex_color; CGAL::IO::Color ray_color; @@ -394,7 +394,7 @@ void draw(const CGAL_VORONOI_TYPE& av2, const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key() == ::Qt::Key_R) && (modifiers == ::Qt::NoButton)) { - basic_viewer->negate_draw_rays(); + basic_viewer->toggle_draw_rays(); basic_viewer->displayMessage (QString("Draw rays=%1.").arg(basic_viewer->get_draw_rays()?"true":"false"));