Ember
Loading...
Searching...
No Matches
BehaviorTreeProjectDialog Class Reference

Dialog for creating and configuring BehaviorTree projects. More...

#include <BehaviorTreeProjectDialog.h>

Inheritance diagram for BehaviorTreeProjectDialog:

Classes

struct  ClickableItem

Public Member Functions

 BehaviorTreeProjectDialog (wxWindow *parent, std::shared_ptr< EmberCore::BehaviorTreeProject > project=nullptr)
 Construct a new dialog for creating/editing a project.
 ~BehaviorTreeProjectDialog ()
std::shared_ptr< EmberCore::BehaviorTreeProject > GetProject () const
 Get the configured project (after dialog is closed with OK)
bool IsProjectValid () const
 Check if the project configuration is valid.

Private Types

enum  {
  ID_PROJECT_NAME = 1000 , ID_PROJECT_DESCRIPTION , ID_PARSER_PROFILE , ID_RESOURCE_LIST ,
  ID_ADD_FILES , ID_ADD_FOLDER , ID_REMOVE_FILES , ID_CLEAR_FILES ,
  ID_VALIDATE , ID_REFRESH_PREVIEW , ID_CREATE , ID_SAVE ,
  ID_PULSE_TIMER
}

Private Member Functions

void CreateLayout ()
wxPanel * CreateLeftPanel (wxWindow *parent)
wxPanel * CreateRightPanel (wxWindow *parent)
wxPanel * CreateResourcesTab (wxNotebook *notebook)
wxPanel * CreateValidationTab (wxNotebook *notebook)
wxPanel * CreatePreviewTab (wxNotebook *notebook)
wxPanel * CreateBlackboardTab (wxNotebook *notebook)
void OnProjectNameChanged (wxCommandEvent &event)
void OnDescriptionChanged (wxCommandEvent &event)
void OnProfileSelected (wxCommandEvent &event)
void OnAddFiles (wxCommandEvent &event)
void OnAddFolder (wxCommandEvent &event)
void OnRemoveFiles (wxCommandEvent &event)
void OnClearFiles (wxCommandEvent &event)
void OnResourceSelected (wxListEvent &event)
void OnResourceActivated (wxListEvent &event)
void OnValidate (wxCommandEvent &event)
void OnRefreshPreview (wxCommandEvent &event)
void OnCreate (wxCommandEvent &event)
void OnCancel (wxCommandEvent &event)
void OnSave (wxCommandEvent &event)
void LoadProfileList ()
void UpdateResourceList ()
void UpdateValidationReport ()
void UpdateTreePreview ()
void ValidateAndUpdateUI ()
void UpdateCreateButtonState ()
void GenerateColoredValidationReport (const EmberCore::ProjectValidationReport &report)
void DrawFileStructureDiagram (wxDC &dc)
void DrawBlackboardDiagram (wxDC &dc)
void OnStructurePanelClick (wxMouseEvent &event)
void LoadXMLPreview (const std::string &filepath, int highlightLine=-1)
void LoadTreePreview (const std::string &filepath, const std::string &treeId)
void LoadBlackboardPreview (const std::string &filepath, const std::string &blackboardId)
void OnPreviewFilterChanged (wxCommandEvent &event)
void UpdateBlackboardTab ()
bool IsValidProjectName (const wxString &name) const
void OnPulseTimer (wxTimerEvent &event)
void UpdateFieldHighlighting ()
wxColour InterpolateColor (const wxColour &color1, const wxColour &color2, float t)
wxString GetResourceStatusIcon (bool valid) const
void SetResourceItemStatus (long item, bool valid, int treeCount)
void PopulateFromProject ()
 wxDECLARE_EVENT_TABLE ()

Private Attributes

