GEOS 3.13.1
NodeSections.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 <vector>
19#include <memory>
20#include <geos/operation/relateng/NodeSection.h>
21#include <geos/export.h>
22
23
24// Forward declarations
25namespace geos {
26namespace operation {
27namespace relateng {
28class RelateNode;
29// class NodeSection;
30}
31}
32namespace geom {
33 class CoordinateXY;
34 class Geometry;
35}
36}
37
38
39using geos::geom::CoordinateXY;
41
42
43namespace geos { // geos.
44namespace operation { // geos.operation
45namespace relateng { // geos.operation.relateng
46
47
48class GEOS_DLL NodeSections {
49
50private:
51
52 // Members
53 const CoordinateXY* nodePt;
54 std::vector<std::unique_ptr<NodeSection>> sections;
55
56 // Methods
57
63 void prepareSections();
64
65 static bool hasMultiplePolygonSections(
66 std::vector<std::unique_ptr<NodeSection>>& sections,
67 std::size_t i);
68
69 static std::vector<const NodeSection*> collectPolygonSections(
70 std::vector<std::unique_ptr<NodeSection>>& sections,
71 std::size_t i);
72
73
74public:
75
76 NodeSections(const CoordinateXY* pt)
77 : nodePt(pt)
78 {};
79
80 const CoordinateXY* getCoordinate() const;
81
82 void addNodeSection(NodeSection* e);
83
84 bool hasInteractionAB() const;
85
86 const Geometry* getPolygonal(bool isA) const;
87
88 std::unique_ptr<RelateNode> createNode();
89
94 NodeSections(const NodeSections&) = delete;
95 NodeSections& operator=(const NodeSections&) = delete;
96
97};
98
99} // namespace geos.operation.relateng
100} // namespace geos.operation
101} // namespace geos
102
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Basic namespace for all GEOS functionalities.
Definition geos.h:39