@inweb/viewer-three 27.5.0 → 27.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/components/LightHelperComponent.js +1 -1
- package/dist/extensions/components/LightHelperComponent.js.map +1 -1
- package/dist/extensions/components/LightHelperComponent.min.js +1 -1
- package/dist/extensions/components/LightHelperComponent.module.js +1 -1
- package/dist/extensions/components/LightHelperComponent.module.js.map +1 -1
- package/dist/extensions/components/StatsPanelComponent.js +0 -1
- package/dist/extensions/components/StatsPanelComponent.js.map +1 -1
- package/dist/extensions/components/StatsPanelComponent.min.js +1 -1
- package/dist/extensions/components/StatsPanelComponent.module.js +0 -1
- package/dist/extensions/components/StatsPanelComponent.module.js.map +1 -1
- package/dist/extensions/loaders/GLTFCloudLoader.js +7 -2
- package/dist/extensions/loaders/GLTFCloudLoader.js.map +1 -1
- package/dist/extensions/loaders/GLTFCloudLoader.min.js +1 -1
- package/dist/extensions/loaders/GLTFCloudLoader.module.js +7 -2
- package/dist/extensions/loaders/GLTFCloudLoader.module.js.map +1 -1
- package/dist/extensions/loaders/GLTFFileLoader.js +2 -1
- package/dist/extensions/loaders/GLTFFileLoader.js.map +1 -1
- package/dist/extensions/loaders/GLTFFileLoader.min.js +1 -1
- package/dist/extensions/loaders/GLTFFileLoader.module.js +2 -1
- package/dist/extensions/loaders/GLTFFileLoader.module.js.map +1 -1
- package/dist/extensions/loaders/IFCXLoader.js +10 -5
- package/dist/extensions/loaders/IFCXLoader.js.map +1 -1
- package/dist/extensions/loaders/IFCXLoader.min.js +1 -1
- package/dist/extensions/loaders/IFCXLoader.module.js +10 -5
- package/dist/extensions/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/viewer-three.js +161 -157
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +68 -53
- package/dist/viewer-three.module.js.map +1 -1
- package/extensions/components/LightHelperComponent.ts +1 -1
- package/extensions/components/StatsPanelComponent.ts +0 -1
- package/extensions/loaders/GLTFCloudLoader.ts +8 -2
- package/extensions/loaders/GLTFFileLoader.ts +3 -2
- package/extensions/loaders/IFCX/IFCXFileLoader.ts +11 -5
- package/lib/Viewer/Viewer.d.ts +1 -1
- package/lib/Viewer/measurement/Snapper.d.ts +1 -1
- package/package.json +5 -5
- package/src/Viewer/Viewer.ts +14 -16
- package/src/Viewer/commands/GetSelected2.ts +1 -1
- package/src/Viewer/commands/SetSelected.ts +1 -1
- package/src/Viewer/components/BackgroundComponent.ts +1 -1
- package/src/Viewer/components/CameraComponent.ts +1 -1
- package/src/Viewer/components/CanvasRemoveComponent.ts +0 -1
- package/src/Viewer/components/HighlighterUtils.ts +2 -2
- package/src/Viewer/components/SelectionComponent.ts +4 -2
- package/src/Viewer/helpers/SectionsHelper.js +4 -8
- package/src/Viewer/helpers/WCSHelper.ts +7 -5
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +19 -14
- package/src/Viewer/loaders/GLTFBinaryParser.ts +2 -2
- package/src/Viewer/loaders/GLTFFileDynamicLoader.ts +2 -2
- package/src/Viewer/measurement/Snapper.ts +2 -2
- package/src/Viewer/models/ModelImpl.ts +38 -25
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
const extentsSize = this.viewer.extents.getSize(new three.Vector3()).length() || 1;
|
|
39
39
|
const helperSize = extentsSize / 20;
|
|
40
40
|
this.viewer.scene.traverse((object) => {
|
|
41
|
-
let helper;
|
|
41
|
+
let helper = null;
|
|
42
42
|
if (object.isDirectionalLight)
|
|
43
43
|
helper = new three.DirectionalLightHelper(object, helperSize, "#aa0000");
|
|
44
44
|
else if (object.isHemisphereLight)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightHelperComponent.js","sources":["../../../extensions/components/LightHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass LightHelperComponent implements IComponent {\n private viewer: Viewer;\n private lightHelpers: (DirectionalLightHelper | HemisphereLightHelper | PointLightHelper)[];\n\n constructor(viewer: Viewer) {\n this.lightHelpers = [];\n this.viewer = viewer;\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n const extentsSize = this.viewer.extents.getSize(new Vector3()).length() || 1;\n const helperSize = extentsSize / 20;\n\n this.viewer.scene.traverse((object: any) => {\n let helper: DirectionalLightHelper | HemisphereLightHelper | PointLightHelper;\n\n if (object.isDirectionalLight) helper = new DirectionalLightHelper(object, helperSize, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, helperSize, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, helperSize, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n this.viewer.update();\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":["Vector3","DirectionalLightHelper","HemisphereLightHelper","PointLightHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,oBAAoB,CAAA;IAIxB,IAAA,WAAA,CAAY,MAAc,EAAA;YAkB1B,IAAA,CAAA,UAAU,GAAG,MAAK;gBAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;oBACnC,MAAM,CAAC,gBAAgB,EAAE;oBACzB,MAAM,CAAC,OAAO,EAAE;IAClB,YAAA,CAAC,CAAC;IACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;IAE5B,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAIA,aAAO,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC;IAC5E,YAAA,MAAM,UAAU,GAAG,WAAW,GAAG,EAAE;gBAEnC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;
|
|
1
|
+
{"version":3,"file":"LightHelperComponent.js","sources":["../../../extensions/components/LightHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass LightHelperComponent implements IComponent {\n private viewer: Viewer;\n private lightHelpers: (DirectionalLightHelper | HemisphereLightHelper | PointLightHelper)[];\n\n constructor(viewer: Viewer) {\n this.lightHelpers = [];\n this.viewer = viewer;\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n const extentsSize = this.viewer.extents.getSize(new Vector3()).length() || 1;\n const helperSize = extentsSize / 20;\n\n this.viewer.scene.traverse((object: any) => {\n let helper: DirectionalLightHelper | HemisphereLightHelper | PointLightHelper | null = null;\n\n if (object.isDirectionalLight) helper = new DirectionalLightHelper(object, helperSize, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, helperSize, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, helperSize, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n this.viewer.update();\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":["Vector3","DirectionalLightHelper","HemisphereLightHelper","PointLightHelper","components"],"mappings":";;;;;;;;;;;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,YAAY,GAAG,EAAE;IACtB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;YACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC5D,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QACxD;QAEA,OAAO,GAAA;YACL,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;gBACnC,MAAM,CAAC,gBAAgB,EAAE;gBACzB,MAAM,CAAC,OAAO,EAAE;IAClB,QAAA,CAAC,CAAC;IACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;YAE5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3D;IA0BD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,MAAM,KAAK,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,t){"use strict";class i{constructor(t){this.syncHelper=()=>{this.lightHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.lightHelpers.length=0;const t=(this.viewer.extents.getSize(new e.Vector3).length()||1)/20;this.viewer.scene.traverse(i=>{let r;i.isDirectionalLight?r=new e.DirectionalLightHelper(i,t,"#aa0000"):i.isHemisphereLight?r=new e.HemisphereLightHelper(i,t,"#ff9800"):i.isPointLight&&(r=new e.PointLightHelper(i,t,"#ff9800")),r&&(this.lightHelpers.push(r),this.viewer.helpers.add(r),this.viewer.update())})},this.lightHelpers=[],this.viewer=t,this.viewer.addEventListener("geometryend",this.syncHelper),this.viewer.addEventListener("clear",this.syncHelper)}dispose(){this.lightHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.lightHelpers.length=0,this.viewer.removeEventListener("geometryend",this.syncHelper),this.viewer.removeEventListener("clear",this.syncHelper)}}t.components.registerComponent("LightHelperComponent",e=>new i(e))});
|
|
24
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,t){"use strict";class i{constructor(t){this.syncHelper=()=>{this.lightHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.lightHelpers.length=0;const t=(this.viewer.extents.getSize(new e.Vector3).length()||1)/20;this.viewer.scene.traverse(i=>{let r=null;i.isDirectionalLight?r=new e.DirectionalLightHelper(i,t,"#aa0000"):i.isHemisphereLight?r=new e.HemisphereLightHelper(i,t,"#ff9800"):i.isPointLight&&(r=new e.PointLightHelper(i,t,"#ff9800")),r&&(this.lightHelpers.push(r),this.viewer.helpers.add(r),this.viewer.update())})},this.lightHelpers=[],this.viewer=t,this.viewer.addEventListener("geometryend",this.syncHelper),this.viewer.addEventListener("clear",this.syncHelper)}dispose(){this.lightHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.lightHelpers.length=0,this.viewer.removeEventListener("geometryend",this.syncHelper),this.viewer.removeEventListener("clear",this.syncHelper)}}t.components.registerComponent("LightHelperComponent",e=>new i(e))});
|
|
@@ -35,7 +35,7 @@ class LightHelperComponent {
|
|
|
35
35
|
const extentsSize = this.viewer.extents.getSize(new Vector3()).length() || 1;
|
|
36
36
|
const helperSize = extentsSize / 20;
|
|
37
37
|
this.viewer.scene.traverse((object) => {
|
|
38
|
-
let helper;
|
|
38
|
+
let helper = null;
|
|
39
39
|
if (object.isDirectionalLight)
|
|
40
40
|
helper = new DirectionalLightHelper(object, helperSize, "#aa0000");
|
|
41
41
|
else if (object.isHemisphereLight)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LightHelperComponent.module.js","sources":["../../../extensions/components/LightHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass LightHelperComponent implements IComponent {\n private viewer: Viewer;\n private lightHelpers: (DirectionalLightHelper | HemisphereLightHelper | PointLightHelper)[];\n\n constructor(viewer: Viewer) {\n this.lightHelpers = [];\n this.viewer = viewer;\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n const extentsSize = this.viewer.extents.getSize(new Vector3()).length() || 1;\n const helperSize = extentsSize / 20;\n\n this.viewer.scene.traverse((object: any) => {\n let helper: DirectionalLightHelper | HemisphereLightHelper | PointLightHelper;\n\n if (object.isDirectionalLight) helper = new DirectionalLightHelper(object, helperSize, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, helperSize, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, helperSize, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n this.viewer.update();\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,oBAAoB,CAAA;AAIxB,IAAA,WAAA,CAAY,MAAc,EAAA;QAkB1B,IAAA,CAAA,UAAU,GAAG,MAAK;YAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;gBACnC,MAAM,CAAC,gBAAgB,EAAE;gBACzB,MAAM,CAAC,OAAO,EAAE;AAClB,YAAA,CAAC,CAAC;AACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;AAE5B,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC;AAC5E,YAAA,MAAM,UAAU,GAAG,WAAW,GAAG,EAAE;YAEnC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;
|
|
1
|
+
{"version":3,"file":"LightHelperComponent.module.js","sources":["../../../extensions/components/LightHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass LightHelperComponent implements IComponent {\n private viewer: Viewer;\n private lightHelpers: (DirectionalLightHelper | HemisphereLightHelper | PointLightHelper)[];\n\n constructor(viewer: Viewer) {\n this.lightHelpers = [];\n this.viewer = viewer;\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.lightHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.lightHelpers.length = 0;\n\n const extentsSize = this.viewer.extents.getSize(new Vector3()).length() || 1;\n const helperSize = extentsSize / 20;\n\n this.viewer.scene.traverse((object: any) => {\n let helper: DirectionalLightHelper | HemisphereLightHelper | PointLightHelper | null = null;\n\n if (object.isDirectionalLight) helper = new DirectionalLightHelper(object, helperSize, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, helperSize, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, helperSize, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n this.viewer.update();\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,oBAAoB,CAAA;AAIxB,IAAA,WAAA,CAAY,MAAc,EAAA;QAkB1B,IAAA,CAAA,UAAU,GAAG,MAAK;YAChB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;gBACnC,MAAM,CAAC,gBAAgB,EAAE;gBACzB,MAAM,CAAC,OAAO,EAAE;AAClB,YAAA,CAAC,CAAC;AACF,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;AAE5B,YAAA,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC;AAC5E,YAAA,MAAM,UAAU,GAAG,WAAW,GAAG,EAAE;YAEnC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;gBACzC,IAAI,MAAM,GAA6E,IAAI;gBAE3F,IAAI,MAAM,CAAC,kBAAkB;oBAAE,MAAM,GAAG,IAAI,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;qBAC5F,IAAI,MAAM,CAAC,iBAAiB;oBAAE,MAAM,GAAG,IAAI,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;qBAC/F,IAAI,MAAM,CAAC,YAAY;oBAAE,MAAM,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC;gBAE1F,IAAI,MAAM,EAAE;AACV,oBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;AAC/B,oBAAA,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBACtB;AACF,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC;AAxCC,QAAA,IAAI,CAAC,YAAY,GAAG,EAAE;AACtB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC5D,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IACxD;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;YACnC,MAAM,CAAC,gBAAgB,EAAE;YACzB,MAAM,CAAC,OAAO,EAAE;AAClB,QAAA,CAAC,CAAC;AACF,QAAA,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC/D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;IAC3D;AA0BD;AAED,UAAU,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,MAAM,KAAK,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -144,7 +144,6 @@
|
|
|
144
144
|
this.viewer.removeEventListener("render", this.updateStats);
|
|
145
145
|
this.viewer.removeEventListener("animate", this.updateViewer);
|
|
146
146
|
this.stats.dom.remove();
|
|
147
|
-
this.stats = undefined;
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
viewerThree.components.registerComponent("StatsPanelComponent", (viewer) => new StatsPanelComponent(viewer));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../extensions/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n this.stats.dom.style.left = \"0px\";\n this.stats.dom.style.top = \"0px\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"render\", this.updateStats);\n this.viewer.addEventListener(\"animate\", this.updateViewer);\n }\n\n dispose() {\n this.viewer.removeEventListener(\"render\", this.updateStats);\n this.viewer.removeEventListener(\"animate\", this.updateViewer);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.stats.update();\n };\n\n updateViewer = () => {\n this.viewer.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,IAAI,KAAK,GAAG,YAAY;CAExB,CAAC,IAAI,IAAI,GAAG,CAAC;CAEb,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE;CAChD,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,sEAAsE;CACjG,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,WAAW,KAAK,GAAG;CAEzD,EAAE,KAAK,CAAC,cAAc,EAAE;CACxB,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;CAElD,CAAC,CAAC,EAAE,KAAK,EAAE;CAIX,CAAC,SAAS,QAAQ,EAAE,KAAK,GAAG;CAE5B,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE;CACpC,EAAE,OAAO,KAAK;CAEd,CAAC;CAED,CAAC,SAAS,SAAS,EAAE,EAAE,GAAG;CAE1B,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,GAA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C;CAzBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;SACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;SAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK;SACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK;CAChC,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;SACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SACxD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;KAC5D;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SAC3D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;CAE7D,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;CACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;KACxB;CASD;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../extensions/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n this.stats.dom.style.left = \"0px\";\n this.stats.dom.style.top = \"0px\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"render\", this.updateStats);\n this.viewer.addEventListener(\"animate\", this.updateViewer);\n }\n\n dispose() {\n this.viewer.removeEventListener(\"render\", this.updateStats);\n this.viewer.removeEventListener(\"animate\", this.updateViewer);\n\n this.stats.dom.remove();\n }\n\n updateStats = () => {\n this.stats.update();\n };\n\n updateViewer = () => {\n this.viewer.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA,IAAI,KAAK,GAAG,YAAY;CAExB,CAAC,IAAI,IAAI,GAAG,CAAC;CAEb,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE;CAChD,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,sEAAsE;CACjG,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,WAAW,KAAK,GAAG;CAEzD,EAAE,KAAK,CAAC,cAAc,EAAE;CACxB,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;CAElD,CAAC,CAAC,EAAE,KAAK,EAAE;CAIX,CAAC,SAAS,QAAQ,EAAE,KAAK,GAAG;CAE5B,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE;CACpC,EAAE,OAAO,KAAK;CAEd,CAAC;CAED,CAAC,SAAS,SAAS,EAAE,EAAE,GAAG;CAE1B,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG;CAEzD,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,GAAG,MAAM;CAEtE,EAAE;CAEF,EAAE,IAAI,GAAG,EAAE;CAEX,CAAC;CAID,CAAC,IAAI,SAAS,GAAG,EAAE,WAAW,IAAI,IAAI,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,SAAS,EAA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A,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;SACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SACxD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;KAC5D;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;SAC3D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;CAE7D,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;KACzB;CASD;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ODA.Three)}(this,function(e){"use strict";var t=function(){var e=0,i=document.createElement("div");function n(e){return i.appendChild(e.dom),e}function a(t){for(var n=0;n<i.children.length;n++)i.children[n].style.display=n===t?"block":"none";e=t}i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(t){t.preventDefault(),a(++e%i.children.length)},!1);var l=(performance||Date).now(),s=l,o=0,r=n(new t.Panel("FPS","#0ff","#002")),d=n(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var f=n(new t.Panel("MB","#f08","#201"));return a(0),{REVISION:16,dom:i,addPanel:n,showPanel:a,begin:function(){l=(performance||Date).now()},end:function(){o++;var e=(performance||Date).now();if(d.update(e-l,200),e>=s+1e3&&(r.update(1e3*o/(e-s),100),s=e,o=0,f)){var t=performance.memory;f.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){l=this.end()},domElement:i,setMode:a}};t.Panel=function(e,t,i){var n=1/0,a=0,l=Math.round,s=l(window.devicePixelRatio||1),o=80*s,r=48*s,d=3*s,f=2*s,p=3*s,c=15*s,h=74*s,u=30*s,m=document.createElement("canvas");m.width=o,m.height=r,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*s+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=i,v.fillRect(0,0,o,r),v.fillStyle=t,v.fillText(e,d,f),v.fillRect(p,c,h,u),v.fillStyle=i,v.globalAlpha=.9,v.fillRect(p,c,h,u),{dom:m,update:function(r,w){n=Math.min(n,r),a=Math.max(a,r),v.fillStyle=i,v.globalAlpha=1,v.fillRect(0,0,o,c),v.fillStyle=t,v.fillText(l(r)+" "+e+" ("+l(n)+"-"+l(a)+")",d,f),v.drawImage(m,p+s,c,h-s,u,p,c,h-s,u),v.fillRect(p+h-s,c,s,u),v.fillStyle=i,v.globalAlpha=.9,v.fillRect(p+h-s,c,s,l((1-r/w)*u))}}};class i{constructor(e){this.updateStats=()=>{this.stats.update()},this.updateViewer=()=>{this.viewer.update()},this.stats=new t,this.stats.dom.style.position="absolute",this.stats.dom.style.left="0px",this.stats.dom.style.top="0px",e.canvas.parentElement.appendChild(this.stats.dom),this.viewer=e,this.viewer.addEventListener("render",this.updateStats),this.viewer.addEventListener("animate",this.updateViewer)}dispose(){this.viewer.removeEventListener("render",this.updateStats),this.viewer.removeEventListener("animate",this.updateViewer),this.stats.dom.remove()
|
|
24
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ODA.Three)}(this,function(e){"use strict";var t=function(){var e=0,i=document.createElement("div");function n(e){return i.appendChild(e.dom),e}function a(t){for(var n=0;n<i.children.length;n++)i.children[n].style.display=n===t?"block":"none";e=t}i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(t){t.preventDefault(),a(++e%i.children.length)},!1);var l=(performance||Date).now(),s=l,o=0,r=n(new t.Panel("FPS","#0ff","#002")),d=n(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var f=n(new t.Panel("MB","#f08","#201"));return a(0),{REVISION:16,dom:i,addPanel:n,showPanel:a,begin:function(){l=(performance||Date).now()},end:function(){o++;var e=(performance||Date).now();if(d.update(e-l,200),e>=s+1e3&&(r.update(1e3*o/(e-s),100),s=e,o=0,f)){var t=performance.memory;f.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){l=this.end()},domElement:i,setMode:a}};t.Panel=function(e,t,i){var n=1/0,a=0,l=Math.round,s=l(window.devicePixelRatio||1),o=80*s,r=48*s,d=3*s,f=2*s,p=3*s,c=15*s,h=74*s,u=30*s,m=document.createElement("canvas");m.width=o,m.height=r,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*s+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=i,v.fillRect(0,0,o,r),v.fillStyle=t,v.fillText(e,d,f),v.fillRect(p,c,h,u),v.fillStyle=i,v.globalAlpha=.9,v.fillRect(p,c,h,u),{dom:m,update:function(r,w){n=Math.min(n,r),a=Math.max(a,r),v.fillStyle=i,v.globalAlpha=1,v.fillRect(0,0,o,c),v.fillStyle=t,v.fillText(l(r)+" "+e+" ("+l(n)+"-"+l(a)+")",d,f),v.drawImage(m,p+s,c,h-s,u,p,c,h-s,u),v.fillRect(p+h-s,c,s,u),v.fillStyle=i,v.globalAlpha=.9,v.fillRect(p+h-s,c,s,l((1-r/w)*u))}}};class i{constructor(e){this.updateStats=()=>{this.stats.update()},this.updateViewer=()=>{this.viewer.update()},this.stats=new t,this.stats.dom.style.position="absolute",this.stats.dom.style.left="0px",this.stats.dom.style.top="0px",e.canvas.parentElement.appendChild(this.stats.dom),this.viewer=e,this.viewer.addEventListener("render",this.updateStats),this.viewer.addEventListener("animate",this.updateViewer)}dispose(){this.viewer.removeEventListener("render",this.updateStats),this.viewer.removeEventListener("animate",this.updateViewer),this.stats.dom.remove()}}e.components.registerComponent("StatsPanelComponent",e=>new i(e))});
|
|
@@ -45,7 +45,6 @@ class StatsPanelComponent {
|
|
|
45
45
|
this.viewer.removeEventListener("render", this.updateStats);
|
|
46
46
|
this.viewer.removeEventListener("animate", this.updateViewer);
|
|
47
47
|
this.stats.dom.remove();
|
|
48
|
-
this.stats = undefined;
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
components.registerComponent("StatsPanelComponent", (viewer) => new StatsPanelComponent(viewer));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../extensions/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n this.stats.dom.style.left = \"0px\";\n this.stats.dom.style.top = \"0px\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"render\", this.updateStats);\n this.viewer.addEventListener(\"animate\", this.updateViewer);\n }\n\n dispose() {\n this.viewer.removeEventListener(\"render\", this.updateStats);\n this.viewer.removeEventListener(\"animate\", this.updateViewer);\n\n this.stats.dom.remove();\n
|
|
1
|
+
{"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../extensions/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2026, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2026 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n this.stats.dom.style.left = \"0px\";\n this.stats.dom.style.top = \"0px\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"render\", this.updateStats);\n this.viewer.addEventListener(\"animate\", this.updateViewer);\n }\n\n dispose() {\n this.viewer.removeEventListener(\"render\", this.updateStats);\n this.viewer.removeEventListener(\"animate\", this.updateViewer);\n\n this.stats.dom.remove();\n }\n\n updateStats = () => {\n this.stats.update();\n };\n\n updateViewer = () => {\n this.viewer.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAmB1B,IAAA,CAAA,WAAW,GAAG,MAAK;AACjB,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACrB,QAAA,CAAC;QAED,IAAA,CAAA,YAAY,GAAG,MAAK;AAClB,YAAA,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;AACtB,QAAA,CAAC;AAxBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;QAC1C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK;QACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK;AAChC,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;QACxD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;IAC5D;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC;QAC3D,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC;AAE7D,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;IACzB;AASD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -2451,6 +2451,11 @@
|
|
|
2451
2451
|
constructor(viewer) {
|
|
2452
2452
|
super();
|
|
2453
2453
|
this.viewer = viewer;
|
|
2454
|
+
this.manager = null;
|
|
2455
|
+
}
|
|
2456
|
+
dispose() {
|
|
2457
|
+
if (this.manager)
|
|
2458
|
+
this.manager.dispose();
|
|
2454
2459
|
}
|
|
2455
2460
|
isSupport(file) {
|
|
2456
2461
|
return (typeof file === "object" &&
|
|
@@ -2460,8 +2465,8 @@
|
|
|
2460
2465
|
}
|
|
2461
2466
|
async load(model) {
|
|
2462
2467
|
const url = `${model.httpClient.serverUrl}${model.path}/${model.database}`;
|
|
2463
|
-
|
|
2464
|
-
const loader = new GLTFLoader(manager);
|
|
2468
|
+
this.manager = new viewerThree.GLTFLoadingManager(url);
|
|
2469
|
+
const loader = new GLTFLoader(this.manager);
|
|
2465
2470
|
loader.setRequestHeader(model.httpClient.headers);
|
|
2466
2471
|
const progress = (event) => {
|
|
2467
2472
|
const { lengthComputable, loaded, total } = event;
|