Cleaned up and removed unused variables and types

This commit is contained in:
Efi Fogel 2025-10-25 10:52:25 +03:00
parent a1b5cd58da
commit d1afc52902
4 changed files with 27 additions and 23 deletions

View File

@ -29,27 +29,33 @@ std::tuple<unsigned char, unsigned char, unsigned char> hsv_to_rgb(float hue, fl
red = fc; red = fc;
green = fx; green = fx;
blue = 0; blue = 0;
} else if(1 <= hue_prime && hue_prime < 2) { }
else if(1 <= hue_prime && hue_prime < 2) {
red = fx; red = fx;
green = fc; green = fc;
blue = 0; blue = 0;
} else if(2 <= hue_prime && hue_prime < 3) { }
else if(2 <= hue_prime && hue_prime < 3) {
red = 0; red = 0;
green = fc; green = fc;
blue = fx; blue = fx;
} else if(3 <= hue_prime && hue_prime < 4) { }
else if(3 <= hue_prime && hue_prime < 4) {
red = 0; red = 0;
green = fx; green = fx;
blue = fc; blue = fc;
} else if(4 <= hue_prime && hue_prime < 5) { }
else if(4 <= hue_prime && hue_prime < 5) {
red = fx; red = fx;
green = 0; green = 0;
blue = fc; blue = fc;
} else if(5 <= hue_prime && hue_prime < 6) { }
else if(5 <= hue_prime && hue_prime < 6) {
red = fc; red = fc;
green = 0; green = 0;
blue = fx; blue = fx;
} else { }
else {
red = 0; red = 0;
green = 0; green = 0;
blue = 0; blue = 0;
@ -127,7 +133,7 @@ void draw_nested() {
{ {
// a hexagon centered at the origin // a hexagon centered at the origin
const double r = 10.0; const double r = 10.0;
for(int i = 0; i < 6; ++i) { for (int i = 0; i < 6; ++i) {
int next = (i + 1) % 6; int next = (i + 1) % 6;
Point source(r * cos(i * CGAL_PI / 3), r * sin(i * CGAL_PI / 3)); 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)); 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<Kernel>; using Traits = CGAL::Arr_linear_traits_2<Kernel>;
using Point = Traits::Point_2; using Point = Traits::Point_2;
using Segment = Traits::Segment_2; using Segment = Traits::Segment_2;
using Ray = Traits::Ray_2;
using Line = Traits::Line_2; using Line = Traits::Line_2;
using X_monotone_curve = Traits::X_monotone_curve_2; using X_monotone_curve = Traits::X_monotone_curve_2;
using Arrangement = CGAL::Arrangement_2<Traits>; using Arrangement = CGAL::Arrangement_2<Traits>;
Arrangement arr; Arrangement arr;
auto& traits = *arr.traits();
// Insert a n*n grid // Insert a n*n grid
int n = 5; int n = 5;
for(int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
Point p1(i * 5, 0); Point p1(i * 5, 0);
Point p2(i * 5, 1); Point p2(i * 5, 1);
CGAL::insert(arr, X_monotone_curve(Line(p1, p2))); 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 p1(0, i * 5);
Point p2(1, i * 5); Point p2(1, i * 5);
CGAL::insert(arr, X_monotone_curve(Line(p1, p2))); CGAL::insert(arr, X_monotone_curve(Line(p1, p2)));
} }
// Generate a inner square(2*2) for all cells // Generate a inner square(2*2) for all cells
// And an inner triangle for each square // And an inner triangle for each square
for(int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
for(int j = 0; j < n; ++j) { for (int j = 0; j < n; ++j) {
Point p1(i * 5 + 1, j * 5 + 1); Point p1(i * 5 + 1, j * 5 + 1);
Point p2(i * 5 + 4, j * 5 + 4); Point p2(i * 5 + 4, j * 5 + 4);
CGAL::insert(arr, X_monotone_curve(Segment(p1, Point(p2.x(), p1.y())))); 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; CGAL::Random random;
std::vector<X_monotone_curve> curves; std::vector<X_monotone_curve> curves;
for(int i = 0; i < n; ++i) { for (int i = 0; i < n; ++i) {
double x1 = random.get_double(-100, 100); double x1 = random.get_double(-100, 100);
double y1 = random.get_double(-100, 100); double y1 = random.get_double(-100, 100);
double x2 = random.get_double(-100, 100); double x2 = random.get_double(-100, 100);

View File

@ -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); 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 <typename Arrangement, typename ZoneVisitor> template <typename Arrangement, typename ZoneVisitor>
bool Arrangement_zone_2<Arrangement, ZoneVisitor>:: bool Arrangement_zone_2<Arrangement, ZoneVisitor>::
is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, is_to_left_impl(const Point_2& p1, Arr_parameter_space /* ps1 */,
const Point_2& p2, Arr_parameter_space ps2, const Point_2& p2, Arr_parameter_space /* ps2 */,
Arr_all_sides_oblivious_tag) const { Arr_all_sides_oblivious_tag) const {
auto cmp_xy = m_geom_traits->compare_xy_2_object(); auto cmp_xy = m_geom_traits->compare_xy_2_object();
return (cmp_xy(p2, p1) == SMALLER); 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 <typename Arrangement, typename ZoneVisitor> template <typename Arrangement, typename ZoneVisitor>
bool Arrangement_zone_2<Arrangement, ZoneVisitor>:: bool Arrangement_zone_2<Arrangement, ZoneVisitor>::
is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, is_to_left_impl(const Point_2& p1, Arr_parameter_space /* ps1 */,
const Point_2& p2, Arr_parameter_space ps2, const Point_2& p2, Arr_parameter_space /* ps2 */,
Arr_has_identified_side_tag) const { Arr_has_identified_side_tag) const {
auto is_on_y_ident = m_geom_traits->is_on_y_identification_2_object(); auto is_on_y_ident = m_geom_traits->is_on_y_identification_2_object();
if (is_on_y_ident(p1)) { 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); 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 <typename Arrangement, typename ZoneVisitor> template <typename Arrangement, typename ZoneVisitor>
bool Arrangement_zone_2<Arrangement, ZoneVisitor>:: bool Arrangement_zone_2<Arrangement, ZoneVisitor>::
is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1, is_to_left_impl(const Point_2& p1, Arr_parameter_space ps1,

View File

@ -175,7 +175,7 @@ private:
return Polyline{}; 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; if (vh->is_at_open_boundary()) return;
m_bounded_approx_vertex(vh); m_bounded_approx_vertex(vh);
} }

View File

@ -169,7 +169,7 @@ protected:
Bbox_2 arr_bbox() const { return Bbox_2(0, 0, 2 * CGAL_PI, CGAL_PI); } 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) { void fit_camera(const Bbox_2&, Camera& cam) {
using Vec = qglviewer::Vec; using Vec = qglviewer::Vec;