use crate::TraceRef;
use egui::Color32;
use egui_plot::MarkerShape;
#[derive(Debug, Clone)]
pub struct Marker {
pub name: String,
pub point: Option<[f64; 2]>,
pub color: Color32,
pub visible: bool,
pub show_point: bool,
pub show_hline: bool,
pub show_vline: bool,
pub shape: MarkerShape,
pub catch_trace: Option<TraceRef>,
pub scope_id: Option<usize>,
}
impl Marker {
pub fn new(name: &str, index: usize) -> Self {
Self {
name: name.to_string(),
point: None,
color: crate::data::trace_look::TraceLook::alloc_color(index),
visible: true,
show_point: true,
show_hline: false,
show_vline: true,
shape: MarkerShape::Circle,
catch_trace: None,
scope_id: None,
}
}
pub fn clear(&mut self) {
self.point = None;
self.scope_id = None;
}
pub fn is_placed(&self) -> bool {
self.point.is_some()
}
}