GEOS
3.4.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2005-2006 Refractions Research Inc. 00007 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00008 * 00009 * This is free software; you can redistribute and/or modify it under 00010 * the terms of the GNU Lesser General Public Licence as published 00011 * by the Free Software Foundation. 00012 * See the COPYING file for more information. 00013 * 00014 **********************************************************************/ 00015 00016 #ifndef GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H 00017 #define GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H 00018 00019 #include <geos/export.h> 00020 #include <vector> 00021 00022 #include <geos/geomgraph/index/EdgeSetIntersector.h> // for inheritance 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 // Forward declarations 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 { // geos::geomgraph 00042 namespace index { // geos::geomgraph::index 00043 00053 class GEOS_DLL SimpleMCSweepLineIntersector: public EdgeSetIntersector { 00054 00055 public: 00056 00057 SimpleMCSweepLineIntersector(); 00058 00059 virtual ~SimpleMCSweepLineIntersector(); 00060 00061 void computeIntersections(std::vector<Edge*> *edges, 00062 SegmentIntersector *si, bool testAllSegments); 00063 00064 void computeIntersections(std::vector<Edge*> *edges0, 00065 std::vector<Edge*> *edges1, 00066 SegmentIntersector *si); 00067 00068 protected: 00069 00070 std::vector<SweepLineEvent*> events; 00071 00072 // statistics information 00073 int nOverlaps; 00074 00075 private: 00076 void add(std::vector<Edge*> *edges); 00077 00078 void add(std::vector<Edge*> *edges,void* edgeSet); 00079 00080 void add(Edge *edge,void* edgeSet); 00081 00082 void prepareEvents(); 00083 00084 void computeIntersections(SegmentIntersector *si); 00085 00086 void processOverlaps(int start, int end, 00087 SweepLineEvent *ev0, 00088 SegmentIntersector *si); 00089 }; 00090 00091 } // namespace geos.geomgraph.index 00092 } // namespace geos.geomgraph 00093 } // namespace geos 00094 00095 #ifdef _MSC_VER 00096 #pragma warning(pop) 00097 #endif 00098 00099 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H 00100