GEOS 3.9.1
SimpleSweepLineIntersector.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_SIMPLESWEEPLINEINTERSECTOR_H
17#define GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
18
19#include <geos/export.h>
20#include <vector>
21
22#include <geos/geomgraph/index/EdgeSetIntersector.h> // for inheritance
23
24#ifdef _MSC_VER
25#pragma warning(push)
26#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
27#endif
28
29// Forward declarations
30namespace geos {
31namespace geomgraph {
32class Edge;
33namespace index {
34class SegmentIntersector;
35class SweepLineEvent;
36}
37}
38}
39
40namespace geos {
41namespace geomgraph { // geos::geomgraph
42namespace index { // geos::geomgraph::index
43
52
53public:
54
56
58
59 void computeIntersections(std::vector<Edge*>* edges,
61 bool testAllSegments) override;
62
63 void computeIntersections(std::vector<Edge*>* edges0,
64 std::vector<Edge*>* edges1,
65 SegmentIntersector* si) override;
66
67private:
68
69 void add(std::vector<Edge*>* edges);
70
71 std::vector<SweepLineEvent*> events;
72
73 // statistics information
74 int nOverlaps;
75
76 void add(std::vector<Edge*>* edges, void* edgeSet);
77
78 void add(Edge* edge, void* edgeSet);
79
80 void prepareEvents();
81
82 void computeIntersections(SegmentIntersector* si);
83
84 void processOverlaps(size_t start, size_t end, SweepLineEvent* ev0,
86};
87
88} // namespace geos.geomgraph.index
89} // namespace geos.geomgraph
90} // namespace geos
91
92#ifdef _MSC_VER
93#pragma warning(pop)
94#endif
95
96#endif // GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
97
Definition geomgraph/Edge.h:66
An EdgeSetIntersector computes all the intersections between the edges in the set.
Definition EdgeSetIntersector.h:41
Computes the intersection of line segments, and adds the intersection to the edges containing the seg...
Definition geomgraph/index/SegmentIntersector.h:47
Finds all intersections in one or two sets of edges, using a simple x-axis sweepline algorithm.
Definition SimpleSweepLineIntersector.h:51
void computeIntersections(std::vector< Edge * > *edges, SegmentIntersector *si, bool testAllSegments) override
Computes all self-intersections between edges in a set of edges, allowing client to choose whether se...
void computeIntersections(std::vector< Edge * > *edges0, std::vector< Edge * > *edges1, SegmentIntersector *si) override
Computes all mutual intersections between two sets of edges.
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26