00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
00017 #define GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
00018
00019 #include <geos/export.h>
00020 #include <vector>
00021
00022 #include <geos/geomgraph/index/EdgeSetIntersector.h>
00023
00024 #ifdef _MSC_VER
00025 #pragma warning(push)
00026 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00027 #endif
00028
00029
00030 namespace geos {
00031 namespace geomgraph {
00032 class Edge;
00033 namespace index {
00034 class SegmentIntersector;
00035 class SweepLineEvent;
00036 }
00037 }
00038 }
00039
00040 namespace geos {
00041 namespace geomgraph {
00042 namespace index {
00043
00051 class GEOS_DLL SimpleSweepLineIntersector: public EdgeSetIntersector {
00052
00053 public:
00054
00055 SimpleSweepLineIntersector();
00056
00057 virtual ~SimpleSweepLineIntersector();
00058
00059 void computeIntersections(std::vector<Edge*> *edges,
00060 SegmentIntersector *si,
00061 bool testAllSegments);
00062
00063 void computeIntersections(std::vector<Edge*> *edges0,
00064 std::vector<Edge*> *edges1,
00065 SegmentIntersector *si);
00066
00067 private:
00068
00069 void add(std::vector<Edge*> *edges);
00070
00071 std::vector<SweepLineEvent*> events;
00072
00073
00074 int nOverlaps;
00075
00076 void add(std::vector<Edge*> *edges, void* edgeSet);
00077
00078 void add(Edge *edge,void* edgeSet);
00079
00080 void prepareEvents();
00081
00082 void computeIntersections(SegmentIntersector *si);
00083
00084 void processOverlaps(int start, int end, SweepLineEvent *ev0,
00085 SegmentIntersector *si);
00086 };
00087
00088 }
00089 }
00090 }
00091
00092 #ifdef _MSC_VER
00093 #pragma warning(pop)
00094 #endif
00095
00096 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
00097