GEOS  3.8.0dev
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 <cstddef>
19 #include <geos/export.h>
20 
21 // Forward declarations
22 namespace geos {
23 namespace index {
24 namespace sweepline {
25 class SweepLineInterval;
26 }
27 }
28 }
29 
30 namespace geos {
31 namespace index { // geos.index
32 namespace sweepline { // geos:index:sweepline
33 
34 class GEOS_DLL SweepLineEvent {
35 
36 public:
37 
38  enum {
39  INSERT_EVENT = 1,
40  DELETE_EVENT
41  };
42 
43  SweepLineEvent(double x, SweepLineEvent* newInsertEvent,
44  SweepLineInterval* newSweepInt);
45 
46  bool isInsert();
47 
48  bool isDelete();
49 
50  SweepLineEvent* getInsertEvent();
51 
52  size_t getDeleteEventIndex();
53 
54  void setDeleteEventIndex(size_t newDeleteEventIndex);
55 
56  SweepLineInterval* getInterval();
57 
64  int compareTo(const SweepLineEvent* pe) const;
65 
66  //int compareTo(void *o) const;
67 
68 private:
69 
70  double xValue;
71 
72  int eventType;
73 
75  SweepLineEvent* insertEvent;
76 
77  size_t deleteEventIndex;
78 
79  SweepLineInterval* sweepInt;
80 
81 };
82 
83 // temp typedefs for backward compatibility
84 //typedef SweepLineEvent indexSweepLineEvent;
85 
86 struct GEOS_DLL SweepLineEventLessThen {
87  bool operator()(const SweepLineEvent* first, const SweepLineEvent* second) const;
88 };
89 
90 //bool isleLessThen(SweepLineEvent *first, SweepLineEvent *second);
91 
92 
93 } // namespace geos:index:sweepline
94 } // namespace geos:index
95 } // namespace geos
96 
97 #endif // GEOS_INDEX_SWEEPLINE_SWEEPLINEEVENT_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25