diff options
Diffstat (limited to 'boost/geometry/strategies/buffer.hpp')
-rw-r--r-- | boost/geometry/strategies/buffer.hpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/boost/geometry/strategies/buffer.hpp b/boost/geometry/strategies/buffer.hpp index 86bdcc37bf..b03c9bc626 100644 --- a/boost/geometry/strategies/buffer.hpp +++ b/boost/geometry/strategies/buffer.hpp @@ -6,8 +6,10 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_HPP -#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_HPP +#ifndef BOOST_GEOMETRY_STRATEGIES_BUFFER_HPP +#define BOOST_GEOMETRY_STRATEGIES_BUFFER_HPP + +#include <cstdint> namespace boost { namespace geometry { @@ -55,6 +57,27 @@ namespace strategy { namespace buffer */ enum buffer_side_selector { buffer_side_left, buffer_side_right }; +// Default number of points in a circle +constexpr std::size_t default_points_per_circle = 90u; + +inline std::size_t get_point_count_for_join(std::size_t count) +{ + std::size_t const min_count = 4u; + return count > min_count ? count : min_count; +} + +inline std::size_t get_point_count_for_end(std::size_t count) +{ + std::size_t const min_count = 4u; + return count > min_count ? count : min_count; +} + +inline std::size_t get_point_count_for_circle(std::size_t count) +{ + std::size_t const min_count = 3u; + return count > min_count ? count : min_count; +} + /*! \brief Enumerates types of pieces (parts of buffer) around geometries \ingroup enum @@ -67,6 +90,7 @@ enum piece_type buffered_flat_end, buffered_point, buffered_concave, // always on the inside + buffered_empty_side, // for one-sided buffers piece_type_unknown }; @@ -100,4 +124,4 @@ enum result_code }} // namespace boost::geometry -#endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_HPP +#endif // BOOST_GEOMETRY_STRATEGIES_BUFFER_HPP |