This repository has been archived by the owner on Dec 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFigures.cpp
112 lines (82 loc) · 2.05 KB
/
Figures.cpp
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
100
101
102
103
104
105
106
107
108
#include <cmath>
#include "Figures.h"
Location::Location(double x, double y) : x(x), y(y) {}
Location::Location(Location &location) {
this->x = location.x;
this->y = location.y;
}
Location::Location() : x(0), y(0) {}
double Location::getX() const {
return x;
}
double Location::getY() const {
return y;
}
Clip::Clip() : min(new Location()), max(new Location()) {}
Clip::Clip(Clip &clip) {
this->min = new Location(*clip.min);
this->max = new Location(*clip.max);
}
Clip::Clip(double xn, double yn, double xk, double yk) {}
Rhombus::Rhombus() {
this->center = *new Location();
this->setColor(200);
this->setStyle(Style::stSolid);
this->setVisible(true);
this->hLength = 20;
this->wLength = 10;
}
Rhombus::Rhombus(const Rhombus &rhombus) {
this->center = rhombus.center;
this->setColor(rhombus.getColor());
this->setStyle(rhombus.getStyle());
this->setVisible(rhombus.isVisible());
}
Rhombus::Rhombus(double hLength, double wLength, Location ¢er) {
this->hLength = hLength;
this->wLength = wLength;
this->center = center;
}
Color Rhombus::getColor() const {
return color;
}
void Rhombus::setColor(Color tint) {
this->color = tint;
}
bool Rhombus::isVisible() const {
return visible;
}
void Rhombus::setVisible(bool vision) {
this->visible = vision;
}
Style Rhombus::getStyle() const {
return style;
}
void Rhombus::setStyle(Style ltype) {
this->style = ltype;
}
double Rhombus::getS() {
return (wLength * hLength) / 2.0;
}
double Rhombus::getP() {
double gipotenuza = sqrt(pow(wLength / 2.0, 2) + pow(hLength / 2.0, 2));
return gipotenuza * 4;
}
double Rhombus::getWLength() {
return this->wLength;
}
double Rhombus::getHLength() {
return this->hLength;
}
Location Rhombus::getCenter() {
return center;
}
void Rhombus::setHLength(double hLength) {
Rhombus::hLength = hLength;
}
void Rhombus::setWLength(double wLength) {
Rhombus::wLength = wLength;
}
void Rhombus::setCenter(const Location ¢er) {
Rhombus::center = center;
}