@roomle/web-sdk 2.44.0-alpha.8 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{banana-for-scale-1e0e65ff.js → banana-for-scale-735674f3.js} +2 -2
- package/lib/{banana-for-scale-1e0e65ff.js.map → banana-for-scale-735674f3.js.map} +1 -1
- package/lib/{banana-for-scale-0bb2a603.nomodule.js → banana-for-scale-74023eca.nomodule.js} +2 -2
- package/lib/{banana-for-scale-0bb2a603.nomodule.js.map → banana-for-scale-74023eca.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-6934b83e.js → component-dimensioning-8b53bc8f.js} +2 -2
- package/lib/component-dimensioning-8b53bc8f.js.map +1 -0
- package/lib/{component-dimensioning-5ae76403.nomodule.js → component-dimensioning-efcee022.nomodule.js} +2 -2
- package/lib/component-dimensioning-efcee022.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-a0b3ecb8.nomodule.js → component-raycast-helper-a495fdd5.nomodule.js} +2 -2
- package/lib/component-raycast-helper-a495fdd5.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-45c68f75.js → component-raycast-helper-a5df8d16.js} +2 -2
- package/lib/component-raycast-helper-a5df8d16.js.map +1 -0
- package/lib/{configurator-211803ef.js → configurator-56f18f83.js} +2 -2
- package/lib/configurator-56f18f83.js.map +1 -0
- package/lib/{configurator-58a7121a.nomodule.js → configurator-e8a4a985.nomodule.js} +2 -2
- package/lib/configurator-e8a4a985.nomodule.js.map +1 -0
- package/lib/configurator-main-99158dd7.js +2 -0
- package/lib/configurator-main-99158dd7.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{default-light-setting-e6acd5e9.nomodule.js → default-light-setting-b08fff1a.nomodule.js} +2 -2
- package/lib/default-light-setting-b08fff1a.nomodule.js.map +1 -0
- package/lib/{default-light-setting-c2462b93.js → default-light-setting-d75da8d3.js} +2 -2
- package/lib/default-light-setting-d75da8d3.js.map +1 -0
- package/lib/definitions/common-core/mock/mock-camera-parameters.d.ts +16 -0
- package/lib/definitions/common-core/mock/mock-rapi-types.d.ts +1 -0
- package/lib/definitions/common-core/src/utils/waiter.d.ts +1 -1
- package/lib/definitions/common-core/src/view-model/configurator-plan-object-view-model.d.ts +2 -0
- package/lib/definitions/common-core/src/view-model/plan-object-view-model.d.ts +6 -0
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +3 -2
- package/lib/definitions/configurator-core/src/utils/component-raycast-helper.d.ts +1 -0
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +1 -1
- package/lib/definitions/planner-core/src/services/planner-kernel-access.d.ts +6 -2
- package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +5 -1
- package/lib/definitions/planner-core/src/view-model/static-plan-object-view-model.d.ts +1 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-event-handler.d.ts +6 -2
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +8 -2
- package/lib/definitions/typings/planner.d.ts +2 -2
- package/lib/{dimensioning-helper-dae926a2.js → dimensioning-helper-241c4cf6.js} +2 -2
- package/lib/{dimensioning-helper-dae926a2.js.map → dimensioning-helper-241c4cf6.js.map} +1 -1
- package/lib/{dimensioning-helper-8a55e783.nomodule.js → dimensioning-helper-6a78638b.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-8a55e783.nomodule.js.map → dimensioning-helper-6a78638b.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-91ccd3ca.js → glb-viewer-3eb1b099.js} +2 -2
- package/lib/{glb-viewer-91ccd3ca.js.map → glb-viewer-3eb1b099.js.map} +1 -1
- package/lib/{glb-viewer-afda72f4.nomodule.js → glb-viewer-5785cf6e.nomodule.js} +2 -2
- package/lib/{glb-viewer-afda72f4.nomodule.js.map → glb-viewer-5785cf6e.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-b9abfeb9.js +2 -0
- package/lib/glb-viewer-main-b9abfeb9.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{banana-for-scale-cebbbc04.legacy.js → banana-for-scale-7a99dd4c.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-cebbbc04.legacy.js.map → banana-for-scale-7a99dd4c.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-88c40ca4.legacy.js → component-dimensioning-427e6c1b.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-427e6c1b.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-41f8172c.legacy.js → component-raycast-helper-feb85202.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-feb85202.legacy.js.map +1 -0
- package/lib/legacy/{configurator-ac1ba154.legacy.js → configurator-4321950d.legacy.js} +2 -2
- package/lib/legacy/configurator-4321950d.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{default-light-setting-bddcc4b6.legacy.js → default-light-setting-a58ace5d.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-a58ace5d.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-0df0c021.legacy.js → dimensioning-helper-37b263b4.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-0df0c021.legacy.js.map → dimensioning-helper-37b263b4.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-a83ba158.legacy.js → glb-viewer-16478885.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-a83ba158.legacy.js.map → glb-viewer-16478885.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{material-viewer-7aeffdfd.legacy.js → material-viewer-441b39a3.legacy.js} +2 -2
- package/lib/legacy/material-viewer-441b39a3.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/pixotron-40191712.legacy.js +2 -0
- package/lib/legacy/{pixotron-09d3a9ef.legacy.js.map → pixotron-40191712.legacy.js.map} +1 -1
- package/lib/legacy/planner-806fb579.legacy.js +2 -0
- package/lib/legacy/{planner-0bee3985.legacy.js.map → planner-806fb579.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/roomle-configurator-d01ed762.legacy.js +2 -0
- package/lib/legacy/{roomle-configurator-fbe4b1ce.legacy.js.map → roomle-configurator-d01ed762.legacy.js.map} +1 -1
- package/lib/legacy/roomle-dependency-injection-0bb547c3.legacy.js +16 -0
- package/lib/legacy/{roomle-dependency-injection-96a638c7.legacy.js.map → roomle-dependency-injection-0bb547c3.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-cfd06705.legacy.js → script-loader-96c524ca.legacy.js} +2 -2
- package/lib/legacy/script-loader-96c524ca.legacy.js.map +1 -0
- package/lib/legacy/static/{ConfiguratorKernel-66acc90d734be73f.js → ConfiguratorKernel-95d61b2d392360fb.js} +12 -12
- package/lib/legacy/static/ConfiguratorKernel-dd1dc5adf875f05f.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-c12029e27495a23f.js +146 -0
- package/lib/legacy/static/ConfiguratorKernelJs-fc7deba89358055c.mem +0 -0
- package/lib/legacy/static/{RoomleCore-2050e58329a960b4.js → RoomleCore-5d9fa540b4b52320.js} +13 -13
- package/lib/legacy/static/RoomleCore-abb01b2207925433.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-8e49dd20c7322435.mem +0 -0
- package/lib/legacy/static/RoomleCoreJs-9d62841adedf35de.js +155 -0
- package/lib/legacy/static/{RoomleToolsCore-fbef1640a2d95a32.js → RoomleToolsCore-49ac07bea3f32e38.js} +16 -16
- package/lib/legacy/static/RoomleToolsCore-683a8d242f6748b4.wasm +0 -0
- package/lib/legacy/static/{rthree-ffe182e11c947389.js → rthree-750136f8399d9f72.js} +1 -1
- package/lib/{static/shaders-623c11c6100521ca.json → legacy/static/shaders-f589c9e8b3d2b0f8.json} +1 -1
- package/lib/legacy/{stats-helper-c6cbed94.legacy.js → stats-helper-c7bc34d3.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-c6cbed94.legacy.js.map → stats-helper-c7bc34d3.legacy.js.map} +1 -1
- package/lib/legacy/{tools-core-989e9d49.legacy.js → tools-core-2ed81909.legacy.js} +2 -2
- package/lib/legacy/tools-core-2ed81909.legacy.js.map +1 -0
- package/lib/{material-viewer-331b92e4.js → material-viewer-2c36dcc3.js} +2 -2
- package/lib/material-viewer-2c36dcc3.js.map +1 -0
- package/lib/{material-viewer-4aa546a2.nomodule.js → material-viewer-74f15a87.nomodule.js} +2 -2
- package/lib/material-viewer-74f15a87.nomodule.js.map +1 -0
- package/lib/material-viewer-main-79f494f5.js +2 -0
- package/lib/material-viewer-main-79f494f5.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/pixotron-0196b4ad.nomodule.js +2 -0
- package/lib/{pixotron-e4c3c879.nomodule.js.map → pixotron-0196b4ad.nomodule.js.map} +1 -1
- package/lib/pixotron-a078097f.js +2 -0
- package/lib/{pixotron-139a0326.js.map → pixotron-a078097f.js.map} +1 -1
- package/lib/planner-29914aec.js +2 -0
- package/lib/{planner-4339598f.js.map → planner-29914aec.js.map} +1 -1
- package/lib/planner-e75df992.nomodule.js +2 -0
- package/lib/{planner-072c1ad9.nomodule.js.map → planner-e75df992.nomodule.js.map} +1 -1
- package/lib/planner-main-60dd76a0.js +2 -0
- package/lib/planner-main-60dd76a0.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/roomle-configurator-3bb4ecfc.js +2 -0
- package/lib/{roomle-configurator-86cb68c5.js.map → roomle-configurator-3bb4ecfc.js.map} +1 -1
- package/lib/roomle-configurator-88705a42.nomodule.js +2 -0
- package/lib/{roomle-configurator-1dbdbc7e.nomodule.js.map → roomle-configurator-88705a42.nomodule.js.map} +1 -1
- package/lib/roomle-dependency-injection-bfa0cd66.js +16 -0
- package/lib/{roomle-dependency-injection-09cae7f5.js.map → roomle-dependency-injection-bfa0cd66.js.map} +1 -1
- package/lib/roomle-dependency-injection-d36e4e32.nomodule.js +16 -0
- package/lib/{roomle-dependency-injection-6187ba7d.nomodule.js.map → roomle-dependency-injection-d36e4e32.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-bb376981.js → roomle-sdk-d4773db5.js} +2 -2
- package/lib/roomle-sdk-d4773db5.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-1a880868.js → script-loader-6dfd98d3.js} +2 -2
- package/lib/script-loader-6dfd98d3.js.map +1 -0
- package/lib/{script-loader-27459708.nomodule.js → script-loader-f6273f1e.nomodule.js} +2 -2
- package/lib/script-loader-f6273f1e.nomodule.js.map +1 -0
- package/lib/static/{ConfiguratorKernel-66acc90d734be73f.js → ConfiguratorKernel-95d61b2d392360fb.js} +1 -1
- package/lib/static/{ConfiguratorKernel-66acc90d734be73f.js.map → ConfiguratorKernel-95d61b2d392360fb.js.map} +1 -1
- package/lib/static/ConfiguratorKernel-dd1dc5adf875f05f.wasm +0 -0
- package/lib/static/ConfiguratorKernelJs-c12029e27495a23f.js +146 -0
- package/lib/static/ConfiguratorKernelJs-fc7deba89358055c.mem +0 -0
- package/lib/static/{RoomleCore-2050e58329a960b4.js → RoomleCore-5d9fa540b4b52320.js} +1 -1
- package/lib/static/RoomleCore-5d9fa540b4b52320.js.map +1 -0
- package/lib/static/RoomleCore-abb01b2207925433.wasm +0 -0
- package/lib/static/RoomleCoreJs-8e49dd20c7322435.mem +0 -0
- package/lib/static/RoomleCoreJs-9d62841adedf35de.js +155 -0
- package/lib/static/{RoomleToolsCore-fbef1640a2d95a32.js → RoomleToolsCore-49ac07bea3f32e38.js} +1 -1
- package/lib/static/RoomleToolsCore-49ac07bea3f32e38.js.map +1 -0
- package/lib/static/RoomleToolsCore-683a8d242f6748b4.wasm +0 -0
- package/lib/static/{rthree-ffe182e11c947389.js → rthree-750136f8399d9f72.js} +1 -1
- package/lib/static/rthree-750136f8399d9f72.js.map +1 -0
- package/lib/{legacy/static/shaders-623c11c6100521ca.json → static/shaders-f589c9e8b3d2b0f8.json} +1 -1
- package/lib/{stats-helper-7cabfad8.js → stats-helper-0c2e34a5.js} +2 -2
- package/lib/{stats-helper-7cabfad8.js.map → stats-helper-0c2e34a5.js.map} +1 -1
- package/lib/{stats-helper-4e6d4f1e.nomodule.js → stats-helper-1d203540.nomodule.js} +2 -2
- package/lib/{stats-helper-4e6d4f1e.nomodule.js.map → stats-helper-1d203540.nomodule.js.map} +1 -1
- package/lib/{tools-core-c8d2e0c4.nomodule.js → tools-core-8472c324.nomodule.js} +2 -2
- package/lib/tools-core-8472c324.nomodule.js.map +1 -0
- package/lib/{tools-core-adbae98e.js → tools-core-9af2623e.js} +2 -2
- package/lib/tools-core-9af2623e.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-5ae76403.nomodule.js.map +0 -1
- package/lib/component-dimensioning-6934b83e.js.map +0 -1
- package/lib/component-raycast-helper-45c68f75.js.map +0 -1
- package/lib/component-raycast-helper-a0b3ecb8.nomodule.js.map +0 -1
- package/lib/configurator-211803ef.js.map +0 -1
- package/lib/configurator-58a7121a.nomodule.js.map +0 -1
- package/lib/configurator-main-553ce4ab.js +0 -2
- package/lib/configurator-main-553ce4ab.js.map +0 -1
- package/lib/default-light-setting-c2462b93.js.map +0 -1
- package/lib/default-light-setting-e6acd5e9.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-480df687.js +0 -2
- package/lib/glb-viewer-main-480df687.js.map +0 -1
- package/lib/legacy/component-dimensioning-88c40ca4.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-41f8172c.legacy.js.map +0 -1
- package/lib/legacy/configurator-ac1ba154.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-bddcc4b6.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-7aeffdfd.legacy.js.map +0 -1
- package/lib/legacy/pixotron-09d3a9ef.legacy.js +0 -2
- package/lib/legacy/planner-0bee3985.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-fbe4b1ce.legacy.js +0 -2
- package/lib/legacy/roomle-dependency-injection-96a638c7.legacy.js +0 -16
- package/lib/legacy/script-loader-cfd06705.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-20501a284bc8fc51.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-191430a6a5695255.mem +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-959d98f479f267ec.js +0 -146
- package/lib/legacy/static/RoomleCore-4000ede83dfd263f.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-10c954e4de8fc356.mem +0 -0
- package/lib/legacy/static/RoomleCoreJs-a3caeb0e833c684f.js +0 -155
- package/lib/legacy/static/RoomleToolsCore-1d5812a538afe16c.wasm +0 -0
- package/lib/legacy/tools-core-989e9d49.legacy.js.map +0 -1
- package/lib/material-viewer-331b92e4.js.map +0 -1
- package/lib/material-viewer-4aa546a2.nomodule.js.map +0 -1
- package/lib/material-viewer-main-64baba25.js +0 -2
- package/lib/material-viewer-main-64baba25.js.map +0 -1
- package/lib/pixotron-139a0326.js +0 -2
- package/lib/pixotron-e4c3c879.nomodule.js +0 -2
- package/lib/planner-072c1ad9.nomodule.js +0 -2
- package/lib/planner-4339598f.js +0 -2
- package/lib/planner-main-371aa66d.js +0 -2
- package/lib/planner-main-371aa66d.js.map +0 -1
- package/lib/roomle-configurator-1dbdbc7e.nomodule.js +0 -2
- package/lib/roomle-configurator-86cb68c5.js +0 -2
- package/lib/roomle-dependency-injection-09cae7f5.js +0 -16
- package/lib/roomle-dependency-injection-6187ba7d.nomodule.js +0 -16
- package/lib/roomle-sdk-bb376981.js.map +0 -1
- package/lib/script-loader-1a880868.js.map +0 -1
- package/lib/script-loader-27459708.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-20501a284bc8fc51.wasm +0 -0
- package/lib/static/ConfiguratorKernelJs-191430a6a5695255.mem +0 -0
- package/lib/static/ConfiguratorKernelJs-959d98f479f267ec.js +0 -146
- package/lib/static/RoomleCore-2050e58329a960b4.js.map +0 -1
- package/lib/static/RoomleCore-4000ede83dfd263f.wasm +0 -0
- package/lib/static/RoomleCoreJs-10c954e4de8fc356.mem +0 -0
- package/lib/static/RoomleCoreJs-a3caeb0e833c684f.js +0 -155
- package/lib/static/RoomleToolsCore-1d5812a538afe16c.wasm +0 -0
- package/lib/static/RoomleToolsCore-fbef1640a2d95a32.js.map +0 -1
- package/lib/static/rthree-ffe182e11c947389.js.map +0 -1
- package/lib/static/worker-to-main-thread-73234f7a.js +0 -1
- package/lib/static/worker-to-main-thread-73234f7a.js.map +0 -1
- package/lib/tools-core-adbae98e.js.map +0 -1
- package/lib/tools-core-c8d2e0c4.nomodule.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
import{ai as ScenePluginDefaultImplementation,_ as __decorate,i as inject}from"./roomle-dependency-injection-bfa0cd66.js";import{g as getAssetPath}from"./main-thread-to-worker-88f74244.js";class BananaForScale extends ScenePluginDefaultImplementation{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(getAssetPath()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),a=this._bounds.getCenter(new THREE.Vector3).clone();a.x-=e.x/2+.18,a.z+=e.z/2+.05,a.y=0;let n=.03;this._banana.scale.copy(new THREE.Vector3(n,n,n)),this._banana.rotation.y=.6,this._banana.position.copy(a)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,a){super.clearScene(e,a),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}__decorate([inject],BananaForScale.prototype,"_staticItemLoader",void 0);export default BananaForScale;
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-735674f3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-735674f3.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"mUAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-d36e4e32.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js"],(function(e){var n,t,a,s;return{setters:[function(e){n=e.ai,t=e._,a=e.i},function(e){s=e.g}],execute:function(){class i extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),n=this._bounds.getCenter(new THREE.Vector3).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new THREE.Vector3(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",i),t([a],i.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-74023eca.nomodule.js.map
|
package/lib/{banana-for-scale-0bb2a603.nomodule.js.map → banana-for-scale-74023eca.nomodule.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-74023eca.nomodule.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"qTAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as __decorate,i as inject}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-dimensioning-
|
|
1
|
+
import{_ as __decorate,i as inject}from"./roomle-dependency-injection-bfa0cd66.js";import"./main-thread-to-worker-88f74244.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class ComponentDimensioning extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(LINE_MATERIAL)?this._lineMaterial=this._cacheHolder.materialCache.get(LINE_MATERIAL):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(LINE_MATERIAL,this._lineMaterial)),this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.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 THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let d=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(d),this._addXEdgeSideLines(d)),1===this._dimensioning.type.value&&(i=this._getYEdge(d),this._addYEdgeSideLines(d)),2===this._dimensioning.type.value&&(i=this._getZEdge(d),this._addZEdgeSideLines(d)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}__decorate([inject],ComponentDimensioning.prototype,"_cacheHolder",void 0),__decorate([inject],ComponentDimensioning.prototype,"_unitFormatter",void 0);export default ComponentDimensioning;
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-8b53bc8f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-8b53bc8f.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-dimensioning-
|
|
1
|
+
System.register(["./roomle-dependency-injection-d36e4e32.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js"],(function(e){var i,t;return{setters:[function(e){i=e._,t=e.i},function(){}],execute:function(){const n="component_dimensioning_line_material",s="component_dimensioning_plane_material",o="component_dimensioning_text_material";class h extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(n)?this._lineMaterial=this._cacheHolder.materialCache.get(n):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(n,this._lineMaterial)),this._cacheHolder.materialCache.has(s)?this._planeMaterial=this._cacheHolder.materialCache.get(s):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(s,this._planeMaterial)),this._cacheHolder.materialCache.has(o)?this._textMaterial=this._cacheHolder.materialCache.get(o):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(o,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let h={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},a=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(a,h);_.computeBoundingBox();let d=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(d),this._addXEdgeSideLines(d)),1===this._dimensioning.type.value&&(i=this._getYEdge(d),this._addYEdgeSideLines(d)),2===this._dimensioning.type.value&&(i=this._getZEdge(d),this._addZEdgeSideLines(d)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(h,a)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,h),this._addLine(a,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,h),this._addLine(a,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let h=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}e("default",h),i([t],h.prototype,"_cacheHolder",void 0),i([t],h.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-efcee022.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-efcee022.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-d36e4e32.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js"],(function(e){var t,i;return{setters:[function(e){t=e.a0},function(e){i=e.t}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,i,n=!1){if(e.children.length>0&&e.children.forEach(t=>{const s=i&&e.id===i.id||n,a=!(t instanceof THREE.Mesh);this._changeMaterialsOnSelect(t,i,(!s||!a)&&s)}),i)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),n||t(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:i,transparent:n}=e.userData.oldMaterial;t(e,{opacity:i,transparent:n}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),n=(new THREE.Vector3).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new THREE.Frustum,i=(new THREE.Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new THREE.Box3;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new THREE.Vector3);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-a495fdd5.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-a495fdd5.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a0 as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
import{a0 as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-bfa0cd66.js";import{t as throttle}from"./main-thread-to-worker-88f74244.js";export default class{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(n=>{const a=t&&e.id===t.id||i,s=!(n instanceof THREE.Mesh);this._changeMaterialsOnSelect(n,t,(!a||!s)&&a)}),t)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:t,transparent:i}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),n=(new THREE.Vector3).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const a=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||a.push(e))}),0===a.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new THREE.Frustum,i=(new THREE.Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new THREE.Box3;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new THREE.Vector3);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}}
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-a5df8d16.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-a5df8d16.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./query-params-helper-a271f9dc.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,C as ConfiguratorViewModel,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
import"./query-params-helper-a271f9dc.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,C as ConfiguratorViewModel,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-bfa0cd66.js";import"./main-thread-to-worker-88f74244.js";import{C as ConfiguratorSceneManager,R as RoomleConfigurator}from"./roomle-configurator-3bb4ecfc.js";import{C as CameraControl3D,a as CameraControl}from"./pixotron-a078097f.js";import{S as ScriptLoader,M as Main}from"./script-loader-6dfd98d3.js";import ComponentRaycastHelper from"./component-raycast-helper-a5df8d16.js";import"./default-light-setting-d75da8d3.js";const INJECTABLES=[new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess),new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("camera-control-3d",CameraControl3D),new DependencyInjectionAssignment("camera-control",CameraControl),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("configurator-scene-manager",ConfiguratorSceneManager,1),new DependencyInjectionAssignment("configurator-view-model",ConfiguratorViewModel,1),new DependencyInjectionAssignment("component-raycast-helper",ComponentRaycastHelper,0)];class Configurator extends Main{setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access"),o=(this.lookup("dom-helper"),this.lookup("configurator-scene-manager"));e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};AppContext.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new RoomleConfigurator(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}export{Configurator};
|
|
2
|
+
//# sourceMappingURL=configurator-56f18f83.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-56f18f83.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-d36e4e32.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js","./roomle-configurator-88705a42.nomodule.js","./pixotron-0196b4ad.nomodule.js","./script-loader-f6273f1e.nomodule.js","./component-raycast-helper-a495fdd5.nomodule.js","./default-light-setting-b08fff1a.nomodule.js"],(function(e){var o,n,t,r,i,a,c,s,l,u,p,d,f,g;return{setters:[function(){},function(e){o=e.D,n=e.L,t=e.R,r=e.a,i=e.C,a=e.b,c=e.A},function(){},function(e){s=e.C,l=e.R},function(e){u=e.C,p=e.a},function(e){d=e.S,f=e.M},function(e){g=e.default},function(){}],execute:function(){const h=[new o("logger",n),new o("rapi-access",t),new o("script-loader",d),new o("camera-control-3d",u),new o("camera-control",p),new o("data-syncer",r),new o("configurator-scene-manager",s,1),new o("configurator-view-model",i,1),new o("component-raycast-helper",g,0)];e("Configurator",class extends f{setupDependencies(){a.setup(h),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),o=this.lookup("rapi-access"),n=(this.lookup("dom-helper"),this.lookup("configurator-scene-manager"));e&&e.cleanUp(),o&&o.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:o,kernelContainer:n,planObjectId:t}=e||{};c.init({kernelInstance:o,kernelContainer:n,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new l(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-e8a4a985.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-e8a4a985.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./query-params-helper-a271f9dc.js";import"./roomle-dependency-injection-bfa0cd66.js";import"./main-thread-to-worker-88f74244.js";import"./roomle-configurator-3bb4ecfc.js";import"./pixotron-a078097f.js";import"./script-loader-6dfd98d3.js";import"./component-raycast-helper-a5df8d16.js";import"./default-light-setting-d75da8d3.js";import{Configurator}from"./configurator-56f18f83.js";(new Configurator).boot(),window.requestIdleCallback||(window.requestIdleCallback=o=>setTimeout(()=>{let e=Date.now();o({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(o){clearTimeout(o)});
|
|
2
|
+
//# sourceMappingURL=configurator-main-99158dd7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-main-99158dd7.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-
|
|
1
|
+
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-d36e4e32.nomodule.js","./main-thread-to-worker-6a4eb1ee.nomodule.js","./roomle-configurator-88705a42.nomodule.js","./pixotron-0196b4ad.nomodule.js","./script-loader-f6273f1e.nomodule.js","./component-raycast-helper-a495fdd5.nomodule.js","./default-light-setting-b08fff1a.nomodule.js","./configurator-e8a4a985.nomodule.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(o){e=o.Configurator}],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
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./roomle-dependency-injection-d36e4e32.nomodule.js","./pixotron-0196b4ad.nomodule.js"],(function(i){var t,a;return{setters:[function(i){t=i.h},function(i){a=i.L}],execute:function(){i("D",class extends a{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 THREE.DirectionalLight(new THREE.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 THREE.Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0)),this._secondDirectionalLight=new THREE.DirectionalLight(new THREE.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 THREE.Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new THREE.Vector3(0,0,0)),this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new THREE.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=t();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 THREE.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 THREE.Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.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 THREE.Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0)))}}}})}}}));
|
|
2
|
+
//# sourceMappingURL=default-light-setting-b08fff1a.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-b08fff1a.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as getGUI}from"./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
import{h as getGUI}from"./roomle-dependency-injection-bfa0cd66.js";import{L as LightSetting}from"./pixotron-a078097f.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 THREE.DirectionalLight(new THREE.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 THREE.Vector2(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0)),this._secondDirectionalLight=new THREE.DirectionalLight(new THREE.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 THREE.Vector2(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new THREE.Vector3(0,0,0)),this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new THREE.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 THREE.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 THREE.Color(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.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 THREE.Color(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new THREE.Vector3(0,0,0)))}}}}export{DefaultLightSetting as D};
|
|
2
|
+
//# sourceMappingURL=default-light-setting-d75da8d3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-d75da8d3.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const MOCK_1_CAMERA_PARAMETER: {
|
|
2
|
+
yaw: number;
|
|
3
|
+
pitch: number;
|
|
4
|
+
distance: number;
|
|
5
|
+
targetX: number;
|
|
6
|
+
targetY: number;
|
|
7
|
+
targetZ: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const MOCK_2_CAMERA_PARAMETER: {
|
|
10
|
+
yaw: number;
|
|
11
|
+
pitch: number;
|
|
12
|
+
distance: number;
|
|
13
|
+
targetX: number;
|
|
14
|
+
targetY: number;
|
|
15
|
+
targetZ: number;
|
|
16
|
+
};
|
|
@@ -46,6 +46,7 @@ export declare const MOCK_RAPI_USER_ACTION: {
|
|
|
46
46
|
count: number;
|
|
47
47
|
aggregationLevel: number;
|
|
48
48
|
};
|
|
49
|
+
export declare const MOCK_RAPI_CONFIGURABLE_ITEM: RapiItem;
|
|
49
50
|
export declare const wrapIntoRapiBox: (key: string, data: RapiJson | RapiJson[]) => {
|
|
50
51
|
[x: string]: {};
|
|
51
52
|
meta: {};
|
|
@@ -9,4 +9,6 @@ export default class ConfiguratorPlanObjectViewModel extends PlanObjectViewModel
|
|
|
9
9
|
getConfigurationRuntimeId(): number;
|
|
10
10
|
getRootComponentId(): number;
|
|
11
11
|
getRootComponentRuntimeId(): number;
|
|
12
|
+
finishConstruction(): Promise<void>;
|
|
13
|
+
failConstruction(): Promise<void>;
|
|
12
14
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { PlanObject } from '../../../typings/planner';
|
|
2
2
|
import PlanElementViewModel from './plan-element-view-model';
|
|
3
3
|
export default class PlanObjectViewModel extends PlanElementViewModel {
|
|
4
|
+
private _initDone;
|
|
5
|
+
private _initFailed;
|
|
6
|
+
private _initWaiter;
|
|
4
7
|
constructor(planObject: PlanObject);
|
|
8
|
+
protected finishInit(): Promise<void>;
|
|
9
|
+
protected failInit(error: Error): Promise<void>;
|
|
10
|
+
isInitDone(): Promise<void>;
|
|
5
11
|
getPlanObject(): PlanObject;
|
|
6
12
|
getSize(): THREE.Vector3;
|
|
7
13
|
update(): void;
|
|
@@ -87,6 +87,7 @@ export default class RoomleConfigurator implements GlobalAPI, Context, KernelUti
|
|
|
87
87
|
private _reloadConfiguration;
|
|
88
88
|
private _performLoadConfiguration;
|
|
89
89
|
private _changeHDGeometry;
|
|
90
|
+
private _callOnPartListUpdate;
|
|
90
91
|
/**
|
|
91
92
|
* Set general configuration parameter
|
|
92
93
|
* @param initData
|
|
@@ -595,13 +596,13 @@ export default class RoomleConfigurator implements GlobalAPI, Context, KernelUti
|
|
|
595
596
|
* Undo last action
|
|
596
597
|
* calls configuratorHistory.undo where array of last configuration are stored
|
|
597
598
|
*/
|
|
598
|
-
undo(): void
|
|
599
|
+
undo(): Promise<void>;
|
|
599
600
|
/**
|
|
600
601
|
* Redo last action
|
|
601
602
|
* calls configuratorHistory.redo where array of last configuration are stored
|
|
602
603
|
* only possible if undo was called before
|
|
603
604
|
*/
|
|
604
|
-
redo(): void
|
|
605
|
+
redo(): Promise<void>;
|
|
605
606
|
/**
|
|
606
607
|
* clears current configurator history
|
|
607
608
|
*/
|
|
@@ -14,5 +14,6 @@ export default class ComponentRaycastHelper {
|
|
|
14
14
|
checkComponentAndPreviewVisibility(sceneEventHandler: ConfiguratorSceneEventHandler, configuratorViewModel: ConfiguratorViewModel): void;
|
|
15
15
|
checkComponentVisibility(sceneEventHandler: ConfiguratorSceneEventHandler, configuratorViewModel: ConfiguratorViewModel): void;
|
|
16
16
|
areAllPreviewsVisible(configuratorViewModel: ConfiguratorViewModel): boolean;
|
|
17
|
+
areAllComponentsInFrustum(previews: RoomleComponent[]): boolean;
|
|
17
18
|
checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel): void;
|
|
18
19
|
}
|
|
@@ -147,7 +147,7 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
147
147
|
* @param position x (left/right),y (up, down) and z(front, back) in meters
|
|
148
148
|
* @param rotation in radians
|
|
149
149
|
*/
|
|
150
|
-
insertObject(id: RapiId, position?: Position3, rotation?: number): Promise<void
|
|
150
|
+
insertObject(id: RapiId, position?: Position3, rotation?: number): Promise<void>;
|
|
151
151
|
insertItemList(ids: RapiId[]): Promise<void>;
|
|
152
152
|
/**
|
|
153
153
|
* Inserts all of the items in the array into current plan
|
|
@@ -20,6 +20,8 @@ export interface PlannerKernelCallbackI {
|
|
|
20
20
|
planBoundsChanged(): void;
|
|
21
21
|
planHistoryStateChanged(): void;
|
|
22
22
|
planCleared(): void;
|
|
23
|
+
startedDrawing(): void;
|
|
24
|
+
stoppedDrawing(): void;
|
|
23
25
|
}
|
|
24
26
|
export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
25
27
|
private _kernelAccessCallback;
|
|
@@ -51,7 +53,9 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
51
53
|
planCleared(): void;
|
|
52
54
|
planCompletelyLoaded(plan: Plan): void;
|
|
53
55
|
planElement3dMeshChanged(plan: Plan, element: PlanElement): void;
|
|
54
|
-
|
|
56
|
+
private _onStaticItemAdded;
|
|
57
|
+
private _onConfigurableItemAdded;
|
|
58
|
+
planElementAdded(plan: Plan, element: PlanElement): Promise<void>;
|
|
55
59
|
planElementChanged(plan: Plan, element: KernelObject): void;
|
|
56
60
|
planHistoryStateChanged(): void;
|
|
57
61
|
planObjectConfigurationCreated(_plan: Plan, _element: PlanObject): void;
|
|
@@ -66,7 +70,7 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
66
70
|
beginPlanConstruction(plan: Plan): void;
|
|
67
71
|
addPlanMesh(plan: Plan, material: any, vertices: Int32Array, indices: Int32Array, uvCoords: Float32Array, normals: Float32Array, type: KernelEnum): void;
|
|
68
72
|
endPlanConstruction(plan: Plan): void;
|
|
69
|
-
addPlanObjectFromItem(rapiElement: RapiItem | RapiConfiguration, position?: Position3, rotation?: number):
|
|
73
|
+
addPlanObjectFromItem(rapiElement: RapiItem | RapiConfiguration, position?: Position3, rotation?: number): Promise<void>;
|
|
70
74
|
coupleReferences(jsObject: any, coreReference: KernelObject): void;
|
|
71
75
|
private _decoupleReferences;
|
|
72
76
|
}
|
|
@@ -28,6 +28,8 @@ export default class PlanViewModel extends ConfiguratorViewModel implements Plan
|
|
|
28
28
|
private _plannerSceneEventHandler;
|
|
29
29
|
private _cameraType;
|
|
30
30
|
constructor(creator: string);
|
|
31
|
+
startedDrawing(): void;
|
|
32
|
+
stoppedDrawing(): void;
|
|
31
33
|
planBoundsChanged(): void;
|
|
32
34
|
setReference(plan: Plan): void;
|
|
33
35
|
clearReference(): void;
|
|
@@ -35,6 +37,8 @@ export default class PlanViewModel extends ConfiguratorViewModel implements Plan
|
|
|
35
37
|
addPlanElementViewModel(planElementViewModel: PlanElementViewModel): void;
|
|
36
38
|
protected _addRootComponent(component: RoomleComponent): void;
|
|
37
39
|
private _getPlanObjectViewModelForRuntimeId;
|
|
40
|
+
getConfigurablePlanObjectForId(id: number): ConfiguratorPlanObjectViewModel;
|
|
41
|
+
getStaticPlanObjectForId(id: number): StaticPlanObjectViewModel;
|
|
38
42
|
getPlanObjectForId(id: number): PlanElementViewModel;
|
|
39
43
|
getConstructionGroup(): THREE.Group;
|
|
40
44
|
getCeilingGroup(): THREE.Group;
|
|
@@ -68,7 +72,7 @@ export default class PlanViewModel extends ConfiguratorViewModel implements Plan
|
|
|
68
72
|
addPlanMesh(_plan: Plan, _material: any, _vertices: Int32Array, _indices: Int32Array, _uvCoords: Float32Array, _normals: Float32Array, _type: KernelEnum): void;
|
|
69
73
|
endPlanConstruction(_plan: Plan): void;
|
|
70
74
|
planElementChanged(_plan: Plan, _planObject: PlanElementViewModel): void;
|
|
71
|
-
planObjectConfigurationLoaded(_plan: Plan,
|
|
75
|
+
planObjectConfigurationLoaded(_plan: Plan, element: PlanElement, success: boolean): void;
|
|
72
76
|
addMesh(planElement: PlanElement, material: any, vertices: Int32Array, indices: Int32Array, uvCoords: Float32Array, normals: Float32Array): void;
|
|
73
77
|
removePlanObjectFromScene(planElementViewModel: PlanElementViewModel): void;
|
|
74
78
|
private _isConstructionType;
|
|
@@ -6,6 +6,7 @@ export default class StaticPlanObjectViewModel extends PlanObjectViewModel {
|
|
|
6
6
|
private _glbUrl;
|
|
7
7
|
private _rapiItem;
|
|
8
8
|
constructor(planObject: PlanObject);
|
|
9
|
+
isInitDone(): Promise<void>;
|
|
9
10
|
setRapiItem(rapiItem: RapiItem): Promise<void>;
|
|
10
11
|
private _addStaticItem;
|
|
11
12
|
getRapiItem(): RapiItem;
|
|
@@ -53,7 +53,6 @@ export default class PlannerSceneEventHandler extends SceneEventHandler<SceneEve
|
|
|
53
53
|
private _isDrawingEnabled;
|
|
54
54
|
private _isCurrentlyDrawing;
|
|
55
55
|
private _state;
|
|
56
|
-
private _point;
|
|
57
56
|
private _floorDrawingPlane;
|
|
58
57
|
constructor(creator: string, scene: THREE.Scene, camera: THREE.Camera, inputManager: InputManager);
|
|
59
58
|
disable(): void;
|
|
@@ -68,6 +67,10 @@ export default class PlannerSceneEventHandler extends SceneEventHandler<SceneEve
|
|
|
68
67
|
private _addPlanObjectHandlers;
|
|
69
68
|
private _addPlanElementHandlers;
|
|
70
69
|
private _createFloorMeshWithHandler;
|
|
70
|
+
private _clickOnPlane;
|
|
71
|
+
private _doubleClickOnPlane;
|
|
72
|
+
private _closeToPoint;
|
|
73
|
+
private _close;
|
|
71
74
|
private _clickElement;
|
|
72
75
|
private _doubleClickElement;
|
|
73
76
|
private _hoverOn;
|
|
@@ -94,7 +97,8 @@ export default class PlannerSceneEventHandler extends SceneEventHandler<SceneEve
|
|
|
94
97
|
disableSnapping(): void;
|
|
95
98
|
enableWallDrawing(): THREE.Mesh;
|
|
96
99
|
cancelWallDrawing(): THREE.Mesh;
|
|
97
|
-
|
|
100
|
+
stopDrawing(): void;
|
|
101
|
+
startDrawing(): void;
|
|
98
102
|
private _toggleDrawing;
|
|
99
103
|
private _endWallDrawing;
|
|
100
104
|
private _startWallDrawing;
|
|
@@ -117,8 +117,14 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
117
117
|
enableWallDrawing(): void;
|
|
118
118
|
disableWallDrawing(): void;
|
|
119
119
|
escapeDrawing(): void;
|
|
120
|
-
private drawingStart;
|
|
121
|
-
private drawingEnd;
|
|
122
120
|
protected _changeCameraControl(cameraControl: CameraControl): void;
|
|
123
121
|
setSceneEvents(sceneEvents: SceneEvents): void;
|
|
122
|
+
/**
|
|
123
|
+
* called by kernel
|
|
124
|
+
*/
|
|
125
|
+
startedDrawing(): void;
|
|
126
|
+
/**
|
|
127
|
+
* called by kernel
|
|
128
|
+
*/
|
|
129
|
+
stoppedDrawing(): void;
|
|
124
130
|
}
|
|
@@ -9,7 +9,7 @@ export interface KernelObject {
|
|
|
9
9
|
clone(): KernelObject;
|
|
10
10
|
delete(): void;
|
|
11
11
|
}
|
|
12
|
-
export declare const INITIAL_SNAP_DISTANCE =
|
|
12
|
+
export declare const INITIAL_SNAP_DISTANCE = 50;
|
|
13
13
|
export interface Plan extends KernelObject {
|
|
14
14
|
defaultParapetHeight: number;
|
|
15
15
|
defaultWallHeight: number;
|
|
@@ -72,7 +72,7 @@ export interface PlanInteractionHandler {
|
|
|
72
72
|
rotateObjectTo(planObject: KernelObject, angleInRad: number): void;
|
|
73
73
|
setObjectRotation(planObject: KernelObject, angleInRad: number): void;
|
|
74
74
|
addPlanObjects(list: KernelObjectPtrList): void;
|
|
75
|
-
addPlanObjectFromItem(object: KernelObject, position: KernelVector3, type: number):
|
|
75
|
+
addPlanObjectFromItem(object: KernelObject, position: KernelVector3, type: number): PlanObject;
|
|
76
76
|
removeElement(planObject: KernelObject): void;
|
|
77
77
|
groupObjects(planObjectPtrList: PlanObjectList): ObjectGroupPtr;
|
|
78
78
|
rotateObjectsBy(planObjectPtrList: PlanObjectList, anAngleInRad: number, aroundPoint: KernelVector3): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as dispose,_ as __decorate,i as inject,O as AsyncGuard,ai as AsyncDependencyLoader}from"./roomle-dependency-injection-09cae7f5.js";import"./main-thread-to-worker-88f74244.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.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 THREE.MeshBasicMaterial({color:16777215,side:THREE.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 THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,i,t,s){this._position.copy(e),this._dimensioningType=i,this._cameraPosition=s,this._label=t;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,i,t){let s=new THREE.Vector3;s.copy(this._position),t.x*=this._getXSign(),s.add(t);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(i);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(i)}_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._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let i=new THREE.Geometry;this._widthLine=new THREE.Line(i,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(i,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(i,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,i=this._getWidthEdge();e.vertices.push(i.start,i.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(t,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,i=this._getHeightEdge();e.vertices.push(i.start,i.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(t,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,i=this._getDepthEdge();e.vertices.push(i.start,i.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(t,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let i=this._lineBounds.min.y<0?this._lineBounds.min.y:0;i-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,i,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,i){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),i.add(this._widthText),e.add(this._heightLine),i.add(this._heightText),e.add(this._depthLine),i.add(this._depthText))}removeFromScene(e,i){e.remove(this._widthLine),i.remove(this._widthText),e.remove(this._heightLine),i.remove(this._heightText),e.remove(this._depthLine),i.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,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.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_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 THREE.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._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.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()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export default DimensioningHelper;
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
import{p as dispose,_ as __decorate,i as inject,O as AsyncGuard,ah as AsyncDependencyLoader}from"./roomle-dependency-injection-bfa0cd66.js";import"./main-thread-to-worker-88f74244.js";const PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class TextWithBackground extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.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 THREE.MeshBasicMaterial({color:16777215,side:THREE.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 THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,i,t,s){this._position.copy(e),this._dimensioningType=i,this._cameraPosition=s,this._label=t;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,i,t){let s=new THREE.Vector3;s.copy(this._position),t.x*=this._getXSign(),s.add(t);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(i);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(i)}_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._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new AsyncGuard,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let i=new THREE.Geometry;this._widthLine=new THREE.Line(i,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(i,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(i,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),AsyncDependencyLoader.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,i=this._getWidthEdge();e.vertices.push(i.start,i.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new TextWithBackground(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(t,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,i=this._getHeightEdge();e.vertices.push(i.start,i.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new TextWithBackground(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(t,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,i=this._getDepthEdge();e.vertices.push(i.start,i.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let t=i.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new TextWithBackground(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(t,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let i=this._lineBounds.min.y<0?this._lineBounds.min.y:0;i-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,i,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,i){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),i.add(this._widthText),e.add(this._heightLine),i.add(this._heightText),e.add(this._depthLine),i.add(this._depthText))}removeFromScene(e,i){e.remove(this._widthLine),i.remove(this._widthText),e.remove(this._heightLine),i.remove(this._heightText),e.remove(this._depthLine),i.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,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.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_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 THREE.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._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.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()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}__decorate([inject],DimensioningHelper.prototype,"_unitFormatter",void 0);export default DimensioningHelper;
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-241c4cf6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-241c4cf6.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"wuHAAe"}
|