GEOS 3.6.2
MCIndexNoder.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/MCIndexNoder.java rev. 1.6 (JTS-1.9)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_NODING_MCINDEXNODER_H
20#define GEOS_NODING_MCINDEXNODER_H
21
22#include <geos/export.h>
23
24#include <geos/inline.h>
25
26#include <geos/index/chain/MonotoneChainOverlapAction.h> // for inheritance
27#include <geos/noding/SinglePassNoder.h> // for inheritance
28#include <geos/index/strtree/STRtree.h> // for composition
29#include <geos/util.h>
30
31#include <vector>
32#include <iostream>
33
34#ifdef _MSC_VER
35#pragma warning(push)
36#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
37#endif
38
39// Forward declarations
40namespace geos {
41 namespace geom {
42 class LineSegment;
43 }
44 namespace noding {
45 class SegmentString;
47 }
48}
49
50namespace geos {
51namespace noding { // geos.noding
52
63class GEOS_DLL MCIndexNoder : public SinglePassNoder {
64
65private:
66 std::vector<index::chain::MonotoneChain*> monoChains;
68 int idCounter;
69 std::vector<SegmentString*>* nodedSegStrings;
70 // statistics
71 int nOverlaps;
72
73 void intersectChains();
74
75 void add(SegmentString* segStr);
76
77public:
78
79 MCIndexNoder(SegmentIntersector *nSegInt=NULL)
80 :
81 SinglePassNoder(nSegInt),
82 idCounter(0),
83 nodedSegStrings(NULL),
84 nOverlaps(0)
85 {}
86
87 ~MCIndexNoder();
88
90 std::vector<index::chain::MonotoneChain*>& getMonotoneChains() { return monoChains; }
91
92 index::SpatialIndex& getIndex();
93
94 std::vector<SegmentString*>* getNodedSubstrings() const;
95
96 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
97
98 class SegmentOverlapAction : public index::chain::MonotoneChainOverlapAction {
99 public:
100 SegmentOverlapAction(SegmentIntersector& newSi)
101 :
102 index::chain::MonotoneChainOverlapAction(),
103 si(newSi)
104 {}
105
106 void overlap(index::chain::MonotoneChain& mc1, std::size_t start1,
107 index::chain::MonotoneChain& mc2, std::size_t start2);
108 private:
110
111 // Declare type as noncopyable
112 SegmentOverlapAction(const SegmentOverlapAction& other);
113 SegmentOverlapAction& operator=(const SegmentOverlapAction& rhs);
114 };
115
116};
117
118} // namespace geos.noding
119} // namespace geos
120
121#ifdef _MSC_VER
122#pragma warning(pop)
123#endif
124
125#ifdef GEOS_INLINE
126# include <geos/noding/MCIndexNoder.inl>
127#endif
128
129#endif // GEOS_NODING_MCINDEXNODER_H
Definition LineSegment.h:57
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition SpatialIndex.h:47
Definition MonotoneChainOverlapAction.h:44
Monotone Chains are a way of partitioning the segments of a linestring to allow for fast searching of...
Definition index/chain/MonotoneChain.h:86
A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatia...
Definition STRtree.h:65
std::vector< SegmentString * > * getNodedSubstrings() const
void computeNodes(std::vector< SegmentString * > *inputSegmentStrings)
std::vector< index::chain::MonotoneChain * > & getMonotoneChains()
Return a reference to this instance's std::vector of MonotoneChains.
Definition MCIndexNoder.h:90
Processes possible intersections detected by a Noder.
Definition noding/SegmentIntersector.h:47
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement Monotone Chains.
Definition MCPointInRing.h:41
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition PreparedLineString.h:27
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25