![]() |
Ember
|
Shared tree rendering canvas usable by both EmberForge and EmberMonitor. More...
#include <TreeCanvas.h>
Classes | |
| struct | CollapseArrowInfo |
| struct | LineSegment |
Public Types | |
| using | NodeSelectionCallback = std::function<void(EmberCore::ITreeNode *)> |
| using | VisibilityChangeCallback = std::function<void()> |
Public Member Functions | |
| TreeCanvas (wxWindow *parent, wxWindowID id=wxID_ANY) | |
| Constructor. | |
| virtual | ~TreeCanvas () |
| Destructor. | |
| void | SetTree (std::shared_ptr< EmberCore::ITreeStructure > tree) |
| Sets the tree structure to display. | |
| std::shared_ptr< EmberCore::ITreeStructure > | GetTree () const |
| Returns the current tree structure. | |
| TreeCanvasConfig & | GetConfig () |
| Returns mutable configuration. | |
| const TreeCanvasConfig & | GetConfig () const |
| Returns const configuration. | |
| void | SetStatusProvider (IStatusProvider *provider) |
| Sets the status overlay provider. | |
| IStatusProvider * | GetStatusProvider () const |
| Returns the status overlay provider. | |
| EmberCore::ITreeNode * | GetSelectedNode () const |
| Returns the currently selected node. | |
| void | SetSelectedNode (EmberCore::ITreeNode *node) |
| Sets the selected node. | |
| void | SetNodeSelectionCallback (NodeSelectionCallback callback) |
| Sets callback invoked when a node is selected. | |
| void | SetVisibilityChangeCallback (VisibilityChangeCallback callback) |
| Sets callback invoked when node visibility changes. | |
| void | ResetView () |
| Resets zoom and pan to default values. | |
| void | FitTreeInView () |
| Adjusts view to fit the entire tree. | |
| void | CenterOnNode (EmberCore::ITreeNode *node) |
| Centers the view on the given node. | |
| void | SetZoom (float zoom) |
| Sets the zoom factor. | |
| float | GetZoom () const |
| Returns the current zoom factor. | |
| void | MarkDirty () |
| Marks the canvas for repaint. | |
| void | RefreshCanvas () |
| Marks canvas dirty (alias for MarkDirty). | |
| void | InvalidateLayout () |
| Invalidates layout cache and triggers refresh. | |
| void | SetShowGrid (bool show) |
| Enables or disables grid display. | |
| void | SetShowOverlayInfo (bool show) |
| Enables or disables overlay info display. | |
| void | SetShowMinimap (bool show) |
| Enables or disables minimap display. | |
| void | SetShowBreadcrumb (bool show) |
| Enables or disables breadcrumb display. | |
| void | EnterFocusMode (EmberCore::ITreeNode *node) |
| Enters focus mode, showing only the subtree rooted at the given node. | |
| void | ExitFocusMode () |
| Exits focus mode. | |
| bool | IsInFocusMode () const |
| Returns whether focus mode is active. | |
| EmberCore::ITreeNode * | GetFocusRoot () const |
| Returns the focus mode root node, or nullptr if not in focus mode. | |
| void | LoadTypeIcons () |
| Loads type icons from the configured icon directory. | |
Protected Member Functions | |
| virtual void | OnNodeSelected (EmberCore::ITreeNode *node) |
| Called when a node is selected; override for app-specific behavior. | |
| virtual void | OnBeforePaintOverlays (wxDC &dc) |
| Called before painting overlays; override to draw custom overlays. | |
| virtual wxColour | GetNodeFillColor (EmberCore::ITreeNode *node, bool selected, bool hovered) |
| Returns the fill color for a node; override for custom coloring. | |
| virtual wxColour | GetNodeBorderColor (EmberCore::ITreeNode *node, bool selected, bool hovered) |
| Returns the border color for a node; override for custom coloring. | |
| virtual wxColour | GetNodeTextColor (EmberCore::ITreeNode *node, bool selected, bool hovered) |
| Returns the text color for a node; override for custom coloring. | |
| virtual void | OnKeyDown (wxKeyEvent &event) |
| Key down handler; override for custom key handling. | |
| virtual void | OnKeyUp (wxKeyEvent &event) |
| Key up handler; override for custom key handling. | |
| wxPoint | GetViewOffset () const |
| Returns the current view offset. | |
| wxPoint | GetTargetOffset () const |
| Returns the target offset for smooth panning. | |
| void | SetTargetOffset (const wxPoint &offset) |
| Sets the target offset for smooth panning. | |
| void | ClearWidthCache () |
| Clears the subtree width cache. | |
| bool | GetShowMinimap () const |
| Returns whether the minimap is shown. | |
Private Member Functions | |
| void | OnPaint (wxPaintEvent &event) |
| void | OnSize (wxSizeEvent &event) |
| void | OnMouseLeftDown (wxMouseEvent &event) |
| void | OnMouseLeftDClick (wxMouseEvent &event) |
| void | OnMouseMotion (wxMouseEvent &event) |
| void | OnMouseWheel (wxMouseEvent &event) |
| void | OnMouseMiddleDown (wxMouseEvent &event) |
| void | OnMouseMiddleUp (wxMouseEvent &event) |
| void | OnMouseLeftUp (wxMouseEvent &event) |
| void | OnMouseRightUp (wxMouseEvent &event) |
| void | DrawGrid (wxDC &dc, const wxRect &viewport) |
| void | DrawNode (wxDC &dc, EmberCore::ITreeNode *node, wxCoord x, wxCoord y, int level, const wxRect &viewport) |
| void | DrawNodeBox (wxDC &dc, EmberCore::ITreeNode *node, wxCoord x, wxCoord y) |
| void | DrawNodeText (wxDC &dc, EmberCore::ITreeNode *node, wxCoord x, wxCoord y) |
| void | DrawTypeHeader (wxDC &dc, EmberCore::ITreeNode *node, const wxRect &nodeRect) |
| void | DrawNodeConnections (wxDC &dc, EmberCore::ITreeNode *node, wxCoord x, wxCoord y) |
| void | DrawCollapseArrow (wxDC &dc, EmberCore::ITreeNode *node, wxCoord x, wxCoord y) |
| void | DrawOverlayInfo (wxDC &dc) |
| void | DrawMinimap (wxDC &dc) |
| void | DrawMinimapNode (wxDC &dc, EmberCore::ITreeNode *node, wxCoord x, wxCoord y, float scaleX, float scaleY, int offsetX, int offsetY, const wxRect &minimapArea) |
| void | DrawBreadcrumb (wxDC &dc) |
| void | AutoCollapseTree (EmberCore::ITreeNode *node, int depth) |
| void | ExpandAllChildren (EmberCore::ITreeNode *node) |
| void | CollapseAllChildren (EmberCore::ITreeNode *node) |
| void | ExpandToDepth (EmberCore::ITreeNode *node, int relativeDepth) |
| wxColour | GetNodeTypeColor (EmberCore::ITreeNode::NodeType type) const |
| EmberCore::ITreeNode * | GetEffectiveRoot () const |
| void | ComputeTreeExtent (EmberCore::ITreeNode *node, wxCoord x, wxCoord y, int &minX, int &maxX, int &maxY) |
| int | CalculateSubtreeWidth (EmberCore::ITreeNode *node) |
| wxPoint | CalculateRootPosition () |
| EmberCore::ITreeNode * | FindNodeAtPosition (EmberCore::ITreeNode *node, wxPoint node_pos, wxPoint target_pos) |
| EmberCore::ITreeNode * | FindArrowAtPosition (const wxPoint &world_pos) const |
| wxPoint | FindNodeWorldPosition (EmberCore::ITreeNode *target_node) |
| wxPoint | ScreenToWorld (const wxPoint &screen_pos) const |
| wxPoint | WorldToScreen (const wxPoint &world_pos) const |
| wxRect | GetViewportBounds () const |
| void | UpdateScaledConfig () |
| void | BuildPathToSelected () |
| wxDECLARE_EVENT_TABLE () | |
Shared tree rendering canvas usable by both EmberForge and EmberMonitor.
Supports zoom, pan, node selection, and optional status overlay. Subclass and override virtual hooks for app-specific behavior.
Definition at line 76 of file TreeCanvas.h.
| using EmberUI::TreeCanvas::NodeSelectionCallback = std::function<void(EmberCore::ITreeNode *)> |
Definition at line 78 of file TreeCanvas.h.
| using EmberUI::TreeCanvas::VisibilityChangeCallback = std::function<void()> |
Definition at line 79 of file TreeCanvas.h.
| EmberUI::TreeCanvas::TreeCanvas | ( | wxWindow * | parent, |
| wxWindowID | id = wxID_ANY ) |
Constructor.
|
virtual |
Destructor.
Definition at line 69 of file TreeCanvas.cpp.
|
private |
Definition at line 114 of file TreeCanvas.cpp.
|
private |
Definition at line 314 of file TreeCanvas.cpp.
|
private |
Definition at line 1485 of file TreeCanvas.cpp.
|
private |
Definition at line 1458 of file TreeCanvas.cpp.
| void EmberUI::TreeCanvas::CenterOnNode | ( | EmberCore::ITreeNode * | node | ) |
Centers the view on the given node.
Definition at line 275 of file TreeCanvas.cpp.
|
inlineprotected |
Clears the subtree width cache.
Definition at line 179 of file TreeCanvas.h.
|
private |
Definition at line 141 of file TreeCanvas.cpp.
|
private |
Definition at line 1231 of file TreeCanvas.cpp.
|
private |
Definition at line 1368 of file TreeCanvas.cpp.
|
private |
Definition at line 1088 of file TreeCanvas.cpp.
|
private |
Definition at line 828 of file TreeCanvas.cpp.
|
private |
Definition at line 1258 of file TreeCanvas.cpp.
|
private |
Definition at line 1331 of file TreeCanvas.cpp.
|
private |
Definition at line 855 of file TreeCanvas.cpp.
|
private |
Definition at line 907 of file TreeCanvas.cpp.
|
private |
Definition at line 1039 of file TreeCanvas.cpp.
|
private |
Definition at line 1004 of file TreeCanvas.cpp.
|
private |
Definition at line 1134 of file TreeCanvas.cpp.
|
private |
Definition at line 939 of file TreeCanvas.cpp.
| void EmberUI::TreeCanvas::EnterFocusMode | ( | EmberCore::ITreeNode * | node | ) |
Enters focus mode, showing only the subtree rooted at the given node.
Definition at line 1184 of file TreeCanvas.cpp.
| void EmberUI::TreeCanvas::ExitFocusMode | ( | ) |
Exits focus mode.
Definition at line 1195 of file TreeCanvas.cpp.
|
private |
Definition at line 131 of file TreeCanvas.cpp.
|
private |
Definition at line 151 of file TreeCanvas.cpp.
|
private |
Definition at line 1521 of file TreeCanvas.cpp.
|
private |
Definition at line 1487 of file TreeCanvas.cpp.
|
private |
Definition at line 1534 of file TreeCanvas.cpp.
| void EmberUI::TreeCanvas::FitTreeInView | ( | ) |
Adjusts view to fit the entire tree.
Definition at line 252 of file TreeCanvas.cpp.
|
inline |
Returns mutable configuration.
Definition at line 92 of file TreeCanvas.h.
|
inline |
Returns const configuration.
Definition at line 94 of file TreeCanvas.h.
|
private |
Definition at line 1206 of file TreeCanvas.cpp.
|
inline |
Returns the focus mode root node, or nullptr if not in focus mode.
Definition at line 151 of file TreeCanvas.h.
|
protectedvirtual |
Returns the border color for a node; override for custom coloring.
Reimplemented in Ember::Monitor::MonitorTreeCanvas, and EmberForge::ForgeTreeCanvas.
Definition at line 214 of file TreeCanvas.cpp.
|
protectedvirtual |
Returns the fill color for a node; override for custom coloring.
Reimplemented in Ember::Monitor::MonitorTreeCanvas, and EmberForge::ForgeTreeCanvas.
Definition at line 204 of file TreeCanvas.cpp.
|
protectedvirtual |
Returns the text color for a node; override for custom coloring.
Reimplemented in Ember::Monitor::MonitorTreeCanvas, and EmberForge::ForgeTreeCanvas.
Definition at line 234 of file TreeCanvas.cpp.
|
private |
Definition at line 1214 of file TreeCanvas.cpp.
|
inline |
Returns the currently selected node.
Definition at line 102 of file TreeCanvas.h.
|
inlineprotected |
Returns whether the minimap is shown.
Definition at line 181 of file TreeCanvas.h.
|
inline |
Returns the status overlay provider.
Definition at line 99 of file TreeCanvas.h.
|
inlineprotected |
Returns the target offset for smooth panning.
Definition at line 175 of file TreeCanvas.h.
|
inline |
Returns the current tree structure.
Definition at line 89 of file TreeCanvas.h.
|
inlineprotected |
Returns the current view offset.
Definition at line 173 of file TreeCanvas.h.
|
private |
Definition at line 1585 of file TreeCanvas.cpp.
|
inline |
Returns the current zoom factor.
Definition at line 120 of file TreeCanvas.h.
|
inline |
Invalidates layout cache and triggers refresh.
Definition at line 128 of file TreeCanvas.h.
|
inline |
Returns whether focus mode is active.
Definition at line 149 of file TreeCanvas.h.
| void EmberUI::TreeCanvas::LoadTypeIcons | ( | ) |
Loads type icons from the configured icon directory.
Definition at line 77 of file TreeCanvas.cpp.
|
inline |
Marks the canvas for repaint.
Definition at line 123 of file TreeCanvas.h.
|
protectedvirtual |
Called before painting overlays; override to draw custom overlays.
Reimplemented in Ember::Monitor::MonitorTreeCanvas, and EmberForge::ForgeTreeCanvas.
Definition at line 202 of file TreeCanvas.cpp.
|
protectedvirtual |
Key down handler; override for custom key handling.
Reimplemented in EmberForge::ForgeTreeCanvas.
Definition at line 607 of file TreeCanvas.cpp.
|
protectedvirtual |
Key up handler; override for custom key handling.
Definition at line 663 of file TreeCanvas.cpp.
|
private |
Definition at line 496 of file TreeCanvas.cpp.
|
private |
Definition at line 404 of file TreeCanvas.cpp.
|
private |
Definition at line 488 of file TreeCanvas.cpp.
|
private |
Definition at line 600 of file TreeCanvas.cpp.
|
private |
Definition at line 605 of file TreeCanvas.cpp.
|
private |
Definition at line 517 of file TreeCanvas.cpp.
|
private |
Definition at line 673 of file TreeCanvas.cpp.
|
private |
Definition at line 578 of file TreeCanvas.cpp.
|
protectedvirtual |
Called when a node is selected; override for app-specific behavior.
Definition at line 196 of file TreeCanvas.cpp.
|
private |
Definition at line 327 of file TreeCanvas.cpp.
|
private |
Definition at line 399 of file TreeCanvas.cpp.
|
inline |
Marks canvas dirty (alias for MarkDirty).
Definition at line 125 of file TreeCanvas.h.
| void EmberUI::TreeCanvas::ResetView | ( | ) |
Resets zoom and pan to default values.
Definition at line 244 of file TreeCanvas.cpp.
|
private |
Definition at line 1575 of file TreeCanvas.cpp.
|
inline |
Sets callback invoked when a node is selected.
Definition at line 107 of file TreeCanvas.h.
| void EmberUI::TreeCanvas::SetSelectedNode | ( | EmberCore::ITreeNode * | node | ) |
Sets the selected node.
Definition at line 190 of file TreeCanvas.cpp.
|
inline |
Enables or disables breadcrumb display.
Definition at line 142 of file TreeCanvas.h.
|
inline |
Enables or disables grid display.
Definition at line 136 of file TreeCanvas.h.
|
inline |
Enables or disables minimap display.
Definition at line 140 of file TreeCanvas.h.
|
inline |
Enables or disables overlay info display.
Definition at line 138 of file TreeCanvas.h.
|
inline |
Sets the status overlay provider.
Definition at line 97 of file TreeCanvas.h.
|
inlineprotected |
Sets the target offset for smooth panning.
Definition at line 177 of file TreeCanvas.h.
| void EmberUI::TreeCanvas::SetTree | ( | std::shared_ptr< EmberCore::ITreeStructure > | tree | ) |
Sets the tree structure to display.
Definition at line 165 of file TreeCanvas.cpp.
|
inline |
Sets callback invoked when node visibility changes.
Definition at line 109 of file TreeCanvas.h.
| void EmberUI::TreeCanvas::SetZoom | ( | float | zoom | ) |
Sets the zoom factor.
Definition at line 295 of file TreeCanvas.cpp.
|
private |
Definition at line 302 of file TreeCanvas.cpp.
|
private |
Definition at line 1580 of file TreeCanvas.cpp.
|
private |
|
private |
Definition at line 287 of file TreeCanvas.h.
|
private |
Definition at line 273 of file TreeCanvas.h.
|
private |
Definition at line 228 of file TreeCanvas.h.
|
private |
Definition at line 250 of file TreeCanvas.h.
|
private |
Definition at line 260 of file TreeCanvas.h.
|
private |
Definition at line 237 of file TreeCanvas.h.
|
private |
Definition at line 258 of file TreeCanvas.h.
|
private |
Definition at line 266 of file TreeCanvas.h.
|
private |
Definition at line 235 of file TreeCanvas.h.
|
private |
Definition at line 234 of file TreeCanvas.h.
|
private |
Definition at line 245 of file TreeCanvas.h.
|
private |
Definition at line 248 of file TreeCanvas.h.
|
private |
Definition at line 247 of file TreeCanvas.h.
|
private |
Definition at line 243 of file TreeCanvas.h.
|
private |
Definition at line 279 of file TreeCanvas.h.
|
private |
Definition at line 284 of file TreeCanvas.h.
|
private |
Definition at line 285 of file TreeCanvas.h.
|
private |
Definition at line 282 of file TreeCanvas.h.
|
private |
Definition at line 283 of file TreeCanvas.h.
|
private |
Definition at line 281 of file TreeCanvas.h.
|
private |
Definition at line 280 of file TreeCanvas.h.
|
private |
Definition at line 278 of file TreeCanvas.h.
|
private |
Definition at line 242 of file TreeCanvas.h.
|
private |
Definition at line 246 of file TreeCanvas.h.
|
private |
Definition at line 261 of file TreeCanvas.h.
|
private |
Definition at line 236 of file TreeCanvas.h.
|
private |
Definition at line 293 of file TreeCanvas.h.
|
private |
Definition at line 229 of file TreeCanvas.h.
|
private |
Definition at line 233 of file TreeCanvas.h.
|
private |
Definition at line 267 of file TreeCanvas.h.
|
private |
Definition at line 275 of file TreeCanvas.h.
|
private |
Definition at line 254 of file TreeCanvas.h.
|
private |
Definition at line 251 of file TreeCanvas.h.
|
private |
Definition at line 253 of file TreeCanvas.h.
|
private |
Definition at line 252 of file TreeCanvas.h.
|
private |
Definition at line 231 of file TreeCanvas.h.
|
private |
Definition at line 240 of file TreeCanvas.h.
|
private |
Definition at line 256 of file TreeCanvas.h.
|
private |
Definition at line 230 of file TreeCanvas.h.
|
private |
Definition at line 257 of file TreeCanvas.h.
|
private |
Definition at line 291 of file TreeCanvas.h.
|
private |
Definition at line 239 of file TreeCanvas.h.
|
private |
Definition at line 276 of file TreeCanvas.h.
|
mutableprivate |
Definition at line 289 of file TreeCanvas.h.
|
private |
Definition at line 241 of file TreeCanvas.h.