Assignments Assignments

light.h
Go to the documentation of this file.
1#ifndef RAY_LIGHT_INCLUDED
2#define RAY_LIGHT_INCLUDED
3#include "shape.h"
4
5 namespace Ray
6{
8 class Light
9 {
10 friend std::ostream &operator << ( std::ostream & , const Light & );
11 friend std::istream &operator >> ( std::istream & , Light & );
12
14 virtual void _write( std::ostream &stream ) const=0;
15
17 virtual void _read( std::istream &stream )=0;
18 protected:
20 Util::Point3D _ambient;
21
23 Util::Point3D _diffuse;
24
26 Util::Point3D _specular;
27
28 public:
30 virtual ~Light( void ){}
31
33 virtual std::string name( void ) const = 0;
34
36 virtual Util::Point3D getAmbient( Util::Ray3D ray , const class RayShapeIntersectionInfo& iInfo , const Material &material ) const=0;
37
39 virtual Util::Point3D getDiffuse( Util::Ray3D ray , const class RayShapeIntersectionInfo& iInfo , const Material &material ) const=0;
40
42 virtual Util::Point3D getSpecular( Util::Ray3D ray , const class RayShapeIntersectionInfo& iInfo , const Material &material ) const=0;
43
46 virtual bool isInShadow( const class RayShapeIntersectionInfo& iInfo , const class Shape &shape , unsigned int tIdx ) const=0;
47
53 virtual Util::Point3D transparency( const class RayShapeIntersectionInfo &iInfo , const class Shape &shape , Util::Point3D cLimit , unsigned int samples , unsigned int tIdx ) const=0;
54
57 virtual void drawOpenGL( int index , GLSLProgram * glslProgram ) const=0;
58 };
59
61 inline std::ostream &operator << ( std::ostream &stream , const Light &light ){ light._write( stream ) ; return stream; }
62
64 inline std::istream &operator >> ( std::istream &stream , Light &light ){ light._read( stream ) ; return stream; }
65}
66#endif // RAY_LIGHT_INCLUDED
67
68
GLSLProgram
Definition GLSLProgram.h:33
Ray::Light
Definition light.h:9
Ray::Light::_diffuse
Util::Point3D _diffuse
Definition light.h:23
Ray::Light::_read
virtual void _read(std::istream &stream)=0
Ray::Light::getAmbient
virtual Util::Point3D getAmbient(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const =0
Ray::Light::_write
virtual void _write(std::ostream &stream) const =0
Ray::Light::getDiffuse
virtual Util::Point3D getDiffuse(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const =0
Ray::Light::operator<<
friend std::ostream & operator<<(std::ostream &, const Light &)
Definition light.h:61
Ray::Light::drawOpenGL
virtual void drawOpenGL(int index, GLSLProgram *glslProgram) const =0
Ray::Light::getSpecular
virtual Util::Point3D getSpecular(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const =0
Ray::Light::isInShadow
virtual bool isInShadow(const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, unsigned int tIdx) const =0
Ray::Light::transparency
virtual Util::Point3D transparency(const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, Util::Point3D cLimit, unsigned int samples, unsigned int tIdx) const =0
Ray::Light::_ambient
Util::Point3D _ambient
Definition light.h:20
Ray::Light::name
virtual std::string name(void) const =0
Ray::Light::~Light
virtual ~Light(void)
Definition light.h:30
Ray::Light::_specular
Util::Point3D _specular
Definition light.h:26
Ray::Light::operator>>
friend std::istream & operator>>(std::istream &, Light &)
Definition light.h:64
Ray::Material
Definition scene.h:249
Ray::RayShapeIntersectionInfo
Definition scene.h:223
Ray::Shape
Definition shape.h:90
Ray
Definition box.h:7
Ray::operator>>
std::istream & operator>>(std::istream &stream, Camera &camera)
Definition camera.cpp:15
Ray::operator<<
std::ostream & operator<<(std::ostream &stream, const Camera &camera)
Definition camera.cpp:25
Util::Point3D
Point< 3 > Point3D
Definition geometry.h:526
Util::Ray3D
Ray< 3 > Ray3D
Definition geometry.h:562
shape.h