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 geom {
29class Geometry;
30}
31namespace noding {
32class Noder;
33}
34}
35
36namespace geos {
37namespace noding { // geos.noding
38
39class GEOS_DLL GeometryNoder {
40public:
41
42 static std::unique_ptr<geom::Geometry> node(const geom::Geometry& geom);
43
44 GeometryNoder(const geom::Geometry& g);
45
46 ~GeometryNoder();
47
48 std::unique_ptr<geom::Geometry> getNoded();
49
50 // Declare type as noncopyable
51 GeometryNoder(GeometryNoder const&) = delete;
52 GeometryNoder& operator=(GeometryNoder const&) = delete;
53
54private:
55
56 const geom::Geometry& argGeom;
57 const bool argGeomHasCurves;
58
59 static void extractPathStrings(const geom::Geometry& g,
60 std::vector<std::unique_ptr<PathString>>& to);
61
62 Noder& getNoder();
63
64 std::unique_ptr<Noder> noder;
65
66 std::unique_ptr<geom::Geometry> toGeometry(std::vector<std::unique_ptr<PathString>>& noded) const;
67
68};
69
70} // namespace geos.noding
71} // namespace geos
72
Basic namespace for all GEOS functionalities.
Definition geos.h:38