b60f1997aa8cf01750b60087205969fe63bae1d6
[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(EvaluationContext *eval_ctx,
42                         Scene *scene,
43                         Object *ob,
44                         AbcTransformWriter *parent,
45                         uint32_t time_sampling,
46                         ExportSettings &settings,
47                         ParticleSystem *psys);
48
49         void do_write();
50 };
51
52 /* ************************************************************************** */
53
54 class AbcPointsReader : public AbcObjectReader {
55         Alembic::AbcGeom::IPointsSchema m_schema;
56         Alembic::AbcGeom::IPointsSchema::Sample m_sample;
57
58 public:
59         AbcPointsReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
60
61         bool valid() const;
62         bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
63                                  const Object *const ob,
64                                  const char **err_str) const;
65
66         void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
67
68         DerivedMesh *read_derivedmesh(DerivedMesh *dm,
69                                       const Alembic::Abc::ISampleSelector &sample_sel,
70                                       int read_flag,
71                                       const char **err_str);
72 };
73
74 void read_points_sample(const Alembic::AbcGeom::IPointsSchema &schema,
75                         const Alembic::AbcGeom::ISampleSelector &selector,
76                         CDStreamConfig &config);
77
78 #endif  /* __ABC_POINTS_H__ */