@roomle/web-sdk 2.94.0-alpha.2 → 2.94.0-alpha.4
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/lib/{banana-for-scale-a6cfb03f.js → banana-for-scale-18519fc3.js} +2 -2
- package/lib/{banana-for-scale-a6cfb03f.js.map → banana-for-scale-18519fc3.js.map} +1 -1
- package/lib/{banana-for-scale-7d77113f.nomodule.js → banana-for-scale-3ee39a60.nomodule.js} +2 -2
- package/lib/{banana-for-scale-7d77113f.nomodule.js.map → banana-for-scale-3ee39a60.nomodule.js.map} +1 -1
- package/lib/{camera-behaviour-05fc5ef1.js → camera-behaviour-64cd3763.js} +2 -2
- package/lib/{camera-behaviour-05fc5ef1.js.map → camera-behaviour-64cd3763.js.map} +1 -1
- package/lib/{camera-behaviour-55f86fa4.nomodule.js → camera-behaviour-6e6728a0.nomodule.js} +2 -2
- package/lib/{camera-behaviour-55f86fa4.nomodule.js.map → camera-behaviour-6e6728a0.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-a9ea8349.js → component-dimensioning-5781a15e.js} +2 -2
- package/lib/component-dimensioning-5781a15e.js.map +1 -0
- package/lib/{component-dimensioning-d2271998.nomodule.js → component-dimensioning-f0f0a854.nomodule.js} +2 -2
- package/lib/component-dimensioning-f0f0a854.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-80394a4e.js → component-raycast-helper-0d8d28c5.js} +2 -2
- package/lib/component-raycast-helper-0d8d28c5.js.map +1 -0
- package/lib/{component-raycast-helper-e910b27c.nomodule.js → component-raycast-helper-f92cd460.nomodule.js} +2 -2
- package/lib/component-raycast-helper-f92cd460.nomodule.js.map +1 -0
- package/lib/{configurator-a35cc80c.js → configurator-85914b34.js} +2 -2
- package/lib/configurator-85914b34.js.map +1 -0
- package/lib/{configurator-79cf93dd.nomodule.js → configurator-a792b8a2.nomodule.js} +2 -2
- package/lib/configurator-a792b8a2.nomodule.js.map +1 -0
- package/lib/configurator-main-e63c2011.js +2 -0
- package/lib/configurator-main-e63c2011.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-be34f1ca.js → continuous-drawing-helper-bc3f2b81.js} +2 -2
- package/lib/continuous-drawing-helper-bc3f2b81.js.map +1 -0
- package/lib/{continuous-drawing-helper-d10bf8bc.nomodule.js → continuous-drawing-helper-ebb3feec.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-ebb3feec.nomodule.js.map +1 -0
- package/lib/{default-light-setting-31cbd6d3.nomodule.js → default-light-setting-aa4f3150.nomodule.js} +2 -2
- package/lib/default-light-setting-aa4f3150.nomodule.js.map +1 -0
- package/lib/{default-light-setting-f7470fe4.js → default-light-setting-ec096a2c.js} +2 -2
- package/lib/default-light-setting-ec096a2c.js.map +1 -0
- package/lib/definitions/common-core/src/rapi-access.d.ts +5 -1
- package/lib/definitions/packages/common-core/src/rapi-access.d.ts +5 -1
- package/lib/definitions/packages/planner-core/src/external-object-api-callbacks.d.ts +4 -4
- package/lib/definitions/packages/planner-core/src/external-object-api.d.ts +2 -2
- package/lib/definitions/packages/planner-core/src/roomle-planner-ui-callback.d.ts +1 -1
- package/lib/definitions/packages/planner-core/src/roomle-planner.d.ts +3 -2
- package/lib/definitions/packages/planner-core/src/services/planner-kernel-access.d.ts +2 -2
- package/lib/definitions/packages/typings/planner.d.ts +1 -1
- package/lib/definitions/planner-core/src/external-object-api-callbacks.d.ts +4 -4
- package/lib/definitions/planner-core/src/external-object-api.d.ts +2 -2
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +1 -1
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +3 -2
- package/lib/definitions/planner-core/src/services/planner-kernel-access.d.ts +2 -2
- package/lib/definitions/typings/planner.d.ts +1 -1
- package/lib/{dimensioning-helper-c90a2e59.nomodule.js → dimensioning-helper-1cdcff70.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-c90a2e59.nomodule.js.map → dimensioning-helper-1cdcff70.nomodule.js.map} +1 -1
- package/lib/{dimensioning-helper-940e213e.js → dimensioning-helper-392ee3e6.js} +2 -2
- package/lib/{dimensioning-helper-940e213e.js.map → dimensioning-helper-392ee3e6.js.map} +1 -1
- package/lib/{glb-viewer-fd67ff04.js → glb-viewer-7779a180.js} +2 -2
- package/lib/{glb-viewer-fd67ff04.js.map → glb-viewer-7779a180.js.map} +1 -1
- package/lib/{glb-viewer-447927c4.nomodule.js → glb-viewer-92d2281a.nomodule.js} +2 -2
- package/lib/{glb-viewer-447927c4.nomodule.js.map → glb-viewer-92d2281a.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-camera-behaviour-2608e844.nomodule.js → glb-viewer-camera-behaviour-136e4c48.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-136e4c48.nomodule.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-141567b1.js → glb-viewer-camera-behaviour-b6c9cc48.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-b6c9cc48.js.map +1 -0
- package/lib/glb-viewer-main-b14902ca.js +2 -0
- package/lib/glb-viewer-main-b14902ca.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/{imos-ix-poc-export-helper-dee4f3a1.js → imos-ix-poc-export-helper-535a1a62.js} +2 -2
- package/lib/imos-ix-poc-export-helper-535a1a62.js.map +1 -0
- package/lib/{imos-ix-poc-export-helper-e4c914df.nomodule.js → imos-ix-poc-export-helper-69752ed1.nomodule.js} +2 -2
- package/lib/imos-ix-poc-export-helper-69752ed1.nomodule.js.map +1 -0
- package/lib/legacy/{banana-for-scale-d076a131.legacy.js → banana-for-scale-3448e790.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-d076a131.legacy.js.map → banana-for-scale-3448e790.legacy.js.map} +1 -1
- package/lib/legacy/{camera-behaviour-b583d9da.legacy.js → camera-behaviour-975c691a.legacy.js} +2 -2
- package/lib/legacy/{camera-behaviour-b583d9da.legacy.js.map → camera-behaviour-975c691a.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-2f39ca2d.legacy.js → component-dimensioning-89c394b9.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-89c394b9.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-d8951895.legacy.js → component-raycast-helper-e56f323f.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-e56f323f.legacy.js.map +1 -0
- package/lib/legacy/{configurator-254d3ebf.legacy.js → configurator-8a6926c6.legacy.js} +2 -2
- package/lib/legacy/configurator-8a6926c6.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-6d3c0faf.legacy.js → continuous-drawing-helper-c4a30431.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-c4a30431.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-e60bff1b.legacy.js → default-light-setting-82dee8af.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-82dee8af.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-216dab16.legacy.js → dimensioning-helper-22a900a7.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-216dab16.legacy.js.map → dimensioning-helper-22a900a7.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-14374774.legacy.js → glb-viewer-04847062.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-14374774.legacy.js.map → glb-viewer-04847062.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-camera-behaviour-7ffdea3d.legacy.js → glb-viewer-camera-behaviour-9528b9f3.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-9528b9f3.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{imos-ix-poc-export-helper-2426ab25.legacy.js → imos-ix-poc-export-helper-a15dab4a.legacy.js} +2 -2
- package/lib/legacy/imos-ix-poc-export-helper-a15dab4a.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-12b157a5.legacy.js → material-viewer-86152a43.legacy.js} +2 -2
- package/lib/legacy/material-viewer-86152a43.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-ddc271ba.legacy.js +2 -0
- package/lib/legacy/{planner-ac0c0581.legacy.js.map → planner-ddc271ba.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{roomle-configurator-f918de16.legacy.js → roomle-configurator-9ef9f83a.legacy.js} +2 -2
- package/lib/legacy/roomle-configurator-9ef9f83a.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-eb7a606c.legacy.js → roomle-dependency-injection-03d82432.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-eb7a606c.legacy.js.map → roomle-dependency-injection-03d82432.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-ee55f933.legacy.js → script-loader-a82a2d26.legacy.js} +2 -2
- package/lib/legacy/script-loader-a82a2d26.legacy.js.map +1 -0
- package/lib/legacy/static/{ConfiguratorKernel-6f3c0f674deeab31.wasm → ConfiguratorKernel-64a9748d4718229e.wasm} +0 -0
- package/lib/legacy/static/RoomleCore-7a3c14a67531e073.wasm +0 -0
- package/lib/legacy/static/{RoomleCore-ed8b449f8ddfd032.js → RoomleCore-c236bb6d0a25bbb2.js} +50 -50
- package/lib/{static/RoomleToolsCore-b75693bfe1271a75.wasm → legacy/static/RoomleToolsCore-8e78cd7a456d6d6c.wasm} +0 -0
- package/lib/legacy/{stats-helper-d995ff14.legacy.js → stats-helper-3a7a00f2.legacy.js} +2 -2
- package/lib/legacy/stats-helper-3a7a00f2.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-3c0d3832.legacy.js → tools-core-f4304d5d.legacy.js} +2 -2
- package/lib/legacy/tools-core-f4304d5d.legacy.js.map +1 -0
- package/lib/{material-viewer-0638640d.js → material-viewer-30280b72.js} +2 -2
- package/lib/material-viewer-30280b72.js.map +1 -0
- package/lib/{material-viewer-1fa1935f.nomodule.js → material-viewer-69e49e54.nomodule.js} +2 -2
- package/lib/material-viewer-69e49e54.nomodule.js.map +1 -0
- package/lib/material-viewer-main-ed23c426.js +2 -0
- package/lib/material-viewer-main-ed23c426.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-98c09e61.nomodule.js +2 -0
- package/lib/{planner-d40da883.nomodule.js.map → planner-98c09e61.nomodule.js.map} +1 -1
- package/lib/planner-9e6bb33f.js +2 -0
- package/lib/{planner-81669c73.js.map → planner-9e6bb33f.js.map} +1 -1
- package/lib/planner-main-4fba8c92.js +2 -0
- package/lib/planner-main-4fba8c92.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{roomle-configurator-53e99bd9.nomodule.js → roomle-configurator-399fdd48.nomodule.js} +2 -2
- package/lib/roomle-configurator-399fdd48.nomodule.js.map +1 -0
- package/lib/{roomle-configurator-cceb45ae.js → roomle-configurator-ffe56578.js} +2 -2
- package/lib/roomle-configurator-ffe56578.js.map +1 -0
- package/lib/{roomle-dependency-injection-0758cad6.nomodule.js → roomle-dependency-injection-27157b44.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-0758cad6.nomodule.js.map → roomle-dependency-injection-27157b44.nomodule.js.map} +1 -1
- package/lib/{roomle-dependency-injection-91bf1e95.js → roomle-dependency-injection-d29fb448.js} +3 -3
- package/lib/{roomle-dependency-injection-91bf1e95.js.map → roomle-dependency-injection-d29fb448.js.map} +1 -1
- package/lib/{roomle-sdk-dfd10423.js → roomle-sdk-0d233ed4.js} +2 -2
- package/lib/roomle-sdk-0d233ed4.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-1491eb6e.nomodule.js → script-loader-9906e5c4.nomodule.js} +2 -2
- package/lib/script-loader-9906e5c4.nomodule.js.map +1 -0
- package/lib/{script-loader-be245e2c.js → script-loader-e1222f7d.js} +2 -2
- package/lib/script-loader-e1222f7d.js.map +1 -0
- package/lib/static/{ConfiguratorKernel-6f3c0f674deeab31.wasm → ConfiguratorKernel-64a9748d4718229e.wasm} +0 -0
- package/lib/static/RoomleCore-7a3c14a67531e073.wasm +0 -0
- package/lib/static/{RoomleCore-ed8b449f8ddfd032.js → RoomleCore-c236bb6d0a25bbb2.js} +1 -1
- package/lib/static/RoomleCore-c236bb6d0a25bbb2.js.map +1 -0
- package/lib/{legacy/static/RoomleToolsCore-b75693bfe1271a75.wasm → static/RoomleToolsCore-8e78cd7a456d6d6c.wasm} +0 -0
- package/lib/{stats-helper-89db8c48.nomodule.js → stats-helper-0d4586e3.nomodule.js} +2 -2
- package/lib/stats-helper-0d4586e3.nomodule.js.map +1 -0
- package/lib/{stats-helper-31f64ecd.js → stats-helper-83e8f531.js} +2 -2
- package/lib/stats-helper-83e8f531.js.map +1 -0
- package/lib/{tools-core-dd55a366.nomodule.js → tools-core-2bd760c5.nomodule.js} +2 -2
- package/lib/tools-core-2bd760c5.nomodule.js.map +1 -0
- package/lib/{tools-core-531ed8dc.js → tools-core-f240f1e9.js} +2 -2
- package/lib/tools-core-f240f1e9.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-a9ea8349.js.map +0 -1
- package/lib/component-dimensioning-d2271998.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-80394a4e.js.map +0 -1
- package/lib/component-raycast-helper-e910b27c.nomodule.js.map +0 -1
- package/lib/configurator-79cf93dd.nomodule.js.map +0 -1
- package/lib/configurator-a35cc80c.js.map +0 -1
- package/lib/configurator-main-94e1c5d0.js +0 -2
- package/lib/configurator-main-94e1c5d0.js.map +0 -1
- package/lib/continuous-drawing-helper-be34f1ca.js.map +0 -1
- package/lib/continuous-drawing-helper-d10bf8bc.nomodule.js.map +0 -1
- package/lib/default-light-setting-31cbd6d3.nomodule.js.map +0 -1
- package/lib/default-light-setting-f7470fe4.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-141567b1.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-2608e844.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-3c69bc92.js +0 -2
- package/lib/glb-viewer-main-3c69bc92.js.map +0 -1
- package/lib/imos-ix-poc-export-helper-dee4f3a1.js.map +0 -1
- package/lib/imos-ix-poc-export-helper-e4c914df.nomodule.js.map +0 -1
- package/lib/legacy/component-dimensioning-2f39ca2d.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-d8951895.legacy.js.map +0 -1
- package/lib/legacy/configurator-254d3ebf.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-6d3c0faf.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-e60bff1b.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-7ffdea3d.legacy.js.map +0 -1
- package/lib/legacy/imos-ix-poc-export-helper-2426ab25.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-12b157a5.legacy.js.map +0 -1
- package/lib/legacy/planner-ac0c0581.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-f918de16.legacy.js.map +0 -1
- package/lib/legacy/script-loader-ee55f933.legacy.js.map +0 -1
- package/lib/legacy/static/RoomleCore-3d2f18d8ad3a0176.wasm +0 -0
- package/lib/legacy/stats-helper-d995ff14.legacy.js.map +0 -1
- package/lib/legacy/tools-core-3c0d3832.legacy.js.map +0 -1
- package/lib/material-viewer-0638640d.js.map +0 -1
- package/lib/material-viewer-1fa1935f.nomodule.js.map +0 -1
- package/lib/material-viewer-main-e1bec764.js +0 -2
- package/lib/material-viewer-main-e1bec764.js.map +0 -1
- package/lib/planner-81669c73.js +0 -2
- package/lib/planner-d40da883.nomodule.js +0 -2
- package/lib/planner-main-758a4f15.js +0 -2
- package/lib/planner-main-758a4f15.js.map +0 -1
- package/lib/roomle-configurator-53e99bd9.nomodule.js.map +0 -1
- package/lib/roomle-configurator-cceb45ae.js.map +0 -1
- package/lib/roomle-sdk-dfd10423.js.map +0 -1
- package/lib/script-loader-1491eb6e.nomodule.js.map +0 -1
- package/lib/script-loader-be245e2c.js.map +0 -1
- package/lib/static/RoomleCore-3d2f18d8ad3a0176.wasm +0 -0
- package/lib/static/RoomleCore-ed8b449f8ddfd032.js.map +0 -1
- package/lib/stats-helper-31f64ecd.js.map +0 -1
- package/lib/stats-helper-89db8c48.nomodule.js.map +0 -1
- package/lib/tools-core-531ed8dc.js.map +0 -1
- package/lib/tools-core-dd55a366.nomodule.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-a792b8a2.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Configurator}from"./configurator-85914b34.js";import"./script-loader-e1222f7d.js";import"./query-params-helper-28405b8d.js";import"./main-thread-to-worker-352ff4b1.js";import"./roomle-dependency-injection-d29fb448.js";import"./camera-behaviour-64cd3763.js";import"./component-raycast-helper-0d8d28c5.js";import"./roomle-configurator-ffe56578.js";import"./default-light-setting-ec096a2c.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)});
|
|
2
|
+
//# sourceMappingURL=configurator-main-e63c2011.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-main-e63c2011.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-a792b8a2.nomodule.js","./script-loader-9906e5c4.nomodule.js","./query-params-helper-4f855064.nomodule.js","./main-thread-to-worker-7f1cb5ea.nomodule.js","./roomle-dependency-injection-27157b44.nomodule.js","./camera-behaviour-6e6728a0.nomodule.js","./component-raycast-helper-f92cd460.nomodule.js","./roomle-configurator-399fdd48.nomodule.js","./default-light-setting-aa4f3150.nomodule.js"],(function(){var e;return{setters:[function(o){e=o.Configurator},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let o=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-o))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.nomodule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ac as convertToTHREE}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
import{ac as convertToTHREE}from"./roomle-dependency-injection-d29fb448.js";import{aT as RingGeometry,h as MeshBasicMaterial,w as DoubleSide,z as Mesh}from"./main-thread-to-worker-352ff4b1.js";class ContinuousDrawingHelper{constructor(){this._currentInnerRadius=0}init(e,i,r){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=r,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new RingGeometry(e,e+e/50,32),r=new MeshBasicMaterial({color:10066329,side:DoubleSide});this._circleMesh=new Mesh(i,r),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new RingGeometry(e,i,32)}const i=convertToTHREE(this._continuousDrawingManager.getStartPoint());i.y=5,this._circleMesh.position.copy(i),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}}export{ContinuousDrawingHelper as default};
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-bc3f2b81.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-bc3f2b81.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-27157b44.nomodule.js","./main-thread-to-worker-7f1cb5ea.nomodule.js"],(function(e){var i,t,r,n,s;return{setters:[function(e){i=e.ac},function(e){t=e.aT,r=e.h,n=e.w,s=e.z}],execute:function(){e("default",class{constructor(){this._currentInnerRadius=0}init(e,i,t){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=t,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new t(e,e+e/50,32),c=new r({color:10066329,side:n});this._circleMesh=new s(i,c),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new t(e,i,32)}const r=i(this._continuousDrawingManager.getStartPoint());r.y=5,this._circleMesh.position.copy(r),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}})}}}));
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-ebb3feec.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-ebb3feec.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./camera-behaviour-6e6728a0.nomodule.js","./roomle-dependency-injection-27157b44.nomodule.js","./main-thread-to-worker-7f1cb5ea.nomodule.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.ag},function(i){e=i.D,n=i.C,o=i.V,s=i.a,h=i.A}],execute:function(){i("D",class extends t{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new e(new n(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new o(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new s(0,0,0)),this._secondDirectionalLight=new e(new n(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new o(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new s(0,0,0)),this._ambientLight=new h(new n(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new s),a=Math.max(Math.max(t.x,t.y),t.z)+1,e=a/2;this._mainDirectionalLight.shadow.camera.top=e,this._mainDirectionalLight.shadow.camera.bottom=-e,this._mainDirectionalLight.shadow.camera.left=-e,this._mainDirectionalLight.shadow.camera.right=e,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=e,this._secondDirectionalLight.shadow.camera.bottom=-e,this._secondDirectionalLight.shadow.camera.left=-e,this._secondDirectionalLight.shadow.camera.right=e,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=a();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new n(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}}}})}}}));
|
|
2
|
+
//# sourceMappingURL=default-light-setting-aa4f3150.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-aa4f3150.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{L as LightSetting}from"./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
import{L as LightSetting}from"./camera-behaviour-64cd3763.js";import{ag as getGUI}from"./roomle-dependency-injection-d29fb448.js";import{D as DirectionalLight,C as Color,V as Vector2,a as Vector3,A as AmbientLight}from"./main-thread-to-worker-352ff4b1.js";class DefaultLightSetting extends LightSetting{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new DirectionalLight(new Color(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new Vector3(0,0,0)),this._secondDirectionalLight=new DirectionalLight(new Color(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new Vector3(0,0,0)),this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new Vector3),a=Math.max(Math.max(t.x,t.y),t.z)+1,o=a/2;this._mainDirectionalLight.shadow.camera.top=o,this._mainDirectionalLight.shadow.camera.bottom=-o,this._mainDirectionalLight.shadow.camera.left=-o,this._mainDirectionalLight.shadow.camera.right=o,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=o,this._secondDirectionalLight.shadow.camera.bottom=-o,this._secondDirectionalLight.shadow.camera.left=-o,this._secondDirectionalLight.shadow.camera.right=o,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=getGUI();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new Color(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new Vector3(0,0,0)))}}}}export{DefaultLightSetting as D};
|
|
2
|
+
//# sourceMappingURL=default-light-setting-ec096a2c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-ec096a2c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -7,6 +7,10 @@ import type InitData from './utils/init-data';
|
|
|
7
7
|
export declare const MAX_URL_LENGTH = 1500;
|
|
8
8
|
export declare const MESH_DEFAULT_FORMAT = "crt";
|
|
9
9
|
export declare const MESH_DEFAULT_QUALITY = 50;
|
|
10
|
+
export declare const USER_ACTION_MODULE: {
|
|
11
|
+
CONFIGURATOR: number;
|
|
12
|
+
ROOM_DESIGNER: number;
|
|
13
|
+
};
|
|
10
14
|
type HttpVerbGet = 'GET';
|
|
11
15
|
type HttpVerbPost = 'POST';
|
|
12
16
|
type HttpVerbPut = 'PUT';
|
|
@@ -180,7 +184,7 @@ export default class RapiAccess implements Context {
|
|
|
180
184
|
* @param fileFormat check API documentation for valid formats
|
|
181
185
|
*/
|
|
182
186
|
export3D(id: RapiId, email: string, fileFormat: string, options?: object): Promise<unknown>;
|
|
183
|
-
trackView(id: string): Promise<void>;
|
|
187
|
+
trackView(id: string, module?: number): Promise<void>;
|
|
184
188
|
signinUser(email: string, password: string): Promise<RapiAuth>;
|
|
185
189
|
signoutUser(token: string): Promise<void>;
|
|
186
190
|
savePlan(plan: RapiPlan): Promise<RapiPlan>;
|
|
@@ -7,6 +7,10 @@ import type InitData from './utils/init-data';
|
|
|
7
7
|
export declare const MAX_URL_LENGTH = 1500;
|
|
8
8
|
export declare const MESH_DEFAULT_FORMAT = "crt";
|
|
9
9
|
export declare const MESH_DEFAULT_QUALITY = 50;
|
|
10
|
+
export declare const USER_ACTION_MODULE: {
|
|
11
|
+
CONFIGURATOR: number;
|
|
12
|
+
ROOM_DESIGNER: number;
|
|
13
|
+
};
|
|
10
14
|
type HttpVerbGet = 'GET';
|
|
11
15
|
type HttpVerbPost = 'POST';
|
|
12
16
|
type HttpVerbPut = 'PUT';
|
|
@@ -180,7 +184,7 @@ export default class RapiAccess implements Context {
|
|
|
180
184
|
* @param fileFormat check API documentation for valid formats
|
|
181
185
|
*/
|
|
182
186
|
export3D(id: RapiId, email: string, fileFormat: string, options?: object): Promise<unknown>;
|
|
183
|
-
trackView(id: string): Promise<void>;
|
|
187
|
+
trackView(id: string, module?: number): Promise<void>;
|
|
184
188
|
signinUser(email: string, password: string): Promise<RapiAuth>;
|
|
185
189
|
signoutUser(token: string): Promise<void>;
|
|
186
190
|
savePlan(plan: RapiPlan): Promise<RapiPlan>;
|
|
@@ -20,7 +20,7 @@ export interface ExternalObjectRootModule {
|
|
|
20
20
|
rotation?: number;
|
|
21
21
|
}
|
|
22
22
|
export interface ExternalObjectGroup {
|
|
23
|
-
groupId
|
|
23
|
+
groupId?: string;
|
|
24
24
|
pos: number[];
|
|
25
25
|
rotation?: number;
|
|
26
26
|
rootModules?: ExternalObjectRootModule[];
|
|
@@ -88,14 +88,14 @@ export interface ExternalObjectUiCallback {
|
|
|
88
88
|
*/
|
|
89
89
|
onDuplicateExternalObjectGroup(sourceGroupId: string, newGroupPosition: ExternalObjectGroupPosition): void;
|
|
90
90
|
/**
|
|
91
|
-
* “
|
|
91
|
+
* “onChangedExternalObjectGroupPlan” is invoked when a group of root modules is moved or rotated to a new position
|
|
92
92
|
* or when the plan itself is changed.
|
|
93
93
|
* The group with the ID "group.id" is moved to the new position and orientation defined in "group".
|
|
94
94
|
* @param group The group of root modules.
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
onChangedExternalObjectGroupPlan(group: ExternalObjectGroup): void;
|
|
97
97
|
/**
|
|
98
|
-
* @deprecated and replaced by “
|
|
98
|
+
* @deprecated and replaced by “onChangedExternalObjectGroupPlan”.
|
|
99
99
|
* @param group The group of root modules.
|
|
100
100
|
*/
|
|
101
101
|
onMovedExternalObjectGroup(group: ExternalObjectGroup): void;
|
|
@@ -46,12 +46,12 @@ export interface ExternalObjectAPI {
|
|
|
46
46
|
* @param findFreeSpaceInPlan A free space is automatically searched for in the plane.
|
|
47
47
|
* @param verifyArrangement Verify whether the root modules of the group need to be rearranged as they have changed in size.
|
|
48
48
|
*/
|
|
49
|
-
loadExternalObjectGroup(groupJson: string |
|
|
49
|
+
loadExternalObjectGroup(groupJson: object | string | string[], findFreeSpaceInPlan: boolean, verifyArrangement?: boolean): Promise<void>;
|
|
50
50
|
/**
|
|
51
51
|
* "renderImagesOfExternalObjectGroups" renders images of groups of modules.
|
|
52
52
|
* @param groupJson The group JSON as string or object.
|
|
53
53
|
*/
|
|
54
|
-
renderImagesOfExternalObjectGroup(groupsJson:
|
|
54
|
+
renderImagesOfExternalObjectGroup(groupsJson: object): Promise<{
|
|
55
55
|
[key: string]: string;
|
|
56
56
|
}>;
|
|
57
57
|
/**
|
|
@@ -207,7 +207,7 @@ export default class RoomlePlannerUiCallback extends UiCallback implements Exter
|
|
|
207
207
|
/**
|
|
208
208
|
* documented in interface ExternalObjectUiCallback
|
|
209
209
|
*/
|
|
210
|
-
|
|
210
|
+
onChangedExternalObjectGroupPlan: (group: ExternalObjectGroup) => void;
|
|
211
211
|
/**
|
|
212
212
|
* documented in interface ExternalObjectUiCallback
|
|
213
213
|
*/
|
|
@@ -379,9 +379,10 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
379
379
|
downloadHomagIxExportPoC(): Promise<any>;
|
|
380
380
|
configureExternalObjectApi(configurationJson: string | ExternalObjectApiConfiguration): Promise<void>;
|
|
381
381
|
loadExternalObjectLibrary(libraryJson: string | object): void;
|
|
382
|
-
loadExternalObjectGroup(
|
|
382
|
+
loadExternalObjectGroup(groupData: object | string | string[], findFreeSpaceInPlan: boolean, verifyArrangement?: boolean): Promise<void>;
|
|
383
383
|
private _loadExternalObjectGroup;
|
|
384
|
-
|
|
384
|
+
private _createSerializedGroupCollection;
|
|
385
|
+
renderImagesOfExternalObjectGroup(groups: object): Promise<{
|
|
385
386
|
[key: string]: string;
|
|
386
387
|
}>;
|
|
387
388
|
removeExternalObjectGroup(groupId: string, wasMerged?: boolean): Promise<void>;
|
|
@@ -69,7 +69,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
69
69
|
externalObjectConfigurationDeleted(plan: Plan, planObject: PlanObject, uniqueId: string): void;
|
|
70
70
|
externalObjectComponentDeleted(plan: Plan, planObject: PlanObject, remainingGroupOrGroups: ExternalObjectGroup | ExternalObjectGroup[], deletedRootModuleId: string): void;
|
|
71
71
|
externalObjectConfigurationDuplicated(plan: Plan, planObject: PlanObject, sourceGroupId: string, newGroupPosition: ExternalObjectGroupPosition): void;
|
|
72
|
-
|
|
72
|
+
externalObjectPlanChanged(plan: Plan, planObject: PlanObject, movedGroup: ExternalObjectGroup): void;
|
|
73
73
|
externalObjectConfigurationsMerged(plan: Plan, planObject: PlanObject, mergedGroup: ExternalObjectGroup, idsOfGroupsMerged: string | string[]): void;
|
|
74
74
|
externalObjectComponentSplitOff(plan: Plan, planObject: PlanObject, splitGroups: ExternalObjectGroup[]): void;
|
|
75
75
|
externalObjectArrangementChanged(plan: Plan, planObject: PlanObject, changedGroup: ExternalObjectGroup): void;
|
|
@@ -97,7 +97,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
97
97
|
protected _externalObjectConfigurationDeleted(groupId: string): void;
|
|
98
98
|
protected _externalObjectComponentDeleted(remainingGroupOrGroups: ExternalObjectGroup | ExternalObjectGroup[], deletedRootModuleId: string): void;
|
|
99
99
|
_externalObjectConfigurationDuplicated(sourceGroupId: string, newGroupPosition: ExternalObjectGroupPosition): void;
|
|
100
|
-
|
|
100
|
+
_externalObjectPlanChanged(movedGroup: ExternalObjectGroup): void;
|
|
101
101
|
_externalObjectConfigurationsMerged(mergedGroup: ExternalObjectGroup, idsOfGroupsMerged: string | string[]): void;
|
|
102
102
|
_externalObjectComponentSplitOff(splitGroups: ExternalObjectGroup[]): void;
|
|
103
103
|
_externalObjectArrangementChanged(changedGroup: ExternalObjectGroup): void;
|
|
@@ -164,7 +164,7 @@ export interface PlanInteractionHandler {
|
|
|
164
164
|
setObjectRotation(planObject: KernelObject, angleInRad: number): void;
|
|
165
165
|
addPlanObjects(list: KernelObjectPtrList, findFreeSpaceInPlan: boolean): PlanObject[];
|
|
166
166
|
addPlanObjectFromItem(object: KernelObject, position: KernelVector3, type: number, findFreeSpaceInPlan: boolean): PlanObject;
|
|
167
|
-
addOrUpdateExternalPlanObjects(serialzedConfiguration: string, position: KernelVector3, rotationInRad: number, findFreeSpaceInPlan: boolean, applyGlobalChildMode: boolean, isVisible: boolean, verifyArrangement: boolean): PlanObject[];
|
|
167
|
+
addOrUpdateExternalPlanObjects(serialzedConfiguration: string | string[], position: KernelVector3, rotationInRad: number, findFreeSpaceInPlan: boolean, applyGlobalChildMode: boolean, isVisible: boolean, verifyArrangement: boolean): PlanObject[];
|
|
168
168
|
catalogItemLoaded(catalogItem: KernelCatalogItem): void;
|
|
169
169
|
removeElement(planObject: KernelObject): void;
|
|
170
170
|
removeObjectWithId(objectId: string): void;
|
|
@@ -20,7 +20,7 @@ export interface ExternalObjectRootModule {
|
|
|
20
20
|
rotation?: number;
|
|
21
21
|
}
|
|
22
22
|
export interface ExternalObjectGroup {
|
|
23
|
-
groupId
|
|
23
|
+
groupId?: string;
|
|
24
24
|
pos: number[];
|
|
25
25
|
rotation?: number;
|
|
26
26
|
rootModules?: ExternalObjectRootModule[];
|
|
@@ -88,14 +88,14 @@ export interface ExternalObjectUiCallback {
|
|
|
88
88
|
*/
|
|
89
89
|
onDuplicateExternalObjectGroup(sourceGroupId: string, newGroupPosition: ExternalObjectGroupPosition): void;
|
|
90
90
|
/**
|
|
91
|
-
* “
|
|
91
|
+
* “onChangedExternalObjectGroupPlan” is invoked when a group of root modules is moved or rotated to a new position
|
|
92
92
|
* or when the plan itself is changed.
|
|
93
93
|
* The group with the ID "group.id" is moved to the new position and orientation defined in "group".
|
|
94
94
|
* @param group The group of root modules.
|
|
95
95
|
*/
|
|
96
|
-
|
|
96
|
+
onChangedExternalObjectGroupPlan(group: ExternalObjectGroup): void;
|
|
97
97
|
/**
|
|
98
|
-
* @deprecated and replaced by “
|
|
98
|
+
* @deprecated and replaced by “onChangedExternalObjectGroupPlan”.
|
|
99
99
|
* @param group The group of root modules.
|
|
100
100
|
*/
|
|
101
101
|
onMovedExternalObjectGroup(group: ExternalObjectGroup): void;
|
|
@@ -46,12 +46,12 @@ export interface ExternalObjectAPI {
|
|
|
46
46
|
* @param findFreeSpaceInPlan A free space is automatically searched for in the plane.
|
|
47
47
|
* @param verifyArrangement Verify whether the root modules of the group need to be rearranged as they have changed in size.
|
|
48
48
|
*/
|
|
49
|
-
loadExternalObjectGroup(groupJson: string |
|
|
49
|
+
loadExternalObjectGroup(groupJson: object | string | string[], findFreeSpaceInPlan: boolean, verifyArrangement?: boolean): Promise<void>;
|
|
50
50
|
/**
|
|
51
51
|
* "renderImagesOfExternalObjectGroups" renders images of groups of modules.
|
|
52
52
|
* @param groupJson The group JSON as string or object.
|
|
53
53
|
*/
|
|
54
|
-
renderImagesOfExternalObjectGroup(groupsJson:
|
|
54
|
+
renderImagesOfExternalObjectGroup(groupsJson: object): Promise<{
|
|
55
55
|
[key: string]: string;
|
|
56
56
|
}>;
|
|
57
57
|
/**
|
|
@@ -207,7 +207,7 @@ export default class RoomlePlannerUiCallback extends UiCallback implements Exter
|
|
|
207
207
|
/**
|
|
208
208
|
* documented in interface ExternalObjectUiCallback
|
|
209
209
|
*/
|
|
210
|
-
|
|
210
|
+
onChangedExternalObjectGroupPlan: (group: ExternalObjectGroup) => void;
|
|
211
211
|
/**
|
|
212
212
|
* documented in interface ExternalObjectUiCallback
|
|
213
213
|
*/
|
|
@@ -379,9 +379,10 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
379
379
|
downloadHomagIxExportPoC(): Promise<any>;
|
|
380
380
|
configureExternalObjectApi(configurationJson: string | ExternalObjectApiConfiguration): Promise<void>;
|
|
381
381
|
loadExternalObjectLibrary(libraryJson: string | object): void;
|
|
382
|
-
loadExternalObjectGroup(
|
|
382
|
+
loadExternalObjectGroup(groupData: object | string | string[], findFreeSpaceInPlan: boolean, verifyArrangement?: boolean): Promise<void>;
|
|
383
383
|
private _loadExternalObjectGroup;
|
|
384
|
-
|
|
384
|
+
private _createSerializedGroupCollection;
|
|
385
|
+
renderImagesOfExternalObjectGroup(groups: object): Promise<{
|
|
385
386
|
[key: string]: string;
|
|
386
387
|
}>;
|
|
387
388
|
removeExternalObjectGroup(groupId: string, wasMerged?: boolean): Promise<void>;
|
|
@@ -69,7 +69,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
69
69
|
externalObjectConfigurationDeleted(plan: Plan, planObject: PlanObject, uniqueId: string): void;
|
|
70
70
|
externalObjectComponentDeleted(plan: Plan, planObject: PlanObject, remainingGroupOrGroups: ExternalObjectGroup | ExternalObjectGroup[], deletedRootModuleId: string): void;
|
|
71
71
|
externalObjectConfigurationDuplicated(plan: Plan, planObject: PlanObject, sourceGroupId: string, newGroupPosition: ExternalObjectGroupPosition): void;
|
|
72
|
-
|
|
72
|
+
externalObjectPlanChanged(plan: Plan, planObject: PlanObject, movedGroup: ExternalObjectGroup): void;
|
|
73
73
|
externalObjectConfigurationsMerged(plan: Plan, planObject: PlanObject, mergedGroup: ExternalObjectGroup, idsOfGroupsMerged: string | string[]): void;
|
|
74
74
|
externalObjectComponentSplitOff(plan: Plan, planObject: PlanObject, splitGroups: ExternalObjectGroup[]): void;
|
|
75
75
|
externalObjectArrangementChanged(plan: Plan, planObject: PlanObject, changedGroup: ExternalObjectGroup): void;
|
|
@@ -97,7 +97,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
97
97
|
protected _externalObjectConfigurationDeleted(groupId: string): void;
|
|
98
98
|
protected _externalObjectComponentDeleted(remainingGroupOrGroups: ExternalObjectGroup | ExternalObjectGroup[], deletedRootModuleId: string): void;
|
|
99
99
|
_externalObjectConfigurationDuplicated(sourceGroupId: string, newGroupPosition: ExternalObjectGroupPosition): void;
|
|
100
|
-
|
|
100
|
+
_externalObjectPlanChanged(movedGroup: ExternalObjectGroup): void;
|
|
101
101
|
_externalObjectConfigurationsMerged(mergedGroup: ExternalObjectGroup, idsOfGroupsMerged: string | string[]): void;
|
|
102
102
|
_externalObjectComponentSplitOff(splitGroups: ExternalObjectGroup[]): void;
|
|
103
103
|
_externalObjectArrangementChanged(changedGroup: ExternalObjectGroup): void;
|
|
@@ -164,7 +164,7 @@ export interface PlanInteractionHandler {
|
|
|
164
164
|
setObjectRotation(planObject: KernelObject, angleInRad: number): void;
|
|
165
165
|
addPlanObjects(list: KernelObjectPtrList, findFreeSpaceInPlan: boolean): PlanObject[];
|
|
166
166
|
addPlanObjectFromItem(object: KernelObject, position: KernelVector3, type: number, findFreeSpaceInPlan: boolean): PlanObject;
|
|
167
|
-
addOrUpdateExternalPlanObjects(serialzedConfiguration: string, position: KernelVector3, rotationInRad: number, findFreeSpaceInPlan: boolean, applyGlobalChildMode: boolean, isVisible: boolean, verifyArrangement: boolean): PlanObject[];
|
|
167
|
+
addOrUpdateExternalPlanObjects(serialzedConfiguration: string | string[], position: KernelVector3, rotationInRad: number, findFreeSpaceInPlan: boolean, applyGlobalChildMode: boolean, isVisible: boolean, verifyArrangement: boolean): PlanObject[];
|
|
168
168
|
catalogItemLoaded(catalogItem: KernelCatalogItem): void;
|
|
169
169
|
removeElement(planObject: KernelObject): void;
|
|
170
170
|
removeObjectWithId(objectId: string): void;
|
package/lib/{dimensioning-helper-c90a2e59.nomodule.js → dimensioning-helper-1cdcff70.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-27157b44.nomodule.js","./main-thread-to-worker-7f1cb5ea.nomodule.js","./TextGeometry-259292ec.nomodule.js"],(function(t){var i,e,s,n,h,o,a,_,d,r,p,m,l,c,x,u,g,w,b,y,T,L,z;return{setters:[function(t){i=t.aY,e=t.H,s=t._,n=t.i,h=t.j,o=t.aZ,a=t.ac},function(t){_=t.O,d=t.a,r=t.h,p=t.w,m=t.bo,l=t.B,c=t.z,x=t.Q,u=t.b9,g=t.K,w=t.u,b=t.G,y=t.b,T=t.bL,L=t.ad},function(t){z=t.T}],execute:function(){const G="component_dimensioning_plane_material",M="component_dimensioning_text_material";class j extends _{constructor(t){super(),this._label="",this._parameters={font:null,size:.1,depth:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=t,this._position=new d,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(G)?this._planeMaterial=this._cacheHolder.materialCache.get(G):(this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(G,this._planeMaterial)),this._cacheHolder.materialCache.has(M)?this._textMaterial=this._cacheHolder.materialCache.get(M):(this._textMaterial=new m({color:3618615}),this._cacheHolder.materialCache.set(M,this._textMaterial))}_init(){let t=new l;this._text=new c(t,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new c(t,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new z(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(t,i,e){this._position.copy(t),this._cameraPosition=e,this._label=i;const s=this.getWorldPosition(new d),n=this._cameraPosition.distanceTo(s),h=Math.max(.01,n/150),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new z(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let t=new x;t.setFromAxisAngle(new d(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,t,new d)}else if(this._updateText(this._textGeometry,new x,new d),this._cameraPosition){const t=this.getWorldPosition(new d),e=i(Math.atan2(this._cameraPosition.x-t.x,this._cameraPosition.z-t.z)-this.parent.rotation.y);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(t,i,e){let s=new d;s.copy(this._position),e.x*=this._getXSign(),s.add(e);let n=t.boundingBox.getSize(new d);t.center(),this._text.position.copy(s),i&&this._text.quaternion.copy(i);let h=new u(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),i&&this._plane.quaternion.copy(i)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){e(this)}}s([n],j.prototype,"_cacheHolder",void 0);class D{constructor(t){this._objectRotation=0,this._cameraPosition=new d,this._topDimensions=!1,this._initialized=new h,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new g,this._dimensionTextGroup=new _,this._creator_=t,this._lineMaterial=new w({color:3618615,linewidth:2});let i=new l;this._widthLine=new b(i,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new b(i,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new b(i,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new r({color:16777215,side:p,opacity:.8,transparent:!0}),o.loadFont("static/lato_regular_sub-9dd2262895ccc1a9.json").then(t=>{this._font=t,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(t){this._enabled&&(this._dimensions||t)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let t=new l,i=this._getWidthEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=t;let s=i.getCenter(new d);this._widthText||(this._widthText=new j(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let t=new l,i=this._getHeightEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=t;let s=i.getCenter(new d);this._heightText||(this._heightText=new j(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let t=new l,i=this._getDepthEdge(),e=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];t.setAttribute("position",new y(new Float32Array(e),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=t;let s=i.getCenter(new d);this._depthText||(this._depthText=new j(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(t){this._origin=a(t.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=a(t.size);const i=this._dimensionLineGroup.localToWorld(new d);this._dimensionTextGroup.position.copy(i),this.update()}update(t=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(t)}addToObject(t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&t.add(this._dimensionLineGroup)}removeFromObject(t){t.remove(this._dimensionLineGroup),this.update()}addToUiScene(t){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const i=this._dimensionLineGroup.localToWorld(new d);this._dimensionTextGroup.position.copy(i),this._dimensionTextGroup.rotation.y=this._objectRotation,t.add(this._dimensionTextGroup),this.update()}removeFromUiScene(t){t.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const t=this._getRotation();return t>Math.PI/2||t<-Math.PI/2?new T(new d(-.05,0,this._dimensions.z-.05),new d(this._dimensions.x+.05,0,this._dimensions.z-.05)):new T(new d(-.05,0,.05),new d(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new T(new d(.05+this._dimensions.x,0,.05),new d(.05+this._dimensions.x,0,this._dimensions.z-.05)):new T(new d(-.05,0,.05),new d(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const t=this._getRotation();return t>0&&t<Math.PI/2?new T(new d(-.05,0,.05),new d(-.05,this._dimensions.y+.05,.05)):t>Math.PI/2?new T(new d(-.05,0,this._dimensions.z-.05),new d(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):t<-Math.PI/2?new T(new d(.05+this._dimensions.x,0,this._dimensions.z-.05),new d(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new T(new d(.05+this._dimensions.x,0,.05),new d(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(t){this._onChange=t}enableTopDimensions(){this._topDimensions=!0,this.enableDimensions(),this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToObject(this._object),this.addToUiScene(this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const t=new L;return t.expandByObject(this._widthLine),t.expandByObject(this._widthText),t.expandByObject(this._heightLine),t.expandByObject(this._heightText),t.expandByObject(this._depthLine),t.expandByObject(this._depthText),t}setVisibility(t){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=t,this._dimensionTextGroup.visible=t)}moveCameraStart(t){this.setVisibility(!1),this._cameraPosition=t,this.update()}moveCameraEnd(t){this.setVisibility(!0),this._cameraPosition=t,this.update()}clearScene(t){this._clear()}setObject(t,i=0){this._object=t,this._objectRotation=i}setUiScene(t){this._uiScene=t}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const t=this._object.getWorldPosition(new d);return i(Math.atan2(this._cameraPosition.x-t.x,this._cameraPosition.z-t.z)-this._objectRotation)}}t("default",D),s([n],D.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-1cdcff70.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-1cdcff70.nomodule.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-9dd2262895ccc1a9.json\""],"names":[],"mappings":"u4HAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aX as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aY as AsyncDependencyLoader,ac as convertToTHREE}from"./roomle-dependency-injection-91bf1e95.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bo as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b9 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bL as Line3,ad as Box3}from"./main-thread-to-worker-352ff4b1.js";import{T as TextGeometry}from"./TextGeometry-dc304c0e.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,depth:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i){this._position.copy(e),this._cameraPosition=i,this._label=t;const s=this.getWorldPosition(new Vector3),n=this._cameraPosition.distanceTo(s),o=Math.max(.01,n/150),h=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=h,this._parameters.bevelSize=h,this._parameters.size=o,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=this.getWorldPosition(new Vector3),t=normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this.parent.rotation.y);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),t&&this._text.quaternion.copy(t);let o=new PlaneGeometry(n.x+.02,n.y+.02,32);o.center(),this._plane.geometry=o,this._plane.position.copy(s),t&&this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._objectRotation=0,this._cameraPosition=new Vector3,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Object3D,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/lato_regular_sub-9dd2262895ccc1a9.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._dimensions||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(e){this._origin=convertToTHREE(e.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=convertToTHREE(e.size);const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToObject(e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&e.add(this._dimensionLineGroup)}removeFromObject(e){e.remove(this._dimensionLineGroup),this.update()}addToUiScene(e){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this._dimensionTextGroup.rotation.y=this._objectRotation,e.add(this._dimensionTextGroup),this.update()}removeFromUiScene(e){e.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const e=this._getRotation();return e>Math.PI/2||e<-Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(this._dimensions.x+.05,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const e=this._getRotation();return e>0&&e<Math.PI/2?new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,this._dimensions.y+.05,.05)):e>Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):e<-Math.PI/2?new Line3(new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this._topDimensions=!0,this.enableDimensions(),this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToObject(this._object),this.addToUiScene(this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=e,this._dimensionTextGroup.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setObject(e,t=0){this._object=e,this._objectRotation=t}setUiScene(e){this._uiScene=e}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const e=this._object.getWorldPosition(new Vector3);return normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this._objectRotation)}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{aY as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aZ as AsyncDependencyLoader,ac as convertToTHREE}from"./roomle-dependency-injection-d29fb448.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bo as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b9 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bL as Line3,ad as Box3}from"./main-thread-to-worker-352ff4b1.js";import{T as TextGeometry}from"./TextGeometry-dc304c0e.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,depth:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new BufferGeometry;this._text=new Mesh(e,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new Mesh(e,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i){this._position.copy(e),this._cameraPosition=i,this._label=t;const s=this.getWorldPosition(new Vector3),n=this._cameraPosition.distanceTo(s),o=Math.max(.01,n/150),h=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=h,this._parameters.bevelSize=h,this._parameters.size=o,this._textGeometry=new TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new Quaternion;e.setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new Vector3)}else if(this._updateText(this._textGeometry,new Quaternion,new Vector3),this._cameraPosition){const e=this.getWorldPosition(new Vector3),t=normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this.parent.rotation.y);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(e,t,i){let s=new Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new Vector3);e.center(),this._text.position.copy(s),t&&this._text.quaternion.copy(t);let o=new PlaneGeometry(n.x+.02,n.y+.02,32);o.center(),this._plane.geometry=o,this._plane.position.copy(s),t&&this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){dispose(this)}}__decorate([inject],TextWithBackground.prototype,"_cacheHolder",void 0);class DimensioningHelper{constructor(e){this._objectRotation=0,this._cameraPosition=new Vector3,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._dimensionLineGroup=new Group,this._dimensionTextGroup=new Object3D,this._creator_=e,this._lineMaterial=new LineBasicMaterial({color:3618615,linewidth:2});let t=new BufferGeometry;this._widthLine=new Line(t,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._dimensionLineGroup.add(this._widthLine),this._heightLine=new Line(t,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._dimensionLineGroup.add(this._heightLine),this._depthLine=new Line(t,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._dimensionLineGroup.add(this._depthLine),this._planeMaterial=new MeshBasicMaterial({color:16777215,side:DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/lato_regular_sub-9dd2262895ccc1a9.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToObject(this._object),this.addToUiScene(this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._dimensions||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new BufferGeometry,t=this._getWidthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let s=t.getCenter(new Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._widthText)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,n,this._cameraPosition)}_updateHeight(){let e=new BufferGeometry,t=this._getHeightEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let s=t.getCenter(new Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._heightText)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,n,this._cameraPosition)}_updateDepth(){let e=new BufferGeometry,t=this._getDepthEdge(),i=[t.start.x,t.start.y,t.start.z,t.end.x,t.end.y,t.end.z];e.setAttribute("position",new BufferAttribute(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let s=t.getCenter(new Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font),this._dimensionTextGroup.add(this._depthText)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(-1e3*this._dimensions.z);this._depthText.update(s,n,this._cameraPosition)}updateSize(e){this._origin=convertToTHREE(e.origin),this._dimensionLineGroup.position.x=this._origin.x-this._object.position.x,this._dimensionLineGroup.position.y=this._origin.y-this._object.position.y,this._dimensionLineGroup.position.z=this._origin.z-this._object.position.z,this._dimensions=convertToTHREE(e.size);const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToObject(e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&e.add(this._dimensionLineGroup)}removeFromObject(e){e.remove(this._dimensionLineGroup),this.update()}addToUiScene(e){if(!(this._widthText&&this._heightText&&this._depthText&&this._object))return;const t=this._dimensionLineGroup.localToWorld(new Vector3);this._dimensionTextGroup.position.copy(t),this._dimensionTextGroup.rotation.y=this._objectRotation,e.add(this._dimensionTextGroup),this.update()}removeFromUiScene(e){e.remove(this._dimensionTextGroup),this.update()}_getWidthEdge(){const e=this._getRotation();return e>Math.PI/2||e<-Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(this._dimensions.x+.05,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(this._dimensions.x+.05,0,.05))}_getDepthEdge(){return this._getRotation()>0?new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05)):new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,0,this._dimensions.z-.05))}_getHeightEdge(){const e=this._getRotation();return e>0&&e<Math.PI/2?new Line3(new Vector3(-.05,0,.05),new Vector3(-.05,this._dimensions.y+.05,.05)):e>Math.PI/2?new Line3(new Vector3(-.05,0,this._dimensions.z-.05),new Vector3(-.05,this._dimensions.y+.05,this._dimensions.z-.05)):e<-Math.PI/2?new Line3(new Vector3(.05+this._dimensions.x,0,this._dimensions.z-.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,this._dimensions.z-.05)):new Line3(new Vector3(.05+this._dimensions.x,0,.05),new Vector3(.05+this._dimensions.x,this._dimensions.y+.05,.05))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this._topDimensions=!0,this.enableDimensions(),this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToObject(this._object),this.addToUiScene(this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromUiScene(this._uiScene),this.removeFromObject(this._object)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._dimensionLineGroup&&this._dimensionTextGroup&&(this._dimensionLineGroup.visible=e,this._dimensionTextGroup.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setObject(e,t=0){this._object=e,this._objectRotation=t}setUiScene(e){this._uiScene=e}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}_getRotation(){const e=this._object.getWorldPosition(new Vector3);return normalizeRotation(Math.atan2(this._cameraPosition.x-e.x,this._cameraPosition.z-e.z)-this._objectRotation)}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export{DimensioningHelper as default};
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-392ee3e6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-392ee3e6.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-9dd2262895ccc1a9.json\""],"names":[],"mappings":"u7IAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-be245e2c.js";import{aN as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,ag as getGUI,_ as __decorate,i as inject,u as CANVAS_ID,x as DynamicLightSettingLoader,y as PREDEFINED_LIGHTSETTING,H as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-91bf1e95.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-05fc5ef1.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aR as getGlbUrl,by as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,U as PerspectiveCamera,bF as download}from"./main-thread-to-worker-352ff4b1.js";import{D as DefaultLightSetting}from"./default-light-setting-f7470fe4.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-141567b1.js";import"./query-params-helper-28405b8d.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),null),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),this._readyForRender(),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalCallback",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
-
//# sourceMappingURL=glb-viewer-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-e1222f7d.js";import{aO as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,ag as getGUI,_ as __decorate,i as inject,u as CANVAS_ID,x as DynamicLightSettingLoader,y as PREDEFINED_LIGHTSETTING,H as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-d29fb448.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-64cd3763.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aR as getGlbUrl,by as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,U as PerspectiveCamera,bF as download}from"./main-thread-to-worker-352ff4b1.js";import{D as DefaultLightSetting}from"./default-light-setting-ec096a2c.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-b6c9cc48.js";import"./query-params-helper-28405b8d.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),null),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),this._readyForRender(),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}async moveCamera(e){return this.glbViewerCameraBehaviour.externalApiMoveCamera(e)}_readyForRender(){this._globalCallback.onReadyForRender()}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}get globalCallbacks(){return this._globalCallback}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalCallback",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-7779a180.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-7779a180.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"mzRAAe"}
|