GEOS  3.13.0dev
Densifier.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2010 Sandro Santilli <strk@kbt.io>
7  * Copyright (C) 2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: operation/polygonize/Polygonizer.java rev. 1.6 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 #pragma once
22 
23 #include <geos/export.h>
24 #include <geos/geom/Geometry.h>
25 #include <geos/geom/util/GeometryTransformer.h>
26 #include <geos/geom/util/Densifier.h>
27 #include <geos/util/Interrupt.h>
28 
29 #include <vector>
30 
31 #ifdef _MSC_VER
32 #pragma warning(push)
33 /* warning C4251: needs to have dll-interface to be used by */
34 /* clients of class */
35 #pragma warning(disable: 4251)
36 #endif
37 
38 
39 namespace geos {
40 namespace geom {
41 namespace util {
42 
57 class GEOS_DLL Densifier {
58 public:
59  Densifier(const Geometry* inputGeom);
60 
61  static Geometry::Ptr densify(const Geometry* geom, double distanceTolerance);
62  void setDistanceTolerance(double distanceTolerance);
63  Geometry::Ptr getResultGeometry() const;
64 
65 private:
66  double distanceTolerance;
67  const Geometry* inputGeom;
68  static std::unique_ptr<CoordinateSequence> densifyPoints(const CoordinateSequence& pts, double distanceTolerance,
69  const PrecisionModel* precModel);
70 
71  class GEOS_DLL DensifyTransformer: public GeometryTransformer {
72  public:
73  DensifyTransformer(double distanceTolerance);
74  double distanceTolerance;
75  CoordinateSequence::Ptr transformCoordinates(const CoordinateSequence* coords, const Geometry* parent) override;
76  Geometry::Ptr transformPolygon(const Polygon* geom, const Geometry* parent) override;
77  Geometry::Ptr transformMultiPolygon(const MultiPolygon* geom, const Geometry* parent) override;
78  Geometry::Ptr createValidArea(const Geometry* roughAreaGeom);
79  };
80 
81 }; // Densifier
82 
83 } // namespace geos.geom.util
84 } // namespace geos.geom
85 } // namespace geos
86 
87 #ifdef _MSC_VER
88 #pragma warning(pop)
89 #endif
90 
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
std::unique_ptr< Geometry > Ptr
An unique_ptr of Geometry.
Definition: Geometry.h:199
Definition: MultiPolygon.h:58
Represents a linear polygon, which may include holes.
Definition: Polygon.h:60
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:88
Definition: Densifier.h:57
A framework for processes which transform an input Geometry into an output Geometry,...
Definition: GeometryTransformer.h:88
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25