![]() |
Ember
|
Custom widget for rendering and interacting with behavior tree nodes. More...
#include <NodeWidget.h>
Public Types | |
| enum class | RenderStyle { Compact , Normal , Detailed , Debug } |
| Node rendering styles. More... | |
| enum class | InteractionState { Normal , Hovered , Selected , Dragging , Editing } |
| Node interaction states. More... | |
| using | NodeClickCallback = std::function<void(NodeWidget *, EmberCore::Node *)> |
| using | NodeDoubleClickCallback = std::function<void(NodeWidget *, EmberCore::Node *)> |
| using | NodeDragCallback = std::function<void(NodeWidget *, const wxPoint &delta)> |
| using | NodeEditCallback = std::function<void(NodeWidget *, const wxString &new_name)> |
Protected Member Functions | |
| virtual void | OnPaint (wxPaintEvent &event) |
| virtual void | OnSize (wxSizeEvent &event) |
| virtual void | OnEraseBackground (wxEraseEvent &event) |
| virtual void | OnMouseEnter (wxMouseEvent &event) |
| virtual void | OnMouseLeave (wxMouseEvent &event) |
| virtual void | OnMouseDown (wxMouseEvent &event) |
| virtual void | OnMouseUp (wxMouseEvent &event) |
| virtual void | OnMouseMove (wxMouseEvent &event) |
| virtual void | OnMouseDoubleClick (wxMouseEvent &event) |
| virtual void | OnRightClick (wxContextMenuEvent &event) |
| virtual void | OnKeyDown (wxKeyEvent &event) |
| virtual void | OnChar (wxKeyEvent &event) |
| virtual void | OnSetFocus (wxFocusEvent &event) |
| virtual void | OnKillFocus (wxFocusEvent &event) |
| void | DrawNodeBackground (wxDC &dc, const wxRect &rect) |
| void | DrawNodeBorder (wxDC &dc, const wxRect &rect) |
| void | DrawNodeIcon (wxDC &dc, const wxRect &icon_rect) |
| void | DrawNodeText (wxDC &dc, const wxRect &text_rect) |
| void | DrawNodeStatus (wxDC &dc, const wxRect &status_rect) |
| void | DrawConnectionPoints (wxDC &dc) |
| wxRect | GetContentRect () const |
| wxRect | GetIconRect () const |
| wxRect | GetTextRect () const |
| wxRect | GetStatusRect () const |
| std::vector< wxPoint > | GetConnectionPoints () const |
| wxColour | GetBackgroundColor () const |
| wxColour | GetBorderColor () const |
| wxColour | GetTextColor () const |
| wxBitmap | GetNodeIcon () const |
| wxString | GetDisplayText () const |
| void | OnAnimationTimer (wxTimerEvent &event) |
| void | UpdateAnimation () |
Private Member Functions | |
| void | InitializeWidget () |
| void | UpdateColors () |
| void | CreateEditControl () |
| void | DestroyEditControl () |
| void | ShowContextMenu (const wxPoint &position) |
Private Attributes | |
| EmberCore::Node * | node_ |
| RenderStyle | render_style_ |
| InteractionState | interaction_state_ |
| wxSize | custom_size_ |
| wxColour | background_color_ |
| wxColour | border_color_ |
| wxColour | text_color_ |
| wxFont | node_font_ |
| bool | is_draggable_ |
| bool | is_highlighted_ |
| wxPoint | drag_start_pos_ |
| wxPoint | last_mouse_pos_ |
| wxTimer * | animation_timer_ |
| double | animation_phase_ |
| bool | is_animating_ |
| wxTextCtrl * | edit_control_ |
| wxString | original_name_ |
| NodeClickCallback | click_callback_ |
| NodeDoubleClickCallback | double_click_callback_ |
| NodeDragCallback | drag_callback_ |
| NodeEditCallback | edit_callback_ |
Static Private Attributes | |
| static const int | BORDER_WIDTH = 2 |
| static const int | PADDING = 6 |
| static const int | ICON_SIZE = 16 |
| static const int | MIN_WIDTH = 80 |
| static const int | MIN_HEIGHT = 32 |
Custom widget for rendering and interacting with behavior tree nodes.
This widget provides a visual representation of a single behavior tree node with support for selection, editing, drag & drop, and visual state indication.
Definition at line 16 of file NodeWidget.h.
| using EmberForge::NodeWidget::NodeClickCallback = std::function<void(NodeWidget *, EmberCore::Node *)> |
Definition at line 97 of file NodeWidget.h.
| using EmberForge::NodeWidget::NodeDoubleClickCallback = std::function<void(NodeWidget *, EmberCore::Node *)> |
Definition at line 98 of file NodeWidget.h.
| using EmberForge::NodeWidget::NodeDragCallback = std::function<void(NodeWidget *, const wxPoint &delta)> |
Definition at line 99 of file NodeWidget.h.
| using EmberForge::NodeWidget::NodeEditCallback = std::function<void(NodeWidget *, const wxString &new_name)> |
Definition at line 100 of file NodeWidget.h.
|
strong |
Node interaction states.
| Enumerator | |
|---|---|
| Normal | |
| Hovered | |
| Selected | |
| Dragging | |
| Editing | |
Definition at line 31 of file NodeWidget.h.
|
strong |
Node rendering styles.
| Enumerator | |
|---|---|
| Compact | |
| Normal | |
| Detailed | |
| Debug | |
Definition at line 21 of file NodeWidget.h.
| EmberForge::NodeWidget::NodeWidget | ( | wxWindow * | parent, |
| EmberCore::Node * | node, | ||
| RenderStyle | style = RenderStyle::Normal ) |
Constructor.
| parent | Parent window |
| node | The behavior tree node to represent |
| style | Initial render style |
|
virtual |
Destructor.
Definition at line 35 of file NodeWidget.cpp.
| wxSize EmberForge::NodeWidget::CalculateMinSize | ( | ) | const |
Definition at line 131 of file NodeWidget.cpp.
|
private |
Definition at line 579 of file NodeWidget.cpp.
|
private |
Definition at line 602 of file NodeWidget.cpp.
|
protected |
Definition at line 416 of file NodeWidget.cpp.
|
protected |
Definition at line 349 of file NodeWidget.cpp.
|
protected |
Definition at line 363 of file NodeWidget.cpp.
|
protected |
Definition at line 371 of file NodeWidget.cpp.
|
protected |
Definition at line 387 of file NodeWidget.cpp.
|
protected |
Definition at line 378 of file NodeWidget.cpp.
|
protected |
Definition at line 481 of file NodeWidget.cpp.
|
protected |
Definition at line 496 of file NodeWidget.cpp.
|
protected |
Definition at line 464 of file NodeWidget.cpp.
|
protected |
Definition at line 428 of file NodeWidget.cpp.
|
protected |
Definition at line 542 of file NodeWidget.cpp.
|
protected |
Definition at line 434 of file NodeWidget.cpp.
|
inline |
Definition at line 61 of file NodeWidget.h.
|
inline |
Definition at line 54 of file NodeWidget.h.
|
protected |
Definition at line 536 of file NodeWidget.cpp.
| wxSize EmberForge::NodeWidget::GetPreferredSize | ( | ) | const |
Definition at line 109 of file NodeWidget.cpp.
|
inline |
Definition at line 58 of file NodeWidget.h.
|
protected |
Definition at line 455 of file NodeWidget.cpp.
|
protected |
Definition at line 519 of file NodeWidget.cpp.
|
protected |
Definition at line 443 of file NodeWidget.cpp.
|
inline |
Definition at line 55 of file NodeWidget.h.
|
private |
Definition at line 564 of file NodeWidget.cpp.
|
inline |
Definition at line 93 of file NodeWidget.h.
|
inline |
Definition at line 69 of file NodeWidget.h.
|
inline |
Definition at line 65 of file NodeWidget.h.
|
protected |
Definition at line 551 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 333 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 232 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 310 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 340 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 298 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 250 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 236 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 243 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 280 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 268 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 185 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 308 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 335 of file NodeWidget.cpp.
|
protectedvirtual |
Definition at line 223 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::ResetToDefaultAppearance | ( | ) |
Definition at line 150 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::SetCustomSize | ( | const wxSize & | size | ) |
Definition at line 133 of file NodeWidget.cpp.
|
inline |
Definition at line 94 of file NodeWidget.h.
| void EmberForge::NodeWidget::SetHighlighted | ( | bool | highlighted | ) |
Definition at line 176 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::SetInteractionState | ( | InteractionState | state | ) |
Definition at line 54 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::SetNode | ( | EmberCore::Node * | node | ) |
Definition at line 43 of file NodeWidget.cpp.
|
inline |
Definition at line 102 of file NodeWidget.h.
| void EmberForge::NodeWidget::SetNodeColors | ( | const wxColour & | background, |
| const wxColour & | border, | ||
| const wxColour & | text ) |
Definition at line 138 of file NodeWidget.cpp.
|
inline |
Definition at line 103 of file NodeWidget.h.
|
inline |
Definition at line 104 of file NodeWidget.h.
|
inline |
Definition at line 105 of file NodeWidget.h.
| void EmberForge::NodeWidget::SetNodeFont | ( | const wxFont & | font | ) |
Definition at line 145 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::SetRenderStyle | ( | RenderStyle | style | ) |
Definition at line 49 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::SetSelected | ( | bool | selected | ) |
Definition at line 62 of file NodeWidget.cpp.
|
private |
Definition at line 609 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::StartEditing | ( | ) |
Definition at line 66 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::StartPulseAnimation | ( | ) |
Definition at line 158 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::StopEditing | ( | bool | save_changes = true | ) |
Definition at line 75 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::StopPulseAnimation | ( | ) |
Definition at line 168 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::SyncVisualState | ( | ) |
Definition at line 107 of file NodeWidget.cpp.
|
protected |
Definition at line 553 of file NodeWidget.cpp.
|
private |
Definition at line 575 of file NodeWidget.cpp.
| void EmberForge::NodeWidget::UpdateFromNode | ( | ) |
Definition at line 92 of file NodeWidget.cpp.
|
private |
Definition at line 177 of file NodeWidget.h.
|
private |
Definition at line 176 of file NodeWidget.h.
|
private |
Definition at line 164 of file NodeWidget.h.
|
private |
Definition at line 165 of file NodeWidget.h.
|
staticprivate |
Definition at line 198 of file NodeWidget.h.
|
private |
Definition at line 185 of file NodeWidget.h.
|
private |
Definition at line 163 of file NodeWidget.h.
|
private |
Definition at line 186 of file NodeWidget.h.
|
private |
Definition at line 187 of file NodeWidget.h.
|
private |
Definition at line 172 of file NodeWidget.h.
|
private |
Definition at line 188 of file NodeWidget.h.
|
private |
Definition at line 181 of file NodeWidget.h.
|
staticprivate |
Definition at line 200 of file NodeWidget.h.
|
private |
Definition at line 160 of file NodeWidget.h.
|
private |
Definition at line 178 of file NodeWidget.h.
|
private |
Definition at line 170 of file NodeWidget.h.
|
private |
Definition at line 171 of file NodeWidget.h.
|
private |
Definition at line 173 of file NodeWidget.h.
|
staticprivate |
Definition at line 202 of file NodeWidget.h.
|
staticprivate |
Definition at line 201 of file NodeWidget.h.
|
private |
Definition at line 158 of file NodeWidget.h.
|
private |
Definition at line 167 of file NodeWidget.h.
|
private |
Definition at line 182 of file NodeWidget.h.
|
staticprivate |
Definition at line 199 of file NodeWidget.h.
|
private |
Definition at line 159 of file NodeWidget.h.
|
private |
Definition at line 166 of file NodeWidget.h.