std::shared_ptr< EmberCore::BehaviorTreeProject > m_project
bool m_isValid
bool m_isEditMode
wxTextCtrl * m_projectName
wxTextCtrl * m_projectDescription
wxChoice * m_parserProfile
wxNotebook * m_notebook
wxListCtrl * m_resourceList
wxButton * m_addFilesBtn
wxButton * m_addFolderBtn
wxButton * m_removeFilesBtn
wxButton * m_clearFilesBtn
wxStaticText * m_resourceCountLabel
wxTextCtrl * m_validationReport
wxButton * m_validateBtn
wxStaticText * m_validationStatus
wxStaticBitmap * m_validationIcon
wxGauge * m_validationProgress
wxStaticText * m_validationProgressText
wxScrolledWindow * m_fileStructurePanel
wxStyledTextCtrl * m_xmlPreviewPanel
wxTextCtrl * m_warningDetailsPanel
wxCheckBox * m_showFilesCheckBox
wxCheckBox * m_showTreesCheckBox
wxCheckBox * m_showBlackboardsCheckBox
wxCheckBox * m_showWarningsCheckBox
wxCheckBox * m_showErrorsCheckBox
wxCheckBox * m_showProjectIssuesCheckBox
wxButton * m_refreshPreviewBtn
wxStaticText * m_treeCountLabel
std::vector< ClickableItem > m_clickableItems
wxScrolledWindow * m_blackboardPanel
wxButton * m_createBtn
wxButton * m_cancelBtn
std::unique_ptr< EmberCore::ProjectValidationReport > m_lastValidationReport
bool m_validationStale
wxString m_lastValidatedParserProfile
wxImageList * m_resourceImageList
wxTimer * m_pulseTimer
float m_pulsePhase
wxColour m_normalBg
wxColour m_highlightBg
int m_selectedItemIndex

Static Private Attributes

static wxString s_lastUsedDirectory

Detailed Description

Dialog for creating and configuring BehaviorTree projects.

This dialog provides an interface for:

  • Setting project name and description
  • Selecting a parser profile
  • Adding/removing XML resource files
  • Validating resources
  • Previewing tree structure

Definition at line 31 of file BehaviorTreeProjectDialog.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_PROJECT_NAME 
ID_PROJECT_DESCRIPTION 
ID_PARSER_PROFILE 
ID_RESOURCE_LIST 
ID_ADD_FILES 
ID_ADD_FOLDER 
ID_REMOVE_FILES 
ID_CLEAR_FILES 
ID_VALIDATE 
ID_REFRESH_PREVIEW 
ID_CREATE 
ID_SAVE 
ID_PULSE_TIMER 

Definition at line 201 of file BehaviorTreeProjectDialog.h.

Constructor & Destructor Documentation

◆ BehaviorTreeProjectDialog()

BehaviorTreeProjectDialog::BehaviorTreeProjectDialog ( wxWindow * parent,
std::shared_ptr< EmberCore::BehaviorTreeProject > project = nullptr )
explicit

Construct a new dialog for creating/editing a project.

Parameters
parentParent window
projectExisting project to edit (nullptr for new project)

◆ ~BehaviorTreeProjectDialog()

BehaviorTreeProjectDialog::~BehaviorTreeProjectDialog ( )

Definition at line 111 of file BehaviorTreeProjectDialog.cpp.

Member Function Documentation

◆ CreateBlackboardTab()

wxPanel * BehaviorTreeProjectDialog::CreateBlackboardTab ( wxNotebook * notebook)
private

Definition at line 545 of file BehaviorTreeProjectDialog.cpp.

◆ CreateLayout()

void BehaviorTreeProjectDialog::CreateLayout ( )
private

Definition at line 122 of file BehaviorTreeProjectDialog.cpp.

◆ CreateLeftPanel()

wxPanel * BehaviorTreeProjectDialog::CreateLeftPanel ( wxWindow * parent)
private

Definition at line 170 of file BehaviorTreeProjectDialog.cpp.

◆ CreatePreviewTab()

wxPanel * BehaviorTreeProjectDialog::CreatePreviewTab ( wxNotebook * notebook)
private

Definition at line 355 of file BehaviorTreeProjectDialog.cpp.

◆ CreateResourcesTab()

wxPanel * BehaviorTreeProjectDialog::CreateResourcesTab ( wxNotebook * notebook)
private

Definition at line 255 of file BehaviorTreeProjectDialog.cpp.

◆ CreateRightPanel()

wxPanel * BehaviorTreeProjectDialog::CreateRightPanel ( wxWindow * parent)
private

