GEOS 3.11.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#pragma once
20
21#include <cstddef>
22#include <geos/export.h>
23
24// Forward declarations
25namespace geos {
26namespace geom {
27class Envelope;
28}
29namespace index {
30class SpatialIndex;
31}
32namespace noding {
33class SegmentString;
34namespace snapround {
35class HotPixel;
36}
37}
38}
39
40namespace geos {
41namespace noding { // geos::noding
42namespace snapround { // geos::noding::snapround
43
49class GEOS_DLL MCIndexPointSnapper {
50
51public:
52
53
55 :
56 index(nIndex)
57 {}
58
71 bool snap(HotPixel& hotPixel, SegmentString* parentEdge,
72 std::size_t vertexIndex);
73
74 bool
75 snap(HotPixel& hotPixel)
76 {
77 return snap(hotPixel, nullptr, 0);
78 }
79
80 geom::Envelope getSafeEnvelope(const HotPixel& hp) const;
81
82
83private:
84
85 static constexpr double SAFE_ENV_EXPANSION_FACTOR = 0.75;
86
88
89 // Declare type as noncopyable
90 MCIndexPointSnapper(const MCIndexPointSnapper& other) = delete;
91 MCIndexPointSnapper& operator=(const MCIndexPointSnapper& rhs) = delete;
92};
93
94
95} // namespace geos::noding::snapround
96} // namespace geos::noding
97} // namespace geos
98
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:46
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:45
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition: HotPixel.h:61
"Snaps" all SegmentStrings in a SpatialIndex containing MonotoneChains to a given HotPixel.
Definition: MCIndexPointSnapper.h:49
bool snap(HotPixel &hotPixel, SegmentString *parentEdge, std::size_t vertexIndex)
Snaps (nodes) all interacting segments to this hot pixel.
Basic namespace for all GEOS functionalities.
Definition: geos.h:39