cpe::scene3d Class Reference

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

+ Collaboration diagram for cpe::scene3d:

List of all members.

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 object3dget_object (const unsigned int k_object) const
 get a given object
const lightget_light (const unsigned int k_light) const
 get a given light
const materialget_material (const unsigned int k_material) const
 get a given material
void set_camera (const camera &cam)
 set the camera
const cameraget_camera () const
 get the camera
void set_background_color (const color &background_color)
 set background color
const colorget_background_color () const
 get_background_color

Private Attributes

std::vector< std::pair< const
object3d *, material > > 
v_object
 internal container for object3d+material
std::vector< lightv_light
 internal container for the lights
camera cam
 internal camera stored
color background_color
 internal background color storage

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

create an empty scene

References v_light, and v_object.


Member Function Documentation

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

add a generic object3d in the container and its material

References v_object.

Referenced by main().

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

add a light in the scene

References v_light.

free pointers of objects 3D

References v_object.

Referenced by main().

get_background_color

References background_color.

Referenced by cpe::ray_tracer::throw_ray().

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

get the camera

References cam.

Referenced by cpe::ray_tracer::trace().

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

get a given material

References v_object.

Referenced by cpe::ray_tracer::compute_color().

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

get a given object

References v_object.

Referenced by cpe::ray_tracer::find_inter().

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)

set background color

References background_color.

Referenced by main().

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

set the camera

References cam.

Referenced by main().


Member Data Documentation

internal background color storage

Referenced by get_background_color(), and set_background_color().

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().


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