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