Blender V4.3
outliner_query.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <functional>
10
11#include "BLI_listbase.h"
12
13#include "DNA_space_types.h"
14
15#include "outliner_intern.hh"
16#include "tree/tree_display.hh"
17
18namespace blender::ed::outliner {
19
20bool outliner_shows_mode_column(const SpaceOutliner &space_outliner)
21{
22 const AbstractTreeDisplay &tree_display = *space_outliner.runtime->tree_display;
23
24 return tree_display.supports_mode_column() && (space_outliner.flag & SO_MODE_COLUMN);
25}
26
28{
29 std::function<bool(const ListBase &)> recursive_fn;
30
31 recursive_fn = [&](const ListBase &lb) {
32 LISTBASE_FOREACH (const TreeElement *, te, &lb) {
33 if (te->abstract_element && !te->abstract_element->get_warning().is_empty()) {
34 return true;
35 }
36
37 if (recursive_fn(te->subtree)) {
38 return true;
39 }
40 }
41
42 return false;
43 };
44
45 return recursive_fn(space_outliner.tree);
46}
47
48} // namespace blender::ed::outliner
#define LISTBASE_FOREACH(type, var, list)
@ SO_MODE_COLUMN
Base Class For Tree-Displays.
bool outliner_has_element_warnings(const SpaceOutliner &space_outliner)
bool outliner_shows_mode_column(const SpaceOutliner &space_outliner)
SpaceOutliner_Runtime * runtime
std::unique_ptr< AbstractTreeDisplay > tree_display
Establish and manage Outliner trees for different display modes.