Alembic import: port DerivedMesh → Mesh
[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(Depsgraph *depsgraph,
40                        Scene *scene,
41                        Object *ob,
42                        AbcTransformWriter *parent,
43                        uint32_t time_sampling,
44                        ExportSettings &settings);
45
46         void do_write();
47 };
48
49 /* ************************************************************************** */
50
51 class AbcCurveReader : public AbcObjectReader {
52         Alembic::AbcGeom::ICurvesSchema m_curves_schema;
53
54 public:
55         AbcCurveReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
56
57         bool valid() const;
58         bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
59                                  const Object *const ob,
60                                  const char **err_str) const;
61
62         void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
63         struct Mesh *read_mesh(struct Mesh *existing_mesh,
64                                const Alembic::Abc::ISampleSelector &sample_sel,
65                                int read_flag,
66                                const char **err_str);
67 };
68
69 /* ************************************************************************** */
70
71 void read_curve_sample(Curve *cu,
72                        const Alembic::AbcGeom::ICurvesSchema &schema,
73                        const Alembic::Abc::ISampleSelector &sample_selector);
74
75 #endif  /* __ABC_CURVES_H__ */