My Project
Loading...
Searching...
No Matches
rectangle.h
Go to the documentation of this file.
1#ifndef RECTANGLE_H
2#define RECTANGLE_H
3
4#include "graphic_primitive.h"
5
15{
16public:
18 rectangle(int x, int y, int width, int heigth);
20 void set_line_color(Color color) override;
22 void set_background_color(Color color) override;
24 void set_coordinates(int x, int y) override;
26 void draw() override;
28 std::tuple<int, int> get_coordinates() override;
30 void set_geometry(int width, int heigth);
31
32private:
33 Color _line_color;
34 Color _background_color;
35 int _x;
36 int _y;
37 int _width;
38 int _heigth;
39};
40
41#endif // RECTANGLE_H
Interface for graphic primitives.
Definition graphic_primitive.h:15
Color
Acceptable colors.
Definition graphic_primitive.h:18
Implementation of a rectangle figure.
Definition rectangle.h:15
void set_geometry(int width, int heigth)
Set rectangle geometry.
Definition rectangle.cpp:24
void draw() override
Drawing a figure.
Definition rectangle.cpp:34
void set_line_color(Color color) override
Set line color.
Definition rectangle.cpp:9
void set_coordinates(int x, int y) override
Setting new coordinates for the figure.
Definition rectangle.cpp:19
void set_background_color(Color color) override
Set the background color of the shape.
Definition rectangle.cpp:14
rectangle(int x, int y, int width, int heigth)
Constructor.
Definition rectangle.cpp:3
std::tuple< int, int > get_coordinates() override
Returns the coordinates of a figure.
Definition rectangle.cpp:29