- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# geos::noding::snapround::SimpleSnapRounder Class Reference

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

`#include <SimpleSnapRounder.h>`

Inheritance diagram for geos::noding::snapround::SimpleSnapRounder:

List of all members.

## Public Member Functions
| SimpleSnapRounder (const geom::PrecisionModel &newPm)
std::vector< SegmentString * > * | getNodedSubstrings () const
| Returns a Collection of fully noded SegmentStrings. The SegmentStrings have the same context as their parent.
void | computeNodes (std::vector< SegmentString * > *inputSegmentStrings)
| Computes the noding for a collection of SegmentStrings.
void | add (const SegmentString *segStr)
void | computeVertexSnaps (const std::vector< SegmentString * > &edges)
## Static Public Member Functions
static bool | addSnappedNode (const HotPixel &hotPix, SegmentString &segStr, unsigned int segIndex)

## Detailed Description

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

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 simple iteration over the line segments.

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.

Last port: noding/snapround/SimpleSnapRounder.java rev. 1.2 (JTS-1.7)

## Member Function Documentation

std::vector<SegmentString*>* geos::noding::snapround::SimpleSnapRounder::getNodedSubstrings | ( |  | ) | const`[virtual]`

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

Returns:
  a newly allocated std::vector of const SegmentStrings. Caller is responsible to delete it

Implements geos::noding::Noder.

void geos::noding::snapround::SimpleSnapRounder::computeNodes | ( | std::vector< SegmentString * > * | segStrings | ) | `[virtual]`

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:

  | segStrings | a collection of SegmentStrings to node

Implements geos::noding::Noder.

static bool geos::noding::snapround::SimpleSnapRounder::addSnappedNode | ( | const HotPixel & | hotPix,
|  | SegmentString & | segStr,
|  | unsigned int | segIndex |
| ) |  |  | `[static]`

Adds a new node (equal to the snap pt) to the segment if the segment passes through the hot pixel.

Parameters:

  | hotPix |
  | segStr |
  | segIndex |

Returns:
  `true` if a node was added

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

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

Parameters:

  | segStrings | the list of segment strings to snap together

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

- SimpleSnapRounder.h