From d1afc52902028530e06ae88e248c35c6baef13ff Mon Sep 17 00:00:00 2001 From: Efi Fogel Date: Sat, 25 Oct 2025 10:52:25 +0300 Subject: [PATCH] Cleaned up and removed unused variables and types --- .../Arrangement_on_surface_2/draw_arr.cpp | 32 +++++++++++-------- .../Arrangement_2/Arrangement_zone_2_impl.h | 14 ++++---- .../Draw_aos/Arr_bounded_approximate_face.h | 2 +- .../include/CGAL/Draw_aos/Arr_viewer.h | 2 +- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp index a04cff18de3..8d6b73e0df8 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/draw_arr.cpp @@ -29,27 +29,33 @@ std::tuple hsv_to_rgb(float hue, fl red = fc; green = fx; blue = 0; - } else if(1 <= hue_prime && hue_prime < 2) { + } + else if(1 <= hue_prime && hue_prime < 2) { red = fx; green = fc; blue = 0; - } else if(2 <= hue_prime && hue_prime < 3) { + } + else if(2 <= hue_prime && hue_prime < 3) { red = 0; green = fc; blue = fx; - } else if(3 <= hue_prime && hue_prime < 4) { + } + else if(3 <= hue_prime && hue_prime < 4) { red = 0; green = fx; blue = fc; - } else if(4 <= hue_prime && hue_prime < 5) { + } + else if(4 <= hue_prime && hue_prime < 5) { red = fx; green = 0; blue = fc; - } else if(5 <= hue_prime && hue_prime < 6) { + } + else if(5 <= hue_prime && hue_prime < 6) { red = fc; green = 0; blue = fx; - } else { + } + else { red = 0; green = 0; blue = 0; @@ -127,7 +133,7 @@ void draw_nested() { { // a hexagon centered at the origin const double r = 10.0; - for(int i = 0; i < 6; ++i) { + for (int i = 0; i < 6; ++i) { int next = (i + 1) % 6; Point source(r * cos(i * CGAL_PI / 3), r * sin(i * CGAL_PI / 3)); Point target(r * cos(next * CGAL_PI / 3), r * sin(next * CGAL_PI / 3)); @@ -165,30 +171,28 @@ void draw_unbounded_linear_grid() { using Traits = CGAL::Arr_linear_traits_2; using Point = Traits::Point_2; using Segment = Traits::Segment_2; - using Ray = Traits::Ray_2; using Line = Traits::Line_2; using X_monotone_curve = Traits::X_monotone_curve_2; using Arrangement = CGAL::Arrangement_2; Arrangement arr; - auto& traits = *arr.traits(); // Insert a n*n grid int n = 5; - for(int i = 0; i < n; ++i) { + for (int i = 0; i < n; ++i) { Point p1(i * 5, 0); Point p2(i * 5, 1); CGAL::insert(arr, X_monotone_curve(Line(p1, p2))); } - for(int i = 0; i < n; ++i) { + for (int i = 0; i < n; ++i) { Point p1(0, i * 5); Point p2(1, i * 5); CGAL::insert(arr, X_monotone_curve(Line(p1, p2))); } // Generate a inner square(2*2) for all cells // And an inner triangle for each square - for(int i = 0; i < n; ++i) { - for(int j = 0; j < n; ++j) { + for (int i = 0; i < n; ++i) { + for (int j = 0; j < n; ++j) { Point p1(i * 5 + 1, j * 5 + 1); Point p2(i * 5 + 4, j * 5 + 4); CGAL::insert(arr, X_monotone_curve(Segment(p1, Point(p2.x(), p1.y())))); @@ -224,7 +228,7 @@ void draw_random_segments(int n) { CGAL::Random random; std::vector curves; - for(int i = 0; i < n; ++i) { + for (int i = 0; i < n; ++i) { double x1 = random.get_double(-100, 100); double y1 = random.get_double(-100, 100); double x2 = random.get_double(-100, 100); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h index 6bb9ddb1c6f..379a83b321f 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h @@ -788,21 +788,21 @@ _is_to_right_impl(const Point_2& p, Halfedge_handle he, return (m_geom_traits->compare_xy_2_object()(p, v_right->point()) == LARGER); } -//! checks whether an point lies to the left of another point. +//! checks whether a point lies to the left of another point. template bool Arrangement_zone_2:: -is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, - const Point_2& p2, Arr_parameter_space ps2, +is_to_left_impl(const Point_2& p1, Arr_parameter_space /* ps1 */, + const Point_2& p2, Arr_parameter_space /* ps2 */, Arr_all_sides_oblivious_tag) const { auto cmp_xy = m_geom_traits->compare_xy_2_object(); return (cmp_xy(p2, p1) == SMALLER); } -//! checks whether an point lies to the left of another point. +//! checks whether a point lies to the left of another point. template bool Arrangement_zone_2:: -is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, - const Point_2& p2, Arr_parameter_space ps2, +is_to_left_impl(const Point_2& p1, Arr_parameter_space /* ps1 */, + const Point_2& p2, Arr_parameter_space /* ps2 */, Arr_has_identified_side_tag) const { auto is_on_y_ident = m_geom_traits->is_on_y_identification_2_object(); if (is_on_y_ident(p1)) { @@ -817,7 +817,7 @@ is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, return (cmp_xy(p2, p1) == SMALLER); } -//! checks whether an point lies to the left of another point. +//! checks whether a point lies to the left of another point. template bool Arrangement_zone_2:: is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, diff --git a/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_bounded_approximate_face.h b/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_bounded_approximate_face.h index c3aaaf68e55..f986c9065fe 100644 --- a/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_bounded_approximate_face.h +++ b/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_bounded_approximate_face.h @@ -175,7 +175,7 @@ private: return Polyline{}; } - void approximate_vertex(Context& ctx, const Vertex_const_handle& vh) const { + void approximate_vertex(Context& /* ctx */, const Vertex_const_handle& vh) const { if (vh->is_at_open_boundary()) return; m_bounded_approx_vertex(vh); } diff --git a/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_viewer.h b/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_viewer.h index a3829c7f19e..3ed066c8515 100644 --- a/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_viewer.h +++ b/Arrangement_on_surface_2/include/CGAL/Draw_aos/Arr_viewer.h @@ -169,7 +169,7 @@ protected: Bbox_2 arr_bbox() const { return Bbox_2(0, 0, 2 * CGAL_PI, CGAL_PI); } - Bbox_2 screen_to_world(const Camera& cam) const { return Bbox_2(0, 0, 2 * CGAL_PI, CGAL_PI); } + Bbox_2 screen_to_world(const Camera& /* cam */) const { return Bbox_2(0, 0, 2 * CGAL_PI, CGAL_PI); } void fit_camera(const Bbox_2&, Camera& cam) { using Vec = qglviewer::Vec;