GEOS  3.9.1dev
MCIndexPointSnapper.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) 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
28 namespace geos {
29 namespace geom {
30 class Envelope;
31 }
32 namespace index {
33 class SpatialIndex;
34 }
35 namespace noding {
36 class SegmentString;
37 namespace snapround {
38 class HotPixel;
39 }
40 }
41 }
42 
43 namespace geos {
44 namespace noding { // geos::noding
45 namespace snapround { // geos::noding::snapround
46 
53 
54 public:
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 
86 private:
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
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition: HotPixel.h:63
#define GEOS_DLL
Definition: export.h:28
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition: SpatialIndex.h:47
MCIndexPointSnapper(index::SpatialIndex &nIndex)
Basic namespace for all GEOS functionalities.
"Snaps" all SegmentStrings in a SpatialIndex containing MonotoneChains to a given HotPixel...