TimelineConflictGeometry.h header

#include <ew/app/TimelineConflictGeometry.h>

Namespace ew::app

TimelineSpan struct

struct ew::app::TimelineSpan

A story-time span. A positive-duration event is the half-open interval [start, end); a zero-duration event (start == end) is the single instant {start}.

Members

qint64 ew::app::TimelineSpan::start = 0

Story-time instant the span begins at (inclusive).

qint64 ew::app::TimelineSpan::end = 0

Story-time instant the span ends at (exclusive); equals start for an instant.

bool operator==(const TimelineSpan &, const TimelineSpan &)=default

Spans compare equal when their start and end match.

Functions

std::optional< TimelineSpan > ew::app::timelineOverlapSpan(const TimelineSpan &a, const TimelineSpan &b)

The story-time sub-span over which two events overlap, or nullopt when they do not (TL-68). The overlap DECISION matches the timeline continuity validator's "two places at once" rule EXACTLY, so the view draws a conflict's geometry over precisely the events the validator flagged: two instants overlap only when identical; an instant overlaps an interval that contains it (start <= instant < end – the interval's own start counts, its end does not); two intervals overlap when each begins before the other ends. The returned sub-span is [max(starts), min(ends)] – for an instant-vs-interval pair this collapses to the instant, and for two coincident instants to that instant. A travel pair (two events that do NOT overlap in time) yields nullopt, so only a genuine coincidence is drawn. Pure: the caller maps the returned span to pixels, so no view is needed to test it. This is the single source of truth the validator's own overlap test also calls, so the two can never drift.