Blender V5.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 ListBaseT< TreeElement > build_tree (const TreeSourceData &source_data)=0
virtual bool supports_mode_column () const
virtual bool is_lazy_built () const
template<typename ElementType, typename... Args>
TreeElement * add_element (const TreeElementAddParams &params, Args &&...args)

Static Public Member Functions

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

Protected Attributes

SpaceOutliner & space_outliner_

Tree Management

TreeElement * add_id_element (const TreeElementAddParams &params, ID *id)
TreeElement * add_element_impl (const TreeElementAddParams &params, short type, ID *owner_id, const void *persistent_ptr, bool allow_null_identity, FunctionRef< std::unique_ptr< AbstractTreeElement >(TreeElement &)> construct_fn)

Detailed Description

Base Class For Tree-Displays.

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

Definition at line 167 of file tree_display.hh.

Constructor & Destructor Documentation

◆ AbstractTreeDisplay()

◆ ~AbstractTreeDisplay()

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

Member Function Documentation

◆ add_element()

template<typename ElementType, typename... Args>
TreeElement * blender::ed::outliner::AbstractTreeDisplay::add_element ( const TreeElementAddParams & params,
Args &&... args )

Add a tree element of ElementType, forwarding args to its constructor. The remaining information the tree needs is queried from ElementType itself:

  • ElementType::element_type gives the TSE_ type to store in the tree-store.
  • ElementType::owner_id(args...) gives the ID identifying the element over rebuilds and file loads, so that state like opened and selected is preserved.
  • ElementType::persistent_ptr(args...) gives that identity for types that have no owner ID (see also #TreeElementAddParams.owner_id and #TreeElementAddParams.persistent_ptr, for the types only the caller can identify).

So a call only mentions the element type and its actual data:

add_element<TreeElementConstraint>({.parent = tenla, .index = index}, object, con);
TreeElement * add_element(const TreeElementAddParams &params, Args &&...args)
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().

Definition at line 248 of file tree_display.hh.

References add_element_impl(), BLI_assert_msg, blender::ed::outliner::detail::element_owner_id(), blender::ed::outliner::detail::element_persistent_ptr(), and blender::ed::outliner::TreeElementAddParams::owner_id.

Referenced by blender::ed::outliner::AbstractTreeElement::add_element(), build_tree(), blender::ed::outliner::TreeDisplayDataAPI::build_tree(), blender::ed::outliner::TreeDisplayIDOrphans::build_tree(), blender::ed::outliner::TreeDisplayOverrideLibraryHierarchies::build_tree(), blender::ed::outliner::TreeDisplaySequencer::build_tree(), blender::ed::outliner::TreeDisplayViewLayer::build_tree(), and blender::ed::outliner::outliner_add_bone().

◆ add_element_impl()

◆ add_id_element()

TreeElement * blender::ed::outliner::AbstractTreeDisplay::add_id_element ( const TreeElementAddParams & params,
ID * id )

◆ build_tree()

◆ create_from_display_mode()

◆ 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 54 of file tree_display.cc.

Referenced by build_tree().

◆ 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 49 of file tree_display.cc.

Referenced by build_tree(), and blender::ed::outliner::outliner_shows_mode_column().

Member Data Documentation

◆ space_outliner_

SpaceOutliner& blender::ed::outliner::AbstractTreeDisplay::space_outliner_
protected

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