@roomle/web-sdk 3.7.0-alpha.2 → 3.7.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{BufferGeometry-C696z6r3.mjs → BufferGeometry-BzmfTBQt.mjs} +1 -1
- package/lib/{BufferGeometry-C696z6r3.mjs.map → BufferGeometry-BzmfTBQt.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-AfQIvZAD.mjs → GLTFExporter-CyhgWPq0.mjs} +2 -2
- package/lib/{GLTFExporter-AfQIvZAD.mjs.map → GLTFExporter-CyhgWPq0.mjs.map} +1 -1
- package/lib/{PointLightHelper-wVSmrAnD.mjs → PointLightHelper-DwIXACyT.mjs} +2 -2
- package/lib/{PointLightHelper-wVSmrAnD.mjs.map → PointLightHelper-DwIXACyT.mjs.map} +1 -1
- package/lib/RoomleCore.js +4 -4
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-C7J95t4f.mjs → SpotLightHelper-CfLHM7LU.mjs} +2 -2
- package/lib/{SpotLightHelper-C7J95t4f.mjs.map → SpotLightHelper-CfLHM7LU.mjs.map} +1 -1
- package/lib/{USDZExporter-BBk0APeK.mjs → USDZExporter-kmxcTvnQ.mjs} +2 -2
- package/lib/{USDZExporter-BBk0APeK.mjs.map → USDZExporter-kmxcTvnQ.mjs.map} +1 -1
- package/lib/{api-oYzhcs_W.mjs → api-X1dDTDvL.mjs} +2 -2
- package/lib/{api-oYzhcs_W.mjs.map → api-X1dDTDvL.mjs.map} +1 -1
- package/lib/{banana-for-scale-D8t2dmc7.mjs → banana-for-scale-Bpf8RfLi.mjs} +4 -4
- package/lib/{banana-for-scale-D8t2dmc7.mjs.map → banana-for-scale-Bpf8RfLi.mjs.map} +1 -1
- package/lib/budgeteer.sw-CQWYbQSc.mjs.map +1 -1
- package/lib/budgeteer.sw.js +1 -1
- package/lib/{common-utils-qErzZAiR.mjs → common-utils-DMI8Yuhe.mjs} +5 -3
- package/lib/common-utils-DMI8Yuhe.mjs.map +1 -0
- package/lib/{component-dimensioning-DlB7-9Om.mjs → component-dimensioning-MtS9xiY-.mjs} +15 -15
- package/lib/{component-dimensioning-DlB7-9Om.mjs.map → component-dimensioning-MtS9xiY-.mjs.map} +1 -1
- package/lib/{component-raycast-helper-C6ptEb0K.mjs → component-raycast-helper-C1qWqpRH.mjs} +13 -9
- package/lib/component-raycast-helper-C1qWqpRH.mjs.map +1 -0
- package/lib/configurator-C5t3clCx.mjs +2 -0
- package/lib/{configurator-CRMunIq7.mjs → configurator-Cg1a9XSL.mjs} +4 -4
- package/lib/{configurator-CRMunIq7.mjs.map → configurator-Cg1a9XSL.mjs.map} +1 -1
- package/lib/{continuous-drawing-helper-BwulJHKj.mjs → continuous-drawing-helper-CQx5Sbns.mjs} +3 -3
- package/lib/{continuous-drawing-helper-BwulJHKj.mjs.map → continuous-drawing-helper-CQx5Sbns.mjs.map} +1 -1
- package/lib/{dat.gui.module-CZHqOVGq.mjs → dat.gui.module-CZ-DIWHM.mjs} +1 -1
- package/lib/{dat.gui.module-CZHqOVGq.mjs.map → dat.gui.module-CZ-DIWHM.mjs.map} +1 -1
- package/lib/{decorate-BAtqSPNS.mjs → decorate-Bck1_lG8.mjs} +1 -1
- package/lib/{decorate-BAtqSPNS.mjs.map → decorate-Bck1_lG8.mjs.map} +1 -1
- package/lib/dimensioning-helper-Bfe0fImX.mjs +2 -0
- package/lib/{dimensioning-helper--Y0Y-Wr1.mjs → dimensioning-helper-GPn7Z8GE.mjs} +7 -7
- package/lib/{dimensioning-helper--Y0Y-Wr1.mjs.map → dimensioning-helper-GPn7Z8GE.mjs.map} +1 -1
- package/lib/glb-viewer-DIEpkrvY.mjs +2 -0
- package/lib/{glb-viewer-CXEoIw1b.mjs → glb-viewer-tgKOPCaI.mjs} +44 -45
- package/lib/glb-viewer-tgKOPCaI.mjs.map +1 -0
- package/lib/highlight-coordinator-DRHeEU-E.mjs +116 -0
- package/lib/highlight-coordinator-DRHeEU-E.mjs.map +1 -0
- package/lib/{homag-intelligence-gb9MqBrz.mjs → homag-intelligence-D5mCTWgG.mjs} +19 -11
- package/lib/homag-intelligence-D5mCTWgG.mjs.map +1 -0
- package/lib/{imos-ix-poc-export-helper-CW7QZhhn.mjs → imos-ix-poc-export-helper-BKFs_Yhm.mjs} +5 -5
- package/lib/{imos-ix-poc-export-helper-CW7QZhhn.mjs.map → imos-ix-poc-export-helper-BKFs_Yhm.mjs.map} +1 -1
- package/lib/kernel-C7YDLxq8.mjs.map +1 -1
- package/lib/{kernel-utils-DCnHzW4n.mjs → kernel-utils-B80amC-l.mjs} +2 -2
- package/lib/{kernel-utils-DCnHzW4n.mjs.map → kernel-utils-B80amC-l.mjs.map} +1 -1
- package/lib/{layer-CFAr2mK_.mjs → layer-BfckfWZz.mjs} +1 -1
- package/lib/{layer-CFAr2mK_.mjs.map → layer-BfckfWZz.mjs.map} +1 -1
- package/lib/{main-BJZ9-cDk.mjs → main-CJ5TNhBt.mjs} +2518 -2554
- package/lib/main-CJ5TNhBt.mjs.map +1 -0
- package/lib/{material-viewer-D8Nmpwg0.mjs → material-viewer-DCqZzMZN.mjs} +40 -35
- package/lib/material-viewer-DCqZzMZN.mjs.map +1 -0
- package/lib/packages-DuOz6rk6.mjs +4 -0
- package/lib/{planner-5VarJrpy.mjs → planner-CSboZram.mjs} +3 -3
- package/lib/{planner-5VarJrpy.mjs.map → planner-CSboZram.mjs.map} +1 -1
- package/lib/planner-CWPqJktz.mjs +2 -0
- package/lib/{plugin-system-DInww4H_.mjs → plugin-system-DD0Z9Jvt.mjs} +3 -3
- package/lib/{plugin-system-DInww4H_.mjs.map → plugin-system-DD0Z9Jvt.mjs.map} +1 -1
- package/lib/{roomle-headless-setup-LoBO7UJe.mjs → roomle-headless-setup-nsoGENQV.mjs} +1 -1
- package/lib/{roomle-headless-setup-LoBO7UJe.mjs.map → roomle-headless-setup-nsoGENQV.mjs.map} +1 -1
- package/lib/roomle-headless.d.ts +252 -106
- package/lib/roomle-headless.js +20 -17
- package/lib/roomle-headless.js.map +1 -1
- package/lib/{roomle-renderer-DVlJsHYn.mjs → roomle-renderer-BEJNPCKx.mjs} +2 -2
- package/lib/roomle-renderer-BEJNPCKx.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +252 -106
- package/lib/roomle-sdk.js +6 -6
- package/lib/roomle-webgpu-renderer-D5flithq.mjs +1502 -0
- package/lib/roomle-webgpu-renderer-D5flithq.mjs.map +1 -0
- package/lib/{scene-renderer-BHZrQYAH.mjs → scene-renderer-Dm1kij1z.mjs} +26 -26
- package/lib/scene-renderer-Dm1kij1z.mjs.map +1 -0
- package/lib/{script-loader-gpkcl1h-.mjs → script-loader-DqaDm1FG.mjs} +3 -3
- package/lib/{script-loader-gpkcl1h-.mjs.map → script-loader-DqaDm1FG.mjs.map} +1 -1
- package/lib/static/packages/workers/generated/budgeteer.sw.js +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.d.ts +4 -4
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js +7 -7
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +28 -8
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorUtils.js +27 -11
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorUtils.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.d.ts +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +37 -2
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js +6 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/planElementManager.d.ts +4 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/planElementManager.js +16 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/planElementManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +4 -4
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-Cv5SoEWT.mjs → stats-helper-D7a7oxnj.mjs} +3 -3
- package/lib/{stats-helper-Cv5SoEWT.mjs.map → stats-helper-D7a7oxnj.mjs.map} +1 -1
- package/lib/{three.core-mM-jZdgg.mjs → three.core-BmQnspOL.mjs} +819 -816
- package/lib/{three.core-mM-jZdgg.mjs.map → three.core-BmQnspOL.mjs.map} +1 -1
- package/lib/{three.module-Bmy3sVQ-.mjs → three.module-DkrZwaid.mjs} +455 -455
- package/lib/{three.module-Bmy3sVQ-.mjs.map → three.module-DkrZwaid.mjs.map} +1 -1
- package/lib/{three.webgpu-BbVYfCDp.mjs → three.webgpu-DLZjhIYv.mjs} +1517 -1517
- package/lib/{three.webgpu-BbVYfCDp.mjs.map → three.webgpu-DLZjhIYv.mjs.map} +1 -1
- package/lib/three.webgpu-RkQxSIwG.mjs +3 -0
- package/lib/{threejs-utils-Bq4pVWBA.mjs → threejs-utils-CrK_gp1x.mjs} +67 -63
- package/lib/threejs-utils-CrK_gp1x.mjs.map +1 -0
- package/lib/{tools-core-DqnhFefF.mjs → tools-core-CZWgXTFV.mjs} +3 -3
- package/lib/{tools-core-DqnhFefF.mjs.map → tools-core-CZWgXTFV.mjs.map} +1 -1
- package/package.json +1 -1
- package/lib/common-utils-qErzZAiR.mjs.map +0 -1
- package/lib/component-raycast-helper-C6ptEb0K.mjs.map +0 -1
- package/lib/component-raycast-helper-LrhRpeDD.mjs +0 -2
- package/lib/configurator-DqiW717d.mjs +0 -2
- package/lib/dimensioning-helper-BpUreWo2.mjs +0 -2
- package/lib/glb-viewer-CXEoIw1b.mjs.map +0 -1
- package/lib/glb-viewer-IDXgmONx.mjs +0 -2
- package/lib/homag-intelligence-gb9MqBrz.mjs.map +0 -1
- package/lib/main-BJZ9-cDk.mjs.map +0 -1
- package/lib/material-viewer-D8Nmpwg0.mjs.map +0 -1
- package/lib/packages-Uv53SHfb.mjs +0 -4
- package/lib/planner-DJcn-iih.mjs +0 -2
- package/lib/roomle-renderer-DVlJsHYn.mjs.map +0 -1
- package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs +0 -217
- package/lib/roomle-webgpu-renderer-CVxBRv6o.mjs.map +0 -1
- package/lib/scene-renderer-BHZrQYAH.mjs.map +0 -1
- package/lib/three.webgpu-Bnp8Whu8.mjs +0 -3
- package/lib/threejs-utils-Bq4pVWBA.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorate-
|
|
1
|
+
{"version":3,"file":"decorate-Bck1_lG8.mjs","names":[],"sources":["../../packages/common-core/src/utils/string-utils.ts","../../packages/common-core/src/di/inject.ts"],"sourcesContent":["/*\n * Lifted from https://github.com/shahata/dasherize/blob/master/index.js\n */\nexport const dashCase = function (str: string) {\n if (str.startsWith('_')) {\n str = str.substr(1);\n }\n return str.replace(\n /[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,\n function (s: string, i: number) {\n return (i > 0 ? '-' : '') + s.toLowerCase();\n },\n );\n};\n","import './global-definitions';\nimport { dashCase } from '../utils/string-utils';\n\nexport default function inject(target: any, propertyName: string): void {\n const propertyCache = Symbol('property-cache');\n const warnedCache = Symbol('warned-cache');\n Object.defineProperty(target, propertyName, {\n get(this: any) {\n if (!this[propertyCache]) {\n // eslint-disable-next-line\n const instance = window.__RML__DI__?.lookup(\n dashCase(propertyName),\n this._creator_,\n );\n if (!instance) {\n // Only warn once per instance to avoid repeated errors from render loops\n // or other recurring access patterns (e.g. after test teardown).\n if (!this[warnedCache]) {\n this[warnedCache] = true;\n console.error(\n 'Dependency ' +\n dashCase(propertyName) +\n ' not found! Add dependency to /utils/injectables.ts',\n );\n }\n } else {\n this[propertyCache] = instance;\n }\n }\n return this[propertyCache];\n },\n });\n}\n"],"mappings":";AAGA,IAAa,IAAW,SAAU,GAAa;AAI7C,QAHI,EAAI,WAAW,IAAI,KACrB,IAAM,EAAI,OAAO,EAAE,GAEd,EAAI,QACT,gDACA,SAAU,GAAW,GAAW;AAC9B,UAAQ,IAAI,IAAI,MAAM,MAAM,EAAE,aAAa;GAE9C;;;;ACTH,SAAwB,EAAO,GAAa,GAA4B;CACtE,IAAM,IAAgB,OAAO,iBAAiB,EACxC,IAAc,OAAO,eAAe;AAC1C,QAAO,eAAe,GAAQ,GAAc,EAC1C,MAAe;AACb,MAAI,CAAC,KAAK,IAAgB;GAExB,IAAM,IAAW,OAAO,aAAa,OACnC,EAAS,EAAa,EACtB,KAAK,UACN;AACD,GAAK,IAYH,KAAK,KAAiB,IATjB,KAAK,OACR,KAAK,KAAe,IACpB,QAAQ,MACN,gBACE,EAAS,EAAa,GACtB,sDACH;;AAMP,SAAO,KAAK;IAEf,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bt as e, Rt as t, bi as n, d as r, m as i, on as a, p as o, pt as s, wn as c, xi as l, zt as u } from "./three.core-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as h } from "./layer-
|
|
1
|
+
import { Bt as e, Rt as t, bi as n, d as r, m as i, on as a, p as o, pt as s, wn as c, xi as l, zt as u } from "./three.core-BmQnspOL.mjs";
|
|
2
|
+
import { n as d, r as f, t as p } from "./decorate-Bck1_lG8.mjs";
|
|
3
|
+
import { a as m } from "./kernel-utils-B80amC-l.mjs";
|
|
4
|
+
import { t as h } from "./layer-BfckfWZz.mjs";
|
|
5
5
|
//#region packages/common-core/src/async-guard.ts
|
|
6
6
|
var g = class {
|
|
7
7
|
constructor(e) {
|
|
@@ -191,7 +191,7 @@ var A = class {
|
|
|
191
191
|
this._enabled && !this._dimensionsVisible && (this._dimensionsVisible = !0, this._visibilityChangedCallback()), this._performUpdate(e);
|
|
192
192
|
}
|
|
193
193
|
updateSize(e) {
|
|
194
|
-
this._origin =
|
|
194
|
+
this._origin = m(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 = m(e.size), this.update();
|
|
195
195
|
}
|
|
196
196
|
removeFromObject(e) {
|
|
197
197
|
e && e.remove(this._dimensionLineGroup);
|
|
@@ -261,8 +261,8 @@ var A = class {
|
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
|
-
|
|
264
|
+
p([f, d("design:type", Object)], A.prototype, "_unitFormatter", void 0);
|
|
265
265
|
//#endregion
|
|
266
266
|
export { E as a, C as c, D as i, g as l, T as n, k as o, A as r, _ as s, w as t };
|
|
267
267
|
|
|
268
|
-
//# sourceMappingURL=dimensioning-helper
|
|
268
|
+
//# sourceMappingURL=dimensioning-helper-GPn7Z8GE.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper--Y0Y-Wr1.mjs","names":[],"sources":["../../packages/common-core/src/async-guard.ts","../../../../node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","../../packages/configurator-core/src/utils/dimensioning-helper.ts"],"sourcesContent":["export default class AsyncGuard<T> {\n public info: any;\n private _promise: Promise<T>;\n private _resolve: (value?: T | PromiseLike<T>) => void;\n private _reject: (error: Error) => void;\n\n constructor(info?: any) {\n this.info = info;\n this._init();\n }\n\n private _init() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n public resolve(value?: any): void {\n if (value) {\n this._resolve(value);\n }\n this._resolve();\n }\n\n public reject(e: Error): void {\n this._reject(e);\n }\n\n public wait(): Promise<T> {\n return this._promise;\n }\n\n public reset() {\n this._init();\n }\n}\n","import {\n\tMatrix4,\n\tObject3D,\n\tVector2,\n\tVector3\n} from 'three';\n\n/**\n * The only type of 3D object that is supported by {@link CSS2DRenderer}.\n *\n * @augments Object3D\n * @three_import import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DObject extends Object3D {\n\n\t/**\n\t * Constructs a new CSS2D object.\n\t *\n\t * @param {HTMLElement} [element] - The DOM element.\n\t */\n\tconstructor( element = document.createElement( 'div' ) ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS2DObject = true;\n\n\t\t/**\n\t\t * The DOM element which defines the appearance of this 3D object.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.element = element;\n\n\t\tthis.element.style.position = 'absolute';\n\t\tthis.element.style.userSelect = 'none';\n\n\t\tthis.element.setAttribute( 'draggable', false );\n\n\t\t/**\n\t\t * The 3D objects center point.\n\t\t * `( 0, 0 )` is the lower left, `( 1, 1 )` is the top right.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\tthis.addEventListener( 'removed', function () {\n\n\t\t\tthis.traverse( function ( object ) {\n\n\t\t\t\tif (\n\t\t\t\t\tobject.element &&\n\t\t\t\t\tobject.element instanceof object.element.ownerDocument.defaultView.Element &&\n\t\t\t\t\tobject.element.parentNode !== null\n\t\t\t\t) {\n\n\t\t\t\t\tobject.element.remove();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.element = source.element.cloneNode( true );\n\n\t\tthis.center = source.center;\n\n\t\treturn this;\n\n\t}\n\n}\n\n//\n\nconst _vector = new Vector3();\nconst _viewMatrix = new Matrix4();\nconst _viewProjectionMatrix = new Matrix4();\nconst _a = new Vector3();\nconst _b = new Vector3();\n\n/**\n * This renderer is a simplified version of {@link CSS3DRenderer}. The only transformation that is\n * supported is translation.\n *\n * The renderer is very useful if you want to combine HTML based labels with 3D objects. Here too,\n * the respective DOM elements are wrapped into an instance of {@link CSS2DObject} and added to the\n * scene graph. All other types of renderable 3D objects (like meshes or point clouds) are ignored.\n *\n * `CSS2DRenderer` only supports 100% browser and display zoom.\n *\n * @three_import import { CSS2DRenderer } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DRenderer {\n\n\t/**\n\t * Constructs a new CSS2D renderer.\n\t *\n\t * @param {CSS2DRenderer~Parameters} [parameters] - The parameters.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst _this = this;\n\n\t\tlet _width, _height;\n\t\tlet _widthHalf, _heightHalf;\n\n\t\tconst cache = {\n\t\t\tobjects: new WeakMap()\n\t\t};\n\n\t\tconst domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );\n\n\t\tdomElement.style.overflow = 'hidden';\n\n\t\t/**\n\t\t * The DOM where the renderer appends its child-elements.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Controls whether the renderer assigns `z-index` values to CSS2DObject DOM elements.\n\t\t * If set to `true`, z-index values are assigned first based on the `renderOrder`\n\t\t * and secondly - the distance to the camera. If set to `false`, no z-index values are assigned.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t/**\n\t\t * Returns an object containing the width and height of the renderer.\n\t\t *\n\t\t * @return {{width:number,height:number}} The size of the renderer.\n\t\t */\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\t/**\n\t\t * Renders the given scene using the given camera.\n\t\t *\n\t\t * @param {Object3D} scene - A scene or any other type of 3D object.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\t_viewMatrix.copy( camera.matrixWorldInverse );\n\t\t\t_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );\n\n\t\t\trenderObject( scene, scene, camera );\n\t\t\tif ( this.sortObjects ) zOrder( scene );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the renderer to the given width and height.\n\t\t *\n\t\t * @param {number} width - The width of the renderer.\n\t\t * @param {number} height - The height of the renderer.\n\t\t */\n\t\tthis.setSize = function ( width, height ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_widthHalf = _width / 2;\n\t\t\t_heightHalf = _height / 2;\n\n\t\t\tdomElement.style.width = width + 'px';\n\t\t\tdomElement.style.height = height + 'px';\n\n\t\t};\n\n\t\tfunction hideObject( object ) {\n\n\t\t\tif ( object.isCSS2DObject ) object.element.style.display = 'none';\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\thideObject( object.children[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera ) {\n\n\t\t\tif ( object.visible === false ) {\n\n\t\t\t\thideObject( object );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( object.isCSS2DObject ) {\n\n\t\t\t\t_vector.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t_vector.applyMatrix4( _viewProjectionMatrix );\n\n\t\t\t\tconst visible = ( _vector.z >= - 1 && _vector.z <= 1 ) && ( object.layers.test( camera.layers ) === true );\n\n\t\t\t\tconst element = object.element;\n\t\t\t\telement.style.display = visible === true ? '' : 'none';\n\n\t\t\t\tif ( visible === true ) {\n\n\t\t\t\t\tobject.onBeforeRender( _this, scene, camera );\n\n\t\t\t\t\telement.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' + 'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.onAfterRender( _this, scene, camera );\n\n\t\t\t\t}\n\n\t\t\t\tconst objectData = {\n\t\t\t\t\tdistanceToCameraSquared: getDistanceToSquared( camera, object )\n\t\t\t\t};\n\n\t\t\t\tcache.objects.set( object, objectData );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( object.children[ i ], scene, camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getDistanceToSquared( object1, object2 ) {\n\n\t\t\t_a.setFromMatrixPosition( object1.matrixWorld );\n\t\t\t_b.setFromMatrixPosition( object2.matrixWorld );\n\n\t\t\treturn _a.distanceToSquared( _b );\n\n\t\t}\n\n\t\tfunction filterAndFlatten( scene ) {\n\n\t\t\tconst result = [];\n\n\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isCSS2DObject ) result.push( object );\n\n\t\t\t} );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t\tfunction zOrder( scene ) {\n\n\t\t\tconst sorted = filterAndFlatten( scene ).sort( function ( a, b ) {\n\n\t\t\t\tif ( a.renderOrder !== b.renderOrder ) {\n\n\t\t\t\t\treturn b.renderOrder - a.renderOrder;\n\n\t\t\t\t}\n\n\t\t\t\tconst distanceA = cache.objects.get( a ).distanceToCameraSquared;\n\t\t\t\tconst distanceB = cache.objects.get( b ).distanceToCameraSquared;\n\n\t\t\t\treturn distanceA - distanceB;\n\n\t\t\t} );\n\n\t\t\tconst zMax = sorted.length;\n\n\t\t\tfor ( let i = 0, l = sorted.length; i < l; i ++ ) {\n\n\t\t\t\tsorted[ i ].element.style.zIndex = zMax - i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Constructor parameters of `CSS2DRenderer`.\n *\n * @typedef {Object} CSS2DRenderer~Parameters\n * @property {HTMLElement} [element] - A DOM element where the renderer appends its child-elements.\n * If not passed in here, a new div element will be created.\n **/\n\nexport { CSS2DObject, CSS2DRenderer };\n","import inject from '../../../common-core/src/di/inject';\nimport AsyncGuard from '../../../common-core/src/async-guard';\nimport type { Object3D } from 'three';\nimport { Group, type Scene } from 'three';\nimport { Box3 } from 'three';\nimport {\n BufferAttribute,\n BufferGeometry,\n Line,\n Line3,\n LineBasicMaterial,\n Vector3,\n} from 'three';\nimport { type KernelCube } from '../../../typings/kernel';\nimport { convertToTHREE } from '../../../common-core/src/utils/kernel-utils';\nimport type UnitFormatter from '../services/unit-formatter';\nimport { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\n\nexport const DIMENSIONING_GEOMETRY = 'dimensioning';\nexport const DIMENSION_LINE_OFFSET = 0.08;\nexport const MIN_CAMERA_DISTANCE_RATIO = 1.2;\nexport const FADE_DISTANCE_RATIO = 2.0;\nexport const EXTENSION_LINE_LENGTH_RATIO = 0.03;\n\nexport interface DimensionLineConfig {\n mainLine: Line3;\n extensionLines: Line3[];\n}\n\nconst LINE_COLOR = 0x373737;\n\nexport function createDimensioningHelper(creator: string): DimensioningHelper {\n return new DimensioningHelper(creator);\n}\n\nexport default class DimensioningHelper {\n public _creator_: string;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n private _object: Object3D;\n private _cameraPosition: Vector3 = new Vector3();\n private _onVisibilityChange: (visible: boolean) => void;\n private _initialized: AsyncGuard<void> = new AsyncGuard();\n\n private _origin: Vector3;\n private _dimensions: Vector3;\n\n private _lineMaterial: LineBasicMaterial;\n private readonly _mainLineMaterial: LineBasicMaterial;\n\n private readonly _widthLineGroup: Group;\n private readonly _heightLineGroup: Group;\n private readonly _depthLineGroup: Group;\n\n private _enabled: boolean = false;\n private _dimensionsVisible = false;\n\n private _dimensionLineGroup = new Group();\n\n constructor(creator: string) {\n this._creator_ = creator;\n\n this._lineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 2,\n });\n\n this._mainLineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 0.001,\n transparent: true,\n opacity: 1.0,\n });\n\n this._dimensionLineGroup.name = DIMENSIONING_GEOMETRY;\n\n this._widthLineGroup = this._createLineGroup('width');\n this._heightLineGroup = this._createLineGroup('height');\n this._depthLineGroup = this._createLineGroup('depth');\n\n this._dimensionLineGroup.add(this._widthLineGroup);\n this._dimensionLineGroup.add(this._heightLineGroup);\n this._dimensionLineGroup.add(this._depthLineGroup);\n\n this.update(false);\n this._initialized.resolve();\n }\n\n private _createLineGroup(_name: string): Group {\n const group = new Group();\n group.name = DIMENSIONING_GEOMETRY;\n group.userData.ignoreComponentRaycast = true;\n return group;\n }\n\n private _createLineFromConfig(\n config: Line3,\n material: LineBasicMaterial,\n ): Line {\n const geometry = new BufferGeometry();\n const vertices = [\n config.start.x,\n config.start.y,\n config.start.z,\n config.end.x,\n config.end.y,\n config.end.z,\n ];\n geometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n const line = new Line(geometry, material);\n line.name = DIMENSIONING_GEOMETRY;\n line.userData.ignoreComponentRaycast = true;\n line.layers.set(LAYER.DIMENSIONS);\n return line;\n }\n\n private addLinesToLineGroup(\n group: Group,\n config: DimensionLineConfig,\n mainMaterial: LineBasicMaterial,\n extMaterial: LineBasicMaterial,\n ) {\n config.extensionLines.forEach((extLine) => {\n group.add(this._createLineFromConfig(extLine, extMaterial));\n });\n\n group.add(this._createLineFromConfig(config.mainLine, mainMaterial));\n }\n\n private clearLineGroup(group: Group) {\n while (group.children.length > 0) {\n const child = group.children[0];\n if (child instanceof Line) {\n child.geometry.dispose();\n }\n group.remove(child);\n }\n }\n\n private addLabelToLineGroup(\n group: Group,\n labelText: string,\n labelWorldPosition: Vector3,\n ): void {\n const labelHtmlDiv = document.createElement('div');\n labelHtmlDiv.classList.add(\n 'dimension-label',\n 'dimension-label--primary',\n 'dimension-label--disabled',\n );\n const labelHtmlSpan = document.createElement('span');\n labelHtmlSpan.classList.add('dimension-label__value');\n labelHtmlSpan.innerHTML = labelText;\n labelHtmlDiv.appendChild(labelHtmlSpan);\n\n const labelObject = new CSS2DObject(labelHtmlDiv);\n const labelLocalPosition =\n this._dimensionLineGroup.worldToLocal(labelWorldPosition);\n labelObject.position.copy(labelLocalPosition);\n\n group.add(labelObject);\n }\n\n private _getWidthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = this._dimensions.y + offset;\n const localCam = this._getLocalCameraPosition();\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(0, y, z),\n new Vector3(this._dimensions.x, y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(0, y - extLength, z),\n new Vector3(0, y + extLength, z),\n ),\n new Line3(\n new Vector3(this._dimensions.x, y - extLength, z),\n new Vector3(this._dimensions.x, y + extLength, z),\n ),\n ],\n };\n }\n\n private _getDepthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = 0;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n\n return {\n mainLine: new Line3(\n new Vector3(x, y, this._dimensions.z),\n new Vector3(x, y, 0),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, y, 0),\n new Vector3(x + extLength, y, 0),\n ),\n new Line3(\n new Vector3(x - extLength, y, this._dimensions.z),\n new Vector3(x + extLength, y, this._dimensions.z),\n ),\n ],\n };\n }\n\n private _getHeightLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(x, 0, z),\n new Vector3(x, this._dimensions.y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, 0, z),\n new Vector3(x + extLength, 0, z),\n ),\n new Line3(\n new Vector3(x - extLength, this._dimensions.y, z),\n new Vector3(x + extLength, this._dimensions.y, z),\n ),\n ],\n };\n }\n\n private _getLocalCameraPosition(): Vector3 {\n if (\n !this._cameraPosition ||\n !this._dimensionLineGroup ||\n !this._dimensions\n ) {\n return new Vector3(0, 0, 0);\n }\n return this._dimensionLineGroup.worldToLocal(this._cameraPosition.clone());\n }\n\n private _getCameraDistanceInfo(): {\n tooClose: boolean;\n opacity: number;\n distance: number;\n } {\n if (!this._object || !this._cameraPosition || !this._dimensions) {\n return { tooClose: false, opacity: 1.0, distance: Infinity };\n }\n const objPos = this._object.getWorldPosition(new Vector3());\n const distance = this._cameraPosition.distanceTo(objPos);\n const objectRadius =\n Math.max(this._dimensions.x, this._dimensions.y, this._dimensions.z) / 2;\n const minThreshold = objectRadius * MIN_CAMERA_DISTANCE_RATIO;\n const fadeThreshold = objectRadius * FADE_DISTANCE_RATIO;\n\n if (distance < minThreshold) {\n return { tooClose: true, opacity: 0, distance };\n }\n if (distance < fadeThreshold) {\n const opacity =\n (distance - minThreshold) / (fadeThreshold - minThreshold);\n return {\n tooClose: false,\n opacity: Math.max(0, Math.min(1, opacity)),\n distance,\n };\n }\n return { tooClose: false, opacity: 1.0, distance };\n }\n\n private _visibilityChangedCallback() {\n if (this._onVisibilityChange) {\n this._onVisibilityChange(this._dimensionsVisible);\n }\n }\n\n public update(force: boolean = false) {\n if (this._enabled && !this._dimensionsVisible) {\n this._dimensionsVisible = true;\n this._visibilityChangedCallback();\n }\n this._performUpdate(force);\n }\n\n public updateSize(boxForMeasurement: KernelCube) {\n this._origin = convertToTHREE(boxForMeasurement.origin);\n this._dimensionLineGroup.position.x =\n this._origin.x - this._object.position.x;\n this._dimensionLineGroup.position.y =\n this._origin.y - this._object.position.y;\n this._dimensionLineGroup.position.z =\n this._origin.z - this._object.position.z;\n this._dimensions = convertToTHREE(boxForMeasurement.size);\n this.update();\n }\n\n public removeFromObject(object: Object3D) {\n if (object) {\n object.remove(this._dimensionLineGroup);\n }\n }\n\n public onDimensionsVisibilityChanged(handler: (visible: boolean) => void) {\n this._onVisibilityChange = handler;\n }\n\n public setObject(object: Object3D): void {\n this._object = object;\n }\n\n public isInitialized(): Promise<void> {\n return this._initialized.wait();\n }\n\n public areDimensionsEnabled(): boolean {\n return this._enabled;\n }\n\n public clearScene(_scene: Scene): void {\n this._clear();\n }\n\n public addToObject(object: Object3D): void {\n if (!object || !this._dimensionLineGroup) {\n return;\n }\n object.add(this._dimensionLineGroup);\n }\n\n public enableDimensions(): void {\n this._enabled = true;\n this.addToObject(this._object);\n this.update(true);\n }\n\n public disableDimensions(): void {\n this._enabled = false;\n if (this._dimensionsVisible) {\n this._dimensionsVisible = false;\n this._visibilityChangedCallback();\n }\n this._clear();\n this.removeFromObject(this._object);\n }\n\n public enableTopDimensions(): void {\n this.enableDimensions();\n this._heightLineGroup.visible = false;\n this.update(true);\n }\n\n public disableTopDimensions(): void {\n this._heightLineGroup.visible = true;\n this.disableDimensions();\n }\n\n public getBoundingBox(): Box3 {\n const bbox = new Box3();\n bbox.expandByObject(this._dimensionLineGroup);\n return bbox;\n }\n\n public moveCameraStart(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n public moveCameraEnd(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n private _performUpdate(force: boolean): void {\n if (!this._enabled && !force) {\n return;\n }\n if (!this._dimensions) {\n return;\n }\n\n let opacity = 1.0;\n\n if (\n this._object &&\n this._cameraPosition &&\n !this._cameraPosition.equals(new Vector3(0, 0, 0))\n ) {\n const distanceCheck = this._getCameraDistanceInfo();\n if (distanceCheck.tooClose) {\n this._dimensionLineGroup.visible = false;\n } else {\n this._dimensionLineGroup.visible = true;\n opacity = distanceCheck.opacity;\n this._mainLineMaterial.opacity = opacity;\n }\n }\n\n this._dimensionLineGroup.updateMatrixWorld(true);\n\n const widthConfig = this._getWidthLineConfig();\n const widthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.x * 1000,\n );\n const widthPos = this._dimensionLineGroup.localToWorld(\n widthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._widthLineGroup);\n this.addLinesToLineGroup(\n this._widthLineGroup,\n widthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (widthLabelText !== null) {\n this.addLabelToLineGroup(this._widthLineGroup, widthLabelText, widthPos);\n }\n\n const heightConfig = this._getHeightLineConfig();\n const heightLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.y * 1000,\n );\n const heightPos = this._dimensionLineGroup.localToWorld(\n heightConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._heightLineGroup);\n this.addLinesToLineGroup(\n this._heightLineGroup,\n heightConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (heightLabelText !== null) {\n this.addLabelToLineGroup(\n this._heightLineGroup,\n heightLabelText,\n heightPos,\n );\n }\n\n const depthConfig = this._getDepthLineConfig();\n const depthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.z * -1000,\n );\n const depthPos = this._dimensionLineGroup.localToWorld(\n depthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._depthLineGroup);\n this.addLinesToLineGroup(\n this._depthLineGroup,\n depthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (depthLabelText !== null) {\n this.addLabelToLineGroup(this._depthLineGroup, depthLabelText, depthPos);\n }\n }\n\n private _clear(): void {\n this._lineMaterial.dispose();\n this._mainLineMaterial.dispose();\n [this._widthLineGroup, this._heightLineGroup, this._depthLineGroup].forEach(\n (group) => {\n this.clearLineGroup(group);\n },\n );\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;AAAA,IAAqB,IAArB,MAAmC;CAMjC,YAAY,GAAY;AAEtB,EADA,KAAK,OAAO,GACZ,KAAK,OAAO;;CAGd,QAAgB;AACd,OAAK,WAAW,IAAI,SAAY,GAAS,MAAW;AAElD,GADA,KAAK,WAAW,GAChB,KAAK,UAAU;IACf;;CAGJ,QAAe,GAAmB;AAIhC,EAHI,KACF,KAAK,SAAS,EAAM,EAEtB,KAAK,UAAU;;CAGjB,OAAc,GAAgB;AAC5B,OAAK,QAAQ,EAAE;;CAGjB,OAA0B;AACxB,SAAO,KAAK;;CAGd,QAAe;AACb,OAAK,OAAO;;GCrBV,IAAN,cAA0B,EAAS;CAOlC,YAAa,IAAU,SAAS,cAAe,MAAO,EAAG;AAoCxD,EAlCA,OAAO,EASP,KAAK,gBAAgB,IASrB,KAAK,UAAU,GAEf,KAAK,QAAQ,MAAM,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I,GAAS,CAAC,CAC/C;AAQD,EAPA,KAAK,eAAe,KAAK,iBAAiB,EAC1C,KAAK,oBACH,KAAK,kBACL,GACA,KAAK,mBACL,KAAK,kBACN,EACG,MAAoB,QACtB,KAAK,oBACH,KAAK,kBACL,GACA,EACD;EAGH,IAAM,IAAc,KAAK,qBAAqB,EACxC,IAAiB,KAAK,eAAe,0BACzC,KAAK,YAAY,IAAI,KACtB,EACK,IAAW,KAAK,oBAAoB,aACxC,EAAY,SAAS,UAAU,IAAI,GAAS,CAAC,CAC9C;AAQD,EAPA,KAAK,eAAe,KAAK,gBAAgB,EACzC,KAAK,oBACH,KAAK,iBACL,GACA,KAAK,mBACL,KAAK,kBACN,EACG,MAAmB,QACrB,KAAK,oBAAoB,KAAK,iBAAiB,GAAgB,EAAS;;CAI5E,SAAuB;AAGrB,EAFA,KAAK,cAAc,SAAS,EAC5B,KAAK,kBAAkB,SAAS,EAChC;GAAC,KAAK;GAAiB,KAAK;GAAkB,KAAK;GAAgB,CAAC,SACjE,MAAU;AACT,QAAK,eAAe,EAAM;IAE7B;;;GA/bF,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-GPn7Z8GE.mjs","names":[],"sources":["../../packages/common-core/src/async-guard.ts","../../../../node_modules/three/examples/jsm/renderers/CSS2DRenderer.js","../../packages/configurator-core/src/utils/dimensioning-helper.ts"],"sourcesContent":["export default class AsyncGuard<T> {\n public info: any;\n private _promise: Promise<T>;\n private _resolve: (value?: T | PromiseLike<T>) => void;\n private _reject: (error: Error) => void;\n\n constructor(info?: any) {\n this.info = info;\n this._init();\n }\n\n private _init() {\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n public resolve(value?: any): void {\n if (value) {\n this._resolve(value);\n }\n this._resolve();\n }\n\n public reject(e: Error): void {\n this._reject(e);\n }\n\n public wait(): Promise<T> {\n return this._promise;\n }\n\n public reset() {\n this._init();\n }\n}\n","import {\n\tMatrix4,\n\tObject3D,\n\tVector2,\n\tVector3\n} from 'three';\n\n/**\n * The only type of 3D object that is supported by {@link CSS2DRenderer}.\n *\n * @augments Object3D\n * @three_import import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DObject extends Object3D {\n\n\t/**\n\t * Constructs a new CSS2D object.\n\t *\n\t * @param {HTMLElement} [element] - The DOM element.\n\t */\n\tconstructor( element = document.createElement( 'div' ) ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isCSS2DObject = true;\n\n\t\t/**\n\t\t * The DOM element which defines the appearance of this 3D object.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.element = element;\n\n\t\tthis.element.style.position = 'absolute';\n\t\tthis.element.style.userSelect = 'none';\n\n\t\tthis.element.setAttribute( 'draggable', false );\n\n\t\t/**\n\t\t * The 3D objects center point.\n\t\t * `( 0, 0 )` is the lower left, `( 1, 1 )` is the top right.\n\t\t *\n\t\t * @type {Vector2}\n\t\t * @default (0.5,0.5)\n\t\t */\n\t\tthis.center = new Vector2( 0.5, 0.5 );\n\n\t\tthis.addEventListener( 'removed', function () {\n\n\t\t\tthis.traverse( function ( object ) {\n\n\t\t\t\tif (\n\t\t\t\t\tobject.element &&\n\t\t\t\t\tobject.element instanceof object.element.ownerDocument.defaultView.Element &&\n\t\t\t\t\tobject.element.parentNode !== null\n\t\t\t\t) {\n\n\t\t\t\t\tobject.element.remove();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.element = source.element.cloneNode( true );\n\n\t\tthis.center = source.center;\n\n\t\treturn this;\n\n\t}\n\n}\n\n//\n\nconst _vector = new Vector3();\nconst _viewMatrix = new Matrix4();\nconst _viewProjectionMatrix = new Matrix4();\nconst _a = new Vector3();\nconst _b = new Vector3();\n\n/**\n * This renderer is a simplified version of {@link CSS3DRenderer}. The only transformation that is\n * supported is translation.\n *\n * The renderer is very useful if you want to combine HTML based labels with 3D objects. Here too,\n * the respective DOM elements are wrapped into an instance of {@link CSS2DObject} and added to the\n * scene graph. All other types of renderable 3D objects (like meshes or point clouds) are ignored.\n *\n * `CSS2DRenderer` only supports 100% browser and display zoom.\n *\n * @three_import import { CSS2DRenderer } from 'three/addons/renderers/CSS2DRenderer.js';\n */\nclass CSS2DRenderer {\n\n\t/**\n\t * Constructs a new CSS2D renderer.\n\t *\n\t * @param {CSS2DRenderer~Parameters} [parameters] - The parameters.\n\t */\n\tconstructor( parameters = {} ) {\n\n\t\tconst _this = this;\n\n\t\tlet _width, _height;\n\t\tlet _widthHalf, _heightHalf;\n\n\t\tconst cache = {\n\t\t\tobjects: new WeakMap()\n\t\t};\n\n\t\tconst domElement = parameters.element !== undefined ? parameters.element : document.createElement( 'div' );\n\n\t\tdomElement.style.overflow = 'hidden';\n\n\t\t/**\n\t\t * The DOM where the renderer appends its child-elements.\n\t\t *\n\t\t * @type {HTMLElement}\n\t\t */\n\t\tthis.domElement = domElement;\n\n\t\t/**\n\t\t * Controls whether the renderer assigns `z-index` values to CSS2DObject DOM elements.\n\t\t * If set to `true`, z-index values are assigned first based on the `renderOrder`\n\t\t * and secondly - the distance to the camera. If set to `false`, no z-index values are assigned.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.sortObjects = true;\n\n\t\t/**\n\t\t * Returns an object containing the width and height of the renderer.\n\t\t *\n\t\t * @return {{width:number,height:number}} The size of the renderer.\n\t\t */\n\t\tthis.getSize = function () {\n\n\t\t\treturn {\n\t\t\t\twidth: _width,\n\t\t\t\theight: _height\n\t\t\t};\n\n\t\t};\n\n\t\t/**\n\t\t * Renders the given scene using the given camera.\n\t\t *\n\t\t * @param {Object3D} scene - A scene or any other type of 3D object.\n\t\t * @param {Camera} camera - The camera.\n\t\t */\n\t\tthis.render = function ( scene, camera ) {\n\n\t\t\tif ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();\n\t\t\tif ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld();\n\n\t\t\t_viewMatrix.copy( camera.matrixWorldInverse );\n\t\t\t_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );\n\n\t\t\trenderObject( scene, scene, camera );\n\t\t\tif ( this.sortObjects ) zOrder( scene );\n\n\t\t};\n\n\t\t/**\n\t\t * Resizes the renderer to the given width and height.\n\t\t *\n\t\t * @param {number} width - The width of the renderer.\n\t\t * @param {number} height - The height of the renderer.\n\t\t */\n\t\tthis.setSize = function ( width, height ) {\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\n\t\t\t_widthHalf = _width / 2;\n\t\t\t_heightHalf = _height / 2;\n\n\t\t\tdomElement.style.width = width + 'px';\n\t\t\tdomElement.style.height = height + 'px';\n\n\t\t};\n\n\t\tfunction hideObject( object ) {\n\n\t\t\tif ( object.isCSS2DObject ) object.element.style.display = 'none';\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\thideObject( object.children[ i ] );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction renderObject( object, scene, camera ) {\n\n\t\t\tif ( object.visible === false ) {\n\n\t\t\t\thideObject( object );\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( object.isCSS2DObject ) {\n\n\t\t\t\t_vector.setFromMatrixPosition( object.matrixWorld );\n\t\t\t\t_vector.applyMatrix4( _viewProjectionMatrix );\n\n\t\t\t\tconst visible = ( _vector.z >= - 1 && _vector.z <= 1 ) && ( object.layers.test( camera.layers ) === true );\n\n\t\t\t\tconst element = object.element;\n\t\t\t\telement.style.display = visible === true ? '' : 'none';\n\n\t\t\t\tif ( visible === true ) {\n\n\t\t\t\t\tobject.onBeforeRender( _this, scene, camera );\n\n\t\t\t\t\telement.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' + 'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';\n\n\t\t\t\t\tif ( element.parentNode !== domElement ) {\n\n\t\t\t\t\t\tdomElement.appendChild( element );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.onAfterRender( _this, scene, camera );\n\n\t\t\t\t}\n\n\t\t\t\tconst objectData = {\n\t\t\t\t\tdistanceToCameraSquared: getDistanceToSquared( camera, object )\n\t\t\t\t};\n\n\t\t\t\tcache.objects.set( object, objectData );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\t\t\trenderObject( object.children[ i ], scene, camera );\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getDistanceToSquared( object1, object2 ) {\n\n\t\t\t_a.setFromMatrixPosition( object1.matrixWorld );\n\t\t\t_b.setFromMatrixPosition( object2.matrixWorld );\n\n\t\t\treturn _a.distanceToSquared( _b );\n\n\t\t}\n\n\t\tfunction filterAndFlatten( scene ) {\n\n\t\t\tconst result = [];\n\n\t\t\tscene.traverseVisible( function ( object ) {\n\n\t\t\t\tif ( object.isCSS2DObject ) result.push( object );\n\n\t\t\t} );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t\tfunction zOrder( scene ) {\n\n\t\t\tconst sorted = filterAndFlatten( scene ).sort( function ( a, b ) {\n\n\t\t\t\tif ( a.renderOrder !== b.renderOrder ) {\n\n\t\t\t\t\treturn b.renderOrder - a.renderOrder;\n\n\t\t\t\t}\n\n\t\t\t\tconst distanceA = cache.objects.get( a ).distanceToCameraSquared;\n\t\t\t\tconst distanceB = cache.objects.get( b ).distanceToCameraSquared;\n\n\t\t\t\treturn distanceA - distanceB;\n\n\t\t\t} );\n\n\t\t\tconst zMax = sorted.length;\n\n\t\t\tfor ( let i = 0, l = sorted.length; i < l; i ++ ) {\n\n\t\t\t\tsorted[ i ].element.style.zIndex = zMax - i;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\n/**\n * Constructor parameters of `CSS2DRenderer`.\n *\n * @typedef {Object} CSS2DRenderer~Parameters\n * @property {HTMLElement} [element] - A DOM element where the renderer appends its child-elements.\n * If not passed in here, a new div element will be created.\n **/\n\nexport { CSS2DObject, CSS2DRenderer };\n","import inject from '../../../common-core/src/di/inject';\nimport AsyncGuard from '../../../common-core/src/async-guard';\nimport type { Object3D } from 'three';\nimport { Group, type Scene } from 'three';\nimport { Box3 } from 'three';\nimport {\n BufferAttribute,\n BufferGeometry,\n Line,\n Line3,\n LineBasicMaterial,\n Vector3,\n} from 'three';\nimport { type KernelCube } from '../../../typings/kernel';\nimport { convertToTHREE } from '../../../common-core/src/utils/kernel-utils';\nimport type UnitFormatter from '../services/unit-formatter';\nimport { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';\nimport { LAYER } from '../../../common-core/src/webgl/layer';\n\nexport const DIMENSIONING_GEOMETRY = 'dimensioning';\nexport const DIMENSION_LINE_OFFSET = 0.08;\nexport const MIN_CAMERA_DISTANCE_RATIO = 1.2;\nexport const FADE_DISTANCE_RATIO = 2.0;\nexport const EXTENSION_LINE_LENGTH_RATIO = 0.03;\n\nexport interface DimensionLineConfig {\n mainLine: Line3;\n extensionLines: Line3[];\n}\n\nconst LINE_COLOR = 0x373737;\n\nexport function createDimensioningHelper(creator: string): DimensioningHelper {\n return new DimensioningHelper(creator);\n}\n\nexport default class DimensioningHelper {\n public _creator_: string;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n private _object: Object3D;\n private _cameraPosition: Vector3 = new Vector3();\n private _onVisibilityChange: (visible: boolean) => void;\n private _initialized: AsyncGuard<void> = new AsyncGuard();\n\n private _origin: Vector3;\n private _dimensions: Vector3;\n\n private _lineMaterial: LineBasicMaterial;\n private readonly _mainLineMaterial: LineBasicMaterial;\n\n private readonly _widthLineGroup: Group;\n private readonly _heightLineGroup: Group;\n private readonly _depthLineGroup: Group;\n\n private _enabled: boolean = false;\n private _dimensionsVisible = false;\n\n private _dimensionLineGroup = new Group();\n\n constructor(creator: string) {\n this._creator_ = creator;\n\n this._lineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 2,\n });\n\n this._mainLineMaterial = new LineBasicMaterial({\n color: LINE_COLOR,\n linewidth: 0.001,\n transparent: true,\n opacity: 1.0,\n });\n\n this._dimensionLineGroup.name = DIMENSIONING_GEOMETRY;\n\n this._widthLineGroup = this._createLineGroup('width');\n this._heightLineGroup = this._createLineGroup('height');\n this._depthLineGroup = this._createLineGroup('depth');\n\n this._dimensionLineGroup.add(this._widthLineGroup);\n this._dimensionLineGroup.add(this._heightLineGroup);\n this._dimensionLineGroup.add(this._depthLineGroup);\n\n this.update(false);\n this._initialized.resolve();\n }\n\n private _createLineGroup(_name: string): Group {\n const group = new Group();\n group.name = DIMENSIONING_GEOMETRY;\n group.userData.ignoreComponentRaycast = true;\n return group;\n }\n\n private _createLineFromConfig(\n config: Line3,\n material: LineBasicMaterial,\n ): Line {\n const geometry = new BufferGeometry();\n const vertices = [\n config.start.x,\n config.start.y,\n config.start.z,\n config.end.x,\n config.end.y,\n config.end.z,\n ];\n geometry.setAttribute(\n 'position',\n new BufferAttribute(new Float32Array(vertices), 3),\n );\n const line = new Line(geometry, material);\n line.name = DIMENSIONING_GEOMETRY;\n line.userData.ignoreComponentRaycast = true;\n line.layers.set(LAYER.DIMENSIONS);\n return line;\n }\n\n private addLinesToLineGroup(\n group: Group,\n config: DimensionLineConfig,\n mainMaterial: LineBasicMaterial,\n extMaterial: LineBasicMaterial,\n ) {\n config.extensionLines.forEach((extLine) => {\n group.add(this._createLineFromConfig(extLine, extMaterial));\n });\n\n group.add(this._createLineFromConfig(config.mainLine, mainMaterial));\n }\n\n private clearLineGroup(group: Group) {\n while (group.children.length > 0) {\n const child = group.children[0];\n if (child instanceof Line) {\n child.geometry.dispose();\n }\n group.remove(child);\n }\n }\n\n private addLabelToLineGroup(\n group: Group,\n labelText: string,\n labelWorldPosition: Vector3,\n ): void {\n const labelHtmlDiv = document.createElement('div');\n labelHtmlDiv.classList.add(\n 'dimension-label',\n 'dimension-label--primary',\n 'dimension-label--disabled',\n );\n const labelHtmlSpan = document.createElement('span');\n labelHtmlSpan.classList.add('dimension-label__value');\n labelHtmlSpan.innerHTML = labelText;\n labelHtmlDiv.appendChild(labelHtmlSpan);\n\n const labelObject = new CSS2DObject(labelHtmlDiv);\n const labelLocalPosition =\n this._dimensionLineGroup.worldToLocal(labelWorldPosition);\n labelObject.position.copy(labelLocalPosition);\n\n group.add(labelObject);\n }\n\n private _getWidthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = this._dimensions.y + offset;\n const localCam = this._getLocalCameraPosition();\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(0, y, z),\n new Vector3(this._dimensions.x, y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(0, y - extLength, z),\n new Vector3(0, y + extLength, z),\n ),\n new Line3(\n new Vector3(this._dimensions.x, y - extLength, z),\n new Vector3(this._dimensions.x, y + extLength, z),\n ),\n ],\n };\n }\n\n private _getDepthLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const y = 0;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n\n return {\n mainLine: new Line3(\n new Vector3(x, y, this._dimensions.z),\n new Vector3(x, y, 0),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, y, 0),\n new Vector3(x + extLength, y, 0),\n ),\n new Line3(\n new Vector3(x - extLength, y, this._dimensions.z),\n new Vector3(x + extLength, y, this._dimensions.z),\n ),\n ],\n };\n }\n\n private _getHeightLineConfig(): DimensionLineConfig {\n const offset = DIMENSION_LINE_OFFSET;\n const extLength = EXTENSION_LINE_LENGTH_RATIO;\n const localCam = this._getLocalCameraPosition();\n const x =\n localCam.x < this._dimensions.x / 2\n ? -offset\n : this._dimensions.x + offset;\n const z = localCam.z < this._dimensions.z / 2 ? 0 : this._dimensions.z;\n\n return {\n mainLine: new Line3(\n new Vector3(x, 0, z),\n new Vector3(x, this._dimensions.y, z),\n ),\n extensionLines: [\n new Line3(\n new Vector3(x - extLength, 0, z),\n new Vector3(x + extLength, 0, z),\n ),\n new Line3(\n new Vector3(x - extLength, this._dimensions.y, z),\n new Vector3(x + extLength, this._dimensions.y, z),\n ),\n ],\n };\n }\n\n private _getLocalCameraPosition(): Vector3 {\n if (\n !this._cameraPosition ||\n !this._dimensionLineGroup ||\n !this._dimensions\n ) {\n return new Vector3(0, 0, 0);\n }\n return this._dimensionLineGroup.worldToLocal(this._cameraPosition.clone());\n }\n\n private _getCameraDistanceInfo(): {\n tooClose: boolean;\n opacity: number;\n distance: number;\n } {\n if (!this._object || !this._cameraPosition || !this._dimensions) {\n return { tooClose: false, opacity: 1.0, distance: Infinity };\n }\n const objPos = this._object.getWorldPosition(new Vector3());\n const distance = this._cameraPosition.distanceTo(objPos);\n const objectRadius =\n Math.max(this._dimensions.x, this._dimensions.y, this._dimensions.z) / 2;\n const minThreshold = objectRadius * MIN_CAMERA_DISTANCE_RATIO;\n const fadeThreshold = objectRadius * FADE_DISTANCE_RATIO;\n\n if (distance < minThreshold) {\n return { tooClose: true, opacity: 0, distance };\n }\n if (distance < fadeThreshold) {\n const opacity =\n (distance - minThreshold) / (fadeThreshold - minThreshold);\n return {\n tooClose: false,\n opacity: Math.max(0, Math.min(1, opacity)),\n distance,\n };\n }\n return { tooClose: false, opacity: 1.0, distance };\n }\n\n private _visibilityChangedCallback() {\n if (this._onVisibilityChange) {\n this._onVisibilityChange(this._dimensionsVisible);\n }\n }\n\n public update(force: boolean = false) {\n if (this._enabled && !this._dimensionsVisible) {\n this._dimensionsVisible = true;\n this._visibilityChangedCallback();\n }\n this._performUpdate(force);\n }\n\n public updateSize(boxForMeasurement: KernelCube) {\n this._origin = convertToTHREE(boxForMeasurement.origin);\n this._dimensionLineGroup.position.x =\n this._origin.x - this._object.position.x;\n this._dimensionLineGroup.position.y =\n this._origin.y - this._object.position.y;\n this._dimensionLineGroup.position.z =\n this._origin.z - this._object.position.z;\n this._dimensions = convertToTHREE(boxForMeasurement.size);\n this.update();\n }\n\n public removeFromObject(object: Object3D) {\n if (object) {\n object.remove(this._dimensionLineGroup);\n }\n }\n\n public onDimensionsVisibilityChanged(handler: (visible: boolean) => void) {\n this._onVisibilityChange = handler;\n }\n\n public setObject(object: Object3D): void {\n this._object = object;\n }\n\n public isInitialized(): Promise<void> {\n return this._initialized.wait();\n }\n\n public areDimensionsEnabled(): boolean {\n return this._enabled;\n }\n\n public clearScene(_scene: Scene): void {\n this._clear();\n }\n\n public addToObject(object: Object3D): void {\n if (!object || !this._dimensionLineGroup) {\n return;\n }\n object.add(this._dimensionLineGroup);\n }\n\n public enableDimensions(): void {\n this._enabled = true;\n this.addToObject(this._object);\n this.update(true);\n }\n\n public disableDimensions(): void {\n this._enabled = false;\n if (this._dimensionsVisible) {\n this._dimensionsVisible = false;\n this._visibilityChangedCallback();\n }\n this._clear();\n this.removeFromObject(this._object);\n }\n\n public enableTopDimensions(): void {\n this.enableDimensions();\n this._heightLineGroup.visible = false;\n this.update(true);\n }\n\n public disableTopDimensions(): void {\n this._heightLineGroup.visible = true;\n this.disableDimensions();\n }\n\n public getBoundingBox(): Box3 {\n const bbox = new Box3();\n bbox.expandByObject(this._dimensionLineGroup);\n return bbox;\n }\n\n public moveCameraStart(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n public moveCameraEnd(position: Vector3): void {\n this._cameraPosition = position;\n this.update();\n }\n\n private _performUpdate(force: boolean): void {\n if (!this._enabled && !force) {\n return;\n }\n if (!this._dimensions) {\n return;\n }\n\n let opacity = 1.0;\n\n if (\n this._object &&\n this._cameraPosition &&\n !this._cameraPosition.equals(new Vector3(0, 0, 0))\n ) {\n const distanceCheck = this._getCameraDistanceInfo();\n if (distanceCheck.tooClose) {\n this._dimensionLineGroup.visible = false;\n } else {\n this._dimensionLineGroup.visible = true;\n opacity = distanceCheck.opacity;\n this._mainLineMaterial.opacity = opacity;\n }\n }\n\n this._dimensionLineGroup.updateMatrixWorld(true);\n\n const widthConfig = this._getWidthLineConfig();\n const widthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.x * 1000,\n );\n const widthPos = this._dimensionLineGroup.localToWorld(\n widthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._widthLineGroup);\n this.addLinesToLineGroup(\n this._widthLineGroup,\n widthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (widthLabelText !== null) {\n this.addLabelToLineGroup(this._widthLineGroup, widthLabelText, widthPos);\n }\n\n const heightConfig = this._getHeightLineConfig();\n const heightLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.y * 1000,\n );\n const heightPos = this._dimensionLineGroup.localToWorld(\n heightConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._heightLineGroup);\n this.addLinesToLineGroup(\n this._heightLineGroup,\n heightConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (heightLabelText !== null) {\n this.addLabelToLineGroup(\n this._heightLineGroup,\n heightLabelText,\n heightPos,\n );\n }\n\n const depthConfig = this._getDepthLineConfig();\n const depthLabelText = this._unitFormatter.formatMMValueToUnitString(\n this._dimensions.z * -1000,\n );\n const depthPos = this._dimensionLineGroup.localToWorld(\n depthConfig.mainLine.getCenter(new Vector3()),\n );\n this.clearLineGroup(this._depthLineGroup);\n this.addLinesToLineGroup(\n this._depthLineGroup,\n depthConfig,\n this._mainLineMaterial,\n this._mainLineMaterial,\n );\n if (depthLabelText !== null) {\n this.addLabelToLineGroup(this._depthLineGroup, depthLabelText, depthPos);\n }\n }\n\n private _clear(): void {\n this._lineMaterial.dispose();\n this._mainLineMaterial.dispose();\n [this._widthLineGroup, this._heightLineGroup, this._depthLineGroup].forEach(\n (group) => {\n this.clearLineGroup(group);\n },\n );\n }\n}\n"],"x_google_ignoreList":[1],"mappings":";;;;;AAAA,IAAqB,IAArB,MAAmC;CAMjC,YAAY,GAAY;AAEtB,EADA,KAAK,OAAO,GACZ,KAAK,OAAO;;CAGd,QAAgB;AACd,OAAK,WAAW,IAAI,SAAY,GAAS,MAAW;AAElD,GADA,KAAK,WAAW,GAChB,KAAK,UAAU;IACf;;CAGJ,QAAe,GAAmB;AAIhC,EAHI,KACF,KAAK,SAAS,EAAM,EAEtB,KAAK,UAAU;;CAGjB,OAAc,GAAgB;AAC5B,OAAK,QAAQ,EAAE;;CAGjB,OAA0B;AACxB,SAAO,KAAK;;CAGd,QAAe;AACb,OAAK,OAAO;;GCrBV,IAAN,cAA0B,EAAS;CAOlC,YAAa,IAAU,SAAS,cAAe,MAAO,EAAG;AAoCxD,EAlCA,OAAO,EASP,KAAK,gBAAgB,IASrB,KAAK,UAAU,GAEf,KAAK,QAAQ,MAAM,WAAW,YAC9B,KAAK,QAAQ,MAAM,aAAa,QAEhC,KAAK,QAAQ,aAAc,aAAa,GAAO,EAS/C,KAAK,SAAS,IAAI,EAAS,IAAK,GAAK,EAErC,KAAK,iBAAkB,WAAW,WAAY;AAE7C,QAAK,SAAU,SAAW,GAAS;AAElC,IACC,EAAO,WACP,EAAO,mBAAmB,EAAO,QAAQ,cAAc,YAAY,WACnE,EAAO,QAAQ,eAAe,QAG9B,EAAO,QAAQ,QAAQ;KAItB;IAED;;CAIJ,KAAM,GAAQ,GAAY;AAQzB,SANA,MAAM,KAAM,GAAQ,EAAW,EAE/B,KAAK,UAAU,EAAO,QAAQ,UAAW,GAAM,EAE/C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K,kBACN,EACG,MAAmB,QACrB,KAAK,oBAAoB,KAAK,iBAAiB,GAAgB,EAAS;;CAI5E,SAAuB;AAGrB,EAFA,KAAK,cAAc,SAAS,EAC5B,KAAK,kBAAkB,SAAS,EAChC;GAAC,KAAK;GAAiB,KAAK;GAAkB,KAAK;GAAgB,CAAC,SACjE,MAAU;AACT,QAAK,eAAe,EAAM;IAE7B;;;GA/bF,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,kBAAA,KAAA,EAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as e, Dn as t, In as n, d as r, n as i, tt as a, xi as o, zr as s } from "./three.core-
|
|
2
|
-
import { r as c } from "./three.module-
|
|
3
|
-
import {
|
|
4
|
-
import { g as
|
|
5
|
-
import {
|
|
6
|
-
import { C as
|
|
7
|
-
import { t as
|
|
1
|
+
import { C as e, Dn as t, In as n, d as r, n as i, tt as a, xi as o, zr as s } from "./three.core-BmQnspOL.mjs";
|
|
2
|
+
import { r as c } from "./three.module-DkrZwaid.mjs";
|
|
3
|
+
import { n as l, r as u, t as d } from "./decorate-Bck1_lG8.mjs";
|
|
4
|
+
import { g as f, v as p } from "./common-utils-DMI8Yuhe.mjs";
|
|
5
|
+
import { h as m } from "./threejs-utils-CrK_gp1x.mjs";
|
|
6
|
+
import { C as h, F as g, S as _, T as v, W as y, X as b, Y as x, Z as S, et as C, f as w, l as T, n as E, nt as D, p as O, r as k, rt as A, t as j, tt as M } from "./main-CJ5TNhBt.mjs";
|
|
7
|
+
import { t as N } from "./script-loader-DqaDm1FG.mjs";
|
|
8
8
|
//#region packages/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.ts
|
|
9
|
-
var
|
|
9
|
+
var P = class extends _ {
|
|
10
10
|
constructor(...e) {
|
|
11
11
|
super(...e), this.shouldIgnoreStandardBehavior = !1;
|
|
12
12
|
}
|
|
@@ -21,7 +21,7 @@ var F = class extends v {
|
|
|
21
21
|
animateCamera(e) {
|
|
22
22
|
return this.shouldIgnoreStandardBehavior ? !0 : super.animateCamera(e);
|
|
23
23
|
}
|
|
24
|
-
},
|
|
24
|
+
}, F = class extends v {
|
|
25
25
|
constructor(t, n) {
|
|
26
26
|
super(t, n), this._params = { ambientLight: { color: "#ffffff" } }, this._ambientLight = new i(new e(this._params.ambientLight.color), .5), this.addToScene();
|
|
27
27
|
}
|
|
@@ -34,24 +34,23 @@ var F = class extends v {
|
|
|
34
34
|
reload() {
|
|
35
35
|
this.removeFromScene(), this.addToScene();
|
|
36
36
|
}
|
|
37
|
-
showGUI() {
|
|
38
|
-
|
|
39
|
-
if (t && this._ambientLight) {
|
|
37
|
+
showGUI(t) {
|
|
38
|
+
if (this._ambientLight) {
|
|
40
39
|
let n = t.addFolder("Ambient Light");
|
|
41
40
|
n.add(this._ambientLight, "visible"), n.add(this._ambientLight, "intensity").min(0).max(5).step(.1), n.addColor(this._params.ambientLight, "color").onChange((t) => {
|
|
42
41
|
this._ambientLight.color = new e(t);
|
|
43
42
|
});
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
|
-
},
|
|
45
|
+
}, I = class extends O {
|
|
47
46
|
constructor(e, t) {
|
|
48
|
-
if (super(e, t,
|
|
49
|
-
let e =
|
|
47
|
+
if (super(e, t, y.GLB, D.CAMERA_3D), this._itemsCount = 0, this._standardSceneBackgroundColor = this._scene.background, this._initData.legacyLight && this._renderer instanceof c) if (this._renderer.capabilities.maxTextures > 8) {
|
|
48
|
+
let e = b.createDynamicLightSettingSource(null, S.CAMERA);
|
|
50
49
|
e && this.loadDynamicLightSetting(e);
|
|
51
|
-
} else console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"), this._lightSetting = new
|
|
50
|
+
} else console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"), this._lightSetting = new F(this._scene);
|
|
52
51
|
}
|
|
53
52
|
createCameraControl(e, t) {
|
|
54
|
-
this._changeCameraBehaviour(new
|
|
53
|
+
this._changeCameraBehaviour(new T(new P(this._creator_, this._getInputManager(), void 0), this._cameraBehaviourState));
|
|
55
54
|
}
|
|
56
55
|
_getInputManager() {
|
|
57
56
|
return this._glbInputManager;
|
|
@@ -59,7 +58,7 @@ var F = class extends v {
|
|
|
59
58
|
async loadStaticItem(e, t) {
|
|
60
59
|
let n = await this._rapiAccess.getItem(e);
|
|
61
60
|
if (n.configuration) return Promise.reject();
|
|
62
|
-
let r =
|
|
61
|
+
let r = p(n);
|
|
63
62
|
return r ? this.loadGLB(r, !0, void 0, t) : Promise.reject(/* @__PURE__ */ Error("GLB Url not detected"));
|
|
64
63
|
}
|
|
65
64
|
loadGLB(e, t = !0, n = new o(1, 1, 1), i) {
|
|
@@ -67,7 +66,7 @@ var F = class extends v {
|
|
|
67
66
|
this._loadGLB(e, new o(0, 0, 0), 0, void 0, n, void 0, void 0, i).then((e) => {
|
|
68
67
|
this._currentGLB = e, this._scene.add(this._currentGLB);
|
|
69
68
|
let n = new r().setFromObject(this._currentGLB);
|
|
70
|
-
t && this.cameraBehaviour.cameraControl instanceof
|
|
69
|
+
t && this.cameraBehaviour.cameraControl instanceof P && this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(n), this._updateBounds(n, void 0, !0), this._readyForRender(), a();
|
|
71
70
|
}, s);
|
|
72
71
|
});
|
|
73
72
|
}
|
|
@@ -76,7 +75,7 @@ var F = class extends v {
|
|
|
76
75
|
e || (e = new c({ antialias: !0 }), e.setSize(n, r), e.outputColorSpace = s, e.autoClear = !1, e.shadowMap.enabled = !0, e.shadowMap.type = 0);
|
|
77
76
|
let o = this.cameraBehaviour.cameraControl.getCamera().clone();
|
|
78
77
|
o instanceof t && (o.aspect = n / r, o.updateProjectionMatrix()), this._lightSetting?.removeFromScene();
|
|
79
|
-
let l = new
|
|
78
|
+
let l = new w(this._scene);
|
|
80
79
|
e.render(this._scene, o);
|
|
81
80
|
let u = e.domElement.toDataURL();
|
|
82
81
|
e.domElement.toBlob((e) => {
|
|
@@ -94,22 +93,22 @@ var F = class extends v {
|
|
|
94
93
|
});
|
|
95
94
|
}
|
|
96
95
|
adjustCamera(e, t, n, i) {
|
|
97
|
-
if (this.cameraBehaviour.cameraControl instanceof
|
|
96
|
+
if (this.cameraBehaviour.cameraControl instanceof P) {
|
|
98
97
|
let a = new r().setFromObject(this._scene).getSize(new o());
|
|
99
98
|
this.cameraBehaviour.cameraControl.adjust(a, e, t, n, i), this._requestRender();
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
onStart(e) {
|
|
103
|
-
this._itemsCount = e, this._scene.background = null, this.cameraBehaviour.cameraControl instanceof
|
|
102
|
+
this._itemsCount = e, this._scene.background = null, this.cameraBehaviour.cameraControl instanceof P && (this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior = !0), console.log("start processing " + e + " items");
|
|
104
103
|
}
|
|
105
104
|
onElementFinished(e) {
|
|
106
105
|
console.log("processed " + e + " of " + this._itemsCount + " items (" + Math.round(100 / this._itemsCount * e) + "%)");
|
|
107
106
|
}
|
|
108
107
|
onFinished(e) {
|
|
109
|
-
this._scene.background = this._standardSceneBackgroundColor, this.cameraBehaviour.cameraControl instanceof
|
|
108
|
+
this._scene.background = this._standardSceneBackgroundColor, this.cameraBehaviour.cameraControl instanceof P && (this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior = !1);
|
|
110
109
|
}
|
|
111
110
|
clearScene() {
|
|
112
|
-
this._currentGLB &&= (this._scene.remove(this._currentGLB),
|
|
111
|
+
this._currentGLB &&= (this._scene.remove(this._currentGLB), m(this._currentGLB), null), super.clearScene();
|
|
113
112
|
}
|
|
114
113
|
enableHD() {
|
|
115
114
|
super.enableHD();
|
|
@@ -125,9 +124,9 @@ var F = class extends v {
|
|
|
125
124
|
return null;
|
|
126
125
|
}
|
|
127
126
|
cameraBehaviourChanged(e = !0) {
|
|
128
|
-
super.cameraBehaviourChanged(e), this.cameraBehaviour.cameraControl.addEventListener(
|
|
127
|
+
super.cameraBehaviourChanged(e), this.cameraBehaviour.cameraControl.addEventListener(h.ZOOM_IN, () => {
|
|
129
128
|
this._requestRender();
|
|
130
|
-
}, this), this.cameraBehaviour.cameraControl.addEventListener(
|
|
129
|
+
}, this), this.cameraBehaviour.cameraControl.addEventListener(h.ZOOM_OUT, () => {
|
|
131
130
|
this._requestRender();
|
|
132
131
|
}, this);
|
|
133
132
|
}
|
|
@@ -138,10 +137,10 @@ var F = class extends v {
|
|
|
138
137
|
console.log("ready_for_render"), this._globalCallback.onReadyForRender();
|
|
139
138
|
}
|
|
140
139
|
};
|
|
141
|
-
|
|
140
|
+
d([u, l("design:type", Object)], I.prototype, "_glbInputManager", void 0), d([u, l("design:type", Object)], I.prototype, "_rapiAccess", void 0);
|
|
142
141
|
//#endregion
|
|
143
142
|
//#region packages/glb-viewer-core/src/services/glb-render-worker.ts
|
|
144
|
-
var
|
|
143
|
+
var L = class {
|
|
145
144
|
constructor(e, t, n) {
|
|
146
145
|
this._prefix = "https://furniture.roomle.com/3d/glb/", this._listeners = /* @__PURE__ */ new Set(), this._finishedItems = 0, this._sceneManager = e, this._renderer = new c({
|
|
147
146
|
antialias: !0,
|
|
@@ -185,7 +184,7 @@ var R = class {
|
|
|
185
184
|
let n = this._entries.indexOf(e);
|
|
186
185
|
n > -1 && this._entries.splice(n, 1), this._finishedItems++, this._listeners.forEach((e) => e.onElementFinished(this._finishedItems)), this._zip.file(e.name, t.blob), this._doNextEntry();
|
|
187
186
|
}
|
|
188
|
-
},
|
|
187
|
+
}, R = "" + new URL("jszip.min.js", import.meta.url).href, z = class {
|
|
189
188
|
constructor(e) {
|
|
190
189
|
this._currentIdOrUrl = null, this._creator_ = e;
|
|
191
190
|
}
|
|
@@ -199,7 +198,7 @@ var R = class {
|
|
|
199
198
|
return this.setOverrides(t), this._domHelper.setDomElement(e), this._sceneManager ? (this._lifeCycleManager.resume(), Promise.resolve()) : new Promise(this._initPromiseCallback.bind(this));
|
|
200
199
|
}
|
|
201
200
|
_initPromiseCallback(e, t) {
|
|
202
|
-
this._sceneManager = new
|
|
201
|
+
this._sceneManager = new I(this._creator_, {
|
|
203
202
|
left: 0,
|
|
204
203
|
top: 1,
|
|
205
204
|
right: 1,
|
|
@@ -226,11 +225,11 @@ var R = class {
|
|
|
226
225
|
}
|
|
227
226
|
processRenderList(e, t = 320, n = 320) {
|
|
228
227
|
let r = JSON.parse(e);
|
|
229
|
-
this._scriptLoader.fetch(
|
|
230
|
-
let e = new
|
|
228
|
+
this._scriptLoader.fetch(R, { id: "jszip-js" }).then(() => {
|
|
229
|
+
let e = new L(this._sceneManager, t, n);
|
|
231
230
|
e.addListener(this._sceneManager), e.start(r.items).then((t) => {
|
|
232
231
|
t.generateAsync({ type: "blob" }).then((t) => {
|
|
233
|
-
|
|
232
|
+
f("content.zip", URL.createObjectURL(t)), e.removeListener(this._sceneManager);
|
|
234
233
|
});
|
|
235
234
|
});
|
|
236
235
|
});
|
|
@@ -280,18 +279,18 @@ var R = class {
|
|
|
280
279
|
return this._globalCallback;
|
|
281
280
|
}
|
|
282
281
|
};
|
|
283
|
-
|
|
282
|
+
d([u, l("design:type", Object)], z.prototype, "_rapiAccess", void 0), d([u, l("design:type", Object)], z.prototype, "_domHelper", void 0), d([u, l("design:type", Object)], z.prototype, "_scriptLoader", void 0), d([u, l("design:type", Object)], z.prototype, "_lifeCycleManager", void 0), d([u, l("design:type", Object)], z.prototype, "_initData", void 0), d([u, l("design:type", Object)], z.prototype, "_globalInitData", void 0), d([u, l("design:type", Object)], z.prototype, "_globalCallback", void 0), d([u, l("design:type", Object)], z.prototype, "_unitFormatter", void 0), d([u, l("design:type", Object)], z.prototype, "_idbManager", void 0);
|
|
284
283
|
//#endregion
|
|
285
284
|
//#region packages/glb-viewer-core/src/input/glb-input-manager.ts
|
|
286
|
-
var
|
|
287
|
-
new
|
|
288
|
-
new
|
|
289
|
-
new
|
|
290
|
-
new
|
|
291
|
-
],
|
|
285
|
+
var B = class extends g {}, V = [
|
|
286
|
+
new M("script-loader", N),
|
|
287
|
+
new M("glb-input-manager", B, C.CONTEXT),
|
|
288
|
+
new M("logger", x),
|
|
289
|
+
new M("rapi-access", A)
|
|
290
|
+
], H = class extends E {
|
|
292
291
|
setupGlobals() {}
|
|
293
292
|
setupDependencies() {
|
|
294
|
-
|
|
293
|
+
k.setup(V), this.lookup("logger", this._context);
|
|
295
294
|
}
|
|
296
295
|
cleanUpGlobals() {
|
|
297
296
|
throw Error("Method not implemented.");
|
|
@@ -300,16 +299,16 @@ var V = class extends _ {}, H = [
|
|
|
300
299
|
throw Error("Method not implemented.");
|
|
301
300
|
}
|
|
302
301
|
async bootFinished() {
|
|
303
|
-
this._viewer = new
|
|
302
|
+
this._viewer = new z(this._context), window.RoomleGLBViewer || (window.RoomleGLBViewer = this._viewer);
|
|
304
303
|
}
|
|
305
304
|
getApi() {
|
|
306
305
|
return this._viewer;
|
|
307
306
|
}
|
|
308
307
|
getContextName() {
|
|
309
|
-
return
|
|
308
|
+
return j.GLB_VIEWER;
|
|
310
309
|
}
|
|
311
310
|
};
|
|
312
311
|
//#endregion
|
|
313
|
-
export {
|
|
312
|
+
export { z as n, H as t };
|
|
314
313
|
|
|
315
|
-
//# sourceMappingURL=glb-viewer-
|
|
314
|
+
//# sourceMappingURL=glb-viewer-tgKOPCaI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-tgKOPCaI.mjs","names":[],"sources":["../../packages/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-light-setting.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-scene-manager.ts","../../packages/glb-viewer-core/src/services/glb-render-worker.ts","../../../../node_modules/jszip/dist/jszip.min.js?no-inline?url","../../packages/glb-viewer-core/src/roomle-glb-viewer.ts","../../packages/glb-viewer-core/src/input/glb-input-manager.ts","../../packages/glb-viewer-core/src/utils/injectables.ts","../../packages/glb-viewer-core/src/glb-viewer.ts"],"sourcesContent":["import CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport { Box3, Euler, Quaternion, Vector3 } from 'three';\n\nexport default class AdjustableCameraControl3D extends CameraControl3D {\n public shouldIgnoreStandardBehavior = false;\n\n public adjust(\n bounds: Vector3,\n position: Vector3,\n\n yaw: number,\n pitch: number,\n _fov: number,\n ) {\n let minVector: Vector3 = new Vector3(-bounds.x / 2, 0, -bounds.z / 2);\n let maxVector: Vector3 = new Vector3(bounds.x / 2, bounds.y, bounds.z / 2);\n this._boundingBox = new Box3(minVector, maxVector);\n\n // before applying attis pitch value with have to rotate down, because we assume that attis rotation is upwards\n let euler = new Euler(-Math.PI / 2 + pitch, yaw, 0, 'ZYX');\n let quaternion = new Quaternion().setFromEuler(euler);\n\n this._camera.updateProjectionMatrix();\n\n this._camera.quaternion.copy(quaternion);\n this._camera.position.copy(position);\n }\n\n protected _update(overrideTarget?: Vector3) {\n if (!this.shouldIgnoreStandardBehavior) {\n super._update(overrideTarget);\n } else {\n this._saveYawAndPitch();\n }\n }\n\n public animateCamera(delta: number): boolean {\n if (!this.shouldIgnoreStandardBehavior) {\n return super.animateCamera(delta);\n } else {\n return true;\n }\n }\n}\n","import LightSetting from '../../../common-core/src/lightsetting/light-setting';\nimport type { ColorRepresentation, Scene } from 'three';\nimport { AmbientLight, Color } from 'three';\nimport type { GenericGUIParamFolder } from '../../../common-core/src/webgl/gui-types';\n\nexport default class GLBViewerLightSetting extends LightSetting {\n private _ambientLight: AmbientLight;\n\n private _params = {\n ambientLight: {\n color: '#ffffff',\n },\n };\n\n constructor(scene: Scene, oldLightSetting?: LightSetting) {\n super(scene, oldLightSetting);\n\n this._ambientLight = new AmbientLight(\n new Color(this._params.ambientLight.color as ColorRepresentation),\n 0.5,\n );\n\n this.addToScene();\n }\n\n public addToScene(): void {\n this._scene.add(this._ambientLight);\n }\n\n public removeFromScene(): void {\n this._scene.remove(this._ambientLight);\n }\n\n public reload(): void {\n this.removeFromScene();\n this.addToScene();\n }\n\n public showGUI(sceneParameters: GenericGUIParamFolder): void {\n if (this._ambientLight) {\n const ambientLightFolder = sceneParameters.addFolder('Ambient Light');\n ambientLightFolder.add(this._ambientLight, 'visible');\n ambientLightFolder\n .add(this._ambientLight, 'intensity')\n .min(0)\n .max(5)\n .step(0.1);\n ambientLightFolder\n .addColor(this._params.ambientLight, 'color')\n .onChange((color: string) => {\n this._ambientLight.color = new Color(color as ColorRepresentation);\n });\n }\n }\n}\n","import SceneManager from '../../../common-core/src/webgl/scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n} from '../../../common-core/src/common-interfaces';\nimport AdjustableCameraControl3D from '../camera-control/adjustable-camera-control-3d';\nimport type { GLBRenderWorkerListener } from '../services/glb-render-worker';\nimport type InputManager from '../../../common-core/src/input/input-manager';\nimport inject from '../../../common-core/src/di/inject';\nimport type GlbInputManager from '../input/glb-input-manager';\n\nimport DefaultLightSetting from '../../../configurator-core/src/webgl/lightsetting/default-light-setting';\nimport { CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';\nimport { dispose } from '../../../common-core/src/utils/threejs-utils';\nimport { type RapiAccess } from '../../../common-core/src/rapi-access';\nimport { getGlbUrl } from '../../../common-core/src/utils/common-utils';\nimport { CANVAS_ID } from '../../../common-core/src/utils/dom-helper';\nimport type { Enumify } from '#/common/src/utils/types';\nimport {\n BasicShadowMap,\n Box3,\n type Color,\n type Object3D,\n PerspectiveCamera,\n SRGBColorSpace,\n Vector3,\n WebGLRenderer,\n} from 'three';\nimport DynamicLightSettingLoader, {\n PREDEFINED_LIGHTSETTING,\n} from '../../../common-core/src/lightsetting/dynamic-light-setting-loader';\nimport GLBViewerLightSetting from './glb-viewer-light-setting';\nimport GlbViewerCameraBehaviour from '../../../common-core/src/cameracontrol/glb-viewer-camera-behaviour';\nimport {\n CAMERA_EVENT,\n type CameraParameter,\n} from '../../../common-core/src/cameracontrol/camera-control';\n\nexport default class GLBViewerSceneManager\n extends SceneManager\n implements GLBRenderWorkerListener\n{\n @inject\n private _glbInputManager: GlbInputManager;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n private _currentGLB: Object3D | null;\n private _standardSceneBackgroundColor: Color;\n\n private _itemsCount = 0;\n\n constructor(creator: string, offset: CanvasOffset) {\n super(creator, offset, CANVAS_ID.GLB, CAMERA_TYPE.CAMERA_3D);\n this._standardSceneBackgroundColor = this._scene.background as Color;\n if (this._initData.legacyLight && this._renderer instanceof WebGLRenderer) {\n if (this._renderer.capabilities.maxTextures > 8) {\n const lightSource =\n DynamicLightSettingLoader.createDynamicLightSettingSource(\n null,\n PREDEFINED_LIGHTSETTING.CAMERA,\n );\n if (lightSource) {\n this.loadDynamicLightSetting(lightSource);\n }\n } else {\n console.warn(\n 'this device has a maximum of 8 texture units thus we are using a simpler light setting',\n );\n this._lightSetting = new GLBViewerLightSetting(this._scene);\n }\n }\n }\n\n protected createCameraControl(\n _mode: Enumify<typeof CAMERA_TYPE>,\n _offset: CanvasOffset,\n ) {\n this._changeCameraBehaviour(\n new GlbViewerCameraBehaviour(\n new AdjustableCameraControl3D(\n this._creator_,\n this._getInputManager(),\n undefined,\n ),\n this._cameraBehaviourState,\n ),\n );\n }\n\n protected _getInputManager(): InputManager {\n return this._glbInputManager;\n }\n\n public async loadStaticItem(\n id: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n const rapiItem = await this._rapiAccess.getItem(id);\n if (rapiItem.configuration) {\n return Promise.reject();\n }\n const glbUrl = getGlbUrl(rapiItem);\n if (!glbUrl) {\n return Promise.reject(new Error('GLB Url not detected'));\n }\n return this.loadGLB(glbUrl, true, undefined, callback);\n }\n\n public loadGLB(\n url: string,\n automaticallyAdjustCamera: boolean = true,\n scaling: Vector3 = new Vector3(1, 1, 1),\n callback?: (percent: number) => void,\n ): Promise<void> {\n this.clearScene();\n return new Promise<void>((resolve, reject) => {\n this._loadGLB(\n url,\n new Vector3(0, 0, 0),\n 0,\n undefined,\n scaling,\n undefined,\n undefined,\n callback,\n ).then((glb) => {\n this._currentGLB = glb;\n this._scene.add(this._currentGLB);\n\n let boundingBox = new Box3().setFromObject(this._currentGLB);\n if (automaticallyAdjustCamera) {\n if (\n this.cameraBehaviour.cameraControl instanceof\n AdjustableCameraControl3D\n ) {\n this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(boundingBox);\n }\n }\n this._updateBounds(boundingBox, undefined, true);\n this._readyForRender();\n resolve();\n }, reject);\n });\n }\n\n public preparePerspectiveImage(\n renderer?: WebGLRenderer,\n width: number = 1000,\n height: number = 1000,\n ): Promise<Base64Image> {\n return new Promise<Base64Image>((resolve, reject) => {\n if (!renderer) {\n renderer = new WebGLRenderer({ antialias: true });\n renderer.setSize(width, height);\n renderer.outputColorSpace = SRGBColorSpace;\n renderer.autoClear = false;\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = BasicShadowMap;\n }\n\n let camera = this.cameraBehaviour.cameraControl.getCamera().clone();\n if (camera instanceof PerspectiveCamera) {\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n }\n\n this._lightSetting?.removeFromScene();\n let defaultLightSetting = new DefaultLightSetting(this._scene);\n\n renderer.render(this._scene, camera);\n let image = renderer.domElement.toDataURL();\n renderer.domElement.toBlob((blob) => {\n if (blob === null) {\n reject(new Error('Failed to create blob from canvas'));\n return;\n }\n resolve({ image, width, height, blob });\n }, 'image/png');\n\n defaultLightSetting.removeFromScene();\n this._lightSetting?.addToScene();\n });\n }\n\n public adjustCamera(\n position: Vector3,\n yaw: number,\n pitch: number,\n fov: number,\n ) {\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n let boundingBox = new Box3().setFromObject(this._scene);\n let bounds = boundingBox.getSize(new Vector3());\n (this.cameraBehaviour.cameraControl as AdjustableCameraControl3D).adjust(\n bounds,\n position,\n yaw,\n pitch,\n fov,\n );\n this._requestRender();\n }\n }\n\n public onStart(count: number) {\n this._itemsCount = count;\n this._scene.background = null;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = true;\n }\n console.log('start processing ' + count + ' items');\n }\n\n public onElementFinished(itemsFinished: number) {\n console.log(\n 'processed ' +\n itemsFinished +\n ' of ' +\n this._itemsCount +\n ' items (' +\n Math.round((100 / this._itemsCount) * itemsFinished) +\n '%)',\n );\n }\n\n public onFinished(_zip: any) {\n this._scene.background = this._standardSceneBackgroundColor;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = false;\n }\n }\n\n public clearScene() {\n if (this._currentGLB) {\n this._scene.remove(this._currentGLB);\n dispose(this._currentGLB);\n this._currentGLB = null;\n }\n super.clearScene();\n }\n\n public enableHD() {\n super.enableHD();\n }\n\n public sceneChanged(): void {\n //override when needed\n }\n\n getBounds(): Box3 | null {\n if (!this._currentGLB) {\n return null;\n }\n return new Box3().setFromObject(this._currentGLB);\n }\n\n protected get glbViewerCameraBehaviour(): GlbViewerCameraBehaviour {\n return this.cameraBehaviour as GlbViewerCameraBehaviour;\n }\n\n getGeometryBounds(): Box3 | null {\n return null;\n }\n\n cameraBehaviourChanged(updateDistance: boolean = true) {\n super.cameraBehaviourChanged(updateDistance);\n\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_IN,\n () => {\n this._requestRender();\n },\n this,\n );\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_OUT,\n () => {\n this._requestRender();\n },\n this,\n );\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this.glbViewerCameraBehaviour.externalApiMoveCamera(cameraParameter);\n }\n\n // info when scene is ready to render, used for testing\n protected _readyForRender() {\n console.log('ready_for_render');\n this._globalCallback.onReadyForRender();\n }\n}\n","import type { Base64Image } from '../../../common-core/src/common-interfaces';\nimport type GLBViewerSceneManager from '../webgl/glb-viewer-scene-manager';\nimport type { RenderEntry } from '../roomle-glb-viewer';\nimport { SRGBColorSpace, Vector3, WebGLRenderer } from 'three';\n\ninterface GLBRenderEntry {\n name: string;\n url: string;\n position: Vector3;\n fov: number;\n yaw: number;\n pitch: number;\n}\n\nexport interface GLBRenderWorkerListener {\n onStart(count: number): void;\n\n onElementFinished(finishedElements: number): void;\n\n onFinished(zip: any): void;\n}\n\nexport default class GLBRenderWorker {\n private _sceneManager: GLBViewerSceneManager;\n private _entries: GLBRenderEntry[];\n\n private _resolve: (zip: any) => void;\n\n private _prefix = 'https://furniture.roomle.com/3d/glb/';\n\n private _renderer: WebGLRenderer;\n private _width: number;\n private _height: number;\n\n private _listeners: Set<GLBRenderWorkerListener> =\n new Set<GLBRenderWorkerListener>();\n private _finishedItems: number = 0;\n\n private _zip: any;\n\n constructor(\n sceneManager: GLBViewerSceneManager,\n width: number,\n height: number,\n ) {\n this._sceneManager = sceneManager;\n\n this._renderer = new WebGLRenderer({ antialias: true, alpha: true });\n this._width = width;\n this._height = height;\n this._renderer.setSize(width, height);\n this._renderer.setClearColor(0xffffff, 0);\n this._renderer.outputColorSpace = SRGBColorSpace;\n }\n\n public addListener(listener: GLBRenderWorkerListener) {\n this._listeners.add(listener);\n }\n\n public removeListener(listener: GLBRenderWorkerListener) {\n this._listeners.delete(listener);\n }\n\n public start(entries: RenderEntry[]): Promise<any> {\n this._entries = [];\n entries.forEach((entry) => {\n this._entries.push(this._transform(entry)); // {name: url.replace('.glb', '.png'), url: this._prefix + url}\n });\n this._finishedItems = 0;\n this._listeners.forEach((listener) =>\n listener.onStart(this._entries.length),\n );\n this._zip = new (window as any).JSZip();\n this._doNextEntry();\n return new Promise<any>((resolve) => {\n this._resolve = resolve;\n });\n }\n\n private _transform(entry: RenderEntry): GLBRenderEntry {\n return {\n name: entry.path.replace('.glb', '.png'),\n url: this._prefix + entry.path,\n position: new Vector3(\n entry.camera.position.x,\n entry.camera.position.z,\n -entry.camera.position.y,\n ),\n fov: entry.camera.fieldOfView * 2, // * 2 because Atti suggested it after all images were cut on all sides\n yaw: entry.camera.rotation.z,\n pitch: entry.camera.rotation.x,\n };\n }\n\n private _doNextEntry() {\n if (this._entries.length === 0) {\n this._listeners.forEach((listener) => listener.onFinished(this._zip));\n this._resolve(this._zip);\n } else {\n this._processEntry(this._entries[0]);\n }\n }\n\n private _processEntry(entry: GLBRenderEntry) {\n this._sceneManager.loadGLB(entry.url, false, undefined).then(() => {\n this._sceneManager.adjustCamera(\n entry.position,\n entry.yaw,\n entry.pitch,\n entry.fov,\n );\n this._sceneManager\n .preparePerspectiveImage(this._renderer, this._width, this._height)\n .then((base64Image) => {\n this._entryFinished(entry, base64Image);\n });\n });\n }\n\n private _entryFinished(entry: GLBRenderEntry, base64Image: Base64Image) {\n let index = this._entries.indexOf(entry);\n if (index > -1) {\n this._entries.splice(index, 1);\n }\n this._finishedItems++;\n this._listeners.forEach((listener) =>\n listener.onElementFinished(this._finishedItems),\n );\n this._zip.file(entry.name, base64Image.blob);\n this._doNextEntry();\n }\n}\n","export default \"__VITE_ASSET__WPGYjwIlzWVNM1bYhOc83w__\"","import type ScriptLoader from '../../common-core/src/script-loader';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport inject from '../../common-core/src/di/inject';\nimport GLBViewerSceneManager from './webgl/glb-viewer-scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n Position3,\n} from '../../common-core/src/common-interfaces';\nimport GLBRenderWorker from './services/glb-render-worker';\nimport type { ExternalEmbeddable, GlobalAPI } from '../../common-core/src/main';\nimport type { Main } from '../../common-core/src/main';\nimport type { Context } from '../../common-core/src/di/context';\nimport type { LifeCycleManager } from '../../common-core/src/life-cycle-manager';\nimport type { SceneSettings } from '../../common-core/src/scene-settings-loader';\nimport { JS_ZIP_FILE_NAME } from '../../common-core/src/static-files/libs';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport type {\n GlobalInitDataDefinition,\n InitDataDefinition,\n} from '../../common-core/src/utils/shims';\nimport type GlobalInitData from '../../common-core/src/utils/global-init-data';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type UnitFormatter from '../../configurator-core/src/services/unit-formatter';\nimport { download } from '../../common-core/src/utils/common-utils';\nimport type { Scene } from 'three';\nimport { Vector3 } from 'three';\nimport { type IdbManager } from '../../common-core/src/services/idb-manager';\nimport type { CameraParameter } from '../../common-core/src/cameracontrol/camera-control';\nimport type { GlobalCallback } from '../../common-core/src/services/global-callback';\n\ninterface RenderCameraInformation {\n fieldOfView: number;\n rotation: Position3;\n position: Position3;\n}\n\nexport declare interface RenderEntry {\n path: string;\n camera: RenderCameraInformation;\n}\n\nexport class GlbViewerUiCallbacks {}\n\nexport class RoomleGLBViewer\n implements GlobalAPI, Context, ExternalEmbeddable<GlbViewerUiCallbacks>\n{\n public _creator_: string;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n @inject\n private _domHelper: DomHelper;\n\n @inject\n private _scriptLoader: ScriptLoader;\n\n @inject\n private _lifeCycleManager: LifeCycleManager;\n\n @inject\n private _initData: InitData;\n\n @inject\n private _globalInitData: GlobalInitData;\n\n @inject\n private _globalCallback: GlobalCallback;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n @inject\n protected _idbManager: IdbManager;\n\n private _sceneManager: GLBViewerSceneManager;\n\n private _currentIdOrUrl: string | null = null;\n\n constructor(creator: string) {\n this._creator_ = creator;\n }\n\n public setCameraOffset(offset: CanvasOffset): void {\n this._sceneManager.setCameraOffset(offset);\n }\n\n public getCameraOffset(): CanvasOffset {\n return this._sceneManager.getCameraOffset();\n }\n\n public init(\n element: HTMLElement,\n initData?: InitDataDefinition,\n ): Promise<void> {\n this.setOverrides(initData);\n this._domHelper.setDomElement(element);\n\n if (this._sceneManager) {\n this._lifeCycleManager.resume();\n return Promise.resolve();\n }\n\n return new Promise<void>(this._initPromiseCallback.bind(this));\n }\n\n private _initPromiseCallback(resolve: () => void, _reject: () => void) {\n this._sceneManager = new GLBViewerSceneManager(this._creator_, {\n left: 0,\n top: 1,\n right: 1,\n bottom: 0,\n });\n // this.loadGLB('https://furniture.roomle.com/3d/glb/furniture/vitra/41206600/41206600.glb');\n this._sceneManager.enableHD();\n resolve();\n }\n\n /**\n * Remove the current glb from the scene if it exists\n */\n public clearScene() {\n this._sceneManager.clearScene();\n }\n\n /**\n * Loads the GLB from the given URL Param\n * @param url\n * @param scaling defaults to 1\n * @param callback loading percent between 0 and 1\n */\n public loadGLB(\n url: string,\n scaling = 1,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = url;\n this._rapiAccess.trackView(url);\n return this._sceneManager.loadGLB(\n url,\n true,\n new Vector3(scaling, scaling, scaling),\n callback,\n );\n }\n\n /**\n * Loads the glb asset from the static item\n * @param staticItemId\n * @param callback loading percent between 0 and 1\n */\n public loadStaticItem(\n staticItemId: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = staticItemId;\n this._rapiAccess.trackView(staticItemId);\n return this._sceneManager.loadStaticItem(staticItemId, callback);\n }\n\n /**\n * Returns the current item id or url of the loaded object\n */\n public getCurrentId(): string | null {\n return this._currentIdOrUrl;\n }\n\n /**\n * Loads a SceneSettings object, currently it can can contain a light setting definition\n * (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loaderEnvironmentSetting}).\n * @param sceneSettings\n */\n public loadSceneSetting(sceneSettings: SceneSettings): Promise<void> {\n return this._sceneManager.loadSceneSettings(sceneSettings);\n }\n\n public preparePerspectiveImage(): Promise<Base64Image> {\n return this._sceneManager.preparePerspectiveImage();\n }\n\n public processRenderList(\n jsonString: string,\n width: number = 320,\n height: number = 320,\n ) {\n const object = JSON.parse(jsonString);\n this._scriptLoader.fetch(JS_ZIP_FILE_NAME, { id: 'jszip-js' }).then(() => {\n const worker = new GLBRenderWorker(this._sceneManager, width, height);\n worker.addListener(this._sceneManager);\n worker.start(object.items).then((zip: any) => {\n zip.generateAsync({ type: 'blob' }).then((content: File) => {\n download('content.zip', URL.createObjectURL(content));\n worker.removeListener(this._sceneManager);\n });\n });\n });\n }\n\n public setOverrides(\n initData:\n | Partial<InitDataDefinition & GlobalInitDataDefinition>\n | InitData\n | undefined,\n ): void {\n if (!initData) {\n return;\n }\n this._initData.setOverrides(initData);\n this._globalInitData.setOverrides(initData);\n }\n\n public updateSize(): void {\n this._sceneManager.updateCamera();\n }\n\n /**\n * Return the main class which has access to lifecycle events and RapiAccess.\n * Hidden because it's only useful for embedding API.\n * Has to be overridden by main class.\n * @hidden\n */\n public getMain(): Main | undefined {\n return undefined;\n }\n\n public resumeTest(element: HTMLElement) {\n this._domHelper.setDomElement(element);\n this._lifeCycleManager.resume();\n }\n\n public pauseTest() {\n this._lifeCycleManager.pause();\n }\n\n public showGUI() {\n this._sceneManager.showGUI();\n }\n\n public get callbacks() {\n return {};\n }\n\n public getScene(): Scene {\n return this._sceneManager.getScene();\n }\n\n public updateScene(): void {\n this._sceneManager.updateScene();\n }\n\n /**\n * returns unit formatter for formatting input und output values in scene\n */\n public getUnitFormatter(): UnitFormatter {\n return this._unitFormatter;\n }\n\n /**\n * returns manager class to interface with indexedDB storage\n */\n public getStorage(): IdbManager {\n return this._idbManager;\n }\n\n public setEnvironmentMap(params: {\n url?: string;\n intensity?: number;\n rotation?: number;\n maxLightSources?: number;\n }): void {\n const { url, intensity, rotation, maxLightSources } = params;\n this._sceneManager.setEnvironmentMap(\n url,\n intensity,\n rotation,\n maxLightSources,\n );\n }\n\n public exportCanvasScreenshot(quality?: number): Promise<string> {\n return this._sceneManager.exportCanvasScreenshot(quality);\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this._sceneManager.moveCamera(cameraParameter);\n }\n\n /**\n * @internal\n * Use this callbacks to hook in your functionality\n */\n public get globalCallbacks(): GlobalCallback {\n return this._globalCallback;\n }\n}\n","import InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class GlbInputManager extends InputManager {\n //move on, nothing to see here\n}\n","import Logger from '../../../common-core/src/logger';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport GlbInputManager from '../input/glb-input-manager';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'glb-input-manager',\n GlbInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type Logger from '../../common-core/src/logger';\nimport { INJECTABLES } from './utils/injectables';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { RoomleGLBViewer } from './roomle-glb-viewer';\n\nexport class GlbViewer extends Main {\n private _viewer: RoomleGLBViewer;\n\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._viewer = new RoomleGLBViewer(this._context);\n\n if (!window.RoomleGLBViewer) {\n window.RoomleGLBViewer = this._viewer;\n }\n }\n\n public getApi(): RoomleGLBViewer {\n return this._viewer;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.GLB_VIEWER;\n }\n}\n"],"x_google_ignoreList":[4],"mappings":";;;;;;;;AAGA,IAAqB,IAArB,cAAuD,EAAgB;;mDAC/B;;CAEtC,OACE,GACA,GAEA,GACA,GACA,GACA;AAGA,OAAK,eAAe,IAAI,EAFC,IAAI,EAA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