Blender V5.3
blender::ed::outliner::detail Namespace Reference

Functions

template<typename ElementType, typename... Args>
ID * element_owner_id (Args &...args)
template<typename ElementType, typename... Args>
const void * element_persistent_ptr (const TreeElementAddParams &params, Args &...args)

Function Documentation

◆ element_owner_id()

template<typename ElementType, typename... Args>
ID * blender::ed::outliner::detail::element_owner_id ( Args &... args)

Query the tree-store identity of ElementType from its static owner_id(), which mirrors the type's constructor signature (minus the TreeElement). Types without an owner ID simply don't define it, and can use #TreeElementAddParams.persistent_ptr instead.

Definition at line 122 of file tree_display.hh.

References element_owner_id().

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element(), and element_owner_id().

◆ element_persistent_ptr()

template<typename ElementType, typename... Args>
const void * blender::ed::outliner::detail::element_persistent_ptr ( const TreeElementAddParams & params,
Args &... args )

Query the tree-store identity of ElementType from its static persistent_ptr(), for types that have no owner ID but can point at their own data to be identified by. Falls back to #TreeElementAddParams.persistent_ptr for types that only the caller can identify.

Having no persistent data pointer can be valid, by defining #ElementType::allow_null_identity. But then state (like open/collapsed state) is not preserved over rebuilds and file loads, and there may be glitches because the wrong tree-store element gets reused.

Definition at line 143 of file tree_display.hh.

References BLI_assert_msg, element_persistent_ptr(), and blender::ed::outliner::TreeElementAddParams::persistent_ptr.

Referenced by blender::ed::outliner::AbstractTreeDisplay::add_element(), and element_persistent_ptr().