radar-g/src/render/foreground/imp.rs

42 lines
1010 B
Rust

use std::cell::RefCell;
use crate::data::{Radar2dRef, RadarData2d};
use crate::painter::Coord;
use crate::render::{imp, WindowCoord};
use femtovg::Paint;
use geo_macros::Prj;
use gtk::glib;
use gtk::subclass::prelude::*;
use ndarray::Array2;
#[derive(Prj, Default)]
pub struct ForegroundConfig {
pub show_lat_lines: bool,
pub show_lon_lines: bool,
pub lat_lines: Vec<Vec<WindowCoord>>,
pub lon_lines: Vec<Vec<WindowCoord>>,
pub painter: Paint,
}
impl ForegroundConfig {
pub fn new() -> Self {
Self::default()
}
}
#[derive(Default)]
pub struct ForegroundWidget {
pub(super) config: RefCell<ForegroundConfig>,
pub(super) dim1: RefCell<Option<Array2<f64>>>,
pub(super) dim2: RefCell<Option<Array2<f64>>>,
pub(super) data: RefCell<Option<Array2<i8>>>,
}
#[glib::object_subclass]
impl ObjectSubclass for ForegroundWidget {
const NAME: &'static str = "ForegroundWidget";
type Type = super::ForegroundWidget;
}
impl ObjectImpl for ForegroundWidget {}