// Boost.Geometry // Copyright (c) 2019, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef BOOST_GEOMETRY_TEST_CS_UNDEFINED_TEST_RELOPS_HPP #define BOOST_GEOMETRY_TEST_CS_UNDEFINED_TEST_RELOPS_HPP #include "common.hpp" #include #include #include #include #include #include #include #include #include #include template < typename G1, typename G2, std::size_t Dim1 = bg::topological_dimension::value, std::size_t Dim2 = bg::topological_dimension::value > struct call_equals { template static void apply(G1 const& g1, G2 const& g2, S const& s) {} }; template struct call_equals { template static void apply(G1 const& g1, G2 const& g2, S const& s) { bg::equals(g1, g2, s); } }; template < typename G1, typename G2, std::size_t Dim1 = bg::topological_dimension::value, std::size_t Dim2 = bg::topological_dimension::value > struct call_overlaps { template static void apply(G1 const& g1, G2 const& g2, S const& s) {} }; template struct call_overlaps { template static void apply(G1 const& g1, G2 const& g2, S const& s) { bg::overlaps(g1, g2, s); } }; template < typename G1, typename G2, std::size_t Dim1 = bg::topological_dimension::value, std::size_t Dim2 = bg::topological_dimension::value > struct call_touches { template static void apply(G1 const& g1, G2 const& g2, S const& s) { bg::touches(g1, g2, s); } }; template struct call_touches { template static void apply(G1 const& g1, G2 const& g2, S const& s) {} }; template < typename G1, typename G2, std::size_t Dim1 = bg::topological_dimension::value, std::size_t Dim2 = bg::topological_dimension::value > struct call_crosses { template static void apply(G1 const& g1, G2 const& g2, S const& s) { bg::crosses(g1, g2, s); } }; template struct call_crosses { template static void apply(G1 const& g1, G2 const& g2, S const& s) {} }; template struct call_crosses { template static void apply(G1 const& g1, G2 const& g2, S const& s) {} }; template inline void rel(G1 const& g1, G2 const& g2, S const& s) { bg::relation(g1, g2, s); bg::relate(g1, g2, bg::de9im::mask("*********"), s); bg::covered_by(g1, g2, s); call_crosses::apply(g1, g2, s); bg::disjoint(g1, g2, s); call_equals::apply(g1, g2, s); bg::intersects(g1, g2, s); call_overlaps::apply(g1, g2, s); call_touches::apply(g1, g2, s); bg::within(g1, g2, s); } template inline void rel_pp(G1 const& g1, G2 const& g2) { ::rel(g1, g2, bg::strategy::within::cartesian_point_point()); ::rel(g1, g2, bg::strategy::within::spherical_point_point()); } template inline void rel_ps(G1 const& g1, G2 const& g2) { typedef typename bg::point_type::type point; ::rel(g1, g2, bg::strategy::within::cartesian_winding()); ::rel(g1, g2, bg::strategy::within::spherical_winding()); ::rel(g1, g2, bg::strategy::within::geographic_winding()); } template inline void rel_ss(G1 const& g1, G2 const& g2) { ::rel(g1, g2, bg::strategy::intersection::cartesian_segments<>()); ::rel(g1, g2, bg::strategy::intersection::spherical_segments<>()); ::rel(g1, g2, bg::strategy::intersection::geographic_segments<>()); } #endif // BOOST_GEOMETRY_TEST_CS_UNDEFINED_TEST_RELOPS_HPP