GEOS: SimpleMCSweepLineIntersector.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# SimpleMCSweepLineIntersector.h

    00001 /**********************************************************************
    00002  * $Id: SimpleMCSweepLineIntersector.h 1820 2006-09-06 16:54:23Z 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 <vector>
    00021
    00022 #include <geos/geomgraph/index/EdgeSetIntersector.h> // for inheritance
    00023
    00024 // Forward declarations
    00025 namespace geos {
    00026         namespace geomgraph {
    00027                 class Edge;
    00028                 namespace index {
    00029                         class SegmentIntersector;
    00030                         class SweepLineEvent;
    00031                 }
    00032         }
    00033 }
    00034
    00035 namespace geos {
    00036 namespace geomgraph { // geos::geomgraph
    00037 namespace index { // geos::geomgraph::index
    00038
    00048 class SimpleMCSweepLineIntersector: public EdgeSetIntersector {
    00049
    00050 public:
    00051
    00052         SimpleMCSweepLineIntersector();
    00053
    00054         virtual ~SimpleMCSweepLineIntersector();
    00055
    00056         void computeIntersections(std::vector<Edge*> *edges,
    00057                         SegmentIntersector *si, bool testAllSegments);
    00058
    00059         void computeIntersections(std::vector<Edge*> *edges0,
    00060                         std::vector<Edge*> *edges1,
    00061                         SegmentIntersector *si);
    00062
    00063 protected:
    00064
    00065         std::vector<SweepLineEvent*> events;
    00066
    00067         // statistics information
    00068         int nOverlaps;
    00069
    00070 private:
    00071         void add(std::vector<Edge*> *edges);
    00072
    00073         void add(std::vector<Edge*> *edges,void* edgeSet);
    00074
    00075         void add(Edge *edge,void* edgeSet);
    00076
    00077         void prepareEvents();
    00078
    00079         void computeIntersections(SegmentIntersector *si);
    00080
    00081         void processOverlaps(int start, int end,
    00082                         SweepLineEvent *ev0,
    00083                         SegmentIntersector *si);
    00084 };
    00085
    00086
    00087
    00088 } // namespace geos.geomgraph.index
    00089 } // namespace geos.geomgraph
    00090 } // namespace geos
    00091
    00092 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLEMCSWEEPLINEINTERSECTOR_H
    00093
    00094 /**********************************************************************
    00095  * $Log$
    00096  * Revision 1.1  2006/03/14 12:55:55  strk
    00097  * Headers split: geomgraphindex.h, nodingSnapround.h
    00098  *
    00099  **********************************************************************/
    00100