Blender  V2.93
tree_display.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 "DNA_listBase.h"
22 
23 #include "tree_display.hh"
24 
25 using namespace blender::ed::outliner;
26 
28 {
29  AbstractTreeDisplay *tree_display = nullptr;
30 
31  switch (mode) {
32  case SO_SCENES:
33  tree_display = new TreeDisplayScenes(*space_outliner);
34  break;
35  case SO_LIBRARIES:
36  tree_display = new TreeDisplayLibraries(*space_outliner);
37  break;
38  case SO_SEQUENCE:
39  tree_display = new TreeDisplaySequencer(*space_outliner);
40  break;
41  case SO_DATA_API:
42  tree_display = new TreeDisplayDataAPI(*space_outliner);
43  break;
44  case SO_ID_ORPHANS:
45  tree_display = new TreeDisplayIDOrphans(*space_outliner);
46  break;
48  tree_display = new TreeDisplayOverrideLibrary(*space_outliner);
49  break;
50  case SO_VIEW_LAYER:
51  default:
52  tree_display = new TreeDisplayViewLayer(*space_outliner);
53  break;
54  }
55 
56  return reinterpret_cast<TreeDisplay *>(tree_display);
57 }
58 
60 {
61  delete reinterpret_cast<AbstractTreeDisplay *>(*tree_display);
62  *tree_display = nullptr;
63 }
64 
66 {
67  return reinterpret_cast<AbstractTreeDisplay *>(tree_display)->buildTree(*source_data);
68 }
These structs are the foundation for all linked lists in the library system.
eSpaceOutliner_Mode
@ SO_OVERRIDES_LIBRARY
@ SO_SEQUENCE
@ SO_DATA_API
@ SO_LIBRARIES
@ SO_VIEW_LAYER
@ SO_SCENES
@ SO_ID_ORPHANS
void buildTree(int startIndex, int endIndex)
Base Class For Tree-Displays.
Definition: tree_display.hh:55
Tree-Display for the Scenes display mode.
Tree-Display for the Orphaned Data display mode.
Tree-Display for the Libraries display mode.
Tree-Display for the Library Overrides display mode.
Tree-Display for the Scenes display mode.
Tree-Display for the Video Sequencer display mode.
Tree-Display for the View Layer display mode.
Definition: tree_display.hh:79
The data to build the tree from.
Definition: tree_display.h:39
void outliner_tree_display_destroy(TreeDisplay **tree_display)
Definition: tree_display.cc:59
ListBase outliner_tree_display_build_tree(TreeDisplay *tree_display, TreeSourceData *source_data)
Definition: tree_display.cc:65
TreeDisplay * outliner_tree_display_create(eSpaceOutliner_Mode mode, SpaceOutliner *space_outliner)
Definition: tree_display.cc:27
struct TreeDisplay TreeDisplay
Definition: tree_display.h:34
Establish and manage Outliner trees for different display modes.