@ifc-lite/viewer 1.27.0 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +35 -42
- package/CHANGELOG.md +74 -0
- package/dist/assets/{basketViewActivator-B3CdrLsb.js → basketViewActivator-Ce38DhXd.js} +8 -8
- package/dist/assets/{bcf-QeHK_Aud.js → bcf-Cv_O3JfD.js} +56 -56
- package/dist/assets/{decode-worker-CgM1iNSK.js → decode-worker-Cjign7Zh.js} +1 -1
- package/dist/assets/{deflate-B-d0SYQM.js → deflate-HbyMq59o.js} +1 -1
- package/dist/assets/drawing-2d-DW98umlt.js +257 -0
- package/dist/assets/e57-source-2wI9jkCA.js +1 -0
- package/dist/assets/{exporters-B4LbZFeT.js → exporters-BuD3XRzB.js} +1309 -1153
- package/dist/assets/geometry.worker-TH3fCCoY.js +1 -0
- package/dist/assets/{geotiff-CrVtDRFq.js → geotiff-B2HA8Bwm.js} +10 -10
- package/dist/assets/{ids-DjsGFN10.js → ids-DYUFMd5f.js} +952 -945
- package/dist/assets/{ifc-lite_bg-DsYUIHm3.wasm → ifc-lite_bg-BEA5DLmg.wasm} +0 -0
- package/dist/assets/index-E9wB0zWt.css +1 -0
- package/dist/assets/{index-COYokSKc.js → index-n5O1QJMM.js} +37877 -38126
- package/dist/assets/{index.es-CY202jA3.js → index.es-BKVIpZgL.js} +9 -9
- package/dist/assets/{jpeg-D4wOkf5h.js → jpeg-C7hjKjPX.js} +1 -1
- package/dist/assets/{jspdf.es.min-DIGb9BHN.js → jspdf.es.min-oWlFc42Y.js} +4 -4
- package/dist/assets/lens-C4p1kQ0p.js +1 -0
- package/dist/assets/{lerc-DmW0_tgf.js → lerc-BfIOGhQz.js} +1 -1
- package/dist/assets/{lzw-oWetY-d6.js → lzw-B0jRuuW5.js} +1 -1
- package/dist/assets/{native-bridge-BX8_tHXE.js → native-bridge-DpB-dtEn.js} +6 -3
- package/dist/assets/{packbits-F8Nkp4NY.js → packbits-DVvBTC39.js} +1 -1
- package/dist/assets/parser.worker-BDsWQ6rc.js +182 -0
- package/dist/assets/{pdf-Dsh3HPZB.js → pdf-dVIqI5ac.js} +10 -10
- package/dist/assets/raw-C0ZJYGmN.js +1 -0
- package/dist/assets/{sandbox-BAC3a-eN.js → sandbox-qpJlrNN0.js} +2962 -2554
- package/dist/assets/server-client-DVZ2huNS.js +719 -0
- package/dist/assets/{webimage-BLV1dgmd.js → webimage-B394g0Tw.js} +1 -1
- package/dist/assets/{xlsx-Bc2HTrjC.js → xlsx-D-oHO76J.js} +8 -8
- package/dist/assets/{zstd-C_1HxVrA.js → zstd-Bf38MwV2.js} +1 -1
- package/dist/index.html +9 -9
- package/package.json +24 -23
- package/src/App.tsx +1 -3
- package/src/components/mcp/playground-dispatcher.ts +3 -0
- package/src/components/mcp/playground-files.ts +33 -1
- package/src/components/viewer/BCFPanel.tsx +1 -16
- package/src/components/viewer/ChatPanel.tsx +11 -46
- package/src/components/viewer/CommandPalette.tsx +6 -1
- package/src/components/viewer/ComparePanel.tsx +420 -0
- package/src/components/viewer/HierarchyPanel.tsx +48 -183
- package/src/components/viewer/IDSPanel.tsx +1 -26
- package/src/components/viewer/MainToolbar.tsx +94 -187
- package/src/components/viewer/MobileToolbar.tsx +1 -9
- package/src/components/viewer/PropertiesPanel.tsx +98 -127
- package/src/components/viewer/ScriptPanel.tsx +8 -34
- package/src/components/viewer/Section2DPanel.tsx +32 -1
- package/src/components/viewer/ViewerLayout.tsx +5 -2
- package/src/components/viewer/Viewport.tsx +3 -0
- package/src/components/viewer/ViewportContainer.tsx +24 -42
- package/src/components/viewer/ViewportOverlays.tsx +1 -4
- package/src/components/viewer/hierarchy/HierarchyNode.tsx +3 -3
- package/src/components/viewer/hierarchy/ifc-icons.ts +9 -0
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +87 -0
- package/src/components/viewer/hierarchy/types.ts +1 -0
- package/src/components/viewer/hierarchy/useHierarchyTree.ts +6 -2
- package/src/components/viewer/properties/MaterialTotalsPanel.tsx +283 -0
- package/src/components/viewer/useGeometryStreaming.ts +0 -2
- package/src/hooks/federationLoadGate.test.ts +12 -2
- package/src/hooks/federationLoadGate.ts +9 -2
- package/src/hooks/ingest/federationAlign.ts +488 -0
- package/src/hooks/ingest/viewerModelIngest.ts +3 -212
- package/src/hooks/useCompare.ts +0 -0
- package/src/hooks/useCompareOverlay.ts +119 -0
- package/src/hooks/useDrawingGeneration.ts +234 -14
- package/src/hooks/useIfc.ts +1 -1
- package/src/hooks/useIfcCache.ts +100 -24
- package/src/hooks/useIfcFederation.ts +42 -811
- package/src/hooks/useIfcLoader.ts +349 -1517
- package/src/hooks/useIfcServer.ts +3 -0
- package/src/hooks/useLens.ts +5 -1
- package/src/hooks/useSymbolicAnnotations.ts +70 -38
- package/src/lib/compare/buildFingerprints.ts +173 -0
- package/src/lib/compare/describeChange.ts +0 -0
- package/src/lib/compare/geometricData.test.ts +54 -0
- package/src/lib/compare/geometricData.ts +37 -0
- package/src/lib/compare/overlay.test.ts +99 -0
- package/src/lib/compare/overlay.ts +91 -0
- package/src/lib/geo/cesium-placement.ts +1 -1
- package/src/lib/geo/reproject.ts +4 -1
- package/src/lib/llm/script-edit-ops.ts +23 -0
- package/src/lib/llm/stream-client.ts +8 -1
- package/src/lib/search/result-export.ts +7 -1
- package/src/sdk/adapters/export-adapter.ts +6 -1
- package/src/services/cacheService.ts +9 -25
- package/src/services/desktop-export.ts +2 -59
- package/src/services/file-dialog.ts +8 -142
- package/src/store/constants.ts +23 -0
- package/src/store/globalId.ts +15 -13
- package/src/store/index.ts +19 -6
- package/src/store/slices/cesiumSlice.ts +8 -1
- package/src/store/slices/compareSlice.ts +96 -0
- package/src/store/slices/drawing2DSlice.ts +8 -0
- package/src/store/slices/lensSlice.ts +8 -0
- package/src/store/slices/visibilitySlice.ts +22 -1
- package/src/store/types.ts +1 -71
- package/src/utils/acquireFileBuffer.test.ts +12 -4
- package/src/utils/ifcConfig.ts +0 -12
- package/src/utils/loadingUtils.ts +32 -0
- package/src/utils/spatialHierarchy.test.ts +53 -1
- package/src/utils/spatialHierarchy.ts +42 -2
- package/src/vite-env.d.ts +2 -0
- package/vite.config.ts +6 -3
- package/DESKTOP_CONTRACT_VERSION +0 -1
- package/dist/assets/drawing-2d-C71b8Ugx.js +0 -257
- package/dist/assets/e57-source-CQHxE8n3.js +0 -1
- package/dist/assets/event-B0kAzHa-.js +0 -1
- package/dist/assets/geometry.worker-BdH-E6NB.js +0 -1
- package/dist/assets/index-ajK6D32J.css +0 -1
- package/dist/assets/lens-PYsLu_MA.js +0 -1
- package/dist/assets/parser.worker-D591Zu_-.js +0 -182
- package/dist/assets/raw-D9iw0tmc.js +0 -1
- package/dist/assets/server-client-Cjwnm7il.js +0 -706
- package/dist/assets/tauri-core-stub-D8Fa-u43.js +0 -1
- package/dist/assets/tauri-dialog-stub-r7Wksg7o.js +0 -1
- package/dist/assets/tauri-fs-stub-BdeRC7aK.js +0 -1
- package/src/components/viewer/DesktopEntitlementBanner.tsx +0 -74
- package/src/components/viewer/SettingsPage.tsx +0 -581
- package/src/hooks/ingest/resolveDataStoreOrAbort.test.ts +0 -61
- package/src/hooks/ingest/resolveDataStoreOrAbort.ts +0 -28
- package/src/hooks/ingest/watchedGeometryStream.test.ts +0 -78
- package/src/hooks/ingest/watchedGeometryStream.ts +0 -76
- package/src/lib/desktop/desktopEntitlementEvents.ts +0 -39
- package/src/lib/desktop-entitlement.ts +0 -43
- package/src/lib/desktop-product.ts +0 -130
- package/src/lib/platform.ts +0 -23
- package/src/services/desktop-cache.ts +0 -186
- package/src/services/desktop-harness.ts +0 -196
- package/src/services/desktop-logger.ts +0 -20
- package/src/services/desktop-native-metadata.ts +0 -230
- package/src/services/desktop-panel-actions.ts +0 -43
- package/src/services/desktop-preferences.ts +0 -44
- package/src/services/fs-cache.ts +0 -212
- package/src/services/tauri-core-stub.ts +0 -7
- package/src/services/tauri-dialog-stub.ts +0 -7
- package/src/services/tauri-fs-stub.ts +0 -7
- package/src/services/tauri-modules.d.ts +0 -50
- package/src/store/slices/desktopEntitlementSlice.ts +0 -86
- package/src/utils/desktopModelSnapshot.ts +0 -358
- package/src/utils/nativeSpatialDataStore.ts +0 -277
- package/src-tauri/Cargo.toml +0 -29
- package/src-tauri/build.rs +0 -7
- package/src-tauri/capabilities/default.json +0 -18
- package/src-tauri/icons/128x128.png +0 -0
- package/src-tauri/icons/128x128@2x.png +0 -0
- package/src-tauri/icons/32x32.png +0 -0
- package/src-tauri/icons/Square107x107Logo.png +0 -0
- package/src-tauri/icons/Square142x142Logo.png +0 -0
- package/src-tauri/icons/Square150x150Logo.png +0 -0
- package/src-tauri/icons/Square284x284Logo.png +0 -0
- package/src-tauri/icons/Square30x30Logo.png +0 -0
- package/src-tauri/icons/Square310x310Logo.png +0 -0
- package/src-tauri/icons/Square44x44Logo.png +0 -0
- package/src-tauri/icons/Square71x71Logo.png +0 -0
- package/src-tauri/icons/Square89x89Logo.png +0 -0
- package/src-tauri/icons/StoreLogo.png +0 -0
- package/src-tauri/icons/icon.icns +0 -0
- package/src-tauri/icons/icon.ico +0 -0
- package/src-tauri/icons/icon.png +0 -0
- package/src-tauri/src/lib.rs +0 -21
- package/src-tauri/src/main.rs +0 -10
- package/src-tauri/tauri.conf.json +0 -39
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import{J as X}from"./zip-DFgP-l20.js";import{
|
|
1
|
+
import{J as X}from"./zip-DFgP-l20.js";import{ap as C}from"./sandbox-qpJlrNN0.js";async function ee(t){const e=await X.loadAsync(t),i=await tt(e),{projectId:o,name:n,extensions:s}=await et(e),a=await it(e);return{version:i.versionId,projectId:o,name:n,topics:a,extensions:s}}async function tt(t){const e=t.file("bcf.version");if(!e)throw new Error("Invalid BCF file: missing bcf.version");const o=(await e.async("string")).match(/VersionId="([^"]+)"/);if(!o)throw new Error("Invalid BCF version file: could not parse VersionId");const n=o[1];return n!=="2.1"&&n!=="3.0"&&console.warn(`Unsupported BCF version: ${n}, treating as 2.1`),{versionId:n==="3.0"?"3.0":"2.1",detailedVersion:o[1]}}async function et(t){const e=t.file("project.bcfp");if(!e)return{};const i=await e.async("string"),o=i.match(/ProjectId="([^"]+)"/),n=i.match(/<Name>([^<]+)<\/Name>/);return{projectId:o?.[1],name:n?.[1]}}async function it(t){const e=new Map,i=new Set;t.forEach(o=>{const n=o.match(/^([^/]+)\/markup\.bcf$/i);n&&i.add(n[1])});for(const o of i)try{const n=await ot(t,o);n&&e.set(n.guid,n)}catch(n){console.warn(`Failed to parse topic ${o}:`,n)}return e}async function ot(t,e){const i=t.file(`${e}/markup.bcf`);if(!i)return null;const o=await i.async("string"),n=o.match(/<Topic\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Topic>/);if(!n)return console.warn(`Invalid markup.bcf in ${e}: missing Topic element`),null;const s=n[1],a=n[2],r=o.match(/<Topic[^>]*TopicType="([^"]+)"/),c=o.match(/<Topic[^>]*TopicStatus="([^"]+)"/),l=g(a,"Title")||"Untitled",p=g(a,"Description"),f=g(a,"Priority"),m=g(a,"Index"),u=g(a,"CreationDate")||new Date().toISOString(),y=g(a,"CreationAuthor")||"Unknown",d=g(a,"ModifiedDate"),x=g(a,"ModifiedAuthor"),w=g(a,"DueDate"),b=g(a,"AssignedTo"),v=g(a,"Stage"),T=[],H=a.matchAll(/<Labels>([^<]+)<\/Labels>/g);for(const A of H)T.push(A[1]);const W=nt(a),O=st(a),I=[],J=a.matchAll(/<RelatedTopic\s+Guid="([^"]+)"/g);for(const A of J)I.push(A[1]);const K=at(o),Q=await ct(t,e,o);return{guid:s,title:l,description:p,topicType:r?.[1],topicStatus:c?.[1],priority:f,index:m?parseInt(m,10):void 0,creationDate:u,creationAuthor:y,modifiedDate:d,modifiedAuthor:x,dueDate:w,assignedTo:b,stage:v,labels:T.length>0?T:void 0,bimSnippet:W,documentReferences:O.length>0?O:void 0,relatedTopics:I.length>0?I:void 0,comments:K,viewpoints:Q}}function g(t,e){return t.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`))?.[1]}function nt(t){const e=t.match(/<BimSnippet\s+SnippetType="([^"]+)"[^>]*>([\s\S]*?)<\/BimSnippet>/);if(!e)return;const i=e[0].match(/isExternal="([^"]+)"/),o=g(e[2],"Reference"),n=g(e[2],"ReferenceSchema");return{snippetType:e[1],isExternal:i?.[1]==="true",reference:o||"",referenceSchema:n}}function st(t){const e=[],i=t.matchAll(/<DocumentReference[^>]*>([\s\S]*?)<\/DocumentReference>/g);for(const o of i){const n=o[0].match(/Guid="([^"]+)"/),s=o[0].match(/isExternal="([^"]+)"/),a=g(o[1],"ReferencedDocument"),r=g(o[1],"Description");a&&e.push({guid:n?.[1],isExternal:s?.[1]==="true",referencedDocument:a,description:r})}return e}function at(t){const e=[],i=t.matchAll(/<Comment\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Comment>/g);for(const o of i){const n=o[1],s=o[2],a=g(s,"Date")||new Date().toISOString(),r=g(s,"Author")||"Unknown",c=g(s,"Comment")||"",l=g(s,"ModifiedDate"),p=g(s,"ModifiedAuthor"),f=s.match(/<Viewpoint\s+Guid="([^"]+)"/);e.push({guid:n,date:a,author:r,comment:c,viewpointGuid:f?.[1],modifiedDate:l,modifiedAuthor:p})}return e}async function ct(t,e,i){const o=[],n=new Map,s=/<Viewpoint\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Viewpoint>/g;for(const c of i.matchAll(s)){const l=c[1],p=c[2],f=p.match(/<Viewpoint>([^<]+)<\/Viewpoint>/),m=p.match(/<Snapshot>([^<]+)<\/Snapshot>/);n.set(l,{viewpointFile:f?.[1],snapshotFile:m?.[1]})}const a=i.matchAll(/<Viewpoint\s+Guid="([^"]+)"[^>]*\/>/g);for(const c of a)n.has(c[1])||n.set(c[1],{});const r=[];t.forEach(c=>{c.startsWith(`${e}/`)&&c.endsWith(".bcfv")&&r.push(c)});for(const c of r)try{const l=t.file(c);if(!l)continue;const p=await l.async("string"),f=rt(p);if(f){const m=n.get(f.guid);let u=null,y="png";if(m?.snapshotFile){const d=`${e}/${m.snapshotFile}`;u=t.file(d),(m.snapshotFile.toLowerCase().endsWith(".jpg")||m.snapshotFile.toLowerCase().endsWith(".jpeg"))&&(y="jpeg")}if(!u){const d=c.replace(".bcfv",""),x=d.replace(/Viewpoint_/i,"Snapshot_"),w=d.replace(/_viewpoint$/i,"_snapshot"),b=[`${x}.png`,`${w}.png`,`${d}.png`,`${e}/snapshot.png`,`${x}.jpg`,`${w}.jpg`,`${d}.jpg`,`${e}/snapshot.jpg`];for(const v of b)if(u=t.file(v),u){(v.toLowerCase().endsWith(".jpg")||v.toLowerCase().endsWith(".jpeg"))&&(y="jpeg");break}}if(u){const d=await u.async("uint8array");f.snapshotData=d,f.snapshot=`data:image/${y};base64,${j(d)}`}o.push(f)}}catch(l){console.warn(`Failed to parse viewpoint ${c}:`,l)}if(o.length===0){const c=t.file(`${e}/snapshot.png`)||t.file(`${e}/snapshot.jpg`);if(c){const l=c.name.toLowerCase().endsWith(".jpg"),p=await c.async("uint8array");o.push({guid:e,snapshot:`data:image/${l?"jpeg":"png"};base64,${j(p)}`,snapshotData:p})}}return o}function rt(t){const i=t.match(/<VisualizationInfo[^>]+Guid="([^"]+)"/)?.[1]||crypto.randomUUID?.()||`vp-${Date.now()}`,o=lt(t),n=pt(t),s=ft(t),a=dt(t),r=ht(t),c=gt(t);return{guid:i,perspectiveCamera:o,orthogonalCamera:n,components:s,lines:a.length>0?a:void 0,clippingPlanes:r.length>0?r:void 0,bitmaps:c.length>0?c:void 0}}function lt(t){const e=t.match(/<PerspectiveCamera>([\s\S]*?)<\/PerspectiveCamera>/);if(!e)return;const i=e[1],o=V(i,"CameraViewPoint"),n=M(i,"CameraDirection"),s=M(i,"CameraUpVector"),a=g(i,"FieldOfView");if(!(!o||!n||!s||!a))return{cameraViewPoint:o,cameraDirection:n,cameraUpVector:s,fieldOfView:parseFloat(a)}}function pt(t){const e=t.match(/<OrthogonalCamera>([\s\S]*?)<\/OrthogonalCamera>/);if(!e)return;const i=e[1],o=V(i,"CameraViewPoint"),n=M(i,"CameraDirection"),s=M(i,"CameraUpVector"),a=g(i,"ViewToWorldScale");if(!(!o||!n||!s||!a))return{cameraViewPoint:o,cameraDirection:n,cameraUpVector:s,viewToWorldScale:parseFloat(a)}}function V(t,e){const i=t.match(new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`));if(!i)return;const o=g(i[1],"X"),n=g(i[1],"Y"),s=g(i[1],"Z");if(!(o===void 0||n===void 0||s===void 0))return{x:parseFloat(o),y:parseFloat(n),z:parseFloat(s)}}function M(t,e){return V(t,e)}function ft(t){const e=t.match(/<Components>([\s\S]*?)<\/Components>/);if(!e)return;const i=e[1],o=B(i,"Selection"),n=ut(i),s=mt(i);if(!(!o&&!n&&!s))return{selection:o?.length?o:void 0,visibility:n,coloring:s?.length?s:void 0}}function B(t,e){const i=t.match(new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`));if(!i)return;const o=[],n=i[1].matchAll(/<Component[^>]*(?:\/>|>[\s\S]*?<\/Component>)/g);for(const s of n){const a=_(s[0]);a&&o.push(a)}return o.length>0?o:void 0}function _(t){const e=t.match(/IfcGuid="([^"]+)"/),i=t.match(/AuthoringToolId="([^"]+)"/),o=t.match(/OriginatingSystem="([^"]+)"/);if(!(!e&&!i))return{ifcGuid:e?.[1],authoringToolId:i?.[1],originatingSystem:o?.[1]}}function ut(t){const e=t.match(/<Visibility[^>]*>([\s\S]*?)<\/Visibility>/);if(!e)return;const o=t.match(/DefaultVisibility="([^"]+)"/)?.[1]!=="false",n=B(e[1],"Exceptions");return{defaultVisibility:o,exceptions:n}}function mt(t){const e=t.match(/<Coloring>([\s\S]*?)<\/Coloring>/);if(!e)return;const i=[],o=e[1].matchAll(/<Color\s+Color="([^"]+)"[^>]*>([\s\S]*?)<\/Color>/g);for(const n of o){const s=n[1],a=[],r=n[2].matchAll(/<Component[^>]*(?:\/>|>[\s\S]*?<\/Component>)/g);for(const c of r){const l=_(c[0]);l&&a.push(l)}a.length>0&&i.push({color:s,components:a})}return i.length>0?i:void 0}function dt(t){const e=[],i=t.match(/<Lines>([\s\S]*?)<\/Lines>/);if(!i)return e;const o=i[1].matchAll(/<Line>([\s\S]*?)<\/Line>/g);for(const n of o){const s=V(n[1],"StartPoint"),a=V(n[1],"EndPoint");s&&a&&e.push({startPoint:s,endPoint:a})}return e}function ht(t){const e=[],i=t.match(/<ClippingPlanes>([\s\S]*?)<\/ClippingPlanes>/);if(!i)return e;const o=i[1].matchAll(/<ClippingPlane>([\s\S]*?)<\/ClippingPlane>/g);for(const n of o){const s=V(n[1],"Location"),a=M(n[1],"Direction");s&&a&&e.push({location:s,direction:a})}return e}function gt(t){const e=[],i=t.match(/<Bitmaps>([\s\S]*?)<\/Bitmaps>/);if(!i)return e;const o=i[1].matchAll(/<Bitmap>([\s\S]*?)<\/Bitmap>/g);for(const n of o){const s=g(n[1],"Format")||g(n[1],"Bitmap"),a=g(n[1],"Reference"),r=V(n[1],"Location"),c=M(n[1],"Normal"),l=M(n[1],"Up"),p=g(n[1],"Height");s&&a&&r&&c&&l&&p&&e.push({format:s.toUpperCase()==="JPG"?"JPG":"PNG",reference:a,location:r,normal:c,up:l,height:parseFloat(p)})}return e}function j(t){let e="";for(let i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return btoa(e)}async function ie(t){const e=new X;yt(e,t.version),(t.projectId||t.name)&&xt(e,t);for(const[i,o]of t.topics)await wt(e,o);return e.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}})}function yt(t,e){const i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<Version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" VersionId="${e}">
|
|
3
3
|
<DetailedVersion>${e}</DetailedVersion>
|
|
4
|
-
</Version>`;t.file("bcf.version",i)}function
|
|
5
|
-
<Name>${
|
|
4
|
+
</Version>`;t.file("bcf.version",i)}function xt(t,e){const i=e.projectId||C(),o=e.name?`
|
|
5
|
+
<Name>${h(e.name)}</Name>`:"",n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
6
6
|
<ProjectExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
7
7
|
<Project ProjectId="${i}">${o}
|
|
8
8
|
</Project>
|
|
9
|
-
</ProjectExtension>`;t.file("project.bcfp",n)}async function
|
|
9
|
+
</ProjectExtension>`;t.file("project.bcfp",n)}async function wt(t,e){const i=t.folder(e.guid);if(i){Ct(i,e);for(let o=0;o<e.viewpoints.length;o++){const n=e.viewpoints[o];await vt(i,n)}}}function Y(t){const e=t.snapshot?.match(/^data:image\/(png|jpe?g)/i);return e&&e[1].toLowerCase().startsWith("jp")?"jpg":"png"}function Ct(t,e){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
10
10
|
<Markup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
11
|
-
<Topic Guid="${e.guid}"${e.topicType?` TopicType="${
|
|
12
|
-
<Title>${
|
|
13
|
-
<Description>${
|
|
14
|
-
<Priority>${
|
|
11
|
+
<Topic Guid="${h(e.guid)}"${e.topicType?` TopicType="${h(e.topicType)}"`:""}${e.topicStatus?` TopicStatus="${h(e.topicStatus)}"`:""}>
|
|
12
|
+
<Title>${h(e.title)}</Title>`;if(e.description&&(i+=`
|
|
13
|
+
<Description>${h(e.description)}</Description>`),e.priority&&(i+=`
|
|
14
|
+
<Priority>${h(e.priority)}</Priority>`),e.index!==void 0&&(i+=`
|
|
15
15
|
<Index>${e.index}</Index>`),i+=`
|
|
16
|
-
<CreationDate>${e.creationDate}</CreationDate>`,i+=`
|
|
17
|
-
<CreationAuthor>${
|
|
18
|
-
<ModifiedDate>${e.modifiedDate}</ModifiedDate>`;const o=e.modifiedAuthor||e.creationAuthor;i+=`
|
|
19
|
-
<ModifiedAuthor>${
|
|
20
|
-
<DueDate>${e.dueDate}</DueDate>`),e.assignedTo&&(i+=`
|
|
21
|
-
<AssignedTo>${
|
|
22
|
-
<Stage>${
|
|
23
|
-
<Labels>${
|
|
24
|
-
<RelatedTopic Guid="${o}"/>`;i+=`
|
|
25
|
-
</Topic>`;for(let o=0;o<e.viewpoints.length;o++){const n=e.viewpoints[o],s=`Viewpoint_${n.guid}.bcfv`,a=`Snapshot_${n.guid}
|
|
26
|
-
<Viewpoints Guid="${n.guid}">`,i+=`
|
|
16
|
+
<CreationDate>${h(e.creationDate)}</CreationDate>`,i+=`
|
|
17
|
+
<CreationAuthor>${h(e.creationAuthor)}</CreationAuthor>`,e.modifiedDate){i+=`
|
|
18
|
+
<ModifiedDate>${h(e.modifiedDate)}</ModifiedDate>`;const o=e.modifiedAuthor||e.creationAuthor;i+=`
|
|
19
|
+
<ModifiedAuthor>${h(o)}</ModifiedAuthor>`}if(e.dueDate&&(i+=`
|
|
20
|
+
<DueDate>${h(e.dueDate)}</DueDate>`),e.assignedTo&&(i+=`
|
|
21
|
+
<AssignedTo>${h(e.assignedTo)}</AssignedTo>`),e.stage&&(i+=`
|
|
22
|
+
<Stage>${h(e.stage)}</Stage>`),e.labels&&e.labels.length>0)for(const o of e.labels)i+=`
|
|
23
|
+
<Labels>${h(o)}</Labels>`;if(e.relatedTopics&&e.relatedTopics.length>0)for(const o of e.relatedTopics)i+=`
|
|
24
|
+
<RelatedTopic Guid="${h(o)}"/>`;i+=`
|
|
25
|
+
</Topic>`;for(let o=0;o<e.viewpoints.length;o++){const n=e.viewpoints[o],s=`Viewpoint_${n.guid}.bcfv`,a=`Snapshot_${n.guid}.${Y(n)}`;i+=`
|
|
26
|
+
<Viewpoints Guid="${h(n.guid)}">`,i+=`
|
|
27
27
|
<Viewpoint>${s}</Viewpoint>`,(n.snapshot||n.snapshotData)&&(i+=`
|
|
28
28
|
<Snapshot>${a}</Snapshot>`),i+=`
|
|
29
29
|
</Viewpoints>`}for(const o of e.comments)i+=`
|
|
30
|
-
<Comment Guid="${o.guid}">`,i+=`
|
|
31
|
-
<Date>${o.date}</Date>`,i+=`
|
|
32
|
-
<Author>${
|
|
33
|
-
<Comment>${
|
|
34
|
-
<Viewpoint Guid="${o.viewpointGuid}"/>`),o.modifiedDate&&(i+=`
|
|
35
|
-
<ModifiedDate>${o.modifiedDate}</ModifiedDate>`),o.modifiedAuthor&&(i+=`
|
|
36
|
-
<ModifiedAuthor>${
|
|
30
|
+
<Comment Guid="${h(o.guid)}">`,i+=`
|
|
31
|
+
<Date>${h(o.date)}</Date>`,i+=`
|
|
32
|
+
<Author>${h(o.author)}</Author>`,i+=`
|
|
33
|
+
<Comment>${h(o.comment)}</Comment>`,o.viewpointGuid&&(i+=`
|
|
34
|
+
<Viewpoint Guid="${h(o.viewpointGuid)}"/>`),o.modifiedDate&&(i+=`
|
|
35
|
+
<ModifiedDate>${h(o.modifiedDate)}</ModifiedDate>`),o.modifiedAuthor&&(i+=`
|
|
36
|
+
<ModifiedAuthor>${h(o.modifiedAuthor)}</ModifiedAuthor>`),i+=`
|
|
37
37
|
</Comment>`;i+=`
|
|
38
|
-
</Markup>`,t.file("markup.bcf",i)}async function
|
|
39
|
-
<VisualizationInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="${e.guid}">`;if(e.components&&(s
|
|
40
|
-
<Lines>`;for(const a of e.lines)s+=
|
|
38
|
+
</Markup>`,t.file("markup.bcf",i)}async function vt(t,e,i){const o=`Viewpoint_${e.guid}.bcfv`,n=`Snapshot_${e.guid}.${Y(e)}`;let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
39
|
+
<VisualizationInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="${h(e.guid)}">`;if(e.components&&(s+=$t(e.components)),e.perspectiveCamera&&(s+=Tt(e.perspectiveCamera)),e.orthogonalCamera&&(s+=Vt(e.orthogonalCamera)),e.lines&&e.lines.length>0){s+=`
|
|
40
|
+
<Lines>`;for(const a of e.lines)s+=Mt(a);s+=`
|
|
41
41
|
</Lines>`}if(e.clippingPlanes&&e.clippingPlanes.length>0){s+=`
|
|
42
|
-
<ClippingPlanes>`;for(const a of e.clippingPlanes)s+=
|
|
42
|
+
<ClippingPlanes>`;for(const a of e.clippingPlanes)s+=Pt(a);s+=`
|
|
43
43
|
</ClippingPlanes>`}if(e.bitmaps&&e.bitmaps.length>0){s+=`
|
|
44
|
-
<Bitmaps>`;for(const a of e.bitmaps)s+=
|
|
44
|
+
<Bitmaps>`;for(const a of e.bitmaps)s+=Dt(a);s+=`
|
|
45
45
|
</Bitmaps>`}if(s+=`
|
|
46
|
-
</VisualizationInfo>`,t.file(o,s),e.snapshotData)t.file(n,e.snapshotData);else if(e.snapshot&&e.snapshot.startsWith("data:")){const a=e.snapshot.split(",")[1]
|
|
46
|
+
</VisualizationInfo>`,t.file(o,s),e.snapshotData)t.file(n,e.snapshotData);else if(e.snapshot&&e.snapshot.startsWith("data:")){const a=e.snapshot.split(",")[1];if(a)try{const r=atob(a),c=new Uint8Array(r.length);for(let l=0;l<r.length;l++)c[l]=r.charCodeAt(l);t.file(n,c)}catch(r){console.warn("[BCF] Skipping malformed snapshot data URL:",r)}}}function $t(t){let e=`
|
|
47
47
|
<Components>`;if(t.visibility?.viewSetupHints){const i=t.visibility.viewSetupHints;e+=`
|
|
48
48
|
<ViewSetupHints`,i.spacesVisible!==void 0&&(e+=` SpacesVisible="${i.spacesVisible}"`),i.spaceBoundariesVisible!==void 0&&(e+=` SpaceBoundariesVisible="${i.spaceBoundariesVisible}"`),i.openingsVisible!==void 0&&(e+=` OpeningsVisible="${i.openingsVisible}"`),e+="/>"}if(t.selection&&t.selection.length>0){e+=`
|
|
49
49
|
<Selection>`;for(const i of t.selection)e+=E(i);e+=`
|
|
50
|
-
</Selection>`}if(e
|
|
51
|
-
<Coloring>`;for(const i of t.coloring)e+=
|
|
50
|
+
</Selection>`}if(e+=St(t.visibility),t.coloring&&t.coloring.length>0){e+=`
|
|
51
|
+
<Coloring>`;for(const i of t.coloring)e+=bt(i);e+=`
|
|
52
52
|
</Coloring>`}return e+=`
|
|
53
|
-
</Components>`,e}function
|
|
53
|
+
</Components>`,e}function St(t){let i=`
|
|
54
54
|
<Visibility DefaultVisibility="${t?.defaultVisibility??!0}">`;if(t?.exceptions&&t.exceptions.length>0){i+=`
|
|
55
55
|
<Exceptions>`;for(const o of t.exceptions)i+=E(o," ");i+=`
|
|
56
56
|
</Exceptions>`}return i+=`
|
|
57
57
|
</Visibility>`,i}function E(t,e=" "){const i=t.originatingSystem||t.authoringToolId;let o=`
|
|
58
|
-
${e}<Component`;return t.ifcGuid&&(o+=` IfcGuid="${t.ifcGuid}"`),i?(o+=">",t.originatingSystem&&(o+=`
|
|
59
|
-
${e} <OriginatingSystem>${
|
|
60
|
-
${e} <AuthoringToolId>${
|
|
61
|
-
${e}</Component>`):o+="/>",o}function
|
|
62
|
-
<Color Color="${t.color}">`;for(const i of t.components)e+=E(i," ");return e+=`
|
|
63
|
-
</Color>`,e}function
|
|
58
|
+
${e}<Component`;return t.ifcGuid&&(o+=` IfcGuid="${h(t.ifcGuid)}"`),i?(o+=">",t.originatingSystem&&(o+=`
|
|
59
|
+
${e} <OriginatingSystem>${h(t.originatingSystem)}</OriginatingSystem>`),t.authoringToolId&&(o+=`
|
|
60
|
+
${e} <AuthoringToolId>${h(t.authoringToolId)}</AuthoringToolId>`),o+=`
|
|
61
|
+
${e}</Component>`):o+="/>",o}function bt(t){let e=`
|
|
62
|
+
<Color Color="${h(t.color)}">`;for(const i of t.components)e+=E(i," ");return e+=`
|
|
63
|
+
</Color>`,e}function Tt(t){return`
|
|
64
64
|
<PerspectiveCamera>
|
|
65
65
|
<CameraViewPoint>
|
|
66
66
|
<X>${t.cameraViewPoint.x}</X>
|
|
@@ -78,7 +78,7 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
78
78
|
<Z>${t.cameraUpVector.z}</Z>
|
|
79
79
|
</CameraUpVector>
|
|
80
80
|
<FieldOfView>${t.fieldOfView}</FieldOfView>
|
|
81
|
-
</PerspectiveCamera>`}function
|
|
81
|
+
</PerspectiveCamera>`}function Vt(t){return`
|
|
82
82
|
<OrthogonalCamera>
|
|
83
83
|
<CameraViewPoint>
|
|
84
84
|
<X>${t.cameraViewPoint.x}</X>
|
|
@@ -96,7 +96,7 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
96
96
|
<Z>${t.cameraUpVector.z}</Z>
|
|
97
97
|
</CameraUpVector>
|
|
98
98
|
<ViewToWorldScale>${t.viewToWorldScale}</ViewToWorldScale>
|
|
99
|
-
</OrthogonalCamera>`}function
|
|
99
|
+
</OrthogonalCamera>`}function Mt(t){return`
|
|
100
100
|
<Line>
|
|
101
101
|
<StartPoint>
|
|
102
102
|
<X>${t.startPoint.x}</X>
|
|
@@ -108,7 +108,7 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
108
108
|
<Y>${t.endPoint.y}</Y>
|
|
109
109
|
<Z>${t.endPoint.z}</Z>
|
|
110
110
|
</EndPoint>
|
|
111
|
-
</Line>`}function
|
|
111
|
+
</Line>`}function Pt(t){return`
|
|
112
112
|
<ClippingPlane>
|
|
113
113
|
<Location>
|
|
114
114
|
<X>${t.location.x}</X>
|
|
@@ -120,10 +120,10 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
120
120
|
<Y>${t.direction.y}</Y>
|
|
121
121
|
<Z>${t.direction.z}</Z>
|
|
122
122
|
</Direction>
|
|
123
|
-
</ClippingPlane>`}function
|
|
123
|
+
</ClippingPlane>`}function Dt(t){return`
|
|
124
124
|
<Bitmap>
|
|
125
125
|
<Format>${t.format}</Format>
|
|
126
|
-
<Reference>${
|
|
126
|
+
<Reference>${h(t.reference)}</Reference>
|
|
127
127
|
<Location>
|
|
128
128
|
<X>${t.location.x}</X>
|
|
129
129
|
<Y>${t.location.y}</Y>
|
|
@@ -140,7 +140,7 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
140
140
|
<Z>${t.up.z}</Z>
|
|
141
141
|
</Up>
|
|
142
142
|
<Height>${t.height}</Height>
|
|
143
|
-
</Bitmap>`}function y(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $(t){return{x:t.x,y:-t.z,z:t.y}}function S(t){return{x:t.x,y:t.z,z:-t.y}}function Dt(t){const e=$(t.position),i=$(t.target),o=$(t.up),n=i.x-e.x,s=i.y-e.y,a=i.z-e.z,r=Math.sqrt(n*n+s*s+a*a),c=r>1e-4?{x:n/r,y:s/r,z:a/r}:{x:0,y:1,z:0},l=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),p=l>1e-4?{x:o.x/l,y:o.y/l,z:o.z/l}:{x:0,y:0,z:1},f=t.fov*180/Math.PI;return{cameraViewPoint:e,cameraDirection:c,cameraUpVector:p,fieldOfView:Math.max(1,Math.min(179,f))}}function zt(t,e){const i=$(t.position),o=$(t.target),n=$(t.up),s=o.x-i.x,a=o.y-i.y,r=o.z-i.z,c=Math.sqrt(s*s+a*a+r*r),l=c>1e-4?{x:s/c,y:a/c,z:r/c}:{x:0,y:1,z:0},p=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),f=p>1e-4?{x:n.x/p,y:n.y/p,z:n.z/p}:{x:0,y:0,z:1};return{cameraViewPoint:i,cameraDirection:l,cameraUpVector:f,viewToWorldScale:e}}function It(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},o=S(t.cameraViewPoint),n=S(i),s=S(t.cameraUpVector),a=t.fieldOfView*Math.PI/180;return{position:o,target:n,up:s,fov:a,isOrthographic:!1}}function At(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},o=S(t.cameraViewPoint),n=S(i),s=S(t.cameraUpVector);return{position:o,target:n,up:s,fov:Math.PI/4,isOrthographic:!0,orthoScale:t.viewToWorldScale}}function Gt(t,e){if(!t.enabled)return null;const i=t.position/100;let o,n;switch(t.axis){case"down":o={x:(e.min.x+e.max.x)/2,y:e.min.y+i*(e.max.y-e.min.y),z:(e.min.z+e.max.z)/2},n=t.flipped?{x:0,y:1,z:0}:{x:0,y:-1,z:0};break;case"front":o={x:(e.min.x+e.max.x)/2,y:(e.min.y+e.max.y)/2,z:e.min.z+i*(e.max.z-e.min.z)},n=t.flipped?{x:0,y:0,z:1}:{x:0,y:0,z:-1};break;case"side":o={x:e.min.x+i*(e.max.x-e.min.x),y:(e.min.y+e.max.y)/2,z:(e.min.z+e.max.z)/2},n=t.flipped?{x:1,y:0,z:0}:{x:-1,y:0,z:0};break}return{location:$(o),direction:$(n)}}function kt(t,e){const i=S(t.location),o=S(t.direction),n=Math.abs(o.x),s=Math.abs(o.y),a=Math.abs(o.z);let r,c,l;if(s>=n&&s>=a){r="down";const p=e.max.y-e.min.y;c=p>0?(i.y-e.min.y)/p*100:50,l=o.y>0}else if(a>=n){r="front";const p=e.max.z-e.min.z;c=p>0?(i.z-e.min.z)/p*100:50,l=o.z>0}else{r="side";const p=e.max.x-e.min.x;c=p>0?(i.x-e.min.x)/p*100:50,l=o.x>0}return c=Math.max(0,Math.min(100,c)),{axis:r,position:c,enabled:!0,flipped:l}}function ie(t){const{camera:e,sectionPlane:i,bounds:o,snapshot:n,snapshotData:s,selectedGuids:a,hiddenGuids:r,visibleGuids:c,coloredGuids:l}=t,p={guid:C()};if(e.isOrthographic&&e.orthoScale!==void 0?p.orthogonalCamera=zt(e,e.orthoScale):p.perspectiveCamera=Dt(e),i?.enabled&&o){const d=Gt(i,o);d&&(p.clippingPlanes=[d])}n&&(p.snapshot=n),s&&(p.snapshotData=s);const f=a&&a.length>0,m=r&&r.length>0,u=c&&c.length>0,g=l&&l.length>0;return(f||m||u||g)&&(p.components={},f&&(p.components.selection=a.map(d=>({ifcGuid:d}))),u?p.components.visibility={defaultVisibility:!1,exceptions:c.map(d=>({ifcGuid:d}))}:m&&(p.components.visibility={defaultVisibility:!0,exceptions:r.map(d=>({ifcGuid:d}))}),g&&(p.components.coloring=l.map(({color:d,guids:x})=>({color:d,components:x.map(w=>({ifcGuid:w}))})))),p}function oe(t,e,i=10){let o,n;t.perspectiveCamera?o=It(t.perspectiveCamera,i):t.orthogonalCamera&&(o=At(t.orthogonalCamera,i)),t.clippingPlanes&&t.clippingPlanes.length>0&&e&&(n=kt(t.clippingPlanes[0],e));const s=[];if(t.components?.selection)for(const l of t.components.selection)l.ifcGuid&&s.push(l.ifcGuid);const a=[],r=[];if(t.components?.visibility){const{defaultVisibility:l,exceptions:p}=t.components.visibility;if(p)for(const f of p)f.ifcGuid&&(l===!1?r.push(f.ifcGuid):a.push(f.ifcGuid))}const c=[];if(t.components?.coloring)for(const l of t.components.coloring){const p=[];for(const f of l.components)f.ifcGuid&&p.push(f.ifcGuid);p.length>0&&c.push({color:l.color,guids:p})}return{camera:o,sectionPlane:n,selectedGuids:s,hiddenGuids:a,visibleGuids:r,coloredGuids:c}}function k(t){return{x:t.x,y:t.z,z:-t.y}}function Lt(t,e){const i=t.perspectiveCamera??t.orthogonalCamera;if(!i)return null;const o=k(i.cameraViewPoint),n=k(i.cameraDirection),s=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z);if(s<1e-6)return null;const a=n.x/s,r=n.y/s,c=n.z/s;return{x:o.x+a*e,y:o.y+r*e,z:o.z+c*e}}function j(t){const e=(t.min.x+t.max.x)/2,i=(t.min.z+t.max.z)/2,o=t.max.y,n=t.max.y-t.min.y,s=Math.max(n*.3,.5);return{position:{x:e,y:o+s,z:i},connectorAnchor:{x:e,y:o,z:i}}}function Et(t,e,i){const o=t.components?.selection;if(o&&o.length>0)for(const r of o){if(!r.ifcGuid)continue;const c=e(r.ifcGuid);if(c)return{...j(c),source:"component"}}const n=t.components?.visibility;if(n&&!n.defaultVisibility&&n.exceptions&&n.exceptions.length>0)for(const r of n.exceptions){if(!r.ifcGuid)continue;const c=e(r.ifcGuid);if(c)return{...j(c),source:"component"}}const s=Lt(t,i);if(s)return{position:s,source:"camera-target"};const a=t.perspectiveCamera??t.orthogonalCamera;return a?{position:k(a.cameraViewPoint),source:"camera-position"}:null}function ne(t,e,i){const{targetDistance:o=50,statusFilter:n}=i??{},s=[];for(let a=0;a<t.length;a++){const r=t[a];if(n&&n.length>0){const p=(r.topicStatus??"").toLowerCase();if(!n.some(f=>f.toLowerCase()===p))continue}let c=null;for(const p of r.viewpoints)if(c=Et(p,e,o),c)break;if(!c)continue;const l=r.viewpoints[0];s.push({topicGuid:r.guid,position:c.position,connectorAnchor:c.connectorAnchor,title:r.title,status:r.topicStatus??"Open",priority:r.priority??"Normal",topicType:r.topicType??"Issue",commentCount:r.comments.length,hasViewpoint:r.viewpoints.length>0,snapshot:l?.snapshot,positionSource:c.source,index:r.index??a+1})}return s}const G="bcf-overlay-marker",R="bcf-overlay-connector",P="bcf-overlay-active",D="bcf-overlay-tooltip",Ft={open:"#f7768e","in progress":"#e0af68",resolved:"#9ece6a",closed:"#565f89"},Ot={open:"●","in progress":"◐",resolved:"✓",closed:"○"};class L{container;svgLayer;markerElements=new Map;connectorElements=new Map;markers=[];activeMarkerId=null;projection;unsubCamera=null;clickCallbacks=[];hoverCallbacks=[];opts;_visible=!0;_disposed=!1;constructor(e,i,o){this.projection=i,this.opts={showConnectors:o?.showConnectors??!0,showTooltips:o?.showTooltips??!0,minScale:o?.minScale??.65,maxScale:o?.maxScale??1,verticalOffset:o?.verticalOffset??36},this.container=document.createElement("div"),this.container.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:20;",e.appendChild(this.container),this.svgLayer=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svgLayer.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;",this.container.appendChild(this.svgLayer),this.injectStyles(),this.unsubCamera=i.onCameraChange(()=>this.updatePositions())}setMarkers(e){this.markers=e;const i=new Set(e.map(o=>o.topicGuid));for(const[o,n]of this.markerElements)i.has(o)||(n.remove(),this.markerElements.delete(o));for(const[o,n]of this.connectorElements)i.has(o)||(n.remove(),this.connectorElements.delete(o));for(const o of e)this.markerElements.has(o.topicGuid)?this.updateMarkerContent(o):this.createMarkerElement(o);this.updatePositions()}setActiveMarker(e){if(this.activeMarkerId){const i=this.markerElements.get(this.activeMarkerId);i&&i.classList.remove(P)}if(this.activeMarkerId=e,e){const i=this.markerElements.get(e);i&&i.classList.add(P)}}setVisible(e){this._visible=e,this.container.style.display=e?"":"none"}onMarkerClick(e){return this.clickCallbacks.push(e),()=>{this.clickCallbacks=this.clickCallbacks.filter(i=>i!==e)}}onMarkerHover(e){return this.hoverCallbacks.push(e),()=>{this.hoverCallbacks=this.hoverCallbacks.filter(i=>i!==e)}}updatePositions(){if(this._disposed||!this._visible)return;const{width:e,height:i}=this.projection.getCanvasSize();if(e===0||i===0)return;const o=this.projection.getCameraPosition?.();for(const n of this.markers){const s=this.markerElements.get(n.topicGuid);if(!s)continue;const a=this.projection.projectToScreen(n.position);if(!a||a.x<-80||a.y<-80||a.x>e+80||a.y>i+80){s.style.display="none";const f=this.connectorElements.get(n.topicGuid);f&&(f.style.display="none");continue}s.style.display="";let r=1;if(o){const f=n.position.x-o.x,m=n.position.y-o.y,u=n.position.z-o.z,g=Math.sqrt(f*f+m*m+u*u),d=Math.max(0,Math.min(1,(g-20)/180));r=this.opts.maxScale+d*(this.opts.minScale-this.opts.maxScale)}const c=a.x,l=a.y;s.style.transform=`translate(${c}px, ${l}px) translate(-50%, -100%) scale(${r.toFixed(3)})`;const p=o?.6+(1-Math.max(0,Math.min(1,(Math.sqrt((n.position.x-o.x)**2+(n.position.y-o.y)**2+(n.position.z-o.z)**2)-20)/250)))*.4:1;if(s.style.opacity=p.toFixed(2),this.opts.showConnectors){const f=n.connectorAnchor??n.position,m=this.projection.projectToScreen(f);let u=this.connectorElements.get(n.topicGuid);if(u||(u=document.createElementNS("http://www.w3.org/2000/svg","line"),u.classList.add(R),this.svgLayer.appendChild(u),this.connectorElements.set(n.topicGuid,u)),!m){u.style.display="none";continue}u.style.display="";const g=this.getStatusColor(n.status);u.setAttribute("x1",String(c)),u.setAttribute("y1",String(l)),u.setAttribute("x2",String(m.x)),u.setAttribute("y2",String(m.y)),u.setAttribute("stroke",g),u.setAttribute("stroke-width","1.5"),u.setAttribute("stroke-dasharray","3 2"),u.setAttribute("stroke-opacity",String((p*.5).toFixed(2)))}}}dispose(){this._disposed=!0,this.unsubCamera&&this.unsubCamera(),this.container.remove(),this.markerElements.clear(),this.connectorElements.clear(),this.clickCallbacks=[],this.hoverCallbacks=[]}createMarkerElement(e){const i=document.createElement("div");i.className=G,i.dataset.topicGuid=e.topicGuid,this.updateMarkerInnerHTML(i,e),i.addEventListener("click",o=>{o.stopPropagation();for(const n of this.clickCallbacks)n(e.topicGuid)}),i.addEventListener("mouseenter",()=>{for(const n of this.hoverCallbacks)n(e.topicGuid);const o=i.querySelector(`.${D}`);o&&(o.style.display="")}),i.addEventListener("mouseleave",()=>{for(const n of this.hoverCallbacks)n(null);const o=i.querySelector(`.${D}`);o&&(o.style.display="none")}),e.topicGuid===this.activeMarkerId&&i.classList.add(P),this.container.appendChild(i),this.markerElements.set(e.topicGuid,i)}updateMarkerContent(e){const i=this.markerElements.get(e.topicGuid);i&&(this.updateMarkerInnerHTML(i,e),e.topicGuid===this.activeMarkerId?i.classList.add(P):i.classList.remove(P))}updateMarkerInnerHTML(e,i){const o=this.getStatusColor(i.status),n=Ot[i.status.toLowerCase()]??"●",s=i.priority?` · ${i.priority}`:"";e.innerHTML=`
|
|
143
|
+
</Bitmap>`}function h(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $(t){return{x:t.x,y:-t.z,z:t.y}}function S(t){return{x:t.x,y:t.z,z:-t.y}}function zt(t){const e=$(t.position),i=$(t.target),o=$(t.up),n=i.x-e.x,s=i.y-e.y,a=i.z-e.z,r=Math.sqrt(n*n+s*s+a*a),c=r>1e-4?{x:n/r,y:s/r,z:a/r}:{x:0,y:1,z:0},l=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),p=l>1e-4?{x:o.x/l,y:o.y/l,z:o.z/l}:{x:0,y:0,z:1},f=t.fov*180/Math.PI;return{cameraViewPoint:e,cameraDirection:c,cameraUpVector:p,fieldOfView:Math.max(1,Math.min(179,f))}}function It(t,e){const i=$(t.position),o=$(t.target),n=$(t.up),s=o.x-i.x,a=o.y-i.y,r=o.z-i.z,c=Math.sqrt(s*s+a*a+r*r),l=c>1e-4?{x:s/c,y:a/c,z:r/c}:{x:0,y:1,z:0},p=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),f=p>1e-4?{x:n.x/p,y:n.y/p,z:n.z/p}:{x:0,y:0,z:1};return{cameraViewPoint:i,cameraDirection:l,cameraUpVector:f,viewToWorldScale:e}}function At(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},o=S(t.cameraViewPoint),n=S(i),s=S(t.cameraUpVector),a=t.fieldOfView*Math.PI/180;return{position:o,target:n,up:s,fov:a,isOrthographic:!1}}function Lt(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},o=S(t.cameraViewPoint),n=S(i),s=S(t.cameraUpVector);return{position:o,target:n,up:s,fov:Math.PI/4,isOrthographic:!0,orthoScale:t.viewToWorldScale}}function kt(t,e){if(!t.enabled)return null;const i=t.position/100;let o,n;switch(t.axis){case"down":o={x:(e.min.x+e.max.x)/2,y:e.min.y+i*(e.max.y-e.min.y),z:(e.min.z+e.max.z)/2},n=t.flipped?{x:0,y:1,z:0}:{x:0,y:-1,z:0};break;case"front":o={x:(e.min.x+e.max.x)/2,y:(e.min.y+e.max.y)/2,z:e.min.z+i*(e.max.z-e.min.z)},n=t.flipped?{x:0,y:0,z:1}:{x:0,y:0,z:-1};break;case"side":o={x:e.min.x+i*(e.max.x-e.min.x),y:(e.min.y+e.max.y)/2,z:(e.min.z+e.max.z)/2},n=t.flipped?{x:1,y:0,z:0}:{x:-1,y:0,z:0};break}return{location:$(o),direction:$(n)}}function Gt(t,e){const i=S(t.location),o=S(t.direction),n=Math.abs(o.x),s=Math.abs(o.y),a=Math.abs(o.z);let r,c,l;if(s>=n&&s>=a){r="down";const p=e.max.y-e.min.y;c=p>0?(i.y-e.min.y)/p*100:50,l=o.y>0}else if(a>=n){r="front";const p=e.max.z-e.min.z;c=p>0?(i.z-e.min.z)/p*100:50,l=o.z>0}else{r="side";const p=e.max.x-e.min.x;c=p>0?(i.x-e.min.x)/p*100:50,l=o.x>0}return c=Math.max(0,Math.min(100,c)),{axis:r,position:c,enabled:!0,flipped:l}}function oe(t){const{camera:e,sectionPlane:i,bounds:o,snapshot:n,snapshotData:s,selectedGuids:a,hiddenGuids:r,visibleGuids:c,coloredGuids:l}=t,p={guid:C()};if(e.isOrthographic&&e.orthoScale!==void 0?p.orthogonalCamera=It(e,e.orthoScale):p.perspectiveCamera=zt(e),i?.enabled&&o){const d=kt(i,o);d&&(p.clippingPlanes=[d])}n&&(p.snapshot=n),s&&(p.snapshotData=s);const f=a&&a.length>0,m=r&&r.length>0,u=c&&c.length>0,y=l&&l.length>0;return(f||m||u||y)&&(p.components={},f&&(p.components.selection=a.map(d=>({ifcGuid:d}))),u?p.components.visibility={defaultVisibility:!1,exceptions:c.map(d=>({ifcGuid:d}))}:m&&(p.components.visibility={defaultVisibility:!0,exceptions:r.map(d=>({ifcGuid:d}))}),y&&(p.components.coloring=l.map(({color:d,guids:x})=>({color:d,components:x.map(w=>({ifcGuid:w}))})))),p}function ne(t,e,i=10){let o,n;t.perspectiveCamera?o=At(t.perspectiveCamera,i):t.orthogonalCamera&&(o=Lt(t.orthogonalCamera,i)),t.clippingPlanes&&t.clippingPlanes.length>0&&e&&(n=Gt(t.clippingPlanes[0],e));const s=[];if(t.components?.selection)for(const l of t.components.selection)l.ifcGuid&&s.push(l.ifcGuid);const a=[],r=[];if(t.components?.visibility){const{defaultVisibility:l,exceptions:p}=t.components.visibility;if(p)for(const f of p)f.ifcGuid&&(l===!1?r.push(f.ifcGuid):a.push(f.ifcGuid))}const c=[];if(t.components?.coloring)for(const l of t.components.coloring){const p=[];for(const f of l.components)f.ifcGuid&&p.push(f.ifcGuid);p.length>0&&c.push({color:l.color,guids:p})}return{camera:o,sectionPlane:n,selectedGuids:s,hiddenGuids:a,visibleGuids:r,coloredGuids:c}}function k(t){return{x:t.x,y:t.z,z:-t.y}}function Et(t,e){const i=t.perspectiveCamera??t.orthogonalCamera;if(!i)return null;const o=k(i.cameraViewPoint),n=k(i.cameraDirection),s=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z);if(s<1e-6)return null;const a=n.x/s,r=n.y/s,c=n.z/s;return{x:o.x+a*e,y:o.y+r*e,z:o.z+c*e}}function U(t){const e=(t.min.x+t.max.x)/2,i=(t.min.z+t.max.z)/2,o=t.max.y,n=t.max.y-t.min.y,s=Math.max(n*.3,.5);return{position:{x:e,y:o+s,z:i},connectorAnchor:{x:e,y:o,z:i}}}function Ft(t,e,i){const o=t.components?.selection;if(o&&o.length>0)for(const r of o){if(!r.ifcGuid)continue;const c=e(r.ifcGuid);if(c)return{...U(c),source:"component"}}const n=t.components?.visibility;if(n&&!n.defaultVisibility&&n.exceptions&&n.exceptions.length>0)for(const r of n.exceptions){if(!r.ifcGuid)continue;const c=e(r.ifcGuid);if(c)return{...U(c),source:"component"}}const s=Et(t,i);if(s)return{position:s,source:"camera-target"};const a=t.perspectiveCamera??t.orthogonalCamera;return a?{position:k(a.cameraViewPoint),source:"camera-position"}:null}function se(t,e,i){const{targetDistance:o=50,statusFilter:n}=i??{},s=[];for(let a=0;a<t.length;a++){const r=t[a];if(n&&n.length>0){const p=(r.topicStatus??"").toLowerCase();if(!n.some(f=>f.toLowerCase()===p))continue}let c=null;for(const p of r.viewpoints)if(c=Ft(p,e,o),c)break;if(!c)continue;const l=r.viewpoints[0];s.push({topicGuid:r.guid,position:c.position,connectorAnchor:c.connectorAnchor,title:r.title,status:r.topicStatus??"Open",priority:r.priority??"Normal",topicType:r.topicType??"Issue",commentCount:r.comments.length,hasViewpoint:r.viewpoints.length>0,snapshot:l?.snapshot,positionSource:c.source,index:r.index??a+1})}return s}const L="bcf-overlay-marker",R="bcf-overlay-connector",P="bcf-overlay-active",D="bcf-overlay-tooltip",Ot={open:"#f7768e","in progress":"#e0af68",resolved:"#9ece6a",closed:"#565f89"},jt={open:"●","in progress":"◐",resolved:"✓",closed:"○"};class G{container;svgLayer;markerElements=new Map;connectorElements=new Map;markers=[];activeMarkerId=null;projection;unsubCamera=null;clickCallbacks=[];hoverCallbacks=[];opts;_visible=!0;_disposed=!1;constructor(e,i,o){this.projection=i,this.opts={showConnectors:o?.showConnectors??!0,showTooltips:o?.showTooltips??!0,minScale:o?.minScale??.65,maxScale:o?.maxScale??1,verticalOffset:o?.verticalOffset??36},this.container=document.createElement("div"),this.container.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:20;",e.appendChild(this.container),this.svgLayer=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svgLayer.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;",this.container.appendChild(this.svgLayer),this.injectStyles(),this.unsubCamera=i.onCameraChange(()=>this.updatePositions())}setMarkers(e){this.markers=e;const i=new Set(e.map(o=>o.topicGuid));for(const[o,n]of this.markerElements)i.has(o)||(n.remove(),this.markerElements.delete(o));for(const[o,n]of this.connectorElements)i.has(o)||(n.remove(),this.connectorElements.delete(o));for(const o of e)this.markerElements.has(o.topicGuid)?this.updateMarkerContent(o):this.createMarkerElement(o);this.updatePositions()}setActiveMarker(e){if(this.activeMarkerId){const i=this.markerElements.get(this.activeMarkerId);i&&i.classList.remove(P)}if(this.activeMarkerId=e,e){const i=this.markerElements.get(e);i&&i.classList.add(P)}}setVisible(e){this._visible=e,this.container.style.display=e?"":"none"}onMarkerClick(e){return this.clickCallbacks.push(e),()=>{this.clickCallbacks=this.clickCallbacks.filter(i=>i!==e)}}onMarkerHover(e){return this.hoverCallbacks.push(e),()=>{this.hoverCallbacks=this.hoverCallbacks.filter(i=>i!==e)}}updatePositions(){if(this._disposed||!this._visible)return;const{width:e,height:i}=this.projection.getCanvasSize();if(e===0||i===0)return;const o=this.projection.getCameraPosition?.();for(const n of this.markers){const s=this.markerElements.get(n.topicGuid);if(!s)continue;const a=this.projection.projectToScreen(n.position);if(!a||a.x<-80||a.y<-80||a.x>e+80||a.y>i+80){s.style.display="none";const f=this.connectorElements.get(n.topicGuid);f&&(f.style.display="none");continue}s.style.display="";let r=1;if(o){const f=n.position.x-o.x,m=n.position.y-o.y,u=n.position.z-o.z,y=Math.sqrt(f*f+m*m+u*u),d=Math.max(0,Math.min(1,(y-20)/180));r=this.opts.maxScale+d*(this.opts.minScale-this.opts.maxScale)}const c=a.x,l=a.y;s.style.transform=`translate(${c}px, ${l}px) translate(-50%, -100%) scale(${r.toFixed(3)})`;const p=o?.6+(1-Math.max(0,Math.min(1,(Math.sqrt((n.position.x-o.x)**2+(n.position.y-o.y)**2+(n.position.z-o.z)**2)-20)/250)))*.4:1;if(s.style.opacity=p.toFixed(2),this.opts.showConnectors){const f=n.connectorAnchor??n.position,m=this.projection.projectToScreen(f);let u=this.connectorElements.get(n.topicGuid);if(u||(u=document.createElementNS("http://www.w3.org/2000/svg","line"),u.classList.add(R),this.svgLayer.appendChild(u),this.connectorElements.set(n.topicGuid,u)),!m){u.style.display="none";continue}u.style.display="";const y=this.getStatusColor(n.status);u.setAttribute("x1",String(c)),u.setAttribute("y1",String(l)),u.setAttribute("x2",String(m.x)),u.setAttribute("y2",String(m.y)),u.setAttribute("stroke",y),u.setAttribute("stroke-width","1.5"),u.setAttribute("stroke-dasharray","3 2"),u.setAttribute("stroke-opacity",String((p*.5).toFixed(2)))}}}dispose(){this._disposed=!0,this.unsubCamera&&this.unsubCamera(),this.container.remove(),this.markerElements.clear(),this.connectorElements.clear(),this.clickCallbacks=[],this.hoverCallbacks=[]}createMarkerElement(e){const i=document.createElement("div");i.className=L,i.dataset.topicGuid=e.topicGuid,this.updateMarkerInnerHTML(i,e),i.addEventListener("click",o=>{o.stopPropagation();for(const n of this.clickCallbacks)n(e.topicGuid)}),i.addEventListener("mouseenter",()=>{for(const n of this.hoverCallbacks)n(e.topicGuid);const o=i.querySelector(`.${D}`);o&&(o.style.display="")}),i.addEventListener("mouseleave",()=>{for(const n of this.hoverCallbacks)n(null);const o=i.querySelector(`.${D}`);o&&(o.style.display="none")}),e.topicGuid===this.activeMarkerId&&i.classList.add(P),this.container.appendChild(i),this.markerElements.set(e.topicGuid,i)}updateMarkerContent(e){const i=this.markerElements.get(e.topicGuid);i&&(this.updateMarkerInnerHTML(i,e),e.topicGuid===this.activeMarkerId?i.classList.add(P):i.classList.remove(P))}updateMarkerInnerHTML(e,i){const o=this.getStatusColor(i.status),n=jt[i.status.toLowerCase()]??"●",s=i.priority?` · ${i.priority}`:"";e.innerHTML=`
|
|
144
144
|
<div class="bcf-marker-pin" style="--marker-color:${o};">
|
|
145
145
|
<span class="bcf-marker-index">${i.index}</span>
|
|
146
146
|
</div>
|
|
@@ -153,10 +153,10 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
153
153
|
${this.escapeHtml(i.status)}${s}${i.commentCount>0?` · ${i.commentCount} comment${i.commentCount!==1?"s":""}`:""}
|
|
154
154
|
</div>
|
|
155
155
|
</div>
|
|
156
|
-
`}getStatusColor(e){return
|
|
156
|
+
`}getStatusColor(e){return Ot[e.toLowerCase()]??"#7aa2f7"}escapeHtml(e){const i=document.createElement("div");return i.textContent=e,i.innerHTML}static stylesInjected=!1;injectStyles(){if(G.stylesInjected)return;G.stylesInjected=!0;const e=document.createElement("style");e.textContent=`
|
|
157
157
|
/* BCF 3D Overlay Markers */
|
|
158
158
|
|
|
159
|
-
.${
|
|
159
|
+
.${L} {
|
|
160
160
|
position: absolute;
|
|
161
161
|
left: 0;
|
|
162
162
|
top: 0;
|
|
@@ -182,7 +182,7 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
182
182
|
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
.${
|
|
185
|
+
.${L}:hover .bcf-marker-pin {
|
|
186
186
|
transform: rotate(-45deg) scale(1.2);
|
|
187
187
|
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
|
|
188
188
|
}
|
|
@@ -270,12 +270,12 @@ ${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
|
270
270
|
0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker-color, #7aa2f7) 35%, transparent), 0 4px 16px rgba(0,0,0,0.4); }
|
|
271
271
|
50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--marker-color, #7aa2f7) 10%, transparent), 0 4px 16px rgba(0,0,0,0.4); }
|
|
272
272
|
}
|
|
273
|
-
`,document.head.appendChild(e)}}function Ut(t,e){return{version:e,projectId:C(),name:t,topics:new Map}}function F(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,labels:t.labels,comments:[],viewpoints:[]}}function z(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}const
|
|
274
|
-
${
|
|
273
|
+
`,document.head.appendChild(e)}}function Ut(t,e){return{version:e,projectId:C(),name:t,topics:new Map}}function F(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,labels:t.labels,comments:[],viewpoints:[]}}function z(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}const Rt="ids-validator@ifc-lite",Xt=1e3,Bt="FFFF3333",_t="Error",Z="Info",Yt=50;function ae(t,e={}){const{author:i=Rt,projectName:o,version:n="2.1",topicGrouping:s="per-entity",includePassingEntities:a=!1,failureTopicType:r=_t,passTopicType:c=Z,maxTopics:l=Xt,failureColor:p=Bt,entityBounds:f,entitySnapshots:m}=e,u=Ut(o??t.title,n);switch(s){case"per-entity":Zt(u,t,{author:i,includePassingEntities:a,failureTopicType:r,passTopicType:c,maxTopics:l,failureColor:p,entityBounds:f,entitySnapshots:m});break;case"per-specification":Nt(u,t,{author:i,failureTopicType:r,maxTopics:l,failureColor:p});break;case"per-requirement":qt(u,t,{author:i,failureTopicType:r,maxTopics:l,failureColor:p,entityBounds:f,entitySnapshots:m});break}return u}function Zt(t,e,i){let o=0;for(const n of e.specificationResults)if(n.status!=="not_applicable")for(const s of n.entityResults){if(o>=i.maxTopics)return;if(s.passed&&!i.includePassingEntities)continue;const a=s.requirementResults.filter(m=>m.status==="fail"),r=s.requirementResults.filter(m=>m.status!=="not_applicable").length,c=s.entityName||`#${s.expressId}`,l=!s.passed,p=F({title:`${s.entityType}: ${c}`,description:Ht(n,s,a.length,r),author:i.author,topicType:l?i.failureTopicType:i.passTopicType??Z,topicStatus:l?"Open":"Closed",priority:l?a.length===r?"High":"Medium":void 0,labels:["IDS",n.specification.name]});let f;if(s.globalId){const m=`${s.modelId}:${s.expressId}`,u=i.entityBounds?.get(m),y=i.entitySnapshots?.get(m),d=q(s.globalId,l?i.failureColor:void 0,u,y);p.viewpoints.push(d),f=d.guid}for(const m of a){const u=z({author:i.author,comment:N(m),viewpointGuid:f});p.comments.push(u)}t.topics.set(p.guid,p),o++}}function Nt(t,e,i){let o=0;for(const n of e.specificationResults){if(n.status!=="fail")continue;if(o>=i.maxTopics)return;const s=n.entityResults.filter(f=>!f.passed),a=F({title:`[FAIL] ${n.specification.name}`,description:Wt(n),author:i.author,topicType:i.failureTopicType,topicStatus:"Open",priority:n.failedCount>n.passedCount?"High":"Medium",labels:["IDS",n.specification.name]}),r=s.map(f=>f.globalId).filter(f=>f!==void 0);let c;if(r.length>0){const f=Kt(r,i.failureColor);a.viewpoints.push(f),c=f.guid}const l=Yt,p=s.slice(0,l);for(const f of p){const m=f.entityName||`#${f.expressId}`,y=f.requirementResults.filter(x=>x.status==="fail").map(x=>x.failureReason??x.checkedDescription).join("; "),d=z({author:i.author,comment:`${f.entityType}: ${m}${f.globalId?` (${f.globalId})`:""}
|
|
274
|
+
${y}`,viewpointGuid:c});a.comments.push(d)}if(s.length>l){const f=z({author:i.author,comment:`... and ${s.length-l} more failing entities`});a.comments.push(f)}t.topics.set(a.guid,a),o++}}function qt(t,e,i){let o=0;for(const n of e.specificationResults)if(n.status==="fail"){for(const s of n.entityResults)if(!s.passed)for(const a of s.requirementResults){if(a.status!=="fail")continue;if(o>=i.maxTopics)return;const r=s.entityName||`#${s.expressId}`,c=F({title:`${s.entityType}: ${r} - ${a.failureReason??a.checkedDescription}`,description:`Specification: ${n.specification.name}
|
|
275
275
|
${n.specification.description??""}
|
|
276
276
|
|
|
277
277
|
Requirement: ${a.checkedDescription}${s.globalId?`
|
|
278
|
-
GlobalId: ${s.globalId}`:""}`,author:i.author,topicType:i.failureTopicType,topicStatus:"Open",labels:["IDS",n.specification.name]});let l;if(s.globalId){const f=`${s.modelId}:${s.expressId}`,m=i.entityBounds?.get(f),u=i.entitySnapshots?.get(f),
|
|
279
|
-
`)}function
|
|
280
|
-
`)}function
|
|
281
|
-
`)}function
|
|
278
|
+
GlobalId: ${s.globalId}`:""}`,author:i.author,topicType:i.failureTopicType,topicStatus:"Open",labels:["IDS",n.specification.name]});let l;if(s.globalId){const f=`${s.modelId}:${s.expressId}`,m=i.entityBounds?.get(f),u=i.entitySnapshots?.get(f),y=q(s.globalId,i.failureColor,m,u);c.viewpoints.push(y),l=y.guid}const p=z({author:i.author,comment:N(a),viewpointGuid:l});c.comments.push(p),t.topics.set(c.guid,c),o++}}}function Ht(t,e,i,o){const n=[];return e.passed?n.push("IDS Validation Passed — all requirements satisfied"):n.push(`IDS Validation Failure — ${i} of ${o} requirements failed`),n.push(""),n.push(`Specification: ${t.specification.name}`),t.specification.description&&n.push(`Description: ${t.specification.description}`),n.push(`Entity Type: ${e.entityType}`),e.globalId&&n.push(`GlobalId: ${e.globalId}`),e.entityName&&n.push(`Name: ${e.entityName}`),n.join(`
|
|
279
|
+
`)}function Wt(t){const e=[];return e.push(`IDS Specification Failure — ${t.failedCount} of ${t.applicableCount} entities failed`),t.specification.description&&(e.push(""),e.push(t.specification.description)),e.push(""),e.push(`Applicable: ${t.applicableCount}`),e.push(`Passed: ${t.passedCount}`),e.push(`Failed: ${t.failedCount}`),e.join(`
|
|
280
|
+
`)}function N(t){const e=[];return e.push(`[${t.facetType}] ${t.checkedDescription}`),t.failureReason&&e.push(`Failure: ${t.failureReason}`),t.expectedValue&&e.push(`Expected: ${t.expectedValue}`),t.actualValue&&e.push(`Actual: ${t.actualValue}`),e.join(`
|
|
281
|
+
`)}function Jt(t){const e=(t.min.x+t.max.x)/2,i=(t.min.y+t.max.y)/2,o=(t.min.z+t.max.z)/2,n=t.max.x-t.min.x,s=t.max.y-t.min.y,a=t.max.z-t.min.z,r=Math.max(n,s,a,.1),c=60*Math.PI/180,l=r/2/Math.tan(c/2)*1.5,p=Math.sqrt(.6*.6+.5*.5+.6*.6),f=.6/p*l,m=.5/p*l,u=.6/p*l,y=e+f,d=i+m,x=o+u,w=e-y,b=i-d,v=o-x,T=Math.sqrt(w*w+b*b+v*v);return{cameraViewPoint:{x:y,y:-x,z:d},cameraDirection:{x:w/T,y:-v/T,z:b/T},cameraUpVector:{x:0,y:0,z:1},fieldOfView:60}}function q(t,e,i,o){const n={guid:C(),components:{selection:[{ifcGuid:t}],visibility:{defaultVisibility:!1,exceptions:[{ifcGuid:t}]}}};return e&&(n.components.coloring=[{color:e,components:[{ifcGuid:t}]}]),i&&(n.perspectiveCamera=Jt(i)),o&&(n.snapshot=o),n}function Kt(t,e){const i={guid:C(),components:{selection:t.map(o=>({ifcGuid:o})),visibility:{defaultVisibility:!1,exceptions:t.map(o=>({ifcGuid:o}))}}};return e&&(i.components.coloring=[{color:e,components:t.map(o=>({ifcGuid:o}))}]),i}function ce(t){return{version:t?.version??"2.1",projectId:C(),name:t?.name,topics:new Map}}function re(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,assignedTo:t.assignedTo,dueDate:t.dueDate,labels:t.labels,comments:[],viewpoints:[]}}function le(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}function pe(t,e){t.topics.set(e.guid,e)}function fe(t,e){t.comments.push(e),t.modifiedDate=new Date().toISOString()}function ue(t,e){t.viewpoints.push(e),t.modifiedDate=new Date().toISOString()}function me(t,e,i){t.topicStatus=e,t.modifiedDate=new Date().toISOString(),t.modifiedAuthor=i}function de(t,e,i,o=255){const n=s=>Math.round(Math.max(0,Math.min(255,s))).toString(16).padStart(2,"0");return`${n(o)}${n(t)}${n(e)}${n(i)}`.toUpperCase()}export{G as B,fe as a,pe as b,ue as c,se as d,le as e,ae as f,ce as g,re as h,oe as i,ne as j,ee as r,de as t,me as u,ie as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as r}from"./pako.esm-n3Pgozwg.js";import{B as o}from"./geotiff-
|
|
1
|
+
import{i as r}from"./pako.esm-n3Pgozwg.js";import{B as o}from"./geotiff-B2HA8Bwm.js";import"./sandbox-qpJlrNN0.js";import"./lens-C4p1kQ0p.js";import"./__vite-browser-external-B1O5LaIO.js";class d extends o{decodeBlock(e){return r(new Uint8Array(e)).buffer}}export{d as default};
|