diff --git a/.github/workflows/miniRT_test.yml b/.github/workflows/miniRT_test.yml index a2fea66..4ef3ec7 100644 --- a/.github/workflows/miniRT_test.yml +++ b/.github/workflows/miniRT_test.yml @@ -26,11 +26,11 @@ jobs: - uses: actions/checkout@v3 # Runs a set of commands using the runners shell - - name: Set up Criterion framework on Ubuntu 22.04 + - name: Set up Criterion framework and norminette on Ubuntu 22.04 run: | sudo apt-get install libcriterion-dev libbsd-dev -y python3 -m pip install --upgrade pip setuptools - python3 -m pip install norminette + python3 -m pip install norminette==3.3.55 # Runs a single command using the runners shell - name: Run norminette validation run: norminette include src diff --git a/include/parser.h b/include/parser.h index 46db6c9..d18d3ba 100644 --- a/include/parser.h +++ b/include/parser.h @@ -6,12 +6,13 @@ /* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/10 12:11:15 by mdias-ma #+# #+# */ -/* Updated: 2023/06/16 13:40:10 by yde-goes ### ########.fr */ +/* Updated: 2024/04/04 13:28:12 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ /// @file parser.h #ifndef PARSER_H +# define PARSER_H # include # include @@ -54,6 +55,29 @@ typedef enum e_token TOKEN_COUNT } t_token; +/** + * @brief Stores the parameters of the shapes cone and cylinder from + * configuration file after they have been verified by the scanner. + * + * @param origin Stores the origin of the cone or cylinder. + * @param direction Stores the direction of the cone or cylinder. + * @param diameter Stores the diameter of the cone or cylinder. + * @param height Stores the height of the cone or cylinder. + * @param radius Stores the radius of the cone or cylinder. + * @param minimum Stores the cone or cylinder minimum height/lowest height. + * @param maximum Stores the cone or cylinder maxinum height/highest height. + */ +typedef struct s_param +{ + t_point origin; + t_vector direction; + double diameter; + double height; + float radius; + float minimum; + float maximum; +} t_param; + /** * @brief Represents a scanner. * diff --git a/include/shapes.h b/include/shapes.h index caeadb6..071b89a 100644 --- a/include/shapes.h +++ b/include/shapes.h @@ -6,7 +6,7 @@ /* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/28 18:05:41 by mdias-ma #+# #+# */ -/* Updated: 2023/06/16 13:40:21 by yde-goes ### ########.fr */ +/* Updated: 2024/04/04 09:30:35 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ @@ -105,7 +105,8 @@ typedef t_tuple (*t_normal_at)(t_shape *, t_tuple); */ typedef struct s_shape { - union { + union + { t_sphere sphere; t_plane plane; t_cylinder cylinder; diff --git a/src/parser/parse_shapes_2.c b/src/parser/parse_shapes_2.c index 4440e8a..063cfe2 100644 --- a/src/parser/parse_shapes_2.c +++ b/src/parser/parse_shapes_2.c @@ -3,26 +3,15 @@ /* ::: :::::::: */ /* parse_shapes_2.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: mdias-ma +#+ +:+ +#+ */ +/* By: yde-goes +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/05/30 15:27:09 by mdias-ma #+# #+# */ -/* Updated: 2023/06/11 10:27:33 by mdias-ma ### ########.fr */ +/* Updated: 2024/04/04 09:33:36 by yde-goes ### ########.fr */ /* */ /* ************************************************************************** */ #include "parser.h" -typedef struct s_param -{ - t_point origin; - t_vector direction; - double diameter; - double height; - float radius; - float minimum; - float maximum; -} t_param; - static void set_cone_attributes(t_shape *shape, t_param param); static void set_cylinder_attributes(t_shape *shape, t_param param);