GEOS 3.11.1
HotPixelIndex.h
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
20#include <geos/algorithm/LineIntersector.h>
21#include <geos/noding/snapround/HotPixel.h>
22#include <geos/geom/PrecisionModel.h>
23#include <geos/util/IllegalArgumentException.h>
24#include <geos/io/WKTWriter.h>
25#include <geos/index/kdtree/KdTree.h>
26#include <geos/index/kdtree/KdNodeVisitor.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
39namespace geos {
40namespace algorithm {
41class LineIntersector;
42}
43namespace index {
44class ItemVisitor;
45}
46namespace noding {
47namespace snapround {
48class HotPixel;
49}
50}
51}
52
53
54namespace geos {
55namespace noding { // geos::noding
56namespace snapround { // geos::noding::snapround
57
58
59class GEOS_DLL HotPixelIndex {
60
61private:
62
63 /* members */
64 const geom::PrecisionModel* pm;
65 double scaleFactor;
66 std::unique_ptr<geos::index::kdtree::KdTree> index;
67 std::deque<HotPixel> hotPixelQue;
68
69 /* methods */
70 geom::Coordinate round(const geom::Coordinate& c);
71 HotPixel* find(const geom::Coordinate& pixelPt);
72
73public:
74
75 HotPixelIndex(const geom::PrecisionModel* p_pm);
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,
88 index::kdtree::KdNodeVisitor& visitor);
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
double round(double val)
Definition: math.h:36
Basic namespace for all GEOS functionalities.
Definition: geos.h:39