GEOS 3.14.0dev
LinearBoundary.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (c) 2024 Martin Davis
7 * Copyright (C) 2024 Paul Ramsey <pramsey@cleverelephant.ca>
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18#include <geos/geom/Coordinate.h>
19#include <geos/export.h>
20
21#include <memory>
22#include <vector>
23
24// Forward declarations
25namespace geos {
26namespace algorithm {
27 class BoundaryNodeRule;
28}
29namespace geom {
30 class CoordinateXY;
31 class LineString;
32}
33}
34
35namespace geos { // geos.
36namespace operation { // geos.operation
37namespace relateng { // geos.operation.relateng
38
39class GEOS_DLL LinearBoundary {
40 using BoundaryNodeRule = geos::algorithm::BoundaryNodeRule;
41 using Coordinate = geos::geom::Coordinate;
42 using CoordinateXY = geos::geom::CoordinateXY;
43 using LineString = geos::geom::LineString;
44
45private:
46
47 // Members
48
49 Coordinate::ConstIntMap m_vertexDegree;
50 bool m_hasBoundary;
51 const BoundaryNodeRule& m_boundaryNodeRule;
52
53
54public:
55
56 // Constructors
57
58 LinearBoundary(std::vector<const LineString*>& lines, const BoundaryNodeRule& bnRule);
59
60 bool hasBoundary() const;
61
62 bool isBoundary(const CoordinateXY* pt) const;
63
64
65private:
66
67 // Methods
68
69 bool checkBoundary(Coordinate::ConstIntMap& vertexDegree) const;
70
71 static void computeBoundaryPoints(
72 std::vector<const LineString*>& lines,
73 Coordinate::ConstIntMap& vertexDegree);
74
75 static void addEndpoint(
76 const CoordinateXY *p,
77 Coordinate::ConstIntMap& vertexDegree);
78
79
80};
81
82} // namespace geos.operation.relateng
83} // namespace geos.operation
84} // namespace geos
85
An interface for rules which determine whether node points which are in boundaries of lineal geometry...
Definition BoundaryNodeRule.h:52
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Definition LineString.h:66
Basic namespace for all GEOS functionalities.
Definition geos.h:39