GEOS 3.9.1
MonotoneChainEdge.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#ifndef GEOS_GEOMGRAPH_INDEX_MONOTONECHAINEDGE_H
17#define GEOS_GEOMGRAPH_INDEX_MONOTONECHAINEDGE_H
18
19#include <geos/export.h>
20#include <geos/geom/Envelope.h> // for composition
21
22#ifdef _MSC_VER
23#pragma warning(push)
24#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
25#endif
26
27// Forward declarations
28namespace geos {
29namespace geom {
30class CoordinateSequence;
31}
32namespace geomgraph {
33class Edge;
34namespace index {
35class SegmentIntersector;
36}
37}
38}
39
40namespace geos {
41namespace geomgraph { // geos::geomgraph
42namespace index { // geos::geomgraph::index
43
46class GEOS_DLL MonotoneChainEdge {
47public:
48 //MonotoneChainEdge();
49 ~MonotoneChainEdge() = default;
51 const geom::CoordinateSequence* getCoordinates();
52 std::vector<size_t>& getStartIndexes();
53 double getMinX(size_t chainIndex);
54 double getMaxX(size_t chainIndex);
55
56 void computeIntersects(const MonotoneChainEdge& mce,
58
59 void computeIntersectsForChain(size_t chainIndex0,
60 const MonotoneChainEdge& mce, size_t chainIndex1,
62
63protected:
64 Edge* e;
65 const geom::CoordinateSequence* pts; // cache a reference to the coord array, for efficiency
66 // the lists of start/end indexes of the monotone chains.
67 // Includes the end point of the edge as a sentinel
68 std::vector<size_t> startIndex;
69 // these envelopes are created once and reused
70private:
71 void computeIntersectsForChain(size_t start0, size_t end0,
72 const MonotoneChainEdge& mce,
73 size_t start1, size_t end1,
75
76 bool overlaps(size_t start0, size_t end0, const MonotoneChainEdge& mce, size_t start1, size_t end1);
77
78};
79
80} // namespace geos.geomgraph.index
81} // namespace geos.geomgraph
82} // namespace geos
83
84#ifdef _MSC_VER
85#pragma warning(pop)
86#endif
87
88#endif
89
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:58
Definition geomgraph/Edge.h:66
MonotoneChains are a way of partitioning the segments of an edge to allow for fast searching of inter...
Definition MonotoneChainEdge.h:46
Computes the intersection of line segments, and adds the intersection to the edges containing the seg...
Definition geomgraph/index/SegmentIntersector.h:47
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26