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

# SweepLineIndex.h

    00001 /**********************************************************************
    00002  * $Id: SweepLineIndex.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) 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 <vector>
    00020
    00021 // Forward declarations
    00022 namespace geos {
    00023         namespace index {
    00024                 namespace sweepline {
    00025                         class SweepLineInterval;
    00026                         class SweepLineEvent;
    00027                         class SweepLineOverlapAction;
    00028                 }
    00029         }
    00030 }
    00031
    00032 namespace geos {
    00033 namespace index { // geos.index
    00034 namespace sweepline { // geos:index:sweepline
    00035
    00041 class SweepLineIndex {
    00042
    00043 public:
    00044
    00045         SweepLineIndex();
    00046
    00047         ~SweepLineIndex();
    00048
    00049         void add(SweepLineInterval *sweepInt);
    00050
    00051         void computeOverlaps(SweepLineOverlapAction *action);
    00052
    00053 private:
    00054
    00055         // FIXME: make it a real vector rather then a pointer
    00056         std::vector<SweepLineEvent*> events;
    00057
    00058         bool indexBuilt;
    00059
    00060         // statistics information
    00061         int nOverlaps;
    00062
    00068         void buildIndex();
    00069
    00070         void processOverlaps(int start, int end,
    00071                         SweepLineInterval *s0,
    00072                         SweepLineOverlapAction *action);
    00073 };
    00074
    00075
    00076 } // namespace geos:index:sweepline
    00077 } // namespace geos:index
    00078 } // namespace geos
    00079
    00080 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEINDEX_H
    00081
    00082 /**********************************************************************
    00083  * $Log$
    00084  * Revision 1.1  2006/03/21 10:01:30  strk
    00085  * indexSweepline.h header split
    00086  *
    00087  **********************************************************************/
    00088