From 29a4c7ea895da8bb721f1d9342b0a8ef3ad89b2f Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 8 Oct 2024 16:20:06 +0200 Subject: [PATCH] Fixes to make sure each header can be compiled in a standalone way (#1178) Verified with ``find include -name "*.h" -exec g++ -c {} -Iinclude -DUSE_UNSTABLE_GEOS_CPP_API \;`` --- include/geos/edgegraph/MarkHalfEdge.h | 1 + include/geos/geom/prep/PreparedLineStringDistance.h | 3 +++ include/geos/geom/prep/PreparedLineStringNearestPoints.h | 7 +++++++ include/geos/linearref/LocationIndexedLine.h | 1 + include/geos/operation/relateng/EdgeSetIntersector.h | 1 + include/geos/operation/union/CascadedPolygonUnion.h | 2 ++ include/geos/operation/union/PointGeometryUnion.h | 1 + include/geos/triangulate/polygon/PolygonHoleJoiner.h | 1 + include/geos/triangulate/polygon/PolygonNoder.h | 7 +++++++ include/geos/triangulate/tri/TriEdge.h | 9 +-------- 10 files changed, 25 insertions(+), 8 deletions(-) diff --git a/include/geos/edgegraph/MarkHalfEdge.h b/include/geos/edgegraph/MarkHalfEdge.h index 5a73d6d18a..11eaeb9101 100644 --- a/include/geos/edgegraph/MarkHalfEdge.h +++ b/include/geos/edgegraph/MarkHalfEdge.h @@ -16,6 +16,7 @@ #pragma once #include +#include #include #include diff --git a/include/geos/geom/prep/PreparedLineStringDistance.h b/include/geos/geom/prep/PreparedLineStringDistance.h index 89c886d3e8..04ef279582 100644 --- a/include/geos/geom/prep/PreparedLineStringDistance.h +++ b/include/geos/geom/prep/PreparedLineStringDistance.h @@ -21,6 +21,9 @@ namespace geos { namespace geom { // geos::geom + +class Geometry; + namespace prep { // geos::geom::prep class PreparedLineString; diff --git a/include/geos/geom/prep/PreparedLineStringNearestPoints.h b/include/geos/geom/prep/PreparedLineStringNearestPoints.h index d6366ef6a6..82939fa5f7 100644 --- a/include/geos/geom/prep/PreparedLineStringNearestPoints.h +++ b/include/geos/geom/prep/PreparedLineStringNearestPoints.h @@ -19,8 +19,15 @@ #pragma once +#include + +#include + namespace geos { namespace geom { // geos::geom + +class CoordinateSequence; + namespace prep { // geos::geom::prep class PreparedLineStringNearestPoints { diff --git a/include/geos/linearref/LocationIndexedLine.h b/include/geos/linearref/LocationIndexedLine.h index 98af39a3c8..f6035903e7 100644 --- a/include/geos/linearref/LocationIndexedLine.h +++ b/include/geos/linearref/LocationIndexedLine.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/include/geos/operation/relateng/EdgeSetIntersector.h b/include/geos/operation/relateng/EdgeSetIntersector.h index 35028b5bd4..0b59eabc94 100644 --- a/include/geos/operation/relateng/EdgeSetIntersector.h +++ b/include/geos/operation/relateng/EdgeSetIntersector.h @@ -43,6 +43,7 @@ using geos::geom::Envelope; using geos::geom::Geometry; using geos::index::strtree::TemplateSTRtree; using geos::index::chain::MonotoneChain; +using geos::noding::SegmentString; using geos::operation::relateng::EdgeSegmentIntersector; diff --git a/include/geos/operation/union/CascadedPolygonUnion.h b/include/geos/operation/union/CascadedPolygonUnion.h index a89e6fa1c2..2b1e292670 100644 --- a/include/geos/operation/union/CascadedPolygonUnion.h +++ b/include/geos/operation/union/CascadedPolygonUnion.h @@ -20,6 +20,8 @@ #pragma once +#include + #include #include diff --git a/include/geos/operation/union/PointGeometryUnion.h b/include/geos/operation/union/PointGeometryUnion.h index 665c53043b..35d615ebbd 100644 --- a/include/geos/operation/union/PointGeometryUnion.h +++ b/include/geos/operation/union/PointGeometryUnion.h @@ -22,6 +22,7 @@ #include #include +#include // Forward declarations namespace geos { diff --git a/include/geos/triangulate/polygon/PolygonHoleJoiner.h b/include/geos/triangulate/polygon/PolygonHoleJoiner.h index 665b16126b..b65c0c0a04 100644 --- a/include/geos/triangulate/polygon/PolygonHoleJoiner.h +++ b/include/geos/triangulate/polygon/PolygonHoleJoiner.h @@ -31,6 +31,7 @@ namespace geom { class Envelope; class Geometry; class LinearRing; +class Polygon; } namespace noding { } diff --git a/include/geos/triangulate/polygon/PolygonNoder.h b/include/geos/triangulate/polygon/PolygonNoder.h index 44d93877e8..94c3556414 100644 --- a/include/geos/triangulate/polygon/PolygonNoder.h +++ b/include/geos/triangulate/polygon/PolygonNoder.h @@ -18,7 +18,11 @@ // #include //#include +#include + #include +#include +#include // Forward declarations namespace geos { @@ -29,6 +33,9 @@ class CoordinateSequence; namespace noding { class NodedSegmentString; } +namespace algorithm { +class LineIntersector; +} } using geos::geom::Coordinate; diff --git a/include/geos/triangulate/tri/TriEdge.h b/include/geos/triangulate/tri/TriEdge.h index 8058856027..208006449b 100644 --- a/include/geos/triangulate/tri/TriEdge.h +++ b/include/geos/triangulate/tri/TriEdge.h @@ -15,16 +15,9 @@ #pragma once #include +#include #include - -// Forward declarations -namespace geos { -namespace geom { -class Coordinate; -} -} - using geos::geom::Coordinate; namespace geos { // geos.