// Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // This file was modified by Oracle on 2013, 2014. // Modifications copyright (c) 2013-2014 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RELATE_HPP #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace relate { // Those are used only to allow dispatch::relate to produce compile-time error template ::type> struct is_supported_by_generic { static const bool value = boost::is_same::value || boost::is_same::value || boost::is_same::value || boost::is_same::value || boost::is_same::value; }; template ::type, typename Tag2 = typename geometry::tag::type> struct is_generic { static const bool value = is_supported_by_generic::value && is_supported_by_generic::value; }; template struct is_generic { static const bool value = is_supported_by_generic::value; }; template struct is_generic { static const bool value = is_supported_by_generic::value; }; template struct is_generic { static const bool value = false; }; }} // namespace detail::relate #ifndef DOXYGEN_NO_DISPATCH namespace detail_dispatch { namespace relate { template ::type, typename Tag2 = typename geometry::tag::type, int TopDim1 = geometry::topological_dimension::value, int TopDim2 = geometry::topological_dimension::value, bool IsGeneric = detail::relate::is_generic::value > struct relate : not_implemented {}; template struct relate : detail::relate::point_point {}; template struct relate : detail::relate::point_multipoint {}; template struct relate : detail::relate::multipoint_point {}; template struct relate : detail::relate::multipoint_multipoint {}; //template //struct relate // : detail::relate::point_box //{}; // //template //struct relate // : detail::relate::box_point //{}; template struct relate : detail::relate::point_geometry {}; template struct relate : detail::relate::geometry_point {}; template struct relate : detail::relate::linear_linear {}; template struct relate : detail::relate::linear_areal {}; template struct relate : detail::relate::areal_linear {}; template struct relate : detail::relate::areal_areal {}; }} // namespace detail_dispatch::relate #endif // DOXYGEN_NO_DISPATCH namespace detail { namespace relate { template struct interruption_enabled { static const bool value = detail_dispatch::relate::relate::interruption_enabled; }; template ::value> struct result_handler_type : not_implemented {}; template struct result_handler_type { typedef matrix_handler type; }; template struct result_handler_type { typedef mask_handler < mask9, interruption_enabled < Geometry1, Geometry2 >::value > type; }; template struct result_handler_type, false> { typedef mask_handler < boost::tuples::cons, interruption_enabled < Geometry1, Geometry2 >::value > type; }; template struct result_handler_type, false> { typedef static_mask_handler < static_mask, interruption_enabled < Geometry1, Geometry2 >::value > type; }; template struct result_handler_type { typedef static_mask_handler < StaticSequence, interruption_enabled < Geometry1, Geometry2 >::value > type; }; template inline typename result_handler_type < Geometry1, Geometry2, MatrixOrMask >::type::result_type relate(Geometry1 const& geometry1, Geometry2 const& geometry2, MatrixOrMask const& matrix_or_mask = MatrixOrMask()) { typedef typename result_handler_type < Geometry1, Geometry2, MatrixOrMask >::type handler_type; handler_type handler(matrix_or_mask); detail_dispatch::relate::relate::apply(geometry1, geometry2, handler); return handler.result(); } struct implemented_tag {}; template