GEOS  3.14.0dev
TaggedLinesSimplifier.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************
14  *
15  * Last port: simplify/TaggedLinesSimplifier.java rev. 1.4 (JTS-1.7.1)
16  *
17  **********************************************************************
18  *
19  * NOTES: changed from JTS design adding a private
20  * TaggedLineStringSimplifier member and making
21  * simplify(collection) method become a templated
22  * function.
23  *
24  **********************************************************************/
25 
26 #pragma once
27 
28 #include <geos/export.h>
29 #include <vector>
30 #include <memory>
31 #include <cassert>
32 
33 #include <geos/simplify/LineSegmentIndex.h> // for templated function body
34 #include <geos/simplify/TaggedLineStringSimplifier.h>
35 
36 #ifdef _MSC_VER
37 #pragma warning(push)
38 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
39 #endif
40 
41 // Forward declarations
42 namespace geos {
43 namespace simplify {
44 class TaggedLineString;
45 }
46 }
47 
48 namespace geos {
49 namespace simplify { // geos::simplify
50 
55 class GEOS_DLL TaggedLinesSimplifier {
56 
57 public:
58 
60 
69  void setDistanceTolerance(double tolerance);
70 
71  void simplify(std::vector<TaggedLineString*>& tlsVector);
72 
73 private:
74 
75  std::unique_ptr<LineSegmentIndex> inputIndex;
76 
77  std::unique_ptr<LineSegmentIndex> outputIndex;
78 
79  double distanceTolerance;
80 };
81 
82 } // namespace geos::simplify
83 } // namespace geos
84 
85 #ifdef _MSC_VER
86 #pragma warning(pop)
87 #endif
88 
Simplifies a collection of TaggedLineStrings, preserving topology (in the sense that no new intersect...
Definition: TaggedLinesSimplifier.h:55
void setDistanceTolerance(double tolerance)
Sets the distance tolerance for the simplification.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25