From 04412af2421fd062a2b1ca74fddb47e4023ab06a Mon Sep 17 00:00:00 2001 From: gruszczrob <=> Date: Thu, 6 Jun 2024 16:00:43 +0200 Subject: [PATCH 1/2] Implementation of Drawing Engine --- DrawingEngine/CMakeLists.txt | 15 +++++++++++++++ DrawingEngine/DrawingEngine.cpp | 8 ++++++++ DrawingEngine/DrawingEngine.h | 25 +++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 DrawingEngine/CMakeLists.txt create mode 100644 DrawingEngine/DrawingEngine.cpp create mode 100644 DrawingEngine/DrawingEngine.h diff --git a/DrawingEngine/CMakeLists.txt b/DrawingEngine/CMakeLists.txt new file mode 100644 index 0000000..b18e8f0 --- /dev/null +++ b/DrawingEngine/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.10) + +# Set the project name +project(DrawingEngine) + +# Create a library target for DrawingEngine module +add_library(DrawingEngine STATIC + DrawingEngine.cpp + DrawingEngine.h +) + +# Set the include directory +target_include_directories(DrawingEngine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(DrawingEngine PUBLIC ClassFactory) + diff --git a/DrawingEngine/DrawingEngine.cpp b/DrawingEngine/DrawingEngine.cpp new file mode 100644 index 0000000..3079cbc --- /dev/null +++ b/DrawingEngine/DrawingEngine.cpp @@ -0,0 +1,8 @@ +#include "DrawingEngine.h" + +DrawingEngine::DrawingEngine(any widthI, any heightI) : ClassFactory() { + if (!setVar(width, widthI, "width") || !setVar(height, heightI, "height")) { + setNotCorrected(); + } +} + diff --git a/DrawingEngine/DrawingEngine.h b/DrawingEngine/DrawingEngine.h new file mode 100644 index 0000000..8727bf4 --- /dev/null +++ b/DrawingEngine/DrawingEngine.h @@ -0,0 +1,25 @@ +#ifndef DRAWINGENGINE_H +#define DRAWINGENGINE_H + +#include +#include +#include +#include +#include "../Logs/Logs.h" +#include "../ClassFactory/ClassFactory.h" + +using namespace std; + +class DrawingEngine : public ClassFactory { +private: + shared_ptr width = make_shared(); + shared_ptr height = make_shared(); + +public: + DrawingEngine(any widthI, any heightI); + + virtual void print(vector> grid) = 0; +}; + +#endif /* DRAWINGENGINE_H */ + From f1f5d5eba6cdfa1b9c127fcfeb36ba962a72bd79 Mon Sep 17 00:00:00 2001 From: gruszczrob <=> Date: Thu, 6 Jun 2024 16:16:49 +0200 Subject: [PATCH 2/2] Implementation of DrawingEngine --- DrawingEngine/DrawingEngine.cpp | 6 +++--- DrawingEngine/DrawingEngine.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DrawingEngine/DrawingEngine.cpp b/DrawingEngine/DrawingEngine.cpp index 3079cbc..6773d97 100644 --- a/DrawingEngine/DrawingEngine.cpp +++ b/DrawingEngine/DrawingEngine.cpp @@ -1,8 +1,8 @@ #include "DrawingEngine.h" DrawingEngine::DrawingEngine(any widthI, any heightI) : ClassFactory() { - if (!setVar(width, widthI, "width") || !setVar(height, heightI, "height")) { - setNotCorrected(); - } + if (!setVar(width, widthI, "width") || !setVar(height, heightI, "height")) { + setNotCorrected(); + } } diff --git a/DrawingEngine/DrawingEngine.h b/DrawingEngine/DrawingEngine.h index 8727bf4..0f763ac 100644 --- a/DrawingEngine/DrawingEngine.h +++ b/DrawingEngine/DrawingEngine.h @@ -12,13 +12,13 @@ using namespace std; class DrawingEngine : public ClassFactory { private: - shared_ptr width = make_shared(); - shared_ptr height = make_shared(); + shared_ptr width = make_shared(); + shared_ptr height = make_shared(); public: - DrawingEngine(any widthI, any heightI); + DrawingEngine(any widthI, any heightI); - virtual void print(vector> grid) = 0; + virtual void print(vector> grid) = 0; }; #endif /* DRAWINGENGINE_H */