From 425f58fdfb0839a12477070e6d701e24d8c5130b Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Fri, 31 Aug 2012 10:03:52 +0200 Subject: [PATCH] Removes more cruft from skyline.cc and skyline.hh. --- lily/include/skyline.hh | 1 - lily/skyline.cc | 54 ----------------------------------------- 2 files changed, 55 deletions(-) diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index eca597f891..e6cd030627 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -47,7 +47,6 @@ struct Building void leading_part (Real chop); bool conceals (Building const &other, Real x) const; Real shift_to_intersect (Real x, Real y) const; - Interval overlapping_shift_interval (Building const &other) const; }; class Skyline diff --git a/lily/skyline.cc b/lily/skyline.cc index f062c00b6c..3501d311ac 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -161,60 +161,6 @@ Building::shift_to_intersect (Real x, Real y) const return infinity_f; } -// Returns the interval of horizontal shifts for which this -// building (pointing up) overlaps the other building (pointing down). -Interval -Building::overlapping_shift_interval (Building const &other) const -{ - Interval iv; - - // If one building is empty, there will never be an overlap. - if (y_intercept_ == -infinity_f || other.y_intercept_ == -infinity_f) - return iv; - - // There are two kinds of interesting positions: - // - when the horizontal extents of the buildings just touch - // - when an endpoint of one building intersects the roof of the other. - // The interval we are looking for is the smallest one that - // contains all of the interesting points. - - - Real my_y1 = height (start_); - Real my_y2 = height (end_); - Real his_y1 = -other.height (other.start_); // "-" because OTHER points down - Real his_y2 = -other.height (other.end_); - - // If both buildings are infinite in the same direction, - // the return value is either empty or full. - if ((isinf (start_) && isinf (other.start_)) - || (isinf (end_) && isinf (other.end_))) - return (y_intercept_ > other.y_intercept_) - ? Interval (-infinity_f, infinity_f) : Interval (); - - // ...when the horizontal extents of the buildings just touch... - if (my_y1 >= his_y2) - iv.add_point (other.end_ - start_); - if (my_y2 >= his_y1) - iv.add_point (other.start_ - end_); - - // ...when an endpoint of one building intersects the roof of the other. - Real p1 = shift_to_intersect (other.start_, his_y1); - Real p2 = shift_to_intersect (other.end_, his_y2); - // "-my_y1" because OTHER points down: - Real p3 = other.shift_to_intersect (start_, -my_y1); - Real p4 = other.shift_to_intersect (end_, -my_y2); - if (!isinf (p1)) - iv.add_point (p1); - if (!isinf (p2)) - iv.add_point (p2); - if (!isinf (p3)) - iv.add_point (p3); - if (!isinf (p4)) - iv.add_point (p4); - - return iv; -} - static Real first_intersection (Building const &b, list *const s, Real start_x) { -- 2.39.2