GEOS 3.14.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#pragma once
16
17#include <cstddef>
18#include <geos/export.h>
19
20// Forward declarations
21namespace geos {
22namespace index {
23namespace sweepline {
24class SweepLineInterval;
25}
26}
27}
28
29namespace geos {
30namespace index { // geos.index
31namespace sweepline { // geos:index:sweepline
32
33class GEOS_DLL SweepLineEvent {
34
35public:
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 std::size_t getDeleteEventIndex();
52
53 void setDeleteEventIndex(std::size_t newDeleteEventIndex);
54
55 SweepLineInterval* getInterval();
56
63 int compareTo(const SweepLineEvent* pe) const;
64
65 //int compareTo(void *o) const;
66
67private:
68
69 double xValue;
70
71 int eventType;
72
74 SweepLineEvent* insertEvent;
75
76 std::size_t deleteEventIndex;
77
78 SweepLineInterval* sweepInt;
79
80};
81
82// temp typedefs for backward compatibility
83//typedef SweepLineEvent indexSweepLineEvent;
84
85struct 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
Basic namespace for all GEOS functionalities.
Definition geos.h:39