-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshape.h
56 lines (49 loc) · 991 Bytes
/
shape.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
56
#pragma once
#include <GL/freeglut.h>
#include <cmath>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
namespace shape {
class Shape {
public:
tuple<float, float, float> colorRGB;
float rotation_angle_radian;
pair<float, float> translationXY;
pair<float, float> coordinate2D; // left-bottom point
};
class Line : public Shape {
public:
float width, length, position;
pair<float, float> line_position;
void draw_line();
void setPosition(float new_position);
};
class Rectangle : public Shape {
public:
float width, height;
void draw_rectangle();
};
class Semicircle : public Shape {
public:
float radius;
void draw_semicircle();
};
class Circle : public Shape {
public:
float radius;
void draw_circle();
};
class Wheel : public Shape {
private:
Circle body_large;
Circle body_background;
Circle body_small;
vector<Circle> small_bolts;
public:
float radius;
int num_circles;
void draw_wheel();
};
}