diff options
Diffstat (limited to 'source/blender/editors/space_outliner/tree/tree_display.hh')
-rw-r--r-- | source/blender/editors/space_outliner/tree/tree_display.hh | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/source/blender/editors/space_outliner/tree/tree_display.hh b/source/blender/editors/space_outliner/tree/tree_display.hh index 96af8258010..68f0f9c562d 100644 --- a/source/blender/editors/space_outliner/tree/tree_display.hh +++ b/source/blender/editors/space_outliner/tree/tree_display.hh @@ -34,16 +34,35 @@ #pragma once -#include "tree_display.h" +#include <memory> +struct ID; +struct LayerCollection; +struct Library; struct ListBase; struct Main; +struct Scene; +struct Sequence; struct SpaceOutliner; struct TreeElement; -struct TreeSourceData; +struct ViewLayer; namespace blender::ed::outliner { +/** + * \brief The data to build the tree from. + */ +struct TreeSourceData { + Main *bmain; + Scene *scene; + ViewLayer *view_layer; + + TreeSourceData(Main &bmain, Scene &scene, ViewLayer &view_layer) + : bmain(&bmain), scene(&scene), view_layer(&view_layer) + { + } +}; + /* -------------------------------------------------------------------- */ /* Tree-Display Interface */ @@ -59,13 +78,21 @@ class AbstractTreeDisplay { } virtual ~AbstractTreeDisplay() = default; + static std::unique_ptr<AbstractTreeDisplay> createFromDisplayMode( + int /*eSpaceOutliner_Mode*/ mode, SpaceOutliner &space_outliner); + /** * Build a tree for this display mode with the Blender context data given in \a source_data and * the view settings in \a space_outliner. */ virtual ListBase buildTree(const TreeSourceData &source_data) = 0; + /** Accessor to whether given tree has some warnings to display. */ + bool hasWarnings() const; + protected: + bool has_warnings = false; + /** All derived classes will need a handle to this, so storing it in the base for convenience. */ SpaceOutliner &space_outliner_; }; @@ -105,8 +132,8 @@ class TreeDisplayLibraries final : public AbstractTreeDisplay { ListBase buildTree(const TreeSourceData &source_data) override; private: - TreeElement *add_library_contents(Main &, ListBase &, Library *) const; - bool library_id_filter_poll(Library *lib, ID *id) const; + TreeElement *add_library_contents(Main &, ListBase &, Library *); + bool library_id_filter_poll(const Library *lib, ID *id) const; short id_filter_get() const; }; @@ -123,8 +150,8 @@ class TreeDisplayOverrideLibrary final : public AbstractTreeDisplay { ListBase buildTree(const TreeSourceData &source_data) override; private: - TreeElement *add_library_contents(Main &, ListBase &, Library *) const; - bool override_library_id_filter_poll(Library *lib, ID *id) const; + TreeElement *add_library_contents(Main &, ListBase &, Library *); + bool override_library_id_filter_poll(const Library *lib, ID *id) const; short id_filter_get() const; }; @@ -148,6 +175,9 @@ class TreeDisplaySequencer final : public AbstractTreeDisplay { private: TreeElement *add_sequencer_contents() const; + /** + * Helped function to put duplicate sequence in the same tree. + */ SequenceAddOp need_add_seq_dup(Sequence *seq) const; void add_seq_dup(Sequence *seq, TreeElement *te, short index) const; }; |