Blender V4.3
TreeNode Class Reference

#include <BKE_grease_pencil.hh>

Inherits GreasePencilLayerTreeNode.

Public Member Functions

 TreeNode ()
 TreeNode (GreasePencilLayerTreeNodeType type)
 TreeNode (GreasePencilLayerTreeNodeType type, StringRefNull name)
 TreeNode (const TreeNode &other)
 ~TreeNode ()
bool is_group () const
bool is_layer () const
const Layeras_layer () const
Layeras_layer ()
const LayerGroup & as_group () const
LayerGroup & as_group ()
const LayerGroup * parent_group () const
LayerGroup * parent_group ()
const TreeNodeparent_node () const
TreeNodeparent_node ()
int64_t depth () const

Public Attributes

 TREENODE_COMMON_METHODS
Public Attributes inherited from GreasePencilLayerTreeNode
struct GreasePencilLayerTreeNodenext
struct GreasePencilLayerTreeNodeprev
struct GreasePencilLayerTreeGroupparent
char * name
int8_t type
uint8_t color [3]
uint32_t flag

Detailed Description

A TreeNode represents one node in the layer tree. It can either be a layer or a group. The node has zero children if it is a layer or zero or more children if it is a group.

Definition at line 286 of file BKE_grease_pencil.hh.

Constructor & Destructor Documentation

◆ TreeNode() [1/4]

blender::bke::greasepencil::TreeNode::TreeNode ( )

Definition at line 937 of file grease_pencil.cc.

◆ TreeNode() [2/4]

blender::bke::greasepencil::TreeNode::TreeNode ( GreasePencilLayerTreeNodeType type)
explicit

Definition at line 947 of file grease_pencil.cc.

◆ TreeNode() [3/4]

blender::bke::greasepencil::TreeNode::TreeNode ( GreasePencilLayerTreeNodeType type,
StringRefNull name )
explicit

Definition at line 952 of file grease_pencil.cc.

◆ TreeNode() [4/4]

blender::bke::greasepencil::TreeNode::TreeNode ( const TreeNode & other)

Definition at line 958 of file grease_pencil.cc.

◆ ~TreeNode()

blender::bke::greasepencil::TreeNode::~TreeNode ( )

Definition at line 965 of file grease_pencil.cc.

Member Function Documentation

◆ as_group() [1/2]

LayerGroup & blender::bke::greasepencil::TreeNode::as_group ( )

Definition at line 986 of file grease_pencil.cc.

◆ as_group() [2/2]

const LayerGroup & blender::bke::greasepencil::TreeNode::as_group ( ) const
Returns
this node as a #LayerGroup.

Definition at line 976 of file grease_pencil.cc.

◆ as_layer() [1/2]

Layer & blender::bke::greasepencil::TreeNode::as_layer ( )

Definition at line 991 of file grease_pencil.cc.

◆ as_layer() [2/2]

const Layer & blender::bke::greasepencil::TreeNode::as_layer ( ) const

◆ depth()

int64_t blender::bke::greasepencil::TreeNode::depth ( ) const
Returns
the number of non-null parents of the node.

Definition at line 1013 of file grease_pencil.cc.

◆ is_group()

bool blender::bke::greasepencil::TreeNode::is_group ( ) const
inline
Returns
true if this node is a #LayerGroup.

Definition at line 779 of file BKE_grease_pencil.hh.

◆ is_layer()

bool blender::bke::greasepencil::TreeNode::is_layer ( ) const
inline
Returns
true if this node is a Layer.

Definition at line 783 of file BKE_grease_pencil.hh.

Referenced by blender::ed::object::apply_eval_grease_pencil_data(), and blender::generate_strokes().

◆ parent_group() [1/2]

LayerGroup * blender::bke::greasepencil::TreeNode::parent_group ( )

Definition at line 1000 of file grease_pencil.cc.

◆ parent_group() [2/2]

const LayerGroup * blender::bke::greasepencil::TreeNode::parent_group ( ) const
Returns
the parent layer group or nullptr for the root group.

Definition at line 996 of file grease_pencil.cc.

Referenced by blender::ed::object::apply_eval_grease_pencil_data().

◆ parent_node() [1/2]

TreeNode * blender::bke::greasepencil::TreeNode::parent_node ( )

Definition at line 1008 of file grease_pencil.cc.

◆ parent_node() [2/2]

const TreeNode * blender::bke::greasepencil::TreeNode::parent_node ( ) const

Definition at line 1004 of file grease_pencil.cc.

Member Data Documentation

◆ TREENODE_COMMON_METHODS

blender::bke::greasepencil::TreeNode::TREENODE_COMMON_METHODS

Definition at line 296 of file BKE_grease_pencil.hh.


The documentation for this class was generated from the following files: