@roomle/web-sdk 2.86.0-alpha.1 → 2.86.0-bo-mvp.2
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/.releaserc.json +5 -0
- package/lib/{TextGeometry-def07ca8.js → TextGeometry-64e47e97.js} +2 -2
- package/lib/{TextGeometry-def07ca8.js.map → TextGeometry-64e47e97.js.map} +1 -1
- package/lib/{TextGeometry-028ef3cf.nomodule.js → TextGeometry-6c37ac59.nomodule.js} +2 -2
- package/lib/{TextGeometry-028ef3cf.nomodule.js.map → TextGeometry-6c37ac59.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-70fd617d.nomodule.js → banana-for-scale-af8b54dc.nomodule.js} +2 -2
- package/lib/{banana-for-scale-70fd617d.nomodule.js.map → banana-for-scale-af8b54dc.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-c196b4a3.js → banana-for-scale-b3f2598c.js} +2 -2
- package/lib/{banana-for-scale-c196b4a3.js.map → banana-for-scale-b3f2598c.js.map} +1 -1
- package/lib/{budgeteer-measure-e4c7fe1a.js → budgeteer-measure-a84ddf03.js} +2 -2
- package/lib/{budgeteer-measure-e4c7fe1a.js.map → budgeteer-measure-a84ddf03.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/camera-behaviour-2daf92d1.nomodule.js +2 -0
- package/lib/{camera-behaviour-3b41bfc0.nomodule.js.map → camera-behaviour-2daf92d1.nomodule.js.map} +1 -1
- package/lib/camera-behaviour-b98a3df3.js +2 -0
- package/lib/{camera-behaviour-d5e8deb1.js.map → camera-behaviour-b98a3df3.js.map} +1 -1
- package/lib/{component-dimensioning-517f2375.nomodule.js → component-dimensioning-14f18372.nomodule.js} +2 -2
- package/lib/component-dimensioning-14f18372.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-ae84523e.js → component-dimensioning-1f825042.js} +2 -2
- package/lib/component-dimensioning-1f825042.js.map +1 -0
- package/lib/{component-raycast-helper-3f721151.nomodule.js → component-raycast-helper-34e08a40.nomodule.js} +2 -2
- package/lib/component-raycast-helper-34e08a40.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-6039d8aa.js → component-raycast-helper-a7505fd7.js} +2 -2
- package/lib/component-raycast-helper-a7505fd7.js.map +1 -0
- package/lib/configurator-64f8efeb.js +2 -0
- package/lib/configurator-64f8efeb.js.map +1 -0
- package/lib/configurator-dc4a5e00.nomodule.js +2 -0
- package/lib/configurator-dc4a5e00.nomodule.js.map +1 -0
- package/lib/configurator-main-c415737c.js +2 -0
- package/lib/configurator-main-c415737c.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-4da163f4.js → continuous-drawing-helper-3ddb3695.js} +2 -2
- package/lib/continuous-drawing-helper-3ddb3695.js.map +1 -0
- package/lib/{continuous-drawing-helper-026900f1.nomodule.js → continuous-drawing-helper-9f39baae.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-9f39baae.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/configurator-kernel-access.d.ts +5 -2
- package/lib/definitions/common-core/src/utils/init-data.d.ts +0 -2
- package/lib/definitions/common-core/src/utils/shims.d.ts +10 -14
- package/lib/definitions/configurator-core/src/export/production-manager-export.d.ts +35 -0
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +10 -0
- package/lib/definitions/configurator-core/src/static-files/geometries.d.ts +1 -0
- package/lib/definitions/configurator-core/src/utils/export-helper.d.ts +38 -0
- package/lib/definitions/configurator-core/src/utils/raycast-helper.d.ts +1 -2
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +4 -0
- package/lib/definitions/planner-core/src/external-object-api-callbacks.d.ts +119 -0
- package/lib/definitions/planner-core/src/external-object-api.d.ts +83 -0
- package/lib/definitions/planner-core/src/roomle-planner-external-object.d.ts +44 -0
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +62 -0
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +16 -2
- package/lib/definitions/planner-core/src/services/planner-kernel-access.d.ts +18 -4
- package/lib/definitions/planner-core/src/utils/map-to-ui-plan-objects.d.ts +1 -1
- package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +1 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +2 -0
- package/lib/definitions/typings/kernel.d.ts +20 -4
- package/lib/definitions/typings/planner.d.ts +1 -1
- package/lib/{dimensioning-helper-4b07a4a6.js → dimensioning-helper-5158f2b2.js} +2 -2
- package/lib/{dimensioning-helper-4b07a4a6.js.map → dimensioning-helper-5158f2b2.js.map} +1 -1
- package/lib/{dimensioning-helper-0b76dc02.nomodule.js → dimensioning-helper-9e131f41.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-0b76dc02.nomodule.js.map → dimensioning-helper-9e131f41.nomodule.js.map} +1 -1
- package/lib/glb-viewer-1a4bbdab.js +2 -0
- package/lib/glb-viewer-1a4bbdab.js.map +1 -0
- package/lib/glb-viewer-5eb83b89.nomodule.js +2 -0
- package/lib/glb-viewer-5eb83b89.nomodule.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-1c1a57b7.nomodule.js → glb-viewer-camera-behaviour-34d13c8c.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-34d13c8c.nomodule.js.map +1 -0
- package/lib/glb-viewer-camera-behaviour-5d2c01e4.js +2 -0
- package/lib/glb-viewer-camera-behaviour-5d2c01e4.js.map +1 -0
- package/lib/glb-viewer-main-85cff8b8.js +2 -0
- package/lib/glb-viewer-main-85cff8b8.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/{default-light-setting-bcaab68f.js → jszip.min-58a46137.js} +2 -2
- package/lib/jszip.min-58a46137.js.map +1 -0
- package/lib/{default-light-setting-43934c58.nomodule.js → jszip.min-b1e4e384.nomodule.js} +2 -2
- package/lib/jszip.min-b1e4e384.nomodule.js.map +1 -0
- package/lib/legacy/{TextGeometry-c00b7ecb.legacy.js → TextGeometry-50d12ddd.legacy.js} +2 -2
- package/lib/legacy/{TextGeometry-c00b7ecb.legacy.js.map → TextGeometry-50d12ddd.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-97373a4d.legacy.js → banana-for-scale-071762d5.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-97373a4d.legacy.js.map → banana-for-scale-071762d5.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/camera-behaviour-47efff06.legacy.js +2 -0
- package/lib/legacy/{camera-behaviour-0a53fb18.legacy.js.map → camera-behaviour-47efff06.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-ad20afec.legacy.js → component-dimensioning-661c0ea5.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-661c0ea5.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-910e15ee.legacy.js → component-raycast-helper-66636733.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-66636733.legacy.js.map +1 -0
- package/lib/legacy/configurator-673bc202.legacy.js +2 -0
- package/lib/legacy/configurator-673bc202.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-651b3af6.legacy.js → continuous-drawing-helper-9ed276b1.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-9ed276b1.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-44362a63.legacy.js → dimensioning-helper-2adf7526.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-44362a63.legacy.js.map → dimensioning-helper-2adf7526.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-camera-behaviour-b189385e.legacy.js → glb-viewer-camera-behaviour-8c0e7077.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-8c0e7077.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-e5c838d2.legacy.js +2 -0
- package/lib/legacy/glb-viewer-e5c838d2.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{default-light-setting-4194c67a.legacy.js → jszip.min-9db57d5d.legacy.js} +2 -2
- package/lib/legacy/jszip.min-9db57d5d.legacy.js.map +1 -0
- package/lib/legacy/{main-thread-to-worker-a28094cc.legacy.js → main-thread-to-worker-f02de9c2.legacy.js} +3 -3
- package/lib/legacy/{main-thread-to-worker-a28094cc.legacy.js.map → main-thread-to-worker-f02de9c2.legacy.js.map} +1 -1
- package/lib/legacy/{material-viewer-a59b141f.legacy.js → material-viewer-79947c90.legacy.js} +2 -2
- package/lib/legacy/material-viewer-79947c90.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-56ba0cfe.legacy.js +2 -0
- package/lib/legacy/{planner-667adf70.legacy.js.map → planner-56ba0cfe.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{query-params-helper-81aac523.legacy.js → query-params-helper-0f7e3d70.legacy.js} +2 -2
- package/lib/legacy/query-params-helper-0f7e3d70.legacy.js.map +1 -0
- package/lib/legacy/roomle-configurator-f289cbd8.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-f289cbd8.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-95cbc1dd.legacy.js → roomle-dependency-injection-89c16cd8.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-95cbc1dd.legacy.js.map → roomle-dependency-injection-89c16cd8.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-1afd47b6.legacy.js → script-loader-15cb60ee.legacy.js} +2 -2
- package/lib/legacy/script-loader-15cb60ee.legacy.js.map +1 -0
- package/lib/{static/ConfiguratorKernel-d6135210f1e8455f.wasm → legacy/static/ConfiguratorKernel-4bb3d415749178f3.wasm} +0 -0
- package/lib/legacy/static/{RoomleCore-773e579b50697de3.wasm → RoomleCore-be0bb9e59a62183a.wasm} +0 -0
- package/lib/{static/RoomleToolsCore-df80b7e27022419c.wasm → legacy/static/RoomleToolsCore-0356b879d1c2eba1.wasm} +0 -0
- package/lib/legacy/static/monkey-0ab775bb33780513.obj +7966 -0
- package/lib/legacy/{stats-helper-1368b623.legacy.js → stats-helper-4dc3e807.legacy.js} +2 -2
- package/lib/legacy/stats-helper-4dc3e807.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-4e275f10.legacy.js → tools-core-e364f30c.legacy.js} +2 -2
- package/lib/legacy/tools-core-e364f30c.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-1a58abb6.nomodule.js → main-thread-to-worker-a33146dd.nomodule.js} +2 -2
- package/lib/{main-thread-to-worker-1a58abb6.nomodule.js.map → main-thread-to-worker-a33146dd.nomodule.js.map} +1 -1
- package/lib/{main-thread-to-worker-554053aa.js → main-thread-to-worker-af604b88.js} +2 -2
- package/lib/{main-thread-to-worker-554053aa.js.map → main-thread-to-worker-af604b88.js.map} +1 -1
- package/lib/{material-viewer-db79268b.js → material-viewer-2b9fa41b.js} +2 -2
- package/lib/material-viewer-2b9fa41b.js.map +1 -0
- package/lib/{material-viewer-c19c8a58.nomodule.js → material-viewer-a41007aa.nomodule.js} +2 -2
- package/lib/material-viewer-a41007aa.nomodule.js.map +1 -0
- package/lib/material-viewer-main-43cfdaf6.js +2 -0
- package/lib/material-viewer-main-43cfdaf6.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-1ac41134.nomodule.js +2 -0
- package/lib/{planner-712a2357.nomodule.js.map → planner-1ac41134.nomodule.js.map} +1 -1
- package/lib/planner-52bbd223.js +2 -0
- package/lib/{planner-669f9f77.js.map → planner-52bbd223.js.map} +1 -1
- package/lib/planner-main-176968fa.js +2 -0
- package/lib/planner-main-176968fa.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{query-params-helper-a5a14aba.js → query-params-helper-15c8e313.js} +2 -2
- package/lib/query-params-helper-15c8e313.js.map +1 -0
- package/lib/{query-params-helper-a2901800.nomodule.js → query-params-helper-ff314078.nomodule.js} +2 -2
- package/lib/query-params-helper-ff314078.nomodule.js.map +1 -0
- package/lib/roomle-configurator-8f8975c3.js +2 -0
- package/lib/roomle-configurator-8f8975c3.js.map +1 -0
- package/lib/roomle-configurator-f5168b6e.nomodule.js +2 -0
- package/lib/roomle-configurator-f5168b6e.nomodule.js.map +1 -0
- package/lib/{roomle-dependency-injection-de9b1dca.js → roomle-dependency-injection-a223d34e.js} +3 -3
- package/lib/{roomle-dependency-injection-de9b1dca.js.map → roomle-dependency-injection-a223d34e.js.map} +1 -1
- package/lib/{roomle-dependency-injection-308dcd5f.nomodule.js → roomle-dependency-injection-a91fd623.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-308dcd5f.nomodule.js.map → roomle-dependency-injection-a91fd623.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-8dcdcb86.js → roomle-sdk-41c94522.js} +2 -2
- package/lib/roomle-sdk-41c94522.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-d1b72d65.nomodule.js → script-loader-42630c85.nomodule.js} +2 -2
- package/lib/script-loader-42630c85.nomodule.js.map +1 -0
- package/lib/{script-loader-289724f5.js → script-loader-aaabae44.js} +2 -2
- package/lib/script-loader-aaabae44.js.map +1 -0
- package/lib/{legacy/static/ConfiguratorKernel-d6135210f1e8455f.wasm → static/ConfiguratorKernel-4bb3d415749178f3.wasm} +0 -0
- package/lib/static/{RoomleCore-773e579b50697de3.wasm → RoomleCore-be0bb9e59a62183a.wasm} +0 -0
- package/lib/{legacy/static/RoomleToolsCore-df80b7e27022419c.wasm → static/RoomleToolsCore-0356b879d1c2eba1.wasm} +0 -0
- package/lib/static/monkey-0ab775bb33780513.obj +7966 -0
- package/lib/{stats-helper-120bc238.nomodule.js → stats-helper-adaf257e.nomodule.js} +2 -2
- package/lib/stats-helper-adaf257e.nomodule.js.map +1 -0
- package/lib/{stats-helper-e341de87.js → stats-helper-e2c6f051.js} +2 -2
- package/lib/stats-helper-e2c6f051.js.map +1 -0
- package/lib/{tools-core-f8e692fb.nomodule.js → tools-core-22535292.nomodule.js} +2 -2
- package/lib/tools-core-22535292.nomodule.js.map +1 -0
- package/lib/{tools-core-c66ce79a.js → tools-core-cf8e7133.js} +2 -2
- package/lib/tools-core-cf8e7133.js.map +1 -0
- package/package.json +2 -2
- package/lib/camera-behaviour-3b41bfc0.nomodule.js +0 -2
- package/lib/camera-behaviour-d5e8deb1.js +0 -2
- package/lib/component-dimensioning-517f2375.nomodule.js.map +0 -1
- package/lib/component-dimensioning-ae84523e.js.map +0 -1
- package/lib/component-raycast-helper-3f721151.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-6039d8aa.js.map +0 -1
- package/lib/configurator-47a99c13.js +0 -2
- package/lib/configurator-47a99c13.js.map +0 -1
- package/lib/configurator-59c6091b.nomodule.js +0 -2
- package/lib/configurator-59c6091b.nomodule.js.map +0 -1
- package/lib/configurator-main-a14f888e.js +0 -2
- package/lib/configurator-main-a14f888e.js.map +0 -1
- package/lib/continuous-drawing-helper-026900f1.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-4da163f4.js.map +0 -1
- package/lib/default-light-setting-43934c58.nomodule.js.map +0 -1
- package/lib/default-light-setting-bcaab68f.js.map +0 -1
- package/lib/glb-viewer-1253cfc4.nomodule.js +0 -2
- package/lib/glb-viewer-1253cfc4.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-1c1a57b7.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-f72e60e9.js +0 -2
- package/lib/glb-viewer-camera-behaviour-f72e60e9.js.map +0 -1
- package/lib/glb-viewer-e5c43179.js +0 -2
- package/lib/glb-viewer-e5c43179.js.map +0 -1
- package/lib/glb-viewer-main-b411001e.js +0 -2
- package/lib/glb-viewer-main-b411001e.js.map +0 -1
- package/lib/legacy/camera-behaviour-0a53fb18.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-ad20afec.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-910e15ee.legacy.js.map +0 -1
- package/lib/legacy/configurator-2432e887.legacy.js +0 -2
- package/lib/legacy/configurator-2432e887.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-651b3af6.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-4194c67a.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-56bbd43d.legacy.js +0 -2
- package/lib/legacy/glb-viewer-56bbd43d.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-b189385e.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-a59b141f.legacy.js.map +0 -1
- package/lib/legacy/planner-667adf70.legacy.js +0 -2
- package/lib/legacy/query-params-helper-81aac523.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-0ec140c9.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-0ec140c9.legacy.js.map +0 -1
- package/lib/legacy/script-loader-1afd47b6.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-1368b623.legacy.js.map +0 -1
- package/lib/legacy/tools-core-4e275f10.legacy.js.map +0 -1
- package/lib/material-viewer-c19c8a58.nomodule.js.map +0 -1
- package/lib/material-viewer-db79268b.js.map +0 -1
- package/lib/material-viewer-main-ae2730f4.js +0 -2
- package/lib/material-viewer-main-ae2730f4.js.map +0 -1
- package/lib/planner-669f9f77.js +0 -2
- package/lib/planner-712a2357.nomodule.js +0 -2
- package/lib/planner-main-e0458a25.js +0 -2
- package/lib/planner-main-e0458a25.js.map +0 -1
- package/lib/query-params-helper-a2901800.nomodule.js.map +0 -1
- package/lib/query-params-helper-a5a14aba.js.map +0 -1
- package/lib/roomle-configurator-28705055.js +0 -2
- package/lib/roomle-configurator-28705055.js.map +0 -1
- package/lib/roomle-configurator-8902fef3.nomodule.js +0 -2
- package/lib/roomle-configurator-8902fef3.nomodule.js.map +0 -1
- package/lib/roomle-sdk-8dcdcb86.js.map +0 -1
- package/lib/script-loader-289724f5.js.map +0 -1
- package/lib/script-loader-d1b72d65.nomodule.js.map +0 -1
- package/lib/stats-helper-120bc238.nomodule.js.map +0 -1
- package/lib/stats-helper-e341de87.js.map +0 -1
- package/lib/tools-core-c66ce79a.js.map +0 -1
- package/lib/tools-core-f8e692fb.nomodule.js.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export interface ExternalObjectUiConfiguration {
|
|
2
|
+
attributeGroupsVisibleInPlanner?: string | string[];
|
|
3
|
+
showPossibleSubModules?: boolean;
|
|
4
|
+
animatedOpenClose?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ExternalObjectMaterialConfiguration {
|
|
7
|
+
defaultMaterial?: string;
|
|
8
|
+
replaceUnmappedMaterialsWithDefault?: boolean;
|
|
9
|
+
materialMapping?: Array<{
|
|
10
|
+
materialName: string;
|
|
11
|
+
materialId: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export interface ExternalObjectDebugConfiguration {
|
|
15
|
+
createDebugGeometry?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ExternalObjectApiConfiguration {
|
|
18
|
+
loadExternalObjectsFromPlan?: boolean;
|
|
19
|
+
uiConfiguration?: ExternalObjectUiConfiguration;
|
|
20
|
+
materialConfiguration?: ExternalObjectMaterialConfiguration;
|
|
21
|
+
debugConfiguration?: ExternalObjectDebugConfiguration;
|
|
22
|
+
}
|
|
23
|
+
export interface ExternalObjectAPI {
|
|
24
|
+
/**
|
|
25
|
+
* With "configureExternalObjectApi" the default representation of the objects and UI and
|
|
26
|
+
* the default behavior when interacting with external objects can be completely or partially overwritten.
|
|
27
|
+
* This configuration should be set prior to loading plans or objects.
|
|
28
|
+
* @param configurationJson The configuration JSON as string or object.
|
|
29
|
+
*/
|
|
30
|
+
configureExternalObjectApi(configurationJson: string | ExternalObjectApiConfiguration): void;
|
|
31
|
+
/**
|
|
32
|
+
* "loadExternalObjectLibrary" loads the master data of a library.
|
|
33
|
+
* If master data has already been loaded for the library, it is completely replaced by the new master data.
|
|
34
|
+
* @param libraryJson The library JSON as string or object.
|
|
35
|
+
*/
|
|
36
|
+
loadExternalObjectLibrary(libraryJson: string | object): void;
|
|
37
|
+
/**
|
|
38
|
+
* "loadExternalObjectGroup" loads a group of modules and places them in the plan.
|
|
39
|
+
* If the group has already been loaded, it is completely replaced by the new group.
|
|
40
|
+
* This function therefore has 2 use cases:
|
|
41
|
+
* 1. Load a new group of modules
|
|
42
|
+
* 2. Update or modify an existing group of modules
|
|
43
|
+
* The initial location of the group and the IDs of the modules are defined in the group JSON.
|
|
44
|
+
* @param groupJson The group JSON as string or object.
|
|
45
|
+
*/
|
|
46
|
+
loadExternalObjectGroup(groupJson: string | object): void;
|
|
47
|
+
/**
|
|
48
|
+
* "removeExternalObjectGroup" removes a group and all its modules from the plan.
|
|
49
|
+
* @param groupId The ID of the group of modules.
|
|
50
|
+
*/
|
|
51
|
+
removeExternalObjectGroup(groupId: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* "selectExternalObjectGroup" changes the selected object in the scene.
|
|
54
|
+
* The function selects a complete group of root modules and always switches to planning mode.
|
|
55
|
+
* If the group consists of only one root module, this is equivalent to selecting a single root module.
|
|
56
|
+
* @param groupId The ID of the group of modules.
|
|
57
|
+
*/
|
|
58
|
+
selectExternalObjectGroup(groupId: string): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* "selectExternalObjectRootModule" changes the selected object in the scene.
|
|
61
|
+
* The function selects a root module within a group and always switches to planning mode.
|
|
62
|
+
* @param rootModuleId The ID of the root module.
|
|
63
|
+
*/
|
|
64
|
+
selectExternalObjectRootModule(rootModuleId: string): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* "selectExternalObjectSubModule" changes the selected object in the scene.
|
|
67
|
+
* The function selects a sub module a root module and always switches to configuration mode.
|
|
68
|
+
* @param rootModuleId The ID of the root module.
|
|
69
|
+
* @param subModuleId The ID of the sub module.
|
|
70
|
+
*/
|
|
71
|
+
selectExternalObjectSubModule(rootModuleId: string, subModuleId: string): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* "openOrCloseGeometryOfExternalObject" switches the geometry of the modules between closed and open representation.
|
|
74
|
+
* The function can switch the geometry of the group or the singe root module with the ID "groupIdOrRootModuleId".
|
|
75
|
+
* If "groupIdOrRootModuleId" is the ID of a root module and the "subModuleId" is also specified, only this one sub-module is opened or closed.
|
|
76
|
+
* @param groupIdOrRootModuleId The ID of the group of modules or the ID of the root module.
|
|
77
|
+
* @param subModuleId The ID of the sub module.
|
|
78
|
+
* @param open If true, the modules are opened, if false, they are closed, if the geometry is already in the desired state, nothing happens.
|
|
79
|
+
* @param animate If true the opening or closing is animated else the geometry is switched instantly.
|
|
80
|
+
*/
|
|
81
|
+
openOrCloseGeometryOfExternalObject(groupIdOrRootModuleId: string, subModuleId: string | null, open: boolean, animate: boolean): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
export declare const defaultExternalObjectApiConfiguration: ExternalObjectApiConfiguration;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ExternalObjectApiConfiguration } from './external-object-api';
|
|
2
|
+
export interface TcAPI {
|
|
3
|
+
/**
|
|
4
|
+
* Sets properties that effect the representation of the objects such as the material mapping
|
|
5
|
+
* and completely overwrites the default settings.
|
|
6
|
+
* @param propertiesJson The properties JSON as string or object.
|
|
7
|
+
*/
|
|
8
|
+
loadTCProperties(propertiesJson: string | ExternalObjectApiConfiguration): void;
|
|
9
|
+
/**
|
|
10
|
+
* Loads the master data json and defines which attributes are displayed in the UI
|
|
11
|
+
* of the PoS system and how they are displayed.
|
|
12
|
+
* @param masterDataJson The master data JSON as string or object.
|
|
13
|
+
*/
|
|
14
|
+
loadTCMasterData(masterDataJson: string | object): void;
|
|
15
|
+
/**
|
|
16
|
+
* Loads all groups of root modules defined in the article-data-json and adds them to the plan.
|
|
17
|
+
* @param articleJson The article data JSON as string or object.
|
|
18
|
+
*/
|
|
19
|
+
loadTCArticles(articleJson: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Removes the specified group of root modules completely from the plan.
|
|
22
|
+
* @param groupId The unique ID of the group of root modules.
|
|
23
|
+
*/
|
|
24
|
+
removeTCArticle(groupId: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Always switches to planning mode and selects an root module group.
|
|
27
|
+
* In planning mode, only a root module or a group of root modules can be selected, but not a sub-module.
|
|
28
|
+
* @param groupId The unique ID of the group of root modules.
|
|
29
|
+
*/
|
|
30
|
+
selectTCArticle(groupId: string): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Always switches to configuration mode and selects a root module or sub-module.
|
|
33
|
+
* @param groupId The unique ID of the group of root modules.
|
|
34
|
+
* @param moduleId The ID of the root module or sub-module.
|
|
35
|
+
*/
|
|
36
|
+
selectTCModule(groupId: string, moduleId: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Opens or closes the geometry (e.g. drawers and doors) of all modules in a group.
|
|
39
|
+
* @param groupId The unique ID of the group of root modules.
|
|
40
|
+
* @param open If true, the modules are opened, if false, they are closed.
|
|
41
|
+
* @param animate If true the opening or closing is animated.
|
|
42
|
+
*/
|
|
43
|
+
openCloseTCArticle(groupId: string, open: boolean, animate: boolean): Promise<void>;
|
|
44
|
+
}
|
|
@@ -150,6 +150,68 @@ export default class RoomlePlannerUiCallback extends UiCallback {
|
|
|
150
150
|
* @param floorAreasData An array of objects, each representing the area and related data for each room within the floor plan.
|
|
151
151
|
*/
|
|
152
152
|
onFloorPlanAreasUpdated: (floorAreasData: FloorAreaDataTransferable[]) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Callback invoked when the selection of a component has been canceled.
|
|
155
|
+
*/
|
|
156
|
+
onComponentSelectionCancel: () => void;
|
|
157
|
+
/**
|
|
158
|
+
* Callback invoked when a plan snapshot is saved.
|
|
159
|
+
* @param planId The ID of the plan snapshot.
|
|
160
|
+
*/
|
|
161
|
+
onPlanSnapshotCreated: (planId: string) => void;
|
|
162
|
+
/**
|
|
163
|
+
* Callback invoked when an object is started to be configured.
|
|
164
|
+
*/
|
|
165
|
+
onStartConfiguring: () => Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Callback invoked when configuration is finished.
|
|
168
|
+
*/
|
|
169
|
+
onBackToPlanner: () => Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Callback invoked when the selection of an external component has changed.
|
|
172
|
+
* @param groupId The ID of the plan object to which the external component is attached.
|
|
173
|
+
* @param moduleId The ID of the selected external component.
|
|
174
|
+
*/
|
|
175
|
+
onExternalComponentSelectionChanged: (groupId: string, moduleId: string | null) => void;
|
|
176
|
+
/**
|
|
177
|
+
* Callback invoked when the attribute value of an external component has changed.
|
|
178
|
+
* @param groupId The ID of the plan object to which the external component is attached.
|
|
179
|
+
* @param moduleId The module ID of the selected external component.
|
|
180
|
+
* @param attrId The id of the changed attribute.
|
|
181
|
+
* @param value The new value of the changed attribute.
|
|
182
|
+
*/
|
|
183
|
+
onExternalComponentParameterChanged: (groupId: string, moduleId: string, attrId: string, value: string) => void;
|
|
184
|
+
/**
|
|
185
|
+
* Callback invoked when an external object is created.
|
|
186
|
+
* @param groupId The ID of the new external object.
|
|
187
|
+
* @param configuration The serialized article data Json.
|
|
188
|
+
*/
|
|
189
|
+
onExternalPlanObjectCreated: (groupId: string, configuration: string) => void;
|
|
190
|
+
/**
|
|
191
|
+
* Callback invoked when an external object has been changed (undo/redo).
|
|
192
|
+
* @param planObjectId The ID of the plan object to which the external component is attached.
|
|
193
|
+
* @param groupId The ID of the new external object.
|
|
194
|
+
* @param configuration The serialized article data Json.
|
|
195
|
+
*/
|
|
196
|
+
onExternalPlanObjectChanged: (groupId: string, configuration: string) => void;
|
|
197
|
+
/**
|
|
198
|
+
* Callback invoked when an external object is deleted.
|
|
199
|
+
* @param groupId The ID of the external object to be removed.
|
|
200
|
+
*/
|
|
201
|
+
onExternalPlanObjectRemoved: (articleId: string) => void;
|
|
202
|
+
/**
|
|
203
|
+
* Callback invoked when a root module or sub-module of an external object is deleted.
|
|
204
|
+
* @param groupId The ID of the external object that is the owner of the module.
|
|
205
|
+
* @param moduleId The ID of the module to be removed.
|
|
206
|
+
*/
|
|
207
|
+
onExternalPlanComponentRemoved: (groupId: string, moduleId: string) => void;
|
|
208
|
+
/**
|
|
209
|
+
* Callback invoked when a module is added to an external object.
|
|
210
|
+
* @param groupId The ID of the external object to which the module is added.
|
|
211
|
+
* @param parentModuleId The ID of th module to which the module is added. If the new module is a root module, this argument is null.
|
|
212
|
+
* @param moduleName The name of the module to be added. This must be one of the "allowedChildModules" of the parent module.
|
|
213
|
+
*/
|
|
214
|
+
onExternalPlanComponentAdded: (groupId: string, parentModuleId: string | null, moduleName: string) => void;
|
|
153
215
|
/**
|
|
154
216
|
* This callback is invoked when the context of the planner changes
|
|
155
217
|
* For example when it switches from planner to configurator, or from planner to viewer
|
|
@@ -22,6 +22,9 @@ import type WallPlanElementViewModel from './view-model/wall-plan-element-view-m
|
|
|
22
22
|
import type ConfiguratorContext from '../../common-core/src/webgl/configurator-context';
|
|
23
23
|
import type { PlanObject } from '../../typings/planner';
|
|
24
24
|
import type IdbManager from '../../common-core/src/services/idb-manager';
|
|
25
|
+
import type { TcAPI } from './roomle-planner-external-object';
|
|
26
|
+
import type { ExternalObjectApiConfiguration } from './external-object-api';
|
|
27
|
+
export type ID_TYPE = 'rml_id' | 'tc_id' | 'rml_serialized' | 'tc_serialized';
|
|
25
28
|
export interface RoomlePlannerCallback {
|
|
26
29
|
switchToConfigurator: () => Promise<Configurator>;
|
|
27
30
|
switchToViewer: () => Promise<GlbViewer>;
|
|
@@ -57,7 +60,7 @@ export interface BatchPaintMaterial {
|
|
|
57
60
|
rgbValue?: number;
|
|
58
61
|
catalogItemId?: RapiId;
|
|
59
62
|
}
|
|
60
|
-
export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlannerCallback, GlobalAPI, Context, KernelUtilityForUi, ExternalEmbeddable<RoomlePlannerUiCallback>, RubensAPI {
|
|
63
|
+
export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlannerCallback, GlobalAPI, Context, KernelUtilityForUi, ExternalEmbeddable<RoomlePlannerUiCallback>, RubensAPI, TcAPI {
|
|
61
64
|
_creator_: string;
|
|
62
65
|
private _configuratorContext;
|
|
63
66
|
private _domHelper;
|
|
@@ -222,7 +225,7 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
222
225
|
* Disable the selection of multiple elements.
|
|
223
226
|
*/
|
|
224
227
|
disableMultiselect(): void;
|
|
225
|
-
dragInObject(
|
|
228
|
+
dragInObject(idOrSerializedConfigString: string, dragEvent: DragEvent, type?: ID_TYPE): Promise<RuntimeId>;
|
|
226
229
|
/**
|
|
227
230
|
* enable snapping of object to object and object to wall
|
|
228
231
|
*/
|
|
@@ -339,6 +342,16 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
339
342
|
*/
|
|
340
343
|
preparePerspectiveImageOf(runtimeId: RuntimeId, options?: PrepareImageOptions): Promise<import("../../common-core/src/common-interfaces").Base64Image>;
|
|
341
344
|
generateTCExport(planObjectIds?: string[]): Promise<any>;
|
|
345
|
+
loadTCProperties(propertiesJson: string | ExternalObjectApiConfiguration): void;
|
|
346
|
+
loadTCMasterData(masterDataJson: string | object): void;
|
|
347
|
+
loadTCArticles(articleJson: string): Promise<void>;
|
|
348
|
+
private _selectKernelComponent;
|
|
349
|
+
removeTCArticle(groupId: string): Promise<void>;
|
|
350
|
+
selectTCModule(groupId: string, moduleId: string): Promise<void>;
|
|
351
|
+
_selectTCArticle(groupId: string, switchToPlanner: boolean): Promise<void>;
|
|
352
|
+
_selectTCModule(groupId: string, moduleId: string, selectPlanObject: boolean, switchToConfigurator: boolean): Promise<void>;
|
|
353
|
+
selectTCArticle(groupId: string): Promise<void>;
|
|
354
|
+
openCloseTCArticle(groupId: string, open: boolean, animate: boolean): Promise<void>;
|
|
342
355
|
enableMeasurementLineDrawing(): void;
|
|
343
356
|
disableMeasurementLineDrawing(): void;
|
|
344
357
|
setObjectToWallMeasurementLength(planElementId: number, measurementId: number, length: number): void;
|
|
@@ -353,4 +366,5 @@ export default class RoomlePlanner implements KernelAccessCallbackI, RoomlePlann
|
|
|
353
366
|
* @returns {Promise<string>} - A promise that resolves to the URL.
|
|
354
367
|
*/
|
|
355
368
|
resolveShortUrl(shortUrl: string): Promise<string>;
|
|
369
|
+
downloadHomagIxExportPoC(): Promise<any>;
|
|
356
370
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { KernelEnum, RuntimeId } from '../../../typings/kernel';
|
|
1
|
+
import type { KernelComponent, KernelEnum, RuntimeId, PlanObject as ConfiguratorPlanObject } from '../../../typings/kernel';
|
|
2
2
|
import type PlanObjectViewModel from '../../../common-core/src/view-model/plan-object-view-model';
|
|
3
3
|
import type { KernelObject, Plan, PlanElement, PlanInteractionHandler, PlanModelViewHelper, PlanObject } from '../../../typings/planner';
|
|
4
|
-
import type { RapiConfiguration, RapiItem } from '../../../typings/rapi-types';
|
|
4
|
+
import type { RapiConfiguration, RapiItem, RapiPlanSnapshotPostData } from '../../../typings/rapi-types';
|
|
5
5
|
import type RoomlePlannerUiCallback from '../roomle-planner-ui-callback';
|
|
6
6
|
import type PlanElementViewModel from '../../../common-core/src/view-model/plan-element-view-model';
|
|
7
7
|
import type { Position3 } from '../../../common-core/src/common-interfaces';
|
|
@@ -57,14 +57,15 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
57
57
|
planElement3dMeshChanged(plan: Plan, element: PlanElement): void;
|
|
58
58
|
private _onStaticItemAdded;
|
|
59
59
|
private _onConfigurableItemAdded;
|
|
60
|
+
private _onConfigurableItemRemoved;
|
|
60
61
|
private _onConfigurableConstructionItemAdded;
|
|
61
62
|
planElementAdded(plan: Plan, element: PlanElement): Promise<void>;
|
|
62
63
|
planElementChanged(plan: Plan, element: KernelObject): void;
|
|
63
64
|
planHistoryStateChanged(): void;
|
|
64
65
|
planObjectConfigurationCreated(_plan: Plan, _element: PlanObject): void;
|
|
66
|
+
externalObjectConfigurationChanged(plan: Plan, planObject: PlanObject, configuration: string): void;
|
|
67
|
+
externalObjectConfigurationDeleted(plan: Plan, planObject: PlanObject, uniqueId: string): void;
|
|
65
68
|
planObjectConfigurationLoaded(plan: Plan, element: PlanElement, success: boolean): void;
|
|
66
|
-
externalObjectConfigurationChanged(_plan: Plan, _planObject: PlanObject, _configuration: string): void;
|
|
67
|
-
externalObjectConfigurationDeleted(_plan: Plan, _planObject: PlanObject, _uniqueId: string): void;
|
|
68
69
|
requestCatalogItem(_catalogItemId: string): void;
|
|
69
70
|
startedDrawing(): void;
|
|
70
71
|
stoppedDrawing(): void;
|
|
@@ -79,4 +80,17 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
|
|
|
79
80
|
coupleReferences(jsObject: any, coreReference: KernelObject): void;
|
|
80
81
|
private _decoupleReferences;
|
|
81
82
|
isConstructionPlanElement(planElement: PlanElement): boolean;
|
|
83
|
+
planObjectSelectionChanged(planObjectId: number): void;
|
|
84
|
+
protected _externalPlanObjectCreated(planObject: PlanObject): void;
|
|
85
|
+
protected _externalPlanObjectRemoved(planObject: PlanObject): void;
|
|
86
|
+
protected _componentSelectionChanged(planObject: ConfiguratorPlanObject, component: KernelComponent, planComponentSelection: boolean): void;
|
|
87
|
+
protected _externalObjectParameterChanged(objectOrComponentId: number, parameterKey: string, value: string): void;
|
|
88
|
+
protected _externalObjectConfigurationChanged(objectId: number, configuration: string): void;
|
|
89
|
+
protected _externalObjectConfigurationDeleted(uniqueId: string): void;
|
|
90
|
+
planSnapshotCreated(planSnapshot: RapiPlanSnapshotPostData): void;
|
|
91
|
+
requestDeleteComponents(componentIds: number[]): void;
|
|
92
|
+
requestDeleteComponent(componentId: number): void;
|
|
93
|
+
requestDeletePlanComponent(componentId: number): void;
|
|
94
|
+
private _externalPlanComponentDeleted;
|
|
95
|
+
dockExternalObjectComponent(parentId: number, parentDockId: number, childId: number, childDockId: number): void;
|
|
82
96
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type UiPlanObject } from '../../../typings/kernel';
|
|
2
2
|
import type PlannerKernelAccess from '../services/planner-kernel-access';
|
|
3
3
|
import type RapiAccess from '../../../common-core/src/rapi-access';
|
|
4
4
|
export declare const mapToUiPlanObjects: (planObjects: any, plannerKernelAccess: PlannerKernelAccess, rapiAccess: RapiAccess) => Promise<UiPlanObject[]>;
|
|
@@ -54,6 +54,7 @@ export default class PlanViewModel extends ConfiguratorViewModel implements Plan
|
|
|
54
54
|
addPlanElementViewModel(planElementViewModel: PlanElementViewModel): void;
|
|
55
55
|
private _handleConfiguratorPlanObjectViewModel;
|
|
56
56
|
private _linkPlanObjectViewModelAndComponent;
|
|
57
|
+
private _detachPlanObjectViewModelFromComponent;
|
|
57
58
|
private _handleConfiguratorConstructionPlanObjectViewModel;
|
|
58
59
|
private _handleConstructionPlanObjectViewModel;
|
|
59
60
|
private _handleStaticPlanObjectViewModel;
|
|
@@ -53,6 +53,7 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
53
53
|
private _paperBackground;
|
|
54
54
|
private _debugSpheres;
|
|
55
55
|
constructor(creator: string, offset: CanvasOffset, plannerCallback: RoomlePlannerCallback, mode: Enumify<typeof CAMERA_TYPE>);
|
|
56
|
+
get configuratorContext(): import("../../../common-core/src/webgl/configurator-context").default;
|
|
56
57
|
planCleared(): void;
|
|
57
58
|
planHistoryStateChanged(): void;
|
|
58
59
|
protected _getViewModel(): PlanViewModel;
|
|
@@ -193,5 +194,6 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
193
194
|
setMeasurementLineLength(measurementId: number, length: number, wallDirection: string): void;
|
|
194
195
|
protected setEventHandlerObject(object: Object3D): void;
|
|
195
196
|
protected _readyForRender(): void;
|
|
197
|
+
protected notifyPlannerOnComponentSelectionCancel(): void;
|
|
196
198
|
}
|
|
197
199
|
export {};
|
|
@@ -386,14 +386,30 @@ export interface KernelVariant {
|
|
|
386
386
|
parameterValues: KernelParameterValue[];
|
|
387
387
|
}
|
|
388
388
|
export interface KernelExternalObjectDocking {
|
|
389
|
-
|
|
389
|
+
groupId: string;
|
|
390
390
|
parentModuleId: string;
|
|
391
391
|
moduleName: string;
|
|
392
392
|
}
|
|
393
393
|
export declare const enum ExportType {
|
|
394
394
|
TC = 0,
|
|
395
395
|
IMOSiX = 1,
|
|
396
|
-
|
|
396
|
+
HOMAGiX = 2,
|
|
397
|
+
BlueOceanPoC = 3
|
|
398
|
+
}
|
|
399
|
+
export interface HomagIxArticleData {
|
|
400
|
+
name: string;
|
|
401
|
+
count: number;
|
|
402
|
+
position: {
|
|
403
|
+
x: number;
|
|
404
|
+
y: number;
|
|
405
|
+
z: number;
|
|
406
|
+
};
|
|
407
|
+
rotation: {
|
|
408
|
+
x: number;
|
|
409
|
+
y: number;
|
|
410
|
+
z: number;
|
|
411
|
+
};
|
|
412
|
+
attributes: string;
|
|
397
413
|
}
|
|
398
414
|
export interface ConfigurationExporter {
|
|
399
415
|
new (): ConfigurationExporter;
|
|
@@ -405,6 +421,8 @@ export interface ConfiguratorKernelClass {
|
|
|
405
421
|
setUpdateCallbacksOnlyIfGeometryIsReady(onlyUpdateIfReady: boolean): void;
|
|
406
422
|
useHDGeometry(requestUseHDGeometry: boolean): void;
|
|
407
423
|
useEnvironmentGeometry(requestEnvironmentGeometry: boolean): void;
|
|
424
|
+
setEnvironmentVariable(key: string, value: any): void;
|
|
425
|
+
setLevel(restrictionLevel: number): void;
|
|
408
426
|
setDockInsertPreviewBoxParameters(thickness: number, protruding: number, intruding: number, bevelSize: number): void;
|
|
409
427
|
clearScene(): void;
|
|
410
428
|
clearAll(): void;
|
|
@@ -428,8 +446,6 @@ export interface ConfiguratorKernelClass {
|
|
|
428
446
|
getPlanComponentAnimations(planComponentId: number): KernelAnimation[];
|
|
429
447
|
setComponentParameter(componentId: number, parameterKey: string, value: string): void;
|
|
430
448
|
setPlanComponentParameters(componentIds: any, parameterKey: string, value: string): void;
|
|
431
|
-
setEnvironmentVariable(key: string, value: any): void;
|
|
432
|
-
setLevel(restrictionLevel: number): void;
|
|
433
449
|
getPlanObjectParameters(planObjectId: number): KernelParameter[];
|
|
434
450
|
getPlanObjectAnimations(planObjectId: number): KernelAnimation[];
|
|
435
451
|
setPlanObjectParameter(planObjectId: number, parameterKey: string, value: string): void;
|
|
@@ -247,7 +247,7 @@ export interface PlanModelViewHelper {
|
|
|
247
247
|
getPlanObject(plan: Plan, aRuntimeId: number): KernelPlanObject;
|
|
248
248
|
getRootPlanObjectId(plan: Plan, aRuntimeId: number): number;
|
|
249
249
|
getObjectComponent(plan: Plan, aComponentOrConfigurationId: number): KernelPlanObjectComponent;
|
|
250
|
-
getExternalObjectComponent(plan: Plan,
|
|
250
|
+
getExternalObjectComponent(plan: Plan, groupId: string, moduleId: string): KernelPlanObjectComponent;
|
|
251
251
|
requestMesh3d(element: PlanElement): void;
|
|
252
252
|
}
|
|
253
253
|
export interface PlanNode extends KernelObject {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{aT as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aU as AsyncDependencyLoader,aa as convertToTHREE}from"./roomle-dependency-injection-de9b1dca.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,bG as Line3,ad as Box3}from"./main-thread-to-worker-554053aa.js";import{T as TextGeometry}from"./TextGeometry-def07ca8.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-
|
|
1
|
+
import{aU as normalizeRotation,H as dispose,_ as __decorate,i as inject,j as AsyncGuard,aV as AsyncDependencyLoader,aa as convertToTHREE}from"./roomle-dependency-injection-a223d34e.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,bH as Line3,ad as Box3}from"./main-thread-to-worker-af604b88.js";import{T as TextGeometry}from"./TextGeometry-64e47e97.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-5158f2b2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-5158f2b2.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-d4b30187185acc59.json\""],"names":[],"mappings":"w7IAAe"}
|
package/lib/{dimensioning-helper-0b76dc02.nomodule.js → dimensioning-helper-9e131f41.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-a91fd623.nomodule.js","./main-thread-to-worker-a33146dd.nomodule.js","./TextGeometry-6c37ac59.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.aU,e=t.H,s=t._,n=t.i,h=t.j,o=t.aV,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.bH,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-9e131f41.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-9e131f41.nomodule.js","sources":["../../packages/configurator-core/public/fonts/lato_regular_sub.json"],"sourcesContent":["export default \"static/lato_regular_sub-d4b30187185acc59.json\""],"names":[],"mappings":"w4HAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-aaabae44.js";import{aK as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,ae as getGUI,_ as __decorate,i as inject,u as CANVAS_ID,x as DynamicLightSettingLoader,y as PREDEFINED_LIGHTSETTING,H as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-a223d34e.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-b98a3df3.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aR as getGlbUrl,bv as WebGLRenderer,i as SRGBColorSpace,bj as BasicShadowMap,N as PerspectiveCamera,bC as download}from"./main-thread-to-worker-af604b88.js";import{D as DefaultLightSetting,J as JS_ZIP_FILE_NAME}from"./jszip.min-58a46137.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-5d2c01e4.js";import"./query-params-helper-15c8e313.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,a,i){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+a,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new Vector3(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const a=getGlbUrl(r);return a?this.loadGLB(a,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),a){return this.clearScene(),new Promise((i,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,a).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),i()},n)})}preparePerspectiveImage(e,t,r){return new Promise(a=>{var i,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(i=this._lightSetting)||void 0===i||i.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{a({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,a){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let i=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(i,e,t,r,a),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let a=JSON.parse(e);this._scriptLoader.fetch(JS_ZIP_FILE_NAME,{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(a.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,r,a,i)}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-1a4bbdab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-1a4bbdab.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./script-loader-42630c85.nomodule.js","./roomle-dependency-injection-a91fd623.nomodule.js","./camera-behaviour-2daf92d1.nomodule.js","./main-thread-to-worker-a33146dd.nomodule.js","./jszip.min-b1e4e384.nomodule.js","./glb-viewer-camera-behaviour-34d13c8c.nomodule.js","./query-params-helper-ff314078.nomodule.js"],(function(e){var t,r,i,n,a,s,o,h,c,d,l,u,m,_,p,g,v,w,f,b,C,S,L,B,M,y,I,x,G,E,j,O,F,D;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.aK,n=e.D,a=e.L,s=e.R,o=e.ae,h=e._,c=e.i,d=e.u,l=e.x,u=e.y,m=e.H,_=e.b},function(e){p=e.C,g=e.L,v=e.S,w=e.T},function(e){f=e.a,b=e.ad,C=e.ag,S=e.Q,L=e.A,B=e.C,M=e.aE,y=e.aR,I=e.bv,x=e.i,G=e.bj,E=e.N,j=e.bC},function(e){O=e.D,F=e.J},function(e){D=e.G},function(){}],execute:function(){const P=[new n("script-loader",t),new n("glb-input-manager",class extends i{},1),new n("logger",a),new n("rapi-access",s)];class z extends p{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let a=new f(-e.x/2,0,-e.z/2),s=new f(e.x/2,e.y,e.z/2);this._boundingBox=new b(a,s);let o=new C(-Math.PI/2+i,r,0,"ZYX"),h=(new S).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class A extends g{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new B(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new B(e)})}}}class U extends v{constructor(e,t){super(e,t,d.GLB,M.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(l.createDynamicLightSettingSource(null,u.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new A(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new D(new z(this._creator_,this._getInputManager(),new f(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=y(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new f(1,1,1),i){return this.clearScene(),new Promise((n,a)=>{this._loadGLB(e,new f(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new b).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof z&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),n()},a)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var n,a;t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof E&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(n=this._lightSetting)||void 0===n||n.removeFromScene();let o=new O(this._scene);e.render(this._scene,s);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(a=this._lightSetting)||void 0===a||a.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof z){let n=(new b).setFromObject(this._scene).getSize(new f);this.cameraBehaviour.cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof z&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof z&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new b).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}cameraBehaviourChanged(){super.cameraBehaviourChanged(),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._requestRender()},this)}}h([c],U.prototype,"_glbInputManager",void 0),h([c],U.prototype,"_rapiAccess",void 0);class R{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new f(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class k{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(w,{id:"tween-js"})]).then(()=>{this._sceneManager=new U(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new f(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch(F,{id:"jszip-js"}).then(()=>{let e=new R(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{j("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}h([c],k.prototype,"_rapiAccess",void 0),h([c],k.prototype,"_domHelper",void 0),h([c],k.prototype,"_scriptLoader",void 0),h([c],k.prototype,"_lifeCycleManager",void 0),h([c],k.prototype,"_initData",void 0),h([c],k.prototype,"_globalInitData",void 0),h([c],k.prototype,"_unitFormatter",void 0),h([c],k.prototype,"_idbManager",void 0),e("GlbViewer",class extends r{setupGlobals(){}setupDependencies(){_.setup(P),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new k(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-5eb83b89.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-5eb83b89.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./camera-behaviour-
|
|
2
|
-
//# sourceMappingURL=glb-viewer-camera-behaviour-
|
|
1
|
+
System.register(["./camera-behaviour-2daf92d1.nomodule.js"],(function(e){var t;return{setters:[function(e){t=e.b}],execute:function(){e("G",class extends t{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(e){this.cameraControl.updateAndReset(e,!1)}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-34d13c8c.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-34d13c8c.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as CameraBehaviour}from"./camera-behaviour-b98a3df3.js";class GlbViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(a){this.cameraControl.updateAndReset(a,!1)}}export{GlbViewerCameraBehaviour as G};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-5d2c01e4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-5d2c01e4.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{GlbViewer}from"./glb-viewer-1a4bbdab.js";import"./script-loader-aaabae44.js";import"./query-params-helper-15c8e313.js";import"./main-thread-to-worker-af604b88.js";import"./roomle-dependency-injection-a223d34e.js";import"./camera-behaviour-b98a3df3.js";import"./jszip.min-58a46137.js";import"./glb-viewer-camera-behaviour-5d2c01e4.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-85cff8b8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-85cff8b8.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./glb-viewer-
|
|
1
|
+
System.register(["./glb-viewer-5eb83b89.nomodule.js","./script-loader-42630c85.nomodule.js","./query-params-helper-ff314078.nomodule.js","./main-thread-to-worker-a33146dd.nomodule.js","./roomle-dependency-injection-a91fd623.nomodule.js","./camera-behaviour-2daf92d1.nomodule.js","./jszip.min-b1e4e384.nomodule.js","./glb-viewer-camera-behaviour-34d13c8c.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.nomodule.js.map
|