-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLightSource.h
More file actions
56 lines (38 loc) · 1.14 KB
/
Copy pathLightSource.h
File metadata and controls
56 lines (38 loc) · 1.14 KB
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
// Tyrus Malmstrom
// Header file for the LightSource.cpp
#ifndef LIGHTSOURCE_H_INCLUDE
#define LIGHTSOURCE_H_INCLUDE
// directives:
#include <iostream>
#include <Eigen/Dense>
#include "Color.h"
// Namespace:
using namespace std;
using Eigen::Vector4d;
class LightSource {
public:
// Constructor:
// Going to take a position (point), and an amount of Color :: red, green blue
LightSource( const Vector4d& _position, const Color& _energy ):
position( _position )
,energy ( _energy )
{ ++counter; };
// pprint member function:
void pprint(ostream& out = cout) const;
// copy assignment operator: 1 of the BIG THREE
const LightSource& operator= (const LightSource& rhs){
if( this != &rhs ){ // Standard alias test...
position = rhs.position;
energy = rhs.energy;
}
return *this;
}
Vector4d position;
Color energy;
protected:
static int counter; // to count the light sources in the scene.
};
//======================================================================
// output stream overloading:
ostream& operator<< (ostream& out, const LightSource& l);
#endif // LIGHTSOURCE_H_INCLUDE