RayTracer 1.0
Ray tracing is a technique used to generate realistic digital images by simulating the inverse path of light. Our goal is to create a program able to generate an image from a file describing the scene.
 
Loading...
Searching...
No Matches
RayTracer::Scene Class Reference

#include <Scene.hpp>

Public Member Functions

 Scene () noexcept
 
void addObject (std::shared_ptr< IPrimitive > obj)
 
void addLight (std::unique_ptr< ILight > light)
 
void setAmbientLight (std::unique_ptr< ILight > light)
 
void setCamera (const Camera &cam)
 
const CameragetCamera () const
 
const std::vector< std::shared_ptr< IPrimitive > > & getObjects () const
 
const std::vector< std::unique_ptr< ILight > > & getLights () const
 
const std::unique_ptr< ILight > & getAmbient () const
 

Private Attributes

std::vector< std::shared_ptr< IPrimitive > > _objects
 
std::vector< std::unique_ptr< ILight > > _lights
 
std::unique_ptr< ILight_ambient
 
Camera _camera
 

Detailed Description

Definition at line 16 of file Scene.hpp.

Constructor & Destructor Documentation

◆ Scene()

RayTracer::Scene::Scene ( )
noexcept

Definition at line 9 of file Scene.cpp.

9 : _objects(), _lights(), _ambient(nullptr)
10{}
std::vector< std::shared_ptr< IPrimitive > > _objects
Definition Scene.hpp:32
std::unique_ptr< ILight > _ambient
Definition Scene.hpp:34
std::vector< std::unique_ptr< ILight > > _lights
Definition Scene.hpp:33

References _ambient, _lights, and _objects.

Member Function Documentation

◆ addLight()

void RayTracer::Scene::addLight ( std::unique_ptr< ILight > light)

Definition at line 17 of file Scene.cpp.

18{
19 _lights.push_back(std::move(light));
20}

References _lights.

◆ addObject()

void RayTracer::Scene::addObject ( std::shared_ptr< IPrimitive > obj)

Definition at line 12 of file Scene.cpp.

13{
14 _objects.push_back(std::move(obj));
15}

References _objects.

◆ getAmbient()

const std::unique_ptr< RayTracer::ILight > & RayTracer::Scene::getAmbient ( ) const

Definition at line 37 of file Scene.cpp.

38{
39 return _ambient;
40}

References _ambient.

◆ getCamera()

const RayTracer::Camera & RayTracer::Scene::getCamera ( ) const

Definition at line 47 of file Scene.cpp.

48{
49 return _camera;
50}
Camera _camera
Definition Scene.hpp:35

References _camera.

◆ getLights()

const std::vector< std::unique_ptr< RayTracer::ILight > > & RayTracer::Scene::getLights ( ) const

Definition at line 32 of file Scene.cpp.

33{
34 return _lights;
35}

References _lights.

◆ getObjects()

const std::vector< std::shared_ptr< RayTracer::IPrimitive > > & RayTracer::Scene::getObjects ( ) const

Definition at line 27 of file Scene.cpp.

28{
29 return _objects;
30}

References _objects.

◆ setAmbientLight()

void RayTracer::Scene::setAmbientLight ( std::unique_ptr< ILight > light)

Definition at line 22 of file Scene.cpp.

23{
24 _ambient = std::move(light);
25}

References _ambient.

◆ setCamera()

void RayTracer::Scene::setCamera ( const Camera & cam)

Definition at line 42 of file Scene.cpp.

43{
44 _camera = cam;
45}

References _camera.

Member Data Documentation

◆ _ambient

std::unique_ptr<ILight> RayTracer::Scene::_ambient
private

Definition at line 34 of file Scene.hpp.

◆ _camera

Camera RayTracer::Scene::_camera
private

Definition at line 35 of file Scene.hpp.

◆ _lights

std::vector<std::unique_ptr<ILight> > RayTracer::Scene::_lights
private

Definition at line 33 of file Scene.hpp.

◆ _objects

std::vector<std::shared_ptr<IPrimitive> > RayTracer::Scene::_objects
private

Definition at line 32 of file Scene.hpp.


The documentation for this class was generated from the following files: