Blender
V5.0
source
blender
io
common
intern
dupli_parent_finder.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2020 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
#pragma once
5
6
#include "
IO_dupli_persistent_id.hh
"
7
8
#include "
BKE_duplilist.hh
"
9
10
#include "
BLI_map.hh
"
11
#include "
BLI_set.hh
"
12
13
namespace
blender::io
{
14
15
/* Find relations between duplicated objects. This class should be instanced for a single real
16
* object, and fed its dupli-objects. */
17
class
DupliParentFinder
final
{
18
private
:
19
/* To check whether an Object * is instanced by this duplicator. */
20
blender::Set<const Object *>
dupli_set_;
21
22
/* To find the DupliObject given its Persistent ID. */
23
using
PIDToDupliMap =
blender::Map<const PersistentID, const DupliObject *>
;
24
PIDToDupliMap pid_to_dupli_;
25
26
/* Mapping from instancer PID to duplis instanced by it. */
27
using
InstancerPIDToDuplisMap =
28
blender::Map<const PersistentID, blender::Set<const DupliObject *>
>;
29
InstancerPIDToDuplisMap instancer_pid_to_duplis_;
30
31
public
:
32
void
insert
(
const
DupliObject
*dupli_ob);
33
34
bool
is_duplicated
(
const
Object
*
object
)
const
;
35
const
DupliObject
*
find_suitable_export_parent
(
const
DupliObject
*dupli_ob)
const
;
36
37
private
:
38
const
DupliObject
*find_duplicated_parent(
const
DupliObject
*dupli_ob)
const
;
39
const
DupliObject
*find_instancer(
const
DupliObject
*dupli_ob)
const
;
40
};
41
42
}
// namespace blender::io
BKE_duplilist.hh
final
#define final(a, b, c)
Definition
BLI_hash.h:19
BLI_map.hh
BLI_set.hh
IO_dupli_persistent_id.hh
blender::Map
Definition
BLI_map.hh:129
blender::Set
Definition
BLI_set.hh:106
blender::io::DupliParentFinder
Definition
dupli_parent_finder.hh:17
blender::io::DupliParentFinder::find_suitable_export_parent
const DupliObject * find_suitable_export_parent(const DupliObject *dupli_ob) const
Definition
dupli_parent_finder.cc:27
blender::io::DupliParentFinder::insert
void insert(const DupliObject *dupli_ob)
Definition
dupli_parent_finder.cc:13
blender::io::DupliParentFinder::is_duplicated
bool is_duplicated(const Object *object) const
Definition
dupli_parent_finder.cc:22
blender::io
Definition
BKE_idprop.hh:29
DupliObject
Definition
BKE_duplilist.hh:30
Object
Definition
DNA_object_types.h:191
Generated on
for Blender by
doxygen
1.16.1