-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.h
More file actions
51 lines (30 loc) · 1000 Bytes
/
Rectangle.h
File metadata and controls
51 lines (30 loc) · 1000 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
#ifndef RECTANGLE_H
#define RECTANGLE_H
#include "Shape.h"
#include <iostream>
using namespace std;
class Rectangle : public Shape {
public:
Rectangle() = delete;
Rectangle(int rectHeight, int rectWidth, const string &d = "");
Rectangle(const Rectangle &) = default;
~Rectangle() override;
const Rectangle &operator=(const Rectangle &rhs);
int getHeight() const;
int getWidth() const;
string toString() const override;
void scale(int n) override;
double geoArea() const override;
double geoPerimeter() const override;
int scrArea() const override;
int scrPerimeter() const override;
int bBoxHeight() const override;
int bBoxWidth() const override;
/* Draws textual image of the shape on a drawing surface*/
void draw(Canvas &canvas, int c, int r, char fg, char bg = '*') const override;
private:
int height;
int width;
};
ostream &operator<<(ostream &ostr, const Rectangle &rhs);
#endif // !RECTANGLE_H