Blender  V2.93
abc_hierarchy_iterator.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2020 Blender Foundation.
17  * All rights reserved.
18  */
19 #pragma once
20 
21 #include "ABC_alembic.h"
22 #include "abc_archive.h"
23 
25 
26 #include <string>
27 
28 #include <Alembic/Abc/OArchive.h>
29 #include <Alembic/Abc/OObject.h>
30 
31 struct Depsgraph;
32 struct Object;
33 
34 namespace blender::io::alembic {
35 
36 class ABCAbstractWriter;
37 class ABCHierarchyIterator;
38 
42  Alembic::Abc::OObject abc_parent;
43  std::string abc_name;
44  std::string abc_path;
47 };
48 
50  private:
51  ABCArchive *abc_archive_;
52  const AlembicExportParams &params_;
53 
54  public:
56  ABCArchive *abc_archive_,
58 
59  virtual void iterate_and_write() override;
60  virtual std::string make_valid_name(const std::string &name) const override;
61 
62  Alembic::Abc::OObject get_alembic_object(const std::string &export_path) const;
63 
64  protected:
65  virtual bool mark_as_weak_export(const Object *object) const override;
66 
67  virtual ExportGraph::key_type determine_graph_index_object(
68  const HierarchyContext *context) override;
69  virtual AbstractHierarchyIterator::ExportGraph::key_type determine_graph_index_dupli(
71  const DupliObject *dupli_object,
72  const DupliParentFinder &dupli_parent_finder) override;
73 
75  const HierarchyContext *context) override;
79  const HierarchyContext *context) override;
80 
81  virtual void release_writer(AbstractHierarchyWriter *writer) override;
82 
83  private:
84  Alembic::Abc::OObject get_alembic_parent(const HierarchyContext *context) const;
85  ABCWriterConstructorArgs writer_constructor_args(const HierarchyContext *context) const;
86  void update_archive_bounding_box();
87  void update_bounding_box_recursive(Imath::Box3d &bounds, const HierarchyContext *context);
88 
89  ABCAbstractWriter *create_data_writer_for_object_type(
90  const HierarchyContext *context, const ABCWriterConstructorArgs &writer_args);
91 };
92 
93 } // namespace blender::io::alembic
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
virtual bool mark_as_weak_export(const Object *object) const override
virtual AbstractHierarchyWriter * create_particle_writer(const HierarchyContext *context) override
Alembic::Abc::OObject get_alembic_object(const std::string &export_path) const
virtual AbstractHierarchyWriter * create_hair_writer(const HierarchyContext *context) override
virtual std::string make_valid_name(const std::string &name) const override
virtual AbstractHierarchyWriter * create_data_writer(const HierarchyContext *context) override
virtual AbstractHierarchyWriter * create_transform_writer(const HierarchyContext *context) override
virtual AbstractHierarchyIterator::ExportGraph::key_type determine_graph_index_dupli(const HierarchyContext *context, const DupliObject *dupli_object, const DupliParentFinder &dupli_parent_finder) override
virtual void release_writer(AbstractHierarchyWriter *writer) override
ABCHierarchyIterator(Depsgraph *depsgraph, ABCArchive *abc_archive_, const AlembicExportParams &params)
virtual ExportGraph::key_type determine_graph_index_object(const HierarchyContext *context) override
const Depsgraph * depsgraph
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
struct SELECTID_Context context
Definition: select_engine.c:47