Blender  V2.93
tree_display_data.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "BLI_listbase.h"
22 #include "BLI_mempool.h"
23 
24 #include "RNA_access.h"
25 
26 #include "../outliner_intern.h"
27 #include "tree_display.hh"
28 
29 namespace blender::ed::outliner {
30 
32  : AbstractTreeDisplay(space_outliner)
33 {
34 }
35 
37 {
38  ListBase tree = {nullptr};
39 
40  PointerRNA mainptr;
41  RNA_main_pointer_create(source_data.bmain, &mainptr);
42 
44  &space_outliner_, &tree, (void *)&mainptr, nullptr, TSE_RNA_STRUCT, -1);
45 
46  /* On first view open parent data elements */
47  const int show_opened = !space_outliner_.treestore ||
49  if (show_opened) {
50  TreeStoreElem *tselem = TREESTORE(te);
51  tselem->flag &= ~TSE_CLOSED;
52  }
53  return tree;
54 }
55 
56 } // namespace blender::ed::outliner
int BLI_mempool_len(BLI_mempool *pool) ATTR_NONNULL(1)
Definition: BLI_mempool.c:454
@ TSE_RNA_STRUCT
@ TSE_CLOSED
Base Class For Tree-Displays.
Definition: tree_display.hh:55
TreeDisplayDataAPI(SpaceOutliner &space_outliner)
ListBase buildTree(const TreeSourceData &source_data) override
void * tree
#define TREESTORE(a)
TreeElement * outliner_add_element(SpaceOutliner *space_outliner, ListBase *lb, void *idv, TreeElement *parent, short type, short index)
void RNA_main_pointer_create(struct Main *main, PointerRNA *r_ptr)
Definition: rna_access.c:115
struct BLI_mempool * treestore
The data to build the tree from.
Definition: tree_display.h:39
struct Main * bmain
Definition: tree_display.h:40
Establish and manage Outliner trees for different display modes.