GEOS  3.8.0dev
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
28 namespace geos {
29 namespace index {
30 class SpatialIndex;
31 }
32 namespace noding {
33 class SegmentString;
34 namespace snapround {
35 class HotPixel;
36 }
37 }
38 }
39 
40 namespace geos {
41 namespace noding { // geos::noding
42 namespace snapround { // geos::noding::snapround
43 
49 class GEOS_DLL MCIndexPointSnapper {
50 
51 public:
52 
53 
55  :
56  index(nIndex)
57  {}
58 
71  bool snap(HotPixel& hotPixel, SegmentString* parentEdge,
72  size_t vertexIndex);
73 
74  bool
75  snap(HotPixel& hotPixel)
76  {
77  return snap(hotPixel, nullptr, 0);
78  }
79 
80 
81 private:
82 
83  index::SpatialIndex& index;
84 
85  // Declare type as noncopyable
86  MCIndexPointSnapper(const MCIndexPointSnapper& other) = delete;
87  MCIndexPointSnapper& operator=(const MCIndexPointSnapper& rhs) = delete;
88 };
89 
90 
91 } // namespace geos::noding::snapround
92 } // namespace geos::noding
93 } // namespace geos
94 
95 #endif // GEOS_NODING_SNAPROUND_MCINDEXPOINTSNAPPER_H
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition: HotPixel.h:62
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
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
"Snaps" all SegmentStrings in a SpatialIndex containing MonotoneChains to a given HotPixel...
Definition: MCIndexPointSnapper.h:49