App: store constraints

Draft listing of constraints in outline view.
This commit is contained in:
Aaron Fenyes 2024-09-22 14:05:40 -07:00
parent 147e275823
commit 050e2373a6
4 changed files with 89 additions and 51 deletions

View file

@ -1,4 +1,5 @@
use nalgebra::DVector;
use rustc_hash::FxHashSet;
use slab::Slab;
use sycamore::reactive::Signal;
@ -7,11 +8,18 @@ pub struct Element {
pub id: String,
pub label: String,
pub color: [f32; 3],
pub rep: DVector<f64>
pub rep: DVector<f64>,
pub constraints: FxHashSet<usize>
}
pub struct Constraint {
pub args: (usize, usize),
pub rep: f64
}
// a complete, view-independent description of an assembly
#[derive(Clone)]
pub struct Assembly {
pub elements: Signal<Slab<Element>>
pub elements: Signal<Slab<Element>>,
pub constraints: Signal<Slab<Constraint>>
}