GEOS 3.9.1
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#ifndef GEOS_NODING_ITERATEDNODER_H
20#define GEOS_NODING_ITERATEDNODER_H
21
22#include <geos/export.h>
23
24#include <vector>
25#include <iostream>
26
27#include <geos/inline.h>
28
29#include <geos/algorithm/LineIntersector.h>
30#include <geos/noding/SegmentString.h> // due to inlines
31#include <geos/noding/Noder.h> // for inheritance
32
33// Forward declarations
34namespace geos {
35namespace geom {
36class PrecisionModel;
37}
38}
39
40namespace geos {
41namespace noding { // geos::noding
42
55class GEOS_DLL IteratedNoder : public Noder { // implements Noder
56
57private:
58 static const int MAX_ITER = 5;
59
60
61 const geom::PrecisionModel* pm;
63 std::vector<SegmentString*>* nodedSegStrings;
64 int maxIter;
65
70 void node(std::vector<SegmentString*>* segStrings,
71 int& numInteriorIntersections,
72 geom::Coordinate& intersectionPoint);
73
74public:
75
77 :
78 pm(newPm),
79 li(pm),
80 maxIter(MAX_ITER)
81 {
82 }
83
84 ~IteratedNoder() override {}
85
96 void
98 {
99 maxIter = n;
100 }
101
102 std::vector<SegmentString*>*
103 getNodedSubstrings() const override
104 {
105 return nodedSegStrings;
106 }
107
108
118 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings) override; // throw(GEOSException);
119};
120
121} // namespace geos::noding
122} // namespace geos
123
124
125#endif // GEOS_NODING_ITERATEDNODER_H
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:49
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Specifies the precision model of the Coordinate in a Geometry.
Definition PrecisionModel.h:87
Nodes a set of SegmentStrings completely.
Definition IteratedNoder.h:55
std::vector< SegmentString * > * getNodedSubstrings() const override
Returns a collection of fully noded SegmentStrings. The SegmentStrings have the same context as their...
Definition IteratedNoder.h:103
void setMaximumIterations(int n)
Sets the maximum number of noding iterations performed before the noding is aborted.
Definition IteratedNoder.h:97
void computeNodes(std::vector< SegmentString * > *inputSegmentStrings) override
Fully nodes a list of SegmentStrings, i.e. peforms noding iteratively until no intersections are foun...
Computes all intersections between segments in a set of SegmentString.
Definition Noder.h:49
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26