# SweepLineEvent.h

    00001 /**********************************************************************
    00002  * $Id: SweepLineEvent.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_SWEEPLINEEVENT_H
    00017 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
    00018
    00019 // Forward declarations
    00020 namespace geos {
    00021         namespace index {
    00022                 namespace sweepline {
    00023                         class SweepLineInterval;
    00024                 }
    00025         }
    00026 }
    00027
    00028 namespace geos {
    00029 namespace index { // geos.index
    00030 namespace sweepline { // geos:index:sweepline
    00031
    00032 class SweepLineEvent {
    00033
    00034 public:
    00035
    00036         enum {
    00037                 INSERT_EVENT = 1,
    00038                 DELETE_EVENT
    00039         };
    00040
    00041         SweepLineEvent(double x, SweepLineEvent *newInsertEvent,
    00042                         SweepLineInterval *newSweepInt);
    00043
    00044         bool isInsert();
    00045
    00046         bool isDelete();
    00047
    00048         SweepLineEvent* getInsertEvent();
    00049
    00050         int getDeleteEventIndex();
    00051
    00052         void setDeleteEventIndex(int newDeleteEventIndex);
    00053
    00054         SweepLineInterval* getInterval();
    00055
    00062         int compareTo(const SweepLineEvent *pe) const;
    00063
    00064         //int compareTo(void *o) const;
    00065
    00066 private:
    00067
    00068         double xValue;
    00069
    00070         int eventType;
    00071
    00073         SweepLineEvent *insertEvent;
    00074
    00075         int deleteEventIndex;
    00076
    00077         SweepLineInterval *sweepInt;
    00078
    00079 };
    00080
    00081 // temp typedefs for backward compatibility
    00082 //typedef SweepLineEvent indexSweepLineEvent;
    00083
    00084 struct SweepLineEventLessThen {
    00085         bool operator() (const SweepLineEvent* first, const SweepLineEvent* second) const;
    00086 };
    00087
    00088 //bool isleLessThen(SweepLineEvent *first, SweepLineEvent *second);
    00089
    00090
    00091 } // namespace geos:index:sweepline
    00092 } // namespace geos:index
    00093 } // namespace geos
    00094
    00095 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
    00096
    00097 /**********************************************************************
    00098  * $Log$
    00099  * Revision 1.1  2006/03/21 10:01:30  strk
    00100  * indexSweepline.h header split
    00101  *
    00102  **********************************************************************/
    00103