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 analytic_export;
12pub mod pdf_vector;
13pub mod determinism;
14pub(crate) mod parallel_scan;
15mod shard_classes;
16pub use parallel_scan::{
17    build_entity_index_parallel, scan_shard, scan_shard_with_refusals, ShardRecords, ShardRefusals,
18};
19pub use shard_classes::{
20    classify_type_name, scan_shard_classified, scan_shard_classified_with_refusals,
21    PREPASS_CLASS_CODE_MASK,
22    PREPASS_CLASS_FLAG_GEOMETRY_JOB, PREPASS_CLASS_FLAG_TYPE_CANDIDATE,
23    PREPASS_CLASS_INDEXED_COLOUR_MAP, PREPASS_CLASS_MATERIAL_DEF_REPR,
24    PREPASS_CLASS_MAPPED_ITEM, PREPASS_CLASS_MATERIAL_LAYER_SET, PREPASS_CLASS_NONE,
25    PREPASS_CLASS_PROJECT, PREPASS_CLASS_REL_DEFINES_BY_TYPE,
26    PREPASS_CLASS_REL_AGGREGATES, PREPASS_CLASS_REL_ASSOCIATES_MATERIAL, PREPASS_CLASS_REL_FILLS,
27    PREPASS_CLASS_REL_VOIDS, PREPASS_CLASS_SITE, PREPASS_CLASS_STYLED_ITEM,
28};
29// `determinism::diff_report` unit tests (#1549) live in this sibling
30// `_tests.rs` file, declared from here rather than inside `determinism.rs`,
31// because that module already sits exactly at its frozen
32// `module_size_ratchet` budget (`tests/module_size_allowlist.txt`); adding
33// even a `mod` declaration there would fail the "no allowlisted file grows"
34// gate. `_tests.rs` is itself exempt from that ratchet (see
35// `module_size_ratchet.rs`'s `is_exempt`).
36#[cfg(test)]
37#[path = "determinism_tests.rs"]
38mod determinism_tests;
39pub mod element;
40pub mod geometry_export;
41mod georeferencing;
42pub mod pipeline_diagnostics;
43pub mod prepass;
44mod prepass_styled;
45pub use prepass_styled::flat_styles_rgba8_from_geometry_columns;
46mod prepass_type_material;
47mod processor;
48pub(crate) mod point_pca;
49pub mod scan_proposals;
50pub mod scan_segmentation;
51pub(crate) mod simplify_math;
52pub mod simplify_session;
53// `simplify_session` unit tests live in a sibling `_tests.rs` file so the
54// module itself stays inside its `module_size_ratchet` budget (same pattern
55// as `determinism_tests.rs`; `_tests.rs` files are ratchet-exempt).
56#[cfg(test)]
57#[path = "simplify_session_tests.rs"]
58mod simplify_session_tests;
59mod mesh_frame;
60pub use mesh_frame::{MeshCoordinateSpace, MeshFrame};
61pub mod stream_meta;
62pub mod style;
63mod symbolic;
64mod types;
65
66pub use geometry_export::{
67    build_geometry_data_export, build_colored_geometry_data_export, ColoredGeometryDataExport,
68    ExportedElement, GeometryDataExport,
69};
70pub use analytic_export::{check_swept_disk, extract_analytic_quantity_sources,
71    AnalyticQuantitySources, extract_swept_disk_definitions,
72    extract_swept_disk_descriptions, extract_swept_disk_views,
73    extract_extrusion_definitions,
74    extrusion_nominal_quantities, DirectrixMetrics,
75    DirectrixSegmentMetrics, ExtrusionNominalQuantities, SweptDiskCheckError,
76    SweptDiskCheckFinding, SweptDiskCheckOptions, SweptDiskCheckReport,
77    SweptDiskDefinition, SweptDiskDefinitions, SweptDiskDescriptions,
78    SweptDiskFindingCode, SweptDiskInstance, SweptDiskNominalQuantities,
79    SweptDiskOccurrence, SweptDiskSourceContext, SweptDiskSourceKey,
80    AnalyticSourceContext, AnalyticSourceKey, ExtrusionDefinition,
81    ExtrusionDefinitions, ExtrusionInstance};
82pub use georeferencing::{
83    extract_georeferencing, extract_georeferencing_with_index, Georeferencing,
84};
85pub use pipeline_diagnostics::{
86    PipelineDiagnostics, PipelinePhaseTimings, PIPELINE_DIAGNOSTICS_SCHEMA_VERSION,
87};
88/// Re-exported so the server can name the quality level without a direct
89/// `ifc-lite-geometry` dependency edge for one enum.
90pub use ifc_lite_geometry::TessellationQuality;
91/// The don't-bake occurrence → flat `MeshData` recovery, shared with the browser
92/// batch (`rust/wasm-bindings/src/api/gpu_meshes/instancing.rs`) so the mapping
93/// has one home rather than two clones. See its doc comment.
94pub use processor::instancing::recover_occurrences_flat;
95pub use processor::{
96    convert_mesh_to_site_local, is_quick_spatial_type_ci, native_to_baked, process_geometry,
97    process_geometry_filtered,
98    process_geometry_filtered_with_quality, process_geometry_filtered_with_quality_and_ids,
99    process_geometry_with_index,
100    process_geometry_streaming, process_geometry_streaming_filtered,
101    process_geometry_streaming_filtered_with_baked_basis,
102    process_geometry_streaming_filtered_with_options, process_geometry_streaming_with_options,
103    process_geometry_streaming_with_options_and_bootstrap,
104    OpeningFilterMode, ProcessingResult, StreamingOptions,
105};
106pub use simplify_session::{simplify_element, SimplifiedElement, SimplifyRecordInput, SimplifySkip};
107pub use style::{default_color_for_type, Rgba, TRANSPARENCY_ALPHA_THRESHOLD};
108pub use symbolic::{
109    extract_symbolic_data, extract_symbolic_data_with_provenance,
110    extract_symbolic_data_with_provenance_in_frame, SymbolicDataWithProvenance, SymbolicCircle, SymbolicData, SymbolicFillArea, SymbolicGridAxis,
111    SymbolicPolyline, SymbolicText, SymbolicTruncation, SymbolicTruncationReason,
112};
113// `MeshTextureData` is the type of `MeshData::texture`, a public field: without
114// this re-export no consumer outside the crate can name it, so a textured
115// `MeshData` can be read but never constructed or matched.
116pub use types::mesh::{InstanceRecord, MeshData, MeshTextureData, RawInstanceOccurrence};
117pub use types::response::{
118    CoordinateInfo, ModelMetadata, ParseResponse, ProcessingStats,
119    QuickMetadataBootstrap, QuickMetadataEntitySummary, QuickMetadataPrunedEdge,
120    QuickMetadataPrunedEdgeKind, QuickMetadataSpatialNode,
121};