GEOS
3.3.2
|
00001 /********************************************************************** 00002 * $Id: SweepLineIndex.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2006 Refractions Research 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_INDEX_SWEEPLINE_SWEEPLINEINDEX_H 00017 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H 00018 00019 #include <geos/export.h> 00020 00021 #include <vector> 00022 00023 #ifdef _MSC_VER 00024 #pragma warning(push) 00025 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00026 #endif 00027 00028 // Forward declarations 00029 namespace geos { 00030 namespace index { 00031 namespace sweepline { 00032 class SweepLineInterval; 00033 class SweepLineEvent; 00034 class SweepLineOverlapAction; 00035 } 00036 } 00037 } 00038 00039 namespace geos { 00040 namespace index { // geos.index 00041 namespace sweepline { // geos:index:sweepline 00042 00048 class GEOS_DLL SweepLineIndex { 00049 00050 public: 00051 00052 SweepLineIndex(); 00053 00054 ~SweepLineIndex(); 00055 00056 void add(SweepLineInterval *sweepInt); 00057 00058 void computeOverlaps(SweepLineOverlapAction *action); 00059 00060 private: 00061 00062 // FIXME: make it a real vector rather then a pointer 00063 std::vector<SweepLineEvent*> events; 00064 00065 bool indexBuilt; 00066 00067 // statistics information 00068 int nOverlaps; 00069 00075 void buildIndex(); 00076 00077 void processOverlaps(int start, int end, 00078 SweepLineInterval *s0, 00079 SweepLineOverlapAction *action); 00080 }; 00081 00082 } // namespace geos:index:sweepline 00083 } // namespace geos:index 00084 } // namespace geos 00085 00086 #ifdef _MSC_VER 00087 #pragma warning(pop) 00088 #endif 00089 00090 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H 00091 00092 /********************************************************************** 00093 * $Log$ 00094 * Revision 1.1 2006/03/21 10:01:30 strk 00095 * indexSweepline.h header split 00096 * 00097 **********************************************************************/ 00098