GEOS  3.6.2
SweepLineEvent.h
00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2006 Refractions Research Inc.
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Public Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************/
00014 
00015 #ifndef GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
00016 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
00017 
00018 #include <geos/export.h>
00019 
00020 // Forward declarations
00021 namespace geos {
00022         namespace index { 
00023                 namespace sweepline { 
00024                         class SweepLineInterval;
00025                 }
00026         }
00027 }
00028 
00029 namespace geos {
00030 namespace index { // geos.index
00031 namespace sweepline { // geos:index:sweepline
00032 
00033 class GEOS_DLL SweepLineEvent {
00034 
00035 public:
00036 
00037         enum {
00038                 INSERT_EVENT = 1,
00039                 DELETE_EVENT
00040         };
00041 
00042         SweepLineEvent(double x, SweepLineEvent *newInsertEvent,
00043                         SweepLineInterval *newSweepInt);
00044 
00045         bool isInsert();
00046 
00047         bool isDelete();
00048 
00049         SweepLineEvent* getInsertEvent();
00050 
00051         int getDeleteEventIndex();
00052 
00053         void setDeleteEventIndex(int newDeleteEventIndex);
00054 
00055         SweepLineInterval* getInterval();
00056 
00063         int compareTo(const SweepLineEvent *pe) const;
00064 
00065         //int compareTo(void *o) const;
00066 
00067 private:
00068 
00069         double xValue;
00070 
00071         int eventType;
00072 
00074         SweepLineEvent *insertEvent;
00075 
00076         int deleteEventIndex;
00077 
00078         SweepLineInterval *sweepInt;
00079 
00080 };
00081 
00082 // temp typedefs for backward compatibility
00083 //typedef SweepLineEvent indexSweepLineEvent;
00084 
00085 struct GEOS_DLL  SweepLineEventLessThen {
00086         bool operator() (const SweepLineEvent* first, const SweepLineEvent* second) const;
00087 };
00088 
00089 //bool isleLessThen(SweepLineEvent *first, SweepLineEvent *second);
00090 
00091 
00092 } // namespace geos:index:sweepline
00093 } // namespace geos:index
00094 } // namespace geos
00095 
00096 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H