GEOS 3.9.1
MCIndexPointSnapper.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 Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: noding/snapround/MCIndexPointSnapper.java r486 (JTS-1.12+)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_NODING_SNAPROUND_MCINDEXPOINTSNAPPER_H
20#define GEOS_NODING_SNAPROUND_MCINDEXPOINTSNAPPER_H
21
22#include <cstddef>
23#include <geos/export.h>
24
25#include <geos/inline.h>
26
27// Forward declarations
28namespace geos {
29namespace geom {
30class Envelope;
31}
32namespace index {
33class SpatialIndex;
34}
35namespace noding {
36class SegmentString;
37namespace snapround {
38class HotPixel;
39}
40}
41}
42
43namespace geos {
44namespace noding { // geos::noding
45namespace snapround { // geos::noding::snapround
46
52class GEOS_DLL MCIndexPointSnapper {
53
54public:
55
56
58 :
59 index(nIndex)
60 {}
61
74 bool snap(HotPixel& hotPixel, SegmentString* parentEdge,
75 size_t vertexIndex);
76
77 bool
78 snap(HotPixel& hotPixel)
79 {
80 return snap(hotPixel, nullptr, 0);
81 }
82
83 geom::Envelope getSafeEnvelope(const HotPixel& hp) const;
84
85
86private:
87
88 static constexpr double SAFE_ENV_EXPANSION_FACTOR = 0.75;
89
91
92 // Declare type as noncopyable
93 MCIndexPointSnapper(const MCIndexPointSnapper& other) = delete;
94 MCIndexPointSnapper& operator=(const MCIndexPointSnapper& rhs) = delete;
95};
96
97
98} // namespace geos::noding::snapround
99} // namespace geos::noding
100} // namespace geos
101
102#endif // GEOS_NODING_SNAPROUND_MCINDEXPOINTSNAPPER_H
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:58
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition SpatialIndex.h:47
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition HotPixel.h:63
"Snaps" all SegmentStrings in a SpatialIndex containing MonotoneChains to a given HotPixel.
Definition MCIndexPointSnapper.h:52
bool snap(HotPixel &hotPixel, SegmentString *parentEdge, size_t vertexIndex)
Snaps (nodes) all interacting segments to this hot pixel.
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26