GEOS 3.13.1
CoverageBoundarySegmentFinder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#pragma once
16
17#include <unordered_set>
18
19#include <geos/geom/CoordinateSequenceFilter.h>
20#include <geos/geom/Coordinate.h>
21#include <geos/geom/LineSegment.h>
22#include <geos/export.h>
23
24namespace geos {
25namespace geom {
27class Geometry;
28}
29}
30
36
37namespace geos {
38namespace coverage { // geos::coverage
39
40class CoverageBoundarySegmentFinder : public CoordinateSequenceFilter
41{
42
43
44public:
45
46 CoverageBoundarySegmentFinder(LineSegment::UnorderedSet& segs)
47 : m_boundarySegs(segs)
48 {};
49
50 bool isGeometryChanged() const override {
51 return false;
52 }
53
54 bool isDone() const override {
55 return false;
56 }
57
58 void filter_ro(const CoordinateSequence& seq, std::size_t i) override;
59
60
61 static LineSegment::UnorderedSet
62 findBoundarySegments(const std::vector<const Geometry*>& geoms);
63
64 static bool isBoundarySegment(
65 const LineSegment::UnorderedSet& boundarySegs,
66 const CoordinateSequence* seq,
67 std::size_t i);
68
69private:
70
71 static LineSegment
72 createSegment(const CoordinateSequence& seq, std::size_t i);
73
74
75 LineSegment::UnorderedSet& m_boundarySegs;
76
77
78}; // CoverageBoundarySegmentFinder
79
80
81
82} // geos::coverage
83} // geos
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition CoordinateSequenceFilter.h:55
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Definition LineSegment.h:61
Basic namespace for all GEOS functionalities.
Definition geos.h:39