Blender  V2.93
tree_display.hh
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 
35 #pragma once
36 
37 #include "tree_display.h"
38 
39 struct ListBase;
40 struct Main;
41 struct SpaceOutliner;
42 struct TreeElement;
43 struct TreeSourceData;
44 
46 
47 /* -------------------------------------------------------------------- */
48 /* Tree-Display Interface */
49 
56  public:
57  AbstractTreeDisplay(SpaceOutliner &space_outliner) : space_outliner_(space_outliner)
58  {
59  }
60  virtual ~AbstractTreeDisplay() = default;
61 
66  virtual ListBase buildTree(const TreeSourceData &source_data) = 0;
67 
68  protected:
71 };
72 
73 /* -------------------------------------------------------------------- */
74 /* View Layer Tree-Display */
75 
80  ViewLayer *view_layer_ = nullptr;
81  bool show_objects_ = true;
82 
83  public:
84  TreeDisplayViewLayer(SpaceOutliner &space_outliner);
85 
86  ListBase buildTree(const TreeSourceData &source_data) override;
87 
88  private:
89  void add_view_layer(ListBase &, TreeElement &);
90  void add_layer_collections_recursive(ListBase &, ListBase &, TreeElement &);
91  void add_layer_collection_objects(ListBase &, LayerCollection &, TreeElement &);
92  void add_layer_collection_objects_children(TreeElement &);
93 };
94 
95 /* -------------------------------------------------------------------- */
96 /* Library Tree-Display */
97 
102  public:
103  TreeDisplayLibraries(SpaceOutliner &space_outliner);
104 
105  ListBase buildTree(const TreeSourceData &source_data) override;
106 
107  private:
108  TreeElement *add_library_contents(Main &, ListBase &, Library *) const;
109  bool library_id_filter_poll(Library *lib, ID *id) const;
110  short id_filter_get() const;
111 };
112 
113 /* -------------------------------------------------------------------- */
114 /* Library Overrides Tree-Display. */
115 
120  public:
121  TreeDisplayOverrideLibrary(SpaceOutliner &space_outliner);
122 
123  ListBase buildTree(const TreeSourceData &source_data) override;
124 
125  private:
126  TreeElement *add_library_contents(Main &, ListBase &, Library *) const;
127  bool override_library_id_filter_poll(Library *lib, ID *id) const;
128  short id_filter_get() const;
129 };
130 
131 /* -------------------------------------------------------------------- */
132 /* Video Sequencer Tree-Display */
133 
138 };
139 
144  public:
145  TreeDisplaySequencer(SpaceOutliner &space_outliner);
146 
147  ListBase buildTree(const TreeSourceData &source_data) override;
148 
149  private:
150  TreeElement *add_sequencer_contents() const;
151  SequenceAddOp need_add_seq_dup(Sequence *seq) const;
152  void add_seq_dup(Sequence *seq, TreeElement *te, short index) const;
153 };
154 
155 /* -------------------------------------------------------------------- */
156 /* Orphaned Data Tree-Display */
157 
162  public:
163  TreeDisplayIDOrphans(SpaceOutliner &space_outliner);
164 
165  ListBase buildTree(const TreeSourceData &source_data) override;
166 
167  private:
168  bool datablock_has_orphans(ListBase &) const;
169 };
170 
171 /* -------------------------------------------------------------------- */
172 /* Scenes Tree-Display */
173 
178  public:
179  TreeDisplayScenes(SpaceOutliner &space_outliner);
180 
181  ListBase buildTree(const TreeSourceData &source_data) override;
182 };
183 
184 /* -------------------------------------------------------------------- */
185 /* Data API Tree-Display */
186 
191  public:
192  TreeDisplayDataAPI(SpaceOutliner &space_outliner);
193 
194  ListBase buildTree(const TreeSourceData &source_data) override;
195 };
196 
197 } // namespace blender::ed::outliner
#define final(a, b, c)
Definition: BLI_hash.h:35
Base Class For Tree-Displays.
Definition: tree_display.hh:55
virtual ListBase buildTree(const TreeSourceData &source_data)=0
AbstractTreeDisplay(SpaceOutliner &space_outliner)
Definition: tree_display.hh:57
Tree-Display for the Scenes display mode.
TreeDisplayDataAPI(SpaceOutliner &space_outliner)
ListBase buildTree(const TreeSourceData &source_data) override
Tree-Display for the Orphaned Data display mode.
ListBase buildTree(const TreeSourceData &source_data) override
TreeDisplayIDOrphans(SpaceOutliner &space_outliner)
Tree-Display for the Libraries display mode.
ListBase buildTree(const TreeSourceData &source_data) override
TreeDisplayLibraries(SpaceOutliner &space_outliner)
Tree-Display for the Library Overrides display mode.
ListBase buildTree(const TreeSourceData &source_data) override
Tree-Display for the Scenes display mode.
ListBase buildTree(const TreeSourceData &source_data) override
TreeDisplayScenes(SpaceOutliner &space_outliner)
Tree-Display for the Video Sequencer display mode.
TreeDisplaySequencer(SpaceOutliner &space_outliner)
ListBase buildTree(const TreeSourceData &source_data) override
Tree-Display for the View Layer display mode.
Definition: tree_display.hh:79
ListBase buildTree(const TreeSourceData &source_data) override
TreeDisplayViewLayer(SpaceOutliner &space_outliner)
DRWShaderLibrary * lib
Definition: DNA_ID.h:273
Definition: BKE_main.h:116
The data to build the tree from.
Definition: tree_display.h:39