-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlayer.h
108 lines (69 loc) · 2.95 KB
/
layer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// Defines attributes of a layer.
#ifndef LAYER_H
#define LAYER_H
#include "absorber.h"
#include "coordinates.h"
#include <vector>
class Layer
{
public:
Layer(double mu_a, double mu_s, double ref_index, double anisotropy,
double depth_start, double depth_end);
~Layer(void);
// Returns the absorption coefficient of the layer.
double getAbsorpCoeff(void) const {return mu_a;}
// Returns the absorption coeffiecient of the layer based on the photon's coordinates
// Checks are made to see if the photon has made it's way into an absorber as well.
double getAbsorpCoeff(const boost::shared_ptr<Vector3d> photonVector);
// Returns the scattering coefficient of the layer.
double getScatterCoeff(void) const {return mu_s;}
double getScatterCoeff(const boost::shared_ptr<Vector3d> photonVector);
// Returns total interaction coefficient (mu_a + mu_s).
double getTotalAttenuationCoeff(void) const {return mu_t;}
double getTotalAttenuationCoeff(const boost::shared_ptr<Vector3d> photonVector);
// Return the albedo
double getAlbedo(void) const {return albedo;}
// Return the anisotropy of the layer.
double getAnisotropy(void) {return g;}
double getAnisotropy(const boost::shared_ptr<Vector3d> photonVector);
// Return the impedance of the layer.
double getImpedance(void) {return impedance;}
double getDepthStart(void) const {return depth_start;}
double getDepthEnd(void) const {return depth_end;}
// Return the refractive index of the layer.
double getRefractiveIndex(void) const {return refractive_index;}
double getRefractiveIndex(const boost::shared_ptr<Vector3d> photonVector);
void setAbsorpCoeff(const double mu_a);
void setScatterCoeff(const double mu_s);
void updateAlbedo();
void addAbsorber(Absorber * a);
void updateAbsorbedWeightByAbsorber(const boost::shared_ptr<Vector3d> currLocation, const double absorbed);
// Iterate over all absorbers and write their data out to file.
void writeAbsorberData(void);
// Return the absorber at this location 'currLocation' in the medium.
Absorber * getAbsorber(const boost::shared_ptr<Vector3d> currLocation);
private:
// Anisotropy factor.
double g;
// Absorption coefficient
double mu_a;
// Scattering coefficient
double mu_s;
// Transmission coefficient
double mu_t;
// The refractive index of the layer
double refractive_index;
// The width of the layer.
//double radial_size;
// z-coordinate value at which the layer starts.
double depth_start;
// z-coordinate value at which the layer ends.
double depth_end;
// Albedo of the layer.
double albedo;
// The impedance of the layer.
double impedance;
// A vector that holds all the abosrbers in this layer.
std::vector<Absorber *> p_absorbers;
};
#endif // end LAYER_H