-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ball.h
67 lines (52 loc) · 1.32 KB
/
Ball.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
63
64
65
66
67
/*
* Ball.h
*
* Created on: 27/03/2016
* Author: eduardo
*/
#ifndef BALL_H_
#define BALL_H_
#include "Particle.h"
#include "vector3.h"
#define PI 3.141592
#define RADIUS 30
namespace MyBilliards {
class Ball: public MyBilliards::particle {
private:
double radio;
double rcolor, gcolor, bcolor; // Range 0.0-1.0 Color (given in RGB space)
public:
Ball();
virtual ~Ball();
void draw();
double getRadio() const {
return radio;
}
void setRadio(double radio) {
if( radio > 0 ) this->radio = radio;
else cerr << "Radio debe ser positivo " <<'\n';
}
double getBcolor() const {
return bcolor;
}
void setBcolor(double bcolor) {
if ( bcolor >= 0.0 && bcolor <= 1.0) this->bcolor = bcolor;
else cerr << "Rango de color debe ser entre 0.0 y 1.0. Color Blue no asignado " <<'\n';
}
double getGcolor() const {
return gcolor;
}
void setGcolor(double gcolor) {
if ( gcolor >= 0.0 && gcolor <= 1.0) this->gcolor = gcolor;
else cerr << "Rango de color debe ser entre 0.0 y 1.0. Color Green no asignado " <<'\n';
}
double getRcolor() const {
return rcolor;
}
void setRcolor(double rcolor) {
if ( rcolor >= 0.0 && rcolor <= 1.0) this->rcolor = rcolor;
else cerr << "Rango de color debe ser entre 0.0 y 1.0. Color Red no asignado " <<'\n';
}
};
} /* namespace MyBilliards */
#endif /* BALL_H_ */