Skip to main content

project_command_ranges

Function project_command_ranges 

Source
pub fn project_command_ranges(
    scene: &Scene,
    ranges: &[Range<usize>],
    options: RangeOptions,
    out: &mut Scene,
) -> RangeCut
Expand description

project_command_range over several ranges at once: writes the projection of each range of ranges, in the order given, one after the other into out (reset first), and reports the cuts summed — the segmented frame’s way of drawing the commands between overlay cuts on the main surface (render-model Phase 4, decision D10).

Each range is projected exactly as project_command_range projects it alone — clamped to the scene, its open clips and layers reopened ahead of it and closed after it, a retained bracket spanning either of its ends demoted to inline paint — so every range is self-contained and the bracket rule holds per range. A clip open across the gap between two ranges is therefore closed at the end of the first and reopened at the start of the second, never left open over the commands the gap removed.

The caller passes the ranges ascending and disjoint (the complement of a frame’s overlay cuts is); overlapping ranges are projected as given, each command carried once per range it falls in. An empty range still reopens and closes the brackets open at its start (drawing nothing), so a caller that wants no trace of it leaves it out.

The returned RangeCut’s start is the first range’s clamped start and its end the last range’s clamped end (both 0 for no range at all); its counters are the sums over every range.