Definition at line 237 of file BehaviorTreeProjectDialog.cpp.

◆ CreateValidationTab()

wxPanel * BehaviorTreeProjectDialog::CreateValidationTab ( wxNotebook * notebook)
private

Definition at line 312 of file BehaviorTreeProjectDialog.cpp.

◆ DrawBlackboardDiagram()

void BehaviorTreeProjectDialog::DrawBlackboardDiagram ( wxDC & dc)
private

Definition at line 578 of file BehaviorTreeProjectDialog.cpp.

◆ DrawFileStructureDiagram()

void BehaviorTreeProjectDialog::DrawFileStructureDiagram ( wxDC & dc)
private

Definition at line 1420 of file BehaviorTreeProjectDialog.cpp.

◆ GenerateColoredValidationReport()

void BehaviorTreeProjectDialog::GenerateColoredValidationReport ( const EmberCore::ProjectValidationReport & report)
private

Definition at line 1275 of file BehaviorTreeProjectDialog.cpp.

◆ GetProject()

std::shared_ptr< EmberCore::BehaviorTreeProject > BehaviorTreeProjectDialog::GetProject ( ) const
inline

Get the configured project (after dialog is closed with OK)

Definition at line 45 of file BehaviorTreeProjectDialog.h.

◆ GetResourceStatusIcon()

wxString BehaviorTreeProjectDialog::GetResourceStatusIcon ( bool valid) const
private

◆ InterpolateColor()

wxColour BehaviorTreeProjectDialog::InterpolateColor ( const wxColour & color1,
const wxColour & color2,
float t )
private

Definition at line 2395 of file BehaviorTreeProjectDialog.cpp.

◆ IsProjectValid()

bool BehaviorTreeProjectDialog::IsProjectValid ( ) const
inline

Check if the project configuration is valid.

Definition at line 50 of file BehaviorTreeProjectDialog.h.

◆ IsValidProjectName()

bool BehaviorTreeProjectDialog::IsValidProjectName ( const wxString & name) const
private

Definition at line 2349 of file BehaviorTreeProjectDialog.cpp.

◆ LoadBlackboardPreview()

void BehaviorTreeProjectDialog::LoadBlackboardPreview ( const std::string & filepath,
const std::string & blackboardId )
private

Definition at line 3069 of file BehaviorTreeProjectDialog.cpp.

◆ LoadProfileList()

void BehaviorTreeProjectDialog::LoadProfileList ( )
private

Definition at line 841 of file BehaviorTreeProjectDialog.cpp.

◆ LoadTreePreview()

void BehaviorTreeProjectDialog::LoadTreePreview ( const std::string & filepath,
const std::string & treeId )
private

Definition at line 2980 of file BehaviorTreeProjectDialog.cpp.

◆ LoadXMLPreview()

void BehaviorTreeProjectDialog::LoadXMLPreview ( const std::string & filepath,
int highlightLine = -1 )
private

Definition at line 2915 of file BehaviorTreeProjectDialog.cpp.

◆ OnAddFiles()

void BehaviorTreeProjectDialog::OnAddFiles ( wxCommandEvent & event)
private

Definition at line 935 of file BehaviorTreeProjectDialog.cpp.

◆ OnAddFolder()

void BehaviorTreeProjectDialog::OnAddFolder ( wxCommandEvent & event)
private

Definition at line 1000 of file BehaviorTreeProjectDialog.cpp.

◆ OnCancel()

void BehaviorTreeProjectDialog::OnCancel ( wxCommandEvent & event)
private

Definition at line 2347 of file BehaviorTreeProjectDialog.cpp.

◆ OnClearFiles()

void BehaviorTreeProjectDialog::OnClearFiles ( wxCommandEvent & event)
private

Definition at line 1080 of file BehaviorTreeProjectDialog.cpp.

◆ OnCreate()

void BehaviorTreeProjectDialog::OnCreate ( wxCommandEvent & event)
private

Definition at line 2296 of file BehaviorTreeProjectDialog.cpp.

◆ OnDescriptionChanged()

void BehaviorTreeProjectDialog::OnDescriptionChanged ( wxCommandEvent & event)
private

Definition at line 913 of file BehaviorTreeProjectDialog.cpp.

