Merge branch 'master' into blender2.8
[blender.git] / source / blender / alembic / intern / abc_points.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  * The Original Code is Copyright (C) 2016 K√©vin Dietrich.
19  * All rights reserved.
20  *
21  * ***** END GPL LICENSE BLOCK *****
22  *
23  */
24
25 #ifndef __ABC_POINTS_H__
26 #define __ABC_POINTS_H__
27
28 #include "abc_object.h"
29 #include "abc_customdata.h"
30
31 /* ************************************************************************** */
32
33 class AbcPointsWriter : public AbcObjectWriter {
34         Alembic::AbcGeom::OPointsSchema m_schema;
35         Alembic::AbcGeom::OPointsSchema::Sample m_sample;
36         /*ParticleSystem*/ void *m_psys;
37
38 public:
39         AbcPointsWriter(Scene *scene,
40                         Object *ob,
41                         AbcTransformWriter *parent,
42                         uint32_t time_sampling,
43                         ExportSettings &settings,
44                         /*ParticleSystem*/ void *psys);
45
46         void do_write();
47 };
48
49 /* ************************************************************************** */
50
51 class AbcPointsReader : public AbcObjectReader {
52         Alembic::AbcGeom::IPointsSchema m_schema;
53         Alembic::AbcGeom::IPointsSchema::Sample m_sample;
54
55 public:
56         AbcPointsReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
57
58         bool valid() const;
59
60         void readObjectData(Main *bmain, float time);
61
62         DerivedMesh *read_derivedmesh(DerivedMesh *dm, const float time, int read_flag, const char **err_str);
63 };
64
65 void read_points_sample(const Alembic::AbcGeom::IPointsSchema &schema,
66                         const Alembic::AbcGeom::ISampleSelector &selector,
67                         CDStreamConfig &config,
68                         float time);
69
70 #endif  /* __ABC_POINTS_H__ */