paiagram/
lines.rs

1use crate::{
2    intervals::StationCache,
3    units::{canvas::CanvasLength, time::TimetableTime},
4    vehicles::{
5        AdjustTimetableEntry, TimetableAdjustment,
6        entries::{TimetableEntry, VehicleSchedule},
7    },
8};
9use bevy::prelude::*;
10
11/// Displayed line type:
12/// A list of (station entity, size of the interval on canvas in mm)
13/// The first entry is the starting station, where the canvas distance is simply omitted.
14/// Each entry afterwards represents the interval from the previous station to this station.
15pub type DisplayedLineType = Vec<(Entity, f32)>;
16
17pub type RulerLineType = Vec<(Entity, TimetableTime)>;
18
19#[derive(Debug, Default)]
20pub enum ScaleMode {
21    Linear,
22    #[default]
23    Logarithmic,
24    Uniform,
25}
26
27/// An imaginary (railway) line on the canvas, consisting of multiple segments.
28#[derive(Component, Debug, Default)]
29#[require(Name)]
30pub struct DisplayedLine {
31    pub stations: Vec<(Entity, f32)>,
32    pub scale_mode: ScaleMode,
33}
34
35#[derive(Component, Debug)]
36#[require(Name)]
37pub struct RulerLine(pub RulerLineType);
38
39pub struct LinesPlugin;
40
41impl Plugin for LinesPlugin {
42    fn build(&self, app: &mut App) {}
43}