-
Notifications
You must be signed in to change notification settings - Fork 0
/
coordinate.h
56 lines (44 loc) · 1.07 KB
/
coordinate.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
55
#pragma once
class Coordinate {
public:
Coordinate(
double x_coordinate,
double y_coordinate,
unsigned int frame_height,
unsigned int frame_width);
int getQtRenderingXCoordinate() {
return x_coordinate;
}
int getQtRenderingYCoordinate() {
return frame_height - y_coordinate;
}
double getXCoordinate() {
return x_coordinate;
}
double getYCoordinate() {
return y_coordinate;
}
void changeInXCoordinate(double change) {
x_coordinate += change;
}
void changeInYCoordinate(double change) {
y_coordinate += change;
}
void setYCoordinateToZero(int offset) {
y_coordinate = 0 + offset;
}
void setXCoordinateToZero(int offset) {
x_coordinate = 0 + offset;
}
unsigned int getFrameHeight() {
return frame_height;
}
unsigned int getFrameWidth() {
return frame_width;
}
private:
double x_coordinate;
double y_coordinate;
unsigned int frame_height;
unsigned int frame_width;
};