pub mod batch_queue;
pub mod material_choice;
pub mod preview;
pub mod preview_cache;
pub mod regenerate_all;
pub mod remote_backoff;
pub mod remote_dispatch;
pub mod remote_lanes_setting;
#[cfg(test)]
mod test_records;
pub mod tilt;
use indicatrix::geometry::GpuFacetPlane;
use indicatrix_vault::model::entry::FullDiagramRecord;
use std::{
collections::BTreeSet,
sync::{Mutex, PoisonError},
};
#[must_use]
pub fn record_planes_for_batch(
full: &FullDiagramRecord,
angle_table_entries: &Mutex<BTreeSet<i64>>,
) -> Option<Vec<GpuFacetPlane>> {
let resolved = crate::gui::editor::resolve_catalogue_planes(full);
if resolved.source == crate::gui::editor::CataloguePlanesSource::AngleTable {
angle_table_entries
.lock()
.unwrap_or_else(PoisonError::into_inner)
.insert(full.entry_id);
}
(!resolved.planes.is_empty()).then_some(resolved.planes)
}
#[must_use]
pub fn angle_table_count(angle_table_entries: &Mutex<BTreeSet<i64>>) -> usize {
angle_table_entries
.lock()
.unwrap_or_else(PoisonError::into_inner)
.len()
}
#[must_use]
pub fn angle_table_summary(count: usize) -> String {
if count == 0 {
String::new()
} else {
format!(", {count} from the angle table (no usable design file)")
}
}