Fixed:
[blender.git] / source / blender / yafray / intern / export_Plugin.h
1 #ifndef __EXPORT_PLUGIN_H
2 #define __EXPORT_PLUGIN_H
3
4 #include"yafray_Render.h"
5 #include"yafexternal.h"
6 extern "C"
7 {
8 #include"PIL_dynlib.h"
9 }
10
11 class yafrayPluginRender_t : public yafrayRender_t
12 {
13         public:
14                 yafrayPluginRender_t() 
15                 {
16                         handle=NULL;
17 #ifdef WIN32
18                         corehandle=NULL;
19 #endif
20                         yafrayGate=NULL;
21                 }
22                 virtual ~yafrayPluginRender_t();
23         protected:
24                 std::string imgout;
25                 PILdynlib *handle;
26 #ifdef WIN32
27                 PILdynlib *corehandle;
28 #endif
29
30                 yafray::yafrayInterface_t *yafrayGate;
31
32                 void displayImage();
33                 virtual void writeTextures();
34                 virtual void writeShader(const std::string &shader_name, Material* matr, const std::string &facetexname="");
35                 virtual void writeMaterialsAndModulators();
36                 virtual void writeObject(Object* obj, 
37                                 const std::vector<VlakRen*> &VLR_list, const float obmat[4][4]);
38                 virtual void writeAllObjects();
39                 virtual void writeAreaLamp(LampRen* lamp, int num, float iview[4][4]);
40                 virtual void writeLamps();
41                 virtual void writeCamera();
42                 virtual void writeHemilight();
43                 virtual void writePathlight();
44                 virtual bool writeWorld();
45                 virtual bool writeRender();
46                 virtual bool initExport();
47                 virtual bool finishExport();
48
49                 void genUVcoords(std::vector<yafray::GFLOAT> &uvcoords,VlakRen *vlr,TFace* uvc, bool comple=false);
50                 void genVcol(std::vector<yafray::CFLOAT> &vcol, VlakRen *vlr, bool comple=false);
51                 void genFace(std::vector<int> &faces,std::vector<std::string> &shaders,std::vector<int> &faceshader,
52                                 std::vector<yafray::GFLOAT> &uvcoords,std::vector<yafray::CFLOAT> &vcol,
53                                 std::map<VertRen*, int> &vert_idx,VlakRen *vlr,
54                                 bool has_orco,bool has_uv);
55                 void genCompleFace(std::vector<int> &faces,/*std::vector<std::string> &shaders,*/std::vector<int> &faceshader,
56                                 std::vector<yafray::GFLOAT> &uvcoords,std::vector<yafray::CFLOAT> &vcol,
57                                 std::map<VertRen*, int> &vert_idx,VlakRen *vlr,
58                                 bool has_orco,bool has_uv);
59                 void genVertices(std::vector<yafray::point3d_t> &verts, int &vidx,
60                                                                                  std::map<VertRen*, int> &vert_idx, VlakRen* vlr, bool has_orco, Object* obj);
61 };
62
63 class blenderYafrayOutput_t : public yafray::colorOutput_t
64 {
65         public:
66                 blenderYafrayOutput_t() {out=0;};
67                 virtual ~blenderYafrayOutput_t() {};
68                 virtual bool putPixel(int x, int y,const yafray::color_t &c, 
69                                 yafray::CFLOAT alpha=0,yafray::PFLOAT depth=0);
70                 virtual void flush() {};
71         protected:
72                 int out;
73 };
74
75 #endif