-Real
-Skyline_pair::left () const
-{
- return min (skylines_[UP].left (), skylines_[DOWN].left ());
-}
-
-Real
-Skyline_pair::right () const
-{
- return max (skylines_[UP].right (), skylines_[DOWN].right ());
-}
-
-// This function comes with the same caveats as smallest_shift:
-// if the skylines are not contiguous, we may report false
-// intersections.
-bool
-Skyline_pair::intersects (Skyline_pair const &other) const
-{
- return skylines_[UP].distance (other[DOWN]) > 0
- && other[UP].distance (skylines_[DOWN]) > 0;
-}
-
-Real
-Skyline_pair::smallest_shift (Skyline_pair const &other, Direction d,
- Real h_pad, Real v_pad)
-{
- // If skylines_[UP] avoids other[DOWN] or skylines_[DOWN] avoids
- // other[UP] then we will not intersect.
- // Note that this is not guaranteed to return the smallest shift
- // if one Skyline_pair is not connected: the smallest_shift left
- // in the case of
- // AAA
- // BBBBBB
- // AAA
- // will result in
- // AAA
- // BBBBBB
- // AAA
- // even though the originals did not collide. If it becomes necessary,
- // this case could be handled by splitting the Skyline_pairs up into
- // their connected components.
-
- return d * min (d * skylines_[UP].smallest_shift (other[DOWN], d, h_pad, v_pad),
- d * skylines_[DOWN].smallest_shift (other[UP], d, h_pad, v_pad));
-}
-