Blender
V5.0
source
blender
editors
space_outliner
tree
tree_element_grease_pencil_node.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9
#include "
BLI_listbase.h
"
10
11
#include "
BKE_grease_pencil.hh
"
12
13
#include "
DNA_outliner_types.h
"
14
15
#include "
../outliner_intern.hh
"
16
17
#include "
tree_element_grease_pencil_node.hh
"
18
19
namespace
blender::ed::outliner
{
20
21
TreeElementGreasePencilNode::TreeElementGreasePencilNode
(
TreeElement
&legacy_te,
22
GreasePencil
&owner_grease_pencil,
23
bke::greasepencil::TreeNode
&
node
)
24
:
AbstractTreeElement
(legacy_te), owner_grease_pencil_(owner_grease_pencil), node_(
node
)
25
{
26
BLI_assert
(legacy_te.
store_elem
->
type
==
TSE_GREASE_PENCIL_NODE
);
27
legacy_te.
name
=
node
.name().c_str();
28
}
29
30
void
TreeElementGreasePencilNode::expand
(
SpaceOutliner
&
/*space_outliner*/
)
const
31
{
32
if
(!node_.is_group()) {
33
return
;
34
}
35
LISTBASE_FOREACH_BACKWARD
(
GreasePencilLayerTreeNode
*, child, &node_.as_group().children) {
36
add_element
(&
legacy_te_
.subtree,
37
&owner_grease_pencil_.id,
38
child,
39
&
legacy_te_
,
40
TSE_GREASE_PENCIL_NODE
,
41
0);
42
}
43
}
44
45
blender::bke::greasepencil::TreeNode
&
TreeElementGreasePencilNode::node
()
const
46
{
47
return
node_;
48
}
49
50
}
// namespace blender::ed::outliner
BKE_grease_pencil.hh
Low-level operations for grease pencil.
BLI_assert
#define BLI_assert(a)
Definition
BLI_assert.h:46
BLI_listbase.h
LISTBASE_FOREACH_BACKWARD
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
Definition
BLI_listbase.h:375
DNA_outliner_types.h
TSE_GREASE_PENCIL_NODE
@ TSE_GREASE_PENCIL_NODE
Definition
DNA_outliner_types.h:116
blender::bke::greasepencil::TreeNode
Definition
BKE_grease_pencil.hh:291
blender::ed::outliner::AbstractTreeElement::AbstractTreeElement
AbstractTreeElement(TreeElement &legacy_te)
Definition
tree_element.hh:103
blender::ed::outliner::AbstractTreeElement::add_element
TreeElement * add_element(ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
Definition
tree_element.cc:243
blender::ed::outliner::AbstractTreeElement::legacy_te_
TreeElement & legacy_te_
Definition
tree_element.hh:36
blender::ed::outliner::TreeElementGreasePencilNode::expand
void expand(SpaceOutliner &) const override
Definition
tree_element_grease_pencil_node.cc:30
blender::ed::outliner::TreeElementGreasePencilNode::TreeElementGreasePencilNode
TreeElementGreasePencilNode(TreeElement &legacy_te, GreasePencil &owner_grease_pencil, blender::bke::greasepencil::TreeNode &node)
Definition
tree_element_grease_pencil_node.cc:21
blender::ed::outliner::TreeElementGreasePencilNode::node
blender::bke::greasepencil::TreeNode & node() const
Definition
tree_element_grease_pencil_node.cc:45
blender::ed::outliner
Definition
outliner_collections.cc:44
outliner_intern.hh
GreasePencilLayerTreeNode
Definition
DNA_grease_pencil_types.h:252
GreasePencil
Definition
DNA_grease_pencil_types.h:447
SpaceOutliner
Definition
DNA_space_types.h:187
TreeStoreElem::type
short type
Definition
DNA_outliner_types.h:16
blender::ed::outliner::TreeElement
Definition
outliner_intern.hh:87
blender::ed::outliner::TreeElement::name
const char * name
Definition
outliner_intern.hh:105
blender::ed::outliner::TreeElement::store_elem
TreeStoreElem * store_elem
Definition
outliner_intern.hh:100
tree_element_grease_pencil_node.hh
Generated on
for Blender by
doxygen
1.16.1