GEOS  3.4.2
GeometryNoder.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
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 #ifndef GEOS_NODING_GEOMETRYNODER_H
20 #define GEOS_NODING_GEOMETRYNODER_H
21 
22 #include <geos/export.h>
23 #include <geos/noding/SegmentString.h> // for NonConstVect
24 
25 #include <memory> // for auto_ptr
26 
27 // Forward declarations
28 namespace geos {
29  namespace geom {
30  class Geometry;
31  }
32  namespace noding {
33  class Noder;
34  }
35 }
36 
37 namespace geos {
38 namespace noding { // geos.noding
39 
40 class GEOS_DLL GeometryNoder
41 {
42 public:
43 
44  static std::auto_ptr<geom::Geometry> node(const geom::Geometry& geom);
45 
46  GeometryNoder(const geom::Geometry& g);
47 
48  std::auto_ptr<geom::Geometry> getNoded();
49 
50 private:
51 
52  const geom::Geometry& argGeom;
53 
54  SegmentString::NonConstVect lineList;
55 
56  static void extractSegmentStrings(const geom::Geometry& g,
57  SegmentString::NonConstVect& to);
58 
59  Noder& getNoder();
60 
61  std::auto_ptr<Noder> noder;
62 
63  std::auto_ptr<geom::Geometry> toGeometry(SegmentString::NonConstVect& noded);
64 
65  GeometryNoder(GeometryNoder const&); /*= delete*/
66  GeometryNoder& operator=(GeometryNoder const&); /*= delete*/
67 };
68 
69 } // namespace geos.noding
70 } // namespace geos
71 
72 #endif // GEOS_NODING_NODER_H