@roomle/web-sdk 2.80.0-alpha.2 → 2.80.0-alpha.3
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/{TextGeometry-b57a793b.nomodule.js → TextGeometry-2cd7a69b.nomodule.js} +2 -2
- package/lib/{TextGeometry-b57a793b.nomodule.js.map → TextGeometry-2cd7a69b.nomodule.js.map} +1 -1
- package/lib/{TextGeometry-f0a85d6a.js → TextGeometry-afd21a68.js} +2 -2
- package/lib/{TextGeometry-f0a85d6a.js.map → TextGeometry-afd21a68.js.map} +1 -1
- package/lib/{banana-for-scale-8c9b8e0d.nomodule.js → banana-for-scale-24a6e087.nomodule.js} +2 -2
- package/lib/{banana-for-scale-8c9b8e0d.nomodule.js.map → banana-for-scale-24a6e087.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-12147338.js → banana-for-scale-65562f32.js} +2 -2
- package/lib/{banana-for-scale-12147338.js.map → banana-for-scale-65562f32.js.map} +1 -1
- package/lib/{budgeteer-measure-d54121c4.js → budgeteer-measure-d2fdd2ca.js} +2 -2
- package/lib/{budgeteer-measure-d54121c4.js.map → budgeteer-measure-d2fdd2ca.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/camera-behaviour-7aba1045.js +2 -0
- package/lib/{camera-behaviour-4d4e7e7c.js.map → camera-behaviour-7aba1045.js.map} +1 -1
- package/lib/camera-behaviour-f8fd624d.nomodule.js +2 -0
- package/lib/{camera-behaviour-1b0b7853.nomodule.js.map → camera-behaviour-f8fd624d.nomodule.js.map} +1 -1
- package/lib/{component-dimensioning-36a1e68e.nomodule.js → component-dimensioning-01b50642.nomodule.js} +2 -2
- package/lib/component-dimensioning-01b50642.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-bdbf6729.js → component-dimensioning-3f78471b.js} +2 -2
- package/lib/component-dimensioning-3f78471b.js.map +1 -0
- package/lib/{component-raycast-helper-40363857.js → component-raycast-helper-2688213e.js} +2 -2
- package/lib/component-raycast-helper-2688213e.js.map +1 -0
- package/lib/{component-raycast-helper-67f9a0e9.nomodule.js → component-raycast-helper-f56673b2.nomodule.js} +2 -2
- package/lib/component-raycast-helper-f56673b2.nomodule.js.map +1 -0
- package/lib/configurator-45e4da79.nomodule.js +2 -0
- package/lib/configurator-45e4da79.nomodule.js.map +1 -0
- package/lib/{configurator-7fce117f.js → configurator-865ca37c.js} +2 -2
- package/lib/configurator-865ca37c.js.map +1 -0
- package/lib/configurator-main-2a5e98fa.js +2 -0
- package/lib/configurator-main-2a5e98fa.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-f2aea1db.nomodule.js → continuous-drawing-helper-2a592de8.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-2a592de8.nomodule.js.map +1 -0
- package/lib/{continuous-drawing-helper-094fdf93.js → continuous-drawing-helper-f4b05a9e.js} +2 -2
- package/lib/continuous-drawing-helper-f4b05a9e.js.map +1 -0
- package/lib/{default-light-setting-ad52e6de.js → default-light-setting-1a29c5d9.js} +2 -2
- package/lib/default-light-setting-1a29c5d9.js.map +1 -0
- package/lib/{default-light-setting-7f113f35.nomodule.js → default-light-setting-4b20f995.nomodule.js} +2 -2
- package/lib/default-light-setting-4b20f995.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/configurator-kernel-access.d.ts +7 -0
- package/lib/definitions/common-core/src/utils/shims.d.ts +5 -0
- package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +10 -1
- package/lib/definitions/common-core/src/view-model/configurator-view-model.d.ts +12 -4
- package/lib/definitions/common-core/src/view-model/helpers/constants.d.ts +2 -0
- package/lib/definitions/common-core/src/webgl/roomle-component-factory.d.ts +2 -0
- package/lib/definitions/configurator-core/src/utils/raycast-helper.d.ts +4 -4
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-event-handler.d.ts +2 -1
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +2 -0
- package/lib/definitions/planner-core/src/view-model/construction-plan-object-view-model.d.ts +0 -1
- package/lib/definitions/planner-core/src/view-model/node-plan-element-view-model.d.ts +0 -2
- package/lib/definitions/planner-core/src/webgl/construction-top-view.d.ts +1 -0
- package/lib/definitions/planner-core/src/webgl/draggable-node.d.ts +1 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-event-handler.d.ts +2 -2
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +1 -0
- package/lib/definitions/typings/rapi-types.d.ts +1 -1
- package/lib/dimensioning-helper-b0c8123d.js +2 -0
- package/lib/{dimensioning-helper-7494fb28.js.map → dimensioning-helper-b0c8123d.js.map} +1 -1
- package/lib/dimensioning-helper-d38228b8.nomodule.js +2 -0
- package/lib/dimensioning-helper-d38228b8.nomodule.js.map +1 -0
- package/lib/{glb-viewer-0fd5cc99.nomodule.js → glb-viewer-2f2f6d1b.nomodule.js} +2 -2
- package/lib/{glb-viewer-0fd5cc99.nomodule.js.map → glb-viewer-2f2f6d1b.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-039ccdb1.js → glb-viewer-81c29c2c.js} +2 -2
- package/lib/{glb-viewer-039ccdb1.js.map → glb-viewer-81c29c2c.js.map} +1 -1
- package/lib/glb-viewer-camera-behaviour-2b657a16.js +2 -0
- package/lib/glb-viewer-camera-behaviour-2b657a16.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-c43375cf.nomodule.js → glb-viewer-camera-behaviour-9676fa07.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-9676fa07.nomodule.js.map +1 -0
- package/lib/glb-viewer-main-16ce98b3.js +2 -0
- package/lib/glb-viewer-main-16ce98b3.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{TextGeometry-8862f872.legacy.js → TextGeometry-bd959010.legacy.js} +2 -2
- package/lib/legacy/{TextGeometry-8862f872.legacy.js.map → TextGeometry-bd959010.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-ade37173.legacy.js → banana-for-scale-6983319f.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-ade37173.legacy.js.map → banana-for-scale-6983319f.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/camera-behaviour-ef426a46.legacy.js +2 -0
- package/lib/legacy/{camera-behaviour-ba624fdd.legacy.js.map → camera-behaviour-ef426a46.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-d6f65e0d.legacy.js → component-dimensioning-9b27ee47.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-9b27ee47.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-f8241e23.legacy.js → component-raycast-helper-f4084d11.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-f4084d11.legacy.js.map +1 -0
- package/lib/legacy/configurator-2c4150d4.legacy.js +2 -0
- package/lib/legacy/configurator-2c4150d4.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-8f4235b4.legacy.js → continuous-drawing-helper-e5520525.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-e5520525.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-1e175f7c.legacy.js → default-light-setting-c2e3a172.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-c2e3a172.legacy.js.map +1 -0
- package/lib/legacy/dimensioning-helper-d82ea1b2.legacy.js +2 -0
- package/lib/legacy/dimensioning-helper-d82ea1b2.legacy.js.map +1 -0
- package/lib/legacy/{glb-viewer-53726809.legacy.js → glb-viewer-2171e4db.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-53726809.legacy.js.map → glb-viewer-2171e4db.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-camera-behaviour-6f853358.legacy.js → glb-viewer-camera-behaviour-cfc892bc.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-cfc892bc.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{main-thread-to-worker-63c62382.legacy.js → main-thread-to-worker-6dc921e1.legacy.js} +3 -3
- package/lib/legacy/{main-thread-to-worker-63c62382.legacy.js.map → main-thread-to-worker-6dc921e1.legacy.js.map} +1 -1
- package/lib/legacy/material-viewer-cbcd6421.legacy.js +2 -0
- package/lib/legacy/material-viewer-cbcd6421.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-2fc85f51.legacy.js +2 -0
- package/lib/legacy/{planner-20fc10ce.legacy.js.map → planner-2fc85f51.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{query-params-helper-a1e70858.legacy.js → query-params-helper-a47f6cfb.legacy.js} +2 -2
- package/lib/legacy/query-params-helper-a47f6cfb.legacy.js.map +1 -0
- package/lib/legacy/roomle-configurator-6ab50bfd.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-6ab50bfd.legacy.js.map +1 -0
- package/lib/legacy/roomle-dependency-injection-7ff2d03f.legacy.js +9 -0
- package/lib/legacy/{roomle-dependency-injection-3542b35a.legacy.js.map → roomle-dependency-injection-7ff2d03f.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-25518980.legacy.js → script-loader-86b229ef.legacy.js} +2 -2
- package/lib/legacy/script-loader-86b229ef.legacy.js.map +1 -0
- package/lib/legacy/static/ConfiguratorKernel-0364d231fcecaafc.wasm +0 -0
- package/lib/legacy/static/RoomleCore-40aee224ba8fbae2.wasm +0 -0
- package/lib/{static/RoomleToolsCore-19282746bbb98ca2.wasm → legacy/static/RoomleToolsCore-6c32dd9f8d017af8.wasm} +0 -0
- package/lib/legacy/{stats-helper-4dd75b8d.legacy.js → stats-helper-28e73e75.legacy.js} +2 -2
- package/lib/legacy/stats-helper-28e73e75.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-5dd3b7d4.legacy.js → tools-core-482a572b.legacy.js} +2 -2
- package/lib/legacy/tools-core-482a572b.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-82b32425.js → main-thread-to-worker-ab187cd2.js} +2 -2
- package/lib/{main-thread-to-worker-82b32425.js.map → main-thread-to-worker-ab187cd2.js.map} +1 -1
- package/lib/{main-thread-to-worker-ff04af1e.nomodule.js → main-thread-to-worker-e424b0c2.nomodule.js} +2 -2
- package/lib/{main-thread-to-worker-ff04af1e.nomodule.js.map → main-thread-to-worker-e424b0c2.nomodule.js.map} +1 -1
- package/lib/material-viewer-56b68f41.js +2 -0
- package/lib/material-viewer-56b68f41.js.map +1 -0
- package/lib/material-viewer-c225f64e.nomodule.js +2 -0
- package/lib/material-viewer-c225f64e.nomodule.js.map +1 -0
- package/lib/material-viewer-main-217bc953.js +2 -0
- package/lib/material-viewer-main-217bc953.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-827f6366.nomodule.js +2 -0
- package/lib/{planner-75145ec2.nomodule.js.map → planner-827f6366.nomodule.js.map} +1 -1
- package/lib/planner-b4546a3c.js +2 -0
- package/lib/{planner-ce25224e.js.map → planner-b4546a3c.js.map} +1 -1
- package/lib/planner-main-6d2478f2.js +2 -0
- package/lib/planner-main-6d2478f2.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{query-params-helper-68ed40a6.js → query-params-helper-9d7ce8f1.js} +2 -2
- package/lib/query-params-helper-9d7ce8f1.js.map +1 -0
- package/lib/{query-params-helper-712890e0.nomodule.js → query-params-helper-fb60ee8f.nomodule.js} +2 -2
- package/lib/query-params-helper-fb60ee8f.nomodule.js.map +1 -0
- package/lib/roomle-configurator-0858b546.nomodule.js +2 -0
- package/lib/roomle-configurator-0858b546.nomodule.js.map +1 -0
- package/lib/roomle-configurator-f1595c70.js +2 -0
- package/lib/roomle-configurator-f1595c70.js.map +1 -0
- package/lib/roomle-dependency-injection-ac8f942b.js +9 -0
- package/lib/{roomle-dependency-injection-56db2f22.js.map → roomle-dependency-injection-ac8f942b.js.map} +1 -1
- package/lib/roomle-dependency-injection-dcc62c88.nomodule.js +9 -0
- package/lib/{roomle-dependency-injection-c12e4c00.nomodule.js.map → roomle-dependency-injection-dcc62c88.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-d2dbfbba.js → roomle-sdk-834c30bd.js} +2 -2
- package/lib/roomle-sdk-834c30bd.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-98a17bbb.nomodule.js → script-loader-bcf84a9b.nomodule.js} +2 -2
- package/lib/script-loader-bcf84a9b.nomodule.js.map +1 -0
- package/lib/{script-loader-ef092985.js → script-loader-fccf744e.js} +2 -2
- package/lib/script-loader-fccf744e.js.map +1 -0
- package/lib/static/ConfiguratorKernel-0364d231fcecaafc.wasm +0 -0
- package/lib/static/RoomleCore-40aee224ba8fbae2.wasm +0 -0
- package/lib/{legacy/static/RoomleToolsCore-19282746bbb98ca2.wasm → static/RoomleToolsCore-6c32dd9f8d017af8.wasm} +0 -0
- package/lib/{stats-helper-c0748092.js → stats-helper-7bf2b8e6.js} +2 -2
- package/lib/stats-helper-7bf2b8e6.js.map +1 -0
- package/lib/{stats-helper-efe5bf85.nomodule.js → stats-helper-9b31e52e.nomodule.js} +2 -2
- package/lib/stats-helper-9b31e52e.nomodule.js.map +1 -0
- package/lib/{tools-core-c31d15d3.nomodule.js → tools-core-5daf53b8.nomodule.js} +2 -2
- package/lib/tools-core-5daf53b8.nomodule.js.map +1 -0
- package/lib/{tools-core-2e800d36.js → tools-core-e8b51fb2.js} +2 -2
- package/lib/tools-core-e8b51fb2.js.map +1 -0
- package/package.json +2 -2
- package/lib/camera-behaviour-1b0b7853.nomodule.js +0 -2
- package/lib/camera-behaviour-4d4e7e7c.js +0 -2
- package/lib/component-dimensioning-36a1e68e.nomodule.js.map +0 -1
- package/lib/component-dimensioning-bdbf6729.js.map +0 -1
- package/lib/component-raycast-helper-40363857.js.map +0 -1
- package/lib/component-raycast-helper-67f9a0e9.nomodule.js.map +0 -1
- package/lib/configurator-04e3b0ec.nomodule.js +0 -2
- package/lib/configurator-04e3b0ec.nomodule.js.map +0 -1
- package/lib/configurator-7fce117f.js.map +0 -1
- package/lib/configurator-main-16e36fb1.js +0 -2
- package/lib/configurator-main-16e36fb1.js.map +0 -1
- package/lib/continuous-drawing-helper-094fdf93.js.map +0 -1
- package/lib/continuous-drawing-helper-f2aea1db.nomodule.js.map +0 -1
- package/lib/default-light-setting-7f113f35.nomodule.js.map +0 -1
- package/lib/default-light-setting-ad52e6de.js.map +0 -1
- package/lib/dimensioning-helper-7494fb28.js +0 -2
- package/lib/dimensioning-helper-b9377b93.nomodule.js +0 -2
- package/lib/dimensioning-helper-b9377b93.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-21363fa3.js +0 -2
- package/lib/glb-viewer-camera-behaviour-21363fa3.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-c43375cf.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-ca829f73.js +0 -2
- package/lib/glb-viewer-main-ca829f73.js.map +0 -1
- package/lib/legacy/camera-behaviour-ba624fdd.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-d6f65e0d.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-f8241e23.legacy.js.map +0 -1
- package/lib/legacy/configurator-9881273c.legacy.js +0 -2
- package/lib/legacy/configurator-9881273c.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-8f4235b4.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-1e175f7c.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-5c4c4754.legacy.js +0 -2
- package/lib/legacy/dimensioning-helper-5c4c4754.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-6f853358.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-40206245.legacy.js +0 -2
- package/lib/legacy/material-viewer-40206245.legacy.js.map +0 -1
- package/lib/legacy/planner-20fc10ce.legacy.js +0 -2
- package/lib/legacy/query-params-helper-a1e70858.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-34ae3e86.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-34ae3e86.legacy.js.map +0 -1
- package/lib/legacy/roomle-dependency-injection-3542b35a.legacy.js +0 -9
- package/lib/legacy/script-loader-25518980.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-d8ae2b5e3db74698.wasm +0 -0
- package/lib/legacy/static/RoomleCore-09101ce4c57050b0.wasm +0 -0
- package/lib/legacy/stats-helper-4dd75b8d.legacy.js.map +0 -1
- package/lib/legacy/tools-core-5dd3b7d4.legacy.js.map +0 -1
- package/lib/material-viewer-3271df96.nomodule.js +0 -2
- package/lib/material-viewer-3271df96.nomodule.js.map +0 -1
- package/lib/material-viewer-8b817d3e.js +0 -2
- package/lib/material-viewer-8b817d3e.js.map +0 -1
- package/lib/material-viewer-main-d05716e9.js +0 -2
- package/lib/material-viewer-main-d05716e9.js.map +0 -1
- package/lib/planner-75145ec2.nomodule.js +0 -2
- package/lib/planner-ce25224e.js +0 -2
- package/lib/planner-main-f5484b07.js +0 -2
- package/lib/planner-main-f5484b07.js.map +0 -1
- package/lib/query-params-helper-68ed40a6.js.map +0 -1
- package/lib/query-params-helper-712890e0.nomodule.js.map +0 -1
- package/lib/roomle-configurator-96729652.nomodule.js +0 -2
- package/lib/roomle-configurator-96729652.nomodule.js.map +0 -1
- package/lib/roomle-configurator-e867d909.js +0 -2
- package/lib/roomle-configurator-e867d909.js.map +0 -1
- package/lib/roomle-dependency-injection-56db2f22.js +0 -9
- package/lib/roomle-dependency-injection-c12e4c00.nomodule.js +0 -9
- package/lib/roomle-sdk-d2dbfbba.js.map +0 -1
- package/lib/script-loader-98a17bbb.nomodule.js.map +0 -1
- package/lib/script-loader-ef092985.js.map +0 -1
- package/lib/static/ConfiguratorKernel-d8ae2b5e3db74698.wasm +0 -0
- package/lib/static/RoomleCore-09101ce4c57050b0.wasm +0 -0
- package/lib/stats-helper-c0748092.js.map +0 -1
- package/lib/stats-helper-efe5bf85.nomodule.js.map +0 -1
- package/lib/tools-core-2e800d36.js.map +0 -1
- package/lib/tools-core-c31d15d3.nomodule.js.map +0 -1
|
@@ -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-ac8f942b.js";import{O as Object3D,a as Vector3,u as LineBasicMaterial,h as MeshBasicMaterial,w as DoubleSide,bn as MeshPhongMaterial,B as BufferGeometry,G as Line,z as Mesh,b as BufferAttribute,Q as Quaternion,bF as Line3,b8 as PlaneGeometry}from"./main-thread-to-worker-ab187cd2.js";import{T as TextGeometry}from"./TextGeometry-afd21a68.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";class ComponentDimensioning extends Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new Vector3),this._size=i.getSize(new 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 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 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(){this._initMaterials();let e=new BufferGeometry;this._line=new Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new BufferGeometry,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),r=new TextGeometry(h,a);r.computeBoundingBox();let _=r.boundingBox.getSize(new Vector3).y;0===this._dimensioning.type.value&&(i=this._getXEdge(_),this._addXEdgeSideLines(_)),1===this._dimensioning.type.value&&(i=this._getYEdge(_),this._addYEdgeSideLines(_)),2===this._dimensioning.type.value&&(i=this._getZEdge(_),this._addZEdgeSideLines(_));let d=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];if(t.setAttribute("position",new BufferAttribute(new Float32Array(d),3)),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=r,0===this._dimensioning.type.value&&this._addText(i,r,new Quaternion,new Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new Vector3(0,0,1),t),this._addText(i,r,e,new Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new Quaternion).setFromAxisAngle(new Vector3(-1,0,0),Math.PI/2),n=(new Quaternion).setFromAxisAngle(new Vector3(0,0,1),e);this._addText(i,r,t.multiply(n),new Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new Vector3(this._dimensioning.to,i,0));return new 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 Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new 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 Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new Vector3(i,0,this._dimensioning.to));return new 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 Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new Vector3(t,0,this._dimensioning.to)),r=s.clone().add(new Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,r)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new Vector3(i,this._dimensioning.to,0));return new 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 Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new Vector3(t,this._dimensioning.to,0)),r=s.clone().add(new Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,r)}_addLine(e,i){let t=new BufferGeometry,n=[e.x,e.y,e.z,i.x,i.y,i.z];t.setAttribute("position",new BufferAttribute(new Float32Array(n),3)),this.add(new Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new 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{ComponentDimensioning as default};
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-3f78471b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-3f78471b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
import{bw as Raycaster,bO as throttle,z as Mesh,v as MeshStandardMaterial,ad as Box3,a as Vector3,am as Frustum,k as Matrix4}from"./main-thread-to-worker-ab187cd2.js";import{an as transitionTransparencyOfMaterial}from"./roomle-dependency-injection-ac8f942b.js";class ComponentRaycastHelper{constructor(){this._nonTransparentComponent=null,this._raycaster=new Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=throttle(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=throttle(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}changeMaterialsOnSelect(e,t,a=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,a))}_changeMaterialsOnSelect(e,t,a=!1){if(e.children.length>0&&e.children.forEach(i=>{const s=t&&e.id===t.id||a,r=!(i instanceof Mesh);this._changeMaterialsOnSelect(i,t,(!s||!r)&&s)}),t)e instanceof Mesh&&e.material instanceof MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),a||transitionTransparencyOfMaterial(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof Mesh&&e.material instanceof MeshStandardMaterial){const{opacity:t,transparent:a}=e.userData.oldMaterial;transitionTransparencyOfMaterial(e,{opacity:t,transparent:a}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const a=(new Box3).setFromObject(e).getCenter(new Vector3),i=(new Vector3).subVectors(a,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(a);const s=[];return this._raycaster.intersectObjects(this._object.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._object,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const a=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(a.length>1)return;const i=a[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,i)}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 Frustum,a=(new Matrix4).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),i=new Box3;return t.setFromProjectionMatrix(a),e.map(e=>(e=>{const a=i.setFromObject(e).getCenter(new Vector3);return t.containsPoint(a)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}}export{ComponentRaycastHelper as default};
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-2688213e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-2688213e.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-
|
|
2
|
-
//# sourceMappingURL=component-raycast-helper-
|
|
1
|
+
System.register(["./main-thread-to-worker-e424b0c2.nomodule.js","./roomle-dependency-injection-dcc62c88.nomodule.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bw,i=e.bO,n=e.z,s=e.v,a=e.ad,r=e.a,c=e.am,o=e.k},function(e){l=e.an}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3),this._raycaster.layers.enable(4),this._raycaster.layers.enable(5),this._raycaster.layers.enable(6)}init(e,t){this._object=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}setObject(e){this._object=e}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(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).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._object.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._object,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._object,null):this.changeMaterialsOnSelect(this._object,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 c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._object,null):this.changeMaterialsOnSelect(this._object,{id:-1}))}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-f56673b2.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-f56673b2.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./script-loader-bcf84a9b.nomodule.js","./roomle-dependency-injection-dcc62c88.nomodule.js","./camera-behaviour-f8fd624d.nomodule.js","./component-raycast-helper-f56673b2.nomodule.js","./roomle-configurator-0858b546.nomodule.js","./query-params-helper-fb60ee8f.nomodule.js","./main-thread-to-worker-e424b0c2.nomodule.js","./default-light-setting-4b20f995.nomodule.js"],(function(e){var o,n,t,r,c,i,a,s,l,u,p,d,f,h;return{setters:[function(e){o=e.S,n=e.M},function(e){t=e.D,r=e.L,c=e.R,i=e.a,a=e.b,s=e.A},function(e){l=e.C,u=e.a},function(e){p=e.default},function(e){d=e.C,f=e.a,h=e.R},function(){},function(){},function(){}],execute:function(){const m=[new t("logger",r),new t("rapi-access",c),new t("script-loader",o),new t("camera-control-3d",l),new t("camera-control",u),new t("data-syncer",i),new t("configurator-scene-manager",d,1),new t("configurator-view-model",f,1),new t("component-raycast-helper",p,0)];e("Configurator",class extends n{setupDependencies(){a.setup(m),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");this.lookup("dom-helper");const n=this.lookup("configurator-scene-manager");e&&e.cleanUp(),o&&o.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:o,kernelContainer:n,planObjectId:t}=e||{};s.init({kernelInstance:o,kernelContainer:n,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new h(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-45e4da79.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-45e4da79.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{S as ScriptLoader,M as Main}from"./script-loader-
|
|
2
|
-
//# sourceMappingURL=configurator-
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-fccf744e.js";import{D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,a as DataSyncer,b as RoomleDependencyInjection,A as AppContext}from"./roomle-dependency-injection-ac8f942b.js";import{C as CameraControl3D,a as CameraControl}from"./camera-behaviour-7aba1045.js";import ComponentRaycastHelper from"./component-raycast-helper-2688213e.js";import{C as ConfiguratorSceneManager,a as ConfiguratorViewModel,R as RoomleConfigurator}from"./roomle-configurator-f1595c70.js";import"./query-params-helper-9d7ce8f1.js";import"./main-thread-to-worker-ab187cd2.js";import"./default-light-setting-1a29c5d9.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");this.lookup("dom-helper");const o=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-865ca37c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-865ca37c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Configurator}from"./configurator-865ca37c.js";import"./script-loader-fccf744e.js";import"./query-params-helper-9d7ce8f1.js";import"./main-thread-to-worker-ab187cd2.js";import"./roomle-dependency-injection-ac8f942b.js";import"./camera-behaviour-7aba1045.js";import"./component-raycast-helper-2688213e.js";import"./roomle-configurator-f1595c70.js";import"./default-light-setting-1a29c5d9.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-2a5e98fa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-main-2a5e98fa.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-45e4da79.nomodule.js","./script-loader-bcf84a9b.nomodule.js","./query-params-helper-fb60ee8f.nomodule.js","./main-thread-to-worker-e424b0c2.nomodule.js","./roomle-dependency-injection-dcc62c88.nomodule.js","./camera-behaviour-f8fd624d.nomodule.js","./component-raycast-helper-f56673b2.nomodule.js","./roomle-configurator-0858b546.nomodule.js","./default-light-setting-4b20f995.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
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-dcc62c88.nomodule.js","./main-thread-to-worker-e424b0c2.nomodule.js"],(function(e){var i,t,r,n,s;return{setters:[function(e){i=e.aa},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-2a592de8.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-2a592de8.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
import{aa as convertToTHREE}from"./roomle-dependency-injection-ac8f942b.js";import{aT as RingGeometry,h as MeshBasicMaterial,w as DoubleSide,z as Mesh}from"./main-thread-to-worker-ab187cd2.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-f4b05a9e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-f4b05a9e.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-7aba1045.js";import{ae as getGUI}from"./roomle-dependency-injection-ac8f942b.js";import{D as DirectionalLight,C as Color,V as Vector2,a as Vector3,A as AmbientLight}from"./main-thread-to-worker-ab187cd2.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-1a29c5d9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-1a29c5d9.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=default-light-setting-
|
|
1
|
+
System.register(["./camera-behaviour-f8fd624d.nomodule.js","./roomle-dependency-injection-dcc62c88.nomodule.js","./main-thread-to-worker-e424b0c2.nomodule.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.ae},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-4b20f995.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-4b20f995.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -17,6 +17,8 @@ export interface ConfiguratorKernelCallbackI extends CommonConfiguratorKernelCal
|
|
|
17
17
|
Editor3dPlanObjectConstructionDone(planObjectId: number): void;
|
|
18
18
|
Editor3dComponentDocked(componentId: number, isRootComponent: boolean, parentObjectRuntimeId: number, componentPosition: KernelVector3, componentRotation: KernelVector3): void;
|
|
19
19
|
finishParameterChange(resolve: () => void, reject: () => void): void;
|
|
20
|
+
updateAnimationParameters(elementId: number | number[], parameters: KernelParameter[]): void;
|
|
21
|
+
changeAnimationValue(elementId: number, parameterKey: string, value: string, applyToChildren: boolean, animate: boolean): void;
|
|
20
22
|
}
|
|
21
23
|
export default class ConfiguratorKernelAccess extends CommonKernelAccess {
|
|
22
24
|
private _memoryManager;
|
|
@@ -31,6 +33,9 @@ export default class ConfiguratorKernelAccess extends CommonKernelAccess {
|
|
|
31
33
|
protected _loadError(): void;
|
|
32
34
|
selectedComponent(componentId: number): void;
|
|
33
35
|
uiRequestConfiguration(objectId: number): void;
|
|
36
|
+
getComponentParameters(componentId: number): KernelParameter[];
|
|
37
|
+
getPlanObjectParameters(objectId: number): KernelParameter[];
|
|
38
|
+
private _addAnimationParameters;
|
|
34
39
|
private _updateComponentParameters;
|
|
35
40
|
selectionChange(componentId: number, isRoot: boolean): void;
|
|
36
41
|
protected _componentSelectionChanged(_planObject: PlanObject, _component: KernelComponent): void;
|
|
@@ -53,6 +58,8 @@ export default class ConfiguratorKernelAccess extends CommonKernelAccess {
|
|
|
53
58
|
changeCommonComponentParameter(componentIds: number[], parameterKey: string, type: string, value: string, resolve: () => void, reject: () => void): void;
|
|
54
59
|
changeComponentParameter(componentId: number, parameterKey: string, type: string, value: string, resolve: () => void, reject: () => void): void;
|
|
55
60
|
changePlanObjectParameter(planObjectId: number, parameterKey: string, type: string, value: string, resolve: () => void, reject: () => void): void;
|
|
61
|
+
updateAnimationParameters(elementId: number | number[], parameters: KernelParameter[]): void;
|
|
62
|
+
changeAnimationValue(elementId: number, parameterKey: string, value: string, applyToChildren: boolean, animate: boolean): void;
|
|
56
63
|
private _finishParameterChange;
|
|
57
64
|
requestDeleteComponents(componentIds: number[]): void;
|
|
58
65
|
requestDeletePlanComponent(componentId: number): void;
|
|
@@ -79,6 +79,11 @@ export interface FeatureFlags {
|
|
|
79
79
|
* @description If true, the advanced docking behavior is enabled (for test purposes only)
|
|
80
80
|
*/
|
|
81
81
|
advancedDocking?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
* @description If true, the animations are enabled (for test purposes only)
|
|
85
|
+
*/
|
|
86
|
+
animations?: boolean;
|
|
82
87
|
/**
|
|
83
88
|
* @internal
|
|
84
89
|
* @description If “vector”, the vector preview is activated when drawing walls (for test purposes only).
|
|
@@ -2,7 +2,7 @@ import type { Dimensioning, KernelCube, KernelEnum } from '../../../typings/kern
|
|
|
2
2
|
import type { AssetUrl, RapiMaterial, RapiMaterialShading, RapiTexture } from '../../../typings/rapi-types';
|
|
3
3
|
import type { Position2, Position3 } from '../common-interfaces';
|
|
4
4
|
import type WallPlanElementViewModel from '../../../planner-core/src/view-model/wall-plan-element-view-model';
|
|
5
|
-
import { type Camera, type Intersection, type Material, type MeshPhysicalMaterial, type MeshStandardMaterial, type NormalBufferAttributes, type Object3D, type Object3DEventMap,
|
|
5
|
+
import { type Camera, type Intersection, type Material, Matrix4, type MeshPhysicalMaterial, type MeshStandardMaterial, type NormalBufferAttributes, type Object3D, type Object3DEventMap, Quaternion, type Texture, type Vector2 } from 'three';
|
|
6
6
|
import { Scene } from 'three';
|
|
7
7
|
import { Box3, BufferGeometry, Color, CubeTexture, DataTexture, Layers, Mesh, MeshBasicMaterial, Vector3 } from 'three';
|
|
8
8
|
import { GUI } from 'dat.gui';
|
|
@@ -41,6 +41,15 @@ export declare const getGUI: (autoplace?: boolean) => GUI;
|
|
|
41
41
|
export declare const setWallTransparencyBasedOnCamera: (camera: Camera, material: Material, animate?: boolean) => void;
|
|
42
42
|
export declare const hideWallsBasedOnCamera: (camera: Camera, wallPlanElementViewModels: WallPlanElementViewModel[]) => boolean;
|
|
43
43
|
export declare const setWallTransparency: (material: Material, transparent: boolean, animate?: boolean) => void;
|
|
44
|
+
export declare const animateMeshMatrix: (mesh: Mesh, fromMatrix: Matrix4, toMatrix: Matrix4, onProgressUpdate?: () => void) => void;
|
|
45
|
+
export declare const calculateBaseMatrix: (matrixFrom: Matrix4, matrixTo: Matrix4) => Matrix4;
|
|
46
|
+
export declare const getAxisAndAngleFromQuaternion: (quaternion: Quaternion) => {
|
|
47
|
+
axis: Vector3;
|
|
48
|
+
angleRad: number;
|
|
49
|
+
};
|
|
50
|
+
export declare const setMeshMatrix: (mesh: Mesh, matrix: Matrix4) => void;
|
|
51
|
+
export declare const interpolateMatrix: (matrixFrom: Matrix4, matrixTo: Matrix4, t: number) => Matrix4;
|
|
52
|
+
export declare const circularInterpolateMatrix: (matrixFrom: Matrix4, matrixTo: Matrix4, t: number) => Matrix4;
|
|
44
53
|
export declare const getColorFromInt: (combinedColor: number) => Color;
|
|
45
54
|
export declare const transitionTransparencyOfMaterial: (object: Object3D, toMaterial: {
|
|
46
55
|
opacity: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';
|
|
2
|
+
import type { PreviewComponent, PreviewLineComponent, RoomleComponentFactory } from '../../../common-core/src/webgl/roomle-component-factory';
|
|
2
3
|
import type { ConfiguratorKernelCallbackI } from '../configurator-kernel-access';
|
|
3
|
-
import type { KernelComponent, KernelEnum, KernelMeshAttributes, KernelMeshBuffer, KernelVector3, PlanObject } from '../../../typings/kernel';
|
|
4
|
+
import type { KernelComponent, KernelEnum, KernelMeshAttributes, KernelMeshBuffer, KernelParameter, KernelVector3, PlanObject } from '../../../typings/kernel';
|
|
4
5
|
import type { ConfigurationString } from '../../../typings/rapi-types';
|
|
5
6
|
import type { Context } from '../di/context';
|
|
6
7
|
import type ConfiguratorContext from '../webgl/configurator-context';
|
|
@@ -9,8 +10,6 @@ import type InitData from '../utils/init-data';
|
|
|
9
10
|
import type MeshGenerator from '../webgl/mesh-generator';
|
|
10
11
|
import type PlannerKernelAccess from '../../../planner-core/src/services/planner-kernel-access';
|
|
11
12
|
import { Box3, Mesh } from 'three';
|
|
12
|
-
export declare const DOCKING_CONVERSATION_ID = 10;
|
|
13
|
-
export declare const DEFAULT_CONVERSATION_ID = 9;
|
|
14
13
|
export interface ConfiguratorViewModelCallbackI {
|
|
15
14
|
componentUpdated(component: RoomleComponent, kernelComponent: KernelComponent): void;
|
|
16
15
|
componentDeleted(component: RoomleComponent): void;
|
|
@@ -43,11 +42,19 @@ export default class ConfiguratorViewModel implements ConfiguratorKernelCallback
|
|
|
43
42
|
protected _componentFactory: RoomleComponentFactory;
|
|
44
43
|
private _requestRenderCallback;
|
|
45
44
|
private _requestRenderSceneUpdateCallback;
|
|
45
|
+
private _invalidateRenderCallback;
|
|
46
46
|
constructor(creator: string);
|
|
47
47
|
get materialQueue(): PromiseQueue<void>;
|
|
48
48
|
protected _getKernelAccess(): PlannerKernelAccess;
|
|
49
49
|
private _applyMeshTransform;
|
|
50
50
|
private _applyMeshUVTransform;
|
|
51
|
+
private _addMeshAnimations;
|
|
52
|
+
private _setComponentAnimationMatrix;
|
|
53
|
+
private _animateComponent;
|
|
54
|
+
updateAnimationParameters(elementId: number | number[], parameters: KernelParameter[]): void;
|
|
55
|
+
changeAnimationValue(elementId: number, parameterKey: string, value: string, applyToChildren: boolean, animate: boolean): void;
|
|
56
|
+
_changeAnimationValue(component: RoomleComponent, parameterKey: string, value: string, animate: boolean): void;
|
|
57
|
+
private getComponentFromElementId;
|
|
51
58
|
private _addMeshToSubPart;
|
|
52
59
|
private _addMeshToComponent;
|
|
53
60
|
private _changeMeshOfComponent;
|
|
@@ -111,4 +118,5 @@ export default class ConfiguratorViewModel implements ConfiguratorKernelCallback
|
|
|
111
118
|
protected getMeshGenerator(): MeshGenerator;
|
|
112
119
|
setRequestRenderCallback(requestRenderCallback: () => void): void;
|
|
113
120
|
setRequestRenderSceneUpdateCallback(requestRenderSceneUpdateCallback: () => void): void;
|
|
121
|
+
setInvalidateRenderCallback(invalidateRenderCallback: () => void): void;
|
|
114
122
|
}
|
|
@@ -18,6 +18,7 @@ export interface RoomleComponent extends RoomleEventedObject3D {
|
|
|
18
18
|
roomleRotation: KernelVector3;
|
|
19
19
|
hash: string;
|
|
20
20
|
geometryChanged: boolean;
|
|
21
|
+
animationValues?: Map<string, string>;
|
|
21
22
|
replaceMeshes(meshes: Mesh[]): void;
|
|
22
23
|
addMesh(mesh: Mesh, transform?: Float32Array): void;
|
|
23
24
|
removeMesh(mesh: Mesh): void;
|
|
@@ -35,6 +36,7 @@ export interface RoomleComponent extends RoomleEventedObject3D {
|
|
|
35
36
|
recursiveMeshes(): Mesh[];
|
|
36
37
|
isChild(componentId: number): boolean;
|
|
37
38
|
getKernelPosition(newParent: RoomleComponent): KernelVector3;
|
|
39
|
+
animateMeshes(aniamtion: string, from: string, to: string, animate: boolean, onProgressUpdate?: () => void): void;
|
|
38
40
|
}
|
|
39
41
|
export interface StaticComponent extends RoomleComponent {
|
|
40
42
|
glbUrl: string;
|
|
@@ -3,7 +3,7 @@ import { type InputEvent } from '../../../common-core/src/input/input-manager';
|
|
|
3
3
|
import type { SceneEventInfo } from '../webgl/configurator-scene-event-handler';
|
|
4
4
|
import EventDispatcher from './event-dispatcher';
|
|
5
5
|
import { type RoomleEventedMesh } from '../../../common-core/src/utils/threejs-utils';
|
|
6
|
-
import { type Camera, type Layers, type Scene } from 'three';
|
|
6
|
+
import { type Camera, type Layers, type Object3D, type Scene } from 'three';
|
|
7
7
|
import { Vector3 } from 'three';
|
|
8
8
|
export declare const enum OBJECT_EVENT {
|
|
9
9
|
CLICK = "select",
|
|
@@ -25,7 +25,7 @@ export declare const enum RAYCAST_EVENT {
|
|
|
25
25
|
}
|
|
26
26
|
export default class RaycastHelper extends EventDispatcher<SceneEventInfo> {
|
|
27
27
|
private _mode;
|
|
28
|
-
private
|
|
28
|
+
private _object;
|
|
29
29
|
private _camera;
|
|
30
30
|
private _inputManager;
|
|
31
31
|
private _raycaster;
|
|
@@ -42,7 +42,7 @@ export default class RaycastHelper extends EventDispatcher<SceneEventInfo> {
|
|
|
42
42
|
private _planeSide;
|
|
43
43
|
private _lastMoveCheck;
|
|
44
44
|
private _onWallSnapping;
|
|
45
|
-
constructor(
|
|
45
|
+
constructor(object: Object3D, camera: Camera, generalInput: InputManager, mode?: INTERSECTION_MODE);
|
|
46
46
|
setLayers(layers: Layers): void;
|
|
47
47
|
getLayers(): Layers;
|
|
48
48
|
private _addInputListeners;
|
|
@@ -65,7 +65,7 @@ export default class RaycastHelper extends EventDispatcher<SceneEventInfo> {
|
|
|
65
65
|
enableDragIn(mesh: RoomleEventedMesh): void;
|
|
66
66
|
setRootComponentId(rootComponentId: number): void;
|
|
67
67
|
setCamera(camera: Camera): void;
|
|
68
|
-
|
|
68
|
+
setObject(object: Object3D): void;
|
|
69
69
|
setMode(mode: INTERSECTION_MODE): void;
|
|
70
70
|
intersectMouseOnScene(event: InputEvent): import("../../../typings/kernel").KernelVector3;
|
|
71
71
|
enableOnWallSnapping(): void;
|
|
@@ -3,7 +3,7 @@ import type InputManager from '../../../common-core/src/input/input-manager';
|
|
|
3
3
|
import { INPUT_EVENT_TYPE } from '../../../common-core/src/input/input-manager';
|
|
4
4
|
import { SELECTION_MODE } from '../utils/selection-handler';
|
|
5
5
|
import SceneEventHandler from '../../../common-core/src/webgl/scene-event-handler';
|
|
6
|
-
import type { PerspectiveCamera, Scene } from 'three';
|
|
6
|
+
import type { Object3D, PerspectiveCamera, Scene } from 'three';
|
|
7
7
|
import { type Vector3 } from 'three';
|
|
8
8
|
import { type Camera } from 'three';
|
|
9
9
|
export declare const enum SCENE_EVENT {
|
|
@@ -87,4 +87,5 @@ export default class ConfiguratorSceneEventHandler extends SceneEventHandler<Sce
|
|
|
87
87
|
getSelectedRuntimeComponentIds(): number[];
|
|
88
88
|
setCameraMoving(cameraMoving: boolean): void;
|
|
89
89
|
setCamera(camera: Camera): void;
|
|
90
|
+
setObject(object: Object3D): void;
|
|
90
91
|
}
|
|
@@ -15,6 +15,7 @@ import SceneManager from '../../../common-core/src/webgl/scene-manager';
|
|
|
15
15
|
import { type CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';
|
|
16
16
|
import type PlannerKernelAccess from '../../../planner-core/src/services/planner-kernel-access';
|
|
17
17
|
import type { Enumify } from '../../../common-core/src/types';
|
|
18
|
+
import type { Object3D } from 'three';
|
|
18
19
|
import { Box3, Vector3 } from 'three';
|
|
19
20
|
import type { CameraTarget, PrepareImageOptions, RenderOptions } from '../../../common-core/src/webgl/image-renderer';
|
|
20
21
|
import ConfiguratorCameraBehaviour from '../../../common-core/src/cameracontrol/configurator-camera-behaviour';
|
|
@@ -146,4 +147,5 @@ export default class ConfiguratorSceneManager extends SceneManager implements Co
|
|
|
146
147
|
cameraBehaviourChanged(): void;
|
|
147
148
|
protected _setCameraControlListeners(): void;
|
|
148
149
|
protected _shouldRenderUi(): boolean;
|
|
150
|
+
protected setEventHandlerObject(object: Object3D): void;
|
|
149
151
|
}
|
package/lib/definitions/planner-core/src/view-model/construction-plan-object-view-model.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { type RoomleEventedMesh } from '../../../common-core/src/utils/threejs-u
|
|
|
4
4
|
import type { Nullable } from '../../../typings/helper';
|
|
5
5
|
import { type ConstructionMeasurements } from '../utils/measurements';
|
|
6
6
|
import ConstructionTopView from '../webgl/construction-top-view';
|
|
7
|
-
export declare const MAX_ROOM_HEIGHT = 5;
|
|
8
7
|
export default class ConstructionPlanObjectViewModel extends StaticPlanObjectViewModel {
|
|
9
8
|
private _constructionTopView;
|
|
10
9
|
constructor(planObject: PlanObject);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PlanObject } from '../../../typings/planner';
|
|
2
2
|
import PlanElementViewModel from '../../../common-core/src/view-model/plan-element-view-model';
|
|
3
|
-
import type { Object3D } from 'three';
|
|
4
3
|
import { Vector3 } from 'three';
|
|
5
4
|
import type { RoomleEventedMesh } from '../../../common-core/src/utils/threejs-utils';
|
|
6
5
|
export default class NodePlanElementViewModel extends PlanElementViewModel {
|
|
@@ -16,5 +15,4 @@ export default class NodePlanElementViewModel extends PlanElementViewModel {
|
|
|
16
15
|
hoverOn(): void;
|
|
17
16
|
hoverOff(): void;
|
|
18
17
|
protected _generateBoundingBox(): RoomleEventedMesh;
|
|
19
|
-
addMesh(mesh: Object3D): void;
|
|
20
18
|
}
|
|
@@ -4,6 +4,7 @@ import { type ConstructionPlanObject } from '../../../typings/planner';
|
|
|
4
4
|
export declare const TOP_GREY_MESH_HEIGHT = 0.01;
|
|
5
5
|
export declare const TOP_BLACK_MESH_HEIGHT = 0.02;
|
|
6
6
|
export declare const TOP_BLACK_MESH_DEPTH = 0.03;
|
|
7
|
+
export declare const MAX_ROOM_HEIGHT = 5;
|
|
7
8
|
export declare const TOP_BLACK_MATERIAL: import("three").MeshStandardMaterial;
|
|
8
9
|
export default class ConstructionTopView extends Object3D {
|
|
9
10
|
private _topGreyMesh;
|
|
@@ -7,7 +7,7 @@ import type PlanElementViewModel from '../../../common-core/src/view-model/plan-
|
|
|
7
7
|
import type { KernelVector3 } from '../../../typings/kernel';
|
|
8
8
|
import SceneEventHandler from '../../../common-core/src/webgl/scene-event-handler';
|
|
9
9
|
import type { CancelSelectionReasons, PlanInteractionHandler } from '../../../typings/planner';
|
|
10
|
-
import type { Camera, Scene } from 'three';
|
|
10
|
+
import type { Camera, Object3D, Scene } from 'three';
|
|
11
11
|
import { Group } from 'three';
|
|
12
12
|
import type { RoomleEventedObject3D } from '../../../common-core/src/utils/threejs-utils';
|
|
13
13
|
import MeasurementLinePlanElementViewModel from '../view-model/measurement-line-plan-element-view-model';
|
|
@@ -111,7 +111,7 @@ export default class PlannerSceneEventHandler extends SceneEventHandler<SceneEve
|
|
|
111
111
|
private _isHoveredObjectNonDraggable;
|
|
112
112
|
private _setCursor;
|
|
113
113
|
setCamera(camera: Camera): void;
|
|
114
|
-
|
|
114
|
+
setObject(object: Object3D): void;
|
|
115
115
|
getSelectedIds(): number[];
|
|
116
116
|
setSelectionMode(selectionMode: SELECTION_MODE): void;
|
|
117
117
|
setPlanViewModel(planViewModel: PlanViewModel): void;
|
|
@@ -185,5 +185,6 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
185
185
|
setObjectToWallMeasurementLength(planElementId: number, measurementId: number, length: number): void;
|
|
186
186
|
setWallMeasurementLength(measurementId: number, length: number, wallDirection: EMSConstant): void;
|
|
187
187
|
setMeasurementLineLength(measurementId: number, length: number, wallDirection: string): void;
|
|
188
|
+
protected setEventHandlerObject(object: Object3D): void;
|
|
188
189
|
}
|
|
189
190
|
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aR as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aS as AsyncDependencyLoader,aa as convertToTHREE}from"./roomle-dependency-injection-ac8f942b.js";import{O as Object3D,a as Vector3,h as MeshBasicMaterial,w as DoubleSide,bn as MeshPhongMaterial,B as BufferGeometry,z as Mesh,Q as Quaternion,b8 as PlaneGeometry,K as Group,u as LineBasicMaterial,G as Line,b as BufferAttribute,bF as Line3,ad as Box3}from"./main-thread-to-worker-ab187cd2.js";import{T as TextGeometry}from"./TextGeometry-afd21a68.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,height:.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-d4b30187185acc59.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-b0c8123d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-b0c8123d.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-d4b30187185acc59.json\""],"names":[],"mappings":"w7IAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./roomle-dependency-injection-dcc62c88.nomodule.js","./main-thread-to-worker-e424b0c2.nomodule.js","./TextGeometry-2cd7a69b.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.aR,e=t.H,s=t._,n=t.i,h=t.j,o=t.aS,a=t.aa},function(t){_=t.O,d=t.a,r=t.h,p=t.w,m=t.bn,l=t.B,c=t.z,x=t.Q,u=t.b8,g=t.K,w=t.u,b=t.G,y=t.b,T=t.bF,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,height:.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-d4b30187185acc59.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-d38228b8.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-d38228b8.nomodule.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-d4b30187185acc59.json\""],"names":[],"mappings":"w4HAAe"}
|