Skip to main content

ifc_lite_processing/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5//! Shared IFC processing pipeline and types.
6//!
7//! This crate extracts the core processing logic so it can be used by both
8//! the HTTP server and the native FFI library.
9
10pub mod appearance;
11pub mod pdf_vector;
12pub mod determinism;
13pub(crate) mod parallel_scan;
14mod shard_classes;
15pub use parallel_scan::{
16    build_entity_index_parallel, scan_shard, scan_shard_with_refusals, ShardRecords, ShardRefusals,
17};
18pub use shard_classes::{
19    classify_type_name, scan_shard_classified, scan_shard_classified_with_refusals,
20    PREPASS_CLASS_CODE_MASK,
21    PREPASS_CLASS_FLAG_GEOMETRY_JOB, PREPASS_CLASS_FLAG_TYPE_CANDIDATE,
22    PREPASS_CLASS_INDEXED_COLOUR_MAP, PREPASS_CLASS_MATERIAL_DEF_REPR,
23    PREPASS_CLASS_MAPPED_ITEM, PREPASS_CLASS_MATERIAL_LAYER_SET, PREPASS_CLASS_NONE,
24    PREPASS_CLASS_PROJECT, PREPASS_CLASS_REL_DEFINES_BY_TYPE,
25    PREPASS_CLASS_REL_AGGREGATES, PREPASS_CLASS_REL_ASSOCIATES_MATERIAL, PREPASS_CLASS_REL_FILLS,
26    PREPASS_CLASS_REL_VOIDS, PREPASS_CLASS_SITE, PREPASS_CLASS_STYLED_ITEM,
27};
28// `determinism::diff_report` unit tests (#1549) live in this sibling
29// `_tests.rs` file, declared from here rather than inside `determinism.rs`,
30// because that module already sits exactly at its frozen
31// `module_size_ratchet` budget (`tests/module_size_allowlist.txt`); adding
32// even a `mod` declaration there would fail the "no allowlisted file grows"
33// gate. `_tests.rs` is itself exempt from that ratchet (see
34// `module_size_ratchet.rs`'s `is_exempt`).
35#[cfg(test)]
36#[path = "determinism_tests.rs"]
37mod determinism_tests;
38pub mod element;
39pub mod geometry_export;
40mod georeferencing;
41pub mod pipeline_diagnostics;
42pub mod prepass;
43mod prepass_styled;
44pub use prepass_styled::flat_styles_rgba8_from_geometry_columns;
45mod prepass_type_material;
46mod processor;
47pub(crate) mod simplify_math;
48pub mod simplify_session;
49// `simplify_session` unit tests live in a sibling `_tests.rs` file so the
50// module itself stays inside its `module_size_ratchet` budget (same pattern
51// as `determinism_tests.rs`; `_tests.rs` files are ratchet-exempt).
52#[cfg(test)]
53#[path = "simplify_session_tests.rs"]
54mod simplify_session_tests;
55pub mod stream_meta;
56pub mod style;
57mod symbolic;
58mod types;
59
60pub use geometry_export::{build_geometry_data_export, ExportedElement, GeometryDataExport};
61pub use georeferencing::{
62    extract_georeferencing, extract_georeferencing_with_index, Georeferencing,
63};
64pub use pipeline_diagnostics::{
65    PipelineDiagnostics, PipelinePhaseTimings, PIPELINE_DIAGNOSTICS_SCHEMA_VERSION,
66};
67/// Re-exported so the server can name the quality level without a direct
68/// `ifc-lite-geometry` dependency edge for one enum.
69pub use ifc_lite_geometry::TessellationQuality;
70/// The don't-bake occurrence → flat `MeshData` recovery, shared with the browser
71/// batch (`rust/wasm-bindings/src/api/gpu_meshes/instancing.rs`) so the mapping
72/// has one home rather than two clones. See its doc comment.
73pub use processor::instancing::recover_occurrences_flat;
74pub use processor::{
75    convert_mesh_to_site_local, is_quick_spatial_type_ci, process_geometry,
76    process_geometry_filtered,
77    process_geometry_filtered_with_quality, process_geometry_with_index,
78    process_geometry_streaming, process_geometry_streaming_filtered,
79    process_geometry_streaming_filtered_with_options, process_geometry_streaming_with_options,
80    process_geometry_streaming_with_options_and_bootstrap,
81    OpeningFilterMode, ProcessingResult, StreamingOptions,
82};
83pub use simplify_session::{simplify_element, SimplifiedElement, SimplifyRecordInput, SimplifySkip};
84pub use style::{default_color_for_type, Rgba, TRANSPARENCY_ALPHA_THRESHOLD};
85pub use symbolic::{
86    extract_symbolic_data, extract_symbolic_data_with_provenance, SymbolicDataWithProvenance, SymbolicCircle, SymbolicData, SymbolicFillArea, SymbolicGridAxis,
87    SymbolicPolyline, SymbolicText, SymbolicTruncation, SymbolicTruncationReason,
88};
89// `MeshTextureData` is the type of `MeshData::texture`, a public field: without
90// this re-export no consumer outside the crate can name it, so a textured
91// `MeshData` can be read but never constructed or matched.
92pub use types::mesh::{InstanceRecord, MeshData, MeshTextureData, RawInstanceOccurrence};
93pub use types::response::{
94    CoordinateInfo, ModelMetadata, ParseResponse, ProcessingStats,
95    QuickMetadataBootstrap, QuickMetadataEntitySummary, QuickMetadataSpatialNode,
96};