@@ -525,73 +525,6 @@ struct intersection_areal_linear_point
525525};
526526
527527
528- struct tupled_output_tag {};
529-
530-
531- template
532- <
533- typename GeometryOut,
534- bool IsTupled = geometry::detail::is_tupled_range_values<GeometryOut>::value
535- >
536- struct tag
537- : geometry::tag<GeometryOut>
538- {};
539-
540- template <typename GeometryOut>
541- struct tag <GeometryOut, true >
542- {
543- typedef tupled_output_tag type;
544- };
545-
546-
547- template <typename Geometry1, typename Geometry2, typename TupledOut>
548- struct expect_output_p
549- {
550- static const bool is_point_found = geometry::tuples::exists_if
551- <
552- TupledOut, geometry::detail::is_tag_same_as_pred<point_tag>::template pred
553- >::value;
554-
555- BOOST_MPL_ASSERT_MSG
556- (
557- is_point_found, POINTLIKE_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT,
558- (types<Geometry1, Geometry2, TupledOut>)
559- );
560- };
561-
562- template <typename Geometry1, typename Geometry2, typename TupledOut>
563- struct expect_output_pl
564- : expect_output_p<Geometry1, Geometry2, TupledOut>
565- {
566- static const bool is_linestring_found = geometry::tuples::exists_if
567- <
568- TupledOut, geometry::detail::is_tag_same_as_pred<linestring_tag>::template pred
569- >::value;
570-
571- BOOST_MPL_ASSERT_MSG
572- (
573- is_linestring_found, LINEAR_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT,
574- (types<Geometry1, Geometry2, TupledOut>)
575- );
576- };
577-
578- template <typename Geometry1, typename Geometry2, typename TupledOut>
579- struct expect_output_pla
580- : expect_output_pl<Geometry1, Geometry2, TupledOut>
581- {
582- static const bool is_polygon_found = geometry::tuples::exists_if
583- <
584- TupledOut, geometry::detail::is_tag_same_as_pred<polygon_tag>::template pred
585- >::value;
586-
587- BOOST_MPL_ASSERT_MSG
588- (
589- is_polygon_found, AREAL_GEOMETRY_EXPECTED_IN_TUPLED_OUTPUT,
590- (types<Geometry1, Geometry2, TupledOut>)
591- );
592- };
593-
594-
595528}} // namespace detail::intersection
596529#endif // DOXYGEN_NO_DETAIL
597530
@@ -614,7 +547,7 @@ template
614547 // tag dispatching:
615548 typename TagIn1 = typename geometry::tag<Geometry1>::type,
616549 typename TagIn2 = typename geometry::tag<Geometry2>::type,
617- typename TagOut = typename detail::intersection::tag <GeometryOut>::type,
550+ typename TagOut = typename detail::setop_insert_output_tag <GeometryOut>::type,
618551 // metafunction finetuning helpers:
619552 typename CastedTagIn1 = typename geometry::tag_cast<TagIn1, areal_tag, linear_tag, pointlike_tag>::type,
620553 typename CastedTagIn2 = typename geometry::tag_cast<TagIn2, areal_tag, linear_tag, pointlike_tag>::type,
@@ -996,13 +929,21 @@ struct intersection_insert
996929 <
997930 Linear1, Linear2, TupledOut, OverlayType,
998931 Reverse1, Reverse2,
999- TagIn1, TagIn2, detail::intersection:: tupled_output_tag,
1000- linear_tag, linear_tag, detail::intersection:: tupled_output_tag
932+ TagIn1, TagIn2, detail::tupled_output_tag,
933+ linear_tag, linear_tag, detail::tupled_output_tag
1001934 >
1002- // NOTE: This is not fully correct because points can be the result only in
1003- // case of intersection but intersection_insert is called also by difference.
1004- // So this requirement could be relaxed in the future.
1005- : detail::intersection::expect_output_pl<Linear1, Linear2, TupledOut>
935+ : detail::expect_output
936+ <
937+ Linear1, Linear2, TupledOut,
938+ // NOTE: points can be the result only in case of intersection.
939+ typename boost::mpl::if_c
940+ <
941+ (OverlayType == overlay_intersection),
942+ point_tag,
943+ void
944+ >::type,
945+ linestring_tag
946+ >
1006947{
1007948 // NOTE: The order of geometries in TupledOut tuple/pair must correspond to the order
1008949 // iterators in OutputIterators tuple/pair.
@@ -1113,10 +1054,10 @@ struct intersection_insert
11131054 <
11141055 PointLike1, PointLike2, TupledOut, OverlayType,
11151056 Reverse1, Reverse2,
1116- TagIn1, TagIn2, detail::intersection:: tupled_output_tag,
1117- pointlike_tag, pointlike_tag, detail::intersection:: tupled_output_tag
1057+ TagIn1, TagIn2, detail::tupled_output_tag,
1058+ pointlike_tag, pointlike_tag, detail::tupled_output_tag
11181059 >
1119- : detail::intersection::expect_output_p <PointLike1, PointLike2, TupledOut>
1060+ : detail::expect_output <PointLike1, PointLike2, TupledOut, point_tag >
11201061{
11211062 // NOTE: The order of geometries in TupledOut tuple/pair must correspond to the order
11221063 // of iterators in OutputIterators tuple/pair.
@@ -1240,16 +1181,16 @@ struct intersection_insert
12401181 <
12411182 PointLike, Linear, TupledOut, OverlayType,
12421183 Reverse1, Reverse2,
1243- TagIn1, TagIn2, detail::intersection:: tupled_output_tag,
1244- pointlike_tag, linear_tag, detail::intersection:: tupled_output_tag
1184+ TagIn1, TagIn2, detail::tupled_output_tag,
1185+ pointlike_tag, linear_tag, detail::tupled_output_tag
12451186 >
12461187 // Reuse the implementation for PointLike/PointLike.
12471188 : intersection_insert
12481189 <
12491190 PointLike, Linear, TupledOut, OverlayType,
12501191 Reverse1, Reverse2,
1251- TagIn1, TagIn2, detail::intersection:: tupled_output_tag,
1252- pointlike_tag, pointlike_tag, detail::intersection:: tupled_output_tag
1192+ TagIn1, TagIn2, detail::tupled_output_tag,
1193+ pointlike_tag, pointlike_tag, detail::tupled_output_tag
12531194 >
12541195{};
12551196
@@ -1265,8 +1206,8 @@ struct intersection_insert
12651206 <
12661207 Linestring, MultiPoint, TupledOut, overlay_intersection,
12671208 Reverse1, Reverse2,
1268- linestring_tag, multi_point_tag, detail::intersection:: tupled_output_tag,
1269- linear_tag, pointlike_tag, detail::intersection:: tupled_output_tag
1209+ linestring_tag, multi_point_tag, detail::tupled_output_tag,
1210+ linear_tag, pointlike_tag, detail::tupled_output_tag
12701211 >
12711212{
12721213 template <typename RobustPolicy, typename OutputIterators, typename Strategy>
@@ -1368,16 +1309,16 @@ struct intersection_insert
13681309 <
13691310 PointLike, Areal, TupledOut, OverlayType,
13701311 Reverse1, Reverse2,
1371- TagIn1, TagIn2, detail::intersection:: tupled_output_tag,
1372- pointlike_tag, areal_tag, detail::intersection:: tupled_output_tag
1312+ TagIn1, TagIn2, detail::tupled_output_tag,
1313+ pointlike_tag, areal_tag, detail::tupled_output_tag
13731314 >
13741315 // Reuse the implementation for PointLike/PointLike.
13751316 : intersection_insert
13761317 <
13771318 PointLike, Areal, TupledOut, OverlayType,
13781319 Reverse1, Reverse2,
1379- TagIn1, TagIn2, detail::intersection:: tupled_output_tag,
1380- pointlike_tag, pointlike_tag, detail::intersection:: tupled_output_tag
1320+ TagIn1, TagIn2, detail::tupled_output_tag,
1321+ pointlike_tag, pointlike_tag, detail::tupled_output_tag
13811322 >
13821323{};
13831324
@@ -1394,8 +1335,8 @@ struct intersection_insert
13941335 <
13951336 Areal, MultiPoint, TupledOut, overlay_intersection,
13961337 Reverse1, Reverse2,
1397- TagIn1, multi_point_tag, detail::intersection:: tupled_output_tag,
1398- areal_tag, pointlike_tag, detail::intersection:: tupled_output_tag
1338+ TagIn1, multi_point_tag, detail::tupled_output_tag,
1339+ areal_tag, pointlike_tag, detail::tupled_output_tag
13991340 >
14001341{
14011342 template <typename RobustPolicy, typename OutputIterators, typename Strategy>
@@ -1426,8 +1367,8 @@ struct intersection_insert
14261367 TupledOut,
14271368 OverlayType,
14281369 ReverseLinestring, ReversePolygon,
1429- linestring_tag, polygon_tag, detail::intersection:: tupled_output_tag,
1430- linear_tag, areal_tag, detail::intersection:: tupled_output_tag
1370+ linestring_tag, polygon_tag, detail::tupled_output_tag,
1371+ linear_tag, areal_tag, detail::tupled_output_tag
14311372 > : detail::intersection::intersection_of_linestring_with_areal
14321373 <
14331374 ReversePolygon,
@@ -1450,8 +1391,8 @@ struct intersection_insert
14501391 TupledOut,
14511392 OverlayType,
14521393 ReverseLinestring, ReverseRing,
1453- linestring_tag, ring_tag, detail::intersection:: tupled_output_tag,
1454- linear_tag, areal_tag, detail::intersection:: tupled_output_tag
1394+ linestring_tag, ring_tag, detail::tupled_output_tag,
1395+ linear_tag, areal_tag, detail::tupled_output_tag
14551396 > : detail::intersection::intersection_of_linestring_with_areal
14561397 <
14571398 ReverseRing,
0 commit comments