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

- File List

# SweepLineIndex.h

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