ifc_lite_geometry/construction/
reports.rs1use crate::{BoolFailure, Error};
4use ifc_lite_core::IfcType;
5
6#[derive(Debug, Clone, Default, PartialEq, Eq)]
8pub struct ConstructionReports {
9 pub curve_capped: bool,
10 pub face_refused: Vec<IfcType>,
15 pub decoder_refused_record_ids: Vec<u32>,
18}
19
20impl ConstructionReports {
21 pub(crate) fn merge(&mut self, other: Self) {
22 self.curve_capped |= other.curve_capped;
23 for ty in other.face_refused {
24 if !self.face_refused.contains(&ty) { self.face_refused.push(ty); }
25 }
26 self.decoder_refused_record_ids.extend(other.decoder_refused_record_ids);
27 self.decoder_refused_record_ids.sort_unstable();
28 self.decoder_refused_record_ids.dedup();
29 }
30}
31
32#[derive(Debug, Clone, PartialEq, Eq)]
35pub struct ConstructionDiagnostic {
36 pub source_id: u32,
37 pub failure: BoolFailure,
38}
39
40#[derive(Debug, thiserror::Error)]
42#[error("Construction execution failed at root {root_source_id:?}, item {failed_source_id:?}: {error}")]
43pub struct ConstructionExecutionError {
44 pub root_source_id: Option<u32>,
45 pub failed_source_id: Option<u32>,
46 #[source]
47 pub error: Box<Error>,
48 pub diagnostics: Vec<ConstructionDiagnostic>,
50 pub reports: ConstructionReports,
51}