cpe::scene Class Reference

Container of object3d+material and light to define a 3D scene. More...

+ Collaboration diagram for cpe::scene:

Public Member Functions

 scene ()
 create an empty scene More...
 
void clean_memory ()
 free pointers of objects 3D More...
 
void add (const object3d *obj, const material &material)
 add a generic object3d in the container and its material More...
 
void add (const light &light_parameter)
 add a light in the scene More...
 
int N_object () const
 get the number of object3d in the scene More...
 
int N_light () const
 get the number of light in the scene More...
 
const object3dget_object (unsigned int k_object) const
 get a given object More...
 
const lightget_light (unsigned int k_light) const
 get a given light More...
 
const materialget_material (unsigned int k_material) const
 get a given material More...
 
void set_camera (const camera &cam)
 set the camera More...
 
const cameraget_camera () const
 get the camera More...
 

Private Attributes

std::vector< const object3d * > v_object
 internal container for object3d More...
 
std::vector< materialv_material
 internal container for material More...
 
std::vector< lightv_light
 internal container for the lights More...
 
camera cam
 internal camera stored More...
 

Detailed Description

Container of object3d+material and light to define a 3D scene.

The class contains pointers. The free process is performed by the explicit call of clean_memory.

Constructor & Destructor Documentation

cpe::scene::scene ( )

create an empty scene

References clean_memory(), v_light, and v_object.

+ Here is the call graph for this function:

Member Function Documentation

void cpe::scene::add ( const object3d obj,
const material material 
)

add a generic object3d in the container and its material

References v_material, and v_object.

Referenced by main().

void cpe::scene::add ( const light light_parameter)

add a light in the scene

References v_light.

void cpe::scene::clean_memory ( )

free pointers of objects 3D

References v_object.

Referenced by main(), and scene().

const camera & cpe::scene::get_camera ( ) const

get the camera

References cam.

Referenced by cpe::render().

const light & cpe::scene::get_light ( unsigned int  k_light) const

get a given light

References MACRO_EXCEPTION_PARAMETER, and v_light.

const material & cpe::scene::get_material ( unsigned int  k_material) const

get a given material

References MACRO_EXCEPTION_PARAMETER, v_material, and v_object.

Referenced by cpe::ray_trace().

const object3d * cpe::scene::get_object ( unsigned int  k_object) const

get a given object

References MACRO_EXCEPTION_PARAMETER, and v_object.

Referenced by cpe::compute_first_intersection().

int cpe::scene::N_light ( ) const

get the number of light in the scene

References v_light.

int cpe::scene::N_object ( ) const

get the number of object3d in the scene

References v_object.

Referenced by cpe::compute_first_intersection().

void cpe::scene::set_camera ( const camera cam)

set the camera

References cam.

Referenced by main().

Member Data Documentation

camera cpe::scene::cam
private

internal camera stored

Referenced by get_camera(), and set_camera().

std::vector<light> cpe::scene::v_light
private

internal container for the lights

Referenced by add(), get_light(), N_light(), and scene().

std::vector<material> cpe::scene::v_material
private

internal container for material

Referenced by add(), and get_material().

std::vector<const object3d*> cpe::scene::v_object
private

internal container for object3d

Referenced by add(), clean_memory(), get_material(), get_object(), N_object(), and scene().


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