@inweb/viewer-three 26.10.6 → 26.12.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.
Files changed (153) hide show
  1. package/README.md +7 -4
  2. package/dist/{plugins → extensions}/components/AxesHelperComponent.js +23 -1
  3. package/dist/extensions/components/AxesHelperComponent.js.map +1 -0
  4. package/dist/extensions/components/AxesHelperComponent.min.js +24 -0
  5. package/dist/{plugins → extensions}/components/AxesHelperComponent.module.js +24 -2
  6. package/dist/extensions/components/AxesHelperComponent.module.js.map +1 -0
  7. package/dist/{plugins → extensions}/components/ExtentsHelperComponent.js +18 -0
  8. package/dist/extensions/components/ExtentsHelperComponent.js.map +1 -0
  9. package/dist/{plugins/components/AxesHelperComponent.min.js → extensions/components/ExtentsHelperComponent.min.js} +1 -1
  10. package/dist/{plugins → extensions}/components/ExtentsHelperComponent.module.js +19 -1
  11. package/dist/extensions/components/ExtentsHelperComponent.module.js.map +1 -0
  12. package/dist/extensions/components/GridHelperComponent.js.map +1 -0
  13. package/dist/extensions/components/GridHelperComponent.module.js.map +1 -0
  14. package/dist/extensions/components/InfoPanelComponent.js +170 -0
  15. package/dist/extensions/components/InfoPanelComponent.js.map +1 -0
  16. package/dist/extensions/components/InfoPanelComponent.min.js +24 -0
  17. package/dist/extensions/components/InfoPanelComponent.module.js +164 -0
  18. package/dist/extensions/components/InfoPanelComponent.module.js.map +1 -0
  19. package/dist/extensions/components/LightHelperComponent.js.map +1 -0
  20. package/dist/extensions/components/LightHelperComponent.module.js.map +1 -0
  21. package/dist/extensions/components/RoomEnvironmentComponent.js.map +1 -0
  22. package/dist/extensions/components/RoomEnvironmentComponent.module.js.map +1 -0
  23. package/dist/{plugins → extensions}/components/StatsPanelComponent.js +9 -3
  24. package/dist/extensions/components/StatsPanelComponent.js.map +1 -0
  25. package/dist/extensions/components/StatsPanelComponent.min.js +24 -0
  26. package/dist/{plugins → extensions}/components/StatsPanelComponent.module.js +9 -3
  27. package/dist/extensions/components/StatsPanelComponent.module.js.map +1 -0
  28. package/dist/{plugins → extensions}/loaders/GLTFCloudLoader.js +2 -3
  29. package/dist/extensions/loaders/GLTFCloudLoader.js.map +1 -0
  30. package/dist/{plugins → extensions}/loaders/GLTFCloudLoader.min.js +1 -1
  31. package/dist/{plugins → extensions}/loaders/GLTFCloudLoader.module.js +2 -3
  32. package/dist/extensions/loaders/GLTFCloudLoader.module.js.map +1 -0
  33. package/dist/extensions/loaders/GLTFFileLoader.js +2499 -0
  34. package/dist/extensions/loaders/GLTFFileLoader.js.map +1 -0
  35. package/dist/extensions/loaders/GLTFFileLoader.min.js +24 -0
  36. package/dist/extensions/loaders/GLTFFileLoader.module.js +74 -0
  37. package/dist/extensions/loaders/GLTFFileLoader.module.js.map +1 -0
  38. package/dist/{plugins → extensions}/loaders/IFCXLoader.js +5 -7
  39. package/dist/extensions/loaders/IFCXLoader.js.map +1 -0
  40. package/dist/{plugins → extensions}/loaders/IFCXLoader.min.js +1 -1
  41. package/dist/{plugins → extensions}/loaders/IFCXLoader.module.js +5 -7
  42. package/dist/extensions/loaders/IFCXLoader.module.js.map +1 -0
  43. package/dist/{plugins → extensions}/loaders/PotreeLoader.js +56 -6
  44. package/dist/extensions/loaders/PotreeLoader.js.map +1 -0
  45. package/dist/extensions/loaders/PotreeLoader.min.js +24 -0
  46. package/dist/{plugins → extensions}/loaders/PotreeLoader.module.js +53 -2
  47. package/dist/extensions/loaders/PotreeLoader.module.js.map +1 -0
  48. package/dist/viewer-three.js +1416 -2930
  49. package/dist/viewer-three.js.map +1 -1
  50. package/dist/viewer-three.min.js +8 -3
  51. package/dist/viewer-three.module.js +1205 -363
  52. package/dist/viewer-three.module.js.map +1 -1
  53. package/{plugins → extensions}/components/AxesHelperComponent.ts +31 -2
  54. package/{plugins → extensions}/components/ExtentsHelperComponent.ts +25 -0
  55. package/extensions/components/InfoPanelComponent.ts +197 -0
  56. package/{plugins → extensions}/components/StatsPanelComponent.ts +10 -3
  57. package/{plugins → extensions}/loaders/GLTFCloudLoader.ts +2 -3
  58. package/{src/Viewer → extensions}/loaders/GLTFFileLoader.ts +21 -12
  59. package/{plugins → extensions}/loaders/IFCX/IFCXCloudLoader.ts +5 -5
  60. package/{plugins → extensions}/loaders/IFCX/IFCXFileLoader.ts +3 -4
  61. package/{plugins → extensions}/loaders/Potree/PotreeFileLoader.ts +3 -4
  62. package/extensions/loaders/Potree/PotreeModelImpl.ts +108 -0
  63. package/lib/Viewer/Viewer.d.ts +28 -20
  64. package/lib/Viewer/commands/GetSelected2.d.ts +2 -0
  65. package/lib/Viewer/commands/SelectModel.d.ts +1 -1
  66. package/lib/Viewer/commands/SetSelected2.d.ts +2 -0
  67. package/lib/Viewer/components/InfoComponent.d.ts +22 -0
  68. package/lib/Viewer/components/SelectionComponent.d.ts +1 -3
  69. package/lib/Viewer/components/index.d.ts +6 -6
  70. package/lib/Viewer/draggers/MeasureLineDragger.d.ts +7 -1
  71. package/lib/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.d.ts +2 -1
  72. package/lib/Viewer/loaders/GLTFBinaryExtension.d.ts +5 -0
  73. package/lib/Viewer/loaders/GLTFCloudDynamicLoader.d.ts +2 -2
  74. package/lib/Viewer/loaders/{GLTFFileLoader.d.ts → GLTFFileDynamicLoader.d.ts} +7 -1
  75. package/lib/Viewer/loaders/GLTFLoadingManager.d.ts +4 -3
  76. package/lib/Viewer/loaders/RangesLoader.d.ts +15 -0
  77. package/lib/Viewer/loaders/index.d.ts +22 -14
  78. package/lib/Viewer/measurement/Snapper.d.ts +15 -0
  79. package/lib/Viewer/measurement/UnitConverter.d.ts +63 -0
  80. package/lib/Viewer/measurement/UnitFormatter.d.ts +4 -0
  81. package/lib/Viewer/models/IModelImpl.d.ts +11 -8
  82. package/lib/Viewer/models/ModelImpl.d.ts +9 -5
  83. package/package.json +11 -11
  84. package/src/Viewer/Viewer.ts +127 -88
  85. package/src/Viewer/commands/ClearSelected.ts +3 -1
  86. package/src/Viewer/commands/GetModels.ts +1 -1
  87. package/src/Viewer/commands/GetSelected.ts +2 -2
  88. package/{plugins/loaders/Potree/PotreeModelImpl.ts → src/Viewer/commands/GetSelected2.ts} +7 -9
  89. package/src/Viewer/commands/HideSelected.ts +3 -1
  90. package/src/Viewer/commands/SelectModel.ts +5 -5
  91. package/src/Viewer/commands/SetSelected.ts +9 -10
  92. package/src/Viewer/commands/SetSelected2.ts +42 -0
  93. package/src/Viewer/commands/ZoomToObjects.ts +5 -6
  94. package/src/Viewer/commands/ZoomToSelected.ts +3 -1
  95. package/src/Viewer/commands/index.ts +4 -0
  96. package/src/Viewer/components/CameraComponent.ts +6 -1
  97. package/src/Viewer/components/ExtentsComponent.ts +4 -1
  98. package/src/Viewer/components/InfoComponent.ts +187 -0
  99. package/src/Viewer/components/SelectionComponent.ts +7 -30
  100. package/src/Viewer/components/index.ts +8 -6
  101. package/src/Viewer/draggers/MeasureLineDragger.ts +84 -226
  102. package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +276 -39
  103. package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +45 -10
  104. package/src/Viewer/loaders/DynamicGltfLoader/GltfStructure.js +71 -2
  105. package/src/Viewer/loaders/GLTFBinaryExtension.ts +91 -0
  106. package/src/Viewer/loaders/GLTFCloudDynamicLoader.ts +13 -19
  107. package/src/Viewer/loaders/GLTFFileDynamicLoader.ts +145 -0
  108. package/src/Viewer/loaders/GLTFLoadingManager.ts +5 -4
  109. package/src/Viewer/loaders/RangesLoader.ts +105 -0
  110. package/src/Viewer/loaders/index.ts +24 -16
  111. package/src/Viewer/measurement/Snapper.ts +208 -0
  112. package/src/Viewer/measurement/UnitConverter.ts +47 -0
  113. package/src/Viewer/measurement/UnitFormatter.ts +95 -0
  114. package/src/Viewer/models/IModelImpl.ts +17 -8
  115. package/src/Viewer/models/ModelImpl.ts +205 -16
  116. package/src/index-umd.ts +1 -1
  117. package/dist/plugins/components/AxesHelperComponent.js.map +0 -1
  118. package/dist/plugins/components/AxesHelperComponent.module.js.map +0 -1
  119. package/dist/plugins/components/ExtentsHelperComponent.js.map +0 -1
  120. package/dist/plugins/components/ExtentsHelperComponent.min.js +0 -24
  121. package/dist/plugins/components/ExtentsHelperComponent.module.js.map +0 -1
  122. package/dist/plugins/components/GridHelperComponent.js.map +0 -1
  123. package/dist/plugins/components/GridHelperComponent.module.js.map +0 -1
  124. package/dist/plugins/components/LightHelperComponent.js.map +0 -1
  125. package/dist/plugins/components/LightHelperComponent.module.js.map +0 -1
  126. package/dist/plugins/components/RoomEnvironmentComponent.js.map +0 -1
  127. package/dist/plugins/components/RoomEnvironmentComponent.module.js.map +0 -1
  128. package/dist/plugins/components/StatsPanelComponent.js.map +0 -1
  129. package/dist/plugins/components/StatsPanelComponent.min.js +0 -24
  130. package/dist/plugins/components/StatsPanelComponent.module.js.map +0 -1
  131. package/dist/plugins/loaders/GLTFCloudLoader.js.map +0 -1
  132. package/dist/plugins/loaders/GLTFCloudLoader.module.js.map +0 -1
  133. package/dist/plugins/loaders/IFCXLoader.js.map +0 -1
  134. package/dist/plugins/loaders/IFCXLoader.module.js.map +0 -1
  135. package/dist/plugins/loaders/PotreeLoader.js.map +0 -1
  136. package/dist/plugins/loaders/PotreeLoader.min.js +0 -24
  137. package/dist/plugins/loaders/PotreeLoader.module.js.map +0 -1
  138. /package/dist/{plugins → extensions}/components/GridHelperComponent.js +0 -0
  139. /package/dist/{plugins → extensions}/components/GridHelperComponent.min.js +0 -0
  140. /package/dist/{plugins → extensions}/components/GridHelperComponent.module.js +0 -0
  141. /package/dist/{plugins → extensions}/components/LightHelperComponent.js +0 -0
  142. /package/dist/{plugins → extensions}/components/LightHelperComponent.min.js +0 -0
  143. /package/dist/{plugins → extensions}/components/LightHelperComponent.module.js +0 -0
  144. /package/dist/{plugins → extensions}/components/RoomEnvironmentComponent.js +0 -0
  145. /package/dist/{plugins → extensions}/components/RoomEnvironmentComponent.min.js +0 -0
  146. /package/dist/{plugins → extensions}/components/RoomEnvironmentComponent.module.js +0 -0
  147. /package/{plugins → extensions}/components/GridHelperComponent.ts +0 -0
  148. /package/{plugins → extensions}/components/LightHelperComponent.ts +0 -0
  149. /package/{plugins → extensions}/components/RoomEnvironmentComponent.ts +0 -0
  150. /package/{plugins → extensions}/loaders/IFCX/IFCXLoader.ts +0 -0
  151. /package/{plugins → extensions}/loaders/IFCX/index.ts +0 -0
  152. /package/{plugins → extensions}/loaders/IFCX/render.js +0 -0
  153. /package/{plugins → extensions}/loaders/Potree/index.ts +0 -0
