SnapRoundingNoder.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/SnapRoundingNoder.java r320 (JTS-1.12)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <geos/geom/Coordinate.h>
#include <geos/geom/Envelope.h>
#include <geos/noding/snapround/HotPixelIndex.h>
#include <geos/noding/Noder.h>
// Forward declarations
namespace geos {
namespace geom {
class Envelope;
class PrecisionModel;
}
namespace noding {
class NodedSegmentString;
}
}
namespace geos {
namespace noding { // geos::noding
namespace snapround { // geos::noding::snapround
class GEOS_DLL SnapRoundingNoder : public Noder {
private:
static constexpr int INTERSECTION_NEARNESS_FACTOR = 100;
// Members
const geom::PrecisionModel* pm;
noding::snapround::HotPixelIndex pixelIndex;
std::vector<SegmentString*> snappedResult;
// Methods
void snapRound(std::vector<SegmentString*>& inputSegStrings, std::vector<SegmentString*>& resultNodedSegments);
void addVertexPixels(std::vector<SegmentString*>& segStrings);
void addIntersectionPixels(std::vector<SegmentString*>& segStrings);
std::unique_ptr<geom::CoordinateSequence> round(const geom::CoordinateSequence& pts) const;
void computeSnaps(const std::vector<SegmentString*>& segStrings, std::vector<SegmentString*>& snapped);
NodedSegmentString* computeSegmentSnaps(NodedSegmentString* ss);
void snapSegment(const geom::CoordinateXY& p0, const geom::CoordinateXY& p1, NodedSegmentString* ss, std::size_t segIndex);
void addVertexNodeSnaps(NodedSegmentString* ss);
void snapVertexNode(const geom::CoordinateXY& p0, NodedSegmentString* ss, std::size_t segIndex);
public:
SnapRoundingNoder(const geom::PrecisionModel* p_pm)
: pm(p_pm)
, pixelIndex(p_pm)
{}
std::vector<SegmentString*>* getNodedSubstrings() const override;
void computeNodes(std::vector<SegmentString*>* inputSegStrings) override; //override
};
} // namespace geos::noding::snapround
} // namespace geos::noding
} // namespace geos
geos::geom::CoordinateSequence
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:56
geos::geom::Envelope
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
geos::noding::NodedSegmentString
Represents a list of contiguous line segments, and supports noding the segments.
Definition NodedSegmentString.h:58
geos::noding::snapround::SnapRoundingNoder::computeNodes
void computeNodes(std::vector< SegmentString * > *inputSegStrings) override
geos::noding::snapround::SnapRoundingNoder::getNodedSubstrings
std::vector< SegmentString * > * getNodedSubstrings() const override
geos::geom
Definition Angle.h:26
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