Blender V5.0
blender::ed::outliner::TreeElementLabel Class Referencefinal

#include <tree_element_label.hh>

Inherits blender::ed::outliner::AbstractTreeElement.

Public Member Functions

 TreeElementLabel (TreeElement &legacy_te, const char *label)
void set_icon (BIFIconID icon)
std::optional< BIFIconIDget_icon () const override
Public Member Functions inherited from blender::ed::outliner::AbstractTreeElement
virtual ~AbstractTreeElement ()=default
virtual bool expand_poll (const SpaceOutliner &) const
TreeElementget_legacy_element ()
virtual StringRefNull get_warning () const
void print_path ()

Additional Inherited Members

Static Public Member Functions inherited from blender::ed::outliner::AbstractTreeElement
static std::unique_ptr< AbstractTreeElementcreate_from_type (int type, TreeElement &legacy_te, ID *owner_id, void *create_data)
static void uncollapse_by_default (TreeElement *legacy_te)
Protected Member Functions inherited from blender::ed::outliner::AbstractTreeElement
 AbstractTreeElement (TreeElement &legacy_te)
virtual void expand (SpaceOutliner &) const
TreeElementadd_element (ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true) const
Protected Attributes inherited from blender::ed::outliner::AbstractTreeElement
TreeElementlegacy_te_
AbstractTreeDisplaydisplay_

Detailed Description

A basic, general purpose tree element to just display a label and an icon. Can be used to group together items underneath as well of course.

Make sure to give this a unique index, so the element can be identified uniquely. Otherwise glitches like multiple highlighted elements happen, that share all state (e.g. collapsed, selected, etc.).

Definition at line 27 of file tree_element_label.hh.

Constructor & Destructor Documentation

◆ TreeElementLabel()

blender::ed::outliner::TreeElementLabel::TreeElementLabel ( TreeElement & legacy_te,
const char * label )

Member Function Documentation

◆ get_icon()

std::optional< BIFIconID > blender::ed::outliner::TreeElementLabel::get_icon ( ) const
overridevirtual

Define the icon to be displayed for this element. If this returns an icon, this will be displayed. Otherwise, tree_element_get_icon() may still determine an icon. By default no value is returned (#std::nullopt).

All elements should be ported to use this over tree_element_get_icon().

Reimplemented from blender::ed::outliner::AbstractTreeElement.

Definition at line 31 of file tree_element_label.cc.

◆ set_icon()

void blender::ed::outliner::TreeElementLabel::set_icon ( BIFIconID icon)

Definition at line 26 of file tree_element_label.cc.


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