GEOS 3.14.0dev
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
38namespace geos { // geos.
39namespace operation { // geos.operation
40namespace relateng { // geos.operation.relateng
41
42
43class GEOS_DLL NodeSections {
44 using CoordinateXY = geos::geom::CoordinateXY;
45 using Geometry = geos::geom::Geometry;
46
47private:
48
49 // Members
50 const CoordinateXY* nodePt;
51 std::vector<std::unique_ptr<NodeSection>> sections;
52
53 // Methods
54
60 void prepareSections();
61
62 static bool hasMultiplePolygonSections(
63 std::vector<std::unique_ptr<NodeSection>>& sections,
64 std::size_t i);
65
66 static std::vector<const NodeSection*> collectPolygonSections(
67 std::vector<std::unique_ptr<NodeSection>>& sections,
68 std::size_t i);
69
70
71public:
72
73 NodeSections(const CoordinateXY* pt)
74 : nodePt(pt)
75 {};
76
77 const CoordinateXY* getCoordinate() const;
78
79 void addNodeSection(NodeSection* e);
80
81 bool hasInteractionAB() const;
82
83 const Geometry* getPolygonal(bool isA) const;
84
85 std::unique_ptr<RelateNode> createNode();
86
91 NodeSections(const NodeSections&) = delete;
92 NodeSections& operator=(const NodeSections&) = delete;
93
94};
95
96} // namespace geos.operation.relateng
97} // namespace geos.operation
98} // namespace geos
99
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition Geometry.h:197
Basic namespace for all GEOS functionalities.
Definition geos.h:39