📄 sink/src/app.rs
//! The eframe shell around [`ViewerModel`] — as thin as possible, since
//! it cannot be exercised headlessly. All UI logic lives in the model.
//!
//! eframe 0.37's [`eframe::App`] splits work across two methods: `logic`
//! runs before each pass (no painting allowed — but repaint requests
//! belong here), and `ui` receives the root [`egui::Ui`], exactly the
//! interface [`ViewerModel::ui`] already speaks.

use eframe::egui;

use crate::model::ViewerModel;

/// The kinect-view application.
pub struct KinectViewApp {
    pub model: ViewerModel,
}

impl eframe::App for KinectViewApp {
    fn logic(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
        // The pipeline renders every UI frame; keep the repaints coming.
        ctx.request_repaint();
    }

    fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
        self.model.ui(ui);
    }
}