@inweb/viewer-three 26.10.6 → 26.11.1
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/plugins/components/AxesHelperComponent.js +23 -1
- package/dist/plugins/components/AxesHelperComponent.js.map +1 -1
- package/dist/plugins/components/AxesHelperComponent.min.js +1 -1
- package/dist/plugins/components/AxesHelperComponent.module.js +24 -2
- package/dist/plugins/components/AxesHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.js +18 -0
- package/dist/plugins/components/ExtentsHelperComponent.js.map +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.min.js +1 -1
- package/dist/plugins/components/ExtentsHelperComponent.module.js +19 -1
- package/dist/plugins/components/ExtentsHelperComponent.module.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.js +2 -3
- package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.min.js +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.module.js +2 -3
- package/dist/plugins/loaders/GLTFCloudLoader.module.js.map +1 -1
- package/dist/plugins/loaders/GLTFFileLoader.js +2499 -0
- package/dist/plugins/loaders/GLTFFileLoader.js.map +1 -0
- package/dist/plugins/loaders/GLTFFileLoader.min.js +24 -0
- package/dist/plugins/loaders/GLTFFileLoader.module.js +74 -0
- package/dist/plugins/loaders/GLTFFileLoader.module.js.map +1 -0
- package/dist/plugins/loaders/IFCXLoader.js +5 -7
- package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.min.js +1 -1
- package/dist/plugins/loaders/IFCXLoader.module.js +5 -7
- package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/plugins/loaders/PotreeLoader.js +1 -2
- package/dist/plugins/loaders/PotreeLoader.js.map +1 -1
- package/dist/plugins/loaders/PotreeLoader.min.js +1 -1
- package/dist/plugins/loaders/PotreeLoader.module.js +1 -2
- package/dist/plugins/loaders/PotreeLoader.module.js.map +1 -1
- package/dist/viewer-three.js +770 -2777
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +609 -206
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/Viewer.d.ts +27 -20
- package/lib/Viewer/commands/GetSelected2.d.ts +2 -0
- package/lib/Viewer/commands/SelectModel.d.ts +1 -1
- package/lib/Viewer/commands/SetSelected2.d.ts +2 -0
- package/lib/Viewer/components/index.d.ts +6 -6
- package/lib/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.d.ts +0 -1
- package/lib/Viewer/loaders/GLTFBinaryExtension.d.ts +5 -0
- package/lib/Viewer/loaders/GLTFCloudDynamicLoader.d.ts +2 -2
- package/lib/Viewer/loaders/{GLTFFileLoader.d.ts → GLTFFileDynamicLoader.d.ts} +7 -1
- package/lib/Viewer/loaders/GLTFLoadingManager.d.ts +4 -3
- package/lib/Viewer/loaders/RangesLoader.d.ts +15 -0
- package/lib/Viewer/loaders/index.d.ts +22 -14
- package/lib/Viewer/models/IModelImpl.d.ts +6 -8
- package/lib/Viewer/models/ModelImpl.d.ts +3 -5
- package/package.json +5 -5
- package/plugins/components/AxesHelperComponent.ts +31 -2
- package/plugins/components/ExtentsHelperComponent.ts +25 -0
- package/plugins/loaders/GLTFCloudLoader.ts +2 -3
- package/{src/Viewer → plugins}/loaders/GLTFFileLoader.ts +21 -12
- package/plugins/loaders/IFCX/IFCXCloudLoader.ts +5 -5
- package/plugins/loaders/IFCX/IFCXFileLoader.ts +3 -4
- package/plugins/loaders/Potree/PotreeFileLoader.ts +3 -4
- package/src/Viewer/Viewer.ts +120 -88
- package/src/Viewer/commands/ClearSelected.ts +3 -1
- package/src/Viewer/commands/GetModels.ts +1 -1
- package/src/Viewer/commands/GetSelected.ts +2 -2
- package/src/Viewer/commands/GetSelected2.ts +34 -0
- package/src/Viewer/commands/HideSelected.ts +3 -1
- package/src/Viewer/commands/SelectModel.ts +5 -5
- package/src/Viewer/commands/SetSelected.ts +9 -10
- package/src/Viewer/commands/SetSelected2.ts +42 -0
- package/src/Viewer/commands/ZoomToObjects.ts +5 -6
- package/src/Viewer/commands/ZoomToSelected.ts +3 -1
- package/src/Viewer/commands/index.ts +4 -0
- package/src/Viewer/components/CameraComponent.ts +6 -1
- package/src/Viewer/components/ExtentsComponent.ts +4 -1
- package/src/Viewer/components/SelectionComponent.ts +2 -0
- package/src/Viewer/components/index.ts +6 -6
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +253 -22
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +20 -10
- package/src/Viewer/loaders/DynamicGltfLoader/GltfStructure.js +3 -1
- package/src/Viewer/loaders/GLTFBinaryExtension.ts +91 -0
- package/src/Viewer/loaders/GLTFCloudDynamicLoader.ts +13 -19
- package/src/Viewer/loaders/GLTFFileDynamicLoader.ts +145 -0
- package/src/Viewer/loaders/GLTFLoadingManager.ts +5 -4
- package/src/Viewer/loaders/RangesLoader.ts +95 -0
- package/src/Viewer/loaders/index.ts +24 -16
- package/src/Viewer/models/IModelImpl.ts +8 -9
- package/src/Viewer/models/ModelImpl.ts +30 -17
|
@@ -30,25 +30,47 @@
|
|
|
30
30
|
class AxesHelperComponent {
|
|
31
31
|
constructor(viewer) {
|
|
32
32
|
this.syncHelper = () => {
|
|
33
|
+
this.modelHelpers.forEach((helper) => {
|
|
34
|
+
helper.removeFromParent();
|
|
35
|
+
helper.dispose();
|
|
36
|
+
});
|
|
37
|
+
this.modelHelpers.length = 0;
|
|
33
38
|
this.axesHelper1.removeFromParent();
|
|
34
39
|
this.axesHelper2.removeFromParent();
|
|
35
40
|
const size = this.viewer.extents.getSize(new three.Vector3()).length();
|
|
36
41
|
const center = this.viewer.extents.getCenter(new three.Vector3());
|
|
37
42
|
this.axesHelper1.position.set(0, 0, 0);
|
|
38
|
-
this.axesHelper1.scale.setScalar(size);
|
|
43
|
+
this.axesHelper1.scale.setScalar(size * 1.25);
|
|
39
44
|
this.axesHelper2.position.copy(center);
|
|
40
45
|
this.axesHelper2.scale.setScalar(size);
|
|
41
46
|
this.viewer.helpers.add(this.axesHelper1);
|
|
42
47
|
this.viewer.helpers.add(this.axesHelper2);
|
|
48
|
+
if (this.viewer.models.length < 2)
|
|
49
|
+
return;
|
|
50
|
+
this.viewer.models.forEach((model) => {
|
|
51
|
+
const extents = model.getExtents(new three.Box3());
|
|
52
|
+
const size = extents.getSize(new three.Vector3()).length();
|
|
53
|
+
const center = extents.getCenter(new three.Vector3());
|
|
54
|
+
const helper = new three.AxesHelper(size);
|
|
55
|
+
helper.position.copy(center);
|
|
56
|
+
this.modelHelpers.push(helper);
|
|
57
|
+
this.viewer.helpers.add(helper);
|
|
58
|
+
});
|
|
43
59
|
};
|
|
44
60
|
this.axesHelper1 = new three.AxesHelper(1);
|
|
45
61
|
this.axesHelper2 = new three.AxesHelper(1);
|
|
62
|
+
this.modelHelpers = [];
|
|
63
|
+
this.axesHelper1.setColors("#ccc", "#ccc", "#cccb");
|
|
46
64
|
this.viewer = viewer;
|
|
47
65
|
this.viewer.addEventListener("initialize", this.syncHelper);
|
|
48
66
|
this.viewer.addEventListener("geometryend", this.syncHelper);
|
|
49
67
|
this.viewer.addEventListener("clear", this.syncHelper);
|
|
50
68
|
}
|
|
51
69
|
dispose() {
|
|
70
|
+
this.modelHelpers.forEach((helper) => {
|
|
71
|
+
helper.removeFromParent();
|
|
72
|
+
helper.dispose();
|
|
73
|
+
});
|
|
52
74
|
this.axesHelper1.removeFromParent();
|
|
53
75
|
this.axesHelper1.dispose();
|
|
54
76
|
this.axesHelper2.removeFromParent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxesHelperComponent.js","sources":["../../../plugins/components/AxesHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { AxesHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass AxesHelperComponent implements IComponent {\n private viewer: Viewer;\n private axesHelper1: AxesHelper;\n private axesHelper2: AxesHelper;\n\n constructor(viewer: Viewer) {\n this.axesHelper1 = new AxesHelper(1);\n this.axesHelper2 = new AxesHelper(1);\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"initialize\", this.syncHelper);\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.axesHelper1.removeFromParent();\n this.axesHelper1.dispose();\n\n this.axesHelper2.removeFromParent();\n this.axesHelper2.dispose();\n\n this.viewer.removeEventListener(\"initialize\", this.syncHelper);\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.axesHelper1.removeFromParent();\n this.axesHelper2.removeFromParent();\n\n const size = this.viewer.extents.getSize(new Vector3()).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n this.axesHelper1.position.set(0, 0, 0);\n this.axesHelper1.scale.setScalar(size);\n\n this.axesHelper2.position.copy(center);\n this.axesHelper2.scale.setScalar(size);\n\n this.viewer.helpers.add(this.axesHelper1);\n this.viewer.helpers.add(this.axesHelper2);\n };\n}\n\ncomponents.registerComponent(\"AxesHelperComponent\", (viewer) => new AxesHelperComponent(viewer));\n"],"names":["Vector3","AxesHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"AxesHelperComponent.js","sources":["../../../plugins/components/AxesHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { AxesHelper, Box3, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass AxesHelperComponent implements IComponent {\n private viewer: Viewer;\n private axesHelper1: AxesHelper;\n private axesHelper2: AxesHelper;\n private modelHelpers: AxesHelper[];\n\n constructor(viewer: Viewer) {\n this.axesHelper1 = new AxesHelper(1);\n this.axesHelper2 = new AxesHelper(1);\n this.modelHelpers = [];\n\n this.axesHelper1.setColors(\"#ccc\", \"#ccc\", \"#cccb\");\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"initialize\", this.syncHelper);\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.axesHelper1.removeFromParent();\n this.axesHelper1.dispose();\n\n this.axesHelper2.removeFromParent();\n this.axesHelper2.dispose();\n\n this.viewer.removeEventListener(\"initialize\", this.syncHelper);\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.axesHelper1.removeFromParent();\n this.axesHelper2.removeFromParent();\n\n const size = this.viewer.extents.getSize(new Vector3()).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n this.axesHelper1.position.set(0, 0, 0);\n this.axesHelper1.scale.setScalar(size * 1.25);\n\n this.axesHelper2.position.copy(center);\n this.axesHelper2.scale.setScalar(size);\n\n this.viewer.helpers.add(this.axesHelper1);\n this.viewer.helpers.add(this.axesHelper2);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n const size = extents.getSize(new Vector3()).length();\n const center = extents.getCenter(new Vector3());\n\n const helper = new AxesHelper(size);\n helper.position.copy(center);\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"AxesHelperComponent\", (viewer) => new AxesHelperComponent(viewer));\n"],"names":["Vector3","Box3","AxesHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,mBAAmB,CAAA;IAMvB,IAAA,WAAA,CAAY,MAAc,EAAA;YA8B1B,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,I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UAAU,CAAC;YAC9D,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;IAsCD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,s){"use strict";class t{constructor(s){this.syncHelper=()=>{this.axesHelper1.removeFromParent(),this.axesHelper2.removeFromParent();const s=this.viewer.extents.getSize(new e.Vector3).length(),t=this.viewer.extents.getCenter(new e.Vector3);this.axesHelper1.position.set(0,0,0),this.axesHelper1.scale.setScalar(s),this.axesHelper2.position.copy(t),this.axesHelper2.scale.setScalar(s),this.viewer.helpers.add(this.axesHelper1),this.viewer.helpers.add(this.axesHelper2)},this.axesHelper1=new e.AxesHelper(1),this.axesHelper2=new e.AxesHelper(1),this.viewer=s,this.viewer.addEventListener("initialize",this.syncHelper),this.viewer.addEventListener("geometryend",this.syncHelper),this.viewer.addEventListener("clear",this.syncHelper)}dispose(){this.axesHelper1.removeFromParent(),this.axesHelper1.dispose(),this.axesHelper2.removeFromParent(),this.axesHelper2.dispose(),this.viewer.removeEventListener("initialize",this.syncHelper),this.viewer.removeEventListener("geometryend",this.syncHelper),this.viewer.removeEventListener("clear",this.syncHelper)}}s.components.registerComponent("AxesHelperComponent",e=>new t(e))});
|
|
24
|
+
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,s){"use strict";class t{constructor(s){this.syncHelper=()=>{this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.modelHelpers.length=0,this.axesHelper1.removeFromParent(),this.axesHelper2.removeFromParent();const s=this.viewer.extents.getSize(new e.Vector3).length(),t=this.viewer.extents.getCenter(new e.Vector3);this.axesHelper1.position.set(0,0,0),this.axesHelper1.scale.setScalar(1.25*s),this.axesHelper2.position.copy(t),this.axesHelper2.scale.setScalar(s),this.viewer.helpers.add(this.axesHelper1),this.viewer.helpers.add(this.axesHelper2),this.viewer.models.length<2||this.viewer.models.forEach(s=>{const t=s.getExtents(new e.Box3),r=t.getSize(new e.Vector3).length(),i=t.getCenter(new e.Vector3),n=new e.AxesHelper(r);n.position.copy(i),this.modelHelpers.push(n),this.viewer.helpers.add(n)})},this.axesHelper1=new e.AxesHelper(1),this.axesHelper2=new e.AxesHelper(1),this.modelHelpers=[],this.axesHelper1.setColors("#ccc","#ccc","#cccb"),this.viewer=s,this.viewer.addEventListener("initialize",this.syncHelper),this.viewer.addEventListener("geometryend",this.syncHelper),this.viewer.addEventListener("clear",this.syncHelper)}dispose(){this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.axesHelper1.removeFromParent(),this.axesHelper1.dispose(),this.axesHelper2.removeFromParent(),this.axesHelper2.dispose(),this.viewer.removeEventListener("initialize",this.syncHelper),this.viewer.removeEventListener("geometryend",this.syncHelper),this.viewer.removeEventListener("clear",this.syncHelper)}}s.components.registerComponent("AxesHelperComponent",e=>new t(e))});
|
|
@@ -21,31 +21,53 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
import { Vector3, AxesHelper } from 'three';
|
|
24
|
+
import { Vector3, Box3, AxesHelper } from 'three';
|
|
25
25
|
import { components } from '@inweb/viewer-three';
|
|
26
26
|
|
|
27
27
|
class AxesHelperComponent {
|
|
28
28
|
constructor(viewer) {
|
|
29
29
|
this.syncHelper = () => {
|
|
30
|
+
this.modelHelpers.forEach((helper) => {
|
|
31
|
+
helper.removeFromParent();
|
|
32
|
+
helper.dispose();
|
|
33
|
+
});
|
|
34
|
+
this.modelHelpers.length = 0;
|
|
30
35
|
this.axesHelper1.removeFromParent();
|
|
31
36
|
this.axesHelper2.removeFromParent();
|
|
32
37
|
const size = this.viewer.extents.getSize(new Vector3()).length();
|
|
33
38
|
const center = this.viewer.extents.getCenter(new Vector3());
|
|
34
39
|
this.axesHelper1.position.set(0, 0, 0);
|
|
35
|
-
this.axesHelper1.scale.setScalar(size);
|
|
40
|
+
this.axesHelper1.scale.setScalar(size * 1.25);
|
|
36
41
|
this.axesHelper2.position.copy(center);
|
|
37
42
|
this.axesHelper2.scale.setScalar(size);
|
|
38
43
|
this.viewer.helpers.add(this.axesHelper1);
|
|
39
44
|
this.viewer.helpers.add(this.axesHelper2);
|
|
45
|
+
if (this.viewer.models.length < 2)
|
|
46
|
+
return;
|
|
47
|
+
this.viewer.models.forEach((model) => {
|
|
48
|
+
const extents = model.getExtents(new Box3());
|
|
49
|
+
const size = extents.getSize(new Vector3()).length();
|
|
50
|
+
const center = extents.getCenter(new Vector3());
|
|
51
|
+
const helper = new AxesHelper(size);
|
|
52
|
+
helper.position.copy(center);
|
|
53
|
+
this.modelHelpers.push(helper);
|
|
54
|
+
this.viewer.helpers.add(helper);
|
|
55
|
+
});
|
|
40
56
|
};
|
|
41
57
|
this.axesHelper1 = new AxesHelper(1);
|
|
42
58
|
this.axesHelper2 = new AxesHelper(1);
|
|
59
|
+
this.modelHelpers = [];
|
|
60
|
+
this.axesHelper1.setColors("#ccc", "#ccc", "#cccb");
|
|
43
61
|
this.viewer = viewer;
|
|
44
62
|
this.viewer.addEventListener("initialize", this.syncHelper);
|
|
45
63
|
this.viewer.addEventListener("geometryend", this.syncHelper);
|
|
46
64
|
this.viewer.addEventListener("clear", this.syncHelper);
|
|
47
65
|
}
|
|
48
66
|
dispose() {
|
|
67
|
+
this.modelHelpers.forEach((helper) => {
|
|
68
|
+
helper.removeFromParent();
|
|
69
|
+
helper.dispose();
|
|
70
|
+
});
|
|
49
71
|
this.axesHelper1.removeFromParent();
|
|
50
72
|
this.axesHelper1.dispose();
|
|
51
73
|
this.axesHelper2.removeFromParent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxesHelperComponent.module.js","sources":["../../../plugins/components/AxesHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { AxesHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass AxesHelperComponent implements IComponent {\n private viewer: Viewer;\n private axesHelper1: AxesHelper;\n private axesHelper2: AxesHelper;\n\n constructor(viewer: Viewer) {\n this.axesHelper1 = new AxesHelper(1);\n this.axesHelper2 = new AxesHelper(1);\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"initialize\", this.syncHelper);\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.axesHelper1.removeFromParent();\n this.axesHelper1.dispose();\n\n this.axesHelper2.removeFromParent();\n this.axesHelper2.dispose();\n\n this.viewer.removeEventListener(\"initialize\", this.syncHelper);\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.axesHelper1.removeFromParent();\n this.axesHelper2.removeFromParent();\n\n const size = this.viewer.extents.getSize(new Vector3()).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n this.axesHelper1.position.set(0, 0, 0);\n this.axesHelper1.scale.setScalar(size);\n\n this.axesHelper2.position.copy(center);\n this.axesHelper2.scale.setScalar(size);\n\n this.viewer.helpers.add(this.axesHelper1);\n this.viewer.helpers.add(this.axesHelper2);\n };\n}\n\ncomponents.registerComponent(\"AxesHelperComponent\", (viewer) => new AxesHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"AxesHelperComponent.module.js","sources":["../../../plugins/components/AxesHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { AxesHelper, Box3, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass AxesHelperComponent implements IComponent {\n private viewer: Viewer;\n private axesHelper1: AxesHelper;\n private axesHelper2: AxesHelper;\n private modelHelpers: AxesHelper[];\n\n constructor(viewer: Viewer) {\n this.axesHelper1 = new AxesHelper(1);\n this.axesHelper2 = new AxesHelper(1);\n this.modelHelpers = [];\n\n this.axesHelper1.setColors(\"#ccc\", \"#ccc\", \"#cccb\");\n\n this.viewer = viewer;\n this.viewer.addEventListener(\"initialize\", this.syncHelper);\n this.viewer.addEventListener(\"geometryend\", this.syncHelper);\n this.viewer.addEventListener(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.axesHelper1.removeFromParent();\n this.axesHelper1.dispose();\n\n this.axesHelper2.removeFromParent();\n this.axesHelper2.dispose();\n\n this.viewer.removeEventListener(\"initialize\", this.syncHelper);\n this.viewer.removeEventListener(\"geometryend\", this.syncHelper);\n this.viewer.removeEventListener(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.axesHelper1.removeFromParent();\n this.axesHelper2.removeFromParent();\n\n const size = this.viewer.extents.getSize(new Vector3()).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n this.axesHelper1.position.set(0, 0, 0);\n this.axesHelper1.scale.setScalar(size * 1.25);\n\n this.axesHelper2.position.copy(center);\n this.axesHelper2.scale.setScalar(size);\n\n this.viewer.helpers.add(this.axesHelper1);\n this.viewer.helpers.add(this.axesHelper2);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n const size = extents.getSize(new Vector3()).length();\n const center = extents.getCenter(new Vector3());\n\n const helper = new AxesHelper(size);\n helper.position.copy(center);\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"AxesHelperComponent\", (viewer) => new AxesHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAMvB,IAAA,WAAA,CAAY,MAAc,EAAA;QA8B1B,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,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;AACnC,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;AAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;AAChE,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,EAAE,CAAC;AAE3D,YAAA,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;YAE7C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;YACtC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;YAEtC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC;YACzC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAA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AAC,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;AAEF,QAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;AACnC,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;AAE1B,QAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;AACnC,QAAA,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;QAE1B,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;QAC9D,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;AAsCD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -30,13 +30,27 @@
|
|
|
30
30
|
class ExtentsHelperComponent {
|
|
31
31
|
constructor(viewer) {
|
|
32
32
|
this.syncHelper = () => {
|
|
33
|
+
this.modelHelpers.forEach((helper) => {
|
|
34
|
+
helper.removeFromParent();
|
|
35
|
+
helper.dispose();
|
|
36
|
+
});
|
|
37
|
+
this.modelHelpers.length = 0;
|
|
33
38
|
this.boxHelper.removeFromParent();
|
|
34
39
|
if (this.viewer.extents.isEmpty())
|
|
35
40
|
return;
|
|
36
41
|
this.boxHelper.box = this.viewer.extents.clone();
|
|
37
42
|
this.viewer.helpers.add(this.boxHelper);
|
|
43
|
+
if (this.viewer.models.length < 2)
|
|
44
|
+
return;
|
|
45
|
+
this.viewer.models.forEach((model) => {
|
|
46
|
+
const extents = model.getExtents(new three.Box3());
|
|
47
|
+
const helper = new three.Box3Helper(extents, "#ff0000");
|
|
48
|
+
this.modelHelpers.push(helper);
|
|
49
|
+
this.viewer.helpers.add(helper);
|
|
50
|
+
});
|
|
38
51
|
};
|
|
39
52
|
this.boxHelper = new three.Box3Helper(new three.Box3(), "#ff0000");
|
|
53
|
+
this.modelHelpers = [];
|
|
40
54
|
this.viewer = viewer;
|
|
41
55
|
this.viewer.on("geometryend", this.syncHelper);
|
|
42
56
|
this.viewer.on("clear", this.syncHelper);
|
|
@@ -47,6 +61,10 @@
|
|
|
47
61
|
this.viewer.on("showall", this.syncHelper);
|
|
48
62
|
}
|
|
49
63
|
dispose() {
|
|
64
|
+
this.modelHelpers.forEach((helper) => {
|
|
65
|
+
helper.removeFromParent();
|
|
66
|
+
helper.dispose();
|
|
67
|
+
});
|
|
50
68
|
this.boxHelper.removeFromParent();
|
|
51
69
|
this.boxHelper.dispose();
|
|
52
70
|
this.viewer.off("geometryend", this.syncHelper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtentsHelperComponent.js","sources":["../../../plugins/components/ExtentsHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { Box3, Box3Helper } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass ExtentsHelperComponent implements IComponent {\n private viewer: Viewer;\n private boxHelper: Box3Helper;\n\n constructor(viewer: Viewer) {\n this.boxHelper = new Box3Helper(new Box3(), \"#ff0000\");\n this.viewer = viewer;\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n this.viewer.on(\"explode\", this.syncHelper);\n this.viewer.on(\"hide\", this.syncHelper);\n this.viewer.on(\"isolate\", this.syncHelper);\n this.viewer.on(\"show\", this.syncHelper);\n this.viewer.on(\"showall\", this.syncHelper);\n }\n\n dispose() {\n this.boxHelper.removeFromParent();\n this.boxHelper.dispose();\n\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n this.viewer.off(\"explode\", this.syncHelper);\n this.viewer.off(\"hide\", this.syncHelper);\n this.viewer.off(\"isolate\", this.syncHelper);\n this.viewer.off(\"show\", this.syncHelper);\n this.viewer.off(\"showall\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.boxHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n this.boxHelper.box = this.viewer.extents.clone();\n this.viewer.helpers.add(this.boxHelper);\n };\n}\n\ncomponents.registerComponent(\"ExtentsHelperComponent\", (viewer) => new ExtentsHelperComponent(viewer));\n"],"names":["
|
|
1
|
+
{"version":3,"file":"ExtentsHelperComponent.js","sources":["../../../plugins/components/ExtentsHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { Box3, Box3Helper } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass ExtentsHelperComponent implements IComponent {\n private viewer: Viewer;\n private boxHelper: Box3Helper;\n private modelHelpers: Box3Helper[];\n\n constructor(viewer: Viewer) {\n this.boxHelper = new Box3Helper(new Box3(), \"#ff0000\");\n this.modelHelpers = [];\n\n this.viewer = viewer;\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n this.viewer.on(\"explode\", this.syncHelper);\n this.viewer.on(\"hide\", this.syncHelper);\n this.viewer.on(\"isolate\", this.syncHelper);\n this.viewer.on(\"show\", this.syncHelper);\n this.viewer.on(\"showall\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.boxHelper.removeFromParent();\n this.boxHelper.dispose();\n\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n this.viewer.off(\"explode\", this.syncHelper);\n this.viewer.off(\"hide\", this.syncHelper);\n this.viewer.off(\"isolate\", this.syncHelper);\n this.viewer.off(\"show\", this.syncHelper);\n this.viewer.off(\"showall\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.boxHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n this.boxHelper.box = this.viewer.extents.clone();\n this.viewer.helpers.add(this.boxHelper);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n\n const helper = new Box3Helper(extents, \"#ff0000\");\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"ExtentsHelperComponent\", (viewer) => new ExtentsHelperComponent(viewer));\n"],"names":["Box3","Box3Helper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,sBAAsB,CAAA;IAK1B,IAAA,WAAA,CAAY,MAAc,EAAA;YAgC1B,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,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;IAEjC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;oBAAE;IAEnC,YAAA,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE;gBAChD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;gBAEvC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;oBAAE;gBAEnC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;oBACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,IAAIA,UAAI,EAAE,CAAC;oBAE5C,MAAM,MAAM,GAAG,IAAIC,gBAAU,CAAC,OAAO,EAAE,SAAS,CAAC;IAEjD,gBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CA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AC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAC7C;IA2BD;AAEDE,0BAAU,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
!function(e,
|
|
24
|
+
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,s){"use strict";class i{constructor(s){this.syncHelper=()=>{this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.modelHelpers.length=0,this.boxHelper.removeFromParent(),this.viewer.extents.isEmpty()||(this.boxHelper.box=this.viewer.extents.clone(),this.viewer.helpers.add(this.boxHelper),this.viewer.models.length<2||this.viewer.models.forEach(s=>{const i=s.getExtents(new e.Box3),t=new e.Box3Helper(i,"#ff0000");this.modelHelpers.push(t),this.viewer.helpers.add(t)}))},this.boxHelper=new e.Box3Helper(new e.Box3,"#ff0000"),this.modelHelpers=[],this.viewer=s,this.viewer.on("geometryend",this.syncHelper),this.viewer.on("clear",this.syncHelper),this.viewer.on("explode",this.syncHelper),this.viewer.on("hide",this.syncHelper),this.viewer.on("isolate",this.syncHelper),this.viewer.on("show",this.syncHelper),this.viewer.on("showall",this.syncHelper)}dispose(){this.modelHelpers.forEach(e=>{e.removeFromParent(),e.dispose()}),this.boxHelper.removeFromParent(),this.boxHelper.dispose(),this.viewer.off("geometryend",this.syncHelper),this.viewer.off("clear",this.syncHelper),this.viewer.off("explode",this.syncHelper),this.viewer.off("hide",this.syncHelper),this.viewer.off("isolate",this.syncHelper),this.viewer.off("show",this.syncHelper),this.viewer.off("showall",this.syncHelper)}}s.components.registerComponent("ExtentsHelperComponent",e=>new i(e))});
|
|
@@ -21,19 +21,33 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
import {
|
|
24
|
+
import { Box3, Box3Helper } from 'three';
|
|
25
25
|
import { components } from '@inweb/viewer-three';
|
|
26
26
|
|
|
27
27
|
class ExtentsHelperComponent {
|
|
28
28
|
constructor(viewer) {
|
|
29
29
|
this.syncHelper = () => {
|
|
30
|
+
this.modelHelpers.forEach((helper) => {
|
|
31
|
+
helper.removeFromParent();
|
|
32
|
+
helper.dispose();
|
|
33
|
+
});
|
|
34
|
+
this.modelHelpers.length = 0;
|
|
30
35
|
this.boxHelper.removeFromParent();
|
|
31
36
|
if (this.viewer.extents.isEmpty())
|
|
32
37
|
return;
|
|
33
38
|
this.boxHelper.box = this.viewer.extents.clone();
|
|
34
39
|
this.viewer.helpers.add(this.boxHelper);
|
|
40
|
+
if (this.viewer.models.length < 2)
|
|
41
|
+
return;
|
|
42
|
+
this.viewer.models.forEach((model) => {
|
|
43
|
+
const extents = model.getExtents(new Box3());
|
|
44
|
+
const helper = new Box3Helper(extents, "#ff0000");
|
|
45
|
+
this.modelHelpers.push(helper);
|
|
46
|
+
this.viewer.helpers.add(helper);
|
|
47
|
+
});
|
|
35
48
|
};
|
|
36
49
|
this.boxHelper = new Box3Helper(new Box3(), "#ff0000");
|
|
50
|
+
this.modelHelpers = [];
|
|
37
51
|
this.viewer = viewer;
|
|
38
52
|
this.viewer.on("geometryend", this.syncHelper);
|
|
39
53
|
this.viewer.on("clear", this.syncHelper);
|
|
@@ -44,6 +58,10 @@ class ExtentsHelperComponent {
|
|
|
44
58
|
this.viewer.on("showall", this.syncHelper);
|
|
45
59
|
}
|
|
46
60
|
dispose() {
|
|
61
|
+
this.modelHelpers.forEach((helper) => {
|
|
62
|
+
helper.removeFromParent();
|
|
63
|
+
helper.dispose();
|
|
64
|
+
});
|
|
47
65
|
this.boxHelper.removeFromParent();
|
|
48
66
|
this.boxHelper.dispose();
|
|
49
67
|
this.viewer.off("geometryend", this.syncHelper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtentsHelperComponent.module.js","sources":["../../../plugins/components/ExtentsHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { Box3, Box3Helper } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass ExtentsHelperComponent implements IComponent {\n private viewer: Viewer;\n private boxHelper: Box3Helper;\n\n constructor(viewer: Viewer) {\n this.boxHelper = new Box3Helper(new Box3(), \"#ff0000\");\n this.viewer = viewer;\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n this.viewer.on(\"explode\", this.syncHelper);\n this.viewer.on(\"hide\", this.syncHelper);\n this.viewer.on(\"isolate\", this.syncHelper);\n this.viewer.on(\"show\", this.syncHelper);\n this.viewer.on(\"showall\", this.syncHelper);\n }\n\n dispose() {\n this.boxHelper.removeFromParent();\n this.boxHelper.dispose();\n\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n this.viewer.off(\"explode\", this.syncHelper);\n this.viewer.off(\"hide\", this.syncHelper);\n this.viewer.off(\"isolate\", this.syncHelper);\n this.viewer.off(\"show\", this.syncHelper);\n this.viewer.off(\"showall\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.boxHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n this.boxHelper.box = this.viewer.extents.clone();\n this.viewer.helpers.add(this.boxHelper);\n };\n}\n\ncomponents.registerComponent(\"ExtentsHelperComponent\", (viewer) => new ExtentsHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"ExtentsHelperComponent.module.js","sources":["../../../plugins/components/ExtentsHelperComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, 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-2025 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 { Box3, Box3Helper } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass ExtentsHelperComponent implements IComponent {\n private viewer: Viewer;\n private boxHelper: Box3Helper;\n private modelHelpers: Box3Helper[];\n\n constructor(viewer: Viewer) {\n this.boxHelper = new Box3Helper(new Box3(), \"#ff0000\");\n this.modelHelpers = [];\n\n this.viewer = viewer;\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n this.viewer.on(\"explode\", this.syncHelper);\n this.viewer.on(\"hide\", this.syncHelper);\n this.viewer.on(\"isolate\", this.syncHelper);\n this.viewer.on(\"show\", this.syncHelper);\n this.viewer.on(\"showall\", this.syncHelper);\n }\n\n dispose() {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n\n this.boxHelper.removeFromParent();\n this.boxHelper.dispose();\n\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n this.viewer.off(\"explode\", this.syncHelper);\n this.viewer.off(\"hide\", this.syncHelper);\n this.viewer.off(\"isolate\", this.syncHelper);\n this.viewer.off(\"show\", this.syncHelper);\n this.viewer.off(\"showall\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.modelHelpers.forEach((helper) => {\n helper.removeFromParent();\n helper.dispose();\n });\n this.modelHelpers.length = 0;\n\n this.boxHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n this.boxHelper.box = this.viewer.extents.clone();\n this.viewer.helpers.add(this.boxHelper);\n\n if (this.viewer.models.length < 2) return;\n\n this.viewer.models.forEach((model) => {\n const extents = model.getExtents(new Box3());\n\n const helper = new Box3Helper(extents, \"#ff0000\");\n\n this.modelHelpers.push(helper);\n this.viewer.helpers.add(helper);\n });\n };\n}\n\ncomponents.registerComponent(\"ExtentsHelperCom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QACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;IAC7C;AA2BD;AAED,UAAU,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -2472,9 +2472,8 @@
|
|
|
2472
2472
|
if (!this.viewer.scene)
|
|
2473
2473
|
return this;
|
|
2474
2474
|
const modelImpl = new viewerThree.ModelImpl(gltf.scene);
|
|
2475
|
-
modelImpl.
|
|
2476
|
-
|
|
2477
|
-
this.viewer.scene.add(modelImpl.scene);
|
|
2475
|
+
modelImpl.id = model.file.id;
|
|
2476
|
+
this.viewer.scene.add(gltf.scene);
|
|
2478
2477
|
this.viewer.models.push(modelImpl);
|
|
2479
2478
|
this.viewer.syncOptions();
|
|
2480
2479
|
this.viewer.syncOverlay();
|