Merge branch 'master' into blender2.8
[blender.git] / source / blender / alembic / intern / abc_curves.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_CURVES_H__
26 #define __ABC_CURVES_H__
27
28 #include "abc_object.h"
29
30 struct Curve;
31
32 /* ************************************************************************** */
33
34 class AbcCurveWriter : public AbcObjectWriter {
35         Alembic::AbcGeom::OCurvesSchema m_schema;
36         Alembic::AbcGeom::OCurvesSchema::Sample m_sample;
37
38 public:
39         AbcCurveWriter(Scene *scene,
40                        Object *ob,
41                        AbcTransformWriter *parent,
42                        uint32_t time_sampling,
43                        ExportSettings &settings);
44
45         void do_write();
46 };
47
48 /* ************************************************************************** */
49
50 class AbcCurveReader : public AbcObjectReader {
51         Alembic::AbcGeom::ICurvesSchema m_curves_schema;
52
53 public:
54         AbcCurveReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
55
56         bool valid() const;
57         bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
58                                  const Object *const ob,
59                                  const char **err_str) const;
60
61         void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
62         DerivedMesh *read_derivedmesh(DerivedMesh *dm,
63                                       const Alembic::Abc::ISampleSelector &sample_sel,
64                                       int read_flag,
65                                       const char **err_str);
66 };
67
68 /* ************************************************************************** */
69
70 void read_curve_sample(Curve *cu,
71                        const Alembic::AbcGeom::ICurvesSchema &schema,
72                        const Alembic::Abc::ISampleSelector &sample_selector);
73
74 #endif  /* __ABC_CURVES_H__ */