Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tree_iterator.hh « tree « space_outliner « editors « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c94c2f95cfe4a628a2b9ded1938e372f0cb033c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: GPL-2.0-or-later */

/** \file
 * \ingroup spoutliner
 */

#pragma once

#include "BLI_function_ref.hh"

struct ListBase;
struct SpaceOutliner;

namespace blender::ed::outliner {

struct TreeElement;

namespace tree_iterator {

using VisitorFn = FunctionRef<void(TreeElement *)>;

/**
 * Preorder (meaning depth-first) traversal of all elements (regardless of collapsed state).
 * Freeing the currently visited element in \a visitor is fine.
 */
void all(const SpaceOutliner &space_outliner, VisitorFn visitor);
void all(const ListBase &subtree, VisitorFn visitor);

/**
 * Preorder (meaning depth-first) traversal of all elements not part of a collapsed sub-tree.
 * Freeing the currently visited element in \a visitor is fine (but not its tree-store element).
 */
void all_open(const SpaceOutliner &, VisitorFn visitor);
void all_open(const SpaceOutliner &, const ListBase &subtree, VisitorFn visitor);

}  // namespace tree_iterator
}  // namespace blender::ed::outliner