GEOS  3.3.9
SimpleMCSweepLineIntersector.h
00001 /**********************************************************************
00002  * $Id: SimpleMCSweepLineIntersector.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) 2005-2006 Refractions Research Inc.
00008  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00009  *
00010  * This is free software; you can redistribute and/or modify it under
00011  * the terms of the GNU Lesser General Public Licence as published
00012  * by the Free Software Foundation. 
00013  * See the COPYING file for more information.
00014  *
00015  **********************************************************************/
00016 
00017 #ifndef GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
00018 #define GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
00019 
00020 #include <geos/export.h>
00021 #include <vector>
00022 
00023 #include <geos/geomgraph/index/EdgeSetIntersector.h> // for inheritance
00024 
00025 #ifdef _MSC_VER
00026 #pragma warning(push)
00027 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00028 #endif
00029 
00030 // Forward declarations
00031 namespace geos {
00032         namespace geomgraph {
00033                 class Edge;
00034                 namespace index {
00035                         class SegmentIntersector;
00036                         class SweepLineEvent;
00037                 }
00038         }
00039 }
00040 
00041 namespace geos {
00042 namespace geomgraph { // geos::geomgraph
00043 namespace index { // geos::geomgraph::index
00044 
00054 class GEOS_DLL SimpleMCSweepLineIntersector: public EdgeSetIntersector {
00055 
00056 public:
00057 
00058         SimpleMCSweepLineIntersector();
00059 
00060         virtual ~SimpleMCSweepLineIntersector();
00061 
00062         void computeIntersections(std::vector<Edge*> *edges,
00063                         SegmentIntersector *si, bool testAllSegments);
00064 
00065         void computeIntersections(std::vector<Edge*> *edges0,
00066                         std::vector<Edge*> *edges1,
00067                         SegmentIntersector *si);
00068 
00069 protected:
00070 
00071         std::vector<SweepLineEvent*> events;
00072 
00073         // statistics information
00074         int nOverlaps;
00075 
00076 private:
00077         void add(std::vector<Edge*> *edges);
00078 
00079         void add(std::vector<Edge*> *edges,void* edgeSet);
00080 
00081         void add(Edge *edge,void* edgeSet);
00082 
00083         void prepareEvents();
00084 
00085         void computeIntersections(SegmentIntersector *si);
00086 
00087         void processOverlaps(int start, int end,
00088                         SweepLineEvent *ev0,
00089                         SegmentIntersector *si);
00090 };
00091 
00092 } // namespace geos.geomgraph.index
00093 } // namespace geos.geomgraph
00094 } // namespace geos
00095 
00096 #ifdef _MSC_VER
00097 #pragma warning(pop)
00098 #endif
00099 
00100 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
00101 
00102 /**********************************************************************
00103  * $Log$
00104  * Revision 1.1  2006/03/14 12:55:55  strk
00105  * Headers split: geomgraphindex.h, nodingSnapround.h
00106  *
00107  **********************************************************************/
00108