GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 **********************************************************************/ 00014 00015 #ifndef GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H 00016 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H 00017 00018 #include <geos/export.h> 00019 00020 #include <vector> 00021 00022 #ifdef _MSC_VER 00023 #pragma warning(push) 00024 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00025 #endif 00026 00027 // Forward declarations 00028 namespace geos { 00029 namespace index { 00030 namespace sweepline { 00031 class SweepLineInterval; 00032 class SweepLineEvent; 00033 class SweepLineOverlapAction; 00034 } 00035 } 00036 } 00037 00038 namespace geos { 00039 namespace index { // geos.index 00040 namespace sweepline { // geos:index:sweepline 00041 00047 class GEOS_DLL SweepLineIndex { 00048 00049 public: 00050 00051 SweepLineIndex(); 00052 00053 ~SweepLineIndex(); 00054 00055 void add(SweepLineInterval *sweepInt); 00056 00057 void computeOverlaps(SweepLineOverlapAction *action); 00058 00059 private: 00060 00061 // FIXME: make it a real vector rather then a pointer 00062 std::vector<SweepLineEvent*> events; 00063 00064 bool indexBuilt; 00065 00066 // statistics information 00067 int nOverlaps; 00068 00074 void buildIndex(); 00075 00076 void processOverlaps(int start, int end, 00077 SweepLineInterval *s0, 00078 SweepLineOverlapAction *action); 00079 }; 00080 00081 } // namespace geos:index:sweepline 00082 } // namespace geos:index 00083 } // namespace geos 00084 00085 #ifdef _MSC_VER 00086 #pragma warning(pop) 00087 #endif 00088 00089 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H