@epigraph/solutions 0.3.0 → 0.4.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.
@@ -5064,7 +5064,7 @@ ${r.join(`
5064
5064
  }
5065
5065
 
5066
5066
  }
5067
- `]}updateActiveHotspotIndex(){this.activeHotspot&&(this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotID))}static setupWebComponent(){window.customElements.get(Cc.webComponentName)||window.customElements.define(Cc.webComponentName,Cc)}firstUpdated(){this.__setupEventListeners()}createHotspots(e){for(const t of e){const i=new v_({config:t,appWcRef:this.appWcRef,hotspotManagerRef:this});this.hotspots.set(i.hotspotID,i)}this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}stepHotspots(e){const t=this.activeHotspotIndex;if(t===null)return;const i=this.hotspotsOrder.length;let s=t;e==="next"?(s=t+1,s>=i&&(s=0)):e==="prev"&&(s=t-1,s<0&&(s=i-1));const r=this.hotspotsOrder[s];this.setActiveHotspot({hotspotId:r})}nextHotspot(){return this.stepHotspots("next"),this.appWcRef.appEvents.hotspotNextEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}previousHotspot(){return this.stepHotspots("prev"),this.appWcRef.appEvents.hotspotPreviousEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}updateHotspots(e){for(const t of e){const i=this.hotspots.get(t.hotspotID);i&&i.updateHotspotConfig(t)}this.__resolveHotspotCardContents()}updateHotspotsOrder(e){this.hotspotsOrder=e}removeHotspots(e){this.activeHotspot&&this.closeActiveHotspot();for(const t of e)this.hotspots.delete(t);this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}removeAllHotspots(){this.removeHotspots(Array.from(this.hotspots.keys()))}setActiveHotspotByIndex(e){const t=this.hotspotsOrder[e];this.setActiveHotspot({hotspotId:t,state:this.__cardsState})}setActiveHotspot({hotspotId:e,state:t=this.__cardsState}){if(this.activeHotspot?.hotspotID===e)return;if(e===null){this.activeHotspot=void 0,this.updateActiveHotspotIndex(),this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const i=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents(),this.appWcRef.appEvents.cameraMoveToTransform.fire({cameraTransforms:this.activeHotspot?.camera,saveFirst:i}),this.appWcRef.isPortraitOrientation){let s=0;this.activeHotspot?.desktopPlacement===ar.LEFT?s=.2:this.activeHotspot?.desktopPlacement===ar.RIGHT&&(s=-.2),this.appWcRef.cameraManager.mainCameraControls.setFocalOffset(s,.2,0,!0)}}__resolveHotspotCardContents(){this.__allCards=[];for(const e of this.hotspots.values()){const t=ce`
5067
+ `]}updateActiveHotspotIndex(){this.activeHotspot&&(this.activeHotspotIndex=this.hotspotsOrder.indexOf(this.activeHotspot?.hotspotID))}static setupWebComponent(){window.customElements.get(Cc.webComponentName)||window.customElements.define(Cc.webComponentName,Cc)}firstUpdated(){this.__setupEventListeners()}createHotspots(e){for(const t of e){const i=new v_({config:t,appWcRef:this.appWcRef,hotspotManagerRef:this});this.hotspots.set(i.hotspotID,i)}this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}stepHotspots(e){const t=this.activeHotspotIndex;if(t===null)return;const i=this.hotspotsOrder.length;let s=t;e==="next"?(s=t+1,s>=i&&(s=0)):e==="prev"&&(s=t-1,s<0&&(s=i-1));const r=this.hotspotsOrder[s];this.setActiveHotspot({hotspotId:r})}openHotspot({hotspotId:e,state:t}){this.setActiveHotspot({hotspotId:e,state:t}),this.appWcRef.appEvents.hotspotOpenEvent.fire({hotspot:this.activeHotspot})}closeActiveHotspot(){const e=this.activeHotspot?.hotspotID;this.setActiveHotspot({hotspotId:null}),this.appWcRef.appEvents.hotspotClosedEvent.fire({hotspotId:e})}nextHotspot(){return this.stepHotspots("next"),this.appWcRef.appEvents.hotspotNextEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}previousHotspot(){return this.stepHotspots("prev"),this.appWcRef.appEvents.hotspotPreviousEvent.fire({hotspot:this.activeHotspot}),this.activeHotspot}updateHotspots(e){for(const t of e){const i=this.hotspots.get(t.hotspotID);i&&i.updateHotspotConfig(t)}this.__resolveHotspotCardContents()}updateHotspotsOrder(e){this.hotspotsOrder=e}removeHotspots(e){this.activeHotspot&&this.closeActiveHotspot();for(const t of e)this.hotspots.delete(t);this.updateHotspotsOrder(Array.from(this.hotspots.keys()))}removeAllHotspots(){this.removeHotspots(Array.from(this.hotspots.keys()))}setActiveHotspotByIndex(e){const t=this.hotspotsOrder[e];this.setActiveHotspot({hotspotId:t,state:this.__cardsState})}setActiveHotspot({hotspotId:e,state:t=this.__cardsState}){if(this.activeHotspot?.hotspotID===e)return;if(e===null){this.activeHotspot=void 0,this.updateActiveHotspotIndex(),this.appWcRef.cameraManager.resetCurrentCameraTransformsToLastSavedState();return}this.enabled===!1&&(this.enabled=!0);const i=!this.activeHotspot;if(this.activeHotspot=this.hotspots.get(e),this.updateActiveHotspotIndex(),this.setActiveHotspotState(t),this.__resolveHotspotCardContents(),this.appWcRef.appEvents.cameraMoveToTransform.fire({cameraTransforms:this.activeHotspot?.camera,saveFirst:i}),this.appWcRef.isPortraitOrientation){let s=0;this.activeHotspot?.desktopPlacement===ar.LEFT?s=.2:this.activeHotspot?.desktopPlacement===ar.RIGHT&&(s=-.2),this.appWcRef.cameraManager.mainCameraControls.setFocalOffset(s,.2,0,!0)}}expandCards(){this.__cardsState=Ti.expanded}collapseCards(){this.__cardsState=Ti.collapsed}setActiveHotspotState(e=Ti.collapsed){if(this.activeHotspot)switch(e){case Ti.collapsed:this.collapseCards();break;case Ti.expanded:this.expandCards();break}}__resolveHotspotCardContents(){this.__allCards=[];for(const e of this.hotspots.values()){const t=ce`
5068
5068
  <swiper-slide part="swiper-slide">
5069
5069
  <style>
5070
5070
  .expand-button {
@@ -5108,7 +5108,7 @@ ${r.join(`
5108
5108
  <span part="epg-card-expand-button-span">EXPAND</span>
5109
5109
  </div>
5110
5110
  </swiper-slide>
5111
- `;this.__allCards.push(t)}this.activeHotspot?.desktopPlacement===ar.LEFT?this.__leftCardContents=this.activeHotspot.renderCardTemplate():this.activeHotspot?.desktopPlacement===ar.RIGHT&&(this.__rightCardContents=this.activeHotspot.renderCardTemplate())}expandCards(){this.__cardsState=Ti.expanded}collapseCards(){this.__cardsState=Ti.collapsed}setActiveHotspotState(e=Ti.collapsed){if(this.activeHotspot)switch(e){case Ti.collapsed:this.collapseCards();break;case Ti.expanded:this.expandCards();break}}openHotspot({hotspotId:e,state:t}){this.setActiveHotspot({hotspotId:e,state:t}),this.appWcRef.appEvents.hotspotOpenEvent.fire({hotspot:this.activeHotspot})}closeActiveHotspot(){const e=this.activeHotspot?.hotspotID;this.setActiveHotspot({hotspotId:null}),this.appWcRef.appEvents.hotspotClosedEvent.fire({hotspotId:e})}recalculateHotspotPositions(){this.requestUpdate()}__renderHotspotIndicatorTemplates(){return Array.from(this.hotspots.values()).map(e=>e.renderAnnotationTemplate(this.activeHotspot?.hotspotID))}__onCardsCarouselSlideChange(e){this.setActiveHotspotByIndex(e.detail.newSlideIndex)}__onExpandButtonClicked(e){e.stopPropagation(),e.preventDefault(),this.setActiveHotspotState(Ti.expanded)}__renderMobileHotspotCardTemplates(){const e=this.__cardsState===Ti.expanded?Ti.expanded:Ti.collapsed;return ce`
5111
+ `;this.__allCards.push(t)}this.activeHotspot?.desktopPlacement===ar.LEFT?this.__leftCardContents=this.activeHotspot.renderCardTemplate():this.activeHotspot?.desktopPlacement===ar.RIGHT&&(this.__rightCardContents=this.activeHotspot.renderCardTemplate())}recalculateHotspotPositions(){this.requestUpdate()}__renderHotspotIndicatorTemplates(){return Array.from(this.hotspots.values()).map(e=>e.renderAnnotationTemplate(this.activeHotspot?.hotspotID))}__onCardsCarouselSlideChange(e){this.setActiveHotspotByIndex(e.detail.newSlideIndex)}__onExpandButtonClicked(e){e.stopPropagation(),e.preventDefault(),this.setActiveHotspotState(Ti.expanded)}__renderMobileHotspotCardTemplates(){const e=this.__cardsState===Ti.expanded?Ti.expanded:Ti.collapsed;return ce`
5112
5112
  <div
5113
5113
  id="mobileHotspotCardsContainer"
5114
5114
  class="hotspot-cards-container carousel ${this.activeHotspot?"show":""} ${e}"
@@ -5233,9 +5233,9 @@ ${r.join(`
5233
5233
  top: 50%;
5234
5234
  transform: translate(-50%, -50%);
5235
5235
  }
5236
- `]}static setupWebComponent(){window.customElements.get(Rc.webComponentName)||window.customElements.define(Rc.webComponentName,Rc)}get appEvents(){return this._appEvents}getCanvasSize(){return this.__canvasSize}get isDevEnv(){return this._isDevEnv}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.cameras.screenshot)}onLoadFailed(e){this._appEvents.appFailedEvent.fire(e)}async _onAuthenticationFailed(e){window.epigraph.logger.error({title:"AUTHENTICATION FAILED: Expand for details...",details:e,contextOverride:this._loggerContext}),this.onLoadFailed({errorCode:QM.AuthenticationFailedError,message:e}),await this.disconnectedCallback()}get assetLoaders(){return this._assetLoaders}get assetManager(){return this._assetManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get isPortraitOrientation(){return this.getBoundingClientRect().width<700}get renderEngine(){return this._renderEngine}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.cameras.main.aspect=i,this.cameraManager.cameras.main.updateProjectionMatrix(),this.cameraManager.cameras.screenshot.aspect=i,this.cameraManager.cameras.screenshot.updateProjectionMatrix()}this.hotspotsManager.activeHotspot||this.cameraManager.fitCameraToObject({objectToFocus:this.getSceneSphericalBoundsForCameraFocus(),enableTransition:!1}),this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}getPositionOnMeshFromPoint(e,t){const i=new v0,s=new Oe;s.x=e/this.getCanvasSize().width*2-1,s.y=-(t/this.getCanvasSize().height)*2+1,i.setFromCamera(s,this.cameraManager.cameras.main);const r=i.intersectObjects(this.renderEngine.sceneHierarchy.renderGeoGrp.children,!0);return r.length>0?r[0].point:null}async setupRenderEngine(e){window.epigraph.logger.info({title:"Initiliazing Render Engine"}),this._renderEngine=new bI(this);const{assetLoaders:t,canvasHtmlElem:i}=await this._renderEngine.setup(e);this.appCanvasContainerElemRef.appendChild(i),this._assetLoaders=t,new ResizeObserver(this.__onWebComponentResize.bind(this)).observe(this.appCanvasContainerElemRef)}getSceneSphericalBoundsForCameraFocus(){const e=this.dimensionsManager.getCurrentSceneBounds();return e.getCenter(this._boundingSphereCenter),e.getBoundingSphere(new mn(this._boundingSphereCenter))}_resetAllForNewExperience(){this.__autoGeneratedProxyMesh.scale.set(1,1,1),this.__autoGeneratedProxyMesh.position.set(0,0,0),this.__autoGeneratedProxyMesh.updateMatrixWorld()}async _launchAR(){return await this.viewInYourSpaceManager.launchAR()}async _spawnRenderGeoGltfEntity(e,t){if(this.renderGeoGltfEntity=new g_({assetId:e,assetLoadingStyles:sl.Eager,appWcRef:this}),await this.renderGeoGltfEntity.create(!1),await this.renderEngine.spawnEntityGltfInScene({entity:this.renderGeoGltfEntity,groupUnder:cp.render}),await this.renderGeoGltfEntity.selectVariant(t).catch(l=>{window.epigraph.logger.error({title:`No Variant named: ${t}`,details:l})}),!this.renderGeoGltfEntity.engineData)return Promise.resolve(!1);this.__renderGeoBoundsBox.setFromObject(this.renderGeoGltfEntity.engineData,!0),this.__renderGeoBoundsBox.getSize(this.__renderGeoBoundsSize);const i=new k;this.__renderGeoBoundsBox.getCenter(i);const s=new Fi;s.name="rendergeopivot";const r=new Er(.1,.1,.1),a=new dn({color:65280,depthTest:!1}),o=new Lt(r,a);s.add(o),this.renderEngine.sceneHierarchy.renderGeoGrp.add(s),s.position.set(i.x,this.__renderGeoBoundsBox.min.y,i.z),s.attach(this.renderGeoGltfEntity.engineData),s.position.set(0,0,0),this._renderEngine.sceneHierarchy.renderGeoGrp.add(this.renderGeoGltfEntity.engineData),s.removeFromParent(),Bt.dispose3(s)}async _autoGenerateAndSpawnProxyGeoEntity(){this.__autoGeneratedProxyMesh.scale.set(this.__renderGeoBoundsSize.x,this.__renderGeoBoundsSize.y,this.__renderGeoBoundsSize.z);const e=new k;this.__renderGeoBoundsBox.getCenter(e);const t=new Fi;t.name="proxygeopivot";const i=new ef(.01,20,20),s=new dn({color:255,depthTest:!1}),r=new Lt(i,s);t.add(r),this.renderEngine.sceneHierarchy.proxyGeoGrp.add(t),t.translateY(-this.__renderGeoBoundsSize.y*.5),t.attach(this.__autoGeneratedProxyMesh),t.position.set(0,0,0),this.renderEngine.sceneHierarchy.proxyGeoGrp.add(this.__autoGeneratedProxyMesh),t.removeFromParent(),Bt.dispose3(t)}async _spawnProxyGeoGltfEntity(e){this.proxyGeoGltfEntity=new g_({assetId:e,assetLoadingStyles:sl.Eager,appWcRef:this}),await this.proxyGeoGltfEntity.create(!1),await this.renderEngine.spawnEntityGltfInScene({entity:this.proxyGeoGltfEntity,groupUnder:cp.proxy})}async spawnAssetInScene({renderGeoAssetId:e,proxyGeoAssetId:t,variantName:i}){return this._resetAllForNewExperience(),await this._spawnRenderGeoGltfEntity(e,i),t?await this._spawnProxyGeoGltfEntity(t):await this._autoGenerateAndSpawnProxyGeoEntity(),await this._onSceneHierarchyUpdate(),Promise.resolve()}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled);const e=this.getSceneSphericalBoundsForCameraFocus();e.radius=e.radius*1.4,this.cameraManager.fitCameraToObject({objectToFocus:e})}hideDimensions(){this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled);const e=this.getSceneSphericalBoundsForCameraFocus();this.cameraManager.fitCameraToObject({objectToFocus:e})}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}_onDimensionsToolControlClick(e){e.stopPropagation(),e.preventDefault(),e.target.active?this.showDimensions():this.hideDimensions()}async _onSceneHierarchyUpdate(e=!1){if(this.dimensionsManager?.recalculateBoundsAndDimensions(),this.dimensionsManager?.repopulateDimensionIndicators(),e)return Promise.resolve([]);await this._cameraManager.onSceneHierarchyUpdate()}postRenderFrameUpdateInEngine(e){this.cameraManager?.mainCameraControls?.update&&this.cameraManager.mainCameraControls.update(e);try{this.renderGeoGltfEntity.asset.getAnimationMixer()?.update(e),this.renderEngine.mainRenderer.render(this.renderEngine?.scene,this.cameraManager?.cameras?.main)}catch(t){return t}}_renderAppElemChildren(){return ce``}_renderAppUiElemChildren(){return ce`
5236
+ `]}static setupWebComponent(){window.customElements.get(Rc.webComponentName)||window.customElements.define(Rc.webComponentName,Rc)}get appEvents(){return this._appEvents}getCanvasSize(){return this.__canvasSize}get isDevEnv(){return this._isDevEnv}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.cameras.screenshot)}onLoadFailed(e){this._appEvents.appFailedEvent.fire(e)}async _onAuthenticationFailed(e){window.epigraph.logger.error({title:"AUTHENTICATION FAILED: Expand for details...",details:e,contextOverride:this._loggerContext}),this.onLoadFailed({errorCode:QM.AuthenticationFailedError,message:e}),await this.disconnectedCallback()}get assetLoaders(){return this._assetLoaders}get assetManager(){return this._assetManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get isPortraitOrientation(){return this.getBoundingClientRect().width<700}get renderEngine(){return this._renderEngine}__onWebComponentResize(){const{width:e,height:t}=this.getBoundingClientRect();if(this.__canvasSize.width=e,this.__canvasSize.height=t,this.renderEngine.mainRenderer.setSize(e,t),this.renderEngine.effectsComposer.setSize(e,t),this.cameraManager){const i=this.renderEngine.canvas.clientWidth/this.renderEngine.canvas.clientHeight;this.cameraManager.cameras.main.aspect=i,this.cameraManager.cameras.main.updateProjectionMatrix(),this.cameraManager.cameras.screenshot.aspect=i,this.cameraManager.cameras.screenshot.updateProjectionMatrix()}this.hotspotsManager.activeHotspot||this.cameraManager.fitCameraToObject({objectToFocus:this.getSceneSphericalBoundsForCameraFocus(),enableTransition:!1}),this.postRenderFrameUpdateInEngine(this.renderEngine.getClockDelta())}getPositionOnMeshFromPoint(e,t){const i=new v0,s=new Oe;s.x=e/this.getCanvasSize().width*2-1,s.y=-(t/this.getCanvasSize().height)*2+1,i.setFromCamera(s,this.cameraManager.cameras.main);const r=i.intersectObjects(this.renderEngine.sceneHierarchy.renderGeoGrp.children,!0);return r.length>0?r[0].point:null}async setupRenderEngine(e){window.epigraph.logger.info({title:"Initiliazing Render Engine"}),this._renderEngine=new bI(this);const{assetLoaders:t,canvasHtmlElem:i}=await this._renderEngine.setup(e);this.appCanvasContainerElemRef.appendChild(i),this._assetLoaders=t,new ResizeObserver(this.__onWebComponentResize.bind(this)).observe(this.appCanvasContainerElemRef)}getSceneSphericalBoundsForCameraFocus(){const e=this.dimensionsManager.getCurrentSceneBounds();return e.getCenter(this._boundingSphereCenter),e.getBoundingSphere(new mn(this._boundingSphereCenter))}_resetAllForNewExperience(){this.__autoGeneratedProxyMesh.scale.set(1,1,1),this.__autoGeneratedProxyMesh.position.set(0,0,0),this.__autoGeneratedProxyMesh.updateMatrixWorld()}async _launchAR(){return await this.viewInYourSpaceManager.launchAR()}async _spawnRenderGeoGltfEntity(e,t){if(this.renderGeoGltfEntity=new g_({assetId:e,assetLoadingStyles:sl.Eager,appWcRef:this}),await this.renderGeoGltfEntity.create(!1),await this.renderEngine.spawnEntityGltfInScene({entity:this.renderGeoGltfEntity,groupUnder:cp.render}),await this.renderGeoGltfEntity.selectVariant(t).catch(l=>{window.epigraph.logger.error({title:`No Variant named: ${t}`,details:l})}),!this.renderGeoGltfEntity.engineData)return Promise.resolve(!1);this.__renderGeoBoundsBox.setFromObject(this.renderGeoGltfEntity.engineData,!0),this.__renderGeoBoundsBox.getSize(this.__renderGeoBoundsSize);const i=new k;this.__renderGeoBoundsBox.getCenter(i);const s=new Fi;s.name="rendergeopivot";const r=new Er(.1,.1,.1),a=new dn({color:65280,depthTest:!1}),o=new Lt(r,a);s.add(o),this.renderEngine.sceneHierarchy.renderGeoGrp.add(s),s.position.set(i.x,this.__renderGeoBoundsBox.min.y,i.z),s.attach(this.renderGeoGltfEntity.engineData),s.position.set(0,0,0),this._renderEngine.sceneHierarchy.renderGeoGrp.add(this.renderGeoGltfEntity.engineData),s.removeFromParent(),Bt.dispose3(s)}async _autoGenerateAndSpawnProxyGeoEntity(){this.__autoGeneratedProxyMesh.scale.set(this.__renderGeoBoundsSize.x,this.__renderGeoBoundsSize.y,this.__renderGeoBoundsSize.z);const e=new k;this.__renderGeoBoundsBox.getCenter(e);const t=new Fi;t.name="proxygeopivot";const i=new ef(.01,20,20),s=new dn({color:255,depthTest:!1}),r=new Lt(i,s);t.add(r),this.renderEngine.sceneHierarchy.proxyGeoGrp.add(t),t.translateY(-this.__renderGeoBoundsSize.y*.5),t.attach(this.__autoGeneratedProxyMesh),t.position.set(0,0,0),this.renderEngine.sceneHierarchy.proxyGeoGrp.add(this.__autoGeneratedProxyMesh),t.removeFromParent(),Bt.dispose3(t)}async _spawnProxyGeoGltfEntity(e){this.proxyGeoGltfEntity=new g_({assetId:e,assetLoadingStyles:sl.Eager,appWcRef:this}),await this.proxyGeoGltfEntity.create(!1),await this.renderEngine.spawnEntityGltfInScene({entity:this.proxyGeoGltfEntity,groupUnder:cp.proxy})}async spawnAssetInScene({renderGeoAssetId:e,proxyGeoAssetId:t,variantName:i}){return this._resetAllForNewExperience(),await this._spawnRenderGeoGltfEntity(e,i),t?await this._spawnProxyGeoGltfEntity(t):await this._autoGenerateAndSpawnProxyGeoEntity(),await this._onSceneHierarchyUpdate(),Promise.resolve()}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled);const e=this.getSceneSphericalBoundsForCameraFocus();e.radius=e.radius*1.4,this.cameraManager.fitCameraToObject({objectToFocus:e})}hideDimensions(e=!1){if(this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),!e){const t=this.getSceneSphericalBoundsForCameraFocus();this.cameraManager.fitCameraToObject({objectToFocus:t})}}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}_onDimensionsToolControlClick(e){e.stopPropagation(),e.preventDefault(),e.target.active?this.showDimensions():this.hideDimensions()}async _onSceneHierarchyUpdate(e=!1){if(this.dimensionsManager?.recalculateBoundsAndDimensions(),this.dimensionsManager?.repopulateDimensionIndicators(),e)return Promise.resolve([]);await this._cameraManager.onSceneHierarchyUpdate()}postRenderFrameUpdateInEngine(e){this.cameraManager?.mainCameraControls?.update&&this.cameraManager.mainCameraControls.update(e);try{this.renderGeoGltfEntity.asset.getAnimationMixer()?.update(e),this.renderEngine.mainRenderer.render(this.renderEngine?.scene,this.cameraManager?.cameras?.main)}catch(t){return t}}_renderAppElemChildren(){return ce``}_renderAppUiElemChildren(){return ce`
5237
5237
  <epg-tool-help id="helpOverlay" class="help-overlay" can-pan theme="dark"></epg-tool-help>
5238
- `}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.inputStart.name,e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}}),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,this.hideDimensions)}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}_setupAutoGeneratedProxyContainers(){const e=new Er,t=new dn({color:65280,opacity:.5,transparent:!0});this.__autoGeneratedProxyMesh=new Lt(e,t)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Ev(this),this._assetManager=new TI(this),this._cameraManager=new RI({appWcRef:this}),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}firstUpdated(){this._setup(),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}updated(e){e.has("debug")&&(this.dimensionsManager.visualizeBounds=this.debug,this.debug?this.renderEngine.showSceneDebuggers():this.renderEngine.hideSceneDebuggers()),e.has("isHelpVisible")&&(this.isHelpVisible?this.helpOverlayElem.show():this.helpOverlayElem.hide())}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}connectedCallback(){super.connectedCallback(),this.parsedUrlParams=Bt.parseUrlForEpigraphParams(this.baseUrlOverride)}async disconnectedCallback(){super.disconnectedCallback()}_renderDimensionsManager(){let e=Le;return this.featuresToEnable.dimensions&&(BI.setupWebComponent(),e=ce`
5238
+ `}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.appEvents.inputStart.name,e=>{switch(e.detail.type){case"rotate":this.style.cursor="grabbing";break;case"pan":this.style.cursor="move",this.showCameraAim();break}}),this.addEventListener(this.appEvents.inputEnd.name,()=>{this.style.cursor="grab",this.hideCameraAim()}),this.addEventListener(this.appEvents.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)})}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}_setupAutoGeneratedProxyContainers(){const e=new Er,t=new dn({color:65280,opacity:.5,transparent:!0});this.__autoGeneratedProxyMesh=new Lt(e,t)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._appEvents=new Ev(this),this._assetManager=new TI(this),this._cameraManager=new RI({appWcRef:this}),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners()}firstUpdated(){this._setup(),window.epigraph.logger.info({title:"All Initializations Complete",contextOverride:this._loggerContext})}updated(e){e.has("debug")&&(this.dimensionsManager.visualizeBounds=this.debug,this.debug?this.renderEngine.showSceneDebuggers():this.renderEngine.hideSceneDebuggers()),e.has("isHelpVisible")&&(this.isHelpVisible?this.helpOverlayElem.show():this.helpOverlayElem.hide())}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}connectedCallback(){super.connectedCallback(),this.parsedUrlParams=Bt.parseUrlForEpigraphParams(this.baseUrlOverride)}async disconnectedCallback(){super.disconnectedCallback()}_renderDimensionsManager(){let e=Le;return this.featuresToEnable.dimensions&&(BI.setupWebComponent(),e=ce`
5239
5239
  <dimensions-manager
5240
5240
  id="dimensionsManager"
5241
5241
  .appWcRef=${this}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/solutions",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-solutions.js",
6
6
  "files": [