pub struct InverseStencilChain { /* private fields */ }Expand description
Per-level inverse maps for a multi-level refinement.
level_stencils[k] maps level-k vertices to level-(k+1) vertices, so the
inverse of level k maps a changed set in level-k space to the affected set
in level-(k+1) space. affected_outputs threads a
base-cage change set forward through every level to the final-level outputs
it touches – equivalent to inverting the composed table, but without paying
the composition cost.
The chain is topology-only: build it once when the stencils are built and reuse it across every position edit.
Implementations§
Source§impl InverseStencilChain
impl InverseStencilChain
Sourcepub fn level_count(&self) -> usize
pub fn level_count(&self) -> usize
Number of refinement levels in the chain.
Sourcepub fn affected_outputs(&self, changed_base_inputs: &[u32]) -> Vec<u32>
pub fn affected_outputs(&self, changed_base_inputs: &[u32]) -> Vec<u32>
Final-level output rows affected by changing the given base-level input (control) points, sorted ascending with duplicates removed.
With no levels the chain is the identity: the affected outputs are the changed inputs themselves.
Sourcepub fn affected_outputs_into(
&self,
changed_base_inputs: &[u32],
scratch: &mut AffectedScratch,
out: &mut Vec<u32>,
)
pub fn affected_outputs_into( &self, changed_base_inputs: &[u32], scratch: &mut AffectedScratch, out: &mut Vec<u32>, )
Like affected_outputs but writes into out
(cleared first) and reuses scratch, so a hot edit loop allocates
nothing after the scratch has warmed up. Same sorted, deduped result.
Trait Implementations§
Source§impl Clone for InverseStencilChain
impl Clone for InverseStencilChain
Source§fn clone(&self) -> InverseStencilChain
fn clone(&self) -> InverseStencilChain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InverseStencilChain
impl Debug for InverseStencilChain
Source§impl<'a> From<&'a [StencilTable]> for InverseStencilChain
impl<'a> From<&'a [StencilTable]> for InverseStencilChain
Source§fn from(level_stencils: &'a [StencilTable]) -> Self
fn from(level_stencils: &'a [StencilTable]) -> Self
Build per-level inverse maps from a refinement’s per-level stencil tables
(e.g. RefinementResult::level_stencils).