@@ -22,21 +22,17 @@
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
24
  import { Box3, Object3D, Vector3 } from "three";
25
- import { ILoader } from "@inweb/viewer-core";
25
+ import { IInfo, Info } from "@inweb/viewer-core";
26
26
 
27
27
  import { IModelImpl } from "./IModelImpl";
28
- import { Viewer } from "../Viewer";
29
-
30
- // Basic model implementation.
28
+ import { convertUnits } from "../measurement/UnitConverter";
29
+ import { getDisplayUnit } from "../measurement/UnitFormatter";
31
30
 
32
31
  export class ModelImpl implements IModelImpl {
33
- public handle: string;
32
+ public id: string;
34
33
  public scene: Object3D;
35
- public loader: ILoader;
36
- public viewer: Viewer;
37
34
 
38
35
  constructor(scene: Object3D) {
39
- this.handle = "1";
40
36
  this.scene = scene;
41
37
  }
42
38
 
@@ -81,6 +77,178 @@ export class ModelImpl implements IModelImpl {
81
77
  this.scene.clear();
82
78
  }
83
79
 
80
+ getUnits(): string {
81
+ return "Meters";
82
+ }
83
+
84
+ getUnitScale(): number {
85
+ return convertUnits(this.getUnits(), "Meters", 1);
86
+ }
87
+
88
+ getUnitString(): string {
89
+ return getDisplayUnit(this.getUnits());
90
+ }
91
+
92
+ getPrecision(): number {
93
+ return 2;
94
+ }
95
+
96
+ getInfo(): IInfo {
97
+ // ===================== AI-CODE-START ======================
98
+ // Source: Claude Sonnet 4.5
99
+ // Date: 2025-10-02
100
+ // Reviewer: roman.mochalov@opendesign.com
101
+ // Issue: CLOUD-5738
102
+
103
+ const geometries = new Set();
104
+ const materials = new Set();
105
+ const textures = new Set();
106
+
107
+ let totalObjects = 0;
108
+ let totalTriangles = 0;
109
+ let totalPoints = 0;
110
+ let totalLines = 0;
111
+ let totalEdges = 0;
112
+ let geometryBytes = 0;
113
+ let textureBytes = 0;
114
+
115
+ this.scene.traverse((object: any) => {
116
+ totalObjects++;
117
+
118
+ if (object.geometry) {
119
+ const geometry = object.geometry;
120
+
121
+ if (!geometries.has(geometry)) {
122
+ geometries.add(geometry);
123
+
124
+ if (geometry.attributes) {
125
+ for (const name in geometry.attributes) {
126
+ const attribute = geometry.attributes[name];
127
+ if (attribute && attribute.array) {
128
+ geometryBytes += attribute.array.byteLength;
129
+ }
130
+ }
131
+ }
132
+
133
+ if (geometry.index && geometry.index.array) {
134
+ geometryBytes += geometry.index.array.byteLength;
135
+ }
136
+ }
137
+
138
+ if (geometry.index) {
139
+ const indexCount = geometry.index.count;
140
+
141
+ if (object.isLine || object.isLineSegments) {
142
+ totalLines += indexCount / 2;
143
+ } else if (object.isPoints) {
144
+ totalPoints += indexCount;
145
+ } else {
146
+ totalTriangles += indexCount / 3;
147
+ }
148
+ } else if (geometry.attributes && geometry.attributes.position) {
149
+ const positionCount = geometry.attributes.position.count;
150
+
151
+ if (object.isLine || object.isLineSegments) {
152
+ totalLines += positionCount / 2;
153
+ } else if (object.isPoints) {
154
+ totalPoints += positionCount;
155
+ } else {
156
+ totalTriangles += positionCount / 3;
157
+ }
158
+ }
159
+
160
+ if (object.isLineSegments && geometry.attributes.position) {
161
+ totalEdges += geometry.attributes.position.count / 2;
162
+ }
163
+ }
164
+
165
+ if (object.material) {
166
+ const materialsArray = Array.isArray(object.material) ? object.material : [object.material];
167
+
168
+ materialsArray.forEach((material: any) => {
169
+ materials.add(material);
170
+
171
+ if (material.map && !textures.has(material.map)) {
172
+ textures.add(material.map);
173
+ textureBytes += estimateTextureSize(material.map);
174
+ }
175
+
176
+ const textureProps = [
177
+ "alphaMap",
178
+ "aoMap",
179
+ "bumpMap",
180
+ "displacementMap",
181
+ "emissiveMap",
182
+ "envMap",
183
+ "lightMap",
184
+ "metalnessMap",
185
+ "normalMap",
186
+ "roughnessMap",
187
+ "specularMap",
188
+ "clearcoatMap",
189
+ "clearcoatNormalMap",
190
+ "clearcoatRoughnessMap",
191
+ "iridescenceMap",
192
+ "sheenColorMap",
193
+ "sheenRoughnessMap",
194
+ "thicknessMap",
195
+ "transmissionMap",
196
+ "anisotropyMap",
197
+ "gradientMap",
198
+ ];
199
+
200
+ textureProps.forEach((prop) => {
201
+ const texture = material[prop];
202
+ if (texture && !textures.has(texture)) {
203
+ textures.add(texture);
204
+ textureBytes += estimateTextureSize(texture);
205
+ }
206
+ });
207
+ });
208
+ }
209
+ });
210
+
211
+ function estimateTextureSize(texture: any): number {
212
+ if (!texture.image) return 0;
213
+
214
+ const width = texture.image.width || 0;
215
+ const height = texture.image.height || 0;
216
+
217
+ // Estimate bytes per pixel (RGBA = 4 bytes)
218
+ const bytesPerPixel = 4;
219
+
220
+ // Account for mipmaps (adds ~33% more memory)
221
+ const mipmapMultiplier = texture.generateMipmaps ? 1.33 : 1;
222
+
223
+ return width * height * bytesPerPixel * mipmapMultiplier;
224
+ }
225
+
226
+ // ===================== AI-CODE-END ======================
227
+
228
+ const info = new Info();
229
+
230
+ info.scene.objects = totalObjects;
231
+ info.scene.triangles = Math.floor(totalTriangles);
232
+ info.scene.points = Math.floor(totalPoints);
233
+ info.scene.lines = Math.floor(totalLines);
234
+ info.scene.edges = Math.floor(totalEdges);
235
+
236
+ info.memory.geometries = geometries.size;
237
+ info.memory.geometryBytes = geometryBytes;
238
+ info.memory.textures = textures.size;
239
+ info.memory.textureBytes = Math.floor(textureBytes);
240
+ info.memory.materials = materials.size;
241
+ info.memory.totalEstimatedGpuBytes = geometryBytes + Math.floor(textureBytes);
242
+
243
+ info.optimizedScene.objects = info.scene.objects;
244
+ info.optimizedScene.triangles = info.scene.triangles;
245
+ info.optimizedScene.points = info.scene.points;
246
+ info.optimizedScene.lines = info.scene.lines;
247
+ info.optimizedScene.edges = info.scene.edges;
248
+
249
+ return info;
250
+ }
251
+
84
252
  getExtents(target: Box3): Box3 {
85
253
  this.scene.traverseVisible((object) => !object.children.length && target.expandByObject(object));
86
254
  return target;
@@ -106,27 +274,49 @@ export class ModelImpl implements IModelImpl {
106
274
  return false;
107
275
  }
108
276
 
277
+ hasHandle(handle: string): boolean {
278
+ return !handle.includes(":") || handle.split(":", 1)[0] === this.id + "";
279
+ }
280
+
109
281
  getOwnObjects(objects: Object3D | Object3D[]): Object3D[] {
110
282
  if (!Array.isArray(objects)) objects = [objects];
111
283
  return objects.filter((object) => this.hasObject(object));
112
284
  }
113
285
 
286
+ getOwnHandles(handles: string | string[]): string[] {
287
+ if (!Array.isArray(handles)) handles = [handles];
288
+ return handles.filter((handle) => this.hasHandle(handle));
289
+ }
290
+
114
291
  getObjectsByHandles(handles: string | string[]): Object3D[] {
115
- const handleSet = new Set(handles);
292
+ const ownHandles = this.getOwnHandles(handles);
293
+ if (ownHandles.length === 0) return [];
294
+
295
+ const handleSet = new Set(ownHandles.map((handle) => handle.slice(handle.indexOf(":") + 1)));
296
+
116
297
  const objects = [];
117
- this.scene.traverse((object) => handleSet.has(object.userData.handle) && objects.push(object));
298
+ this.scene.traverse((object) => {
299
+ const handle = object.userData.handle;
300
+ if (handle && handleSet.has(handle)) objects.push(object);
301
+ });
302
+
118
303
  return objects;
119
304
  }
120
305
 
121
306
  getHandlesByObjects(objects: Object3D | Object3D[]): string[] {
122
- if (!Array.isArray(objects)) objects = [objects];
123
- const handlesSet = new Set<string>();
124
- this.getOwnObjects(objects).forEach((object) => handlesSet.add(object.userData.handle));
125
- return Array.from(handlesSet);
307
+ const ownObjects = this.getOwnObjects(objects);
308
+ if (ownObjects.length === 0) return [];
309
+
310
+ const handleSet = new Set<string>();
311
+ ownObjects.forEach((object) => {
312
+ const handle = object.userData.handle;
313
+ if (handle) handleSet.add(`${this.id}:${handle}`);
314
+ });
315
+
316
+ return Array.from(handleSet);
126
317
  }
127
318
 
128
319
  hideObjects(objects: Object3D | Object3D[]): this {
129
- if (!Array.isArray(objects)) objects = [objects];
130
320
  this.getOwnObjects(objects).forEach((object) => (object.visible = false));
131
321
  return this;
132
322
  }
@@ -144,7 +334,6 @@ export class ModelImpl implements IModelImpl {
144
334
  }
145
335
 
146
336
  showObjects(objects: Object3D | Object3D[]): this {
147
- if (!Array.isArray(objects)) objects = [objects];
148
337
  this.getOwnObjects(objects).forEach((object) => {
149
338
  object.visible = true;
150
339
  object.traverseAncestors((parent) => (parent.visible = true));
package/src/index-umd.ts CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
  export * from "./index";
25
25
 
26
- // add the global exports (was removed in 0.160.0) to expose the plugins to Three.js code
26
+ // add the global exports (was removed in 0.160.0) to expose the extensions to Three.js code
27
27
 
28
28
  import * as THREE from "three";
29
29
 
@@ -1 +0,0 @@
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;IAKvB,IAAA,WAAA,CAAY,MAAc,EAAA;YAsB1B,IAAA,CAAA,UAAU,GAAG,MAAK;IAChB,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;IACnC,YAAA,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE;IAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAIA,aAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IAChE,YAAA,MAAM,MAAM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AmB,CAAC,YAAY,EAAE,IAAI,CAAC,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;IAkBD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -1 +0,0 @@
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;AAKvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAsB1B,IAAA,CAAA,UAAU,GAAG,MAAK;AAChB,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,CAAC;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qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
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":["Box3Helper","Box3","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,sBAAsB,CAAA;IAI1B,IAAA,WAAA,CAAY,MAAc,EAAA;YAyB1B,IAAA,CAAA,UAAU,GAAG,MAAK;IAChB,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;IACzC,QAAA,CAAC;IA/BC,QAAA,IAAI,CAAC,SAAS,GAAG,IAAIA,gBAAU,CAAC,IAAIC,UAAI,EAAE,EAAE,SAAS,CAAC;IACtD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;YACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC9C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC;QAC5C;QAEA,OAAO,GAAA;IACL,QAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;IACjC,QAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;YAExB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;YACzC,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;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;IAUD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -1,24 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
23
-
24
- !function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],i):i((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,function(e,i){"use strict";class s{constructor(i){this.syncHelper=()=>{this.boxHelper.removeFromParent(),this.viewer.extents.isEmpty()||(this.boxHelper.box=this.viewer.extents.clone(),this.viewer.helpers.add(this.boxHelper))},this.boxHelper=new e.Box3Helper(new e.Box3,"#ff0000"),this.viewer=i,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.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)}}i.components.registerComponent("ExtentsHelperComponent",e=>new s(e))});
@@ -1 +0,0 @@
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.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CAAC;IAC5C;IAEA,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;AACjC,QAAA,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE;QAExB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QACzC,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;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;AAUD;AAED,UAAU,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,CAAC,MAAM,KAAK,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GridHelperComponent.js","sources":["../../../plugins/components/GridHelperComponent.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 { GridHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass GridHelperComponent implements IComponent {\n private viewer: Viewer;\n private gridHelper: GridHelper;\n\n constructor(viewer: Viewer) {\n this.gridHelper = new GridHelper(10, 20, 0x444444, 0xaaaaaa);\n this.viewer = viewer;\n this.viewer.on(\"initialize\", this.syncHelper);\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.gridHelper.removeFromParent();\n this.gridHelper.dispose();\n\n this.viewer.off(\"initialize\", this.syncHelper);\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.gridHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n const size = this.viewer.extents.getSize(new Vector3()).multiply(this.viewer.camera.up).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n const upY = new Vector3(0, 1, 0);\n const up = new Vector3().copy(this.viewer.camera.up);\n\n this.gridHelper.scale.setScalar(size);\n this.gridHelper.position.copy(center);\n this.gridHelper.quaternion.setFromUnitVectors(upY, up);\n\n this.viewer.helpers.add(this.gridHelper);\n };\n}\n\ncomponents.registerComponent(\"GridHelperComponent\", (viewer) => new GridHelperComponent(viewer));\n"],"names":["Vector3","GridHelper","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BA,MAAM,mBAAmB,CAAA;IAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;YAiB1B,IAAA,CAAA,UAAU,GAAG,MAAK;IAChB,YAAA,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE;IAElC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAA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,OAAO,GAAA;IACL,QAAA,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE;IAClC,QAAA,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;YAEzB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC;YAC9C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC;YAC/C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC;QAC3C;IAmBD;AAEDC,0BAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"GridHelperComponent.module.js","sources":["../../../plugins/components/GridHelperComponent.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 { GridHelper, Vector3 } from \"three\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass GridHelperComponent implements IComponent {\n private viewer: Viewer;\n private gridHelper: GridHelper;\n\n constructor(viewer: Viewer) {\n this.gridHelper = new GridHelper(10, 20, 0x444444, 0xaaaaaa);\n this.viewer = viewer;\n this.viewer.on(\"initialize\", this.syncHelper);\n this.viewer.on(\"geometryend\", this.syncHelper);\n this.viewer.on(\"clear\", this.syncHelper);\n }\n\n dispose() {\n this.gridHelper.removeFromParent();\n this.gridHelper.dispose();\n\n this.viewer.off(\"initialize\", this.syncHelper);\n this.viewer.off(\"geometryend\", this.syncHelper);\n this.viewer.off(\"clear\", this.syncHelper);\n }\n\n syncHelper = () => {\n this.gridHelper.removeFromParent();\n\n if (this.viewer.extents.isEmpty()) return;\n\n const size = this.viewer.extents.getSize(new Vector3()).multiply(this.viewer.camera.up).length();\n const center = this.viewer.extents.getCenter(new Vector3());\n\n const upY = new Vector3(0, 1, 0);\n const up = new Vector3().copy(this.viewer.camera.up);\n\n this.gridHelper.scale.setScalar(size);\n this.gridHelper.position.copy(center);\n this.gridHelper.quaternion.setFromUnitVectors(upY, up);\n\n this.viewer.helpers.add(this.gridHelper);\n };\n}\n\ncomponents.registerComponent(\"GridHelperComponent\", (viewer) => new GridHelperComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAiB1B,IAAA,CAAA,UAAU,GAAG,MAAK;AAChB,YAAA,IAAI,CAAC,UAAU,CAAC,gBAAgB,EAAE;AAElC,YAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;gBAAE;AAEnC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;AAChG,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,EAAE,CAAC;YAE3D,MAAM,GAAG,GAA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IAC3C;AAmBD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LightHelperComponent.js","sources":["../../../plugins/components/LightHelperComponent.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 { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Sphere } 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.getBoundingSphere(new Sphere()).radius * 2;\n const size = 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, size, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, size, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, size, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\n }\n });\n };\n}\n\ncomponents.registerComponent(\"LightHelperComponent\", (viewer) => new LightHelperComponent(viewer));\n"],"names":["Sphere","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,iBAAiB,CAAC,IAAIA,YAAM,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;IAClF,YAAA,MAAM,IAAI,GAAG,WAAW,GAAG,EAAE;gBAE7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;IACzC,gBAAA,IAAI,MAAyE;oBAE7E,IAAI,MAAM,CAAC,kBAAkB;wBAAE,MAAM,GAAG,IAAIC,4BAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;yBACtF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ources":["../../../plugins/components/LightHelperComponent.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 { DirectionalLightHelper, HemisphereLightHelper, PointLightHelper, Sphere } 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.getBoundingSphere(new Sphere()).radius * 2;\n const size = 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, size, \"#aa0000\");\n else if (object.isHemisphereLight) helper = new HemisphereLightHelper(object, size, \"#ff9800\");\n else if (object.isPointLight) helper = new PointLightHelper(object, size, \"#ff9800\");\n\n if (helper) {\n this.lightHelpers.push(helper);\n this.viewer.helpers.add(helper);\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,iBAAiB,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;AAClF,YAAA,MAAM,IAAI,GAAG,WAAW,GAAG,EAAE;YAE7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAW,KAAI;AACzC,gBAAA,IAAI,MAAyE;gBAE7E,IAAI,MAAM,CAAC,kBAAkB;oBAAE,MAAM,GAAG,IAAI,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;qBACtF,IAAI,MAAM,CAAC,iBAAiB;oBAAE,MAAM,GAAG,IAAI,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;qBACzF,IAAI,MAAM,CAAC,YAAY;oBAAE,MAAM,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC;gBAEpF,IAAI,MAAM,EAAE;AACV,oBAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;oBAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;gBACjC;AACF,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC;AAvCC,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;AAyBD;AAED,UAAU,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,CAAC,MAAM,KAAK,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoomEnvironmentComponent.js","sources":["../../../../../node_modules/three/examples/jsm/environments/RoomEnvironment.js","../../../plugins/components/RoomEnvironmentComponent.ts"],"sourcesContent":["import {\n \tBackSide,\n \tBoxGeometry,\n \tInstancedMesh,\n \tMesh,\n\tMeshLambertMaterial,\n \tMeshStandardMaterial,\n \tPointLight,\n \tScene,\n \tObject3D,\n} from 'three';\n\n/**\n * This class represents a scene with a basic room setup that can be used as\n * input for {@link PMREMGenerator#fromScene}. The resulting PMREM represents the room's\n * lighting and can be used for Image Based Lighting by assigning it to {@link Scene#environment}\n * or directly as an environment map to PBR materials.\n *\n * The implementation is based on the [EnvironmentScene](https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts)\n * component from the `model-viewer` project.\n *\n * ```js\n * const environment = new RoomEnvironment();\n * const pmremGenerator = new THREE.PMREMGenerator( renderer );\n *\n * const envMap = pmremGenerator.fromScene( environment ).texture;\n * scene.environment = envMap;\n * ```\n *\n * @augments Scene\n * @three_import import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';\n */\nclass RoomEnvironment extends Scene {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tconst geometry = new BoxGeometry();\n\t\tgeometry.deleteAttribute( 'uv' );\n\n\t\tconst roomMaterial = new MeshStandardMaterial( { side: BackSide } );\n\t\tconst boxMaterial = new MeshStandardMaterial();\n\n\t\tconst mainLight = new PointLight( 0xffffff, 900, 28, 2 );\n\t\tmainLight.position.set( 0.418, 16.199, 0.300 );\n\t\tthis.add( mainLight );\n\n\t\tconst room = new Mesh( geometry, roomMaterial );\n\t\troom.position.set( - 0.757, 13.219, 0.717 );\n\t\troom.scale.set( 31.713, 28.305, 28.591 );\n\t\tthis.add( room );\n\n\t\tconst boxes = new InstancedMesh( geometry, boxMaterial, 6 );\n\t\tconst transform = new Object3D();\n\n\t\t// box1\n\t\ttransform.position.set( - 10.906, 2.009, 1.846 );\n\t\ttransform.rotation.set( 0, - 0.195, 0 );\n\t\ttransform.scale.set( 2.328, 7.905, 4.651 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 0, transform.matrix );\n\n\t\t// box2\n\t\ttransform.position.set( - 5.607, - 0.754, - 0.758 );\n\t\ttransform.rotation.set( 0, 0.994, 0 );\n\t\ttransform.scale.set( 1.970, 1.534, 3.955 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 1, transform.matrix );\n\n\t\t// box3\n\t\ttransform.position.set( 6.167, 0.857, 7.803 );\n\t\ttransform.rotation.set( 0, 0.561, 0 );\n\t\ttransform.scale.set( 3.927, 6.285, 3.687 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 2, transform.matrix );\n\n\t\t// box4\n\t\ttransform.position.set( - 2.017, 0.018, 6.124 );\n\t\ttransform.rotation.set( 0, 0.333, 0 );\n\t\ttransform.scale.set( 2.002, 4.566, 2.064 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 3, transform.matrix );\n\n\t\t// box5\n\t\ttransform.position.set( 2.291, - 0.756, - 2.621 );\n\t\ttransform.rotation.set( 0, - 0.286, 0 );\n\t\ttransform.scale.set( 1.546, 1.552, 1.496 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 4, transform.matrix );\n\n\t\t// box6\n\t\ttransform.position.set( - 2.193, - 0.369, - 5.547 );\n\t\ttransform.rotation.set( 0, 0.516, 0 );\n\t\ttransform.scale.set( 3.875, 3.487, 2.986 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 5, transform.matrix );\n\n\t\tthis.add( boxes );\n\n\n\t\t// -x right\n\t\tconst light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight1.position.set( - 16.116, 14.37, 8.208 );\n\t\tlight1.scale.set( 0.1, 2.428, 2.739 );\n\t\tthis.add( light1 );\n\n\t\t// -x left\n\t\tconst light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight2.position.set( - 16.109, 18.021, - 8.207 );\n\t\tlight2.scale.set( 0.1, 2.425, 2.751 );\n\t\tthis.add( light2 );\n\n\t\t// +x\n\t\tconst light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );\n\t\tlight3.position.set( 14.904, 12.198, - 1.832 );\n\t\tlight3.scale.set( 0.15, 4.265, 6.331 );\n\t\tthis.add( light3 );\n\n\t\t// +z\n\t\tconst light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );\n\t\tlight4.position.set( - 0.462, 8.89, 14.520 );\n\t\tlight4.scale.set( 4.38, 5.441, 0.088 );\n\t\tthis.add( light4 );\n\n\t\t// -z\n\t\tconst light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );\n\t\tlight5.position.set( 3.235, 11.486, - 12.541 );\n\t\tlight5.scale.set( 2.5, 2.0, 0.1 );\n\t\tthis.add( light5 );\n\n\t\t// +y\n\t\tconst light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );\n\t\tlight6.position.set( 0.0, 20.0, 0.0 );\n\t\tlight6.scale.set( 1.0, 0.1, 1.0 );\n\t\tthis.add( light6 );\n\n\t}\n\n\t/**\n\t * Frees internal resources. This method should be called\n\t * when the environment is no longer required.\n\t */\n\tdispose() {\n\n\t\tconst resources = new Set();\n\n\t\tthis.traverse( ( object ) => {\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tresources.add( object.geometry );\n\t\t\t\tresources.add( object.material );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tfor ( const resource of resources ) {\n\n\t\t\tresource.dispose();\n\n\t\t}\n\n\t}\n\n}\n\nfunction createAreaLightMaterial( intensity ) {\n\n\t// create an emissive-only material. see #31348\n\tconst material = new MeshLambertMaterial( {\n\t\tcolor: 0x000000,\n\t\temissive: 0xffffff,\n\t\temissiveIntensity: intensity\n\t} );\n\n\treturn material;\n\n}\n\nexport { RoomEnvironment };\n","///////////////////////////////////////////////////////////////////////////////\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 { PMREMGenerator } from \"three\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass RoomEnvironmentComponent implements IComponent {\n protected viewer: Viewer;\n\n constructor(viewer: Viewer) {\n this.viewer = viewer;\n\n const environment = new RoomEnvironment();\n const pmremGenerator = new PMREMGenerator(this.viewer.renderer);\n\n this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;\n\n environment.dispose();\n }\n\n dispose() {\n this.viewer.scene.environment = undefined;\n }\n}\n\ncomponents.registerComponent(\"LightComponent\", (viewer) => new RoomEnvironmentComponent(viewer));\n"],"names":["Scene","BoxGeometry","MeshStandardMaterial","BackSide","PointLight","Mesh","InstancedMesh","Object3D","MeshLambertMaterial","PMREMGenerator","components"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCA,MAAM,eAAe,SAASA,WAAK,CAAC;CAEpC,CAAC,WAAW,GAAG;CAEf,EAAE,KAAK,EAAE;CAET,EAAE,MAAM,QAAQ,GAAG,IAAIC,iBAAW,EAAE;CACpC,EAAE,QAAQ,CAAC,eAAe,EAAE,IAAI,EAAE;CAElC,EAAE,MAAM,YAAY,GAAG,IAAIC,0BAAoB,EAAE,EAAE,IAAI,EAAEC,cAAQ,EAAE,EAAE;CACrE,EAAE,MAAM,WAAW,GAAG,IAAID,0BAAoB,EAAE;CAEhD,EAAE,MAAM,SAAS,GAAG,IAAIE,gBAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;CAC1D,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;CAChD,EA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EpC,GAAG;CAEH,EAAE,CAAC,EAAE;CAEL,EAAE,MAAM,MAAM,QAAQ,IAAI,SAAS,GAAG;CAEtC,GAAG,QAAQ,CAAC,OAAO,EAAE;CAErB,EAAE;CAEF,CAAC;CAED;CAEA,SAAS,uBAAuB,EAAE,SAAS,GAAG;CAG9C,CAAC,MAAM,QAAQ,GAAG,IAAIG,yBAAmB,EAAE;CAC3C,EAAE,KAAK,EAAE,QAAQ;CACjB,EAAE,QAAQ,EAAE,QAAQ;CACpB,EAAE,iBAAiB,EAAE;CACrB,EAAE,EAAE;CAEJ,CAAC,OAAO,QAAQ;CAEhB;;CCxJA,MAAM,wBAAwB,CAAA;CAG5B,IAAA,WAAA,CAAY,MAAc,EAAA;CACxB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;CAEpB,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;SACzC,MAAM,cAAc,GAAG,IAAIC,oBAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;CAE/D,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO;SAE7E,WAAW,CAAC,OAAO,EAAE;KACvB;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS;KAC3C;CACD;AAEDC,uBAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,MAAM,KAAK,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoomEnvironmentComponent.module.js","sources":["../../../plugins/components/RoomEnvironmentComponent.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 { PMREMGenerator } from \"three\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass RoomEnvironmentComponent implements IComponent {\n protected viewer: Viewer;\n\n constructor(viewer: Viewer) {\n this.viewer = viewer;\n\n const environment = new RoomEnvironment();\n const pmremGenerator = new PMREMGenerator(this.viewer.renderer);\n\n this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;\n\n environment.dispose();\n }\n\n dispose() {\n this.viewer.scene.environment = undefined;\n }\n}\n\ncomponents.registerComponent(\"LightComponent\", (viewer) => new RoomEnvironmentComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,wBAAwB,CAAA;AAG5B,IAAA,WAAA,CAAY,MAAc,EAAA;AACxB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;AAEpB,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;QACzC,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;AAE/D,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO;QAE7E,WAAW,CAAC,OAAO,EAAE;IACvB;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS;IAC3C;AACD;AAED,UAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,MAAM,KAAK,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../plugins/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-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 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 viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.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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AC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;CAC1C,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,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;KAC7C;KAEA,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;CAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;CACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;KACxB;CAMD;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -1,24 +0,0 @@
1
- ///////////////////////////////////////////////////////////////////////////////
2
- // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
3
- // All rights reserved.
4
- //
5
- // This software and its documentation and related materials are owned by
6
- // the Alliance. The software may only be incorporated into application
7
- // programs owned by members of the Alliance, subject to a signed
8
- // Membership Agreement and Supplemental Software License Agreement with the
9
- // Alliance. The structure and organization of this software are the valuable
10
- // trade secrets of the Alliance and its suppliers. The software is also
11
- // protected by copyright law and international treaty provisions. Application
12
- // programs incorporating this software must include the following statement
13
- // with their copyright notices:
14
- //
15
- // This application incorporates Open Design Alliance software pursuant to a
16
- // license agreement with Open Design Alliance.
17
- // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
18
- // All rights reserved.
19
- //
20
- // By use of this software, its documentation or related materials, you
21
- // acknowledge and accept the above terms.
22
- ///////////////////////////////////////////////////////////////////////////////
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,n=document.createElement("div");function i(e){return n.appendChild(e.dom),e}function l(t){for(var i=0;i<n.children.length;i++)n.children[i].style.display=i===t?"block":"none";e=t}n.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",n.addEventListener("click",function(t){t.preventDefault(),l(++e%n.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,r=i(new t.Panel("FPS","#0ff","#002")),f=i(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=i(new t.Panel("MB","#f08","#201"));return l(0),{REVISION:16,dom:n,addPanel:i,showPanel:l,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(f.update(e-a,200),e>=o+1e3&&(r.update(1e3*s/(e-o),100),o=e,s=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:n,setMode:l}};t.Panel=function(e,t,n){var i=1/0,l=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,r=48*o,f=3*o,d=2*o,c=3*o,p=15*o,h=74*o,u=30*o,m=document.createElement("canvas");m.width=s,m.height=r,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=n,v.fillRect(0,0,s,r),v.fillStyle=t,v.fillText(e,f,d),v.fillRect(c,p,h,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c,p,h,u),{dom:m,update:function(r,w){i=Math.min(i,r),l=Math.max(l,r),v.fillStyle=n,v.globalAlpha=1,v.fillRect(0,0,s,p),v.fillStyle=t,v.fillText(a(r)+" "+e+" ("+a(i)+"-"+a(l)+")",f,d),v.drawImage(m,c+o,p,h-o,u,c,p,h-o,u),v.fillRect(c+h-o,p,o,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c+h-o,p,o,a((1-r/w)*u))}}};class n{constructor(e){this.updateStats=()=>{this.viewer.render(null,!0),this.stats.update()},this.stats=new t,this.stats.dom.style.position="absolute",e.canvas.parentElement.appendChild(this.stats.dom),this.viewer=e,this.viewer.on("animate",this.updateStats)}dispose(){this.viewer.off("animate",this.updateStats),this.stats.dom.remove(),this.stats=void 0}}e.components.registerComponent("StatsPanelComponent",e=>new n(e))});
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../plugins/components/StatsPanelComponent.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 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 viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,mBAAmB,CAAA;AAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;QAgB1B,IAAA,CAAA,WAAW,GAAG,MAAK;YACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;AAC9B,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AACrB,QAAA,CAAC;AAlBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;AAC1C,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,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;IAC7C;IAEA,OAAO,GAAA;QACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;AAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;AACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;IACxB;AAMD;AAED,UAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC"}