![]() |
Ember
|
Central panel for managing and displaying behavior tree scenes. More...
#include <MainPanel.h>
Public Types | |
| using | SceneChangedCallback = std::function<void(IScene *newScene, int newIndex)> |
| using | WelcomeActionCallback = std::function<void(const std::string &action, const std::string ¶m)> |
Public Member Functions | |
| MainPanel (wxWindow *parent) | |
| wxString | GetTitle () const override |
| Returns the display title of the panel. | |
| wxString | GetPanelType () const override |
| Returns the panel type identifier. | |
| int | AddScene (std::unique_ptr< IScene > scene) |
| Add a new scene to the panel. | |
| int | InsertScene (int index, std::unique_ptr< IScene > scene) |
| Insert a scene at a specific position. | |
| bool | RemoveScene (int index, bool force=false) |
| Remove a scene by index. | |
| IScene * | GetActiveScene () const |
| Get the currently active scene. | |
| IScene * | GetScene (int index) const |
| Get a scene by index. | |
| size_t | GetSceneCount () const |
| Get the number of scenes. | |
| void | SwitchToNextScene () |
| Switch to the next scene (cyclic) | |
| void | SwitchToPreviousScene () |
| Switch to the previous scene (cyclic) | |
| bool | SetActiveScene (int index) |
| Set the active scene by index. | |
| int | CreateNewScene () |
| Create a new empty behavior tree scene. | |
| int | CreateNewScene (const wxString &customTitle) |
| Create a new empty behavior tree scene with custom title. | |
| void | UpdateActiveSceneTitle (const wxString &newTitle) |
| Update the title of the active scene. | |
| wxAuiNotebook * | GetNotebook () const |
| void | ApplyCanvasBackgroundColor (const wxColour &color) |
| Apply canvas background color to all scenes. | |
| void | SetSceneChangedCallback (SceneChangedCallback callback) |
| void | SetWelcomeActionCallback (WelcomeActionCallback cb) |
| void | ShowWelcome () |
| void | ShowScenes () |
| Public Member Functions inherited from EmberUI::Panel | |
| Panel (wxWindow *parent, const wxString &name="Panel", long style=wxTAB_TRAVERSAL) | |
| Constructs the panel with optional name and style. | |
| virtual | ~Panel () |
| wxPanel * | GetPanel () override |
| Returns this panel as wxPanel pointer. | |
| wxString | GetTitle () const override |
| Returns the panel title. | |
| wxString | GetPanelType () const override |
| Returns the panel type identifier. | |
| void | Initialize () override |
| Initializes the panel layout and appearance. | |
| void | Refresh () override |
| Refreshes panel content. | |
| void | OnActivated () override |
| Called when the panel is activated. | |
| void | OnDeactivated () override |
| Called when the panel is deactivated. | |
| void | Cleanup () override |
| Cleans up panel resources. | |
| bool | IsValid () const override |
| Returns true if the panel has been initialized. | |
| wxString | SerializeState () const override |
| Serializes panel state to a string. | |
| void | DeserializeState (const wxString &state) override |
| Restores panel state from a serialized string. | |
| bool | HasUnsavedChanges () const override |
| Returns true if there are unsaved changes. | |
| bool | Save () override |
| Saves panel state; returns true on success. | |
| bool | SupportsOperation (const wxString &operation) const override |
| Returns true if the panel supports the given operation. | |
| bool | ExecuteOperation (const wxString &operation, const wxString ¶meter="") override |
| Executes a named operation with optional parameter. | |
| wxString | GetName () const override |
| Returns the panel name. | |
| void | SetName (const wxString &name) override |
| Sets the panel name. | |
| void | SetTitle (const wxString &title) |
| Sets the panel title. | |
| void | SetPanelType (const wxString &type) |
| Sets the panel type identifier. | |
| Public Member Functions inherited from IPanel | |
| virtual | ~IPanel ()=default |
Private Types | |
| enum | { ID_NEW_SCENE_BUTTON = wxID_HIGHEST + 1000 , ID_SCENE_NOTEBOOK , ID_OVERLAY_BUTTON , ID_OVERLAY_SHOW_ALL = wxID_HIGHEST + 2000 , ID_OVERLAY_HIDE_ALL , ID_OVERLAY_GRID , ID_OVERLAY_MINIMAP , ID_OVERLAY_BREADCRUMB , ID_OVERLAY_COORDINATE , ID_OVERLAY_SELECTED_NODE , ID_OVERLAY_TREE_INFO , ID_OVERLAY_FPS , ID_OVERLAY_CONTROLS_HELP } |
Private Member Functions | |
| void | CreateLayout () override |
| Hook: creates the panel layout. Override to customize. | |
| void | CreateToolbar () |
| void | DoCreateLayout () |
| void | DoCreateToolbar () |
| wxPanel * | CreateWelcomePanel () |
| void | OnTabChanged (wxAuiNotebookEvent &event) |
| void | OnTabClosed (wxAuiNotebookEvent &event) |
| void | OnNewSceneButton (wxCommandEvent &event) |
| void | OnOverlayButton (wxCommandEvent &event) |
| void | OnOverlayMenuItem (wxCommandEvent &event) |
| void | UpdateOverlayButtonState () |
| void | ApplyOverlayToActiveCanvas () |
| wxString | GenerateSceneTitle () const |
| bool | SceneTitleExists (const wxString &title) const |
| wxDECLARE_EVENT_TABLE () | |
Private Attributes | |
| wxStaticText * | m_title |
| wxToolBar * | m_toolbar |
| wxSimplebook * | m_book = nullptr |
| wxPanel * | m_welcomePanel = nullptr |
| wxAuiNotebook * | m_sceneNotebook |
| std::vector< std::unique_ptr< IScene > > | m_scenes |
| int | m_activeSceneIndex |
| int | m_nextSceneNumber |
| bool | m_isClosingTab = false |
| SceneChangedCallback | m_sceneChangedCallback |
| WelcomeActionCallback | m_welcomeActionCallback |
Additional Inherited Members | |
| Protected Member Functions inherited from EmberUI::Panel | |
| virtual void | ApplyTheme () |
| Hook: applies theme colors and fonts. Override to customize. | |
| virtual void | UpdateContent () |
| Hook: updates displayed content. Override to refresh data. | |
| virtual void | HandleActivation () |
| Hook: handles panel activation. Override to customize. | |
| virtual void | HandleDeactivation () |
| Hook: handles panel deactivation. Override to customize. | |
| virtual bool | ValidateState () const |
| Hook: validates panel state; returns true if valid. | |
| void | MarkChanged () |
| Marks the panel as having unsaved changes. | |
| void | MarkSaved () |
| Clears the unsaved-changes flag. | |
| wxSizer * | GetMainSizer () const |
| Returns the main sizer for layout. | |
| void | SetMainSizer (wxSizer *sizer) |
| Sets the main sizer. | |
| virtual void | OnPanelSize (wxSizeEvent &event) |
| Hook: handles panel resize events. | |
| virtual void | OnPanelPaint (wxPaintEvent &event) |
| Hook: handles panel paint events. | |
Central panel for managing and displaying behavior tree scenes.
MainPanel is the primary workspace area in EmberForge where behavior trees are visualized and edited. It manages multiple scenes using a tabbed notebook interface, allowing users to work with several behavior trees simultaneously.
Definition at line 43 of file MainPanel.h.
| using MainPanel::SceneChangedCallback = std::function<void(IScene *newScene, int newIndex)> |
Definition at line 139 of file MainPanel.h.
| using MainPanel::WelcomeActionCallback = std::function<void(const std::string &action, const std::string ¶m)> |
Definition at line 142 of file MainPanel.h.
|
private |
Definition at line 149 of file MainPanel.h.
| MainPanel::MainPanel | ( | wxWindow * | parent | ) |
| int MainPanel::AddScene | ( | std::unique_ptr< IScene > | scene | ) |
Add a new scene to the panel.
| scene | The scene to add |
Definition at line 324 of file MainPanel.cpp.
| void MainPanel::ApplyCanvasBackgroundColor | ( | const wxColour & | color | ) |
Apply canvas background color to all scenes.
| color | Background color to apply |
Definition at line 676 of file MainPanel.cpp.
|
private |
Definition at line 776 of file MainPanel.cpp.
|
overrideprivatevirtual |
Hook: creates the panel layout. Override to customize.
Reimplemented from EmberUI::Panel.
Definition at line 28 of file MainPanel.cpp.
| int MainPanel::CreateNewScene | ( | ) |
Create a new empty behavior tree scene.
Definition at line 461 of file MainPanel.cpp.
| int MainPanel::CreateNewScene | ( | const wxString & | customTitle | ) |
Create a new empty behavior tree scene with custom title.
| customTitle | The title for the new scene |
Definition at line 511 of file MainPanel.cpp.
|
private |
Definition at line 281 of file MainPanel.cpp.
|
private |
Definition at line 64 of file MainPanel.cpp.
|
private |
Definition at line 32 of file MainPanel.cpp.
|
private |
Definition at line 285 of file MainPanel.cpp.
|
private |
Definition at line 477 of file MainPanel.cpp.
| IScene * MainPanel::GetActiveScene | ( | ) | const |
Get the currently active scene.
Definition at line 425 of file MainPanel.cpp.
|
inline |
Definition at line 131 of file MainPanel.h.
|
inlineoverridevirtual |
| IScene * MainPanel::GetScene | ( | int | index | ) | const |
Get a scene by index.
| index | Index of the scene |
Definition at line 432 of file MainPanel.cpp.
|
inline |
Get the number of scenes.
Definition at line 92 of file MainPanel.h.
|
inlineoverridevirtual |
Returns the display title of the panel.
Implements IPanel.
Definition at line 48 of file MainPanel.h.
| int MainPanel::InsertScene | ( | int | index, |
| std::unique_ptr< IScene > | scene ) |
Insert a scene at a specific position.
| index | Position to insert at |
| scene | The scene to insert |
Definition at line 360 of file MainPanel.cpp.
|
private |
Definition at line 572 of file MainPanel.cpp.
|
private |
Definition at line 707 of file MainPanel.cpp.
|
private |
Definition at line 733 of file MainPanel.cpp.
|
private |
Definition at line 543 of file MainPanel.cpp.
|
private |
Definition at line 598 of file MainPanel.cpp.
| bool MainPanel::RemoveScene | ( | int | index, |
| bool | force = false ) |
Remove a scene by index.
| index | Index of the scene to remove |
| force | If true, skip unsaved changes confirmation |
Definition at line 378 of file MainPanel.cpp.
|
private |
Definition at line 502 of file MainPanel.cpp.
| bool MainPanel::SetActiveScene | ( | int | index | ) |
Set the active scene by index.
| index | Index of the scene to activate |
Definition at line 439 of file MainPanel.cpp.
|
inline |
Definition at line 140 of file MainPanel.h.
|
inline |
Definition at line 143 of file MainPanel.h.
| void MainPanel::ShowScenes | ( | ) |
Definition at line 271 of file MainPanel.cpp.
| void MainPanel::ShowWelcome | ( | ) |
Definition at line 261 of file MainPanel.cpp.
| void MainPanel::SwitchToNextScene | ( | ) |
Switch to the next scene (cyclic)
Definition at line 688 of file MainPanel.cpp.
| void MainPanel::SwitchToPreviousScene | ( | ) |
Switch to the previous scene (cyclic)
Definition at line 697 of file MainPanel.cpp.
| void MainPanel::UpdateActiveSceneTitle | ( | const wxString & | newTitle | ) |
Update the title of the active scene.
| newTitle | The new title for the scene |
Definition at line 526 of file MainPanel.cpp.
|
private |
Definition at line 798 of file MainPanel.cpp.
|
private |
|
private |
Definition at line 191 of file MainPanel.h.
|
private |
Definition at line 186 of file MainPanel.h.
|
private |
Definition at line 193 of file MainPanel.h.
|
private |
Definition at line 192 of file MainPanel.h.
|
private |
Definition at line 194 of file MainPanel.h.
|
private |
Definition at line 188 of file MainPanel.h.
|
private |
Definition at line 190 of file MainPanel.h.
|
private |
Definition at line 184 of file MainPanel.h.
|
private |
Definition at line 185 of file MainPanel.h.
|
private |
Definition at line 195 of file MainPanel.h.
|
private |
Definition at line 187 of file MainPanel.h.