MCIndexPointSnapper.h
/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2006 Refractions Research Inc.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Public Licence as published
* by the Free Software Foundation.
* See the COPYING file for more information.
*
**********************************************************************
*
* Last port: noding/snapround/MCIndexPointSnapper.java r486 (JTS-1.12+)
*
**********************************************************************/
#pragma once
#include <cstddef>
#include <geos/export.h>
// Forward declarations
namespace geos {
namespace geom {
class Envelope;
}
namespace index {
class SpatialIndex;
}
namespace noding {
class SegmentString;
namespace snapround {
class HotPixel;
}
}
}
namespace geos {
namespace noding { // geos::noding
namespace snapround { // geos::noding::snapround
class GEOS_DLL MCIndexPointSnapper {
public:
MCIndexPointSnapper(index::SpatialIndex& nIndex)
:
index(nIndex)
{}
bool snap(HotPixel& hotPixel, SegmentString* parentEdge,
std::size_t vertexIndex);
bool
snap(HotPixel& hotPixel)
{
return snap(hotPixel, nullptr, 0);
}
geom::Envelope getSafeEnvelope(const HotPixel& hp) const;
private:
static constexpr double SAFE_ENV_EXPANSION_FACTOR = 0.75;
index::SpatialIndex& index;
// Declare type as noncopyable
MCIndexPointSnapper(const MCIndexPointSnapper& other) = delete;
MCIndexPointSnapper& operator=(const MCIndexPointSnapper& rhs) = delete;
};
} // namespace geos::noding::snapround
} // namespace geos::noding
} // namespace geos
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::index::SpatialIndex
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition SpatialIndex.h:46
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
geos::noding::snapround::HotPixel
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition HotPixel.h:60
geos::noding::snapround::MCIndexPointSnapper
"Snaps" all SegmentStrings in a SpatialIndex containing MonotoneChains to a given HotPixel.
Definition MCIndexPointSnapper.h:49
geos::noding::snapround::MCIndexPointSnapper::snap
bool snap(HotPixel &hotPixel, SegmentString *parentEdge, std::size_t vertexIndex)
Snaps (nodes) all interacting segments to this hot pixel.
geos::geom
Definition Angle.h:26
geos::index
Provides classes for various kinds of spatial indexes.
Definition CleanCoverage.h:39
geos::noding::snapround
Contains classes to implement the Snap Rounding algorithm for noding linestrings.
Definition namespaces.h:175
geos::noding
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition CoverageCleaner.h:42
geos
Basic namespace for all GEOS functionalities.
Definition geos.h:38