2024-09-13 00:40:34 -07:00
|
|
|
use nalgebra::DVector;
|
|
|
|
use sycamore::reactive::Signal;
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq)]
|
|
|
|
pub struct Element {
|
|
|
|
pub id: String,
|
|
|
|
pub label: String,
|
|
|
|
pub color: [f32; 3],
|
|
|
|
pub rep: DVector<f64>,
|
2024-09-16 11:29:44 -07:00
|
|
|
|
|
|
|
/* TO DO */
|
|
|
|
// does this belong in the element data?
|
|
|
|
pub selected: Signal<bool>
|
2024-09-13 00:40:34 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// a complete, view-independent description of an assembly
|
2024-09-13 15:15:55 -07:00
|
|
|
#[derive(Clone)]
|
2024-09-13 00:40:34 -07:00
|
|
|
pub struct Assembly {
|
|
|
|
// the order of the elements is arbitrary, and it could change at any time
|
|
|
|
pub elements: Signal<Vec<Element>>
|
|
|
|
}
|