Chris@102: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@102: Chris@102: // Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. Chris@102: Chris@102: // Use, modification and distribution is subject to the Boost Software License, Chris@102: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_HPP Chris@102: #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_HPP Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: Chris@102: namespace strategy { namespace buffer Chris@102: { Chris@102: Chris@102: /* Chris@102: Chris@102: A Buffer-join strategy gets 4 input points. Chris@102: On the two consecutive segments s1 and s2 (joining at vertex v): Chris@102: Chris@102: The lines from parallel at s1, s2 (at buffer-distance) end/start Chris@102: in two points perpendicular to the segments: p1 and p2. Chris@102: These parallel lines interesct in point ip Chris@102: Chris@102: (s2) Chris@102: | Chris@102: | Chris@102: ^ Chris@102: | Chris@102: (p2) |(v) Chris@102: * +----<--- (s1) Chris@102: Chris@102: x(ip) *(p1) Chris@102: Chris@102: Chris@102: So, in clockwise order: Chris@102: v : vertex point Chris@102: p1: perpendicular on left side of segment1<1> (perp1) Chris@102: ip: intersection point Chris@102: p2: perpendicular on left side of segment2<0> (perp2) Chris@102: */ Chris@102: Chris@102: Chris@102: Chris@102: /*! Chris@102: \brief Enumerates options for side of buffer (left/right w.r.t. directed Chris@102: segment) Chris@102: \ingroup enum Chris@102: \details Around a linestring, a buffer can be defined left or right. Chris@102: Around a polygon, assumed clockwise internally, Chris@102: a buffer is either on the left side (inflates the polygon), or on the Chris@102: right side (deflates the polygon) Chris@102: */ Chris@102: enum buffer_side_selector { buffer_side_left, buffer_side_right }; Chris@102: Chris@102: /*! Chris@102: \brief Enumerates types of pieces (parts of buffer) around geometries Chris@102: \ingroup enum Chris@102: */ Chris@102: enum piece_type Chris@102: { Chris@102: buffered_segment, Chris@102: buffered_join, Chris@102: buffered_round_end, Chris@102: buffered_flat_end, Chris@102: buffered_point, Chris@102: buffered_concave // always on the inside Chris@102: }; Chris@102: Chris@102: Chris@102: /*! Chris@102: \brief Enumerates types of joins Chris@102: \ingroup enum Chris@102: */ Chris@102: enum join_selector Chris@102: { Chris@102: join_convex, Chris@102: join_concave, Chris@102: join_continue, // collinear, next segment touches previous segment Chris@102: join_spike // collinear, with overlap, next segment goes back Chris@102: }; Chris@102: Chris@102: Chris@102: }} // namespace strategy::buffer Chris@102: Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: #endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_HPP