GEOS 3.11.1
geomgraph/index/MonotoneChain.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 * Last port: geomgraph/index/MonotoneChain.java rev. 1.3 (JTS-1.7)
17 *
18 **********************************************************************/
19
20#pragma once
21
22
23#include <geos/export.h>
24#include <geos/geomgraph/index/SweepLineEventObj.h> // for inheritance
25#include <geos/geomgraph/index/MonotoneChainEdge.h> // for inline
26#include <geos/geomgraph/index/MonotoneChain.h>
27
28// Forward declarations
29namespace geos {
30namespace geomgraph {
31namespace index {
32class SegmentIntersector;
33}
34}
35}
36
37namespace geos {
38namespace geomgraph { // geos::geomgraph
39namespace index { // geos::geomgraph::index
40
44class GEOS_DLL MonotoneChain: public SweepLineEventOBJ {
45private:
47 std::size_t chainIndex;
48
49 MonotoneChain(const MonotoneChain& other) = delete;
50 MonotoneChain& operator=(const MonotoneChain& rhs) = delete;
51
52public:
53
54 MonotoneChain(MonotoneChainEdge* newMce, std::size_t newChainIndex):
55 mce(newMce),
56 chainIndex(newChainIndex)
57 {}
58
59 ~MonotoneChain() override {}
60
61 void
62 computeIntersections(MonotoneChain* mc, SegmentIntersector* si)
63 {
64 mce->computeIntersectsForChain(chainIndex, *(mc->mce), mc->chainIndex, *si);
65 }
66};
67
68
69} // namespace geos.geomgraph.index
70} // namespace geos.geomgraph
71} // namespace geos
72
MonotoneChains are a way of partitioning the segments of an edge to allow for fast searching of inter...
Definition: MonotoneChainEdge.h:45
Definition: geomgraph/index/MonotoneChain.h:44
Computes the intersection of line segments, and adds the intersection to the edges containing the seg...
Definition: geomgraph/index/SegmentIntersector.h:46
Basic namespace for all GEOS functionalities.
Definition: geos.h:39