/** * IDS (Information Delivery Specification) to BCF Reporter * * Creates BCF projects from IDS validation results, generating one topic * per failing entity with failure details as comments and viewpoints that * isolate and select the failing element. * * This is a pure function with no viewer/React dependencies — it can be * used headlessly (CLI, server-side, tests) as well as from the viewer. * * Inspired by IfcOpenShell's ifctester BCF reporter, but improved: * - Groups failures per entity (not per requirement×entity) to avoid topic flood * - Uses comments for requirement details instead of cramming into title * - Isolates the failing element (defaultVisibility=false) * - Colors the failing element red * - Sets topic metadata (type, status, priority, labels) * - Configurable grouping strategies */ import type { BCFProject } from './types.js'; /** Input for the BCF reporter — structurally matches IDSValidationReport */ export interface IDSReportInput { /** IDS document title */ title: string; /** Optional IDS document description */ description?: string; /** Results per specification */ specificationResults: IDSSpecResultInput[]; } /** Specification result — structurally matches IDSSpecificationResult */ export interface IDSSpecResultInput { specification: { name: string; description?: string; }; status: 'pass' | 'fail' | 'not_applicable'; applicableCount: number; passedCount: number; failedCount: number; entityResults: IDSEntityResultInput[]; } /** Entity result — structurally matches IDSEntityResult */ export interface IDSEntityResultInput { expressId: number; modelId: string; entityType: string; entityName?: string; globalId?: string; passed: boolean; requirementResults: IDSRequirementResultInput[]; } /** Bounds for an entity — used for camera computation in viewpoints (Y-up viewer coords) */ export interface EntityBoundsInput { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; } /** Requirement result — structurally matches IDSRequirementResult */ export interface IDSRequirementResultInput { status: 'pass' | 'fail' | 'not_applicable'; facetType: string; checkedDescription: string; failureReason?: string; actualValue?: string; expectedValue?: string; } /** Options for the BCF IDS export */ export interface IDSBCFExportOptions { /** Author email for BCF topics (default: "ids-validator@ifc-lite") */ author?: string; /** Project name (default: IDS document title) */ projectName?: string; /** BCF version (default: "2.1") */ version?: '2.1' | '3.0'; /** * Topic grouping strategy: * - "per-entity": One topic per failing entity, requirements as comments (default) * - "per-specification": One topic per failing specification, entities as comments * - "per-requirement": One topic per (specification, requirement, entity) — like IfcOpenShell */ topicGrouping?: 'per-entity' | 'per-specification' | 'per-requirement'; /** Include passing entities as Info topics (default: false) */ includePassingEntities?: boolean; /** Topic type for failures (default: "Error") */ failureTopicType?: string; /** Topic type for passes (default: "Info") */ passTopicType?: string; /** Maximum topics to create — safety valve for large models (default: 1000) */ maxTopics?: number; /** ARGB hex color for failing elements in viewpoints (default: "FFFF3333" — red) */ failureColor?: string; /** * Entity bounds map for computing per-entity camera positions. * Key: "modelId:expressId", Value: bounding box in viewer Y-up coordinates. * When provided, viewpoints will include a perspective camera framing the entity. */ entityBounds?: Map; /** * Entity snapshot map for attaching screenshots to viewpoints. * Key: "modelId:expressId", Value: data URL (PNG). * When provided, viewpoints will include the snapshot image. */ entitySnapshots?: Map; } /** * Create a BCF project from IDS validation results. * * Each failing entity becomes a BCF topic with: * - Title: "{EntityType}: {EntityName}" * - Description: specification context + failure summary * - Comments: one per failed requirement with full details * - Viewpoint: entity selected, isolated, colored red * * @param report - IDS validation results * @param options - Export configuration * @returns BCF project ready for writeBCF() */ export declare function createBCFFromIDSReport(report: IDSReportInput, options?: IDSBCFExportOptions): BCFProject; //# sourceMappingURL=ids-reporter.d.ts.map