use super::row_format::tier_items_from_rows;
use crate::EditorTierItem;
use indicatrix::geometry::meet_solver::SolvedTier;
use indicatrix_cut_core::Design;
use indicatrix_editor::view_model::{row_format::format_angle_cell, rows};
pub(in crate::gui::editor) use indicatrix_editor::view_model::rows::manufacturability_warnings_tagged;
#[must_use]
pub(in crate::gui::editor) fn tier_items_stale_with_last_solved(
design: &Design,
n_d: f64,
last_solved: Option<&[SolvedTier]>,
dirty: &std::collections::BTreeSet<usize>,
) -> Vec<EditorTierItem> {
tier_items_from_rows(rows::tier_items_stale_with_last_solved(
design,
n_d,
last_solved,
dirty,
))
}
pub(in crate::gui::editor) fn tier_items(design: &Design, n_d: f64) -> Vec<EditorTierItem> {
tier_items_from_rows(rows::tier_items(design, n_d))
}
pub(in crate::gui::editor) fn tier_items_from_solved(
design: &Design,
solved: &[SolvedTier],
n_d: f64,
) -> Vec<EditorTierItem> {
tier_items_from_rows(rows::tier_items_from_solved(design, solved, n_d))
}
pub(in crate::gui::editor) fn apply_proposed_angles(
tiers: &mut [EditorTierItem],
changes: &[indicatrix_cut_core::AngleChange],
) {
for change in changes {
if let Some(row) = tiers.get_mut(change.index) {
row.proposed_angle = format_angle_cell(change.to_deg).into();
}
}
}