Raytracer
Loading...
Searching...
No Matches
Materials.hpp
1#include <memory>
2#include "Common.hpp"
3#include "arguments/Kinds.hpp"
4#include "interfaces/IArguments.hpp"
5#include "interfaces/ITexture.hpp"
6#include "utils/VecN.hpp"
7
8#ifndef __ARG_MATERIALS_HPP__
9 #define __ARG_MATERIALS_HPP__
10
11namespace Raytracer::Arguments
12{
14 private:
15 ArgumentKind _kind;
16 Utils::Vec3 _color;
17 std::shared_ptr<Interfaces::ITexture> _texture = nullptr;
18
19 public:
20 Lambertian(Utils::Vec3 color) : _color(color)
21 {
22 _kind = ArgumentKind::ARG_LAMBERTIAN_COLOR;
23 }
24 Lambertian(double r, double g, double b) : _color(r, g, b)
25 {
26 _kind = ArgumentKind::ARG_LAMBERTIAN_TEXTURE;
27 }
28 Lambertian(std::shared_ptr<Interfaces::ITexture> texture)
29 : _texture(texture)
30 {
31 _kind = ArgumentKind::ARG_LAMBERTIAN_TEXTURE;
32 }
33 GET_SET(Utils::Vec3, color);
34 GET_SET(std::shared_ptr<Interfaces::ITexture>, texture);
35 ARG_KIND(_kind);
36 };
37
39 private:
40 ArgumentKind _kind;
41 double _refractionIndex;
42 Utils::Color _color;
43
44 public:
45 Dielectric(double refractionIndex) : _refractionIndex(refractionIndex)
46 {
47 _kind = ArgumentKind::ARG_DIELECTRIC;
48 }
49 Dielectric(double refractionIndex, Utils::Color color)
50 : _refractionIndex(refractionIndex)
51 {
52 _kind = ArgumentKind::ARG_DIELECTRIC_COLOR;
53 }
54 GET_SET(double, refractionIndex);
55 GET_SET(Utils::Color, color);
56 ARG_KIND(_kind);
57 };
58
60 private:
61 ArgumentKind _kind;
62 Utils::Vec3 _color;
63 std::shared_ptr<Interfaces::ITexture> _texture = nullptr;
64
65 public:
66 DiffuseLight(Utils::Vec3 color) : _color(color)
67 {
68 _kind = ArgumentKind::ARG_DIFFUSE_LIGHT_COLOR;
69 }
70 DiffuseLight(std::shared_ptr<Interfaces::ITexture> texture)
71 : _texture(texture)
72 {
73 _kind = ArgumentKind::ARG_DIFFUSE_LIGHT_TEXTURE;
74 }
75 GET_SET(Utils::Vec3, color);
76 GET_SET(std::shared_ptr<Interfaces::ITexture>, texture);
77 ARG_KIND(_kind);
78 };
79
81 private:
82 ArgumentKind _kind;
83 Utils::Color _color;
84 std::shared_ptr<Interfaces::ITexture> _texture = nullptr;
85
86 public:
87 Isotropic(Utils::Color color) : _color(color)
88 {
89 _kind = ArgumentKind::ARG_ISOTROPIC_COLOR;
90 }
91 Isotropic(std::shared_ptr<Interfaces::ITexture> texture)
92 : _texture(texture)
93 {
94 _kind = ArgumentKind::ARG_ISOTROPIC_TEXTURE;
95 }
96 GET_SET(Utils::Color, color);
97 GET_SET(std::shared_ptr<Interfaces::ITexture>, texture);
98 ARG_KIND(_kind);
99 };
100
102 private:
103 Utils::Vec3 _color;
104 double _fuzz;
105
106 public:
107 Metal(Utils::Vec3 color, double fuzz) : _color(color), _fuzz(fuzz)
108 {
109 }
110 GET_SET(Utils::Vec3, color);
111 GET_SET(double, fuzz);
112 ARG_KIND(ArgumentKind::ARG_METAL);
113 };
114} // namespace Raytracer::Arguments
115
116#endif /* __ARG_MATERIALS_HPP__ */
Definition Materials.hpp:38
Definition Materials.hpp:59
Definition Materials.hpp:80
Definition Materials.hpp:13
Definition Materials.hpp:101
Definition IArguments.hpp:8
Definition VecN.hpp:40