MEPP2 Project
lightsampler.hpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; 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
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
13 #include <random>
14 #include <cmath>
15 
16 #include <Eigen/Geometry>
17 using namespace Eigen;
18 
20 {
21 public:
22  enum Method { NAIVE };
23 
24 public:
26  virtual ~LightSampler() {}
27 
28 public:
29  void sample(MatrixX3d &samples,
30  int n,
31  double phi_min = 0.,
32  double phi_max = M_PI,
33  Method method = NAIVE,
34  bool use_random = true) const;
35 
36  void sample_to_global(MatrixX3d &samples,
37  int n,
38  const Vector3d &up = Vector3d::UnitZ(),
39  double phi_min = 0.,
40  double phi_max = M_PI,
41  bool use_random = true,
42  Method method = NAIVE) const;
43 
44  void to_global(const MatrixX3d &local,
45  MatrixX3d &global,
46  const Vector3d &up = Vector3d::UnitZ()) const;
47 
48 protected:
49  void sample_naive(MatrixX3d &samples,
50  int n,
51  double phi_min = 0.,
52  double phi_max = M_PI,
53  bool use_random = true) const;
54 };
55 
56 #include "lightsampler.inl"
LightSampler
Definition: lightsampler.hpp:20
lightsampler.inl
LightSampler::~LightSampler
virtual ~LightSampler()
Definition: lightsampler.hpp:26
LightSampler::Method
Method
Definition: lightsampler.hpp:22
LightSampler::LightSampler
LightSampler()
Definition: lightsampler.hpp:25