![]() |
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 |
| Returns the wxPanel used as the scene content. | |
| wxString | GetTitle () const override |
| Returns the display title of the scene. | |
| wxString | GetSceneType () const override |
| Returns the scene type identifier. | |
| void | OnActivated () override |
| Called when the scene becomes active. | |
| void | OnDeactivated () override |
| Called when the scene becomes inactive. | |
| void | Refresh () override |
| Refreshes the scene content. | |
| bool | HasUnsavedChanges () const override |
| Returns true if the scene has unsaved changes. | |
| bool | Save () override |
| Saves the scene content; returns true on success. | |
| 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. | |
| std::shared_ptr< EmberCore::ITreeStructure > | GetTreeAdapter () const |
| EmberForge::ForgeTreeCanvas * | GetTreeVisualization () const |
| 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 |
| virtual bool | IsClosable () const |
| Returns true if the scene can be closed. | |
Private Member Functions | |
| void | CreateLayout () |
Private Attributes | |
| wxPanel * | m_panel |
| EmberForge::ForgeTreeCanvas * | 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 8 of file BehaviorTreeScene.cpp.
|
virtual |
Definition at line 29 of file BehaviorTreeScene.cpp.
|
delete |
|
private |
Definition at line 39 of file BehaviorTreeScene.cpp.
| void BehaviorTreeScene::CreateSampleBehaviorTree | ( | ) |
Create a sample behavior tree for testing/demo purposes.
Definition at line 113 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 |
Returns the wxPanel used as the scene content.
Implements IScene.
Definition at line 36 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Returns the scene type identifier.
Implements IScene.
Definition at line 38 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Returns the display title of the scene.
Implements IScene.
Definition at line 37 of file BehaviorTreeScene.h.
|
inline |
Definition at line 70 of file BehaviorTreeScene.h.
|
inline |
Definition at line 71 of file BehaviorTreeScene.h.
|
inlineoverridevirtual |
Returns true if the scene has unsaved changes.
Reimplemented from IScene.
Definition at line 42 of file BehaviorTreeScene.h.
|
overridevirtual |
Called when the scene becomes active.
Reimplemented from IScene.
Definition at line 59 of file BehaviorTreeScene.cpp.
|
overridevirtual |
Called when the scene becomes inactive.
Reimplemented from IScene.
Definition at line 66 of file BehaviorTreeScene.cpp.
|
delete |
|
overridevirtual |
Refreshes the scene content.
Reimplemented from IScene.
Definition at line 68 of file BehaviorTreeScene.cpp.
|
overridevirtual |
Saves the scene content; returns true on success.
Reimplemented from IScene.
Definition at line 74 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 101 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 79 of file BehaviorTreeScene.cpp.
| void BehaviorTreeScene::SetCanvasBackgroundColor | ( | const wxColour & | color | ) |
Set the canvas background color.
| color | Background color to apply |
Definition at line 138 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 88 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 136 of file BehaviorTreeScene.cpp.
|
private |
Definition at line 108 of file BehaviorTreeScene.h.
|
private |
Definition at line 111 of file BehaviorTreeScene.h.
|
private |
Definition at line 114 of file BehaviorTreeScene.h.
|
private |
Definition at line 104 of file BehaviorTreeScene.h.
|
private |
Definition at line 110 of file BehaviorTreeScene.h.
|
private |
Definition at line 109 of file BehaviorTreeScene.h.
|
private |
Definition at line 105 of file BehaviorTreeScene.h.