GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::noding::snapround::MCIndexSnapRounder Class Reference

Uses Snap Rounding to compute a rounded, fully noded arrangement from a set of SegmentString. More...

#include <MCIndexSnapRounder.h>

Inheritance diagram for geos::noding::snapround::MCIndexSnapRounder:
[legend]
Collaboration diagram for geos::noding::snapround::MCIndexSnapRounder:
[legend]

Public Member Functions

 MCIndexSnapRounder (const geom::PrecisionModel &nPm)
 
std::vector< SegmentString * > * getNodedSubstrings () const override
 Returns a collection of fully noded SegmentStrings. The SegmentStrings have the same context as their parent. More...
 
void computeNodes (std::vector< SegmentString * > *segStrings) override
 Computes the noding for a collection of SegmentStrings. More...
 
void computeVertexSnaps (std::vector< SegmentString * > &edges)
 
- Public Member Functions inherited from geos::noding::Noder
virtual ~Noder ()
 

Private Member Functions

void snapRound (MCIndexNoder &noder, std::vector< SegmentString * > *segStrings)
 
void findInteriorIntersections (MCIndexNoder &noder, std::vector< SegmentString * > *segStrings, std::vector< geom::Coordinate > &intersections)
 
void computeIntersectionSnaps (std::vector< geom::Coordinate > &snapPts)
 
void computeVertexSnaps (NodedSegmentString *e)
 
void checkCorrectness (std::vector< SegmentString * > &inputSegmentStrings)
 
 MCIndexSnapRounder (const MCIndexSnapRounder &other)=delete
 
MCIndexSnapRounderoperator= (const MCIndexSnapRounder &rhs)=delete
 

Private Attributes

const geom::PrecisionModelpm
 externally owned More...
 
algorithm::LineIntersector li
 
double scaleFactor
 
std::vector< SegmentString * > * nodedSegStrings
 
std::unique_ptr< MCIndexPointSnapperpointSnapper
 

Additional Inherited Members

- Protected Member Functions inherited from geos::noding::Noder
 Noder ()
 

Detailed Description

Uses Snap Rounding to compute a rounded, fully noded arrangement from a set of SegmentString.

Implements the Snap Rounding technique described in Hobby, Guibas & Marimont, and Goodrich et al.

Snap Rounding assumes that all vertices lie on a uniform grid (hence the precision model of the input must be fixed precision, and all the input vertices must be rounded to that precision).

This implementation uses a monotone chains and a spatial index to speed up the intersection tests.

This implementation appears to be fully robust using an integer precision model.

It will function with non-integer precision models, but the results are not 100% guaranteed to be correctly noded.

Definition at line 74 of file MCIndexSnapRounder.h.

Constructor & Destructor Documentation

geos::noding::snapround::MCIndexSnapRounder::MCIndexSnapRounder ( const geom::PrecisionModel nPm)
inline

Definition at line 78 of file MCIndexSnapRounder.h.

geos::noding::snapround::MCIndexSnapRounder::MCIndexSnapRounder ( const MCIndexSnapRounder other)
privatedelete

Member Function Documentation

void geos::noding::snapround::MCIndexSnapRounder::checkCorrectness ( std::vector< SegmentString * > &  inputSegmentStrings)
private
void geos::noding::snapround::MCIndexSnapRounder::computeIntersectionSnaps ( std::vector< geom::Coordinate > &  snapPts)
private

Computes nodes introduced as a result of snapping segments to snap points (hot pixels)

void geos::noding::snapround::MCIndexSnapRounder::computeNodes ( std::vector< SegmentString * > *  segStrings)
overridevirtual

Computes the noding for a collection of SegmentStrings.

Some Noders may add all these nodes to the input SegmentStrings; others may only add some or none at all.

Parameters
segStringsa collection of SegmentStrings to node The caller remains responsible for releasing the memory associated with the container and its elements.

Implements geos::noding::Noder.

void geos::noding::snapround::MCIndexSnapRounder::computeVertexSnaps ( std::vector< SegmentString * > &  edges)

Computes nodes introduced as a result of snapping segments to vertices of other segments

Parameters
edgesthe list of segment strings to snap together NOTE: they must be instances of NodedSegmentString, or an assertion will fail.
void geos::noding::snapround::MCIndexSnapRounder::computeVertexSnaps ( NodedSegmentString e)
private

Performs a brute-force comparison of every segment in each SegmentString. This has n^2 performance.

void geos::noding::snapround::MCIndexSnapRounder::findInteriorIntersections ( MCIndexNoder noder,
std::vector< SegmentString * > *  segStrings,
std::vector< geom::Coordinate > &  intersections 
)
private

Computes all interior intersections in the collection of SegmentStrings, and push their Coordinate to the provided vector.

Does NOT node the segStrings.

std::vector<SegmentString*>* geos::noding::snapround::MCIndexSnapRounder::getNodedSubstrings ( ) const
inlineoverridevirtual

Returns a collection of fully noded SegmentStrings. The SegmentStrings have the same context as their parent.

Returns
a newly allocated std::vector of newly allocated SegmentStrings (copies of input, if needs be). Caller is responsible to delete container and elements.

Implements geos::noding::Noder.

Definition at line 88 of file MCIndexSnapRounder.h.

MCIndexSnapRounder& geos::noding::snapround::MCIndexSnapRounder::operator= ( const MCIndexSnapRounder rhs)
privatedelete
void geos::noding::snapround::MCIndexSnapRounder::snapRound ( MCIndexNoder noder,
std::vector< SegmentString * > *  segStrings 
)
private

Member Data Documentation

algorithm::LineIntersector geos::noding::snapround::MCIndexSnapRounder::li
private

Definition at line 110 of file MCIndexSnapRounder.h.

std::vector<SegmentString*>* geos::noding::snapround::MCIndexSnapRounder::nodedSegStrings
private

Definition at line 114 of file MCIndexSnapRounder.h.

const geom::PrecisionModel& geos::noding::snapround::MCIndexSnapRounder::pm
private

externally owned

Definition at line 108 of file MCIndexSnapRounder.h.

std::unique_ptr<MCIndexPointSnapper> geos::noding::snapround::MCIndexSnapRounder::pointSnapper
private

Definition at line 116 of file MCIndexSnapRounder.h.

double geos::noding::snapround::MCIndexSnapRounder::scaleFactor
private

Definition at line 112 of file MCIndexSnapRounder.h.


The documentation for this class was generated from the following file: