From 1e2588441fa40063f01f607ad1510744fb0fd931 Mon Sep 17 00:00:00 2001 From: Godzil Date: Sat, 15 Feb 2020 23:18:04 +0000 Subject: [PATCH] Rename tuple file to remove the plural. Also add empty shell ray. --- source/CMakeLists.txt | 5 +++-- source/include/colour.h | 2 +- source/include/matrix.h | 2 +- source/include/ray.h | 12 ++++++++++++ source/include/{tuples.h => tuple.h} | 6 +++--- source/matrix.cpp | 2 +- source/objects/ray.cpp | 8 ++++++++ source/{tuples.cpp => tuple.cpp} | 2 +- tests/matrix_test.cpp | 2 +- tests/transformation_test.cpp | 2 +- tests/tuples_test.cpp | 2 +- 11 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 source/include/ray.h rename source/include/{tuples.h => tuple.h} (96%) create mode 100644 source/objects/ray.cpp rename source/{tuples.cpp => tuple.cpp} (97%) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 776325d..a0f5909 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -3,8 +3,9 @@ # First most is build as a library add_library(rayonnement STATIC) -set(RAY_HEADERS include/tuples.h include/math_helper.h include/colour.h include/canvas.h include/matrix.h include/transformation.h) -set(RAY_SOURCES tuples.cpp math_helper.cpp colour.cpp canvas.cpp matrix.cpp transformation.cpp) +set(RAY_HEADERS include/tuple.h include/math_helper.h include/colour.h include/canvas.h include/matrix.h include/transformation.h + include/ray.h) +set(RAY_SOURCES tuple.cpp math_helper.cpp colour.cpp canvas.cpp matrix.cpp transformation.cpp objects/ray.cpp) target_include_directories(rayonnement PUBLIC include) target_sources(rayonnement PRIVATE ${RAY_HEADERS} ${RAY_SOURCES}) diff --git a/source/include/colour.h b/source/include/colour.h index 33c89bd..5f1af6f 100644 --- a/source/include/colour.h +++ b/source/include/colour.h @@ -9,7 +9,7 @@ #ifndef DORAYME_COLOUR_H #define DORAYME_COLOUR_H -#include +#include class Colour : public Tuple { diff --git a/source/include/matrix.h b/source/include/matrix.h index 1589706..be644f6 100644 --- a/source/include/matrix.h +++ b/source/include/matrix.h @@ -9,7 +9,7 @@ #ifndef DORAYME_MATRIX_H #define DORAYME_MATRIX_H -#include +#include class Matrix { diff --git a/source/include/ray.h b/source/include/ray.h new file mode 100644 index 0000000..d525021 --- /dev/null +++ b/source/include/ray.h @@ -0,0 +1,12 @@ +/* + * DoRayMe - a quick and dirty Raytracer + * Ray header + * + * Created by Manoël Trapier + * Copyright (c) 2020 986-Studio. + * + */ +#ifndef DORAYME_RAY_H +#define DORAYME_RAY_H + +#endif //DORAYME_RAY_H diff --git a/source/include/tuples.h b/source/include/tuple.h similarity index 96% rename from source/include/tuples.h rename to source/include/tuple.h index 95b475a..58d2624 100644 --- a/source/include/tuples.h +++ b/source/include/tuple.h @@ -6,8 +6,8 @@ * Copyright (c) 2020 986-Studio. * */ -#ifndef DORAYME_TUPLES_H -#define DORAYME_TUPLES_H +#ifndef DORAYME_TUPLE_H +#define DORAYME_TUPLE_H #include @@ -56,4 +56,4 @@ public: Vector cross(const Vector &b) const; }; -#endif /* DORAYME_TUPLES_H */ +#endif /*DORAYME_TUPLE_H*/ diff --git a/source/matrix.cpp b/source/matrix.cpp index 446d6ac..ec730fc 100644 --- a/source/matrix.cpp +++ b/source/matrix.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include Matrix::Matrix(int width) diff --git a/source/objects/ray.cpp b/source/objects/ray.cpp new file mode 100644 index 0000000..df4c372 --- /dev/null +++ b/source/objects/ray.cpp @@ -0,0 +1,8 @@ +/* + * DoRayMe - a quick and dirty Raytracer + * Ray implementation + * + * Created by Manoël Trapier + * Copyright (c) 2020 986-Studio. + * + */ \ No newline at end of file diff --git a/source/tuples.cpp b/source/tuple.cpp similarity index 97% rename from source/tuples.cpp rename to source/tuple.cpp index daa7b96..0cdcdcc 100644 --- a/source/tuples.cpp +++ b/source/tuple.cpp @@ -6,7 +6,7 @@ * Copyright (c) 2020 986-Studio. * */ -#include +#include #include diff --git a/tests/matrix_test.cpp b/tests/matrix_test.cpp index 26a6f05..e51b92b 100644 --- a/tests/matrix_test.cpp +++ b/tests/matrix_test.cpp @@ -7,7 +7,7 @@ * */ #include -#include +#include #include #include diff --git a/tests/transformation_test.cpp b/tests/transformation_test.cpp index accf02f..6653d1c 100644 --- a/tests/transformation_test.cpp +++ b/tests/transformation_test.cpp @@ -7,7 +7,7 @@ * */ #include -#include +#include #include #include diff --git a/tests/tuples_test.cpp b/tests/tuples_test.cpp index d552d53..cf698f2 100644 --- a/tests/tuples_test.cpp +++ b/tests/tuples_test.cpp @@ -6,7 +6,7 @@ * Copyright (c) 2020 986-Studio. * */ -#include +#include #include #include