2 * ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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.
18 * The Original Code is Copyright (C) 2016 Kévin Dietrich.
19 * All rights reserved.
21 * ***** END GPL LICENSE BLOCK *****
25 #ifndef __ABC_ARCHIVE_H__
26 #define __ABC_ARCHIVE_H__
28 #include <Alembic/Abc/All.h>
30 #ifdef WITH_ALEMBIC_HDF5
31 # include <Alembic/AbcCoreHDF5/All.h>
34 #include <Alembic/AbcCoreOgawa/All.h>
38 /* Wrappers around input and output archives. The goal is to be able to use
39 * streams so that unicode paths work on Windows (T49112), and to make sure that
40 * the stream objects remain valid as long as the archives are open.
44 Alembic::Abc::IArchive m_archive;
45 std::ifstream m_infile;
46 std::vector<std::istream *> m_streams;
50 explicit ArchiveReader(const char *filename);
55 * Returns true when either Blender is compiled with HDF5 support and
56 * the archive was succesfully opened (valid() will also return true),
57 * or when Blender was built without HDF5 support but a HDF5 file was
58 * detected (valid() will return false).
62 Alembic::Abc::IObject getTop();
66 std::ofstream m_outfile;
67 Alembic::Abc::OArchive m_archive;
70 explicit ArchiveWriter(const char *filename, const char *scene, bool do_ogawa, Alembic::Abc::MetaData &md);
72 Alembic::Abc::OArchive &archive();
75 #endif /* __ABC_ARCHIVE_H__ */