9#include <wx/filename.h>
10#include <wx/stdpaths.h>
23 : wxPanel(parent,
id), title_font_(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL) {
24 SetBackgroundColour(config_.background_color);
33 icon_action_.LoadFile(icon_dir +
"action_node_30.png", wxBITMAP_TYPE_PNG);
34 icon_control_.LoadFile(icon_dir +
"control_node_30.png", wxBITMAP_TYPE_PNG);
35 icon_condition_.LoadFile(icon_dir +
"condition_node_30.png", wxBITMAP_TYPE_PNG);
36 icon_decorator_.LoadFile(icon_dir +
"decorator_node_30.png", wxBITMAP_TYPE_PNG);
37 icon_tree_.LoadFile(icon_dir +
"tree_node_30.png", wxBITMAP_TYPE_PNG);
38 icon_warning_.LoadFile(icon_dir +
"warning_30.png", wxBITMAP_TYPE_PNG);
44 last_frame_time_ = wxGetUTCTimeMillis();
47 m_performanceTimer =
new wxTimer(
this, wxID_ANY);
48 m_performanceTimer->Start(33);
51 Bind(wxEVT_TIMER, [
this](wxTimerEvent &) {
53 wxLongLong currentTime = wxGetUTCTimeMillis();
54 double deltaTime = (currentTime - last_frame_time_).ToDouble() / 1000.0;
55 last_frame_time_ = currentTime;
62 if (enable_smooth_panning_) {
63 float dx = target_offset_.x - view_offset_.x;
64 float dy = target_offset_.y - view_offset_.y;
67 if (std::abs(dx) > 0.1f || std::abs(dy) > 0.1f) {
71 float smoothSpeed = 100.0f - pan_smoothness_;
72 smoothSpeed = std::max(1.0f, smoothSpeed);
75 float alpha = 1.0f - exp(-smoothSpeed * 0.05f * deltaTime);
77 view_offset_.x +=
static_cast<int>(dx * alpha);
78 view_offset_.y +=
static_cast<int>(dy * alpha);
81 view_offset_ = target_offset_;
85 view_offset_ = target_offset_;
131 zoom_factor_ = prefs.GetMainPanelSettings().defaultZoomLevel;
134 wxSize panel_size = GetSize();
145 wxSize panel_size = GetSize();
150 if (node_world_pos.x != -1 && node_world_pos.y != -1) {
155 panel_size.y / 2 -
static_cast<int>(node_world_pos.y *
zoom_factor_)};
161 panel_size.y / 2 -
static_cast<int>(root_pos.y *
zoom_factor_)};
184 auto scaleIcon = [
this](
const wxBitmap &original) -> wxBitmap {
185 if (!original.IsOk())
188 wxImage img = original.ConvertToImage();
190 new_size = std::max(4, std::min(300, new_size));
192 if (new_size != 30) {
193 img = img.Scale(new_size, new_size, wxIMAGE_QUALITY_BICUBIC);
195 return wxBitmap(img);
219 dc.SetBackground(wxBrush(
config_.background_color));
239 if (mainPanelSettings.highlightPathToSelected &&
selected_node_) {
251 DrawNode(dc,
tree_->GetRootNode(), root_pos.x, root_pos.y, 0);
257 wxColour pathColor(mainPanelSettings.pathHighlightColor.r, mainPanelSettings.pathHighlightColor.g,
258 mainPanelSettings.pathHighlightColor.b);
259 dc.SetPen(wxPen(pathColor, 4));
261 dc.DrawLine(seg.x1, seg.y1, seg.x2, seg.y2);
280 monitor.
RecordMetric(
"Tree Nodes",
static_cast<float>(
tree_->GetNodeCount()),
"nodes");
281 monitor.
RecordMetric(
"Tree Depth",
static_cast<float>(
tree_->GetMaxDepth()),
"levels");
314 wxPoint mouse_pos =
event.GetPosition();
330 wxPoint mouse_pos =
event.GetPosition();
344 LOG_INFO(
"TreeVisualization",
"Right click on visualization at (" + std::to_string(event.GetX()) +
", " +
345 std::to_string(event.GetY()) +
")");
349 wxPoint mouse_pos =
event.GetPosition();
352 bool shouldPan =
false;
357 shouldPan =
event.LeftIsDown();
359 shouldPan =
event.MiddleIsDown();
361 shouldPan =
event.RightIsDown();
416 wxPoint mouse_screen =
event.GetPosition();
419 wxPoint mouse_world = {
static_cast<int>((mouse_screen.x -
view_offset_.x) / old_zoom),
420 static_cast<int>((mouse_screen.y -
view_offset_.y) / old_zoom)};
442 int keyCode =
event.GetKeyCode();
456 if (hotkey.length() == 1) {
458 char hotkeyChar = hotkey[0];
459 return (keyCode == toupper(hotkeyChar));
460 }
else if (hotkey ==
"Delete") {
461 return (keyCode == WXK_DELETE);
462 }
else if (hotkey ==
"F5") {
463 return (keyCode == WXK_F5);
464 }
else if (hotkey ==
"Up") {
465 return (keyCode == WXK_UP);
466 }
else if (hotkey ==
"Down") {
467 return (keyCode == WXK_DOWN);
468 }
else if (hotkey ==
"Left") {
469 return (keyCode == WXK_LEFT);
470 }
else if (hotkey ==
"Right") {
471 return (keyCode == WXK_RIGHT);
479 bool handled =
false;
481 if (matchesHotkey(btViewSettings.panUpHotkey)) {
484 }
else if (matchesHotkey(btViewSettings.panDownHotkey)) {
487 }
else if (matchesHotkey(btViewSettings.panLeftHotkey)) {
490 }
else if (matchesHotkey(btViewSettings.panRightHotkey)) {
501 if (matchesHotkey(btViewSettings.resetViewHotkey)) {
507 if (matchesHotkey(btViewSettings.centerOnNodeHotkey)) {
518 if (matchesHotkey(btViewSettings.deleteNodeHotkey)) {
527 if (keyCode == WXK_UP || keyCode == WXK_DOWN || keyCode == WXK_LEFT || keyCode == WXK_RIGHT) {
545 wxSize panel_size = GetSize();
547 wxPoint bottomRight =
ScreenToWorld({panel_size.x, panel_size.y});
552 wxColour gridBgColor(mainPanelSettings.gridBackgroundColor.r, mainPanelSettings.gridBackgroundColor.g,
553 mainPanelSettings.gridBackgroundColor.b);
554 wxColour gridLineColor(mainPanelSettings.gridLineColor.r, mainPanelSettings.gridLineColor.g,
555 mainPanelSettings.gridLineColor.b);
558 dc.SetBrush(wxBrush(gridBgColor));
559 dc.SetPen(*wxTRANSPARENT_PEN);
560 dc.DrawRectangle(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
563 dc.SetPen(wxPen(gridLineColor, 1));
564 dc.SetBrush(*wxTRANSPARENT_BRUSH);
576 int startX = (topLeft.x / gridSpacing) * gridSpacing;
577 int endX = bottomRight.x;
578 for (
int x = startX; x <= endX; x += gridSpacing) {
579 dc.DrawLine(x, topLeft.y, x, bottomRight.y);
583 int startY = (topLeft.y / gridSpacing) * gridSpacing;
584 int endY = bottomRight.y;
585 for (
int y = startY; y <= endY; y += gridSpacing) {
586 dc.DrawLine(topLeft.x, y, bottomRight.x, y);
598 if (nodeInViewport) {
615 wxCoord child_x = x - total_width / 2;
616 wxCoord child_y = y +
config_.node_height +
config_.vertical_spacing;
619 bool shouldDrawConnections = nodeInViewport;
621 if (!shouldDrawConnections) {
625 viewport.Inflate(margin);
628 if (child_y >= viewport.GetTop() && child_y <= viewport.GetBottom()) {
630 int leftmost_x = child_x;
631 int rightmost_x = child_x + total_width;
632 if (rightmost_x >= viewport.GetLeft() && leftmost_x <= viewport.GetRight()) {
633 shouldDrawConnections =
true;
639 if (shouldDrawConnections) {
648 wxCoord center_x = child_x + subtree_width / 2;
651 DrawNode(dc, child, center_x, child_y, level + 1, draw_children);
653 child_x += subtree_width;
665 wxColour base_color(mainPanelSettings.idleNodeBgColor.r, mainPanelSettings.idleNodeBgColor.g,
666 mainPanelSettings.idleNodeBgColor.b);
668 wxColour fill_color = base_color;
669 wxColour border_color(mainPanelSettings.idleNodeBorderColor.r, mainPanelSettings.idleNodeBorderColor.g,
670 mainPanelSettings.idleNodeBorderColor.b);
671 int border_width = 1;
674 bool isSelected =
false;
681 auto applyTint = [](
const wxColour &color,
float tint) -> wxColour {
683 int g = color.Green();
684 int b = color.Blue();
688 r = r +
static_cast<int>((255 - r) * tint);
689 g = g +
static_cast<int>((255 - g) * tint);
690 b = b +
static_cast<int>((255 - b) * tint);
693 r = r +
static_cast<int>(r * tint);
694 g = g +
static_cast<int>(g * tint);
695 b = b +
static_cast<int>(b * tint);
698 return wxColour(r, g, b);
706 fill_color = applyTint(base_color, mainPanelSettings.selectedNodeBgTint);
707 border_color = wxColour(mainPanelSettings.selectedNodeColor.r, mainPanelSettings.selectedNodeColor.g,
708 mainPanelSettings.selectedNodeColor.b);
712 fill_color = applyTint(base_color, mainPanelSettings.hoveredNodeBgTint);
713 border_color = wxColour(mainPanelSettings.hoveredNodeColor.r, mainPanelSettings.hoveredNodeColor.g,
714 mainPanelSettings.hoveredNodeColor.b);
720 fill_color = applyTint(base_color, -0.05f);
722 border_color = wxColour(100, 150, 255);
726 dc.SetBrush(wxBrush(fill_color));
730 wxPen pen(border_color, border_width, wxPENSTYLE_SHORT_DASH);
733 dc.SetPen(wxPen(border_color, border_width));
738 dc.DrawRoundedRectangle(node_rect, 5);
749 wxColour text_color(mainPanelSettings.idleNodeTextColor.r, mainPanelSettings.idleNodeTextColor.g,
750 mainPanelSettings.idleNodeTextColor.b);
753 bool isSelected =
false;
762 text_color = wxColour(mainPanelSettings.selectedNodeTextColor.r, mainPanelSettings.selectedNodeTextColor.g,
763 mainPanelSettings.selectedNodeTextColor.b);
765 text_color = wxColour(mainPanelSettings.hoveredNodeTextColor.r, mainPanelSettings.hoveredNodeTextColor.g,
766 mainPanelSettings.hoveredNodeTextColor.b);
769 dc.SetTextForeground(text_color);
772 wxCoord text_width, text_height;
773 dc.GetTextExtent(text, &text_width, &text_height);
776 if (text_width >
config_.node_width - 10) {
777 while (text_width >
config_.node_width - 20 && text.length() > 3) {
778 text = text.substr(0, text.length() - 1);
779 dc.GetTextExtent(text +
"...", &text_width, &text_height);
785 wxCoord text_x = x - text_width / 2;
786 wxCoord text_y = y +
config_.title_padding.y;
788 dc.DrawText(text, text_x, text_y);
792 wxBitmap *icon_to_draw =
nullptr;
823 if (icon_to_draw && icon_to_draw->IsOk()) {
824 int icon_width = icon_to_draw->GetWidth();
827 int icon_center_x = x;
828 int icon_center_y = y +
config_.node_height / 2 + 8;
831 wxPoint screen_center =
WorldToScreen(wxPoint(icon_center_x, icon_center_y));
834 int screen_x = screen_center.x - icon_width / 2;
835 int screen_y = screen_center.y - icon_width / 2;
838 double old_scale_x, old_scale_y;
839 dc.GetUserScale(&old_scale_x, &old_scale_y);
840 wxPoint old_origin = dc.GetDeviceOrigin();
843 dc.SetUserScale(1.0, 1.0);
844 dc.SetDeviceOrigin(0, 0);
846 dc.DrawBitmap(*icon_to_draw, screen_x, screen_y,
true);
849 dc.SetUserScale(old_scale_x, old_scale_y);
850 dc.SetDeviceOrigin(old_origin.x, old_origin.y);
861 wxColour connectionColor(mainPanelSettings.connectionLineColor.r, mainPanelSettings.connectionLineColor.g,
862 mainPanelSettings.connectionLineColor.b);
865 wxCoord child_y = y +
config_.node_height +
config_.vertical_spacing;
871 bool anyChildInPath =
false;
876 anyChildInPath =
true;
883 dc.SetPen(wxPen(connectionColor, 2));
886 dc.DrawLine(x, y +
config_.node_height, x, child_y - 10);
889 if (parentInPath && anyChildInPath) {
894 wxCoord child_x = x - total_width / 2;
900 wxCoord center_x = child_x + subtree_width / 2;
906 dc.SetPen(wxPen(connectionColor, 2));
909 dc.DrawLine(x, child_y - 10, center_x, child_y - 10);
912 dc.DrawLine(center_x, child_y - 10, center_x, child_y);
915 if (parentInPath && childInPath) {
920 child_x += subtree_width;
935 int circle_radius = 8;
939 wxCoord arrow_y = y +
config_.node_height;
942 dc.SetBrush(wxBrush(wxColour(70, 70, 70)));
943 dc.SetPen(wxPen(wxColour(100, 100, 100), 1));
944 dc.DrawCircle(arrow_x, arrow_y, circle_radius);
952 triangle[0] = {arrow_x - arrow_size, arrow_y - 2};
953 triangle[1] = {arrow_x + arrow_size, arrow_y - 2};
954 triangle[2] = {arrow_x, arrow_y + 3};
956 dc.SetPen(wxPen(wxColour(120, 200, 255), 1));
957 dc.SetBrush(wxBrush(wxColour(120, 200, 255)));
961 triangle[0] = {arrow_x - 2, arrow_y - arrow_size};
962 triangle[1] = {arrow_x - 2, arrow_y + arrow_size};
963 triangle[2] = {arrow_x + 3, arrow_y};
965 dc.SetPen(wxPen(wxColour(180, 180, 180), 1));
966 dc.SetBrush(wxBrush(wxColour(180, 180, 180)));
969 dc.DrawPolygon(3, triangle);
974 dc.SetUserScale(1.0, 1.0);
975 dc.SetDeviceOrigin(0, 0);
977 wxSize panel_size = GetSize();
985 int offsetY) -> wxPoint {
988 return wxPoint(offsetX, offsetY);
990 return wxPoint(panel_size.x - offsetX, offsetY);
992 return wxPoint(offsetX, panel_size.y - offsetY);
994 return wxPoint(panel_size.x - offsetX, panel_size.y - offsetY);
996 return wxPoint(offsetX, offsetY);
1001 if (btViewSettings.showCoordinateInfo) {
1002 wxColour color(btViewSettings.coordinateInfoColor.r, btViewSettings.coordinateInfoColor.g,
1003 btViewSettings.coordinateInfoColor.b);
1004 dc.SetTextForeground(color);
1005 dc.SetFont(wxFont(btViewSettings.coordinateInfoFontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
1006 wxFONTWEIGHT_NORMAL));
1010 wxPoint pos = calculatePosition(btViewSettings.coordinateInfoAnchor, btViewSettings.coordinateInfoX,
1011 btViewSettings.coordinateInfoY);
1012 dc.DrawText(zoomText, pos.x, pos.y);
1017 wxColour color(btViewSettings.selectedNodeInfoColor.r, btViewSettings.selectedNodeInfoColor.g,
1018 btViewSettings.selectedNodeInfoColor.b);
1019 dc.SetTextForeground(color);
1020 dc.SetFont(wxFont(btViewSettings.selectedNodeInfoFontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
1021 wxFONTWEIGHT_NORMAL));
1025 wxPoint pos = calculatePosition(btViewSettings.selectedNodeInfoAnchor, btViewSettings.selectedNodeInfoX,
1026 btViewSettings.selectedNodeInfoY);
1027 dc.DrawText(selectedText, pos.x, pos.y);
1031 if (btViewSettings.showTreeInfo &&
tree_ &&
tree_->HasRootNode()) {
1032 wxColour color(btViewSettings.treeInfoColor.r, btViewSettings.treeInfoColor.g, btViewSettings.treeInfoColor.b);
1033 dc.SetTextForeground(color);
1035 wxFont(btViewSettings.treeInfoFontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
1037 wxString statsText =
1038 wxString::Format(
"Tree: %lu nodes total",
static_cast<unsigned long>(
tree_->GetNodeCount()));
1040 calculatePosition(btViewSettings.treeInfoAnchor, btViewSettings.treeInfoX, btViewSettings.treeInfoY);
1041 dc.DrawText(statsText, pos.x, pos.y);
1045 if (btViewSettings.showFPS) {
1046 wxColour color(btViewSettings.fpsColor.r, btViewSettings.fpsColor.g, btViewSettings.fpsColor.b);
1047 dc.SetTextForeground(color);
1048 dc.SetFont(wxFont(btViewSettings.fpsFontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
1052 wxString fpsText = wxString::Format(
"FPS: %.1f", fps);
1053 wxPoint pos = calculatePosition(btViewSettings.fpsAnchor, btViewSettings.fpsX, btViewSettings.fpsY);
1054 dc.DrawText(fpsText, pos.x, pos.y);
1058 if (btViewSettings.showControlsHelp) {
1059 wxColour color(btViewSettings.controlsHelpColor.r, btViewSettings.controlsHelpColor.g,
1060 btViewSettings.controlsHelpColor.b);
1061 dc.SetTextForeground(color);
1063 wxFont(btViewSettings.controlsHelpFontSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
1066 "Controls: Left-click=Select | Double-click=Center View | Middle-drag=Pan | Wheel=Zoom | " +
1067 btViewSettings.resetViewHotkey +
"=Reset View | " + btViewSettings.centerOnNodeHotkey +
1068 "=Expand/Collapse | " + btViewSettings.deleteNodeHotkey +
"=Delete Node";
1069 wxPoint pos = calculatePosition(btViewSettings.controlsHelpAnchor, btViewSettings.controlsHelpX,
1070 btViewSettings.controlsHelpY);
1071 dc.DrawText(helpText, pos.x, pos.y);
1090 int total_width = 0;
1097 width = std::max(total_width,
config_.node_width +
config_.horizontal_spacing);
1118 wxRect node_rect(node_pos.x -
config_.node_width / 2, node_pos.y,
config_.node_width,
config_.node_height);
1120 if (node_rect.Contains(target_pos)) {
1127 wxCoord child_x = node_pos.x - total_width / 2;
1128 wxCoord child_y = node_pos.y +
config_.node_height +
config_.vertical_spacing;
1134 wxCoord center_x = child_x + subtree_width / 2;
1141 child_x += subtree_width;
1150 if (!target_node || !
tree_ || !
tree_->HasRootNode())
1154 std::function<wxPoint(
ITreeNode *, wxPoint,
int)> findPosition = [&](
ITreeNode *node, wxPoint node_pos,
1155 int level) -> wxPoint {
1160 bool isTargetNode = (node == target_node);
1161 if (!isTargetNode && target_node && node->
GetId() == target_node->
GetId() &&
1163 isTargetNode =
true;
1173 wxCoord child_x = node_pos.x - total_width / 2;
1174 wxCoord child_y = node_pos.y +
config_.node_height +
config_.vertical_spacing;
1180 wxCoord center_x = child_x + subtree_width / 2;
1182 wxPoint found = findPosition(child, {center_x, child_y}, level + 1);
1183 if (found.x != -1 && found.y != -1) {
1187 child_x += subtree_width;
1196 return findPosition(
tree_->GetRootNode(), root_pos, 0);
1200 wxSize panel_size = GetSize();
1201 return x >= -100 && x <= panel_size.x + 100 && y >= -100 && y <= panel_size.y + 100;
1216 wxSize panel_size = GetSize();
1218 wxPoint bottomRight =
ScreenToWorld({panel_size.x, panel_size.y});
1220 return wxRect(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y);
1235 viewport.Inflate(margin);
1238 return viewport.Intersects(nodeBounds);
1244 const auto &mainPanelSettings = prefs.GetMainPanelSettings();
1245 const auto &perfSettings = prefs.GetPerformanceSettings();
1264 config_.grid_size = mainPanelSettings.gridSize;
1265 config_.grid_color = wxColour(mainPanelSettings.gridLineColor.r, mainPanelSettings.gridLineColor.g,
1266 mainPanelSettings.gridLineColor.b);
1276 "TreeVisualization",
1277 wxString::Format(
"Loaded preferences: zoom_step=%.2f, wheel_sens=%.2f, pan_sens=%.2f, pan=%s, "
1278 "zoom_follows_cursor=%s, show_grid=%s, grid_size=%d, viewport_culling=%s, culling_margin=%d",
1287 if (hotkey ==
"Left Mouse Button") {
1291 if (hotkey ==
"Middle Mouse Button") {
1295 if (hotkey ==
"Right Mouse Button") {
1302 if (hotkey ==
"Space")
1304 if (hotkey ==
"Shift")
1306 if (hotkey ==
"Ctrl")
1308 if (hotkey ==
"Alt")
1310 if (hotkey ==
"Tab")
1322 if (hotkey.length() == 1) {
1324 if (c >=
'A' && c <=
'Z')
1326 if (c >=
'a' && c <=
'z')
1336 int keyCode =
event.GetKeyCode();
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
#define LOG_INFO(category, message)
Centralized resource path management for EmberForge.
Abstract interface for tree nodes that can be visualized.
virtual bool IsUnimplementedReference() const
Check if this node references an unimplemented tree.
virtual bool IsSubTreeReference() const
Check if this node is a SubTree reference.
virtual size_t GetId() const =0
virtual size_t GetChildCount() const =0
virtual NodeType GetType() const =0
virtual ITreeNode * GetParent() const =0
virtual bool AreChildrenVisible() const =0
virtual const String & GetName() const =0
virtual ITreeNode * GetChild(size_t index) const =0
Tree visualization panel that renders behavior trees in a grid-based layout.
wxTimer * m_performanceTimer
void DrawCollapseArrow(wxDC &dc, ITreeNode *node, wxCoord x, wxCoord y)
void OnMouseLeftDClick(wxMouseEvent &event)
void OnSize(wxSizeEvent &event)
ITreeNode * FindNodeAtPosition(ITreeNode *node, wxPoint node_pos, wxPoint target_pos, int level=0)
wxPoint ScreenToWorld(const wxPoint &screen_pos) const
wxBitmap scaled_icon_condition_
std::shared_ptr< ITreeNode > selected_node_
wxBitmap scaled_icon_tree_
bool IsNodeInViewport(wxCoord x, wxCoord y) const
void DrawNodeText(wxDC &dc, ITreeNode *node, wxCoord x, wxCoord y)
void DrawNodeConnections(wxDC &dc, ITreeNode *node, wxCoord x, wxCoord y)
VisualizationConfig config_
virtual ~TreeVisualization()
wxPoint WorldToScreen(const wxPoint &world_pos) const
int viewport_culling_margin_
void SetBehaviorTree(std::shared_ptr< ITreeStructure > tree)
void OnMouseWheel(wxMouseEvent &event)
wxBitmap scaled_icon_decorator_
void DrawNavigationInfo(wxDC &dc)
void DrawNodeBox(wxDC &dc, ITreeNode *node, wxCoord x, wxCoord y)
void SetSelectedNode(ITreeNode *node)
void OnMouseMotion(wxMouseEvent &event)
bool enable_viewport_culling_
int CalculateSubtreeWidth(ITreeNode *node)
wxRect GetViewportBounds() const
std::vector< LineSegment > highlighted_path_segments_
wxBitmap scaled_icon_warning_
float mouse_wheel_sensitivity_
void OnMouseLeftDown(wxMouseEvent &event)
void CollectHighlightedConnections(ITreeNode *node, wxCoord x, wxCoord y)
void DrawNode(wxDC &dc, ITreeNode *node, wxCoord x, wxCoord y, int level, bool draw_children=true)
ITreeNode * hovered_node_
void OnMouseMiddleUp(wxMouseEvent &event)
bool enable_smooth_panning_
std::map< ITreeNode *, int > width_cache_
bool IsPointInViewport(wxCoord x, wxCoord y) const
NodeSelectionCallback m_nodeSelectionCallback
std::set< int > path_to_selected_ids_
wxPoint CalculateRootPosition()
wxBitmap scaled_icon_control_
int ParseHotkeyString(const std::string &hotkey)
wxBitmap scaled_icon_action_
void OnPaint(wxPaintEvent &event)
void CenterOnNode(ITreeNode *node)
std::shared_ptr< ITreeStructure > tree_
void OnMouseRightDown(wxMouseEvent &event)
void OnKeyUp(wxKeyEvent &event)
std::vector< CollapseArrowInfo > collapse_arrows_to_draw_
void OnMouseMiddleDown(wxMouseEvent &event)
void OnKeyDown(wxKeyEvent &event)
wxPoint FindNodeWorldPosition(ITreeNode *target_node)
bool zoom_follows_cursor_
AppPreferences & GetPreferences()
static AppPreferencesManager & GetInstance()
BehaviorTreeViewSettings & GetBehaviorTreeViewSettings()
MainPanelSettings & GetMainPanelSettings()
TextAnchor
Text anchor position for debug info overlay.
static wxString GetDir(const wxString &relativeDir)
Get the full path to a resource directory.
Main types header for EmberCore.
std::string String
Framework-agnostic string type.
wxBEGIN_EVENT_TABLE(TreeVisualization, wxPanel) EVT_PAINT(TreeVisualization