diff --git a/src/06_POLY/CMakeLists.txt b/src/06_POLY/CMakeLists.txt index 2263977..7f42919 100644 --- a/src/06_POLY/CMakeLists.txt +++ b/src/06_POLY/CMakeLists.txt @@ -1,2 +1,31 @@ -add_executable(06_POLY_MP MP/shapes_main.cpp ../helpers/AnsiConsole.cpp) -add_executable(06_POLY_Testat Testat/shapes_main.cpp ../helpers/AnsiConsole.cpp) \ No newline at end of file +add_executable(06_POLY_MP + MP/shapes_main.cpp + MP/Shape.cpp + MP/Position.h + MP/Shape.h + MP/Point.cpp + MP/Point.h + MP/Circle.cpp + MP/Circle.h + MP/Rectangle.cpp + MP/Rectangle.h + MP/Scene.cpp + MP/Scene.h + ../helpers/AnsiConsole.cpp + ) + +add_executable(06_POLY_Testat + Testat/shapes_main.cpp + Testat/Shape.cpp + Testat/Position.h + Testat/Shape.h + Testat/Point.cpp + Testat/Point.h + Testat/Circle.cpp + Testat/Circle.h + Testat/Rectangle.cpp + Testat/Rectangle.h + Testat/Scene.cpp + Testat/Scene.h + ../helpers/AnsiConsole.cpp + ) \ No newline at end of file diff --git a/src/06_POLY/MP/Circle.cpp b/src/06_POLY/MP/Circle.cpp new file mode 100644 index 0000000..d20aea8 --- /dev/null +++ b/src/06_POLY/MP/Circle.cpp @@ -0,0 +1,34 @@ +#include "Circle.h" +#include + +Circle::Circle(int x, int y, int radius, Colors color) : Shape(Position(x, y), color) { + _radius = radius; +} + +void Circle::draw() { + /* see https://de.wikibooks.org/wiki/Formelsammlung_Mathematik:_Geometrie + * Höhensatz des Euklid + * */ + int x_start = position.x - _radius / 2; + int x_stop = position.x + _radius / 2; + + for (int i = x_start; i <= x_stop; i++) { + double x_relative = double(i) - double(x_start); + double h = sqrt(x_relative * (x_stop - x_start - x_relative)); + ansiConsole.printText(position.x + int(x_relative) - _radius / 2, + static_cast(position.y + h), "#", + color); + ansiConsole.printText(position.x + int(x_relative) - _radius / 2, + static_cast(position.y - h), "#", + color); + + } +} + +void Circle::nonVirtual() { + std::cout << "Circle" << std::endl; +} + +void Circle::virtualVoid() { + std::cout << "Circle" << std::endl; +} diff --git a/src/06_POLY/MP/Circle.h b/src/06_POLY/MP/Circle.h new file mode 100644 index 0000000..099456a --- /dev/null +++ b/src/06_POLY/MP/Circle.h @@ -0,0 +1,16 @@ +#ifndef C_C_CIRCLE_H +#define C_C_CIRCLE_H + +#include "Shape.h" + +class Circle : public Shape{ +protected: + int _radius; +public: + explicit Circle(int x = 0, int y = 0, int radius = 0, Colors color = Colors::GREEN); + void draw() override; + void nonVirtual(); + void virtualVoid() override; +}; + +#endif //C_C_CIRCLE_H diff --git a/src/06_POLY/MP/Point.cpp b/src/06_POLY/MP/Point.cpp new file mode 100644 index 0000000..77efe5c --- /dev/null +++ b/src/06_POLY/MP/Point.cpp @@ -0,0 +1,8 @@ +#include "Point.h" + +Point::Point(int x, int y, Colors color) : Shape(Position(x, y), color) { +} + +void Point::draw() { + ansiConsole.printText(position.x, position.y, "*", color); +} diff --git a/src/06_POLY/MP/Point.h b/src/06_POLY/MP/Point.h new file mode 100644 index 0000000..bc693bf --- /dev/null +++ b/src/06_POLY/MP/Point.h @@ -0,0 +1,14 @@ +#ifndef C_C_POINT_H +#define C_C_POINT_H + +#include "Shape.h" + +class Point : public Shape{ + +public: + explicit Point(int x, int y, Colors color); + void draw() override; +}; + + +#endif diff --git a/src/06_POLY/MP/Position.h b/src/06_POLY/MP/Position.h new file mode 100644 index 0000000..f977d98 --- /dev/null +++ b/src/06_POLY/MP/Position.h @@ -0,0 +1,14 @@ +#ifndef C_C_POSITION_H +#define C_C_POSITION_H + +struct Position { + int x; + int y; + + explicit Position(int x_ = 0, int y_ = 0) { + x = x_; + y = y_; + } +}; + +#endif \ No newline at end of file diff --git a/src/06_POLY/MP/Rectangle.cpp b/src/06_POLY/MP/Rectangle.cpp new file mode 100644 index 0000000..e74bf2f --- /dev/null +++ b/src/06_POLY/MP/Rectangle.cpp @@ -0,0 +1,31 @@ +#include "Rectangle.h" + +Rectangle::Rectangle(int x, int y, int width, int height, Colors color) : Shape(Position(x, y), color) { + this->width = width; + this->height = height; +} + +void Rectangle::draw() { + int x_start = position.x - (width / 2); + int x_stop = position.x + (width / 2); + + int y_start = position.y - (height / 2); + int y_stop = position.y + (height / 2); + + for(int i = x_start; i <= x_stop; i++) { + ansiConsole.printText(i, position.y - (height / 2), "#", color); + ansiConsole.printText(i, position.y + (height / 2), "#", color); + } + for(int i = y_start; i< y_stop; i++) { + ansiConsole.printText(position.x + (width / 2), i, "#", color); + ansiConsole.printText(position.x - (width / 2), i, "#", color); + } +} + +void Rectangle::nonVirtual() { + std::cout << "Rectangle" << std::endl; +} + +void Rectangle::virtualVoid() { + std::cout << "Rectangle" << std::endl; +} \ No newline at end of file diff --git a/src/06_POLY/MP/Rectangle.h b/src/06_POLY/MP/Rectangle.h new file mode 100644 index 0000000..98167ec --- /dev/null +++ b/src/06_POLY/MP/Rectangle.h @@ -0,0 +1,20 @@ +#include "Shape.h" + +#ifndef C_C_RECTANGLE_H +#define C_C_RECTANGLE_H + + +class Rectangle : public Shape{ +protected: + int width; + int height; + +public: + explicit Rectangle(int x = 0, int y = 0, int width = 0, int height = 0, Colors color = Colors::WHITE); + void draw() override; + void nonVirtual(); + void virtualVoid() override; +}; + + +#endif //C_C_RECTANGLE_H diff --git a/src/06_POLY/MP/Scene.cpp b/src/06_POLY/MP/Scene.cpp new file mode 100644 index 0000000..9d25e7e --- /dev/null +++ b/src/06_POLY/MP/Scene.cpp @@ -0,0 +1,19 @@ +#include "Scene.h" +#include + +Scene::Scene(std::vector shapes) : shapes(std::move(shapes)) { + +} + +void Scene::draw() { + ansiConsole.clearScreen(); + for(Shape* shape : shapes) { + shape->draw(); + } +} + +Scene::~Scene() { + for(Shape* shape : shapes) { + delete shape; + } +} diff --git a/src/06_POLY/MP/Scene.h b/src/06_POLY/MP/Scene.h new file mode 100644 index 0000000..90e3352 --- /dev/null +++ b/src/06_POLY/MP/Scene.h @@ -0,0 +1,17 @@ +#include +#include "Shape.h" + +#ifndef C_C_SCENE_H +#define C_C_SCENE_H + +class Scene { +private: + std::vector shapes; +public: + explicit Scene(std::vector shapes); + void draw(); + ~Scene(); +}; + + +#endif //C_C_SCENE_H diff --git a/src/06_POLY/MP/Shape.cpp b/src/06_POLY/MP/Shape.cpp new file mode 100644 index 0000000..d399a26 --- /dev/null +++ b/src/06_POLY/MP/Shape.cpp @@ -0,0 +1,21 @@ +#include "Position.h" +#include "Shape.h" + +Shape::Shape(Position position, Colors color) { + this->position = position; + this->color = color; +} + +Shape::~Shape() = default; + +void Shape::nonVirtual() { + std::cout << "Shape" << std::endl; +} + +void Shape::virtualVoid() { + std::cout << "Shape" << std::endl; +} + +void Shape::callVirtual() { + virtualVoid(); +} \ No newline at end of file diff --git a/src/06_POLY/MP/Shape.h b/src/06_POLY/MP/Shape.h new file mode 100644 index 0000000..98fb3d2 --- /dev/null +++ b/src/06_POLY/MP/Shape.h @@ -0,0 +1,20 @@ +#ifndef C_C_SHAPE_H +#define C_C_SHAPE_H + +#include "../../helpers/AnsiConsole.h" +#include "Position.h" + +class Shape { +protected: + Position position; + Colors color; +public: + Shape(Position position, Colors color); + virtual ~Shape(); + virtual void draw() = 0; + void nonVirtual(); + virtual void virtualVoid(); + void callVirtual(); +}; + +#endif \ No newline at end of file diff --git a/src/06_POLY/MP/shapes_main.cpp b/src/06_POLY/MP/shapes_main.cpp index f09dcb8..f081179 100644 --- a/src/06_POLY/MP/shapes_main.cpp +++ b/src/06_POLY/MP/shapes_main.cpp @@ -1,139 +1,11 @@ -#include "../../helpers/AnsiConsole.h" -#include #include +#include "Shape.h" +#include "Point.h" +#include "Circle.h" +#include "Rectangle.h" +#include "Scene.h" -struct Position { - int x; - int y; - - explicit Position(int x_ = 0, int y_ = 0) { - x = x_; - y = y_; - } -}; - -class Shape { -protected: - Position position; - Colors color; -public: - Shape(Position position, Colors color); - virtual ~Shape(); - virtual void draw() = 0; -}; - -Shape::Shape(Position position, Colors color) { - this->position = position; - this->color = color; -} - -Shape::~Shape() = default; - -class Point : public Shape{ - -public: - explicit Point(int x, int y, Colors color); - void draw() override; -}; - -Point::Point(int x, int y, Colors color) : Shape(Position(x, y), color) { - -} - -void Point::draw() { - ansiConsole.printText(position.x, position.y, "*", color); -} - -class Circle : public Shape{ -protected: - int _radius; -public: - explicit Circle(int x = 0, int y = 0, int radius = 0, Colors color = Colors::GREEN); - - void draw() override; -}; - -Circle::Circle(int x, int y, int radius, Colors color) : Shape(Position(x, y), color) { - _radius = radius; -} - -void Circle::draw() { - /* see https://de.wikibooks.org/wiki/Formelsammlung_Mathematik:_Geometrie - * Höhensatz des Euklid - * */ - int x_start = position.x - _radius / 2; - int x_stop = position.x + _radius / 2; - - for (int i = x_start; i <= x_stop; i++) { - double x_relative = double(i) - double(x_start); - double h = sqrt(x_relative * (x_stop - x_start - x_relative)); - ansiConsole.printText(position.x + int(x_relative) - _radius / 2, - static_cast(position.y + h), "#", - color); - ansiConsole.printText(position.x + int(x_relative) - _radius / 2, - static_cast(position.y - h), "#", - color); - - } -} - -class Rectangle : public Shape{ -protected: - int width; - int height; - -public: - explicit Rectangle(int x = 0, int y = 0, int width = 0, int height = 0, Colors color = Colors::WHITE); - void draw() override; -}; - -Rectangle::Rectangle(int x, int y, int width, int height, Colors color) : Shape(Position(x, y), color) { - this->width = width; - this->height = height; -} - -void Rectangle::draw() { - int x_start = position.x - (width / 2); - int x_stop = position.x + (width / 2); - - int y_start = position.y - (height / 2); - int y_stop = position.y + (height / 2); - - for(int i = x_start; i <= x_stop; i++) { - ansiConsole.printText(i, position.y - (height / 2), "#", color); - ansiConsole.printText(i, position.y + (height / 2), "#", color); - } - for(int i = y_start; i< y_stop; i++) { - ansiConsole.printText(position.x + (width / 2), i, "#", color); - ansiConsole.printText(position.x - (width / 2), i, "#", color); - } -} - -class Scene { -private: - std::vector shapes; -public: - explicit Scene(std::vector shapes); - void draw(); - ~Scene(); -}; - -Scene::Scene(std::vector shapes) : shapes(std::move(shapes)) { - -} - -void Scene::draw() { - ansiConsole.clearScreen(); - for(Shape* shape : shapes) { - shape->draw(); - } -} - -Scene::~Scene() { - for(Shape* shape : shapes) { - delete shape; - } -} +void invokeVirtually(Shape* shape); int main(int argc, char **argv) { std::vector shapes; @@ -149,12 +21,36 @@ int main(int argc, char **argv) { shapes.push_back(new Rectangle(5, 21, 10, 10, Colors::MAGENTA)); + shapes.push_back(new Point(5, 10, Colors::WHITE)); + shapes.push_back(new Point(15, 7, Colors::WHITE)); + shapes.push_back(new Point(7, 5, Colors::WHITE)); + auto *s = new Scene(shapes); s->draw(); delete s; + invokeVirtually(new Circle(1, 1, 1, Colors::RED)); + invokeVirtually(new Rectangle(1, 1, 1, 1, Colors::BLACK)); + invokeVirtually(new Point(1, 1, Colors::GREEN)); + + std::cout << "-------------------------------" << std::endl; + + auto * c = new Circle(1, 1, 1, Colors::RED); + c->callVirtual(); + auto * r = new Rectangle(1, 1, 1, 1, Colors::BLACK); + r->callVirtual(); + auto * p = new Point(1, 1, Colors::GREEN); + p->callVirtual(); return 0; } + +void invokeVirtually(Shape* shape) { + if(auto * c = dynamic_cast(shape)) + c->nonVirtual(); + else if(auto * r = dynamic_cast(shape)) + r->nonVirtual(); + else shape->nonVirtual(); +} \ No newline at end of file diff --git a/src/06_POLY/Testat/Circle.cpp b/src/06_POLY/Testat/Circle.cpp new file mode 100644 index 0000000..5ef58f7 --- /dev/null +++ b/src/06_POLY/Testat/Circle.cpp @@ -0,0 +1,26 @@ +#include "Circle.h" +#include + +Circle::Circle(int x, int y, int radius, Colors color) : Shape(Position(x, y), color) { + _radius = radius; +} + +void Circle::draw() { + /* see https://de.wikibooks.org/wiki/Formelsammlung_Mathematik:_Geometrie + * Höhensatz des Euklid + * */ + int x_start = position.x - _radius / 2; + int x_stop = position.x + _radius / 2; + + for (int i = x_start; i <= x_stop; i++) { + double x_relative = double(i) - double(x_start); + double h = sqrt(x_relative * (x_stop - x_start - x_relative)); + ansiConsole.printText(position.x + int(x_relative) - _radius / 2, + static_cast(position.y + h), "#", + color); + ansiConsole.printText(position.x + int(x_relative) - _radius / 2, + static_cast(position.y - h), "#", + color); + + } +} diff --git a/src/06_POLY/Testat/Circle.h b/src/06_POLY/Testat/Circle.h new file mode 100644 index 0000000..f0186d2 --- /dev/null +++ b/src/06_POLY/Testat/Circle.h @@ -0,0 +1,14 @@ +#ifndef C_C_CIRCLE_H +#define C_C_CIRCLE_H + +#include "Shape.h" + +class Circle : public Shape{ +protected: + int _radius; +public: + explicit Circle(int x = 0, int y = 0, int radius = 0, Colors color = Colors::GREEN); + void draw() override; +}; + +#endif //C_C_CIRCLE_H diff --git a/src/06_POLY/Testat/Point.cpp b/src/06_POLY/Testat/Point.cpp new file mode 100644 index 0000000..77efe5c --- /dev/null +++ b/src/06_POLY/Testat/Point.cpp @@ -0,0 +1,8 @@ +#include "Point.h" + +Point::Point(int x, int y, Colors color) : Shape(Position(x, y), color) { +} + +void Point::draw() { + ansiConsole.printText(position.x, position.y, "*", color); +} diff --git a/src/06_POLY/Testat/Point.h b/src/06_POLY/Testat/Point.h new file mode 100644 index 0000000..bc693bf --- /dev/null +++ b/src/06_POLY/Testat/Point.h @@ -0,0 +1,14 @@ +#ifndef C_C_POINT_H +#define C_C_POINT_H + +#include "Shape.h" + +class Point : public Shape{ + +public: + explicit Point(int x, int y, Colors color); + void draw() override; +}; + + +#endif diff --git a/src/06_POLY/Testat/Position.h b/src/06_POLY/Testat/Position.h new file mode 100644 index 0000000..f977d98 --- /dev/null +++ b/src/06_POLY/Testat/Position.h @@ -0,0 +1,14 @@ +#ifndef C_C_POSITION_H +#define C_C_POSITION_H + +struct Position { + int x; + int y; + + explicit Position(int x_ = 0, int y_ = 0) { + x = x_; + y = y_; + } +}; + +#endif \ No newline at end of file diff --git a/src/06_POLY/Testat/Rectangle.cpp b/src/06_POLY/Testat/Rectangle.cpp new file mode 100644 index 0000000..7aaa71a --- /dev/null +++ b/src/06_POLY/Testat/Rectangle.cpp @@ -0,0 +1,23 @@ +#include "Rectangle.h" + +Rectangle::Rectangle(int x, int y, int width, int height, Colors color) : Shape(Position(x, y), color) { + this->width = width; + this->height = height; +} + +void Rectangle::draw() { + int x_start = position.x - (width / 2); + int x_stop = position.x + (width / 2); + + int y_start = position.y - (height / 2); + int y_stop = position.y + (height / 2); + + for(int i = x_start; i <= x_stop; i++) { + ansiConsole.printText(i, position.y - (height / 2), "#", color); + ansiConsole.printText(i, position.y + (height / 2), "#", color); + } + for(int i = y_start; i< y_stop; i++) { + ansiConsole.printText(position.x + (width / 2), i, "#", color); + ansiConsole.printText(position.x - (width / 2), i, "#", color); + } +} \ No newline at end of file diff --git a/src/06_POLY/Testat/Rectangle.h b/src/06_POLY/Testat/Rectangle.h new file mode 100644 index 0000000..f8775b9 --- /dev/null +++ b/src/06_POLY/Testat/Rectangle.h @@ -0,0 +1,18 @@ +#include "Shape.h" + +#ifndef C_C_RECTANGLE_H +#define C_C_RECTANGLE_H + + +class Rectangle : public Shape{ +protected: + int width; + int height; + +public: + explicit Rectangle(int x = 0, int y = 0, int width = 0, int height = 0, Colors color = Colors::WHITE); + void draw() override; +}; + + +#endif //C_C_RECTANGLE_H diff --git a/src/06_POLY/Testat/Scene.cpp b/src/06_POLY/Testat/Scene.cpp new file mode 100644 index 0000000..9d25e7e --- /dev/null +++ b/src/06_POLY/Testat/Scene.cpp @@ -0,0 +1,19 @@ +#include "Scene.h" +#include + +Scene::Scene(std::vector shapes) : shapes(std::move(shapes)) { + +} + +void Scene::draw() { + ansiConsole.clearScreen(); + for(Shape* shape : shapes) { + shape->draw(); + } +} + +Scene::~Scene() { + for(Shape* shape : shapes) { + delete shape; + } +} diff --git a/src/06_POLY/Testat/Scene.h b/src/06_POLY/Testat/Scene.h new file mode 100644 index 0000000..90e3352 --- /dev/null +++ b/src/06_POLY/Testat/Scene.h @@ -0,0 +1,17 @@ +#include +#include "Shape.h" + +#ifndef C_C_SCENE_H +#define C_C_SCENE_H + +class Scene { +private: + std::vector shapes; +public: + explicit Scene(std::vector shapes); + void draw(); + ~Scene(); +}; + + +#endif //C_C_SCENE_H diff --git a/src/06_POLY/Testat/Shape.cpp b/src/06_POLY/Testat/Shape.cpp new file mode 100644 index 0000000..6fa576c --- /dev/null +++ b/src/06_POLY/Testat/Shape.cpp @@ -0,0 +1,9 @@ +#include "Position.h" +#include "Shape.h" + +Shape::Shape(Position position, Colors color) { + this->position = position; + this->color = color; +} + +Shape::~Shape() = default; \ No newline at end of file diff --git a/src/06_POLY/Testat/Shape.h b/src/06_POLY/Testat/Shape.h new file mode 100644 index 0000000..2c803d3 --- /dev/null +++ b/src/06_POLY/Testat/Shape.h @@ -0,0 +1,17 @@ +#ifndef C_C_SHAPE_H +#define C_C_SHAPE_H + +#include "../../helpers/AnsiConsole.h" +#include "Position.h" + +class Shape { +protected: + Position position; + Colors color; +public: + Shape(Position position, Colors color); + virtual ~Shape(); + virtual void draw() = 0; +}; + +#endif \ No newline at end of file diff --git a/src/06_POLY/Testat/shapes_main.cpp b/src/06_POLY/Testat/shapes_main.cpp index f09dcb8..2c96230 100644 --- a/src/06_POLY/Testat/shapes_main.cpp +++ b/src/06_POLY/Testat/shapes_main.cpp @@ -1,139 +1,9 @@ -#include "../../helpers/AnsiConsole.h" -#include #include - -struct Position { - int x; - int y; - - explicit Position(int x_ = 0, int y_ = 0) { - x = x_; - y = y_; - } -}; - -class Shape { -protected: - Position position; - Colors color; -public: - Shape(Position position, Colors color); - virtual ~Shape(); - virtual void draw() = 0; -}; - -Shape::Shape(Position position, Colors color) { - this->position = position; - this->color = color; -} - -Shape::~Shape() = default; - -class Point : public Shape{ - -public: - explicit Point(int x, int y, Colors color); - void draw() override; -}; - -Point::Point(int x, int y, Colors color) : Shape(Position(x, y), color) { - -} - -void Point::draw() { - ansiConsole.printText(position.x, position.y, "*", color); -} - -class Circle : public Shape{ -protected: - int _radius; -public: - explicit Circle(int x = 0, int y = 0, int radius = 0, Colors color = Colors::GREEN); - - void draw() override; -}; - -Circle::Circle(int x, int y, int radius, Colors color) : Shape(Position(x, y), color) { - _radius = radius; -} - -void Circle::draw() { - /* see https://de.wikibooks.org/wiki/Formelsammlung_Mathematik:_Geometrie - * Höhensatz des Euklid - * */ - int x_start = position.x - _radius / 2; - int x_stop = position.x + _radius / 2; - - for (int i = x_start; i <= x_stop; i++) { - double x_relative = double(i) - double(x_start); - double h = sqrt(x_relative * (x_stop - x_start - x_relative)); - ansiConsole.printText(position.x + int(x_relative) - _radius / 2, - static_cast(position.y + h), "#", - color); - ansiConsole.printText(position.x + int(x_relative) - _radius / 2, - static_cast(position.y - h), "#", - color); - - } -} - -class Rectangle : public Shape{ -protected: - int width; - int height; - -public: - explicit Rectangle(int x = 0, int y = 0, int width = 0, int height = 0, Colors color = Colors::WHITE); - void draw() override; -}; - -Rectangle::Rectangle(int x, int y, int width, int height, Colors color) : Shape(Position(x, y), color) { - this->width = width; - this->height = height; -} - -void Rectangle::draw() { - int x_start = position.x - (width / 2); - int x_stop = position.x + (width / 2); - - int y_start = position.y - (height / 2); - int y_stop = position.y + (height / 2); - - for(int i = x_start; i <= x_stop; i++) { - ansiConsole.printText(i, position.y - (height / 2), "#", color); - ansiConsole.printText(i, position.y + (height / 2), "#", color); - } - for(int i = y_start; i< y_stop; i++) { - ansiConsole.printText(position.x + (width / 2), i, "#", color); - ansiConsole.printText(position.x - (width / 2), i, "#", color); - } -} - -class Scene { -private: - std::vector shapes; -public: - explicit Scene(std::vector shapes); - void draw(); - ~Scene(); -}; - -Scene::Scene(std::vector shapes) : shapes(std::move(shapes)) { - -} - -void Scene::draw() { - ansiConsole.clearScreen(); - for(Shape* shape : shapes) { - shape->draw(); - } -} - -Scene::~Scene() { - for(Shape* shape : shapes) { - delete shape; - } -} +#include "Shape.h" +#include "Point.h" +#include "Circle.h" +#include "Rectangle.h" +#include "Scene.h" int main(int argc, char **argv) { std::vector shapes; @@ -149,6 +19,10 @@ int main(int argc, char **argv) { shapes.push_back(new Rectangle(5, 21, 10, 10, Colors::MAGENTA)); + shapes.push_back(new Point(5, 10, Colors::WHITE)); + shapes.push_back(new Point(15, 7, Colors::WHITE)); + shapes.push_back(new Point(7, 5, Colors::WHITE)); + auto *s = new Scene(shapes); s->draw(); @@ -157,4 +31,4 @@ int main(int argc, char **argv) { return 0; -} +} \ No newline at end of file