◆ OnPreviewFilterChanged()

void BehaviorTreeProjectDialog::OnPreviewFilterChanged ( wxCommandEvent & event)
private

Definition at line 1157 of file BehaviorTreeProjectDialog.cpp.

◆ OnProfileSelected()

void BehaviorTreeProjectDialog::OnProfileSelected ( wxCommandEvent & event)
private

Definition at line 917 of file BehaviorTreeProjectDialog.cpp.

◆ OnProjectNameChanged()

void BehaviorTreeProjectDialog::OnProjectNameChanged ( wxCommandEvent & event)
private

Definition at line 908 of file BehaviorTreeProjectDialog.cpp.

◆ OnPulseTimer()

void BehaviorTreeProjectDialog::OnPulseTimer ( wxTimerEvent & event)
private

Definition at line 2365 of file BehaviorTreeProjectDialog.cpp.

◆ OnRefreshPreview()

void BehaviorTreeProjectDialog::OnRefreshPreview ( wxCommandEvent & event)
private

Definition at line 1155 of file BehaviorTreeProjectDialog.cpp.

◆ OnRemoveFiles()

void BehaviorTreeProjectDialog::OnRemoveFiles ( wxCommandEvent & event)
private

Definition at line 1064 of file BehaviorTreeProjectDialog.cpp.

◆ OnResourceActivated()

void BehaviorTreeProjectDialog::OnResourceActivated ( wxListEvent & event)
private

Definition at line 1091 of file BehaviorTreeProjectDialog.cpp.

◆ OnResourceSelected()

void BehaviorTreeProjectDialog::OnResourceSelected ( wxListEvent & event)
private

Definition at line 1089 of file BehaviorTreeProjectDialog.cpp.

◆ OnSave()

void BehaviorTreeProjectDialog::OnSave ( wxCommandEvent & event)
private

Definition at line 2342 of file BehaviorTreeProjectDialog.cpp.

◆ OnStructurePanelClick()

void BehaviorTreeProjectDialog::OnStructurePanelClick ( wxMouseEvent & event)
private

Definition at line 2410 of file BehaviorTreeProjectDialog.cpp.

◆ OnValidate()

void BehaviorTreeProjectDialog::OnValidate ( wxCommandEvent & event)
private

Definition at line 1153 of file BehaviorTreeProjectDialog.cpp.

◆ PopulateFromProject()

void BehaviorTreeProjectDialog::PopulateFromProject ( )
private

Definition at line 866 of file BehaviorTreeProjectDialog.cpp.

◆ SetResourceItemStatus()

void BehaviorTreeProjectDialog::SetResourceItemStatus ( long item,
bool valid,
int treeCount )
private

◆ UpdateBlackboardTab()

void BehaviorTreeProjectDialog::UpdateBlackboardTab ( )
private

Definition at line 572 of file BehaviorTreeProjectDialog.cpp.

◆ UpdateCreateButtonState()

void BehaviorTreeProjectDialog::UpdateCreateButtonState ( )
private

Definition at line 2287 of file BehaviorTreeProjectDialog.cpp.

◆ UpdateFieldHighlighting()

void BehaviorTreeProjectDialog::UpdateFieldHighlighting ( )
private

Definition at line 2375 of file BehaviorTreeProjectDialog.cpp.

◆ UpdateResourceList()

void BehaviorTreeProjectDialog::UpdateResourceList ( )
private

Definition at line 885 of file BehaviorTreeProjectDialog.cpp.

◆ UpdateTreePreview()

void BehaviorTreeProjectDialog::UpdateTreePreview ( )
private

Definition at line 1387 of file BehaviorTreeProjectDialog.cpp.

◆ UpdateValidationReport()

void BehaviorTreeProjectDialog::UpdateValidationReport ( )
private

◆ ValidateAndUpdateUI()

void BehaviorTreeProjectDialog::ValidateAndUpdateUI ( )
private

Definition at line 1164 of file BehaviorTreeProjectDialog.cpp.

◆ wxDECLARE_EVENT_TABLE()

BehaviorTreeProjectDialog::wxDECLARE_EVENT_TABLE ( )
private

