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 determinism;
11pub(crate) mod parallel_scan;
12mod shard_classes;
13pub use parallel_scan::{build_entity_index_parallel, scan_shard, ShardRecords};
14pub use shard_classes::{
15    classify_type_name, scan_shard_classified, PREPASS_CLASS_CODE_MASK,
16    PREPASS_CLASS_FLAG_GEOMETRY_JOB, PREPASS_CLASS_FLAG_TYPE_CANDIDATE,
17    PREPASS_CLASS_INDEXED_COLOUR_MAP, PREPASS_CLASS_MATERIAL_DEF_REPR,
18    PREPASS_CLASS_MAPPED_ITEM, PREPASS_CLASS_MATERIAL_LAYER_SET, PREPASS_CLASS_NONE,
19    PREPASS_CLASS_PROJECT, PREPASS_CLASS_REL_DEFINES_BY_TYPE,
20    PREPASS_CLASS_REL_AGGREGATES, PREPASS_CLASS_REL_ASSOCIATES_MATERIAL, PREPASS_CLASS_REL_FILLS,
21    PREPASS_CLASS_REL_VOIDS, PREPASS_CLASS_SITE, PREPASS_CLASS_STYLED_ITEM,
22};
23// `determinism::diff_report` unit tests (#1549) live in this sibling
24// `_tests.rs` file, declared from here rather than inside `determinism.rs`,
25// because that module already sits exactly at its frozen
26// `module_size_ratchet` budget (`tests/module_size_allowlist.txt`); adding
27// even a `mod` declaration there would fail the "no allowlisted file grows"
28// gate. `_tests.rs` is itself exempt from that ratchet (see
29// `module_size_ratchet.rs`'s `is_exempt`).
30#[cfg(test)]
31#[path = "determinism_tests.rs"]
32mod determinism_tests;
33pub mod element;
34pub mod geometry_export;
35mod georeferencing;
36pub mod pipeline_diagnostics;
37pub mod prepass;
38mod prepass_styled;
39pub use prepass_styled::flat_styles_rgba8_from_geometry_columns;
40mod processor;
41pub(crate) mod simplify_math;
42pub mod simplify_session;
43// `simplify_session` unit tests live in a sibling `_tests.rs` file so the
44// module itself stays inside its `module_size_ratchet` budget (same pattern
45// as `determinism_tests.rs`; `_tests.rs` files are ratchet-exempt).
46#[cfg(test)]
47#[path = "simplify_session_tests.rs"]
48mod simplify_session_tests;
49pub mod stream_meta;
50pub mod style;
51mod symbolic;
52mod types;
53
54pub use geometry_export::{build_geometry_data_export, ExportedElement, GeometryDataExport};
55pub use georeferencing::{
56    extract_georeferencing, extract_georeferencing_with_index, Georeferencing,
57};
58pub use pipeline_diagnostics::{
59    PipelineDiagnostics, PipelinePhaseTimings, PIPELINE_DIAGNOSTICS_SCHEMA_VERSION,
60};
61/// Re-exported so the server can name the quality level without a direct
62/// `ifc-lite-geometry` dependency edge for one enum.
63pub use ifc_lite_geometry::TessellationQuality;
64pub use processor::{
65    convert_mesh_to_site_local, process_geometry, process_geometry_filtered,
66    process_geometry_filtered_with_quality, process_geometry_with_index,
67    process_geometry_streaming, process_geometry_streaming_filtered,
68    process_geometry_streaming_filtered_with_options, process_geometry_streaming_with_options,
69    process_geometry_streaming_with_options_and_bootstrap,
70    OpeningFilterMode, ProcessingResult, StreamingOptions,
71};
72pub use simplify_session::{simplify_element, SimplifiedElement, SimplifyRecordInput, SimplifySkip};
73pub use style::{default_color_for_type, Rgba, TRANSPARENCY_ALPHA_THRESHOLD};
74pub use symbolic::{
75    extract_symbolic_data, SymbolicCircle, SymbolicData, SymbolicFillArea, SymbolicGridAxis,
76    SymbolicPolyline, SymbolicText,
77};
78pub use types::mesh::{InstanceRecord, MeshData, RawInstanceOccurrence};
79pub use types::response::{
80    CoordinateInfo, ModelMetadata, ParseResponse, ProcessingStats,
81    QuickMetadataBootstrap, QuickMetadataEntitySummary, QuickMetadataSpatialNode,
82};