Ember
Loading...
Searching...
No Matches
ForgeNavigatorTab.cpp
Go to the documentation of this file.
2#include "App/MainFrame.h"
3
5 : EmberUI::NavigatorTab(parent, /*deferLayout=*/false), m_mainFrame(mainFrame) {
6 if (!m_mainFrame)
7 return;
8
9 SetTreeSelectionCallback([this](const std::string &treeId) {
10 if (treeId != m_mainFrame->GetCurrentTreeId()) {
11 m_mainFrame->LoadTreeIntoScene(treeId);
12 m_mainFrame->UpdateTreeSelector();
13 }
14 });
15
16 SetNodeSelectionCallback([this](EmberCore::ITreeNode *node) { m_mainFrame->OnHierarchySelectionChanged(node); });
17
18 SetLayoutInvalidationCallback([this]() { m_mainFrame->InvalidateCanvasLayout(); });
19
20 SetBlackboardSelectionCallback([this](const std::string &bbId) { m_mainFrame->NavigateToBlackboard(bbId); });
21
22 SetCallbacks({[this]() { return m_mainFrame->IsActiveSceneBehaviorTree(); },
23 [this]() { m_mainFrame->RefreshCanvasVisualization(); },
24 [this](EmberCore::ITreeNode *n) { m_mainFrame->CenterOnNode(n); },
25 [this](const std::string &id) { m_mainFrame->OpenTreeInNewScene(id); },
26 [this]() { m_mainFrame->OnNavigatorTabClosed(); }});
27}
Abstract interface for tree nodes that can be visualized.
Definition ITreeNode.h:31
void SetNodeSelectionCallback(std::function< void(EmberCore::ITreeNode *)> cb)
void SetTreeSelectionCallback(TreeSelectionCallback callback)
void SetBlackboardSelectionCallback(std::function< void(const std::string &)> cb)
void SetCallbacks(NavigatorCallbacks cb)
NavigatorTab(wxWindow *parent)
void SetLayoutInvalidationCallback(std::function< void()> cb)
ForgeNavigatorTab(wxWindow *parent, MainFrame *mainFrame)
Main application window for EmberForge.
Definition MainFrame.h:67
Definition Panel.h:8