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
5namespace 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:
21
24
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
Definition: GLSLProgram.h:33
Definition: light.h:9
Util::Point3D _diffuse
Definition: light.h:23
virtual void _read(std::istream &stream)=0
virtual Util::Point3D getAmbient(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const =0
virtual void _write(std::ostream &stream) const =0
virtual Util::Point3D getDiffuse(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const =0
friend std::istream & operator>>(std::istream &, Light &)
Definition: light.h:64
virtual void drawOpenGL(int index, GLSLProgram *glslProgram) const =0
virtual Util::Point3D getSpecular(Util::Ray3D ray, const class RayShapeIntersectionInfo &iInfo, const Material &material) const =0
friend std::ostream & operator<<(std::ostream &, const Light &)
Definition: light.h:61
virtual bool isInShadow(const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, unsigned int tIdx) const =0
virtual Util::Point3D transparency(const class RayShapeIntersectionInfo &iInfo, const class Shape &shape, Util::Point3D cLimit, unsigned int samples, unsigned int tIdx) const =0
Util::Point3D _ambient
Definition: light.h:20
virtual std::string name(void) const =0
virtual ~Light(void)
Definition: light.h:30
Util::Point3D _specular
Definition: light.h:26
Definition: scene.h:249
Definition: scene.h:223
Definition: shape.h:89
Definition: geometry.h:299
Definition: box.h:7
std::istream & operator>>(std::istream &stream, Camera &camera)
Definition: camera.cpp:15
std::ostream & operator<<(std::ostream &stream, const Camera &camera)
Definition: camera.cpp:25