-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabsorber.h
66 lines (48 loc) · 1.73 KB
/
absorber.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
//
// absorber.h
// Xcode
//
// Created by jacob on 6/20/11.
//
#ifndef ABSORBER_H
#define ABSORBER_H
#include "vectorMath.h"
using namespace VectorMath;
#include <boost/thread/mutex.hpp>
// Forward declerations of objects.
class Vector3d;
class Logger;
class Absorber
{
public:
Absorber(const double x, const double y, const double z);
Absorber(const Vector3d &location);
Absorber(const boost::shared_ptr<Vector3d> location);
void InitCommon(void);
virtual ~Absorber();
virtual bool hitAbsorberBoundary(const boost::shared_ptr<Vector3d> photonVector) = 0;
virtual bool inAbsorber(const boost::shared_ptr<Vector3d> photonVector) = 0;
virtual bool crossedAbsorber(const boost::shared_ptr<Vector3d> currPoint,
const boost::shared_ptr<Vector3d> prevPoint) = 0;
double getAbsorberAbsorptionCoeff(void) {return this->mu_a;}
double getAbsorberScatteringCoeff(void) {return this->mu_s;}
void setAbsorberAbsorptionCoeff(const double mu_a) {this->mu_a = mu_a;}
void setAbsorberScatterCoeff(const double mu_s) {this->mu_s = mu_s;}
// Update absorber weight.
void updateAbsorbedWeight(const double absorbed);
// Write the absorber data out to file to be used in post-processing.
void writeData(void);
protected:
// The optical properties of the absorber.
double mu_a;
double mu_s;
double refractive_index;
double anisotropy;
double absorbedWeight;
// The coordinates of the center point of the absorber in the medium.
boost::shared_ptr<Vector3d> center;
// Create a mutex to serialize access when updating the absorbed weight.
// in this absorber.
boost::mutex m_mutex;
};
#endif