forked from StudioInfinity/dyna3
App: store assembly elements in slab
This commit is contained in:
parent
78f8ef8215
commit
d121385c18
5 changed files with 45 additions and 40 deletions
|
@ -1,5 +1,5 @@
|
|||
use nalgebra::DVector;
|
||||
use rustc_hash::FxHashMap;
|
||||
use slab::Slab;
|
||||
use sycamore::reactive::Signal;
|
||||
|
||||
#[derive(Clone, PartialEq)]
|
||||
|
@ -7,12 +7,12 @@ pub struct Element {
|
|||
pub id: String,
|
||||
pub label: String,
|
||||
pub color: [f32; 3],
|
||||
pub rep: DVector<f64>
|
||||
pub rep: DVector<f64>,
|
||||
pub key: usize
|
||||
}
|
||||
|
||||
// a complete, view-independent description of an assembly
|
||||
#[derive(Clone)]
|
||||
pub struct Assembly {
|
||||
// the order of the elements is arbitrary, and it could change at any time
|
||||
pub elements: Signal<FxHashMap<String, Element>>
|
||||
pub elements: Signal<Slab<Element>>
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue