Blender
V4.3
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
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:50
BLI_listbase.h
LISTBASE_FOREACH_BACKWARD
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
Definition
BLI_listbase.h:384
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:286
blender::bke::greasepencil::TreeNode::is_group
bool is_group() const
Definition
BKE_grease_pencil.hh:779
blender::bke::greasepencil::TreeNode::as_group
const LayerGroup & as_group() const
Definition
grease_pencil.cc:976
blender::ed::outliner::AbstractTreeElement
Definition
tree_element.hh:29
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:240
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:42
outliner_intern.hh
GreasePencilLayerTreeGroup::children
ListBase children
Definition
DNA_grease_pencil_types.h:344
GreasePencilLayerTreeNode
Definition
DNA_grease_pencil_types.h:248
GreasePencil
Definition
DNA_grease_pencil_types.h:442
GreasePencil::id
ID id
Definition
DNA_grease_pencil_types.h:443
SpaceOutliner
Definition
DNA_space_types.h:289
TreeStoreElem::type
short type
Definition
DNA_outliner_types.h:16
blender::ed::outliner::TreeElement
Definition
outliner_intern.hh:84
blender::ed::outliner::TreeElement::subtree
ListBase subtree
Definition
outliner_intern.hh:95
blender::ed::outliner::TreeElement::name
const char * name
Definition
outliner_intern.hh:102
blender::ed::outliner::TreeElement::store_elem
TreeStoreElem * store_elem
Definition
outliner_intern.hh:97
tree_element_grease_pencil_node.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0