GEOS  3.8.0dev
SimpleMCSweepLineIntersector.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_SIMPLEMCSWEEPLINEINTERSECTOR_H
17 #define GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
18 
19 #include <geos/export.h>
20 #include <vector>
21 
22 #include <geos/geomgraph/index/EdgeSetIntersector.h> // for inheritance
23 #include <geos/geomgraph/index/SegmentIntersector.h>
24 
25 #ifdef _MSC_VER
26 #pragma warning(push)
27 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
28 #endif
29 
30 // Forward declarations
31 namespace geos {
32 namespace geomgraph {
33 class Edge;
34 namespace index {
35 // class SegmentIntersector;
36 class SweepLineEvent;
37 }
38 }
39 }
40 
41 namespace geos {
42 namespace geomgraph { // geos::geomgraph
43 namespace index { // geos::geomgraph::index
44 
54 class GEOS_DLL SimpleMCSweepLineIntersector: public EdgeSetIntersector {
55 
56 public:
57 
59 
60  ~SimpleMCSweepLineIntersector() override;
61 
62  void computeIntersections(std::vector<Edge*>* edges,
63  SegmentIntersector* si, bool testAllSegments) override;
64 
65  void computeIntersections(std::vector<Edge*>* edges0,
66  std::vector<Edge*>* edges1,
67  SegmentIntersector* si) override;
68 
69 protected:
70 
71  std::vector<SweepLineEvent*> events;
72 
73  // statistics information
74  int nOverlaps;
75 
76 private:
77  void add(std::vector<Edge*>* edges);
78 
79  void add(std::vector<Edge*>* edges, void* edgeSet);
80 
81  void add(Edge* edge, void* edgeSet);
82 
83  void prepareEvents();
84 
85  void computeIntersections(SegmentIntersector* si);
86 
87  void processOverlaps(size_t start, size_t end,
88  SweepLineEvent* ev0,
89  SegmentIntersector* si);
90 };
91 
92 } // namespace geos.geomgraph.index
93 } // namespace geos.geomgraph
94 } // namespace geos
95 
96 #ifdef _MSC_VER
97 #pragma warning(pop)
98 #endif
99 
100 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
101 
Finds all intersections in one or two sets of edges, using an x-axis sweepline algorithm in conjuncti...
Definition: SimpleMCSweepLineIntersector.h:54
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Definition: geomgraph/Edge.h:66