ifc_lite_geometry/program/
mod.rs

1// SPDX-License-Identifier: MPL-2.0
2//! Owned numerical constructors admitted by the actual selected processor, and
3//! the common item/cache/mapping controller that drives them for a reached item.
4
5pub(crate) mod constructor;
6mod boolean;
7mod execute;
8mod inner;
9// Refs #7955: first cross-crate consumer.
10// Keep the construction-only surface private until that consumer is reviewed.
11#[cfg_attr(any(not(test), not(any(all(test, any(not(target_arch = "wasm32"), feature = "wasm_source_capture")), feature = "retained-runtime"))), allow(dead_code))]
12mod retained;
13#[cfg(any(all(test, any(not(target_arch = "wasm32"), feature = "wasm_source_capture")), feature = "retained-runtime"))]
14pub(crate) use retained::bounds;
15mod inner_cache;
16mod item;
17mod layers;
18mod mapping;
19pub(crate) mod mapping_budget;
20mod opening;
21mod opening_bounds;
22mod product;
23mod styled;
24mod voids;
25pub(crate) mod openings;
26pub(crate) use boolean::BooleanMachine;
27#[cfg(test)]
28pub(crate) use inner::ProgramStage;
29pub(crate) use inner::{program_error, GeometryProgram, ProgramError};
30
31/// Opaque, owned constructor admitted by the actual selected processor instance.
32/// It contains sampled production parameters in file units, never a decoder,
33/// source callback, product placement or a finished-mesh substitute for source.
34#[derive(Debug, Clone)]
35pub struct OwnedConstructor(constructor::Constructor);
36
37impl OwnedConstructor {
38    pub(crate) fn new(value: constructor::Constructor) -> Self { Self(value) }
39
40    pub(crate) fn restore_source_reports(&self) {
41        if let constructor::Constructor::SurfaceModel(plan) = &self.0 {
42            crate::processors::diagnostic_capture::restore(&plan.source_reports());
43        }
44    }
45
46    /// Evaluate without access to IFC source or a geometry router.
47    pub fn evaluate(self) -> crate::Result<crate::Mesh> {
48        execute::construct(self)
49    }
50}
51
52#[cfg(test)]
53mod constructor_tests;
54
55/// Opaque bridge for the off-by-default retained processing executor.
56#[doc(hidden)]
57#[cfg(feature = "retained-runtime")]
58pub mod transactions;