forked from StudioInfinity/dyna3

When we access an element, we always have its key, either because the slab iterator yielded it along side the element or because we used it to get the element from the slab.
17 lines
No EOL
357 B
Rust
17 lines
No EOL
357 B
Rust
use nalgebra::DVector;
|
|
use slab::Slab;
|
|
use sycamore::reactive::Signal;
|
|
|
|
#[derive(Clone, PartialEq)]
|
|
pub struct Element {
|
|
pub id: String,
|
|
pub label: String,
|
|
pub color: [f32; 3],
|
|
pub rep: DVector<f64>
|
|
}
|
|
|
|
// a complete, view-independent description of an assembly
|
|
#[derive(Clone)]
|
|
pub struct Assembly {
|
|
pub elements: Signal<Slab<Element>>
|
|
} |