Container of object3d+material and light to define a 3D scene. More...
Public Member Functions | |
scene3d () | |
create an empty scene | |
void | clean_memory () |
free pointers of objects 3D | |
void | add (const object3d *obj, const material &material) |
add a generic object3d in the container and its material | |
void | add (const light &light_parameter) |
add a light in the scene | |
unsigned int | N_object () const |
get the number of object3d in the scene | |
unsigned int | N_light () const |
get the number of light in the scene | |
const object3d * | get_object (const unsigned int k_object) const |
get a given object | |
const light & | get_light (const unsigned int k_light) const |
get a given light | |
const material & | get_material (const unsigned int k_material) const |
get a given material | |
void | set_camera (const camera &cam) |
set the camera | |
const camera & | get_camera () const |
get the camera | |
void | set_background_color (const color &background_color) |
set background color | |
const color & | get_background_color () const |
get_background_color | |
Private Attributes | |
std::vector< std::pair< const object3d *, material > > | v_object |
internal container for object3d+material | |
std::vector< light > | v_light |
internal container for the lights | |
camera | cam |
internal camera stored | |
color | background_color |
internal background color storage |
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.
void cpe::scene3d::add | ( | const object3d * | obj, |
const material & | material | ||
) |
void cpe::scene3d::add | ( | const light & | light_parameter | ) |
add a light in the scene
References v_light.
void cpe::scene3d::clean_memory | ( | ) |
const color & cpe::scene3d::get_background_color | ( | ) | const |
const camera & cpe::scene3d::get_camera | ( | ) | const |
const light & cpe::scene3d::get_light | ( | const unsigned int | k_light | ) | const |
get a given light
References v_light.
const material & cpe::scene3d::get_material | ( | const unsigned int | k_material | ) | const |
const object3d * cpe::scene3d::get_object | ( | const unsigned int | k_object | ) | const |
unsigned int cpe::scene3d::N_light | ( | ) | const |
get the number of light in the scene
References v_light.
Referenced by cpe::ray_tracer::ray_to_light().
unsigned int cpe::scene3d::N_object | ( | ) | const |
get the number of object3d in the scene
References v_object.
Referenced by cpe::ray_tracer::find_inter().
void cpe::scene3d::set_background_color | ( | const color & | background_color | ) |
void cpe::scene3d::set_camera | ( | const camera & | cam | ) |
color cpe::scene3d::background_color [private] |
internal background color storage
Referenced by get_background_color(), and set_background_color().
camera cpe::scene3d::cam [private] |
internal camera stored
Referenced by get_camera(), and set_camera().
std::vector<light> cpe::scene3d::v_light [private] |
internal container for the lights
Referenced by add(), get_light(), N_light(), and scene3d().
std::vector<std::pair<const object3d*,material> > cpe::scene3d::v_object [private] |
internal container for object3d+material
Referenced by add(), clean_memory(), get_material(), get_object(), N_object(), and scene3d().