Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
donner::editor::LayerTreeModel Class Reference

Builds and owns the flat Layers row list. Selection is mirrored in from EditorApp on every refresh; selection requests flow back out through LayersPanel (this model is read-only with respect to the document). More...

#include "donner/editor/LayerTreeModel.h"

Public Member Functions

void refresh (const EditorApp &app)
 Rebuild the row snapshot from live editor state. Safe to call only when the async renderer is idle (mirrors SidebarPresenter::refreshSnapshot, taking document write access for the duration of the walk). Preserves expansion state across calls.
const std::vector< LayerTreeRow > & rows () const
 The current flat row list, in visual stack order (later-painted siblings appear first / on top).
void setExpanded (std::uint64_t stableId, bool expanded)
 Set the expansion state for the element identified by stableId.
void toggleExpanded (std::uint64_t stableId)
 Toggle the expansion state for the element identified by stableId.
bool isExpanded (std::uint64_t stableId) const
 Whether the element identified by stableId is currently expanded.

Static Public Member Functions

static std::uint64_t StableIdFor (const svg::SVGElement &element)
 Compute the stable id for an element (public so panels/tests can key into expansion state without duplicating the derivation).

Detailed Description

Builds and owns the flat Layers row list. Selection is mirrored in from EditorApp on every refresh; selection requests flow back out through LayersPanel (this model is read-only with respect to the document).


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