Blender
V4.3
source
blender
depsgraph
intern
depsgraph_relation.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2020 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
9
#include "
intern/depsgraph_relation.hh
"
/* own include */
10
11
#include "
BLI_utildefines.h
"
12
13
#include "
intern/depsgraph_type.hh
"
14
#include "
intern/node/deg_node.hh
"
15
16
namespace
blender::deg
{
17
18
Relation::Relation
(
Node
*from,
Node
*to,
const
char
*description)
19
: from(from), to(to), name(description),
flag
(0)
20
{
21
/* Hook it up to the nodes which use it.
22
*
23
* NOTE: We register relation in the nodes which this link connects to here
24
* in constructor but we don't un-register it in the destructor.
25
*
26
* Reasoning:
27
*
28
* - Destructor is currently used on global graph destruction, so there's no
29
* real need in avoiding dangling pointers, all the memory is to be freed
30
* anyway.
31
*
32
* - Un-registering relation is not a cheap operation, so better to have it
33
* as an explicit call if we need this. */
34
from->outlinks.append(
this
);
35
to->inlinks.append(
this
);
36
}
37
38
Relation::~Relation
()
39
{
40
/* Sanity check. */
41
BLI_assert
(from !=
nullptr
&& to !=
nullptr
);
42
}
43
44
void
Relation::unlink
()
45
{
46
/* Sanity check. */
47
BLI_assert
(from !=
nullptr
&& to !=
nullptr
);
48
from->outlinks.remove_first_occurrence_and_reorder(
this
);
49
to->inlinks.remove_first_occurrence_and_reorder(
this
);
50
}
51
52
}
// namespace blender::deg
BLI_assert
#define BLI_assert(a)
Definition
BLI_assert.h:50
BLI_utildefines.h
deg_node.hh
depsgraph_relation.hh
depsgraph_type.hh
blender::deg
Definition
DEG_depsgraph_light_linking.hh:18
blender::deg::Node
Definition
deg_node.hh:153
blender::deg::Relation::~Relation
~Relation()
Definition
depsgraph_relation.cc:38
blender::deg::Relation::unlink
void unlink()
Definition
depsgraph_relation.cc:44
blender::deg::Relation::Relation
Relation(Node *from, Node *to, const char *description)
Definition
depsgraph_relation.cc:18
flag
uint8_t flag
Definition
wm_window.cc:138
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0