GEOS 3.8.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
44class GEOS_DLL MonotoneChainEdge {
45public:
46 //MonotoneChainEdge();
47 ~MonotoneChainEdge() = default;
48 MonotoneChainEdge(Edge* newE);
49 const geom::CoordinateSequence* getCoordinates();
50 std::vector<size_t>& getStartIndexes();
51 double getMinX(size_t chainIndex);
52 double getMaxX(size_t chainIndex);
53
54 void computeIntersects(const MonotoneChainEdge& mce,
55 SegmentIntersector& si);
56
57 void computeIntersectsForChain(size_t chainIndex0,
58 const MonotoneChainEdge& mce, size_t chainIndex1,
59 SegmentIntersector& si);
60
61protected:
62 Edge* e;
63 const geom::CoordinateSequence* pts; // cache a reference to the coord array, for efficiency
64 // the lists of start/end indexes of the monotone chains.
65 // Includes the end point of the edge as a sentinel
66 std::vector<size_t> startIndex;
67 // these envelopes are created once and reused
68private:
69 void computeIntersectsForChain(size_t start0, size_t end0,
70 const MonotoneChainEdge& mce,
71 size_t start1, size_t end1,
72 SegmentIntersector& ei);
73
74 bool overlaps(size_t start0, size_t end0, const MonotoneChainEdge& mce, size_t start1, size_t end1);
75
76};
77
78} // namespace geos.geomgraph.index
79} // namespace geos.geomgraph
80} // namespace geos
81
82#ifdef _MSC_VER
83#pragma warning(pop)
84#endif
85
86#endif
87
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25