-
Notifications
You must be signed in to change notification settings - Fork 2
/
pixel.hpp
99 lines (71 loc) · 1.55 KB
/
pixel.hpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef PIXEL_HPP
#define PIXEL_HPP
namespace transmogrifier {
class Pixel {
// The values X and Y correspond to the pixel's location.
// The value for color
int X;
int Y;
// The following two-dimensional array corresponds to the type of encompassing triangle.
// 0 - Red, 1 - Blue
// 0 - Top piece, 1 - Bottom piece - (T/B corresponds to location on Ianiv Schweber's table)
// The third entry is the rotation.
// The value 0 refers to the position in the downward pointing star in the top-left position.
// From there, the subsequent value increments the angle clockwise by 36 degrees.
int triType[3];
// Keeps track of which Chuck Close layer this pixel lies on
int layer;
// The X's and Y's correspond to the encompassing triangle's vertices.
// If Pixel is red, the P's correspond to the point on the long edge, and
// the Q's correspond to the point on one of the shorter edges.
// Otherwise, the P's correspond to the only other point and the Q's are null.
double X1, X2, X3, Y1, Y2, Y3, P1, P2, Q1, Q2;
bool isColored;
public:
int
getX();
void
setX(int x);
void
setY(int y);
void
color();
bool
coloredYet();
double
getX1();
double
getY1();
double
getX2();
double
getY2();
double
getX3();
double
getY3();
void
setTypes(int* type);
int
getType();
int
getRot();
int
getSpin();
int
getLayer();
void
setVertices(double x1, double y1, double x2, double y2, double x3, double y3);
void
changeLt();
void
changeLT();
void
changelt();
void
changelT();
void
ellipticize();
};
}
#endif /* PIXEL_HPP */