TimelineConstraints.h header
#include <ew/app/TimelineConstraints.h>
Namespace ew::app
ConstraintEvent struct
struct ew::app::ConstraintEvent
One event as the constraint engine sees it (TL-12): its id, its span [start, end], and the relative constraints it holds on other events. Its duration is end - start; honouring a move preserves it.
Members
ew::core::ContentId ew::app::ConstraintEvent::id
The event's id.
qint64 ew::app::ConstraintEvent::start = 0
The event's start instant (minutes since the epoch).
qint64 ew::app::ConstraintEvent::end = 0
The event's end instant.
std::vector<ew::core::TimelineConstraint> ew::app::ConstraintEvent::constraints = {}
The relative constraints this event holds (each references another event); empty by default.
ConstraintViolation struct
struct ew::app::ConstraintViolation
A single broken relative constraint (TL-12): the constrained event B, the event A it is measured against, and the kind – so the Conflicts dock can describe and jump to it.
Members
ew::core::ContentId ew::app::ConstraintViolation::eventId
B, the event whose constraint is unsatisfied.
ew::core::ContentId ew::app::ConstraintViolation::otherId
A, the event B is measured against.
ew::core::TimelineConstraintKind ew::app::ConstraintViolation::kind
The relation B fails to satisfy.
bool operator==(const ConstraintViolation &, const ConstraintViolation &)=default
Value equality over all fields, so the flag set is testable without a view.
Functions
bool ew::app::constraintSatisfied(ew::core::TimelineConstraintKind kind, qint64 aStart, qint64 aEnd, qint64 bStart, qint64 bEnd)
True when event B (bStart .. bEnd) satisfies a kind constraint against event A (aStart .. aEnd): After = B starts at/after A ends; Before = B ends at/before A starts; During = B lies within [A.start, A.end]. Spans are half-open in spirit but compared with <= so a zero-gap touch counts as satisfied (an event that starts exactly when its predecessor ends is "after" it).
std::vector< ConstraintViolation > ew::app::evaluateConstraints(const std::vector< ConstraintEvent > &events)
Every violated constraint across events (TL-12 "flag"): a constraint whose referenced event is present but unsatisfied. A constraint against a missing or null event, or a self-reference, is INERT (skipped, never a violation). Order follows events, then each event's constraint order, so the result is stable for a UI list.
std::map< ew::core::ContentId, qint64 > ew::app::honourConstraints(const std::vector< ConstraintEvent > &events, ew::core::ContentId movedId)
Cascades the constraints after movedId moved (TL-12 "honour"): returns the new START for every event that (transitively) depends on movedId and must shift to keep its constraint satisfied, preserving each moved event's duration. Only dependents move – never movedId itself (the user placed it), and never an event already satisfied. Cycle-SAFE: each dependent is repositioned at most once, so a dependency cycle stops propagating (its residual break is left for evaluateConstraints to flag) and a corrupt project can never loop. An event absent from the result keeps its current start. A dependent that still cannot be satisfied by moving alone (e.g. it is longer than the span it must fit During) is moved as close as possible and then flagged.