Phongo Clap RT  1.0
Simple Raytracing Renderer
Scene.h
Go to the documentation of this file.
1 #ifndef _SCENE_H_
2 #define _SCENE_H_
3 
7 
8 #include <fstream>
9 #include <string>
10 #include <vector>
11 
12 #include "Shape.h"
13 #include "Light.h"
14 
15 //----------------------------------------------------------------------------------------------------------------------
19 //----------------------------------------------------------------------------------------------------------------------
20 class Scene
21 {
22 public:
23  //--------------------------------------------------------------------------------------------------------------------
25  //--------------------------------------------------------------------------------------------------------------------
26  Scene();
27  //--------------------------------------------------------------------------------------------------------------------
30  //--------------------------------------------------------------------------------------------------------------------
31  Scene(std::string _n);
32  //--------------------------------------------------------------------------------------------------------------------
34  //--------------------------------------------------------------------------------------------------------------------
35  ~Scene();
36  //--------------------------------------------------------------------------------------------------------------------
39  //--------------------------------------------------------------------------------------------------------------------
40  void addObject(geo::Shape *_object);
41  //--------------------------------------------------------------------------------------------------------------------
44  //--------------------------------------------------------------------------------------------------------------------
45  void addLight(Light *_light);
46 
47  // give access to Renderer class to the private interface
48  friend class Renderer;
49 
50 private:
51  //--------------------------------------------------------------------------------------------------------------------
53  //--------------------------------------------------------------------------------------------------------------------
54  std::string m_fileName;
55  //--------------------------------------------------------------------------------------------------------------------
57  //--------------------------------------------------------------------------------------------------------------------
58  std::vector<geo::Shape*> m_objects;
59  //--------------------------------------------------------------------------------------------------------------------
61  //--------------------------------------------------------------------------------------------------------------------
62  std::vector<Light*> m_lights;
63 };
64 
65 #endif // Scene.h
This is a base class that will be used as template when creating concretes types of light...
Definition: Light.h:18
Core of my program, central unit that manages all the other classes almost.
Definition: Renderer.h:23
~Scene()
Default destructor for the Scene class.
Definition: Scene.cpp:10
A class for the lights in the scene. There is no sepparate .cpp file due to its simplicity.
std::vector< Light * > m_lights
Holds all the Light instances of the scene.
Definition: Scene.h:62
Scene()
Default constructor.
Definition: Scene.cpp:6
void addObject(geo::Shape *_object)
Adds an shape obejct to the scene.
Definition: Scene.cpp:12
Semi abstract class with virtual methods that holds all the calls for getting intersections, getting normals, also for specifying the properties of the material that will be hold by the Material member of this class.
Definition: Shape.h:21
Hold all the objects and lights of the scene.
Definition: Scene.h:20
void addLight(Light *_light)
Adds a light to the scene structure.
Definition: Scene.cpp:17
std::string m_fileName
Holds the name of the file scene.
Definition: Scene.h:54
std::vector< geo::Shape * > m_objects
Holds all the Shape objects in the scene.
Definition: Scene.h:58