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 object3d * | get_object (unsigned int k_object) const |
| get a given object More... | |
| const light & | get_light (unsigned int k_light) const |
| get a given light More... | |
| const material & | get_material (unsigned int k_material) const |
| get a given material More... | |
| void | set_camera (const camera &cam) |
| set the camera More... | |
| const camera & | get_camera () const |
| get the camera More... | |
Private Attributes | |
| std::vector< const object3d * > | v_object |
| internal container for object3d More... | |
| std::vector< material > | v_material |
| internal container for material More... | |
| std::vector< light > | v_light |
| internal container for the lights More... | |
| camera | cam |
| internal camera stored More... | |
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.
| cpe::scene::scene | ( | ) |
create an empty scene
References clean_memory(), v_light, and v_object.
Here is the call graph for this function:add a generic object3d in the container and its material
References v_material, and v_object.
Referenced by main().
| void cpe::scene::clean_memory | ( | ) |
| const camera & cpe::scene::get_camera | ( | ) | const |
| 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 | ) |
|
private |
internal camera stored
Referenced by get_camera(), and set_camera().
|
private |
internal container for the lights
Referenced by add(), get_light(), N_light(), and scene().
|
private |
internal container for material
Referenced by add(), and get_material().
|
private |
internal container for object3d
Referenced by add(), clean_memory(), get_material(), get_object(), N_object(), and scene().