GEOS 3.14.0dev
IteratedNoder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: noding/IteratedNoder.java r591 (JTS-1.12+)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22
23#include <vector>
24#include <iostream>
25
26#include <geos/algorithm/LineIntersector.h>
27#include <geos/noding/SegmentString.h> // due to inlines
28#include <geos/noding/Noder.h> // for inheritance
29
30// Forward declarations
31namespace geos {
32namespace geom {
33class PrecisionModel;
34}
35}
36
37namespace geos {
38namespace noding { // geos::noding
39
52class GEOS_DLL IteratedNoder : public Noder { // implements Noder
53
54private:
55 static const int MAX_ITER = 5;
56
57
58 const geom::PrecisionModel* pm;
60 std::vector<SegmentString*>* nodedSegStrings;
61 int maxIter;
62
67 void node(std::vector<SegmentString*>* segStrings,
68 int& numInteriorIntersections,
69 geom::CoordinateXY& intersectionPoint);
70
71public:
72
74 :
75 pm(newPm),
76 li(pm),
77 maxIter(MAX_ITER)
78 {
79 }
80
81 ~IteratedNoder() override {}
82
93 void
95 {
96 maxIter = n;
97 }
98
99 std::vector<SegmentString*>*
100 getNodedSubstrings() const override
101 {
102 return nodedSegStrings;
103 }
104
105
115 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings) override; // throw(GEOSException);
116};
117
118} // namespace geos::noding
119} // namespace geos
120
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:53
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:88
Nodes a set of SegmentStrings completely.
Definition IteratedNoder.h:52
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
void setMaximumIterations(int n)
Sets the maximum number of noding iterations performed before the noding is aborted.
Definition IteratedNoder.h:94
void computeNodes(std::vector< SegmentString * > *inputSegmentStrings) override
Fully nodes a list of SegmentStrings, i.e. performs noding iteratively until no intersections are fou...
Computes all intersections between segments in a set of SegmentString.
Definition Noder.h:46
Basic namespace for all GEOS functionalities.
Definition geos.h:39