Blender  V3.3
dupli_parent_finder.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. All rights reserved. */
3 #pragma once
4 
6 
7 #include "BKE_duplilist.h"
8 
9 #include <map>
10 #include <set>
11 
12 namespace blender::io {
13 
14 /* Find relations between duplicated objects. This class should be instanced for a single real
15  * object, and fed its dupli-objects. */
17  private:
18  /* To check whether an Object * is instanced by this duplicator. */
19  std::set<const Object *> dupli_set_;
20 
21  /* To find the DupliObject given its Persistent ID. */
22  typedef std::map<const PersistentID, const DupliObject *> PIDToDupliMap;
23  PIDToDupliMap pid_to_dupli_;
24 
25  /* Mapping from instancer PID to duplis instanced by it. */
26  typedef std::map<const PersistentID, std::set<const DupliObject *>> InstancerPIDToDuplisMap;
27  InstancerPIDToDuplisMap instancer_pid_to_duplis_;
28 
29  public:
30  void insert(const DupliObject *dupli_ob);
31 
32  bool is_duplicated(const Object *object) const;
33  const DupliObject *find_suitable_export_parent(const DupliObject *dupli_ob) const;
34 
35  private:
36  const DupliObject *find_duplicated_parent(const DupliObject *dupli_ob) const;
37  const DupliObject *find_instancer(const DupliObject *dupli_ob) const;
38 };
39 
40 } // namespace blender::io
#define final(a, b, c)
Definition: BLI_hash.h:21
const DupliObject * find_suitable_export_parent(const DupliObject *dupli_ob) const
void insert(const DupliObject *dupli_ob)
bool is_duplicated(const Object *object) const