GEOS  3.6.1
index/sweepline/SweepLineEvent.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #ifndef GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
16 #define GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
17 
18 #include <geos/export.h>
19 
20 // Forward declarations
21 namespace geos {
22  namespace index {
23  namespace sweepline {
24  class SweepLineInterval;
25  }
26  }
27 }
28 
29 namespace geos {
30 namespace index { // geos.index
31 namespace sweepline { // geos:index:sweepline
32 
33 class GEOS_DLL SweepLineEvent {
34 
35 public:
36 
37  enum {
38  INSERT_EVENT = 1,
39  DELETE_EVENT
40  };
41 
42  SweepLineEvent(double x, SweepLineEvent *newInsertEvent,
43  SweepLineInterval *newSweepInt);
44 
45  bool isInsert();
46 
47  bool isDelete();
48 
49  SweepLineEvent* getInsertEvent();
50 
51  int getDeleteEventIndex();
52 
53  void setDeleteEventIndex(int newDeleteEventIndex);
54 
55  SweepLineInterval* getInterval();
56 
63  int compareTo(const SweepLineEvent *pe) const;
64 
65  //int compareTo(void *o) const;
66 
67 private:
68 
69  double xValue;
70 
71  int eventType;
72 
74  SweepLineEvent *insertEvent;
75 
76  int deleteEventIndex;
77 
78  SweepLineInterval *sweepInt;
79 
80 };
81 
82 // temp typedefs for backward compatibility
83 //typedef SweepLineEvent indexSweepLineEvent;
84 
85 struct GEOS_DLL SweepLineEventLessThen {
86  bool operator() (const SweepLineEvent* first, const SweepLineEvent* second) const;
87 };
88 
89 //bool isleLessThen(SweepLineEvent *first, SweepLineEvent *second);
90 
91 
92 } // namespace geos:index:sweepline
93 } // namespace geos:index
94 } // namespace geos
95 
96 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25