-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.h
62 lines (53 loc) · 1.39 KB
/
circle.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
57
58
59
60
61
62
#ifndef CIRCLE_H
#define CIRCLE_H
#include <iostream>
#include <GL/freeglut.h>
#include <string>
using namespace std;
class Circle
{
protected:
GLfloat cx;
GLfloat cy;
GLfloat radius;
string fill;
GLint id;
GLfloat RGB[3];
public:
Circle() { }
Circle(GLfloat cx, GLfloat cy, GLfloat radius, string fill, GLint id)
{
this->cx = cx;
this->cy = cy;
this->radius = radius;
this->fill = fill;
this->id = id;
if (this->fill == "blue")
{
this->RGB[0] = 0; this->RGB[1] = .15; this->RGB[2] = 1;
}
else if (this->fill == "white")
{
this->RGB[0] = 1; this->RGB[1] = 1; this->RGB[2] = 1;
}
else if (this->fill == "black")
{
this->RGB[0] = 0; this->RGB[1] = 0; this->RGB[2] = 0;
}
else if (this->fill == "green")
{
this->RGB[0] = 0; this->RGB[1] = .5; this->RGB[2] = 0;
}
else if (this->fill == "red")
{
this->RGB[0] = 1; this->RGB[1] = 0; this->RGB[2] = 0;
}
}
GLfloat getcx();
GLfloat getcy();
GLfloat getRadius();
string getFill();
GLint getId();
void draw();
};
#endif