GEOS: SimpleSweepLineIntersector.h Source File

GEOS 3.5.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
30 namespace geos {
31 namespace geomgraph {
32 class Edge;
33 namespace index {
34 class SegmentIntersector;
35 class SweepLineEvent;
36 }
37 }
38 }
39
40 namespace geos {
41 namespace geomgraph { // geos::geomgraph
42 namespace index { // geos::geomgraph::index
43
51 class GEOS_DLL SimpleSweepLineIntersector: public EdgeSetIntersector {
52
53 public:
54
55 SimpleSweepLineIntersector();
56
57 virtual ~SimpleSweepLineIntersector();
58
59 void computeIntersections(std::vector<Edge*> *edges,
60 SegmentIntersector *si,
61 bool testAllSegments);
62
63 void computeIntersections(std::vector<Edge*> *edges0,
64 std::vector<Edge*> *edges1,
65 SegmentIntersector *si);
66
67 private:
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(int start, int end, SweepLineEvent *ev0,
85 SegmentIntersector *si);
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
geos::geomgraph::index::SimpleSweepLineIntersector
Finds all intersections in one or two sets of edges, using a simple x-axis sweepline algorithm...
Definition: SimpleSweepLineIntersector.h:51
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::geomgraph::Edge
Definition: geomgraph/Edge.h:66