scene3d.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _SCENE3D_HPP_
00022 #define _SCENE3D_HPP_
00023
00024 #include <vector>
00025
00026 #include <exception_cpe.hpp>
00027 #include <object3d.hpp>
00028 #include <color.hpp>
00029 #include <v3_shaded.hpp>
00030
00031
00032 namespace cpe
00033 {
00034
00035
00036 struct material;
00037
00042 class scene3d
00043 {
00044 public:
00045
00046
00047
00048
00049
00050
00051
00053 scene3d();
00054
00055
00056
00057
00058
00059
00060
00062 void clean_memory();
00063
00065 void add(const object3d* obj,const material& material);
00067 void add(const light_parameters& light);
00068
00070 unsigned int N_object() const;
00072 unsigned int N_light() const;
00073
00074
00075
00076
00077
00078
00079
00080
00082 const object3d* get_object(const unsigned int k_object) const;
00084 const light_parameters& get_light(const unsigned int k_light) const;
00086 const material& get_material(const unsigned int k_material) const;
00087
00088 private:
00089
00090
00091
00092
00093
00094
00095
00097 std::vector<std::pair<const object3d*,material> > v_object;
00099 std::vector<light_parameters> v_light;
00100
00101 };
00102
00103
00104
00106 struct material
00107 {
00109 material(const color& _c,const shading_parameters& _shad):c(_c),shad(_shad){}
00110
00112 color c;
00114 shading_parameters shad;
00115 };
00116
00118 class exception_scene3d : public exception_cpe
00119 {
00120 public:
00121
00123 exception_scene3d():exception_cpe(){}
00125 exception_scene3d(const std::string& msg,const std::string& file,const std::string& caller,const int& line):exception_cpe(msg,file,caller,line){}
00126 };
00127
00128 }
00129 #endif