Chris@102: // Boost.Geometry Chris@102: Chris@102: // Copyright (c) 2014 Oracle and/or its affiliates. Chris@102: Chris@102: // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle 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_ALGORITHMS_DETAIL_FLATTENING_HPP Chris@102: #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_FLATTENING_HPP Chris@102: Chris@102: #include Chris@102: #include Chris@102: #include Chris@102: Chris@102: #include Chris@102: Chris@102: namespace boost { namespace geometry Chris@102: { Chris@102: Chris@102: #ifndef DOXYGEN_NO_DISPATCH Chris@102: namespace detail_dispatch Chris@102: { Chris@102: Chris@102: template ::type> Chris@102: struct flattening Chris@102: : not_implemented Chris@102: {}; Chris@102: Chris@102: template Chris@102: struct flattening Chris@102: { Chris@102: static inline ResultType apply(Geometry const& /*geometry*/) Chris@102: { Chris@102: return ResultType(0); Chris@102: } Chris@102: }; Chris@102: Chris@102: template Chris@102: struct flattening Chris@102: { Chris@102: static inline ResultType apply(Geometry const& geometry) Chris@102: { Chris@102: return ResultType(get_radius<0>(geometry) - get_radius<2>(geometry)) Chris@102: / ResultType(get_radius<0>(geometry)); Chris@102: } Chris@102: }; Chris@102: Chris@102: } // namespace detail_dispatch Chris@102: #endif // DOXYGEN_NO_DISPATCH Chris@102: Chris@102: #ifndef DOXYGEN_NO_DETAIL Chris@102: namespace detail Chris@102: { Chris@102: Chris@102: template Chris@102: ResultType flattening(Geometry const& geometry) Chris@102: { Chris@102: return detail_dispatch::flattening::apply(geometry); Chris@102: } Chris@102: Chris@102: } // namespace detail Chris@102: #endif // DOXYGEN_NO_DETAIL Chris@102: Chris@102: }} // namespace boost::geometry Chris@102: Chris@102: #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_FLATTENING_HPP