From 322ca4d7103e94c2518215a09a8996f9dbd496a1 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Mon, 17 May 2021 08:54:43 +0200 Subject: [PATCH] grid --- lib/Ray/CMakeLists.txt | 1 + lib/Ray/include/Drawables/3D/Grid.hpp | 54 +++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 lib/Ray/include/Drawables/3D/Grid.hpp diff --git a/lib/Ray/CMakeLists.txt b/lib/Ray/CMakeLists.txt index 8db06465..30f1a583 100644 --- a/lib/Ray/CMakeLists.txt +++ b/lib/Ray/CMakeLists.txt @@ -44,6 +44,7 @@ set(HEADERS include/Drawables/2D/Triangle.hpp include/Drawables/3D/Circle.hpp include/Drawables/3D/Cylinder.hpp + include/Drawables/3D/Grid.hpp include/Drawables/3D/Line.hpp include/Drawables/3D/Plane.hpp include/Drawables/3D/Point.hpp diff --git a/lib/Ray/include/Drawables/3D/Grid.hpp b/lib/Ray/include/Drawables/3D/Grid.hpp new file mode 100644 index 00000000..82682790 --- /dev/null +++ b/lib/Ray/include/Drawables/3D/Grid.hpp @@ -0,0 +1,54 @@ +/* +** EPITECH PROJECT, 2021 +** Bomberman +** File description: +** Grid +*/ + +#ifndef GRID_HPP_ +#define GRID_HPP_ + +#include "Drawables/ADrawable3D.hpp" + +namespace RAY::Drawable3D { + //! @brief a grid (centered at (0, 0, 0)) + class Grid: public ADrawable3D + { + public: + //! @brief Grid constructor + //! @param slices slices of the grid + //! @param spacing spacing of slices + Grid(int slices, float spacing); + + //! @brief A default copy constructor + Grid(const Grid &) = default; + + //! @brief A Grid is assignable + Grid &operator=(const Grid &) = default; + + //! @brief A default destructor + ~Grid() = default; + + //! @return the slices of the Grid + int getSlices(void) const; + + //! @return the spacing of the Grid + float getSpacing(void) const; + + //! @brief Set slices + Grid &setSlices(int slices); + + //! @brief Set spacing + Grid &setSpacing(float spacing); + + private: + //! @brief Grid slices + int _slices; + //! @brief Slices spacing + float _spacing; + }; +}; + + + +#endif /* !GRID_HPP_ */