@giro3d/piero 1.0.0-beta.0
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/LICENSE +9 -0
- package/README.md +134 -0
- package/dist/Components.cjs.js +2 -0
- package/dist/Components.cjs.js.map +1 -0
- package/dist/Components.es.js +608 -0
- package/dist/Components.es.js.map +1 -0
- package/dist/assets/piero.css +9 -0
- package/dist/index.cjs.js +9 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +6971 -0
- package/dist/index.es.js.map +1 -0
- package/dist/modules.cjs.js +2 -0
- package/dist/modules.cjs.js.map +1 -0
- package/dist/modules.d.ts +2 -0
- package/dist/modules.es.js +856 -0
- package/dist/modules.es.js.map +1 -0
- package/dist/src/App.vue.d.ts +6 -0
- package/dist/src/api/BookmarkApi.d.ts +6 -0
- package/dist/src/api/DatasetApi.d.ts +61 -0
- package/dist/src/api/ViewApi.d.ts +4 -0
- package/dist/src/api/index.d.ts +4 -0
- package/dist/src/components/AlertToast.vue.d.ts +4 -0
- package/dist/src/components/AttributeGroup.vue.d.ts +7 -0
- package/dist/src/components/AttributeItem.vue.d.ts +6 -0
- package/dist/src/components/AttributePanel.vue.d.ts +14 -0
- package/dist/src/components/ColorFragment.vue.d.ts +6 -0
- package/dist/src/components/Configuration.d.ts +14 -0
- package/dist/src/components/CoordinateFragment.vue.d.ts +10 -0
- package/dist/src/components/DropdownView.vue.d.ts +13 -0
- package/dist/src/components/LinkFragment.vue.d.ts +10 -0
- package/dist/src/components/LoadingScreen.vue.d.ts +2 -0
- package/dist/src/components/MainView.vue.d.ts +5 -0
- package/dist/src/components/MinimapView.vue.d.ts +4 -0
- package/dist/src/components/ModalOverlay.vue.d.ts +25 -0
- package/dist/src/components/NavigationButtons.vue.d.ts +2 -0
- package/dist/src/components/OpacitySlider.vue.d.ts +10 -0
- package/dist/src/components/PanelContainer.vue.d.ts +10 -0
- package/dist/src/components/ProgressBar.vue.d.ts +14 -0
- package/dist/src/components/SearchOverlay.vue.d.ts +8 -0
- package/dist/src/components/SpinnerControl.vue.d.ts +2 -0
- package/dist/src/components/StatusBar.vue.d.ts +10 -0
- package/dist/src/components/SwitchToggle.vue.d.ts +25 -0
- package/dist/src/components/VisibilityControl.vue.d.ts +9 -0
- package/dist/src/components/atoms/ButtonArea.vue.d.ts +17 -0
- package/dist/src/components/atoms/ButtonWithIcon.vue.d.ts +11 -0
- package/dist/src/components/atoms/CompactList.vue.d.ts +17 -0
- package/dist/src/components/atoms/Icon.vue.d.ts +6 -0
- package/dist/src/components/atoms/IconList.vue.d.ts +17 -0
- package/dist/src/components/atoms/IconListButton.vue.d.ts +10 -0
- package/dist/src/components/atoms/ImportButton.vue.d.ts +13 -0
- package/dist/src/components/atoms/ListLabel.vue.d.ts +5 -0
- package/dist/src/components/atoms/ListLabelButton.vue.d.ts +11 -0
- package/dist/src/components/atoms/SectionCollapsible.vue.d.ts +30 -0
- package/dist/src/components/charts/BarChart.vue.d.ts +4 -0
- package/dist/src/components/charts/DoughnutChart.vue.d.ts +4 -0
- package/dist/src/components/panels/AboutPanel.vue.d.ts +2 -0
- package/dist/src/components/panels/AnalysisPanel.vue.d.ts +2 -0
- package/dist/src/components/panels/AnnotationItem.vue.d.ts +21 -0
- package/dist/src/components/panels/AnnotationPanel.vue.d.ts +2 -0
- package/dist/src/components/panels/BasemapItem.vue.d.ts +17 -0
- package/dist/src/components/panels/BookmarkItem.vue.d.ts +16 -0
- package/dist/src/components/panels/BookmarkPanel.vue.d.ts +2 -0
- package/dist/src/components/panels/DatagroupItem.vue.d.ts +18 -0
- package/dist/src/components/panels/DatasetItem.vue.d.ts +18 -0
- package/dist/src/components/panels/DatasetOrGroupItem.vue.d.ts +18 -0
- package/dist/src/components/panels/DatasetPanel.vue.d.ts +2 -0
- package/dist/src/components/panels/EmptyIndicator.vue.d.ts +6 -0
- package/dist/src/components/panels/LoadingIndicator.vue.d.ts +6 -0
- package/dist/src/components/panels/MeasurementItem.vue.d.ts +17 -0
- package/dist/src/components/panels/MeasurementPanel.vue.d.ts +2 -0
- package/dist/src/components/panels/OverlayItem.vue.d.ts +19 -0
- package/dist/src/components/panels/ShareBookmarkModal.vue.d.ts +5 -0
- package/dist/src/components/panels/analysis/ClippingBox.vue.d.ts +2 -0
- package/dist/src/components/panels/analysis/CrossSection.vue.d.ts +2 -0
- package/dist/src/components/panels/analysis/FloodingPlane.vue.d.ts +2 -0
- package/dist/src/components/panels/analysis/Statistics.vue.d.ts +2 -0
- package/dist/src/components/panels/analysis/ToolWrapper.vue.d.ts +28 -0
- package/dist/src/components/toolbar/ToolBar.vue.d.ts +9 -0
- package/dist/src/components/toolbar/ToolbarButton.vue.d.ts +12 -0
- package/dist/src/config-loader.d.ts +7 -0
- package/dist/src/constants.d.ts +7 -0
- package/dist/src/context.d.ts +35 -0
- package/dist/src/createPieroApp.d.ts +31 -0
- package/dist/src/events.d.ts +30 -0
- package/dist/src/giro3d/CameraControlsInspector.d.ts +17 -0
- package/dist/src/giro3d/EntityBuilder.d.ts +21 -0
- package/dist/src/giro3d/Graticule.d.ts +20 -0
- package/dist/src/giro3d/Grid.d.ts +11 -0
- package/dist/src/giro3d/LayerBuilder.d.ts +46 -0
- package/dist/src/giro3d/Measure3D.d.ts +20 -0
- package/dist/src/giro3d/Plane.d.ts +11 -0
- package/dist/src/giro3d/Skybox.d.ts +6 -0
- package/dist/src/giro3d/entities/FeatureCollectionEntity.d.ts +41 -0
- package/dist/src/giro3d/entities/PointCloudEntity.d.ts +45 -0
- package/dist/src/giro3d/entities/TiledPointCloudEntity.d.ts +13 -0
- package/dist/src/giro3d/entities/Tiles3dEntity.d.ts +11 -0
- package/dist/src/giro3d/entities/VectorLabelsEntity.d.ts +48 -0
- package/dist/src/giro3d/entities/VectorMeshEntity.d.ts +97 -0
- package/dist/src/giro3d/entities/VectorShapeEntity.d.ts +8 -0
- package/dist/src/giro3d/entities/flatPointCloud.d.ts +2 -0
- package/dist/src/giro3d/entities/tiledIfc.d.ts +2 -0
- package/dist/src/giro3d/entities/vector.d.ts +2 -0
- package/dist/src/giro3d/sources/GeopackageSource.d.ts +20 -0
- package/dist/src/giro3d/sources/ShapefileSource.d.ts +20 -0
- package/dist/src/giro3d/sources/mixins.d.ts +60 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/loaders/csv.d.ts +3 -0
- package/dist/src/loaders/las.d.ts +3 -0
- package/dist/src/loaders/loader.d.ts +29 -0
- package/dist/src/loaders/loader.test.d.ts +1 -0
- package/dist/src/loaders/userData.d.ts +8 -0
- package/dist/src/loaders/vector.d.ts +4 -0
- package/dist/src/module.d.ts +11 -0
- package/dist/src/modules/IFCLoader.d.ts +9 -0
- package/dist/src/modules/PLYLoader.d.ts +9 -0
- package/dist/src/modules/PotreeLoader.d.ts +9 -0
- package/dist/src/modules/Tour.d.ts +17 -0
- package/dist/src/modules/ifc/IfcEntity.d.ts +84 -0
- package/dist/src/modules/ifc/IfcEntityInspector.d.ts +7 -0
- package/dist/src/modules/ifc/IfcPropertyView.vue.d.ts +6 -0
- package/dist/src/modules/ifc/IfcSubtree.vue.d.ts +7 -0
- package/dist/src/modules/index.d.ts +5 -0
- package/dist/src/modules/ply/PlyEntity.d.ts +33 -0
- package/dist/src/providers/Alticoding.d.ts +32 -0
- package/dist/src/providers/BanProvider.d.ts +11 -0
- package/dist/src/providers/Geocoding.d.ts +7 -0
- package/dist/src/providers/IgnProvider.d.ts +11 -0
- package/dist/src/services/AnalysisManager.d.ts +10 -0
- package/dist/src/services/AnnotationManager.d.ts +48 -0
- package/dist/src/services/CameraController.d.ts +99 -0
- package/dist/src/services/DatasetManager.d.ts +27 -0
- package/dist/src/services/Giro3DManager.d.ts +42 -0
- package/dist/src/services/Highlighter.d.ts +11 -0
- package/dist/src/services/LayerManager.d.ts +37 -0
- package/dist/src/services/MeasureTool.d.ts +13 -0
- package/dist/src/services/MeasurementManager.d.ts +31 -0
- package/dist/src/services/MinimapController.d.ts +19 -0
- package/dist/src/services/Picker.d.ts +53 -0
- package/dist/src/services/analysis/ClippingBoxManager.d.ts +41 -0
- package/dist/src/services/analysis/CrossSectionManager.d.ts +9 -0
- package/dist/src/services/analysis/FloodingPlaneManager.d.ts +11 -0
- package/dist/src/stores/analysis.d.ts +1571 -0
- package/dist/src/stores/annotations.d.ts +60 -0
- package/dist/src/stores/bookmarks.d.ts +21 -0
- package/dist/src/stores/camera.d.ts +39 -0
- package/dist/src/stores/datasets.d.ts +49 -0
- package/dist/src/stores/giro3d.d.ts +45 -0
- package/dist/src/stores/layers.d.ts +40 -0
- package/dist/src/stores/measurement.d.ts +45 -0
- package/dist/src/stores/modules.d.ts +11 -0
- package/dist/src/stores/notifications.d.ts +8 -0
- package/dist/src/stores/statistics.d.ts +8 -0
- package/dist/src/types/Annotation.d.ts +35 -0
- package/dist/src/types/AnnotationMode.d.ts +7 -0
- package/dist/src/types/BaseLayer.d.ts +30 -0
- package/dist/src/types/Bookmark.d.ts +19 -0
- package/dist/src/types/CameraPosition.d.ts +7 -0
- package/dist/src/types/Configuration.d.ts +106 -0
- package/dist/src/types/Dataset.d.ts +78 -0
- package/dist/src/types/Feature.d.ts +13 -0
- package/dist/src/types/FloodingPlane.d.ts +14 -0
- package/dist/src/types/IFCTypes.d.ts +5 -0
- package/dist/src/types/LayerObject.d.ts +20 -0
- package/dist/src/types/Measure.d.ts +20 -0
- package/dist/src/types/MeasurementMode.d.ts +7 -0
- package/dist/src/types/Named.d.ts +5 -0
- package/dist/src/types/NavigationMode.d.ts +2 -0
- package/dist/src/types/Notification.d.ts +8 -0
- package/dist/src/types/OLGeometry.d.ts +1 -0
- package/dist/src/types/Overlay.d.ts +24 -0
- package/dist/src/types/VectorStyle.d.ts +31 -0
- package/dist/src/types/Viewbox.d.ts +7 -0
- package/dist/src/types/configuration/analysis.d.ts +26 -0
- package/dist/src/types/configuration/bookmark.d.ts +16 -0
- package/dist/src/types/configuration/camera.d.ts +19 -0
- package/dist/src/types/configuration/color.d.ts +18 -0
- package/dist/src/types/configuration/datasets/cityjson.d.ts +9 -0
- package/dist/src/types/configuration/datasets/core.d.ts +49 -0
- package/dist/src/types/configuration/datasets/featureCollection.d.ts +6 -0
- package/dist/src/types/configuration/datasets/ifc.d.ts +10 -0
- package/dist/src/types/configuration/datasets/index.d.ts +27 -0
- package/dist/src/types/configuration/datasets/layer.d.ts +43 -0
- package/dist/src/types/configuration/datasets/ply.d.ts +10 -0
- package/dist/src/types/configuration/datasets/pointCloud.d.ts +12 -0
- package/dist/src/types/configuration/datasets/potreePointCloud.d.ts +10 -0
- package/dist/src/types/configuration/datasets/tiledIfc.d.ts +9 -0
- package/dist/src/types/configuration/datasets/tiledPointCloud.d.ts +9 -0
- package/dist/src/types/configuration/datasets/vector.d.ts +34 -0
- package/dist/src/types/configuration/features.d.ts +2 -0
- package/dist/src/types/configuration/geographic.d.ts +51 -0
- package/dist/src/types/configuration/layers/core.d.ts +50 -0
- package/dist/src/types/configuration/layers/index.d.ts +51 -0
- package/dist/src/types/configuration/sources/bingMaps.d.ts +5 -0
- package/dist/src/types/configuration/sources/core/baseConfig.d.ts +70 -0
- package/dist/src/types/configuration/sources/core/tiled.d.ts +19 -0
- package/dist/src/types/configuration/sources/core/vector.d.ts +13 -0
- package/dist/src/types/configuration/sources/core/vectorTile.d.ts +8 -0
- package/dist/src/types/configuration/sources/customVector.d.ts +7 -0
- package/dist/src/types/configuration/sources/customVectorTile.d.ts +8 -0
- package/dist/src/types/configuration/sources/geojson.d.ts +5 -0
- package/dist/src/types/configuration/sources/geotiff.d.ts +8 -0
- package/dist/src/types/configuration/sources/gpx.d.ts +5 -0
- package/dist/src/types/configuration/sources/kml.d.ts +5 -0
- package/dist/src/types/configuration/sources/mvt.d.ts +10 -0
- package/dist/src/types/configuration/sources/osm.d.ts +5 -0
- package/dist/src/types/configuration/sources/stadiaMaps.d.ts +5 -0
- package/dist/src/types/configuration/sources/wms.d.ts +15 -0
- package/dist/src/types/configuration/sources/wmts.d.ts +15 -0
- package/dist/src/types/configuration/sources/xyz.d.ts +9 -0
- package/dist/src/types/utilities.d.ts +5 -0
- package/dist/src/utils/Components.d.ts +8 -0
- package/dist/src/utils/Configuration.d.ts +15 -0
- package/dist/src/utils/Download.d.ts +11 -0
- package/dist/src/utils/Fetcher.d.ts +77 -0
- package/dist/src/utils/Measure.d.ts +7 -0
- package/dist/src/utils/OLFeatures.d.ts +57 -0
- package/dist/src/utils/Projections.d.ts +10 -0
- package/dist/src/utils/Types.d.ts +11 -0
- package/package.json +103 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var O=Object.defineProperty;var D=(l,a,t)=>a in l?O(l,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[a]=t;var h=(l,a,t)=>D(l,typeof a!="symbol"?a+"":a,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("/builds/giro3d/piero/node_modules/@giro3d/giro3d/gui/EntityPanel.js"),g=require("/builds/giro3d/piero/node_modules/openbim-components/index.js"),f=require("./Components.cjs.js"),B=require("/builds/giro3d/piero/node_modules/@giro3d/giro3d/entities/Entity3D.js"),_=require("/builds/giro3d/piero/node_modules/three"),z=require("/builds/giro3d/piero/node_modules/@giro3d/giro3d/gui/EntityInspector.js"),c=require("/builds/giro3d/piero/node_modules/vue/dist/vue.runtime.esm-bundler.js"),j=require("/builds/giro3d/piero/node_modules/three/examples/jsm/loaders/PLYLoader.js"),V=require("/builds/giro3d/piero/node_modules/@giro3d/giro3d/entities/PointCloud.js"),R=require("/builds/giro3d/piero/node_modules/@giro3d/giro3d/sources/PotreeSource.js"),w=require("/builds/giro3d/piero/node_modules/shepherd.js/dist/js/shepherd.esm.js"),x=new _.Matrix4,U={bbox:new _.MeshBasicMaterial({color:"#FFFF00",depthTest:!0,opacity:.2,transparent:!0}),selection:new _.MeshBasicMaterial({color:"#FF0000",depthTest:!1,opacity:.6,transparent:!0})},Y=4186316022,q=781010003,G=2655215786,W=3242617779,H=919958153,$=1307041759,F=1451395588,L=1883228015,Q=[F,L],J=[Y,q,G,W,H,$],M=l=>f.isObject(l)&&l.isIFCPickResult,P=class P extends B{constructor(t){super(new _.Group);h(this,"isIfcEntity",!0);h(this,"isPickableFeatures",!0);h(this,"type","IfcEntity");h(this,"_classificationCache");h(this,"_components");h(this,"_fragmentBoundingBox");h(this,"_fragmentClassifier");h(this,"_fragmentManager");h(this,"_ifcSelection");h(this,"_indexMap");h(this,"_model");h(this,"_source");this._source=t,this._components=new g.Components,this._components.ui.enabled=!1,this._components.scene=new g.SimpleScene(this._components),this._components.renderer=new g.SimpleRenderer(this._components,document.createElement("div")),this._components.camera=new g.SimpleCamera(this._components),this._components.raycaster=new g.SimpleRaycaster(this._components),this._components.init(),this._ifcSelection={bbox:{},selection:{}},this._indexMap={},this._classificationCache=null,this._fragmentBoundingBox=null}clearHighlight(t="selection"){for(const e of Object.keys(this._ifcSelection[t])){const o=this._fragmentManager.list[e],n=o==null?void 0:o.fragments[t];n!=null&&n.mesh.removeFromParent()}this.notifyChange(this),this._ifcSelection[t]={}}getBoundingBoxById(t){this.clearHighlight("bbox"),this.highlightById(t,"bbox");const e=this._fragmentBoundingBox;if(e===null)throw new Error("Must call initClassification before getBoundingBoxById");const o=this._fragmentManager;e.reset();const n=this._ifcSelection.bbox;if(!Object.keys(n).length)return;for(const d of Object.keys(n)){const y=o.list[d].fragments.bbox;e.addMesh(y.mesh)}const s=e.get(),{y:r,z:u}=s.min,{y:m,z:i}=s.max;return s.min.y=-i,s.max.y=-u,s.min.z=r,s.max.z=m,s.translate(this._model.position),this.clearHighlight("bbox"),s}getClassification(){if(this._classificationCache===null)throw new Error("Must call initClassification before getClassification");return this._classificationCache}getProperties(t){const e=[],o=this._model.properties;if(!o)return[];for(const n of this._indexMap[t]){const s=o[n];if(s==null)continue;const{name:r}=g.IfcPropertiesUtils.getEntityName(o,n);if(r!==null){if(s.type===F){const u=g.IfcPropertiesUtils.getPsetProps(o,n);if(u!==null)for(const m of u){if(o[m]==null)continue;const d=this.getProperty(m);d!==null&&e.push({parentName:r,...d})}}else if(s.type===L){const u=g.IfcPropertiesUtils.getQsetQuantities(o,n);if(u!==null)for(const m of u){const{key:i}=g.IfcPropertiesUtils.getQuantityValue(o,m);if(i===null)continue;const d=this.getProperty(m);d!==null&&e.push({parentName:r,...d})}}}}return e}getProperty(t){const e=this._model.properties;if(e===void 0)return null;const{name:o}=g.IfcPropertiesUtils.getEntityName(e,t);if(o===null)return null;const{value:n}=g.IfcPropertiesUtils.getQuantityValue(e,t);return{name:o,value:n}}highlight(t,e,o){this._ifcSelection[t][e.uuid]=new Set;const n=parseInt(o,10);this._ifcSelection[t][e.uuid].add(o),this.addComposites(t,e,n),this.regenerate(t,e.uuid);const s=e.fragment.group;if(s){const r=s.data[n][0];for(let u=0;u<r.length;u++){const m=r[u],i=s.keyFragments[m],d=this._fragmentManager.list[i];i in this._ifcSelection[t]||(this._ifcSelection[t][i]=new Set),this._ifcSelection[t][i].add(o),this.addComposites(t,d.mesh,n),this.regenerate(t,i)}}this.notifyChange(this)}highlightById(t,e="selection"){for(const o of Object.keys(t)){o in this._ifcSelection[e]||(this._ifcSelection[e][o]=new Set);const n=this._fragmentManager.list[o],s=new Set;for(const r of t[o])this._ifcSelection[e][o].add(r),s.add(parseInt(r,10));for(const r of s)this.addComposites(e,n.mesh,r);this.regenerate(e,o)}this.notifyChange(this)}pick(t,e){return super.pick(t,e).map(o=>({...o,entity:this,features:o.features,isIFCPickResult:!0,object:o.object}))}pickFeaturesFrom(t){var o,n,s;const e=t.object;if(e.fragment!=null&&t.instanceId!=null&&t.face){const r=e.fragment.getVertexBlockID(e.geometry,t.face.a),u=(o=e.fragment.getItemID(t.instanceId,r))==null?void 0:o.replace(/\..*/,"");if(u&&((s=(n=e.fragment.group)==null?void 0:n.properties)==null?void 0:s[u])!=null){const i=e.fragment.group.properties[u],p=[{ifcProperties:this.getProperties(u),itemProperties:i}];return t.features=p,p}}return[]}async initClassification(){this._classificationCache=await this.regenerateClassification(["storeys","entities"]),this._classificationCache.length===0&&(this._classificationCache=await this.regenerateClassification(["entities"])),this._fragmentBoundingBox=await this._components.tools.get(g.FragmentBoundingBox)}async preprocess(){const t=await f.Fetcher.fetchArrayBuffer(this._source.url);this._fragmentManager=await this._components.tools.get(g.FragmentManager),this._fragmentClassifier=await this._components.tools.get(g.FragmentClassifier);const e=new g.FragmentIfcLoader(this._components);e.settings.webIfc.COORDINATE_TO_ORIGIN=!0,e.settings.webIfc.OPTIMIZE_PROFILES=!0;const o=new Uint8Array(t);this._model=await e.load(o,this._source.name),this._model.rotateX(Math.PI/2);const n=new _.Vector3;if(this._source.at)this._source.at.toVector3(n),this._model.position.copy(n);else{const r=this._model.coordinationMatrix.clone().invert();n.applyMatrix4(r),this._model.position.set(n.x,-n.z,n.y)}this._model.updateWorldMatrix(!0,!0),this._model.updateMatrix(),this._model.updateMatrixWorld(!0),this.initializeEntityIndexes(),this._fragmentClassifier.byStorey(this._model),this._fragmentClassifier.byEntity(this._model),await this.initClassification(),this.object3d.add(this._model),this.onObjectCreated(this._model);const s=f.Fetcher.getContext(this._source.url);f.fillObject3DUserData(this,{filename:s.filename}),this.notifyChange(this.object3d)}addComposites(t,e,o){this.addHighlightToFragment(t,e.fragment);const n=e.fragment.composites[o];if(n)for(let s=1;s<n;s++){const r=g.toCompositeID(o,s);this._ifcSelection[t][e.uuid].add(r)}}addHighlightToFragment(t,e){if(!(t in e.fragments)){const o=e.addFragment(t,[U[t]]);e.blocks.count>1&&(o.setInstance(0,{ids:Array.from(e.ids),transform:x}),o.blocks.setVisibility(!1)),this._model.add(o.mesh),o.mesh.renderOrder=30,o.mesh.frustumCulled=!1,o.mesh.name=t,o.mesh.updateMatrixWorld(!0)}}initializeEntityIndexes(){this._indexMap={};const t=this._model.properties;if(t!==void 0)for(const e of J)g.IfcPropertiesUtils.getRelationMap(t,e,(o,n)=>{const s=t[o];Q.includes(s.type)||this.setEntityIndex(o);for(const r of n)this.setEntityIndex(r).add(o)})}regenerate(t,e){this.updateFragmentFill(t,e)}async regenerateClassification(t,e={}){const o=this._fragmentClassifier.get(),n=[],s=t[0],r=o[s];if(s==null||r==null)return n;for(const u of Object.keys(r)){const m={...e,[s]:[u]},i=await this._fragmentClassifier.find(m);if(Object.keys(i).length>0){const y=s[0].toUpperCase()+s.slice(1),b=await this.regenerateClassification(t.slice(1),m);n.push({children:b,fragments:i,name:u,treeItemName:y})}}return n}setEntityIndex(t){return t in this._indexMap||(this._indexMap[t]=new Set),this._indexMap[t]}updateFragmentFill(t,e){const o=this._ifcSelection[t][e],n=this._fragmentManager.list[e];if(n==null)return;const s=n.fragments[t];if(s==null)return;const r=n.mesh.parent;if(r==null)return;if(r.add(s.mesh),s.blocks.count>1)n.getInstance(0,x),s.setInstance(0,{ids:Array.from(n.ids),transform:x}),s.blocks.setVisibility(!0,o,!0);else{let m=0;for(const i of o){s.mesh.count=m+1;const{instanceID:d}=n.getInstanceAndBlockID(i);n.getInstance(d,x),s.setInstance(m,{ids:[i],transform:x}),m++}}}};h(P,"isIFCEntity",t=>f.isObject(t)&&t.isIfcEntity),h(P,"isIFCPickResult",t=>f.isObject(t)&&P.isIFCEntity(t.entity));let k=P;class Z extends z{constructor(a,t,e){super(a,t,e,{visibility:!0})}}const K={class:"d-flex"},X=["title"],tt=["id"],et={class:"list-unstyled border-start"},ot=c.defineComponent({__name:"IfcSubtree",props:{classificationElement:{},ifcEntity:{}},setup(l){const a=l,t=_.MathUtils.generateUUID(),e=`#${t}`,o=c.ref(!1),n=f.useCameraStore(),s=f.useAnalysisStore();function r(){const i=a.ifcEntity.getBoundingBoxById(a.classificationElement.fragments);i&&!i.isEmpty()&&(s.setClippingBox(i),s.enableClippingBox(!0))}function u(){o.value=!0,a.ifcEntity.clearHighlight(),a.ifcEntity.highlightById(a.classificationElement.fragments),setTimeout(()=>o.value=!1,2e3)}function m(){const i=a.ifcEntity.getBoundingBoxById(a.classificationElement.fragments);i&&!i.isEmpty()&&n.lookTopDownAt(i)}return(i,d)=>{const p=c.resolveComponent("IfcSubtree",!0);return c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("div",K,[c.createElementVNode("span",{class:c.normalizeClass(["border rounded px-1 py-0 fw-normal",o.value?"text-danger border-danger":"text-secondary border-secondary"]),title:i.classificationElement.treeItemName},c.toDisplayString(i.classificationElement.treeItemName),11,X),i.classificationElement.children.length>0?(c.openBlock(),c.createBlock(f.IconList,{key:0},{default:c.withCtx(()=>[c.createVNode(f.IconListButton,{title:"Expand group",icon:"bi-chevron-down","data-bs-toggle":"collapse","data-bs-target":e,"aria-controls":c.unref(t),"aria-expanded":"true"},null,8,["aria-controls"])]),_:1})):c.createCommentVNode("",!0),c.createVNode(f._sfc_main$2,{class:c.normalizeClass(["label",o.value?"text-danger-emphasis":"text-muted"]),text:i.classificationElement.name,title:`Zoom to ${i.classificationElement.name}`,onClick:m},null,8,["class","text","title"]),c.createVNode(f.IconList,{class:"ms-1"},{default:c.withCtx(()=>[c.createVNode(f.IconListButton,{title:"Highlight",icon:"bi-highlighter",onClick:u}),c.createVNode(f.IconListButton,{title:"Clip to",icon:"bi-bounding-box",onClick:r})]),_:1})]),i.classificationElement.children.length>0?(c.openBlock(),c.createElementBlock("div",{key:0,id:c.unref(t),class:"collapse show"},[c.createElementVNode("ul",et,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.classificationElement.children,(y,b)=>(c.openBlock(),c.createElementBlock("li",{key:b},[c.createVNode(p,{"ifc-entity":a.ifcEntity,"classification-element":y},null,8,["ifc-entity","classification-element"])]))),128))])],8,tt)):c.createCommentVNode("",!0)])}}}),nt=f._export_sfc(ot,[["__scopeId","data-v-c2ab888d"]]),st={key:0},it=c.defineComponent({__name:"IfcPropertyView",props:{dataset:{}},setup(l){const a=f.useDatasetStore(),t=l,e=f.refAndWatch(t.dataset,"isPreloaded");function o(){const s=n();return s==null?null:s.getClassification()}function n(){const s=a.getEntity(t.dataset);return s??null}return(s,r)=>c.unref(e)?(c.openBlock(),c.createElementBlock("div",st,[c.createElementVNode("ul",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o(),(u,m)=>(c.openBlock(),c.createElementBlock("li",{key:m},[c.createVNode(nt,{"ifc-entity":n(),"classification-element":u},null,8,["ifc-entity","classification-element"])]))),128))])])):c.createCommentVNode("",!0)}}),at=f._export_sfc(it,[["__scopeId","data-v-d2d82ae7"]]),rt=l=>{if(M(l)){const a=l.object;if(a.fragment!=null&&l.face&&l.instanceId!=null){const t=a.fragment.getVertexBlockID(a.geometry,l.face.a),e=a.fragment.getItemID(l.instanceId,t).replace(/\..*/,"");return l.entity.highlight("selection",a,e),()=>l.entity.clearHighlight()}}return null},ct=l=>({name:l.filename,source:{url:l.file},type:"ifc",visible:!0}),lt=(l,a)=>{var u,m,i,d,p,y,b,I,C;if(!M(l))return;const t=(u=l.features)==null?void 0:u.at(0);if(!t)return;a.has("IFC")||a.set("IFC",[]);const e=a.get("IFC"),{ifcProperties:o,itemProperties:n}=t,s="NULL",r=((m=n.Name)==null?void 0:m.value)??s;e.push({key:"Site",value:((d=(i=l.entity.object3d.userData)==null?void 0:i.dataset)==null?void 0:d.name)??s}),e.push({key:"IFCType",value:g.IfcCategoryMap[n.type]??s}),e.push({key:"Name",value:r}),e.push({key:"ID",value:n.expressID}),e.push({key:"GlobalId",value:((p=n.GlobalId)==null?void 0:p.value)??s}),((y=n.Description)==null?void 0:y.value)!=null&&e.push({key:"Description",value:n.Description.value}),((b=n.PredefinedType)==null?void 0:b.value)!=null&&e.push({key:"PredefinedType",value:n.PredefinedType.value}),((I=n.ObjectType)==null?void 0:I.value)!=null&&e.push({key:"ObjectType",value:n.ObjectType.value});for(const{name:S,parentName:T,value:N}of o)a.has(T)||a.set(T,[]),(C=a.get(T))==null||C.push({key:S,value:N})},ut=l=>{const a=l.dataset,t=a.config,e=f.getCoordinates(t.source.position??a.get("position")),o=new k({...t.source,at:e,name:a.name});return Promise.resolve(o)};class dt{constructor(){h(this,"name","IFC")}async initialize(a){a.datasets.registerDatasetType("ifc",{attributeExtractor:lt,entityBuilder:ut,fileExtensions:["ifc"],highlight:rt,icon:"bi-building",loader:ct,name:"IFC",propertyView:at}),A.registerInspector("IfcEntity",Z),await f.Fetcher.fetch("web-ifc.wasm").catch(t=>{console.warn("Could not load web-ifc.wasm",t)})}}const v=class v extends _.Mesh{constructor(){super(...arguments);h(this,"isPickableFeatures",!0);h(this,"isPlyMesh",!0)}pickFeaturesFrom(t){if(this.geometry.hasAttribute("color")&&t.face){const e=this.geometry.getAttribute("color").array,o=t.face,s=[{color:new _.Color(e[o.a*3],e[o.a*3+1],e[o.a*3+2])}];return t.features=s,s}return[]}};h(v,"isPlyMesh",t=>f.isObject(t)&&t.isPlyMesh),h(v,"isPlyPickResult",t=>f.isObject(t)&&v.isPlyMesh(t==null?void 0:t.object));let E=v;class ht extends B{constructor(t){super(new _.Group);h(this,"isPlyEntity",!0);h(this,"source");this.source=t}async preprocess(){const t=await f.Fetcher.fetchArrayBuffer(this.source.url),e=this.source.at.as(this.source.featureProjection).toVector3(),n=new j.PLYLoader().parse(t),s=new _.MeshLambertMaterial({side:_.DoubleSide});n.hasAttribute("color")&&(s.vertexColors=!0),n.computeVertexNormals();const r=new E(n,s);r.name="plyModel",n.computeBoundingBox(),r.position.copy(e),r.updateWorldMatrix(!0,!0),this.object3d.add(r),this.onObjectCreated(r);const u=f.Fetcher.getContext(this.source.url);f.fillObject3DUserData(this,{filename:u.filename}),this.notifyChange(this.object3d)}}const mt=l=>{const{dataset:a,instance:t}=l,e=a.config,o=f.getCoordinates(e.source.position??a.get("position")),n=new ht({...e.source,at:o,featureProjection:t.referenceCrs});return Promise.resolve(n)},ft=(l,a)=>{var o;if(!E.isPlyPickResult(l))return;const t=(o=l.features)==null?void 0:o.at(0);if(!t)return;a.has("PLY")||a.set("PLY",[]),a.get("PLY").push({key:"Color",value:t.color})};class pt{constructor(){h(this,"name","PLY")}initialize(a){a.datasets.registerDatasetType("ply",{attributeExtractor:ft,entityBuilder:mt,icon:"bi-file-earmark-binary",name:"PLY"})}}const gt=l=>{const a=l.dataset.config,t=new V({source:new R({url:`${a.source.url}/${a.source.filename}`})});return f.fillObject3DUserData(t,{filename:a.source.url}),Promise.resolve(t)};class yt{constructor(){h(this,"name","Potree")}initialize(a){a.datasets.registerDatasetType("potree",{entityBuilder:gt,icon:"fg-multipoint",name:"Potree Point Cloud"})}}class bt{constructor(){h(this,"name","Tour");h(this,"_camera",null);h(this,"_cameraCallback",null);h(this,"_context",null);h(this,"_tours",null)}initialize(a){this._context=a,a.events.addEventListener("ready",this.start.bind(this))}buildTours(){const a=this._camera,t=new w.Tour({tourName:"main",useModalOverlay:!0}),e=new w.Tour({tourName:"navigating",useModalOverlay:!0}),o=new w.Tour({tourName:"analyzing",useModalOverlay:!0}),n=[{action:()=>{var i;return(i=w.activeTour)==null?void 0:i.next()},text:"Next"},{action:()=>{var i;return(i=w.activeTour)==null?void 0:i.cancel()},secondary:!0,text:"Exit"}],s=()=>{var C,S;const i=(C=w.activeTour)==null?void 0:C.getCurrentStep(),d=i==null?void 0:i.getElement(),p=d==null?void 0:d.querySelector(".shepherd-text"),y=(S=w.activeTour)==null?void 0:S.steps;if(i==null||d==null||p==null||y==null)return;const b=document.createElement("div");b.className="progress mt-3",b.setAttribute("role","progressbar"),b.style.height="2px";const I=document.createElement("div");I.className="progress-bar bg-success",I.style.width=`${100*(y.indexOf(i)/y.length)}%`,b.appendChild(I),p.appendChild(b)},r=async(i,d)=>new Promise(p=>{const y=document.getElementById(i);if(y&&!y.classList.contains("active")&&y.click(),document.querySelector(d))return p(document.querySelector(d));const b=new MutationObserver(()=>{document.querySelector(d)&&(b.disconnect(),p(document.querySelector(d)))});b.observe(document.body,{childList:!0,subtree:!0})});t.addStep({buttons:[{action:()=>{var i;(i=w.activeTour)==null||i.complete(),e.show(0)},text:"Navigating"},{action:()=>{var i;(i=w.activeTour)==null||i.complete(),o.show(0)},text:"Analyzing data"},{action:()=>{var i;return(i=w.activeTour)==null?void 0:i.cancel()},secondary:!0,text:"Exit"}],cancelIcon:{enabled:!0,label:"Exit tutorial"},id:"example-step",text:"<p>Welcome to <strong>Piero</strong>, the Giro3D application.<br/>We can guide you through the different features.</p>",title:"Welcome!",when:{show:s}}),e.addStep({attachTo:{element:"#main-view",on:"bottom"},buttons:n,id:"view",text:"<p>This is the <b>main view</b>.</p><p>Giro3D natively supports a broad range of data sources, from 2D raster and vector data, to 3D point clouds and tilesets.</p><p>Piero adds support for CityJSON and IFC files.</p>",when:{show:s}}),e.addStep({attachTo:{element:"#main-view",on:"bottom"},buttons:n,id:"navigate",text:'<p>This application integrates <a href="https://github.com/yomotsu/camera-controls">camera-controls</a>, a camera control for three.js.</p><p><b>Click</b> to move the camera. <b>Right-click</b> to rotate around a point. <b>Scroll</b> to zoom in or out.</p>',when:{hide:()=>{this._cameraCallback&&a.removeEventListener("interaction-end",this._cameraCallback),this._cameraCallback=null},show:()=>{let i=0;this._cameraCallback=()=>{var d;i+=1,i>2&&((d=w.activeTour)==null||d.next())},a.addEventListener("interaction-end",this._cameraCallback),s()}}}),e.addStep({attachTo:{element:"#toolbar",on:"right"},beforeShowPromise:()=>r("toolbar-datasets","#datasets-drop-zone"),buttons:n,id:"toolbar-layers",text:"<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>",when:{show:s}}),e.addStep({attachTo:{element:"#basemap-list",on:"right"},beforeShowPromise:()=>r("toolbar-datasets","#datasets-drop-zone"),buttons:n,id:"basemaps",text:"<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>",when:{show:s}}),e.addStep({attachTo:{element:"#overlay-list",on:"right"},beforeShowPromise:()=>r("toolbar-datasets","#datasets-drop-zone"),buttons:n,id:"overlays",text:"<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>",when:{show:s}}),e.addStep({attachTo:{element:"#dataset-list",on:"right"},beforeShowPromise:()=>r("toolbar-datasets","#datasets-drop-zone"),buttons:n,id:"layers",text:"<p>The <b>Datasets</b> panel contains all 3D objects in the scene.</><p>You can toggle their visibility and delete them.<p><p>Most objects leverage Giro3D's adaptive resolution to optimize their display.</p>",when:{show:s}}),e.addStep({attachTo:{element:"#datasets-drop-zone",on:"right"},beforeShowPromise:()=>r("toolbar-datasets","#datasets-drop-zone"),buttons:n,id:"adddata",text:"<p>You can add your own data from your computer by <b>dragging the file</b> into this page.</p><p>While you won't benefit from Giro3D's tiling mechanism, this can be a great way to quickly visualize datasets up to 100MB.</p><p>This application supports CityJSONs, IFCs, LAS/LAZs, CSV pointclouds, and simple GeoJSON features.</p>",when:{show:s}}),e.addStep({attachTo:{element:"#main-view",on:"bottom"},buttons:n,id:"attributes",text:"<p>By clicking on any feature on the map, you can see its <strong>Attribute table</strong>. Clickable features display a cursor when hovered.</p>",when:{show:s}}),e.addStep({attachTo:{element:"#search-place-autocomplete",on:"bottom"},buttons:[{action:()=>{var i;(i=w.activeTour)==null||i.complete(),o.show(0)},text:"Analyzing data"},{action:()=>{var i;return(i=w.activeTour)==null?void 0:i.complete()},secondary:!0,text:"Exit"}],id:"widgets",text:"Giro3D is highly extensible. Here we added a widget to search and navigate to locations based on the French address database.",when:{show:s}}),o.addStep({attachTo:{element:"#annotations-fieldset",on:"right"},beforeShowPromise:()=>r("toolbar-annotations","#annotations-fieldset"),buttons:n,id:"annotation",text:"<p>You can <strong>annotate</strong> any data displayed using Giro3D native tools.<br>Select the <strong>geometry</strong> of your annotation, and <strong>click</strong> on the scene to add points. <strong>Right-click</strong> to end the shape.</p>",when:{show:s}}),o.addStep({attachTo:{element:"#annotations-fieldset",on:"right"},beforeShowPromise:()=>r("toolbar-annotations","#annotations-fieldset"),buttons:n,id:"annotations",text:"You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.",when:{show:s}}),f.hasExperimentalFeature("measurements")&&o.addStep({attachTo:{element:"#panel-container",on:"right"},beforeShowPromise:()=>r("toolbar-measures","#measures-fieldset"),buttons:n,id:"measurements",text:"You can add <strong>measurements</strong> to easily get distances betwween objects.<br>Once started, moving the mouse will display the measure. <strong>Click</strong> to save the measurement. <strong>Right-click</strong> to end.",when:{show:s}}),o.addStep({attachTo:{element:"#panel-container",on:"right"},beforeShowPromise:()=>r("toolbar-analysis","#panel-container .card"),buttons:[{action:()=>{var i;return(i=w.activeTour)==null?void 0:i.complete()},text:"Done!"}],id:"analysis",text:"In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.",when:{show:s}});const u=()=>{const i=new URL(document.URL);i.searchParams.delete("tourStep"),i.searchParams.set("tour","none"),window.history.replaceState({},"",i.toString())},m=i=>{const d=new URL(document.URL);let p="main";i.tour.id.startsWith("navigating")?p="navigating":i.tour.id.startsWith("analyzing")&&(p="analyzing"),d.searchParams.set("tour",p),d.searchParams.set("tourStep",i.step.id),window.history.replaceState({},"",d.toString())};return t.on("cancel",u),t.on("complete",u),t.on("show",m),e.on("cancel",u),e.on("complete",u),e.on("show",m),o.on("cancel",u),o.on("complete",u),o.on("show",m),{analyzingTour:o,mainTour:t,navigatingTour:e}}getTours(){return this._tours||(this._tours=this.buildTours()),this._tours}restart(){const{mainTour:a}=this.getTours();a.show(0)}start(){if(!this._context)throw new Error("module is not initialized");const{analyzingTour:a,mainTour:t,navigatingTour:e}=this.getTours();this._camera=this._context.view.getCameraController();const o=new URL(document.URL),n=o.searchParams.get("tour")??"main";if(n!=="none"){const s=o.searchParams.get("tourStep")??0;n==="navigating"?e.show(s):n==="analyzing"?a.show(s):t.show(s)}}}exports.IFCLoader=dt;exports.PLYLoader=pt;exports.PotreeLoader=yt;exports.Tour=bt;
|
|
2
|
+
//# sourceMappingURL=modules.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules.cjs.js","sources":["../src/modules/ifc/IfcEntity.ts","../src/modules/ifc/IfcEntityInspector.ts","../src/modules/ifc/IfcSubtree.vue","../src/modules/ifc/IfcPropertyView.vue","../src/modules/IFCLoader.ts","../src/modules/ply/PlyEntity.ts","../src/modules/PLYLoader.ts","../src/modules/PotreeLoader.ts","../src/modules/Tour.ts"],"sourcesContent":["import type PickableFeatures from '@giro3d/giro3d/core/picking/PickableFeatures';\nimport type PickOptions from '@giro3d/giro3d/core/picking/PickOptions';\nimport type PickResult from '@giro3d/giro3d/core/picking/PickResult';\nimport type { Fragment } from 'bim-fragment/fragment';\nimport type { FragmentMesh } from 'bim-fragment/fragment-mesh';\nimport type { FragmentsGroup } from 'bim-fragment/fragments-group';\nimport type { FragmentIdMap } from 'openbim-components';\nimport type { Box3, Material, Vector2 } from 'three';\n\nimport Entity3D from '@giro3d/giro3d/entities/Entity3D';\nimport {\n Components,\n FragmentBoundingBox,\n FragmentClassifier,\n FragmentIfcLoader,\n FragmentManager,\n IfcPropertiesUtils,\n SimpleCamera,\n SimpleRaycaster,\n SimpleRenderer,\n SimpleScene,\n toCompositeID,\n} from 'openbim-components';\nimport { Group, Matrix4, MeshBasicMaterial, Vector3 } from 'three';\n\nimport { fillObject3DUserData } from '@/loaders/userData';\nimport Fetcher from '@/utils/Fetcher';\nimport { isObject } from '@/utils/Types';\n\nimport type { CoordinatesMixin, UrlOrDataMixin } from '../../giro3d/sources/mixins';\n\n// Copied/extract quite a lot from openbim-components library:\n// - src/fragments/FragmentHighlighter/index.ts for highlighting\n// - src/fragments/FragmentClassifier/index.ts for classification\n// - src/ifc/IfcPropertiesProcessor/index.ts for property-related stuff\n\n///// HIGHLIGHTING\n\nconst tempMatrix = new Matrix4();\n\ntype FragmentTypeName = 'bbox' | 'selection';\n\ntype MaterialMap = {\n [name in FragmentTypeName]: Material;\n};\ntype SelectionMap = {\n [name in FragmentTypeName]: FragmentIdMap;\n};\n\nconst materials: MaterialMap = {\n bbox: new MeshBasicMaterial({\n color: '#FFFF00',\n depthTest: true,\n opacity: 0.2,\n transparent: true,\n }),\n selection: new MeshBasicMaterial({\n color: '#FF0000',\n depthTest: false,\n opacity: 0.6,\n transparent: true,\n }),\n};\n\n///// PROPERTIES\n\ninterface IndexMap {\n [expressID: string]: Set<number>;\n}\n\n// Re-defined from Web-ifc\nconst IFCRELDEFINESBYPROPERTIES = 4186316022;\nconst IFCRELDEFINESBYTYPE = 781010003;\nconst IFCRELASSOCIATESMATERIAL = 2655215786;\nconst IFCRELCONTAINEDINSPATIALSTRUCTURE = 3242617779;\nconst IFCRELASSOCIATESCLASSIFICATION = 919958153;\nconst IFCRELASSIGNSTOGROUP = 1307041759;\nconst IFCPROPERTYSET = 1451395588;\nconst IFCELEMENTQUANTITY = 1883228015;\n\n// IFC properties we want to explore\nconst setEntities = [IFCPROPERTYSET, IFCELEMENTQUANTITY];\n\n// IFC relations we want to process to extract properties\nconst relationsToProcess = [\n IFCRELDEFINESBYPROPERTIES,\n IFCRELDEFINESBYTYPE,\n IFCRELASSOCIATESMATERIAL,\n IFCRELCONTAINEDINSPATIALSTRUCTURE,\n IFCRELASSOCIATESCLASSIFICATION,\n IFCRELASSIGNSTOGROUP,\n];\n\n///// CLASSIFICATION\n\nexport enum ClassificationSystem {\n ENTITY = 'entities',\n STOREY = 'storeys',\n}\n\nexport type ClassificationItem = {\n children: ClassificationItem[];\n fragments: FragmentIdMap;\n name: string;\n treeItemName: string;\n};\n\nexport interface IFCFeature {\n ifcProperties: IFCProperty[];\n itemProperties: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [attribute: string]: any;\n };\n}\n\nexport interface IFCPickResult extends PickResult<IFCFeature> {\n entity: IfcEntity;\n features?: IFCFeature[];\n isIFCPickResult: true;\n object: FragmentMesh;\n}\n\nexport interface IFCProperty {\n name: string;\n parentName: string;\n value: number | null;\n}\n\nexport const isIFCPickResult = (obj: unknown): obj is IFCPickResult =>\n isObject(obj) && (obj as IFCPickResult).isIFCPickResult;\n\n/** Source interface for {@link IfcEntity} */\nexport interface IfcSource extends CoordinatesMixin, UrlOrDataMixin {\n /** Name of the IFC */\n name: string;\n}\n\n/**\n * Entity for displaying an IFC file\n */\nexport default class IfcEntity\n extends Entity3D\n implements PickableFeatures<IFCFeature, IFCPickResult>\n{\n public readonly isIfcEntity = true as const;\n public readonly isPickableFeatures = true as const;\n public override readonly type = 'IfcEntity' as const;\n\n private _classificationCache: ClassificationItem[] | null;\n\n private _components: Components;\n private _fragmentBoundingBox: FragmentBoundingBox | null;\n private _fragmentClassifier!: FragmentClassifier;\n private _fragmentManager!: FragmentManager;\n private _ifcSelection: SelectionMap; // Currently selected fragments\n private _indexMap: IndexMap; // Properties relationships\n private _model!: FragmentsGroup;\n private readonly _source: IfcSource;\n\n public constructor(source: IfcSource) {\n super(new Group());\n this._source = source;\n\n this._components = new Components();\n this._components.ui.enabled = false;\n\n this._components.scene = new SimpleScene(this._components);\n this._components.renderer = new SimpleRenderer(\n this._components,\n document.createElement('div'),\n );\n this._components.camera = new SimpleCamera(this._components);\n this._components.raycaster = new SimpleRaycaster(this._components);\n\n this._components.init();\n\n this._ifcSelection = { bbox: {}, selection: {} };\n this._indexMap = {};\n this._classificationCache = null;\n this._fragmentBoundingBox = null;\n }\n\n public static isIFCEntity = (obj: unknown): obj is IfcEntity =>\n isObject(obj) && (obj as IfcEntity).isIfcEntity;\n\n public static isIFCPickResult = (obj: unknown): obj is IFCPickResult =>\n isObject(obj) && IfcEntity.isIFCEntity((obj as PickResult<unknown>).entity);\n\n public clearHighlight(name: FragmentTypeName = 'selection'): void {\n for (const fragID of Object.keys(this._ifcSelection[name])) {\n const fragment = this._fragmentManager.list[fragID];\n const selection = fragment?.fragments[name];\n if (selection != null) {\n selection.mesh.removeFromParent();\n }\n }\n this.notifyChange(this);\n\n this._ifcSelection[name] = {};\n }\n\n public getBoundingBoxById(ids: FragmentIdMap): Box3 | undefined {\n this.clearHighlight('bbox');\n this.highlightById(ids, 'bbox');\n\n const bbox = this._fragmentBoundingBox;\n if (bbox === null) {\n throw new Error('Must call initClassification before getBoundingBoxById');\n }\n\n const fragments = this._fragmentManager;\n bbox.reset();\n\n const selected = this._ifcSelection.bbox;\n if (!Object.keys(selected).length) {\n return;\n }\n for (const fragID of Object.keys(selected)) {\n const fragment = fragments.list[fragID];\n const highlight = fragment.fragments['bbox'];\n bbox.addMesh(highlight.mesh);\n }\n\n const box = bbox.get();\n\n // since Giro3D is Z-up, we need to swap Y and Z, and then invert the sign of\n // the new Y (i.e the Z before the swap).\n const { y: ymin, z: zmin } = box.min;\n const { y: ymax, z: zmax } = box.max;\n\n box.min.y = -zmax;\n box.max.y = -zmin;\n box.min.z = ymin;\n box.max.z = ymax;\n\n box.translate(this._model.position);\n\n this.clearHighlight('bbox');\n return box;\n }\n\n public getClassification(): ClassificationItem[] {\n if (this._classificationCache === null) {\n throw new Error('Must call initClassification before getClassification');\n }\n return this._classificationCache;\n }\n\n public getProperties(expressID: string): IFCProperty[] {\n const properties = [];\n const objectRawProperties = this._model.properties;\n if (!objectRawProperties) {\n return [];\n }\n\n for (const id of this._indexMap[expressID]) {\n const entity = objectRawProperties[id];\n if (entity == null) {\n continue;\n }\n const { name } = IfcPropertiesUtils.getEntityName(objectRawProperties, id);\n if (name === null) {\n continue;\n }\n\n if (entity.type === IFCPROPERTYSET) {\n const psetPropsIds = IfcPropertiesUtils.getPsetProps(objectRawProperties, id);\n if (psetPropsIds !== null) {\n for (const psetPropId of psetPropsIds) {\n const psetProp = objectRawProperties[psetPropId];\n if (psetProp == null) {\n continue;\n }\n const psetProperties = this.getProperty(psetPropId);\n if (psetProperties === null) {\n continue;\n }\n properties.push({\n parentName: name,\n ...psetProperties,\n });\n }\n }\n } else if (entity.type === IFCELEMENTQUANTITY) {\n const qsetQuantityIds = IfcPropertiesUtils.getQsetQuantities(\n objectRawProperties,\n id,\n );\n if (qsetQuantityIds !== null) {\n for (const quantityId of qsetQuantityIds) {\n const { key } = IfcPropertiesUtils.getQuantityValue(\n objectRawProperties,\n quantityId,\n );\n if (key === null) {\n continue;\n }\n const qsetProperties = this.getProperty(quantityId);\n if (qsetProperties === null) {\n continue;\n }\n properties.push({\n parentName: name,\n ...qsetProperties,\n });\n }\n }\n }\n }\n\n return properties;\n }\n\n public getProperty(expressID: number): { name: string; value: number | null } | null {\n const properties = this._model.properties;\n if (properties === undefined) {\n return null;\n }\n\n const { name } = IfcPropertiesUtils.getEntityName(properties, expressID);\n if (name === null) {\n return null;\n }\n\n const { value } = IfcPropertiesUtils.getQuantityValue(properties, expressID);\n return { name, value };\n }\n\n public highlight(name: FragmentTypeName, mesh: FragmentMesh, itemId: string): void {\n this._ifcSelection[name][mesh.uuid] = new Set<string>();\n\n const idNum = parseInt(itemId, 10);\n this._ifcSelection[name][mesh.uuid].add(itemId);\n this.addComposites(name, mesh, idNum);\n this.regenerate(name, mesh.uuid);\n\n const group = mesh.fragment.group;\n if (group) {\n const keys = group.data[idNum][0];\n for (let i = 0; i < keys.length; i++) {\n const fragKey = keys[i];\n const fragID = group.keyFragments[fragKey];\n const fragment = this._fragmentManager.list[fragID];\n\n if (!(fragID in this._ifcSelection[name])) {\n this._ifcSelection[name][fragID] = new Set<string>();\n }\n this._ifcSelection[name][fragID].add(itemId);\n this.addComposites(name, fragment.mesh, idNum);\n this.regenerate(name, fragID);\n }\n }\n this.notifyChange(this);\n }\n\n public highlightById(ids: FragmentIdMap, name: FragmentTypeName = 'selection'): void {\n for (const fragID of Object.keys(ids)) {\n if (!(fragID in this._ifcSelection[name])) {\n this._ifcSelection[name][fragID] = new Set<string>();\n }\n\n const fragment = this._fragmentManager.list[fragID];\n\n const idsNum = new Set<number>();\n for (const id of ids[fragID]) {\n this._ifcSelection[name][fragID].add(id);\n idsNum.add(parseInt(id, 10));\n }\n for (const id of idsNum) {\n this.addComposites(name, fragment.mesh, id);\n }\n this.regenerate(name, fragID);\n }\n\n this.notifyChange(this);\n }\n\n public override pick(canvasCoords: Vector2, options?: PickOptions): IFCPickResult[] {\n return super.pick(canvasCoords, options).map(p => ({\n ...p,\n entity: this,\n features: p.features as IFCFeature[] | undefined,\n isIFCPickResult: true,\n object: p.object as FragmentMesh,\n }));\n }\n\n public pickFeaturesFrom(pickedResult: IFCPickResult): IFCFeature[] {\n const mesh = pickedResult.object;\n if (mesh.fragment != null && pickedResult.instanceId != null && pickedResult.face) {\n const blockId = mesh.fragment.getVertexBlockID(mesh.geometry, pickedResult.face.a);\n\n const itemId = mesh.fragment\n .getItemID(pickedResult.instanceId, blockId)\n ?.replace(/\\..*/, '');\n\n // @ts-expect-error IfcProperties defines indexes as numbers, but actually are strings\n if (itemId && mesh.fragment.group?.properties?.[itemId] != null) {\n const properties = mesh.fragment.group.properties;\n // @ts-expect-error IfcProperties defines indexes as numbers, but actually are strings\n const itemProperties = properties[itemId];\n const ifcProperties = this.getProperties(itemId);\n\n const result = [{ ifcProperties, itemProperties }];\n pickedResult.features = result;\n return result;\n }\n }\n return [];\n }\n\n protected async initClassification(): Promise<void> {\n this._classificationCache = await this.regenerateClassification([\n ClassificationSystem.STOREY,\n ClassificationSystem.ENTITY,\n ]);\n if (this._classificationCache.length === 0) {\n // Maybe we don't have storeys, try to classify by entity\n this._classificationCache = await this.regenerateClassification([\n ClassificationSystem.ENTITY,\n ]);\n }\n this._fragmentBoundingBox = await this._components.tools.get(FragmentBoundingBox);\n }\n\n protected override async preprocess(): Promise<void> {\n const data = await Fetcher.fetchArrayBuffer(this._source.url);\n\n this._fragmentManager = await this._components.tools.get(FragmentManager);\n\n this._fragmentClassifier = await this._components.tools.get(FragmentClassifier);\n const fragmentIfcLoader = new FragmentIfcLoader(this._components);\n\n fragmentIfcLoader.settings.webIfc.COORDINATE_TO_ORIGIN = true;\n fragmentIfcLoader.settings.webIfc.OPTIMIZE_PROFILES = true;\n\n const buffer = new Uint8Array(data);\n this._model = await fragmentIfcLoader.load(buffer, this._source.name);\n\n // IFC models are Y-up, so we need to rotate them to be Z-up.\n this._model.rotateX(Math.PI / 2);\n\n const position = new Vector3();\n // If custom coordinates are provided, we ignore the IFC's placement\n if (this._source.at) {\n this._source.at.toVector3(position);\n this._model.position.copy(position);\n } else {\n // Since we are loading the model with COORDINATE_TO_ORIGIN = true, all vertices will be\n // expressed as an offset from the root object, rather than their absolute world space\n // positions. We then have to compute a transformation matrix to put the object back in\n // its original position.\n // For this, we use the undocumented coordination matrix which is the transformation\n // from world to local space.\n //\n // However, since Giro3D is Z-up, we need to swap Y and Z, and then invert the sign of\n // the new Y (i.e the Z before the swap).\n //\n // Important note: the IFC's origin is not transformed to the instance's CRS. We assume that\n // The IFC file is in the same coordinate system as the instance.\n const coordinationMatrix = this._model.coordinationMatrix.clone().invert();\n position.applyMatrix4(coordinationMatrix);\n this._model.position.set(position.x, -position.z, position.y);\n }\n\n this._model.updateWorldMatrix(true, true);\n this._model.updateMatrix();\n this._model.updateMatrixWorld(true);\n this.initializeEntityIndexes();\n\n this._fragmentClassifier.byStorey(this._model);\n this._fragmentClassifier.byEntity(this._model);\n\n await this.initClassification();\n\n this.object3d.add(this._model);\n this.onObjectCreated(this._model);\n\n const context = Fetcher.getContext(this._source.url);\n fillObject3DUserData(this, { filename: context.filename });\n\n this.notifyChange(this.object3d);\n }\n\n private addComposites(name: FragmentTypeName, mesh: FragmentMesh, itemID: number): void {\n this.addHighlightToFragment(name, mesh.fragment);\n const composites = mesh.fragment.composites[itemID];\n if (composites) {\n for (let i = 1; i < composites; i++) {\n const compositeID = toCompositeID(itemID, i);\n this._ifcSelection[name][mesh.uuid].add(compositeID);\n }\n }\n }\n\n private addHighlightToFragment(name: FragmentTypeName, fragment: Fragment): void {\n if (!(name in fragment.fragments)) {\n const subFragment = fragment.addFragment(name, [materials[name]]);\n if (fragment.blocks.count > 1) {\n subFragment.setInstance(0, {\n ids: Array.from(fragment.ids),\n transform: tempMatrix,\n });\n subFragment.blocks.setVisibility(false);\n }\n\n this._model.add(subFragment.mesh);\n\n subFragment.mesh.renderOrder = 30;\n subFragment.mesh.frustumCulled = false;\n subFragment.mesh.name = name;\n subFragment.mesh.updateMatrixWorld(true);\n }\n }\n\n private initializeEntityIndexes(): void {\n this._indexMap = {};\n const properties = this._model.properties;\n if (properties === undefined) {\n return;\n }\n\n for (const relation of relationsToProcess) {\n IfcPropertiesUtils.getRelationMap(properties, relation, (relationID, relatedIDs) => {\n const relationEntity = properties[relationID];\n if (!setEntities.includes(relationEntity.type)) {\n this.setEntityIndex(relationID);\n }\n for (const expressID of relatedIDs) {\n this.setEntityIndex(expressID).add(relationID);\n }\n });\n }\n }\n\n private regenerate(name: FragmentTypeName, fragID: string): void {\n this.updateFragmentFill(name, fragID);\n }\n\n private async regenerateClassification(\n groupSystemNames: string[],\n result = {},\n ): Promise<ClassificationItem[]> {\n const systems = this._fragmentClassifier.get();\n const groups: ClassificationItem[] = [];\n const currentSystemName = groupSystemNames[0]; // storeys\n const systemGroups = systems[currentSystemName];\n\n if (currentSystemName == null || systemGroups == null) {\n return groups;\n }\n for (const name of Object.keys(systemGroups)) {\n // name is N00, N01, N02...\n // { storeys: \"N00\" }, { storeys: \"N01\" }...\n const filter = { ...result, [currentSystemName]: [name] };\n const found = await this._fragmentClassifier.find(filter);\n const hasElements = Object.keys(found).length > 0;\n\n if (hasElements) {\n const firstLetter = currentSystemName[0].toUpperCase();\n const treeItemName = firstLetter + currentSystemName.slice(1); // Storeys\n const children = await this.regenerateClassification(\n groupSystemNames.slice(1),\n filter,\n );\n\n groups.push({ children, fragments: found, name, treeItemName });\n }\n }\n return groups;\n }\n\n private setEntityIndex(expressID: number): Set<number> {\n if (!(expressID in this._indexMap)) {\n this._indexMap[expressID] = new Set();\n }\n return this._indexMap[expressID];\n }\n private updateFragmentFill(name: FragmentTypeName, fragmentID: string): void {\n const ids = this._ifcSelection[name][fragmentID];\n const fragment = this._fragmentManager.list[fragmentID];\n if (fragment == null) {\n return;\n }\n const selection = fragment.fragments[name];\n if (selection == null) {\n return;\n }\n\n const fragmentParent = fragment.mesh.parent;\n if (fragmentParent == null) {\n return;\n }\n fragmentParent.add(selection.mesh);\n\n const isBlockFragment = selection.blocks.count > 1;\n if (isBlockFragment) {\n fragment.getInstance(0, tempMatrix);\n selection.setInstance(0, {\n ids: Array.from(fragment.ids),\n transform: tempMatrix,\n });\n\n selection.blocks.setVisibility(true, ids, true);\n } else {\n let i = 0;\n for (const id of ids) {\n selection.mesh.count = i + 1;\n const { instanceID } = fragment.getInstanceAndBlockID(id);\n fragment.getInstance(instanceID, tempMatrix);\n selection.setInstance(i, { ids: [id], transform: tempMatrix });\n i++;\n }\n }\n }\n}\n","import type Instance from '@giro3d/giro3d/core/Instance';\nimport type GUI from 'lil-gui';\n\nimport EntityInspector from '@giro3d/giro3d/gui/EntityInspector';\n\nimport type IfcEntity from './IfcEntity';\n\nexport default class IfcEntityInspector extends EntityInspector<IfcEntity> {\n public constructor(parentGui: GUI, instance: Instance, entity: IfcEntity) {\n super(parentGui, instance, entity, { visibility: true });\n }\n}\n","<script setup lang=\"ts\">\n import { MathUtils } from 'three';\n import { ref } from 'vue';\n\n import type IfcEntity from '@/modules/ifc/IfcEntity';\n import type { ClassificationItem } from '@/modules/ifc/IfcEntity';\n\n import IconList from '@/components/atoms/IconList.vue';\n import IconListButton from '@/components/atoms/IconListButton.vue';\n import ListLabelButton from '@/components/atoms/ListLabelButton.vue';\n import { useAnalysisStore } from '@/stores/analysis';\n import { useCameraStore } from '@/stores/camera';\n\n const props = defineProps<{\n classificationElement: ClassificationItem;\n ifcEntity: IfcEntity;\n }>();\n\n const id = MathUtils.generateUUID();\n const target = `#${id}`;\n\n const highlighted = ref(false);\n const cameraStore = useCameraStore();\n const analysis = useAnalysisStore();\n\n function clipTo(): void {\n const bbox = props.ifcEntity.getBoundingBoxById(props.classificationElement.fragments);\n if (bbox && !bbox.isEmpty()) {\n analysis.setClippingBox(bbox);\n analysis.enableClippingBox(true);\n }\n }\n\n function highlight(): void {\n highlighted.value = true;\n props.ifcEntity.clearHighlight();\n props.ifcEntity.highlightById(props.classificationElement.fragments);\n\n setTimeout(() => (highlighted.value = false), 2000);\n }\n\n function zoomTo(): void {\n const bbox = props.ifcEntity.getBoundingBoxById(props.classificationElement.fragments);\n if (bbox && !bbox.isEmpty()) {\n cameraStore.lookTopDownAt(bbox);\n }\n }\n</script>\n\n<template>\n <div>\n <div class=\"d-flex\">\n <span\n class=\"border rounded px-1 py-0 fw-normal\"\n :class=\"\n highlighted ? 'text-danger border-danger' : 'text-secondary border-secondary'\n \"\n :title=\"classificationElement.treeItemName\"\n >{{ classificationElement.treeItemName }}</span\n >\n <IconList v-if=\"classificationElement.children.length > 0\">\n <IconListButton\n title=\"Expand group\"\n icon=\"bi-chevron-down\"\n data-bs-toggle=\"collapse\"\n :data-bs-target=\"target\"\n :aria-controls=\"id\"\n aria-expanded=\"true\"\n />\n </IconList>\n <ListLabelButton\n class=\"label\"\n :class=\"highlighted ? 'text-danger-emphasis' : 'text-muted'\"\n :text=\"classificationElement.name\"\n :title=\"`Zoom to ${classificationElement.name}`\"\n @click=\"zoomTo\"\n />\n <IconList class=\"ms-1\">\n <IconListButton title=\"Highlight\" icon=\"bi-highlighter\" @click=\"highlight\" />\n <IconListButton title=\"Clip to\" icon=\"bi-bounding-box\" @click=\"clipTo\" />\n </IconList>\n </div>\n <div v-if=\"classificationElement.children.length > 0\" :id=\"id\" class=\"collapse show\">\n <ul class=\"list-unstyled border-start\">\n <li v-for=\"(item, index) in classificationElement.children\" :key=\"index\">\n <IfcSubtree :ifc-entity=\"props.ifcEntity\" :classification-element=\"item\" />\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style scoped>\n ul {\n margin-left: 0.5rem;\n padding-left: 0.5rem;\n }\n</style>\n","<script setup lang=\"ts\">\n import type { Dataset } from '@/types/Dataset';\n\n import { useDatasetStore } from '@/stores/datasets';\n import { refAndWatch } from '@/utils/Components';\n\n import type IfcEntity from './IfcEntity';\n import type { ClassificationItem } from './IfcEntity';\n\n import IfcSubtree from './IfcSubtree.vue';\n\n const datasets = useDatasetStore();\n\n const props = defineProps<{\n dataset: Dataset;\n }>();\n\n const isPreloaded = refAndWatch(props.dataset, 'isPreloaded');\n\n function getClassificationRoot(): ClassificationItem[] | null {\n const ifcEntity = getIfcEntity();\n\n if (ifcEntity == null) {\n return null;\n }\n\n return ifcEntity.getClassification();\n }\n\n function getIfcEntity(): IfcEntity | null {\n const entity = datasets.getEntity(props.dataset);\n\n if (entity == null) {\n return null;\n }\n\n return entity as IfcEntity;\n }\n</script>\n\n<template>\n <div v-if=\"isPreloaded\">\n <ul>\n <li v-for=\"(item, index) in getClassificationRoot()\" :key=\"index\">\n <IfcSubtree\n :ifc-entity=\"getIfcEntity() as IfcEntity\"\n :classification-element=\"item\"\n />\n </li>\n </ul>\n </div>\n</template>\n\n<style scoped>\n ul {\n font-size: smaller;\n }\n</style>\n","import type PickResult from '@giro3d/giro3d/core/picking/PickResult';\n\nimport EntityPanel from '@giro3d/giro3d/gui/EntityPanel';\nimport { IfcCategoryMap } from 'openbim-components';\n\nimport type { PieroContext } from '@/context';\nimport type { EntityBuilder } from '@/giro3d/EntityBuilder';\nimport type { LoadDatasetFromFile } from '@/loaders/loader';\nimport type { Module } from '@/module';\nimport type { HighlightFn } from '@/services/Highlighter';\nimport type { AttributeExtractorFn } from '@/services/Picker';\nimport type { IFCDatasetConfig } from '@/types/configuration/datasets/ifc';\nimport type { Attribute, AttributesGroups } from '@/types/Feature';\n\nimport { getCoordinates } from '@/utils/Configuration';\nimport Fetcher from '@/utils/Fetcher';\n\nimport IfcEntity, { isIFCPickResult } from './ifc/IfcEntity';\nimport IfcEntityInspector from './ifc/IfcEntityInspector';\nimport IfcPropertyView from './ifc/IfcPropertyView.vue';\n\nconst highlight: HighlightFn = (pick: PickResult) => {\n if (isIFCPickResult(pick)) {\n const mesh = pick.object;\n if (mesh.fragment != null && pick.face && pick.instanceId != null) {\n const blockId = mesh.fragment.getVertexBlockID(mesh.geometry, pick.face.a);\n\n const itemId = mesh.fragment.getItemID(pick.instanceId, blockId).replace(/\\..*/, '');\n\n pick.entity.highlight('selection', mesh, itemId);\n\n return () => pick.entity.clearHighlight();\n }\n }\n\n return null;\n};\n\nconst loader: LoadDatasetFromFile<IFCDatasetConfig> = context => {\n return {\n name: context.filename,\n source: {\n url: context.file,\n },\n type: 'ifc',\n visible: true,\n } satisfies IFCDatasetConfig;\n};\n\nconst attributeExtractor: AttributeExtractorFn = (\n pickResult: PickResult,\n attributesGroups: AttributesGroups,\n) => {\n if (!isIFCPickResult(pickResult)) {\n return;\n }\n\n const feature = pickResult.features?.at(0);\n if (!feature) {\n return;\n }\n\n if (!attributesGroups.has('IFC')) {\n attributesGroups.set('IFC', []);\n }\n const attributes = attributesGroups.get('IFC') as Attribute[];\n\n const { ifcProperties, itemProperties } = feature;\n\n const nullValue = 'NULL';\n const name = itemProperties.Name?.value ?? nullValue;\n\n attributes.push({\n key: 'Site',\n value: pickResult.entity.object3d.userData?.dataset?.name ?? nullValue,\n });\n attributes.push({\n key: 'IFCType',\n value: IfcCategoryMap[itemProperties.type] ?? nullValue,\n });\n attributes.push({ key: 'Name', value: name });\n attributes.push({ key: 'ID', value: itemProperties.expressID });\n attributes.push({ key: 'GlobalId', value: itemProperties.GlobalId?.value ?? nullValue });\n if (itemProperties.Description?.value != null) {\n attributes.push({ key: 'Description', value: itemProperties.Description.value });\n }\n if (itemProperties.PredefinedType?.value != null) {\n attributes.push({ key: 'PredefinedType', value: itemProperties.PredefinedType.value });\n }\n if (itemProperties.ObjectType?.value != null) {\n attributes.push({ key: 'ObjectType', value: itemProperties.ObjectType.value });\n }\n\n for (const { name, parentName, value } of ifcProperties) {\n if (!attributesGroups.has(parentName)) {\n attributesGroups.set(parentName, []);\n }\n attributesGroups.get(parentName)?.push({ key: name, value });\n }\n};\n\nconst entityBuilder: EntityBuilder = context => {\n const dataset = context.dataset;\n\n const cfg = dataset.config as IFCDatasetConfig;\n const at = getCoordinates(cfg.source.position ?? dataset.get('position'));\n const entity = new IfcEntity({\n ...cfg.source,\n at,\n name: dataset.name,\n });\n\n return Promise.resolve(entity);\n};\n\n/**\n * Loads IFC (Industry Foundation Classes) files.\n */\nexport default class IFCLoader implements Module {\n public readonly name = 'IFC';\n\n public async initialize(context: PieroContext): Promise<void> {\n context.datasets.registerDatasetType('ifc', {\n attributeExtractor,\n entityBuilder,\n fileExtensions: ['ifc'],\n highlight,\n icon: 'bi-building',\n loader,\n name: 'IFC',\n propertyView: IfcPropertyView,\n });\n\n EntityPanel.registerInspector('IfcEntity', IfcEntityInspector);\n\n // Preload web-ifc.wasm\n await Fetcher.fetch('web-ifc.wasm').catch(e => {\n console.warn('Could not load web-ifc.wasm', e);\n });\n }\n}\n","import type PickableFeatures from '@giro3d/giro3d/core/picking/PickableFeatures';\nimport type PickResult from '@giro3d/giro3d/core/picking/PickResult';\n\nimport Entity3D from '@giro3d/giro3d/entities/Entity3D';\nimport { Color, DoubleSide, Group, Mesh, MeshLambertMaterial } from 'three';\nimport { PLYLoader as PLYThreeLoader } from 'three/examples/jsm/loaders/PLYLoader.js';\n\nimport type {\n CoordinatesMixin,\n FeatureProjectionMixin,\n UrlOrDataMixin,\n} from '@/giro3d/sources/mixins';\n\nimport { fillObject3DUserData } from '@/loaders/userData';\nimport Fetcher from '@/utils/Fetcher';\nimport { isObject } from '@/utils/Types';\n\n/**\n * Feature returned when picking on Ply objects\n */\nexport interface PlyFeature {\n color: Color;\n}\n\n/** Parameters for creating {@link PlyEntity} */\nexport interface PlySource\n extends Required<CoordinatesMixin>,\n Required<FeatureProjectionMixin>,\n UrlOrDataMixin {}\n\n/**\n * PLY 3D object implementing our picking\n */\nexport class PlyMesh extends Mesh implements PickableFeatures<PlyFeature> {\n public readonly isPickableFeatures = true;\n public readonly isPlyMesh = true;\n\n public static isPlyMesh = (obj: unknown): obj is PlyMesh =>\n isObject(obj) && (obj as PlyMesh).isPlyMesh;\n\n public static isPlyPickResult = (obj: unknown): obj is PickResult<PlyFeature> =>\n isObject(obj) && PlyMesh.isPlyMesh((obj as PickResult<unknown>)?.object);\n\n public pickFeaturesFrom(pickedResult: PickResult): PlyFeature[] {\n if (this.geometry.hasAttribute('color') && pickedResult.face) {\n const colors = this.geometry.getAttribute('color').array;\n const face = pickedResult.face;\n\n const color = new Color(\n colors[face.a * 3],\n colors[face.a * 3 + 1],\n colors[face.a * 3 + 2],\n );\n const result = [{ color }];\n pickedResult.features = result;\n return result;\n }\n\n return [];\n }\n}\n\n/**\n * Entity for displaying a PLY file\n */\nexport default class PlyEntity extends Entity3D {\n public readonly isPlyEntity = true;\n public readonly source: PlySource;\n\n public constructor(source: PlySource) {\n super(new Group());\n this.source = source;\n }\n\n protected override async preprocess(): Promise<void> {\n const data = await Fetcher.fetchArrayBuffer(this.source.url);\n\n const position = this.source.at.as(this.source.featureProjection).toVector3();\n\n const loader = new PLYThreeLoader();\n const geometry = loader.parse(data);\n\n const material = new MeshLambertMaterial({\n side: DoubleSide,\n });\n if (geometry.hasAttribute('color')) {\n material.vertexColors = true;\n }\n geometry.computeVertexNormals();\n\n const mesh = new PlyMesh(geometry, material);\n mesh.name = 'plyModel';\n geometry.computeBoundingBox();\n\n mesh.position.copy(position);\n mesh.updateWorldMatrix(true, true);\n\n this.object3d.add(mesh);\n this.onObjectCreated(mesh);\n\n const context = Fetcher.getContext(this.source.url);\n fillObject3DUserData(this, { filename: context.filename });\n\n this.notifyChange(this.object3d);\n }\n}\n","import type PickResult from '@giro3d/giro3d/core/picking/PickResult';\n\nimport type { PieroContext } from '@/context';\nimport type { EntityBuilder } from '@/giro3d/EntityBuilder';\nimport type { Module } from '@/module';\nimport type { AttributeExtractorFn } from '@/services/Picker';\nimport type { PLYDatasetConfig } from '@/types/configuration/datasets/ply';\nimport type { Attribute, AttributesGroups } from '@/types/Feature';\n\nimport { getCoordinates } from '@/utils/Configuration';\n\nimport PlyEntity, { PlyMesh } from './ply/PlyEntity';\n\nconst build: EntityBuilder = context => {\n const { dataset, instance } = context;\n\n const cfg = dataset.config as PLYDatasetConfig;\n const at = getCoordinates(cfg.source.position ?? dataset.get('position'));\n const entity = new PlyEntity({\n ...cfg.source,\n at,\n featureProjection: instance.referenceCrs,\n });\n\n return Promise.resolve(entity);\n};\n\nconst getAttributesFromPlyObject: AttributeExtractorFn = (\n pickResult: PickResult,\n attributesGroups: AttributesGroups,\n) => {\n if (!PlyMesh.isPlyPickResult(pickResult)) {\n return;\n }\n\n const feature = pickResult.features?.at(0);\n if (!feature) {\n return;\n }\n\n if (!attributesGroups.has('PLY')) {\n attributesGroups.set('PLY', []);\n }\n const plyAttributes = attributesGroups.get('PLY') as Attribute[];\n\n plyAttributes.push({ key: 'Color', value: feature.color });\n};\n\n/**\n * Loads .ply files.\n */\nexport default class PLYLoader implements Module {\n public readonly name = 'PLY';\n\n public initialize(context: PieroContext): Promise<void> | void {\n context.datasets.registerDatasetType('ply', {\n attributeExtractor: getAttributesFromPlyObject,\n entityBuilder: build,\n icon: 'bi-file-earmark-binary',\n name: 'PLY',\n });\n }\n}\n","import PointCloud from '@giro3d/giro3d/entities/PointCloud';\nimport PotreeSource from '@giro3d/giro3d/sources/PotreeSource';\n\nimport type { PieroContext } from '@/context';\nimport type { EntityBuilder } from '@/giro3d/EntityBuilder';\nimport type { Module } from '@/module';\nimport type { PotreePointCloudDatasetConfig } from '@/types/configuration/datasets/potreePointCloud';\n\nimport { fillObject3DUserData } from '@/loaders/userData';\n\nconst entityBuilder: EntityBuilder = context => {\n const cfg = context.dataset.config as PotreePointCloudDatasetConfig;\n\n const entity = new PointCloud({\n source: new PotreeSource({ url: `${cfg.source.url}/${cfg.source.filename}` }),\n });\n\n fillObject3DUserData(entity, {\n filename: cfg.source.url,\n });\n\n return Promise.resolve(entity);\n};\n\n/**\n * Loads [Potree](https://potree.github.io/) datasets.\n */\nexport default class PotreeLoader implements Module {\n public readonly name = 'Potree';\n\n public initialize(context: PieroContext): Promise<void> | void {\n context.datasets.registerDatasetType('potree', {\n entityBuilder,\n icon: 'fg-multipoint',\n name: 'Potree Point Cloud',\n });\n }\n}\n","import Shepherd from 'shepherd.js';\n\nimport type { PieroContext } from '@/context';\nimport type { Module } from '@/module';\n\nimport { hasExperimentalFeature } from '@/utils/Configuration';\n\nimport type CameraController from '../services/CameraController';\n\ninterface TourEvent {\n previous?: Shepherd.Step;\n step: Shepherd.Step;\n tour: Shepherd.Tour & {\n id: string;\n };\n}\n\ntype Tours = {\n readonly analyzingTour: Shepherd.Tour;\n readonly mainTour: Shepherd.Tour;\n readonly navigatingTour: Shepherd.Tour;\n};\n\n/**\n * Provides a guided tour of the application.\n */\nexport default class TourModule implements Module {\n public readonly name = 'Tour';\n\n private _camera: CameraController | null = null;\n private _cameraCallback: (() => void) | null = null;\n private _context: PieroContext | null = null;\n private _tours: Tours | null = null;\n\n public initialize(context: PieroContext): Promise<void> | void {\n this._context = context;\n context.events.addEventListener('ready', this.start.bind(this));\n }\n\n private buildTours(): Tours {\n const camera = this._camera as CameraController;\n\n const mainTour = new Shepherd.Tour({\n tourName: 'main',\n useModalOverlay: true,\n });\n const navigatingTour = new Shepherd.Tour({\n tourName: 'navigating',\n useModalOverlay: true,\n });\n const analyzingTour = new Shepherd.Tour({\n tourName: 'analyzing',\n useModalOverlay: true,\n });\n\n const buttonsOptions = [\n { action: (): void => Shepherd.activeTour?.next(), text: 'Next' },\n { action: (): void => Shepherd.activeTour?.cancel(), secondary: true, text: 'Exit' },\n ];\n\n const displayProgress = (): void => {\n const currentStep = Shepherd.activeTour?.getCurrentStep();\n const currentStepElement = currentStep?.getElement();\n const content = currentStepElement?.querySelector('.shepherd-text');\n const steps = Shepherd.activeTour?.steps;\n\n if (\n currentStep == null ||\n currentStepElement == null ||\n content == null ||\n steps == null\n ) {\n return;\n }\n\n const progress = document.createElement('div');\n progress.className = 'progress mt-3';\n progress.setAttribute('role', 'progressbar');\n progress.style.height = '2px';\n\n const progressbar = document.createElement('div');\n progressbar.className = 'progress-bar bg-success';\n progressbar.style.width = `${100 * (steps.indexOf(currentStep) / steps.length)}%`;\n\n progress.appendChild(progressbar);\n content.appendChild(progress);\n };\n\n const loadPanel = async (\n panelId: string,\n waitSelector: string,\n ): Promise<Element | null> => {\n return new Promise(resolve => {\n const link = document.getElementById(panelId);\n if (link && !link.classList.contains('active')) {\n link.click();\n }\n\n if (document.querySelector(waitSelector)) {\n return resolve(document.querySelector(waitSelector));\n }\n\n const observer = new MutationObserver(() => {\n if (document.querySelector(waitSelector)) {\n observer.disconnect();\n resolve(document.querySelector(waitSelector));\n }\n });\n\n // If you get \"parameter 1 is not of type 'Node'\" error, see https://stackoverflow.com/a/77855838/492336\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n });\n });\n };\n\n mainTour.addStep({\n buttons: [\n {\n action: (): void => {\n Shepherd.activeTour?.complete();\n navigatingTour.show(0);\n },\n text: 'Navigating',\n },\n {\n action: (): void => {\n Shepherd.activeTour?.complete();\n analyzingTour.show(0);\n },\n text: 'Analyzing data',\n },\n {\n action: (): void => Shepherd.activeTour?.cancel(),\n secondary: true,\n text: 'Exit',\n },\n ],\n cancelIcon: { enabled: true, label: 'Exit tutorial' },\n id: 'example-step',\n text: '<p>Welcome to <strong>Piero</strong>, the Giro3D application.<br/>We can guide you through the different features.</p>',\n title: 'Welcome!',\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#main-view',\n on: 'bottom',\n },\n buttons: buttonsOptions,\n id: 'view',\n text: '<p>This is the <b>main view</b>.</p><p>Giro3D natively supports a broad range of data sources, from 2D raster and vector data, to 3D point clouds and tilesets.</p><p>Piero adds support for CityJSON and IFC files.</p>',\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#main-view',\n on: 'bottom',\n },\n buttons: buttonsOptions,\n id: 'navigate',\n text: '<p>This application integrates <a href=\"https://github.com/yomotsu/camera-controls\">camera-controls</a>, a camera control for three.js.</p><p><b>Click</b> to move the camera. <b>Right-click</b> to rotate around a point. <b>Scroll</b> to zoom in or out.</p>',\n when: {\n hide: () => {\n if (this._cameraCallback) {\n camera.removeEventListener('interaction-end', this._cameraCallback);\n }\n this._cameraCallback = null;\n },\n show: () => {\n let nbEvents = 0;\n this._cameraCallback = (): void => {\n nbEvents += 1;\n if (nbEvents > 2) {\n Shepherd.activeTour?.next();\n }\n };\n camera.addEventListener('interaction-end', this._cameraCallback);\n displayProgress();\n },\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#toolbar',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-datasets', '#datasets-drop-zone'),\n buttons: buttonsOptions,\n id: 'toolbar-layers',\n text: '<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>',\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#basemap-list',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-datasets', '#datasets-drop-zone'),\n buttons: buttonsOptions,\n id: 'basemaps',\n text: '<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>',\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#overlay-list',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-datasets', '#datasets-drop-zone'),\n buttons: buttonsOptions,\n id: 'overlays',\n text: '<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>',\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#dataset-list',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-datasets', '#datasets-drop-zone'),\n buttons: buttonsOptions,\n id: 'layers',\n text: \"<p>The <b>Datasets</b> panel contains all 3D objects in the scene.</><p>You can toggle their visibility and delete them.<p><p>Most objects leverage Giro3D's adaptive resolution to optimize their display.</p>\",\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#datasets-drop-zone',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-datasets', '#datasets-drop-zone'),\n buttons: buttonsOptions,\n id: 'adddata',\n text: \"<p>You can add your own data from your computer by <b>dragging the file</b> into this page.</p><p>While you won't benefit from Giro3D's tiling mechanism, this can be a great way to quickly visualize datasets up to 100MB.</p><p>This application supports CityJSONs, IFCs, LAS/LAZs, CSV pointclouds, and simple GeoJSON features.</p>\",\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#main-view',\n on: 'bottom',\n },\n buttons: buttonsOptions,\n id: 'attributes',\n text: '<p>By clicking on any feature on the map, you can see its <strong>Attribute table</strong>. Clickable features display a cursor when hovered.</p>',\n when: {\n show: displayProgress,\n },\n });\n\n navigatingTour.addStep({\n attachTo: {\n element: '#search-place-autocomplete',\n on: 'bottom',\n },\n buttons: [\n {\n action: (): void => {\n Shepherd.activeTour?.complete();\n analyzingTour.show(0);\n },\n text: 'Analyzing data',\n },\n {\n action: (): void => Shepherd.activeTour?.complete(),\n secondary: true,\n text: 'Exit',\n },\n ],\n id: 'widgets',\n text: 'Giro3D is highly extensible. Here we added a widget to search and navigate to locations based on the French address database.',\n when: {\n show: displayProgress,\n },\n });\n\n analyzingTour.addStep({\n attachTo: {\n element: '#annotations-fieldset',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-annotations', '#annotations-fieldset'),\n buttons: buttonsOptions,\n id: 'annotation',\n text: '<p>You can <strong>annotate</strong> any data displayed using Giro3D native tools.<br>Select the <strong>geometry</strong> of your annotation, and <strong>click</strong> on the scene to add points. <strong>Right-click</strong> to end the shape.</p>',\n when: {\n show: displayProgress,\n },\n });\n\n analyzingTour.addStep({\n attachTo: {\n element: '#annotations-fieldset',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-annotations', '#annotations-fieldset'),\n buttons: buttonsOptions,\n id: 'annotations',\n text: 'You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.',\n when: {\n show: displayProgress,\n },\n });\n\n if (hasExperimentalFeature('measurements')) {\n analyzingTour.addStep({\n attachTo: {\n element: '#panel-container',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-measures', '#measures-fieldset'),\n buttons: buttonsOptions,\n id: 'measurements',\n text: 'You can add <strong>measurements</strong> to easily get distances betwween objects.<br>Once started, moving the mouse will display the measure. <strong>Click</strong> to save the measurement. <strong>Right-click</strong> to end.',\n when: {\n show: displayProgress,\n },\n });\n }\n\n analyzingTour.addStep({\n attachTo: {\n element: '#panel-container',\n on: 'right',\n },\n beforeShowPromise: () => loadPanel('toolbar-analysis', '#panel-container .card'),\n buttons: [{ action: (): void => Shepherd.activeTour?.complete(), text: 'Done!' }],\n id: 'analysis',\n text: \"In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.\",\n when: {\n show: displayProgress,\n },\n });\n\n const markSkiptour = (): void => {\n const url = new URL(document.URL);\n url.searchParams.delete('tourStep');\n url.searchParams.set('tour', 'none');\n window.history.replaceState({}, '', url.toString());\n };\n\n const markTour = (current: TourEvent): void => {\n const url = new URL(document.URL);\n let tourName = 'main';\n if (current.tour.id.startsWith('navigating')) {\n tourName = 'navigating';\n } else if (current.tour.id.startsWith('analyzing')) {\n tourName = 'analyzing';\n }\n url.searchParams.set('tour', tourName);\n url.searchParams.set('tourStep', current.step.id);\n window.history.replaceState({}, '', url.toString());\n };\n\n mainTour.on('cancel', markSkiptour);\n mainTour.on('complete', markSkiptour);\n mainTour.on('show', markTour);\n\n navigatingTour.on('cancel', markSkiptour);\n navigatingTour.on('complete', markSkiptour);\n navigatingTour.on('show', markTour);\n\n analyzingTour.on('cancel', markSkiptour);\n analyzingTour.on('complete', markSkiptour);\n analyzingTour.on('show', markTour);\n\n return { analyzingTour, mainTour, navigatingTour };\n }\n\n private getTours(): Tours {\n if (!this._tours) {\n this._tours = this.buildTours();\n }\n return this._tours;\n }\n\n private restart(): void {\n const { mainTour } = this.getTours();\n mainTour.show(0);\n }\n\n private start(): void {\n if (!this._context) {\n throw new Error('module is not initialized');\n }\n\n const { analyzingTour, mainTour, navigatingTour } = this.getTours();\n this._camera = this._context.view.getCameraController();\n\n const url = new URL(document.URL);\n const tour = url.searchParams.get('tour') ?? 'main';\n if (tour !== 'none') {\n const tourStep = url.searchParams.get('tourStep') ?? 0;\n if (tour === 'navigating') {\n navigatingTour.show(tourStep);\n } else if (tour === 'analyzing') {\n analyzingTour.show(tourStep);\n } else {\n mainTour.show(tourStep);\n }\n }\n }\n}\n"],"names":["tempMatrix","Matrix4","materials","MeshBasicMaterial","IFCRELDEFINESBYPROPERTIES","IFCRELDEFINESBYTYPE","IFCRELASSOCIATESMATERIAL","IFCRELCONTAINEDINSPATIALSTRUCTURE","IFCRELASSOCIATESCLASSIFICATION","IFCRELASSIGNSTOGROUP","IFCPROPERTYSET","IFCELEMENTQUANTITY","setEntities","relationsToProcess","isIFCPickResult","obj","isObject","_IfcEntity","Entity3D","source","Group","__publicField","Components","SimpleScene","SimpleRenderer","SimpleCamera","SimpleRaycaster","name","fragID","fragment","selection","ids","bbox","fragments","selected","highlight","box","ymin","zmin","ymax","zmax","expressID","properties","objectRawProperties","id","entity","IfcPropertiesUtils","psetPropsIds","psetPropId","psetProperties","qsetQuantityIds","quantityId","key","qsetProperties","value","mesh","itemId","idNum","group","keys","i","fragKey","idsNum","canvasCoords","options","p","pickedResult","blockId","_a","_c","_b","itemProperties","result","FragmentBoundingBox","data","Fetcher","FragmentManager","FragmentClassifier","fragmentIfcLoader","FragmentIfcLoader","buffer","position","Vector3","coordinationMatrix","context","fillObject3DUserData","itemID","composites","compositeID","toCompositeID","subFragment","relation","relationID","relatedIDs","relationEntity","groupSystemNames","systems","groups","currentSystemName","systemGroups","filter","found","treeItemName","children","fragmentID","fragmentParent","instanceID","IfcEntity","IfcEntityInspector","EntityInspector","parentGui","instance","props","__props","MathUtils","target","highlighted","ref","cameraStore","useCameraStore","analysis","useAnalysisStore","clipTo","zoomTo","_createElementBlock","_createElementVNode","_hoisted_1","classificationElement","_hoisted_2","_createBlock","IconList","_createVNode","IconListButton","_unref","ListLabelButton","_normalizeClass","_hoisted_4","_openBlock","_Fragment","item","index","_component_IfcSubtree","datasets","useDatasetStore","isPreloaded","refAndWatch","getClassificationRoot","ifcEntity","getIfcEntity","_renderList","IfcSubtree","pick","loader","attributeExtractor","pickResult","attributesGroups","feature","attributes","ifcProperties","nullValue","_d","IfcCategoryMap","_e","_f","_g","_h","parentName","_i","entityBuilder","dataset","cfg","at","getCoordinates","IFCLoader","IfcPropertyView","EntityPanel","e","_PlyMesh","Mesh","colors","face","Color","PlyMesh","PlyEntity","geometry","PLYThreeLoader","material","MeshLambertMaterial","DoubleSide","build","getAttributesFromPlyObject","PLYLoader","PointCloud","PotreeSource","PotreeLoader","TourModule","camera","mainTour","Shepherd","navigatingTour","analyzingTour","buttonsOptions","displayProgress","currentStep","currentStepElement","content","steps","progress","progressbar","loadPanel","panelId","waitSelector","resolve","link","observer","nbEvents","hasExperimentalFeature","markSkiptour","url","markTour","current","tourName","tour","tourStep"],"mappings":"4jCAsCMA,EAAa,IAAIC,EAAAA,QAWjBC,EAAyB,CAC3B,KAAM,IAAIC,EAAAA,kBAAkB,CACxB,MAAO,UACP,UAAW,GACX,QAAS,GACT,YAAa,EAAA,CAChB,EACD,UAAW,IAAIA,EAAAA,kBAAkB,CAC7B,MAAO,UACP,UAAW,GACX,QAAS,GACT,YAAa,EAAA,CAChB,CACL,EASMC,EAA4B,WAC5BC,EAAsB,UACtBC,EAA2B,WAC3BC,EAAoC,WACpCC,EAAiC,UACjCC,EAAuB,WACvBC,EAAiB,WACjBC,EAAqB,WAGrBC,EAAc,CAACF,EAAgBC,CAAkB,EAGjDE,EAAqB,CACvBT,EACAC,EACAC,EACAC,EACAC,EACAC,CACJ,EAqCaK,EAAmBC,GAC5BC,EAAAA,SAASD,CAAG,GAAMA,EAAsB,gBAWvBE,EAArB,MAAqBA,UACTC,CAEZ,CAgBW,YAAYC,EAAmB,CAClC,MAAM,IAAIC,EAAAA,KAAO,EAhBLC,EAAA,mBAAc,IACdA,EAAA,0BAAqB,IACZA,EAAA,YAAO,aAExBA,EAAA,6BAEAA,EAAA,oBACAA,EAAA,6BACAA,EAAA,4BACAA,EAAA,yBACAA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