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