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