GEOS: SimpleSweepLineIntersector.h Source File

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

# SimpleSweepLineIntersector.h

    00001 /**********************************************************************
    00002  * $Id: SimpleSweepLineIntersector.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_SIMPLESWEEPLINEINTERSECTOR_H
    00018 #define GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_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
    00046 class SimpleSweepLineIntersector: public EdgeSetIntersector {
    00047
    00048 public:
    00049
    00050         SimpleSweepLineIntersector();
    00051
    00052         virtual ~SimpleSweepLineIntersector();
    00053
    00054         void computeIntersections(std::vector<Edge*> *edges,
    00055                         SegmentIntersector *si,
    00056                         bool testAllSegments);
    00057
    00058         void computeIntersections(std::vector<Edge*> *edges0,
    00059                         std::vector<Edge*> *edges1,
    00060                         SegmentIntersector *si);
    00061
    00062 private:
    00063
    00064         void add(std::vector<Edge*> *edges);
    00065
    00066         std::vector<SweepLineEvent*> events;
    00067
    00068         // statistics information
    00069         int nOverlaps;
    00070
    00071         void add(std::vector<Edge*> *edges, void* edgeSet);
    00072
    00073         void add(Edge *edge,void* edgeSet);
    00074
    00075         void prepareEvents();
    00076
    00077         void computeIntersections(SegmentIntersector *si);
    00078
    00079         void processOverlaps(int start, int end, SweepLineEvent *ev0,
    00080                         SegmentIntersector *si);
    00081 };
    00082
    00083
    00084
    00085
    00086 } // namespace geos.geomgraph.index
    00087 } // namespace geos.geomgraph
    00088 } // namespace geos
    00089
    00090 #endif // GEOS_GEOMGRAPH_INDEX_SIMPLESWEEPLINEINTERSECTOR_H
    00091
    00092 /**********************************************************************
    00093  * $Log$
    00094  * Revision 1.1  2006/03/14 12:55:55  strk
    00095  * Headers split: geomgraphindex.h, nodingSnapround.h
    00096  *
    00097  **********************************************************************/
    00098