|
Blender
V3.3
|
#include <BKE_asset_catalog.hh>
Public Types | |
| using | ChildMap = std::map< std::string, AssetCatalogTreeItem > |
| using | ItemIterFn = FunctionRef< void(AssetCatalogTreeItem &)> |
Public Member Functions | |
| AssetCatalogTreeItem (StringRef name, CatalogID catalog_id, StringRef simple_name, const AssetCatalogTreeItem *parent=nullptr) | |
| CatalogID | get_catalog_id () const |
| StringRefNull | get_simple_name () const |
| StringRefNull | get_name () const |
| bool | has_unsaved_changes () const |
| AssetCatalogPath | catalog_path () const |
| int | count_parents () const |
| bool | has_children () const |
| void | foreach_child (const ItemIterFn callback) |
Protected Attributes | |
| ChildMap | children_ |
| CatalogPathComponent | name_ |
| CatalogID | catalog_id_ |
| std::string | simple_name_ |
| bool | has_unsaved_changes_ = false |
| const AssetCatalogTreeItem * | parent_ = nullptr |
Friends | |
| class | AssetCatalogTree |
Representation of a catalog path in the AssetCatalogTree.
Definition at line 284 of file BKE_asset_catalog.hh.
| using blender::bke::AssetCatalogTreeItem::ChildMap = std::map<std::string, AssetCatalogTreeItem> |
Container for child items. Uses a #std::map to keep items ordered by their name (i.e. their last catalog component).
Definition at line 290 of file BKE_asset_catalog.hh.
Definition at line 291 of file BKE_asset_catalog.hh.
| blender::bke::AssetCatalogTreeItem::AssetCatalogTreeItem | ( | StringRef | name, |
| CatalogID | catalog_id, | ||
| StringRef | simple_name, | ||
| const AssetCatalogTreeItem * | parent = nullptr |
||
| ) |
Definition at line 675 of file blenkernel/intern/asset_catalog.cc.
| AssetCatalogPath blender::bke::AssetCatalogTreeItem::catalog_path | ( | ) | const |
Return the full catalog path, defined as the name of this catalog prefixed by the full catalog path of its parent and a separator.
Definition at line 702 of file blenkernel/intern/asset_catalog.cc.
References name_, and parent_.
Referenced by blender::bke::tests::AssetCatalogTest::assert_expected_item(), blender::bke::tests::AssetCatalogTest::assert_expected_tree_item_child_items(), blender::bke::tests::AssetCatalogTest::assert_expected_tree_items(), blender::bke::tests::AssetCatalogTest::assert_expected_tree_root_items(), blender::ed::asset_browser::AssetCatalogTreeViewItem::build_context_menu(), blender::ed::asset_browser::AssetCatalogTreeViewItem::build_row(), and blender::ed::asset_browser::AssetCatalogDropController::can_drop().
| int blender::bke::AssetCatalogTreeItem::count_parents | ( | ) | const |
Definition at line 711 of file blenkernel/intern/asset_catalog.cc.
References parent_.
Referenced by blender::bke::tests::AssetCatalogTest::assert_expected_item().
| void blender::bke::AssetCatalogTreeItem::foreach_child | ( | const ItemIterFn | callback | ) |
Iterate over children calling callback for each of them, but do not recurse into their children.
Definition at line 734 of file blenkernel/intern/asset_catalog.cc.
References callback, and children_.
Referenced by blender::bke::tests::AssetCatalogTest::assert_expected_tree_item_child_items().
| CatalogID blender::bke::AssetCatalogTreeItem::get_catalog_id | ( | ) | const |
Definition at line 683 of file blenkernel/intern/asset_catalog.cc.
References catalog_id_.
Referenced by blender::ed::asset_browser::AssetCatalogTreeViewItem::build_context_menu(), blender::ed::asset_browser::AssetCatalogDragController::create_drag_data(), blender::ed::asset_browser::AssetCatalogTreeViewItem::on_activate(), blender::ed::asset_browser::AssetCatalogDragController::on_drag_start(), blender::ed::asset_browser::AssetCatalogDropController::on_drop(), and blender::ed::asset_browser::AssetCatalogTreeViewItem::rename().
| StringRefNull blender::bke::AssetCatalogTreeItem::get_name | ( | ) | const |
Definition at line 688 of file blenkernel/intern/asset_catalog.cc.
References name_.
Referenced by blender::bke::tests::AssetCatalogTest::assert_expected_item().
| StringRefNull blender::bke::AssetCatalogTreeItem::get_simple_name | ( | ) | const |
Definition at line 693 of file blenkernel/intern/asset_catalog.cc.
References simple_name_.
Referenced by blender::ed::asset_browser::AssetCatalogDropController::on_drop().
| bool blender::bke::AssetCatalogTreeItem::has_children | ( | ) | const |
Definition at line 720 of file blenkernel/intern/asset_catalog.cc.
References children_.
| bool blender::bke::AssetCatalogTreeItem::has_unsaved_changes | ( | ) | const |
Definition at line 697 of file blenkernel/intern/asset_catalog.cc.
References has_unsaved_changes_.
Referenced by blender::ed::asset_browser::AssetCatalogTreeViewItem::build_row().
|
friend |
Definition at line 285 of file BKE_asset_catalog.hh.
|
protected |
Definition at line 317 of file BKE_asset_catalog.hh.
Referenced by get_catalog_id().
|
protected |
Child tree items, ordered by their names.
Definition at line 314 of file BKE_asset_catalog.hh.
Referenced by foreach_child(), has_children(), and blender::bke::AssetCatalogTree::insert_item().
|
protected |
Copy of #AssetCatalog::flags.has_unsaved_changes.
Definition at line 321 of file BKE_asset_catalog.hh.
Referenced by has_unsaved_changes().
|
protected |
The user visible name of this component.
Definition at line 316 of file BKE_asset_catalog.hh.
Referenced by catalog_path(), and get_name().
|
protected |
Pointer back to the parent item. Used to reconstruct the hierarchy from an item (e.g. to build a path).
Definition at line 325 of file BKE_asset_catalog.hh.
Referenced by catalog_path(), and count_parents().
|
protected |
Copy of #AssetCatalog::simple_name.
Definition at line 319 of file BKE_asset_catalog.hh.
Referenced by get_simple_name().