GEOS  3.9.1dev
HotPixelIndex.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2020 Paul Ramsey <pramsey@cleverelephant.ca>
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 #pragma once
16 
17 #include <geos/export.h>
18 #include <geos/geom/Envelope.h> // for unique_ptr
19 #include <geos/geom/Coordinate.h> // for composition
24 #include <geos/io/WKTWriter.h>
27 
28 #include <array>
29 #include <map>
30 #include <memory>
31 
32 
33 #ifdef _MSC_VER
34 #pragma warning(push)
35 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
36 #endif
37 
38 // Forward declarations
39 namespace geos {
40 namespace algorithm {
41 class LineIntersector;
42 }
43 namespace index {
44 class ItemVisitor;
45 }
46 namespace noding {
47 namespace snapround {
48 class HotPixel;
49 }
50 }
51 }
52 
53 
54 namespace geos {
55 namespace noding { // geos::noding
56 namespace snapround { // geos::noding::snapround
57 
58 
60 
61 private:
62 
63  /* members */
65  double scaleFactor;
66  std::unique_ptr<geos::index::kdtree::KdTree> index;
67  std::deque<HotPixel> hotPixelQue;
68 
69  /* methods */
71  HotPixel* find(const geom::Coordinate& pixelPt);
72 
73 public:
74 
76  HotPixel* add(const geom::Coordinate& pt);
77  void add(const geom::CoordinateSequence* pts);
78  void add(const std::vector<geom::Coordinate>& pts);
79  void addNodes(const geom::CoordinateSequence* pts);
80  void addNodes(const std::vector<geom::Coordinate>& pts);
81 
87  void query(const geom::Coordinate& p0, const geom::Coordinate& p1,
89 
90 };
91 
92 } // namespace geos::noding::snapround
93 } // namespace geos::noding
94 } // namespace geos
95 
96 #ifdef _MSC_VER
97 #pragma warning(pop)
98 #endif
99 
100 
std::deque< HotPixel > hotPixelQue
Definition: HotPixelIndex.h:67
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition: HotPixel.h:63
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Specifies the precision model of the Coordinate in a Geometry.
const geom::PrecisionModel * pm
Definition: HotPixelIndex.h:64
double round(double val)
Definition: math.h:36
Basic namespace for all GEOS functionalities.
std::unique_ptr< geos::index::kdtree::KdTree > index
Definition: HotPixelIndex.h:66
The internal representation of a list of coordinates inside a Geometry.