annotate DEPENDENCIES/generic/include/boost/geometry/algorithms/detail/flattening.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents f46d142149f5
children
rev   line source
Chris@102 1 // Boost.Geometry
Chris@102 2
Chris@102 3 // Copyright (c) 2014 Oracle and/or its affiliates.
Chris@102 4
Chris@102 5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
Chris@102 6
Chris@102 7 // Use, modification and distribution is subject to the Boost Software License,
Chris@102 8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@102 9 // http://www.boost.org/LICENSE_1_0.txt)
Chris@102 10
Chris@102 11 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_FLATTENING_HPP
Chris@102 12 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_FLATTENING_HPP
Chris@102 13
Chris@102 14 #include <boost/geometry/core/radius.hpp>
Chris@102 15 #include <boost/geometry/core/tag.hpp>
Chris@102 16 #include <boost/geometry/core/tags.hpp>
Chris@102 17
Chris@102 18 #include <boost/geometry/algorithms/not_implemented.hpp>
Chris@102 19
Chris@102 20 namespace boost { namespace geometry
Chris@102 21 {
Chris@102 22
Chris@102 23 #ifndef DOXYGEN_NO_DISPATCH
Chris@102 24 namespace detail_dispatch
Chris@102 25 {
Chris@102 26
Chris@102 27 template <typename ResultType, typename Geometry, typename Tag = typename tag<Geometry>::type>
Chris@102 28 struct flattening
Chris@102 29 : not_implemented<Tag>
Chris@102 30 {};
Chris@102 31
Chris@102 32 template <typename ResultType, typename Geometry>
Chris@102 33 struct flattening<ResultType, Geometry, srs_sphere_tag>
Chris@102 34 {
Chris@102 35 static inline ResultType apply(Geometry const& /*geometry*/)
Chris@102 36 {
Chris@102 37 return ResultType(0);
Chris@102 38 }
Chris@102 39 };
Chris@102 40
Chris@102 41 template <typename ResultType, typename Geometry>
Chris@102 42 struct flattening<ResultType, Geometry, srs_spheroid_tag>
Chris@102 43 {
Chris@102 44 static inline ResultType apply(Geometry const& geometry)
Chris@102 45 {
Chris@102 46 return ResultType(get_radius<0>(geometry) - get_radius<2>(geometry))
Chris@102 47 / ResultType(get_radius<0>(geometry));
Chris@102 48 }
Chris@102 49 };
Chris@102 50
Chris@102 51 } // namespace detail_dispatch
Chris@102 52 #endif // DOXYGEN_NO_DISPATCH
Chris@102 53
Chris@102 54 #ifndef DOXYGEN_NO_DETAIL
Chris@102 55 namespace detail
Chris@102 56 {
Chris@102 57
Chris@102 58 template <typename ResultType, typename Geometry>
Chris@102 59 ResultType flattening(Geometry const& geometry)
Chris@102 60 {
Chris@102 61 return detail_dispatch::flattening<ResultType, Geometry>::apply(geometry);
Chris@102 62 }
Chris@102 63
Chris@102 64 } // namespace detail
Chris@102 65 #endif // DOXYGEN_NO_DETAIL
Chris@102 66
Chris@102 67 }} // namespace boost::geometry
Chris@102 68
Chris@102 69 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_FLATTENING_HPP