-
Notifications
You must be signed in to change notification settings - Fork 1
/
Event.h
47 lines (33 loc) · 1.01 KB
/
Event.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include "util.h"
#include <limits.h>
enum class EventType
{
CIRCLE,
SITE
};
class BeachLineBSTNode;
//Make these independent of raylib library so need your own x and y coords
/*
This is the event which is stored in Event Queue
It could be either a site event or a circle event
point: the point at which the current event occurs (bottom most point of circle in case of circle event, site point in case of site event)
//events are sorted by y
//Pointer to the arc/leaf of BST Node that will be deleted in case of circle event
*/
class Event
{
Event();
public:
static bool lessThan(const Event *a, const Event *b);
static bool greaterThan(const Event *a, const Event *b);
Vertex* point;//Point at which this event is triggered
//Use type to identify site vs circle event
EventType type;
BeachLineBSTNode *arc;
position2D circleCenter;
int pqIndex;//Managed by EventPQ
Event(Vertex* point); //Site Event
Event(Vertex* point, BeachLineBSTNode *arc, position2D center); //Circle Event
~Event();
};