Member Data Documentation

◆ m_addFilesBtn

wxButton* BehaviorTreeProjectDialog::m_addFilesBtn
private

Definition at line 132 of file BehaviorTreeProjectDialog.h.

◆ m_addFolderBtn

wxButton* BehaviorTreeProjectDialog::m_addFolderBtn
private

Definition at line 133 of file BehaviorTreeProjectDialog.h.

◆ m_blackboardPanel

wxScrolledWindow* BehaviorTreeProjectDialog::m_blackboardPanel
private

Definition at line 173 of file BehaviorTreeProjectDialog.h.

◆ m_cancelBtn

wxButton* BehaviorTreeProjectDialog::m_cancelBtn
private

Definition at line 177 of file BehaviorTreeProjectDialog.h.

◆ m_clearFilesBtn

wxButton* BehaviorTreeProjectDialog::m_clearFilesBtn
private

Definition at line 135 of file BehaviorTreeProjectDialog.h.

◆ m_clickableItems

std::vector<ClickableItem> BehaviorTreeProjectDialog::m_clickableItems
private

Definition at line 170 of file BehaviorTreeProjectDialog.h.

◆ m_createBtn

wxButton* BehaviorTreeProjectDialog::m_createBtn
private

Definition at line 176 of file BehaviorTreeProjectDialog.h.

◆ m_fileStructurePanel

wxScrolledWindow* BehaviorTreeProjectDialog::m_fileStructurePanel
private

Definition at line 147 of file BehaviorTreeProjectDialog.h.

◆ m_highlightBg

wxColour BehaviorTreeProjectDialog::m_highlightBg
private

Definition at line 194 of file BehaviorTreeProjectDialog.h.

◆ m_isEditMode

bool BehaviorTreeProjectDialog::m_isEditMode
private

Definition at line 120 of file BehaviorTreeProjectDialog.h.

◆ m_isValid

bool BehaviorTreeProjectDialog::m_isValid
private

Definition at line 119 of file BehaviorTreeProjectDialog.h.

◆ m_lastValidatedParserProfile

wxString BehaviorTreeProjectDialog::m_lastValidatedParserProfile
private

Definition at line 182 of file BehaviorTreeProjectDialog.h.

◆ m_lastValidationReport

std::unique_ptr<EmberCore::ProjectValidationReport> BehaviorTreeProjectDialog::m_lastValidationReport
private

Definition at line 180 of file BehaviorTreeProjectDialog.h.

◆ m_normalBg

wxColour BehaviorTreeProjectDialog::m_normalBg
private

Definition at line 193 of file BehaviorTreeProjectDialog.h.

◆ m_notebook

wxNotebook* BehaviorTreeProjectDialog::m_notebook
private

Definition at line 128 of file BehaviorTreeProjectDialog.h.

◆ m_parserProfile

wxChoice* BehaviorTreeProjectDialog::m_parserProfile
private

Definition at line 125 of file BehaviorTreeProjectDialog.h.

◆ m_project

std::shared_ptr<EmberCore::BehaviorTreeProject> BehaviorTreeProjectDialog::m_project
private

Definition at line 118 of file BehaviorTreeProjectDialog.h.

◆ m_projectDescription

wxTextCtrl* BehaviorTreeProjectDialog::m_projectDescription
private

Definition at line 124 of file BehaviorTreeProjectDialog.h.

◆ m_projectName

wxTextCtrl* BehaviorTreeProjectDialog::m_projectName
private

Definition at line 123 of file BehaviorTreeProjectDialog.h.

◆ m_pulsePhase

float BehaviorTreeProjectDialog::m_pulsePhase
private

Definition at line 192 of file BehaviorTreeProjectDialog.h.

◆ m_pulseTimer

wxTimer* BehaviorTreeProjectDialog::m_pulseTimer
private

Definition at line 191 of file BehaviorTreeProjectDialog.h.

◆ m_refreshPreviewBtn

wxButton* BehaviorTreeProjectDialog::m_refreshPreviewBtn
private

Definition at line 158 of file BehaviorTreeProjectDialog.h.

◆ m_removeFilesBtn

wxButton* BehaviorTreeProjectDialog::m_removeFilesBtn
private

