Merge branch 'blender2.7'
[blender.git] / source / blender / alembic / intern / abc_hair.h
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * Contributor(s): Esteban Tovagliari, Cedric Paille, Kevin Dietrich
19  *
20  * ***** END GPL LICENSE BLOCK *****
21  */
22
23 #ifndef __ABC_HAIR_H__
24 #define __ABC_HAIR_H__
25
26 #include "abc_object.h"
27
28 struct ParticleSettings;
29 struct ParticleSystem;
30
31 /* ************************************************************************** */
32
33 class AbcHairWriter : public AbcObjectWriter {
34         ParticleSystem *m_psys;
35
36         Alembic::AbcGeom::OCurvesSchema m_schema;
37         Alembic::AbcGeom::OCurvesSchema::Sample m_sample;
38
39         bool m_uv_warning_shown;
40
41 public:
42         AbcHairWriter(Object *ob,
43                       AbcTransformWriter *parent,
44                       uint32_t time_sampling,
45                       ExportSettings &settings,
46                       ParticleSystem *psys);
47
48 private:
49         virtual void do_write();
50
51         void write_hair_sample(struct Mesh *mesh,
52                                ParticleSettings *part,
53                                std::vector<Imath::V3f> &verts,
54                                std::vector<Imath::V3f> &norm_values,
55                                std::vector<Imath::V2f> &uv_values,
56                                std::vector<int32_t> &hvertices);
57
58         void write_hair_child_sample(struct Mesh *mesh,
59                                      ParticleSettings *part,
60                                      std::vector<Imath::V3f> &verts,
61                                      std::vector<Imath::V3f> &norm_values,
62                                      std::vector<Imath::V2f> &uv_values,
63                                      std::vector<int32_t> &hvertices);
64 };
65
66 #endif  /* __ABC_HAIR_H__ */