Add pure combined Allocation Arrange planner with exact source and geometry checks
This commit is contained in:
@@ -13,6 +13,11 @@ use oa_core::{
|
||||
};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
// The pure planner is verified before its App gesture adapter is connected.
|
||||
#[allow(dead_code)]
|
||||
#[path = "allocation_drag/arrange.rs"]
|
||||
pub mod arrange;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Destination {
|
||||
LayoutOnly,
|
||||
@@ -76,6 +81,11 @@ pub enum Refusal {
|
||||
|
||||
pub fn capture(p: &Project, diagram: Id, work: Id, placement: Id) -> Result<Scope, Refusal> {
|
||||
validate_candidate(p).map_err(|e| Refusal::InvalidCandidate(e.to_string()))?;
|
||||
capture_validated(p, diagram, work, placement)
|
||||
}
|
||||
|
||||
/// Collect work facts after the caller's single complete Project validation.
|
||||
fn capture_validated(p: &Project, diagram: Id, work: Id, placement: Id) -> Result<Scope, Refusal> {
|
||||
let d = p.diagrams.get(&diagram).ok_or(Refusal::StaleScope)?;
|
||||
let root = p.elements.get(&work).ok_or(Refusal::StaleScope)?;
|
||||
if !root.kind().is_work()
|
||||
|
||||
Reference in New Issue
Block a user