SimpleSweepLineIntersector.h

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_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> // 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 
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         // statistics information
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 } // namespace geos.geomgraph.index
00089 } // namespace geos.geomgraph
00090 } // namespace geos
00091 
00092 #ifdef _MSC_VER
00093 #pragma warning(pop)
00094 #endif
00095 
00096 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
00097 

Generated on 10 Sep 2013 for GEOS by  doxygen 1.4.7