Definition at line 134 of file BehaviorTreeProjectDialog.h.

◆ m_resourceCountLabel

wxStaticText* BehaviorTreeProjectDialog::m_resourceCountLabel
private

Definition at line 136 of file BehaviorTreeProjectDialog.h.

◆ m_resourceImageList

wxImageList* BehaviorTreeProjectDialog::m_resourceImageList
private

Definition at line 185 of file BehaviorTreeProjectDialog.h.

◆ m_resourceList

wxListCtrl* BehaviorTreeProjectDialog::m_resourceList
private

Definition at line 131 of file BehaviorTreeProjectDialog.h.

◆ m_selectedItemIndex

int BehaviorTreeProjectDialog::m_selectedItemIndex
private

Definition at line 196 of file BehaviorTreeProjectDialog.h.

◆ m_showBlackboardsCheckBox

wxCheckBox* BehaviorTreeProjectDialog::m_showBlackboardsCheckBox
private

Definition at line 154 of file BehaviorTreeProjectDialog.h.

◆ m_showErrorsCheckBox

wxCheckBox* BehaviorTreeProjectDialog::m_showErrorsCheckBox
private

Definition at line 156 of file BehaviorTreeProjectDialog.h.

◆ m_showFilesCheckBox

wxCheckBox* BehaviorTreeProjectDialog::m_showFilesCheckBox
private

Definition at line 152 of file BehaviorTreeProjectDialog.h.

◆ m_showProjectIssuesCheckBox

wxCheckBox* BehaviorTreeProjectDialog::m_showProjectIssuesCheckBox
private

Definition at line 157 of file BehaviorTreeProjectDialog.h.

◆ m_showTreesCheckBox

wxCheckBox* BehaviorTreeProjectDialog::m_showTreesCheckBox
private

Definition at line 153 of file BehaviorTreeProjectDialog.h.

◆ m_showWarningsCheckBox

wxCheckBox* BehaviorTreeProjectDialog::m_showWarningsCheckBox
private

Definition at line 155 of file BehaviorTreeProjectDialog.h.

◆ m_treeCountLabel

wxStaticText* BehaviorTreeProjectDialog::m_treeCountLabel
private

Definition at line 159 of file BehaviorTreeProjectDialog.h.

◆ m_validateBtn

wxButton* BehaviorTreeProjectDialog::m_validateBtn
private

Definition at line 140 of file BehaviorTreeProjectDialog.h.

◆ m_validationIcon

wxStaticBitmap* BehaviorTreeProjectDialog::m_validationIcon
private

Definition at line 142 of file BehaviorTreeProjectDialog.h.

◆ m_validationProgress

wxGauge* BehaviorTreeProjectDialog::m_validationProgress
private

Definition at line 143 of file BehaviorTreeProjectDialog.h.

◆ m_validationProgressText

wxStaticText* BehaviorTreeProjectDialog::m_validationProgressText
private

Definition at line 144 of file BehaviorTreeProjectDialog.h.

◆ m_validationReport

wxTextCtrl* BehaviorTreeProjectDialog::m_validationReport
private

Definition at line 139 of file BehaviorTreeProjectDialog.h.

◆ m_validationStale

bool BehaviorTreeProjectDialog::m_validationStale
private

Definition at line 181 of file BehaviorTreeProjectDialog.h.

◆ m_validationStatus

wxStaticText* BehaviorTreeProjectDialog::m_validationStatus
private

Definition at line 141 of file BehaviorTreeProjectDialog.h.

◆ m_warningDetailsPanel

wxTextCtrl* BehaviorTreeProjectDialog::m_warningDetailsPanel
private

Definition at line 149 of file BehaviorTreeProjectDialog.h.

◆ m_xmlPreviewPanel

wxStyledTextCtrl* BehaviorTreeProjectDialog::m_xmlPreviewPanel
private

Definition at line 148 of file BehaviorTreeProjectDialog.h.

◆ s_lastUsedDirectory

wxString BehaviorTreeProjectDialog::s_lastUsedDirectory
staticprivate

Definition at line 188 of file BehaviorTreeProjectDialog.h.


The documentation for this class was generated from the following files: