forked from StudioInfinity/dyna3
App: store constraints
Draft listing of constraints in outline view.
This commit is contained in:
parent
147e275823
commit
050e2373a6
4 changed files with 89 additions and 51 deletions
|
@ -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>>
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue