![]() |
Ember
|
Ember follows a clean architectural separation between core logic and user interface components. This design enables:
EmberCore is the framework-agnostic core library containing all behavior tree logic. It has no dependencies on wxWidgets or any GUI framework.
The Core module contains the fundamental data structures:
| Class | Purpose |
|---|---|
| Node | Represents a single behavior tree node |
| BehaviorTree | Container for a complete behavior tree with metadata |
| BehaviorTreeValidator | Validates tree structure and constraints |
| BlackboardEntry | Key-value storage for tree communication |
| Blackboard | Collection of blackboard entries |
The Parsers module handles XML serialization:
| Class | Purpose |
|---|---|
| LibXMLBehaviorTreeParser | Parses XML files into behavior trees |
| LibXMLBehaviorTreeSerializer | Serializes trees back to XML |
| ParserConfig | Configuration for parsing behavior |
| ParserProfile | Named configuration presets |
| ConfigManager | Manages parser configurations |
| BehaviorTreeProject | Multi-file project management |
| ProjectManager | Singleton for active project handling |
The Adapters module provides an abstraction layer between core data and visualization:
| Class | Purpose |
|---|---|
| ITreeNode | Abstract interface for tree nodes |
| ITreeStructure | Abstract interface for tree traversal |
| ITreeFactory | Factory interface for node creation |
| DirectTreeAdapter | Adapts BehaviorTree to ITreeStructure |
| NodeAdapter | Adapts Node to ITreeNode |
Pure virtual interfaces for extensibility:
| Interface | Purpose |
|---|---|
| ITreeNode | Node access abstraction |
| ITreeStructure | Tree structure abstraction |
| ITreeFactory | Node creation abstraction |
| IParseProgressCallback | Progress reporting for parsing |
Framework-agnostic type definitions:
| Type | Purpose |
|---|---|
| String | std::string alias |
| Point | 2D point (x, y) |
| Size | 2D dimensions (width, height) |
| Rect | Rectangle (position + size) |
| Color | RGBA color representation |
Utility classes:
| Class | Purpose |
|---|---|
| Logger | Logging infrastructure |
| SpdlogManager | spdlog integration (optional) |
EmberForge is the wxWidgets-based GUI application that provides the visual interface for Ember.
| Class | Purpose |
|---|---|
| App | wxApp subclass, application entry point |
| MainFrame | Main window, manages layout and menus |
Dockable panels for the workspace:
| Class | Purpose |
|---|---|
| Panel | Base class for all panels |
| SidePanel | Base class for side panels with tabs |
| MainPanel | Central panel containing scenes |
| LeftSidePanel | Left dock (file explorer, hierarchy) |
| RightSidePanel | Right dock (properties) |
| BottomPanel | Bottom dock (logs, output) |
Tab components for panel content:
| Class | Purpose |
|---|---|
| ITab | Tab interface |
| FileExplorerTab | File browser tab |
| SceneHierarchyTab | Tree hierarchy view |
| PropertiesTab | Node property editor |
| LogTab | Log message viewer |
| ToolTab | Tool palette |
Scene system for tree visualization:
| Class | Purpose |
|---|---|
| IScene | Scene interface |
| BehaviorTreeScene | Behavior tree visualization scene |
| SceneContainer | Manages multiple scenes |
| TreeVisualization | Canvas for rendering trees |
Modal dialogs:
| Class | Purpose |
|---|---|
| PreferencesDialog | Application preferences |
| ParserConfigDialog | Parser configuration |
| BehaviorTreeProjectDialog | Project management |
| ProjectManagerDialog | Project selection |
| LoadingDialog | Progress indicator |
UI utilities:
| Class | Purpose |
|---|---|
| AppPreferences | Persistent application settings |
| BehaviorTreeConfig | Tree visualization settings |
| WxConverters | Type conversion utilities |
| CustomTabArt | Custom tab appearance |
The Adapters module implements the Adapter pattern to decouple EmberCore data structures from visualization code. This allows the same visualization code to work with different tree implementations.
ITreeFactory and DefaultTreeFactory implement the Factory pattern for creating tree nodes, enabling customization of node creation.
ConfigManager and ProjectManager use the Singleton pattern for global access to configuration and project state.
Event callbacks (NodeSelectionCallback, TreeSelectionCallback) implement a simplified Observer pattern for UI updates.
Panel and SidePanel use the Template Method pattern with virtual hooks (CreateLayout, CreateToolbar) for customization by subclasses.
EmberCore is designed for single-threaded use. All UI operations in EmberForge occur on the main thread. Background operations (like parsing large files) should use wxWidgets threading primitives and communicate results via events.