GEOS 3.15.0dev
GeometryNoder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2012 Sandro Santilli <strk@kbt.io>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * NOTE: this is not in JTS. JTS has a snapround/GeometryNoder though
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22#include <geos/noding/SegmentString.h> // for NonConstVect
23
24#include <memory> // for unique_ptr
25
26// Forward declarations
27namespace geos {
28namespace algorithm {
29class CircularArcIntersector;
30}
31namespace geom {
32class Geometry;
33}
34namespace noding {
35class ArcIntersectionAdder;
36class Noder;
37}
38}
39
40namespace geos {
41namespace noding { // geos.noding
42
43class GEOS_DLL GeometryNoder {
44public:
45
46 static std::unique_ptr<geom::Geometry> node(const geom::Geometry& geom);
47
48 static std::unique_ptr<geom::Geometry> node(const geom::Geometry& geom1, const geom::Geometry& geom2);
49
50 GeometryNoder(const geom::Geometry& g);
51
52 GeometryNoder(const geom::Geometry& g1, const geom::Geometry& g2);
53
54 ~GeometryNoder();
55
56 std::unique_ptr<geom::Geometry> getNoded();
57
58 void setOnlyFirstGeomEdges(bool onlyFirstGeomEdges);
59
60 // Declare type as noncopyable
61 GeometryNoder(GeometryNoder const&) = delete;
62 GeometryNoder& operator=(GeometryNoder const&) = delete;
63
64private:
65
66 const geom::Geometry* argGeom1;
67 const geom::Geometry* argGeom2;
68 const bool argGeomHasCurves;
69 bool onlyFirstGeomEdges;
70
71 std::unique_ptr<Noder> noder;
72 std::unique_ptr<algorithm::CircularArcIntersector> m_cai;
73 std::unique_ptr<ArcIntersectionAdder> m_aia;
74
75 static void extractPathStrings(const geom::Geometry& g,
76 std::vector<std::unique_ptr<PathString>>& to);
77
78 Noder& getNoder();
79
80 std::unique_ptr<geom::Geometry> toGeometry(std::vector<std::unique_ptr<PathString>>& noded) const;
81
82};
83
84} // namespace geos.noding
85} // namespace geos
86
Basic namespace for all GEOS functionalities.
Definition geos.h:38