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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_outliner/tree/tree_element.hh')
-rw-r--r--source/blender/editors/space_outliner/tree/tree_element.hh19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/tree/tree_element.hh b/source/blender/editors/space_outliner/tree/tree_element.hh
index 3e61dd25898..4a7e95556db 100644
--- a/source/blender/editors/space_outliner/tree/tree_element.hh
+++ b/source/blender/editors/space_outliner/tree/tree_element.hh
@@ -37,17 +37,24 @@ class AbstractTreeElement {
TreeElement &legacy_te_;
public:
- AbstractTreeElement(TreeElement &legacy_te) : legacy_te_(legacy_te)
- {
- }
virtual ~AbstractTreeElement() = default;
/**
+ * Check if the type is expandible in current context.
+ */
+ virtual bool expandPoll(const SpaceOutliner &) const
+ {
+ return true;
+ }
+ /**
* Let the type add its own children.
*/
virtual void expand(SpaceOutliner &) const
{
}
+ virtual void postExpand(SpaceOutliner &) const
+ {
+ }
/**
* Just while transitioning to the new tree-element design: Some types are only partially ported,
@@ -57,6 +64,12 @@ class AbstractTreeElement {
{
return true;
}
+
+ protected:
+ /* Pseudo-abstract: Only allow creation through derived types. */
+ AbstractTreeElement(TreeElement &legacy_te) : legacy_te_(legacy_te)
+ {
+ }
};
} // namespace blender::ed::outliner