TimelineMapLink.h header

#include <ew/app/TimelineMapLink.h>

Namespace ew::app

LocatedSpan struct

struct ew::app::LocatedSpan

One timeline event reduced to what the map link needs (TL-64): its story-time span and the place it happens. locationId is null when the event has no location.

Members

qint64 ew::app::LocatedSpan::start = 0

Start of the event's story-time span (minutes since the story epoch).

qint64 ew::app::LocatedSpan::end = 0

End of the event's story-time span.

ew::core::ContentId ew::app::LocatedSpan::locationId

The place the event happens; null when it has no location.

Functions

std::vector< LocatedSpan > ew::app::locatedSpans(const ew::core::Project &project)

Every timeline event in project as a located span (TL-64), in project id order – its [start, end] story-time interval and its location id (null when it has none). Pure over the model so the place-and-time link is testable without a view; the caller decides how to resolve a location id to a map region.

std::vector< ew::core::ContentId > ew::app::locationsInSpan(const std::vector< LocatedSpan > &spans, qint64 start, qint64 end)

The distinct, non-null location ids whose event overlaps the story-time window [start, end] (TL-64: "selecting a span highlights the map regions in play"). Overlap is decided by the shared timelineOverlapSpan, so it matches the timeline's own overlap semantics exactly (an instant event counts when it falls inside the half-open window). The result is in first-seen order and each id appears once; an event with no location is ignored.

std::vector< int > ew::app::regionsForLocations(const ew::core::Map &map, const std::vector< ew::core::ContentId > &locationIds)

The indices of map's regions whose linked entity is one of locationIds (TL-64): the places drawn on this map that are in play. Ascending, each index once; a region with no link, or one linking outside the set, is omitted. A null id in locationIds never matches (a region with no link is not "in play").