From 3fe1de5e6add6dd58eecf8d46fcd1666937b6783 Mon Sep 17 00:00:00 2001 From: dbaston Date: Wed, 26 Jun 2024 21:09:46 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20libgeos/?= =?UTF-8?q?geos@3db005a65baf5fb53a3d2078c30dd7d365115b5e=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doxygen/LineIntersector_8h_source.html | 86 +++++++++++++++----------- 1 file changed, 49 insertions(+), 37 deletions(-) diff --git a/doxygen/LineIntersector_8h_source.html b/doxygen/LineIntersector_8h_source.html index b3f8368540..41ec14baa8 100644 --- a/doxygen/LineIntersector_8h_source.html +++ b/doxygen/LineIntersector_8h_source.html @@ -460,51 +460,63 @@
589  {
590  geom::CoordinateXYZM ptInt(Intersection::intersection(p1, p2, q1, q2));
591  if (ptInt.isNull()) {
-
592  // FIXME need to cast to correct type in mixed-dimensionality case
-
593  ptInt = static_cast<const C1&>(nearestEndpoint(p1, p2, q1, q2));
-
594  }
-
595  return ptInt;
-
596  }
-
597 
-
617  static const geom::CoordinateXY& nearestEndpoint(const geom::CoordinateXY& p1,
-
618  const geom::CoordinateXY& p2,
-
619  const geom::CoordinateXY& q1,
-
620  const geom::CoordinateXY& q2);
-
621 
-
622 
-
623  template<typename C1, typename C2>
-
624  static geom::CoordinateXYZM zmGetOrInterpolateCopy(
-
625  const C1& p,
-
626  const C2& p1,
-
627  const C2& p2)
-
628  {
-
629  geom::CoordinateXYZM pCopy(p);
-
630  pCopy.z = Interpolate::zGetOrInterpolate(p, p1, p2);
-
631  pCopy.m = Interpolate::mGetOrInterpolate(p, p1, p2);
-
632  return pCopy;
-
633  }
+
592  const geom::CoordinateXY& nearest = nearestEndpoint(p1, p2, q1, q2);
+
593 #if __cplusplus >= 201703L
+
594  if constexpr (std::is_same<C1, C2>::value) {
+
595 #else
+
596  if (std::is_same<C1, C2>::value) {
+
597 #endif
+
598  ptInt = static_cast<const C1&>(nearest);
+
599  } else {
+
600  if (&nearest == static_cast<const geom::CoordinateXY*>(&p1) || &nearest == static_cast<const geom::CoordinateXY*>(&p2)) {
+
601  ptInt = static_cast<const C1&>(nearest);
+
602  } else {
+
603  ptInt = static_cast<const C2&>(nearest);
+
604  }
+
605  }
+
606  }
+
607  return ptInt;
+
608  }
+
609 
+
629  static const geom::CoordinateXY& nearestEndpoint(const geom::CoordinateXY& p1,
+
630  const geom::CoordinateXY& p2,
+
631  const geom::CoordinateXY& q1,
+
632  const geom::CoordinateXY& q2);
+
633 
634 
-
635 };
-
636 
-
637 
-
638 } // namespace geos::algorithm
-
639 } // namespace geos
-
640 
-
641 
-
642 
-
643 
-
644 
-
645 
+
635  template<typename C1, typename C2>
+
636  static geom::CoordinateXYZM zmGetOrInterpolateCopy(
+
637  const C1& p,
+
638  const C2& p1,
+
639  const C2& p2)
+
640  {
+
641  geom::CoordinateXYZM pCopy(p);
+
642  pCopy.z = Interpolate::zGetOrInterpolate(p, p1, p2);
+
643  pCopy.m = Interpolate::mGetOrInterpolate(p, p1, p2);
+
644  return pCopy;
+
645  }
646 
-
647 
+
647 };
648 
649 
-
650 
-
651 
+
650 } // namespace geos::algorithm
+
651 } // namespace geos
652 
653 
654 
655 
+
656 
+
657 
+
658 
+
659 
+
660 
+
661 
+
662 
+
663 
+
664 
+
665 
+
666 
+
667 
static geom::CoordinateXY intersection(const geom::CoordinateXY &p1, const geom::CoordinateXY &p2, const geom::CoordinateXY &q1, const geom::CoordinateXY &q2)
Computes the intersection point of two lines. If the lines are parallel or collinear this case is det...
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:53
intersection_type
Definition: LineIntersector.h:137