/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (c) 2024 Martin Davis * Copyright (C) 2024 Paul Ramsey * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * **********************************************************************/ #pragma once #include #include #include // Forward declarations namespace geos { namespace geom { class Geometry; class Envelope; } namespace noding { class SegmentString; } namespace operation { namespace relateng { class RelateSegmentString; class EdgeSegmentIntersector; } } } using geos::geom::Envelope; using geos::geom::Geometry; using geos::index::strtree::TemplateSTRtree; using geos::index::chain::MonotoneChain; using geos::operation::relateng::EdgeSegmentIntersector; namespace geos { // geos. namespace operation { // geos.operation namespace relateng { // geos.operation.relateng class GEOS_DLL EdgeSetIntersector { private: // Members TemplateSTRtree index; // HPRtree index = new HPRtree(); const Envelope* envelope = nullptr; std::deque monoChains; std::size_t overlapCounter = 0; // Methods void addToIndex(const SegmentString* segStr); void addEdges(std::vector& segStrings); public: EdgeSetIntersector( std::vector& edgesA, std::vector& edgesB, const Envelope* env) : envelope(env) { addEdges(edgesA); addEdges(edgesB); // build index to ensure thread-safety // index.build(); }; void process(EdgeSegmentIntersector& intersector); }; } // namespace geos.operation.relateng } // namespace geos.operation } // namespace geos