Blender V4.3
blender::ed::outliner::AbstractTreeDisplay Class Referenceabstract

Base Class For Tree-Displays. More...

#include <tree_display.hh>

Inherited by blender::ed::outliner::TreeDisplayDataAPI, blender::ed::outliner::TreeDisplayIDOrphans, blender::ed::outliner::TreeDisplayLibraries, blender::ed::outliner::TreeDisplayOverrideLibraryHierarchies, blender::ed::outliner::TreeDisplayOverrideLibraryProperties, blender::ed::outliner::TreeDisplayScenes, blender::ed::outliner::TreeDisplaySequencer, and blender::ed::outliner::TreeDisplayViewLayer.

Public Member Functions

 AbstractTreeDisplay (SpaceOutliner &space_outliner)
 
virtual ~AbstractTreeDisplay ()=default
 
virtual ListBase build_tree (const TreeSourceData &source_data)=0
 
virtual bool supports_mode_column () const
 
virtual bool is_lazy_built () const
 

Static Public Member Functions

static std::unique_ptr< AbstractTreeDisplaycreate_from_display_mode (int mode, SpaceOutliner &space_outliner)
 

Protected Attributes

SpaceOutlinerspace_outliner_
 

Tree Management

TreeElementadd_element (ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true)
 
static TreeElementadd_element (SpaceOutliner *space_outliner, ListBase *lb, ID *owner_id, void *create_data, TreeElement *parent, short type, short index, const bool expand=true)
 

Detailed Description

Base Class For Tree-Displays.

Abstract base class defining the interface for tree-display variants.

Definition at line 64 of file tree_display.hh.

Constructor & Destructor Documentation

◆ AbstractTreeDisplay()

blender::ed::outliner::AbstractTreeDisplay::AbstractTreeDisplay ( SpaceOutliner & space_outliner)
inline

Definition at line 66 of file tree_display.hh.

◆ ~AbstractTreeDisplay()

virtual blender::ed::outliner::AbstractTreeDisplay::~AbstractTreeDisplay ( )
virtualdefault

Member Function Documentation

◆ add_element() [1/2]

TreeElement * blender::ed::outliner::AbstractTreeDisplay::add_element ( ListBase * lb,
ID * owner_id,
void * create_data,
TreeElement * parent,
short type,
short index,
const bool expand = true )
Note
If child items are only added to the tree if the item is open, the TSE_ type must be added to #outliner_element_needs_rebuild_on_open_change().
Parameters
owner_idThe ID owning the represented data (or the ID itself if the element represents an ID directly). This is crucial to recognize tree elements over rebuilds, so that state like opened and selected is preserved. If this is not null, the create_data pointer will be used instead, refer to its description.
create_dataData passed to the constructor of the corresponding #AbstractTreeElement sub-type. If owner_id is not set, this pointer will be stored in an attempt to identify the element over rebuilds, so that state like opened and selected is preserved. Of course that won't work for volatile data (like stack variables).
expandIf true, the element may add its own sub-tree. E.g. objects will list their animation data, object data, constraints, modifiers, ... This often adds visual noise, and can be expensive to add in big scenes. So prefer setting this to false.

Definition at line 240 of file outliner_tree.cc.

References blender::ed::outliner::TreeElement::abstract_element, BLI_addtail(), BLI_assert, BLI_assert_msg, blender::ed::outliner::check_persistent(), blender::ed::outliner::AbstractTreeElement::create_from_type(), ELEM, TreeStoreElem::flag, GS, blender::ed::outliner::TreeElement::idcode, blender::ed::outliner::TreeElement::index, blender::ed::outliner::TreeElement::name, ID::name, blender::ed::outliner::TreeElement::parent, SEARCHING_OUTLINER, space_outliner_, blender::ed::outliner::tree_element_expand(), TREESTORE, TREESTORE_ID_TYPE, TSE_ANIM_DATA, TSE_BONE, TSE_BONE_COLLECTION, TSE_BONE_COLLECTION_BASE, TSE_CHILDSEARCH, TSE_CONSTRAINT, TSE_CONSTRAINT_BASE, TSE_DEFGROUP, TSE_DEFGROUP_BASE, TSE_DRIVER_BASE, TSE_EBONE, TSE_GENERIC_LABEL, TSE_GP_LAYER, TSE_GPENCIL_EFFECT, TSE_GPENCIL_EFFECT_BASE, TSE_GREASE_PENCIL_NODE, TSE_ID_BASE, TSE_IS_REAL_ID, TSE_LAYER_COLLECTION, TSE_LIBRARY_OVERRIDE, TSE_LIBRARY_OVERRIDE_BASE, TSE_LIBRARY_OVERRIDE_OPERATION, TSE_LINKED_NODE_TREE, TSE_LINKED_OB, TSE_LINKED_PSYS, TSE_MODIFIER, TSE_MODIFIER_BASE, TSE_NLA, TSE_NLA_TRACK, TSE_POSE_BASE, TSE_POSE_CHANNEL, TSE_R_LAYER, TSE_R_LAYER_BASE, TSE_RNA_ARRAY_ELEM, TSE_RNA_PROPERTY, TSE_RNA_STRUCT, TSE_SCENE_COLLECTION_BASE, TSE_SEQ_STRIP, TSE_SEQUENCE, TSE_SEQUENCE_DUP, TSE_SOME_ID, and TSE_VIEW_COLLECTION_BASE.

◆ add_element() [2/2]

◆ build_tree()

virtual ListBase blender::ed::outliner::AbstractTreeDisplay::build_tree ( const TreeSourceData & source_data)
pure virtual

◆ create_from_display_mode()

std::unique_ptr< AbstractTreeDisplay > blender::ed::outliner::AbstractTreeDisplay::create_from_display_mode ( int mode,
SpaceOutliner & space_outliner )
static

◆ is_lazy_built()

bool blender::ed::outliner::AbstractTreeDisplay::is_lazy_built ( ) const
virtual

Some trees may want to skip building children of collapsed parents. This should be done if the tree type may become very complex, which could cause noticeable slowdowns. Problem: This doesn't address performance issues while searching, since all elements are constructed for that. Trees of this type have to be rebuilt for any change to the collapsed state of any element.

Reimplemented in blender::ed::outliner::TreeDisplayDataAPI, and blender::ed::outliner::TreeDisplayOverrideLibraryHierarchies.

Definition at line 55 of file tree_display.cc.

◆ supports_mode_column()

bool blender::ed::outliner::AbstractTreeDisplay::supports_mode_column ( ) const
virtual

Define if the display mode should be allowed to show a mode column on the left. This column adds an icon to indicate which objects are in the current mode (edit mode, pose mode, etc.) and allows adding other objects to the mode by clicking the icon.

Returns false by default.

Reimplemented in blender::ed::outliner::TreeDisplayScenes, and blender::ed::outliner::TreeDisplayViewLayer.

Definition at line 50 of file tree_display.cc.

Referenced by blender::ed::outliner::outliner_shows_mode_column().

Member Data Documentation

◆ space_outliner_


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