Photon.h
Go to the documentation of this file.
1 #ifndef _utl_Photon_h_
2 #define _utl_Photon_h_
3 
4 #include <utl/Point.h>
5 #include <utl/Vector.h>
6 #include <utl/TimeInterval.h>
7 
8 
9 namespace utl {
10 
11  class Photon {
12 
13  public:
14  Photon() = default;
15 
16  Photon(const utl::Point& p, const utl::Vector& n,
17  const double lambda, const double weight, const int source = 0)
18  : fWeight(weight), fSource(source), fPosition(p), fDirection(n), fWavelength(lambda) { }
19 
21  double GetWeight() const { return fWeight; }
22 
24  int GetSource() const { return fSource; }
25  const utl::Point& GetPosition() const { return fPosition; }
26  const utl::Vector& GetDirection() const { return fDirection; }
27  double GetWavelength() const { return fWavelength; }
28  utl::TimeInterval GetTime() const { return fTime; }
29 
31  void SetWeight(const double w) { fWeight = w; }
32  void SetSource(const int source ) { fSource = source; }
33  void SetPosition(const utl::Point& p) { fPosition = p; }
34  void SetDirection(const utl::Vector& v) { fDirection = v; }
35  void SetWavelength(const double wl) { fWavelength = wl; }
36  void SetTime(const utl::TimeInterval& t) { fTime = t; }
37 
38  private:
39  double fWeight = 0;
40  int fSource = 0;
43  double fWavelength = 0;
45 
46  };
47 
48 }
49 
50 
51 #endif
Point object.
Definition: Point.h:32
double fWeight
Definition: Photon.h:39
double GetWeight() const
weight assigned to the photon
Definition: Photon.h:21
utl::TimeInterval fTime
Definition: Photon.h:44
int GetSource() const
source of the photons. Should use Eye::LightSource enum types
Definition: Photon.h:24
void SetPosition(const utl::Point &p)
Definition: Photon.h:33
double fWavelength
Definition: Photon.h:43
Photon()=default
void SetSource(const int source)
Definition: Photon.h:32
void SetWeight(const double w)
source of the photons. Should use Eye::LightSource enum types
Definition: Photon.h:31
const utl::Vector & GetDirection() const
Definition: Photon.h:26
int fSource
Definition: Photon.h:40
Photon(const utl::Point &p, const utl::Vector &n, const double lambda, const double weight, const int source=0)
Definition: Photon.h:16
A TimeInterval is used to represent time elapsed between two events.
Definition: TimeInterval.h:43
Vector object.
Definition: Vector.h:30
void SetWavelength(const double wl)
Definition: Photon.h:35
double GetWavelength() const
Definition: Photon.h:27
utl::Vector fDirection
Definition: Photon.h:42
void SetTime(const utl::TimeInterval &t)
Definition: Photon.h:36
utl::TimeInterval GetTime() const
Definition: Photon.h:28
void SetDirection(const utl::Vector &v)
Definition: Photon.h:34
utl::Point fPosition
Definition: Photon.h:41
const utl::Point & GetPosition() const
Definition: Photon.h:25

, generated on Tue Sep 26 2023.