-
Notifications
You must be signed in to change notification settings - Fork 0
/
VEvent.h
50 lines (40 loc) · 1.01 KB
/
VEvent.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
#ifndef VEVENT_H
#define VEVENT_H
#include <iostream>
#include "VPoint.h"
#include "VParabola.h"
/*
The class for storing place / circle event in event queue.
point : the point at which current event occurs (top circle point for circle event, focus point for place event)
pe : whether it is a place event or not
y : y coordinate of "point", events are sorted by this "y"
arch : if "pe", it is an arch above which the event occurs
*/
class VEvent
{
public:
VPoint * point;
bool pe;
double y;
VParabola * arch;
/*
Constructor for the class
p : point, at which the event occurs
pev : whether it is a place event or not
*/
VEvent(VPoint * p, bool pev)
{
point = p;
pe = pev;
y = p->y;
arch = 0;
}
/*
function for comparing two events (by "y" property)
*/
struct CompareEvent : public std::binary_function<VEvent*, VEvent*, bool>
{
bool operator()(const VEvent* l, const VEvent* r) const { return (l->y < r->y); }
};
};
#endif