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