GEOS 3.14.0dev
PolygonNodeConverter.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/operation/relateng/NodeSection.h>
19#include <geos/export.h>
20#include <vector>
21#include <memory>
22
23// Forward declarations
24namespace geos {
25namespace operation {
26namespace relateng {
27// class NodeSection;
28}
29}
30}
31
32
33// using geos::geom::CoordinateXY;
34// using geos::geom::Geometry;
35
36
37namespace geos { // geos.
38namespace operation { // geos.operation
39namespace relateng { // geos.operation.relateng
40
66class GEOS_DLL PolygonNodeConverter {
67 using CoordinateXY = geos::geom::CoordinateXY;
68
69public:
70
79 static std::vector<std::unique_ptr<NodeSection>> convert(
80 std::vector<const NodeSection*>& polySections);
81
82
83private:
84
85 static std::size_t convertShellAndHoles(
86 std::vector<const NodeSection*>& sections,
87 std::size_t shellIndex,
88 std::vector<std::unique_ptr<NodeSection>>& convertedSections);
89
90 static std::vector<std::unique_ptr<NodeSection>> convertHoles(
91 std::vector<const NodeSection*>& sections);
92
93 static NodeSection* createSection(
94 const NodeSection* ns,
95 const CoordinateXY* v0,
96 const CoordinateXY* v1);
97
98 static std::vector<const NodeSection*> extractUnique(
99 std::vector<const NodeSection*>& sections);
100
101 static std::size_t next(
102 std::vector<const NodeSection *>& ns, std::size_t i);
103
104 static std::size_t findShell(
105 std::vector<const NodeSection *>& polySections);
106
107
108};
109
110} // namespace geos.operation.relateng
111} // namespace geos.operation
112} // namespace geos
113
Definition NodeSection.h:50
Definition PolygonNodeConverter.h:66
static std::vector< std::unique_ptr< NodeSection > > convert(std::vector< const NodeSection * > &polySections)
Basic namespace for all GEOS functionalities.
Definition geos.h:39