-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrectangulo.cpp
More file actions
77 lines (63 loc) · 805 Bytes
/
rectangulo.cpp
File metadata and controls
77 lines (63 loc) · 805 Bytes
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
#include "rectangulo.h"
Rectangulo::Rectangulo()
{
_x1=0;
_y1=0;
_x2=0;
_y2=0;
}
Rectangulo::Rectangulo(int x1,int y1,int x2,int y2)
{
_x1=x1;
_y1=y1;
_x2=x2;
_y2=y2;
}
void Rectangulo::setX1(int x1)
{
_x1=x1;
}
int Rectangulo::getX1()
{
return _x1;
}
void Rectangulo::setY1(int y1)
{
_y1=y1;
}
int Rectangulo::getY1()
{
return _y1;
}
void Rectangulo::setX2(int x2)
{
_x2=x2;
}
int Rectangulo::getX2()
{
return _x2;
}
void Rectangulo::setY2(int y2)
{
_y2=y2;
}
int Rectangulo::getY2()
{
return _y2;
}
int Rectangulo::getAncho()
{
return _x2-_x1;
}
int Rectangulo::getAlto()
{
return _y2-_y1;
}
void Rectangulo::dibujar()
{
bar3d(_x1,_y1,_x2,_y2,0,0);
}
char Rectangulo::getTipo()
{
return 'R';
}