• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 
5 // This file was modified by Oracle on 2013, 2014, 2015, 2017.
6 // Modifications copyright (c) 2013-2017 Oracle and/or its affiliates.
7 
8 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9 
10 // Use, modification and distribution is subject to the Boost Software License,
11 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
12 // http://www.boost.org/LICENSE_1_0.txt)
13 
14 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP
15 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP
16 
17 
18 #include <boost/geometry/core/tags.hpp>
19 
20 #include <boost/geometry/algorithms/detail/relate/interface.hpp>
21 
22 #include <boost/geometry/algorithms/detail/relate/point_point.hpp>
23 #include <boost/geometry/algorithms/detail/relate/point_geometry.hpp>
24 #include <boost/geometry/algorithms/detail/relate/linear_linear.hpp>
25 #include <boost/geometry/algorithms/detail/relate/linear_areal.hpp>
26 #include <boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp>
27 #include <boost/geometry/algorithms/detail/relate/areal_areal.hpp>
28 
29 #include <boost/geometry/strategies/intersection.hpp>
30 #include <boost/geometry/strategies/within.hpp>
31 
32 
33 namespace boost { namespace geometry {
34 
35 
36 #ifndef DOXYGEN_NO_DISPATCH
37 namespace dispatch {
38 
39 template <typename Point1, typename Point2>
40 struct relate<Point1, Point2, point_tag, point_tag, 0, 0, false>
41     : detail::relate::point_point<Point1, Point2>
42 {};
43 
44 template <typename Point, typename MultiPoint>
45 struct relate<Point, MultiPoint, point_tag, multi_point_tag, 0, 0, false>
46     : detail::relate::point_multipoint<Point, MultiPoint>
47 {};
48 
49 template <typename MultiPoint, typename Point>
50 struct relate<MultiPoint, Point, multi_point_tag, point_tag, 0, 0, false>
51     : detail::relate::multipoint_point<MultiPoint, Point>
52 {};
53 
54 template <typename MultiPoint1, typename MultiPoint2>
55 struct relate<MultiPoint1, MultiPoint2, multi_point_tag, multi_point_tag, 0, 0, false>
56     : detail::relate::multipoint_multipoint<MultiPoint1, MultiPoint2>
57 {};
58 
59 // TODO - for now commented out because before implementing it we must consider:
60 // 1. how the Box degenerated to a Point should be treated
61 // 2. what should be the definition of a Box degenerated to a Point
62 // 3. what fields should the matrix/mask contain for dimension > 2 and dimension > 9
63 //
64 //template <typename Point, typename Box, int TopDim2>
65 //struct relate<Point, Box, point_tag, box_tag, 0, TopDim2, false>
66 //    : detail::relate::point_box<Point, Box>
67 //{};
68 //
69 //template <typename Box, typename Point, int TopDim1>
70 //struct relate<Box, Point, box_tag, point_tag, TopDim1, 0, false>
71 //    : detail::relate::box_point<Box, Point>
72 //{};
73 
74 
75 template <typename Point, typename Geometry, typename Tag2, int TopDim2>
76 struct relate<Point, Geometry, point_tag, Tag2, 0, TopDim2, true>
77     : detail::relate::point_geometry<Point, Geometry>
78 {};
79 
80 template <typename Geometry, typename Point, typename Tag1, int TopDim1>
81 struct relate<Geometry, Point, Tag1, point_tag, TopDim1, 0, true>
82     : detail::relate::geometry_point<Geometry, Point>
83 {};
84 
85 template <typename MultiPoint, typename Geometry, typename Tag2, int TopDim2>
86 struct relate<MultiPoint, Geometry, multi_point_tag, Tag2, 0, TopDim2, false>
87     : detail::relate::multi_point_geometry<MultiPoint, Geometry>
88 {};
89 
90 template <typename Geometry, typename MultiPoint, typename Tag1, int TopDim1>
91 struct relate<Geometry, MultiPoint, Tag1, multi_point_tag, TopDim1, 0, false>
92     : detail::relate::geometry_multi_point<Geometry, MultiPoint>
93 {};
94 
95 
96 template <typename Linear1, typename Linear2, typename Tag1, typename Tag2>
97 struct relate<Linear1, Linear2, Tag1, Tag2, 1, 1, true>
98     : detail::relate::linear_linear<Linear1, Linear2>
99 {};
100 
101 
102 template <typename Linear, typename Areal, typename Tag1, typename Tag2>
103 struct relate<Linear, Areal, Tag1, Tag2, 1, 2, true>
104     : detail::relate::linear_areal<Linear, Areal>
105 {};
106 
107 template <typename Areal, typename Linear, typename Tag1, typename Tag2>
108 struct relate<Areal, Linear, Tag1, Tag2, 2, 1, true>
109     : detail::relate::areal_linear<Areal, Linear>
110 {};
111 
112 
113 template <typename Areal1, typename Areal2, typename Tag1, typename Tag2>
114 struct relate<Areal1, Areal2, Tag1, Tag2, 2, 2, true>
115     : detail::relate::areal_areal<Areal1, Areal2>
116 {};
117 
118 } // namespace dispatch
119 #endif // DOXYGEN_NO_DISPATCH
120 
121 
122 }} // namespace boost::geometry
123 
124 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_IMPLEMENTATION_HPP
125