SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
binsampler.h File Reference

Compute frozen break values across animation frames (Slice Z.7). More...

#include "render/intervalbinner.h"
#include <QVector>
Include dependency graph for binsampler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  OpenSWMM
 
namespace  OpenSWMM::Render
 

Functions

QVector< doubleOpenSWMM::Render::sampleBreaksAcrossFrames (const IntervalBinner &binner, const QVector< QVector< double > > &perFrameValues, double sampleRate=0.2)
 Pick perFrameValues at sampleRate fraction (≥ 1 frame), flatten the selected frames' values, and call IntervalBinner::computeBreaks() on the flat sample.
 
QVector< int > OpenSWMM::Render::sampledFrameIndices (int frameCount, double sampleRate)
 Indices of the frames the sampler would pick, for the same frameCount and sampleRate. Pure function — useful for tests and for showing the user which frames were sampled. Returns an empty vector when frameCount == 0.
 

Detailed Description

Compute frozen break values across animation frames (Slice Z.7).

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later
    Animation binning lifecycle (RENDERING_RULE_MODEL_PLAN.md §14.1):
      1. At Rule creation, sample the bound attribute across all
         frames at the configured sample rate and call
         `sampleBreaksAcrossFrames` to compute breaks once.
      2. The caller stashes those breaks into the binner via
         `setMethod(Manual) + setManualBreaks(...)` — freezing the
         breaks for the rest of the Rule's lifetime.
      3. The user can re-run step 1 explicitly (the Symbology tab's
         "Recompute breaks…" button) or opt into per-frame
         recomputation via Rule::setRebinPerFrame(true).

    The sampler itself is stateless — pure function over input
    frames. Z.7 ships just the sampler + the Rule-side opt-in
    flag. Integration with AnimationController + the result-layer
    paint loop is the named Z.7a follow-up.