RayZaler 0.1
The free opto-mechanical simulation framework
SkySampler.h
1//
2// Copyright (c) 2024 Gonzalo José Carracedo Carballal
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Lesser General Public License as
6// published by the Free Software Foundation, either version 3 of the
7// License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public
15// License along with this program. If not, see
16// <http://www.gnu.org/licenses/>
17//
18
19#ifndef _SKY_SAMPLER_H
20#define _SKY_SAMPLER_H
21
22#include <Samplers/Circular.h>
23#include <Samplers/Ring.h>
24#include <Samplers/Map.h>
25
26namespace RZ {
27 enum SkyObjectShape {
28 PointLike,
29 CircleLike,
30 RingLike,
31 Extended
32 };
33
34 class SkySampler {
35 MapSampler m_mapSampler;
36 CircularSampler m_circularSampler;
37 RingSampler m_ringSampler;
38 Sampler *m_sampler = nullptr;
39 SkyObjectShape m_shape = PointLike;
40 Real m_diameter = M_PI / 6; // Radians
41 Vec3 m_centralAxis = -Vec3::eZ();
42 bool m_random = false;
43 unsigned int m_nRays = 1000;
44 std::string m_path;
45 bool m_dirty = true;
46
47 void reconfigure();
48
49 public:
50 SkySampler(Vec3 const &direction);
51 void setShape(SkyObjectShape);
52 void setNumRays(unsigned);
53 void setDiameter(Real);
54 void setRandom(bool);
55 void setPath(std::string const &);
56 bool get(Vec3 &);
57 };
58}
59
60#endif // _SKY_SAMPLER_H
Definition: Circular.h:25
Definition: Map.h:26
Definition: Ring.h:25
Definition: Sampler.h:27
Definition: SkySampler.h:34
Definition: Vector.h:66