e5c710c465d07736a2675165696566ee4200ba77
[blender.git] / source / blender / yafray / intern / yafray_Render.h
1 #ifndef __YAFRAY_RENDER_H
2 #define __YAFRAY_RENDER_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include "MEM_guardedalloc.h"
9 #include "IMB_imbuf_types.h"
10
11 #include "DNA_action_types.h"
12 #include "DNA_armature_types.h"
13 #include "DNA_camera_types.h"
14 #include "DNA_constraint_types.h"
15 #include "DNA_curve_types.h"
16 #include "DNA_effect_types.h"
17 #include "DNA_group_types.h"
18 #include "DNA_ika_types.h"
19 #include "DNA_image_types.h"
20 #include "DNA_key_types.h"
21 #include "DNA_lamp_types.h"
22 #include "DNA_lattice_types.h"
23 #include "DNA_material_types.h"
24 #include "DNA_meta_types.h"
25 #include "DNA_mesh_types.h"
26 #include "DNA_meshdata_types.h"
27 #include "DNA_object_types.h"
28 #include "DNA_packedFile_types.h"
29 #include "DNA_radio_types.h"
30 #include "DNA_scene_types.h"
31 #include "DNA_screen_types.h"
32 #include "DNA_sound_types.h"
33 #include "DNA_space_types.h"
34 #include "DNA_texture_types.h"
35 #include "DNA_userdef_types.h"
36 #include "DNA_vfont_types.h"
37 #include "DNA_view3d_types.h"
38 #include "DNA_world_types.h"
39
40 #include "BKE_global.h"
41 #include "BKE_image.h"
42 #include "render.h"
43
44 /* useful matrix & vector operations */
45 #include "MTC_matrixops.h"
46 #include "MTC_vectorops.h"
47
48 #include "BLI_blenlib.h"
49
50 /* need error(), so extern declare here */
51 extern void error (char *fmt, ...);
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57
58 #ifdef __cplusplus
59 #include <iostream>
60 #include <iomanip>
61 #include <sstream>
62 #include <fstream>
63 #include <map>
64 #include <string>
65 #include <vector>
66
67 class yafrayRender_t
68 {
69         public:
70                 // ctor
71                 yafrayRender_t() {}
72                 // dtor
73                 virtual ~yafrayRender_t() {}
74
75                 // mtds
76                 bool exportScene();
77
78                 void addDupliMtx(Object* obj);
79
80                 bool objectKnownData(Object* obj);
81
82         protected:
83                 Object* maincam_obj;
84                 float mainCamLens;
85
86                 int maxraydepth;
87                 bool hasworld;
88
89                 std::map<Object*, std::vector<VlakRen*> > all_objects;
90                 std::map<std::string, Material*> used_materials;
91                 std::map<std::string, MTex*> used_textures;
92                 std::map<std::string, std::vector<float> > dupliMtx_list;
93                 std::map<std::string, Object*> dup_srcob;
94                 std::map<void*, Object*> objectData;
95                 std::map<Image*, Material*> imagetex;
96                 std::map<Image*, std::string> imgtex_shader;
97
98                 Object* findObject(const char* name);
99                 bool getAllMatTexObs();
100
101                 virtual void writeTextures()=0;
102                 virtual void writeShader(const std::string &shader_name, Material* matr, const std::string &facetexname)=0;
103                 virtual void writeMaterialsAndModulators()=0;
104                 virtual void writeObject(Object* obj, const std::vector<VlakRen*> &VLR_list, const float obmat[4][4])=0;
105                 virtual void writeAllObjects()=0;
106                 virtual void writeLamps()=0;
107                 virtual void writeCamera()=0;
108                 virtual void writeAreaLamp(LampRen* lamp, int num, float iview[4][4])=0;
109                 virtual void writeHemilight()=0;
110                 virtual void writePathlight()=0;
111                 virtual bool writeWorld()=0;
112                 virtual bool writeRender()=0;
113                 virtual bool initExport()=0;
114                 virtual bool finishExport()=0;
115                 
116                 void clearAll();
117
118 };
119
120 #endif
121
122
123 #endif /*__YAFRAY_RENDER_H */