![]() |
Ember
|
Scene implementation for behavior tree visualization. More...
#include <BehaviorTreeScene.h>
Public Types | |
| using | NodeSelectionCallback = std::function<void(EmberCore::ITreeNode *)> |
Public Member Functions | |
| BehaviorTreeScene (wxWindow *parent, const wxString &title="Behavior Tree") | |
| Construct a new BehaviorTreeScene. | |
| virtual | ~BehaviorTreeScene () |
| wxPanel * | GetPanel () override |
| Get the main panel widget for this scene. | |
| wxString | GetTitle () const override |
| Get the display title for this scene. | |
| wxString | GetSceneType () const override |
| Get a unique identifier for this scene type. | |
| void | OnActivated () override |
| Called when this scene becomes the active tab. | |
| void | OnDeactivated () override |
| Called when this scene is no longer the active tab. | |
| void | Refresh () override |
| Called when the scene should refresh its display. | |
| bool | HasUnsavedChanges () const override |
| Check if this scene has unsaved changes. | |
| bool | Save () override |
| Save the scene (if applicable) | |
| void | SetBehaviorTree (std::shared_ptr< EmberCore::Node > root) |
| Set the behavior tree for this scene using legacy Node interface. | |
| void | SetBehaviorTree (std::shared_ptr< EmberCore::ITreeStructure > tree) |
| Set the behavior tree for this scene using new abstraction interface. | |
| EmberCore::Node * | GetBehaviorTree () const |
| Get the behavior tree root node (legacy interface) | |
| EmberCore::ITreeStructure * | GetAbstractedTree () const |
| Get the abstracted tree structure. | |
| EmberCore::TreeVisualization * | GetTreeVisualization () const |
| Get the tree visualization component. | |
| void | CreateSampleBehaviorTree () |
| Create a sample behavior tree for testing/demo purposes. | |
| void | SetTitle (const wxString &title) |
| Set the title of this scene. | |
| void | SetNodeSelectionCallback (NodeSelectionCallback callback) |
| Set callback for node selection events. | |
| void | SetCanvasBackgroundColor (const wxColour &color) |
| Set the canvas background color. | |
| BehaviorTreeScene (const BehaviorTreeScene &)=delete | |
| BehaviorTreeScene & | operator= (const BehaviorTreeScene &)=delete |
| Public Member Functions inherited from IScene | |
| virtual | ~IScene ()=default |
Private Member Functions | |
| void | CreateLayout () |
Private Attributes | |
| wxPanel * | m_panel |
| EmberCore::TreeVisualization * | m_treeVisualization |
| std::shared_ptr< EmberCore::Node > | m_behaviorTreeRoot |
| std::shared_ptr< EmberCore::ITreeStructure > | m_treeAdapter |
| wxString | m_title |
| bool | m_hasUnsavedChanges |
| NodeSelectionCallback | m_nodeSelectionCallback |
Scene implementation for behavior tree visualization.
This class encapsulates all behavior tree specific functionality that was previously embedded in MainPanel, allowing MainPanel to be generic.
Definition at line 21 of file BehaviorTreeScene.h.
| using BehaviorTreeScene::NodeSelectionCallback = std::function<void(EmberCore::ITreeNode *)> |
Definition at line 24 of file BehaviorTreeScene.h.
| BehaviorTreeScene::BehaviorTreeScene | ( | wxWindow * | parent, |
| const wxString & | title = "Behavior Tree" ) |
Construct a new BehaviorTreeScene.
| parent | Parent window for the scene panel |
| title | Title for this scene tab (optional) |
Definition at line 7 of file BehaviorTreeScene.cpp.
|
virtual |
Definition at line 28 of file BehaviorTreeScene.cpp.
|
delete |
|
private |
Definition at line 35 of file BehaviorTreeScene.cpp.
| void BehaviorTreeScene::CreateSampleBehaviorTree | ( | ) |
Create a sample behavior tree for testing/demo purposes.
Definition at line 108 of file BehaviorTreeScene.cpp.
|
inline |
Get the abstracted tree structure.
Definition at line 68 of file BehaviorTreeScene.h.
|
inline |
Get the behavior tree root node (legacy interface)
Definition at line 62 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Get the main panel widget for this scene.
Implements IScene.
Definition at line 36 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Get a unique identifier for this scene type.
Implements IScene.
Definition at line 38 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Get the display title for this scene.
Implements IScene.
Definition at line 37 of file BehaviorTreeScene.h.
|
inline |
Get the tree visualization component.
Definition at line 74 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Check if this scene has unsaved changes.
Reimplemented from IScene.
Definition at line 42 of file BehaviorTreeScene.h.
|
overridevirtual |
Called when this scene becomes the active tab.
Reimplemented from IScene.
Definition at line 55 of file BehaviorTreeScene.cpp.
|
overridevirtual |
Called when this scene is no longer the active tab.
Reimplemented from IScene.
Definition at line 62 of file BehaviorTreeScene.cpp.
|
delete |
|
overridevirtual |
Called when the scene should refresh its display.
Reimplemented from IScene.
Definition at line 64 of file BehaviorTreeScene.cpp.
|
overridevirtual |
Save the scene (if applicable)
Reimplemented from IScene.
Definition at line 70 of file BehaviorTreeScene.cpp.
| void BehaviorTreeScene::SetBehaviorTree | ( | std::shared_ptr< EmberCore::ITreeStructure > | tree | ) |
Set the behavior tree for this scene using new abstraction interface.
| tree | Tree structure to visualize |
Definition at line 96 of file BehaviorTreeScene.cpp.
| void BehaviorTreeScene::SetBehaviorTree | ( | std::shared_ptr< EmberCore::Node > | root | ) |
Set the behavior tree for this scene using legacy Node interface.
| root | Root node of the behavior tree (for backward compatibility) |
Definition at line 75 of file BehaviorTreeScene.cpp.
| void BehaviorTreeScene::SetCanvasBackgroundColor | ( | const wxColour & | color | ) |
Set the canvas background color.
| color | Background color to apply |
Definition at line 132 of file BehaviorTreeScene.cpp.
|
inline |
Set callback for node selection events.
| callback | Function to call when a node is selected in the scene view |
Definition at line 91 of file BehaviorTreeScene.h.
| void BehaviorTreeScene::SetTitle | ( | const wxString & | title | ) |
Set the title of this scene.
| title | New title for the scene tab |
Definition at line 130 of file BehaviorTreeScene.cpp.
|
private |
Definition at line 111 of file BehaviorTreeScene.h.
|
private |
Definition at line 114 of file BehaviorTreeScene.h.
|
private |
Definition at line 117 of file BehaviorTreeScene.h.
|
private |
Definition at line 107 of file BehaviorTreeScene.h.
|
private |
Definition at line 113 of file BehaviorTreeScene.h.
|
private |
Definition at line 112 of file BehaviorTreeScene.h.
|
private |
Definition at line 108 of file BehaviorTreeScene.h.