Blender  V3.3
tree_display_data.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BLI_listbase.h"
8 #include "BLI_mempool.h"
9 
10 #include "DNA_space_types.h"
11 
12 #include "RNA_access.h"
13 
14 #include "../outliner_intern.hh"
15 #include "tree_display.hh"
16 #include "tree_element.hh"
17 
18 namespace blender::ed::outliner {
19 
21  : AbstractTreeDisplay(space_outliner)
22 {
23 }
24 
26 {
27  ListBase tree = {nullptr};
28 
29  PointerRNA mainptr;
30  RNA_main_pointer_create(source_data.bmain, &mainptr);
31 
33  &space_outliner_, &tree, (void *)&mainptr, nullptr, TSE_RNA_STRUCT, -1);
34 
35  /* On first view open parent data elements */
36  const int show_opened = !space_outliner_.treestore ||
38  if (show_opened) {
39  TreeStoreElem *tselem = TREESTORE(te);
40  tselem->flag &= ~TSE_CLOSED;
41  }
42  return tree;
43 }
44 
46 {
47  return true;
48 }
49 
50 } // namespace blender::ed::outliner
int BLI_mempool_len(const BLI_mempool *pool) ATTR_NONNULL(1)
Definition: BLI_mempool.c:434
@ TSE_RNA_STRUCT
@ TSE_CLOSED
Base Class For Tree-Displays.
Definition: tree_display.hh:62
TreeDisplayDataAPI(SpaceOutliner &space_outliner)
ListBase buildTree(const TreeSourceData &source_data) override
void * tree
TreeElement * outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, TreeElement *parent, short type, short index, const bool expand)
#define TREESTORE(a)
void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)
Definition: rna_access.c:105
struct BLI_mempool * treestore
The data to build the tree from.
Definition: tree_display.hh:43
Establish and manage Outliner trees for different display modes.