Merge commit 'master@6ed15c5a41130b55cb57a43a8a9470a91d38c3d5' 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 struct ParticleSystem;
32
33 /* ************************************************************************** */
34
35 class AbcPointsWriter : public AbcObjectWriter {
36         Alembic::AbcGeom::OPointsSchema m_schema;
37         Alembic::AbcGeom::OPointsSchema::Sample m_sample;
38         ParticleSystem *m_psys;
39
40 public:
41         AbcPointsWriter(Scene *scene,
42                         Object *ob,
43                         AbcTransformWriter *parent,
44                         uint32_t time_sampling,
45                         ExportSettings &settings,
46                         ParticleSystem *psys);
47
48         void do_write();
49 };
50
51 /* ************************************************************************** */
52
53 class AbcPointsReader : public AbcObjectReader {
54         Alembic::AbcGeom::IPointsSchema m_schema;
55         Alembic::AbcGeom::IPointsSchema::Sample m_sample;
56
57 public:
58         AbcPointsReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
59
60         bool valid() const;
61
62         void readObjectData(Main *bmain, float time);
63
64         DerivedMesh *read_derivedmesh(DerivedMesh *dm, const float time, int read_flag, const char **err_str);
65 };
66
67 void read_points_sample(const Alembic::AbcGeom::IPointsSchema &schema,
68                         const Alembic::AbcGeom::ISampleSelector &selector,
69                         CDStreamConfig &config,
70                         float time);
71
72 #endif  /* __ABC_POINTS_H__ */