TimelineHierarchy.h header
#include <ew/app/TimelineHierarchy.h>
Namespace ew::app
TimelineHierarchyInput struct
struct ew::app::TimelineHierarchyInput
One event's hierarchy inputs (TL-11): its id, its parent event (null = top-level), its own span, and whether it is collapsed (folded to a single summary bar with its descendants hidden).
Members
ew::core::ContentId ew::app::TimelineHierarchyInput::id
The event's id.
ew::core::ContentId ew::app::TimelineHierarchyInput::parentId = {}
The parent event's id, or a null id (the default) for a top-level event.
qint64 ew::app::TimelineHierarchyInput::start = 0
The event's own start instant (minutes since the epoch).
qint64 ew::app::TimelineHierarchyInput::end = 0
The event's own end instant.
bool ew::app::TimelineHierarchyInput::collapsed = false
Whether the event is collapsed – drawn as one summary bar, its descendants hidden.
TimelineHierarchyItem struct
struct ew::app::TimelineHierarchyItem
One VISIBLE event after applying the hierarchy (TL-11) – an event every one of whose ancestors is expanded. depth drives indentation (0 = top level); hasChildren says whether to draw a disclosure control; collapsed marks a folded parent; [spanStart, spanEnd] is the span to DRAW – the event's own span, or, for a collapsed parent, the envelope of itself and its descendants, so a folded "Age" reads as covering everything inside it.
Members
ew::core::ContentId ew::app::TimelineHierarchyItem::id
The event's id (matches a TimelineHierarchyInput::id).
int ew::app::TimelineHierarchyItem::depth = 0
Nesting depth: 0 for a top-level event, 1 for its child, and so on.
bool ew::app::TimelineHierarchyItem::hasChildren = false
Whether the event has at least one child (draw a disclosure triangle).
bool ew::app::TimelineHierarchyItem::collapsed = false
Whether the event is a collapsed parent (folded).
qint64 ew::app::TimelineHierarchyItem::spanStart = 0
The start of the span to draw: the event's own start, or the descendant envelope's start when collapsed.
qint64 ew::app::TimelineHierarchyItem::spanEnd = 0
The end of the span to draw: the event's own end, or the descendant envelope's end when collapsed.
bool operator==(const TimelineHierarchyItem &, const TimelineHierarchyItem &)=default
Value equality over all fields, so the flatten is testable without a view.
Functions
std::set< ew::core::ContentId > ew::app::timelineDescendants(const std::vector< TimelineHierarchyInput > &inputs, ew::core::ContentId root)
The set of root's transitive descendants (children, grandchildren, ...) over the parent links in inputs, NOT including root itself. Cycle-SAFE via a visited set, so a corrupt parentId cycle can never hang. This is what the "Parent event" picker excludes (together with the event itself) to keep the hierarchy acyclic – you cannot reparent an event under its own descendant.
std::vector< TimelineHierarchyItem > ew::app::timelineHierarchy(const std::vector< TimelineHierarchyInput > &inputs)
Flattens the event hierarchy for drawing (TL-11): DROPS every event that has a collapsed ancestor, and gives each surviving event its depth, whether it has children, and its draw span (a collapsed parent spans the envelope of itself and its descendants). Input order is preserved among the survivors. Cycle-SAFE: a parentId cycle (or a parent that is not in inputs) is broken – the event past the break is treated as top-level – so a corrupt or hand-edited project can never hang or recurse. Pure, so the visibility and envelope invariants are machine-checkable without a view.