From f0ad78e17c3b48b457ad2cda9224924500e89eb9 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 8 Mar 2021 15:40:25 +0100 Subject: Cleanup: Rename recently added Outliner files to exclude "_base" suffix These files can contain more than just the "base" tree element types. E.g. the class for the view-layer base element can also contain the class for the view-layer elements. Otherwise we'd end up with like >50 files for the individual types, most of them very small. So just give the files a general name and put the related classes in there. --- .../blender/editors/space_outliner/CMakeLists.txt | 16 ++--- .../editors/space_outliner/tree/tree_element.cc | 8 +-- .../space_outliner/tree/tree_element_collection.cc | 44 ++++++++++++++ .../space_outliner/tree/tree_element_collection.hh | 36 ++++++++++++ .../tree/tree_element_collection_base.cc | 44 -------------- .../tree/tree_element_collection_base.hh | 36 ------------ .../space_outliner/tree/tree_element_driver.cc | 68 ++++++++++++++++++++++ .../space_outliner/tree/tree_element_driver.hh | 38 ++++++++++++ .../tree/tree_element_driver_base.cc | 68 ---------------------- .../tree/tree_element_driver_base.hh | 38 ------------ .../tree/tree_element_scene_objects.cc | 50 ++++++++++++++++ .../tree/tree_element_scene_objects.hh | 36 ++++++++++++ .../tree/tree_element_scene_objects_base.cc | 50 ---------------- .../tree/tree_element_scene_objects_base.hh | 36 ------------ .../space_outliner/tree/tree_element_view_layer.cc | 51 ++++++++++++++++ .../space_outliner/tree/tree_element_view_layer.hh | 36 ++++++++++++ .../tree/tree_element_view_layer_base.cc | 51 ---------------- .../tree/tree_element_view_layer_base.hh | 36 ------------ 18 files changed, 371 insertions(+), 371 deletions(-) create mode 100644 source/blender/editors/space_outliner/tree/tree_element_collection.cc create mode 100644 source/blender/editors/space_outliner/tree/tree_element_collection.hh delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_collection_base.cc delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_collection_base.hh create mode 100644 source/blender/editors/space_outliner/tree/tree_element_driver.cc create mode 100644 source/blender/editors/space_outliner/tree/tree_element_driver.hh delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_driver_base.cc delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_driver_base.hh create mode 100644 source/blender/editors/space_outliner/tree/tree_element_scene_objects.cc create mode 100644 source/blender/editors/space_outliner/tree/tree_element_scene_objects.hh delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.cc delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.hh create mode 100644 source/blender/editors/space_outliner/tree/tree_element_view_layer.cc create mode 100644 source/blender/editors/space_outliner/tree/tree_element_view_layer.hh delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_view_layer_base.cc delete mode 100644 source/blender/editors/space_outliner/tree/tree_element_view_layer_base.hh (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index 82c87a7b199..0306807d9ad 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -56,13 +56,13 @@ set(SRC tree/tree_display_view_layer.cc tree/tree_element.cc tree/tree_element_anim_data.cc - tree/tree_element_collection_base.cc - tree/tree_element_driver_base.cc + tree/tree_element_collection.cc + tree/tree_element_driver.cc tree/tree_element_gpencil_layer.cc tree/tree_element_id.cc tree/tree_element_nla.cc - tree/tree_element_scene_objects_base.cc - tree/tree_element_view_layer_base.cc + tree/tree_element_scene_objects.cc + tree/tree_element_view_layer.cc outliner_intern.h tree/tree_display.h @@ -70,13 +70,13 @@ set(SRC tree/tree_element.h tree/tree_element.hh tree/tree_element_anim_data.hh - tree/tree_element_collection_base.hh - tree/tree_element_driver_base.hh + tree/tree_element_collection.hh + tree/tree_element_driver.hh tree/tree_element_gpencil_layer.hh tree/tree_element_id.hh tree/tree_element_nla.hh - tree/tree_element_scene_objects_base.hh - tree/tree_element_view_layer_base.hh + tree/tree_element_scene_objects.hh + tree/tree_element_view_layer.hh ) set(LIB diff --git a/source/blender/editors/space_outliner/tree/tree_element.cc b/source/blender/editors/space_outliner/tree/tree_element.cc index 75ecfb5584a..25bd9a53cf8 100644 --- a/source/blender/editors/space_outliner/tree/tree_element.cc +++ b/source/blender/editors/space_outliner/tree/tree_element.cc @@ -21,13 +21,13 @@ #include "DNA_listBase.h" #include "tree_element_anim_data.hh" -#include "tree_element_collection_base.hh" -#include "tree_element_driver_base.hh" +#include "tree_element_collection.hh" +#include "tree_element_driver.hh" #include "tree_element_gpencil_layer.hh" #include "tree_element_id.hh" #include "tree_element_nla.hh" -#include "tree_element_scene_objects_base.hh" -#include "tree_element_view_layer_base.hh" +#include "tree_element_scene_objects.hh" +#include "tree_element_view_layer.hh" #include "tree_element.h" #include "tree_element.hh" diff --git a/source/blender/editors/space_outliner/tree/tree_element_collection.cc b/source/blender/editors/space_outliner/tree/tree_element_collection.cc new file mode 100644 index 00000000000..1add61db7f1 --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_collection.cc @@ -0,0 +1,44 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#include "DNA_listBase.h" + +#include "BLT_translation.h" + +#include "../outliner_intern.h" +#include "tree_display.h" + +#include "tree_element_collection.hh" + +namespace blender::ed::outliner { + +TreeElementCollectionBase::TreeElementCollectionBase(TreeElement &legacy_te, Scene &scene) + : AbstractTreeElement(legacy_te), scene_(scene) +{ + BLI_assert(legacy_te.store_elem->type == TSE_SCENE_COLLECTION_BASE); + legacy_te.name = IFACE_("Scene Collection"); +} + +void TreeElementCollectionBase::expand(SpaceOutliner &space_outliner) const +{ + outliner_add_collection_recursive(&space_outliner, scene_.master_collection, &legacy_te_); +} + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_collection.hh b/source/blender/editors/space_outliner/tree/tree_element_collection.hh new file mode 100644 index 00000000000..e9584d37dfe --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_collection.hh @@ -0,0 +1,36 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#pragma once + +#include "tree_element.hh" + +namespace blender::ed::outliner { + +class TreeElementCollectionBase final : public AbstractTreeElement { + Scene &scene_; + + public: + TreeElementCollectionBase(TreeElement &legacy_te, Scene &scene); + + void expand(SpaceOutliner &) const override; +}; + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_collection_base.cc b/source/blender/editors/space_outliner/tree/tree_element_collection_base.cc deleted file mode 100644 index 29e010b100d..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_collection_base.cc +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#include "DNA_listBase.h" - -#include "BLT_translation.h" - -#include "../outliner_intern.h" -#include "tree_display.h" - -#include "tree_element_collection_base.hh" - -namespace blender::ed::outliner { - -TreeElementCollectionBase::TreeElementCollectionBase(TreeElement &legacy_te, Scene &scene) - : AbstractTreeElement(legacy_te), scene_(scene) -{ - BLI_assert(legacy_te.store_elem->type == TSE_SCENE_COLLECTION_BASE); - legacy_te.name = IFACE_("Scene Collection"); -} - -void TreeElementCollectionBase::expand(SpaceOutliner &space_outliner) const -{ - outliner_add_collection_recursive(&space_outliner, scene_.master_collection, &legacy_te_); -} - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_collection_base.hh b/source/blender/editors/space_outliner/tree/tree_element_collection_base.hh deleted file mode 100644 index e9584d37dfe..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_collection_base.hh +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#pragma once - -#include "tree_element.hh" - -namespace blender::ed::outliner { - -class TreeElementCollectionBase final : public AbstractTreeElement { - Scene &scene_; - - public: - TreeElementCollectionBase(TreeElement &legacy_te, Scene &scene); - - void expand(SpaceOutliner &) const override; -}; - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_driver.cc b/source/blender/editors/space_outliner/tree/tree_element_driver.cc new file mode 100644 index 00000000000..42f51908eaa --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_driver.cc @@ -0,0 +1,68 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#include "BLI_listbase_wrapper.hh" + +#include "BKE_fcurve_driver.h" + +#include "DNA_anim_types.h" +#include "DNA_listBase.h" + +#include "BLT_translation.h" + +#include "../outliner_intern.h" +#include "tree_display.h" + +#include "tree_element_driver.hh" + +namespace blender::ed::outliner { + +TreeElementDriverBase::TreeElementDriverBase(TreeElement &legacy_te, AnimData &anim_data) + : AbstractTreeElement(legacy_te), anim_data_(anim_data) +{ + BLI_assert(legacy_te.store_elem->type == TSE_DRIVER_BASE); + legacy_te.name = IFACE_("Drivers"); +} + +void TreeElementDriverBase::expand(SpaceOutliner &space_outliner) const +{ + ID *lastadded = nullptr; + + for (FCurve *fcu : blender::ListBaseWrapper(anim_data_.drivers)) { + if (fcu->driver && fcu->driver->variables.first) { + ChannelDriver *driver = fcu->driver; + + for (DriverVar *dvar : blender::ListBaseWrapper(driver->variables)) { + /* loop over all targets used here */ + DRIVER_TARGETS_USED_LOOPER_BEGIN (dvar) { + if (lastadded != dtar->id) { + /* XXX this lastadded check is rather lame, and also fails quite badly... */ + outliner_add_element( + &space_outliner, &legacy_te_.subtree, dtar->id, &legacy_te_, TSE_LINKED_OB, 0); + lastadded = dtar->id; + } + } + DRIVER_TARGETS_LOOPER_END; + } + } + } +} + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_driver.hh b/source/blender/editors/space_outliner/tree/tree_element_driver.hh new file mode 100644 index 00000000000..1925e3570be --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_driver.hh @@ -0,0 +1,38 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#pragma once + +#include "tree_element.hh" + +struct TreeElement; + +namespace blender::ed::outliner { + +class TreeElementDriverBase final : public AbstractTreeElement { + AnimData &anim_data_; + + public: + TreeElementDriverBase(TreeElement &legacy_te, AnimData &anim_data); + + void expand(SpaceOutliner &space_outliner) const override; +}; + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_driver_base.cc b/source/blender/editors/space_outliner/tree/tree_element_driver_base.cc deleted file mode 100644 index a01a3c42531..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_driver_base.cc +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#include "BLI_listbase_wrapper.hh" - -#include "BKE_fcurve_driver.h" - -#include "DNA_anim_types.h" -#include "DNA_listBase.h" - -#include "BLT_translation.h" - -#include "../outliner_intern.h" -#include "tree_display.h" - -#include "tree_element_driver_base.hh" - -namespace blender::ed::outliner { - -TreeElementDriverBase::TreeElementDriverBase(TreeElement &legacy_te, AnimData &anim_data) - : AbstractTreeElement(legacy_te), anim_data_(anim_data) -{ - BLI_assert(legacy_te.store_elem->type == TSE_DRIVER_BASE); - legacy_te.name = IFACE_("Drivers"); -} - -void TreeElementDriverBase::expand(SpaceOutliner &space_outliner) const -{ - ID *lastadded = nullptr; - - for (FCurve *fcu : blender::ListBaseWrapper(anim_data_.drivers)) { - if (fcu->driver && fcu->driver->variables.first) { - ChannelDriver *driver = fcu->driver; - - for (DriverVar *dvar : blender::ListBaseWrapper(driver->variables)) { - /* loop over all targets used here */ - DRIVER_TARGETS_USED_LOOPER_BEGIN (dvar) { - if (lastadded != dtar->id) { - /* XXX this lastadded check is rather lame, and also fails quite badly... */ - outliner_add_element( - &space_outliner, &legacy_te_.subtree, dtar->id, &legacy_te_, TSE_LINKED_OB, 0); - lastadded = dtar->id; - } - } - DRIVER_TARGETS_LOOPER_END; - } - } - } -} - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_driver_base.hh b/source/blender/editors/space_outliner/tree/tree_element_driver_base.hh deleted file mode 100644 index 1925e3570be..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_driver_base.hh +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#pragma once - -#include "tree_element.hh" - -struct TreeElement; - -namespace blender::ed::outliner { - -class TreeElementDriverBase final : public AbstractTreeElement { - AnimData &anim_data_; - - public: - TreeElementDriverBase(TreeElement &legacy_te, AnimData &anim_data); - - void expand(SpaceOutliner &space_outliner) const override; -}; - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_scene_objects.cc b/source/blender/editors/space_outliner/tree/tree_element_scene_objects.cc new file mode 100644 index 00000000000..a46e8de1bdd --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_scene_objects.cc @@ -0,0 +1,50 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#include "BKE_collection.h" + +#include "BLI_utildefines.h" + +#include "BLT_translation.h" + +#include "../outliner_intern.h" +#include "tree_display.h" + +#include "tree_element_scene_objects.hh" + +namespace blender::ed::outliner { + +TreeElementSceneObjectsBase::TreeElementSceneObjectsBase(TreeElement &legacy_te, Scene &scene) + : AbstractTreeElement(legacy_te), scene_(scene) +{ + BLI_assert(legacy_te.store_elem->type == TSE_SCENE_OBJECTS_BASE); + legacy_te.name = IFACE_("Objects"); +} + +void TreeElementSceneObjectsBase::expand(SpaceOutliner &space_outliner) const +{ + FOREACH_SCENE_OBJECT_BEGIN (&scene_, ob) { + outliner_add_element(&space_outliner, &legacy_te_.subtree, ob, &legacy_te_, TSE_SOME_ID, 0); + } + FOREACH_SCENE_OBJECT_END; + outliner_make_object_parent_hierarchy(&legacy_te_.subtree); +} + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_scene_objects.hh b/source/blender/editors/space_outliner/tree/tree_element_scene_objects.hh new file mode 100644 index 00000000000..a2aa29c4a33 --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_scene_objects.hh @@ -0,0 +1,36 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#pragma once + +#include "tree_element.hh" + +namespace blender::ed::outliner { + +class TreeElementSceneObjectsBase final : public AbstractTreeElement { + Scene &scene_; + + public: + TreeElementSceneObjectsBase(TreeElement &legacy_te, Scene &scene); + + void expand(SpaceOutliner &) const override; +}; + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.cc b/source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.cc deleted file mode 100644 index 4446b8864e6..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#include "BKE_collection.h" - -#include "BLI_utildefines.h" - -#include "BLT_translation.h" - -#include "../outliner_intern.h" -#include "tree_display.h" - -#include "tree_element_scene_objects_base.hh" - -namespace blender::ed::outliner { - -TreeElementSceneObjectsBase::TreeElementSceneObjectsBase(TreeElement &legacy_te, Scene &scene) - : AbstractTreeElement(legacy_te), scene_(scene) -{ - BLI_assert(legacy_te.store_elem->type == TSE_SCENE_OBJECTS_BASE); - legacy_te.name = IFACE_("Objects"); -} - -void TreeElementSceneObjectsBase::expand(SpaceOutliner &space_outliner) const -{ - FOREACH_SCENE_OBJECT_BEGIN (&scene_, ob) { - outliner_add_element(&space_outliner, &legacy_te_.subtree, ob, &legacy_te_, TSE_SOME_ID, 0); - } - FOREACH_SCENE_OBJECT_END; - outliner_make_object_parent_hierarchy(&legacy_te_.subtree); -} - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.hh b/source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.hh deleted file mode 100644 index a2aa29c4a33..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_scene_objects_base.hh +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#pragma once - -#include "tree_element.hh" - -namespace blender::ed::outliner { - -class TreeElementSceneObjectsBase final : public AbstractTreeElement { - Scene &scene_; - - public: - TreeElementSceneObjectsBase(TreeElement &legacy_te, Scene &scene); - - void expand(SpaceOutliner &) const override; -}; - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_view_layer.cc b/source/blender/editors/space_outliner/tree/tree_element_view_layer.cc new file mode 100644 index 00000000000..7bb9405147e --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_view_layer.cc @@ -0,0 +1,51 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#include "DNA_layer_types.h" + +#include "BLI_listbase_wrapper.hh" + +#include "BLT_translation.h" + +#include "../outliner_intern.h" +#include "tree_display.h" + +#include "tree_element_view_layer.hh" + +namespace blender::ed::outliner { + +TreeElementViewLayerBase::TreeElementViewLayerBase(TreeElement &legacy_te, Scene &scene) + : AbstractTreeElement(legacy_te), scene_(scene) +{ + BLI_assert(legacy_te.store_elem->type == TSE_R_LAYER_BASE); + legacy_te_.name = IFACE_("View Layers"); +} + +void TreeElementViewLayerBase::expand(SpaceOutliner &space_outliner) const +{ + for (auto *view_layer : ListBaseWrapper(scene_.view_layers)) { + TreeElement *tenlay = outliner_add_element( + &space_outliner, &legacy_te_.subtree, &scene_, &legacy_te_, TSE_R_LAYER, 0); + tenlay->name = view_layer->name; + tenlay->directdata = view_layer; + } +} + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_view_layer.hh b/source/blender/editors/space_outliner/tree/tree_element_view_layer.hh new file mode 100644 index 00000000000..24e03b265dc --- /dev/null +++ b/source/blender/editors/space_outliner/tree/tree_element_view_layer.hh @@ -0,0 +1,36 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup spoutliner + */ + +#pragma once + +#include "tree_element.hh" + +namespace blender::ed::outliner { + +class TreeElementViewLayerBase final : public AbstractTreeElement { + Scene &scene_; + + public: + TreeElementViewLayerBase(TreeElement &legacy_te, Scene &scene); + + void expand(SpaceOutliner &) const override; +}; + +} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_view_layer_base.cc b/source/blender/editors/space_outliner/tree/tree_element_view_layer_base.cc deleted file mode 100644 index 490086203dc..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_view_layer_base.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#include "DNA_layer_types.h" - -#include "BLI_listbase_wrapper.hh" - -#include "BLT_translation.h" - -#include "../outliner_intern.h" -#include "tree_display.h" - -#include "tree_element_view_layer_base.hh" - -namespace blender::ed::outliner { - -TreeElementViewLayerBase::TreeElementViewLayerBase(TreeElement &legacy_te, Scene &scene) - : AbstractTreeElement(legacy_te), scene_(scene) -{ - BLI_assert(legacy_te.store_elem->type == TSE_R_LAYER_BASE); - legacy_te_.name = IFACE_("View Layers"); -} - -void TreeElementViewLayerBase::expand(SpaceOutliner &space_outliner) const -{ - for (auto *view_layer : ListBaseWrapper(scene_.view_layers)) { - TreeElement *tenlay = outliner_add_element( - &space_outliner, &legacy_te_.subtree, &scene_, &legacy_te_, TSE_R_LAYER, 0); - tenlay->name = view_layer->name; - tenlay->directdata = view_layer; - } -} - -} // namespace blender::ed::outliner diff --git a/source/blender/editors/space_outliner/tree/tree_element_view_layer_base.hh b/source/blender/editors/space_outliner/tree/tree_element_view_layer_base.hh deleted file mode 100644 index 24e03b265dc..00000000000 --- a/source/blender/editors/space_outliner/tree/tree_element_view_layer_base.hh +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -/** \file - * \ingroup spoutliner - */ - -#pragma once - -#include "tree_element.hh" - -namespace blender::ed::outliner { - -class TreeElementViewLayerBase final : public AbstractTreeElement { - Scene &scene_; - - public: - TreeElementViewLayerBase(TreeElement &legacy_te, Scene &scene); - - void expand(SpaceOutliner &) const override; -}; - -} // namespace blender::ed::outliner -- cgit v1.2.3