GEOS  3.13.1
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
25 namespace geos {
26 namespace algorithm {
27  class BoundaryNodeRule;
28 }
29 namespace geom {
30  class CoordinateXY;
31  class LineString;
32 }
33 }
34 
35 
38 using geos::geom::CoordinateXY;
40 
41 
42 namespace geos { // geos.
43 namespace operation { // geos.operation
44 namespace relateng { // geos.operation.relateng
45 
46 class GEOS_DLL LinearBoundary {
47 
48 private:
49 
50  // Members
51 
52  Coordinate::ConstIntMap m_vertexDegree;
53  bool m_hasBoundary;
54  const BoundaryNodeRule& m_boundaryNodeRule;
55 
56 
57 public:
58 
59  // Constructors
60 
61  LinearBoundary(std::vector<const LineString*>& lines, const BoundaryNodeRule& bnRule);
62 
63  bool hasBoundary() const;
64 
65  bool isBoundary(const CoordinateXY* pt) const;
66 
67 
68 private:
69 
70  // Methods
71 
72  bool checkBoundary(Coordinate::ConstIntMap& vertexDegree) const;
73 
74  static void computeBoundaryPoints(
75  std::vector<const LineString*>& lines,
76  Coordinate::ConstIntMap& vertexDegree);
77 
78  static void addEndpoint(
79  const CoordinateXY *p,
80  Coordinate::ConstIntMap& vertexDegree);
81 
82 
83 };
84 
85 } // namespace geos.operation.relateng
86 } // namespace geos.operation
87 } // namespace geos
88 
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
std::map< const CoordinateXY *, int, CoordinateLessThan > ConstIntMap
A map of const Coordinate pointers to integers.
Definition: Coordinate.h:238
Definition: LineString.h:66
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25