-
Notifications
You must be signed in to change notification settings - Fork 1
/
eventdata.h
54 lines (47 loc) · 1.1 KB
/
eventdata.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
48
49
50
51
52
53
54
#ifndef EVENTDATA_H
#define EVENTDATA_H
#include <vparabola.h>
/*
* This struct represents one entry in the history of execution
* and contains all the information pertaining to one valid event
*/
struct EventData
{
EventData(
double y,
VParabola * r = nullptr,
bool pe = true,
VPoint * pi = nullptr,
VPoint * cc = nullptr)
:
ly(y),
root(r),
isPointEvent(pe),
pointInserted(VPoint(-1, -1)),
circleCenter(VPoint(-1, -1))
{
if (nullptr != pi)
{
pointInserted = *pi;
}
if (nullptr != cc)
{
circleCenter = *cc;
}
}
double ly;
VParabola * root; // We are owning this
bool isPointEvent;
VPoint pointInserted; // if isPointEvent
VPoint circleCenter; // if !isPointEvent
bool operator <=(const EventData &other) const
{
return ly <= other.ly;
}
};
/*
* This container holds all the history of the algorithm
* needed for visualization
*/
typedef std::vector <EventData> EventsData;
#endif // EVENTDATA_H