IteratedNoder.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/IteratedNoder.java r591 (JTS-1.12+)
*
**********************************************************************/
#pragma once
#include <geos/export.h>
#include <vector>
#include <iostream>
#include <geos/algorithm/LineIntersector.h>
#include <geos/noding/SegmentString.h> // due to inlines
#include <geos/noding/Noder.h> // for inheritance
// Forward declarations
namespace geos {
namespace geom {
class PrecisionModel;
}
}
namespace geos {
namespace noding { // geos::noding
class GEOS_DLL IteratedNoder : public Noder { // implements Noder
private:
static const int MAX_ITER = 5;
const geom::PrecisionModel* pm;
algorithm::LineIntersector li;
std::vector<SegmentString*>* nodedSegStrings;
int maxIter;
void node(std::vector<SegmentString*>* segStrings,
int& numInteriorIntersections,
geom::CoordinateXY& intersectionPoint);
public:
IteratedNoder(const geom::PrecisionModel* newPm)
:
pm(newPm),
li(pm),
maxIter(MAX_ITER)
{
}
~IteratedNoder() override {}
void
setMaximumIterations(int n)
{
maxIter = n;
}
std::vector<SegmentString*>*
getNodedSubstrings() const override
{
return nodedSegStrings;
}
void computeNodes(std::vector<SegmentString*>* inputSegmentStrings) override; // throw(GEOSException);
};
} // namespace geos::noding
} // namespace geos
geos::algorithm::LineIntersector
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:53
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
geos::noding::IteratedNoder::getNodedSubstrings
std::vector< SegmentString * > * getNodedSubstrings() const override
Returns a collection of fully noded SegmentStrings. The SegmentStrings have the same context as their...
Definition IteratedNoder.h:100
geos::noding::IteratedNoder::setMaximumIterations
void setMaximumIterations(int n)
Sets the maximum number of noding iterations performed before the noding is aborted.
Definition IteratedNoder.h:94
geos::noding::IteratedNoder::computeNodes
void computeNodes(std::vector< SegmentString * > *inputSegmentStrings) override
Fully nodes a list of SegmentStrings, i.e. performs noding iteratively until no intersections are fou...
geos::geom
Definition Angle.h:26
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