@inweb/viewer-three 27.5.0 → 27.6.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/extensions/components/LightHelperComponent.js +1 -1
- package/dist/extensions/components/LightHelperComponent.js.map +1 -1
- package/dist/extensions/components/LightHelperComponent.min.js +1 -1
- package/dist/extensions/components/LightHelperComponent.module.js +1 -1
- package/dist/extensions/components/LightHelperComponent.module.js.map +1 -1
- package/dist/extensions/components/StatsPanelComponent.js +0 -1
- package/dist/extensions/components/StatsPanelComponent.js.map +1 -1
- package/dist/extensions/components/StatsPanelComponent.min.js +1 -1
- package/dist/extensions/components/StatsPanelComponent.module.js +0 -1
- package/dist/extensions/components/StatsPanelComponent.module.js.map +1 -1
- package/dist/extensions/loaders/GLTFCloudLoader.js +7 -2
- package/dist/extensions/loaders/GLTFCloudLoader.js.map +1 -1
- package/dist/extensions/loaders/GLTFCloudLoader.min.js +1 -1
- package/dist/extensions/loaders/GLTFCloudLoader.module.js +7 -2
- package/dist/extensions/loaders/GLTFCloudLoader.module.js.map +1 -1
- package/dist/extensions/loaders/GLTFFileLoader.js +2 -1
- package/dist/extensions/loaders/GLTFFileLoader.js.map +1 -1
- package/dist/extensions/loaders/GLTFFileLoader.min.js +1 -1
- package/dist/extensions/loaders/GLTFFileLoader.module.js +2 -1
- package/dist/extensions/loaders/GLTFFileLoader.module.js.map +1 -1
- package/dist/extensions/loaders/IFCXLoader.js +10 -5
- package/dist/extensions/loaders/IFCXLoader.js.map +1 -1
- package/dist/extensions/loaders/IFCXLoader.min.js +1 -1
- package/dist/extensions/loaders/IFCXLoader.module.js +10 -5
- package/dist/extensions/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/viewer-three.js +217 -189
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +4 -4
- package/dist/viewer-three.module.js +68 -53
- package/dist/viewer-three.module.js.map +1 -1
- package/extensions/components/LightHelperComponent.ts +1 -1
- package/extensions/components/StatsPanelComponent.ts +0 -1
- package/extensions/loaders/GLTFCloudLoader.ts +8 -2
- package/extensions/loaders/GLTFFileLoader.ts +3 -2
- package/extensions/loaders/IFCX/IFCXFileLoader.ts +11 -5
- package/lib/Viewer/Viewer.d.ts +1 -1
- package/lib/Viewer/measurement/Snapper.d.ts +1 -1
- package/package.json +5 -5
- package/src/Viewer/Viewer.ts +14 -16
- package/src/Viewer/commands/GetSelected2.ts +1 -1
- package/src/Viewer/commands/SetSelected.ts +1 -1
- package/src/Viewer/components/BackgroundComponent.ts +1 -1
- package/src/Viewer/components/CameraComponent.ts +1 -1
- package/src/Viewer/components/CanvasRemoveComponent.ts +0 -1
- package/src/Viewer/components/HighlighterUtils.ts +2 -2
- package/src/Viewer/components/SelectionComponent.ts +4 -2
- package/src/Viewer/helpers/SectionsHelper.js +4 -8
- package/src/Viewer/helpers/WCSHelper.ts +7 -5
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +19 -14
- package/src/Viewer/loaders/GLTFBinaryParser.ts +2 -2
- package/src/Viewer/loaders/GLTFFileDynamicLoader.ts +2 -2
- package/src/Viewer/measurement/Snapper.ts +2 -2
- package/src/Viewer/models/ModelImpl.ts +38 -25
package/dist/viewer-three.js
CHANGED
|
@@ -159,8 +159,7 @@
|
|
|
159
159
|
this.abortController = new AbortController();
|
|
160
160
|
}
|
|
161
161
|
dispose() {
|
|
162
|
-
this.
|
|
163
|
-
this.abortController = undefined;
|
|
162
|
+
this.cancel();
|
|
164
163
|
}
|
|
165
164
|
isSupport(file, format) {
|
|
166
165
|
return false;
|
|
@@ -179,10 +178,10 @@
|
|
|
179
178
|
extractFileName(file) {
|
|
180
179
|
const regex = /[^/\\?#:]+(?=\?|#|$)/;
|
|
181
180
|
if (typeof file === "string")
|
|
182
|
-
return (file.match(regex) || [])[0];
|
|
181
|
+
return (file.match(regex) || [])[0] || "";
|
|
183
182
|
else if (file instanceof globalThis.File)
|
|
184
|
-
return (file.name.match(regex) || [])[0];
|
|
185
|
-
return
|
|
183
|
+
return (file.name.match(regex) || [])[0] || "";
|
|
184
|
+
return "";
|
|
186
185
|
}
|
|
187
186
|
};
|
|
188
187
|
class Loaders {
|
|
@@ -264,21 +263,44 @@
|
|
|
264
263
|
snapshotQuality: 0.25,
|
|
265
264
|
};
|
|
266
265
|
}
|
|
266
|
+
function isColorRGB(value) {
|
|
267
|
+
return (typeof value === "object" &&
|
|
268
|
+
value !== null &&
|
|
269
|
+
typeof value.r === "number" &&
|
|
270
|
+
typeof value.g === "number" &&
|
|
271
|
+
typeof value.b === "number");
|
|
272
|
+
}
|
|
273
|
+
function isLegacyRGB(value) {
|
|
274
|
+
return (typeof value === "object" &&
|
|
275
|
+
value !== null &&
|
|
276
|
+
typeof value.red === "number" &&
|
|
277
|
+
typeof value.green === "number" &&
|
|
278
|
+
typeof value.blue === "number");
|
|
279
|
+
}
|
|
267
280
|
class Options {
|
|
268
281
|
constructor(emitter) {
|
|
282
|
+
this._updateCount = 0;
|
|
269
283
|
this._emitter = emitter;
|
|
270
|
-
this._data =
|
|
284
|
+
this._data = Options.defaults();
|
|
285
|
+
this._defaults = Options.defaults();
|
|
271
286
|
this.loadFromStorage();
|
|
272
287
|
}
|
|
273
288
|
static defaults() {
|
|
274
289
|
return defaultOptions();
|
|
275
290
|
}
|
|
276
291
|
change() {
|
|
277
|
-
if (this._emitter !== undefined) {
|
|
292
|
+
if (this._emitter !== undefined && this._updateCount === 0) {
|
|
278
293
|
this.saveToStorage();
|
|
279
294
|
this._emitter.emit({ type: "optionschange", data: this });
|
|
280
295
|
}
|
|
281
296
|
}
|
|
297
|
+
beginUpdate() {
|
|
298
|
+
this._updateCount++;
|
|
299
|
+
}
|
|
300
|
+
endUpdate() {
|
|
301
|
+
this._updateCount--;
|
|
302
|
+
this.change();
|
|
303
|
+
}
|
|
282
304
|
saveToStorage() {
|
|
283
305
|
if (typeof window !== "undefined")
|
|
284
306
|
try {
|
|
@@ -292,321 +314,312 @@
|
|
|
292
314
|
if (typeof window !== "undefined")
|
|
293
315
|
try {
|
|
294
316
|
const item = localStorage.getItem("od-client-settings");
|
|
295
|
-
if (item)
|
|
296
|
-
|
|
297
|
-
this.data = { ...data };
|
|
298
|
-
}
|
|
317
|
+
if (item)
|
|
318
|
+
this.data = JSON.parse(item);
|
|
299
319
|
}
|
|
300
320
|
catch (error) {
|
|
301
321
|
console.error("Cannot load client settings.", error);
|
|
302
322
|
}
|
|
303
323
|
}
|
|
304
|
-
resetToDefaults(fields) {
|
|
305
|
-
if (fields
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
this.data =
|
|
324
|
+
resetToDefaults(fields, defaults = this._defaults) {
|
|
325
|
+
if (Array.isArray(fields)) {
|
|
326
|
+
const resetData = {};
|
|
327
|
+
for (const field of fields) {
|
|
328
|
+
if (field in defaults)
|
|
329
|
+
resetData[field] = defaults[field];
|
|
330
|
+
}
|
|
331
|
+
this.data = resetData;
|
|
312
332
|
}
|
|
313
333
|
else {
|
|
314
|
-
this.data =
|
|
334
|
+
this.data = defaults;
|
|
315
335
|
}
|
|
316
336
|
}
|
|
337
|
+
setProperty(key, value = this._defaults[key], accept = this.isValidValue(key, value)) {
|
|
338
|
+
if (!accept) {
|
|
339
|
+
console.warn(`Options.${key}: Invalid value`, value);
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (this._data[key] !== value) {
|
|
343
|
+
this._data[key] = value;
|
|
344
|
+
this.change();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
isValidValue(key, value) {
|
|
348
|
+
return typeof value === typeof this._defaults[key];
|
|
349
|
+
}
|
|
317
350
|
get data() {
|
|
318
351
|
return this._data;
|
|
319
352
|
}
|
|
320
353
|
set data(value) {
|
|
321
|
-
this.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
354
|
+
this.beginUpdate();
|
|
355
|
+
try {
|
|
356
|
+
for (const key of Object.keys(value)) {
|
|
357
|
+
if (key in this._defaults)
|
|
358
|
+
this[key] = value[key];
|
|
359
|
+
else
|
|
360
|
+
this._data[key] = value[key];
|
|
361
|
+
}
|
|
362
|
+
if ("enablePartialMode" in value) {
|
|
363
|
+
this.enablePartialMode = value.enablePartialMode;
|
|
364
|
+
}
|
|
365
|
+
if ("sectionFillColor" in value) {
|
|
366
|
+
this.sectionFillColor = value.sectionFillColor;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
finally {
|
|
370
|
+
this.endUpdate();
|
|
371
|
+
}
|
|
333
372
|
}
|
|
334
373
|
get showWCS() {
|
|
335
374
|
return this._data.showWCS;
|
|
336
375
|
}
|
|
337
376
|
set showWCS(value) {
|
|
338
|
-
this.
|
|
339
|
-
this.change();
|
|
377
|
+
this.setProperty("showWCS", value);
|
|
340
378
|
}
|
|
341
379
|
get cameraAnimation() {
|
|
342
380
|
return this._data.cameraAnimation;
|
|
343
381
|
}
|
|
344
382
|
set cameraAnimation(value) {
|
|
345
|
-
this.
|
|
346
|
-
this.change();
|
|
383
|
+
this.setProperty("cameraAnimation", value);
|
|
347
384
|
}
|
|
348
385
|
get antialiasing() {
|
|
349
386
|
return this._data.antialiasing;
|
|
350
387
|
}
|
|
351
388
|
set antialiasing(value) {
|
|
352
|
-
this.
|
|
353
|
-
this.change();
|
|
389
|
+
this.setProperty("antialiasing", value, typeof value === "boolean" || typeof value === "string");
|
|
354
390
|
}
|
|
355
391
|
get groundShadow() {
|
|
356
392
|
return this._data.groundShadow;
|
|
357
393
|
}
|
|
358
394
|
set groundShadow(value) {
|
|
359
|
-
this.
|
|
360
|
-
this.change();
|
|
395
|
+
this.setProperty("groundShadow", value);
|
|
361
396
|
}
|
|
362
397
|
get shadows() {
|
|
363
398
|
return this._data.shadows;
|
|
364
399
|
}
|
|
365
400
|
set shadows(value) {
|
|
366
|
-
this.
|
|
367
|
-
this.change();
|
|
401
|
+
this.setProperty("shadows", value);
|
|
368
402
|
}
|
|
369
403
|
get cameraAxisXSpeed() {
|
|
370
404
|
return this._data.cameraAxisXSpeed;
|
|
371
405
|
}
|
|
372
406
|
set cameraAxisXSpeed(value) {
|
|
373
|
-
this.
|
|
374
|
-
this.change();
|
|
407
|
+
this.setProperty("cameraAxisXSpeed", value);
|
|
375
408
|
}
|
|
376
409
|
get cameraAxisYSpeed() {
|
|
377
410
|
return this._data.cameraAxisYSpeed;
|
|
378
411
|
}
|
|
379
412
|
set cameraAxisYSpeed(value) {
|
|
380
|
-
this.cameraAxisYSpeed
|
|
381
|
-
this.change();
|
|
413
|
+
this.setProperty("cameraAxisYSpeed", value);
|
|
382
414
|
}
|
|
383
415
|
get ambientOcclusion() {
|
|
384
416
|
return this._data.ambientOcclusion;
|
|
385
417
|
}
|
|
386
418
|
set ambientOcclusion(value) {
|
|
387
|
-
this.
|
|
388
|
-
this.change();
|
|
419
|
+
this.setProperty("ambientOcclusion", value);
|
|
389
420
|
}
|
|
390
421
|
get enableStreamingMode() {
|
|
391
422
|
return this._data.enableStreamingMode;
|
|
392
423
|
}
|
|
393
424
|
set enableStreamingMode(value) {
|
|
394
|
-
this.
|
|
395
|
-
|
|
396
|
-
this._data.enablePartialMode = false;
|
|
397
|
-
this.change();
|
|
425
|
+
this.setProperty("enableStreamingMode", value);
|
|
426
|
+
this.setProperty("enablePartialMode", this.enablePartialMode && this.enableStreamingMode);
|
|
398
427
|
}
|
|
399
428
|
get enablePartialMode() {
|
|
400
429
|
return this._data.enablePartialMode;
|
|
401
430
|
}
|
|
402
431
|
set enablePartialMode(value) {
|
|
403
|
-
this.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
this._data.sceneGraph = false;
|
|
407
|
-
}
|
|
408
|
-
this.change();
|
|
432
|
+
this.setProperty("enablePartialMode", value);
|
|
433
|
+
this.setProperty("enableStreamingMode", this.enableStreamingMode || this.enablePartialMode);
|
|
434
|
+
this.setProperty("sceneGraph", this.sceneGraph && !this.enablePartialMode);
|
|
409
435
|
}
|
|
410
436
|
get memoryLimit() {
|
|
411
437
|
return this._data.memoryLimit;
|
|
412
438
|
}
|
|
413
439
|
set memoryLimit(value) {
|
|
414
|
-
this.
|
|
415
|
-
this.change();
|
|
440
|
+
this.setProperty("memoryLimit", value);
|
|
416
441
|
}
|
|
417
442
|
get cuttingPlaneFillColor() {
|
|
418
|
-
|
|
419
|
-
return {
|
|
420
|
-
red: this._data.sectionFillColor.r,
|
|
421
|
-
green: this._data.sectionFillColor.g,
|
|
422
|
-
blue: this._data.sectionFillColor.b,
|
|
423
|
-
};
|
|
443
|
+
return this._data.cuttingPlaneFillColor;
|
|
424
444
|
}
|
|
425
445
|
set cuttingPlaneFillColor(value) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
446
|
+
if (this._updateCount === 0) {
|
|
447
|
+
console.warn("Options.cuttingPlaneFillColor has been deprecated since 27.5 and will be removed in a future release, use sectionFillColor instead");
|
|
448
|
+
}
|
|
449
|
+
this.setProperty("cuttingPlaneFillColor", value, isLegacyRGB(value));
|
|
450
|
+
this.setProperty("sectionFillColor", {
|
|
451
|
+
r: this._data.cuttingPlaneFillColor.red,
|
|
452
|
+
g: this._data.cuttingPlaneFillColor.green,
|
|
453
|
+
b: this._data.cuttingPlaneFillColor.blue,
|
|
454
|
+
}, true);
|
|
433
455
|
}
|
|
434
456
|
get enableSectionFill() {
|
|
435
457
|
return this._data.enableSectionFill;
|
|
436
458
|
}
|
|
437
459
|
set enableSectionFill(value) {
|
|
438
|
-
this.
|
|
439
|
-
this.change();
|
|
460
|
+
this.setProperty("enableSectionFill", value);
|
|
440
461
|
}
|
|
441
462
|
get sectionFillColor() {
|
|
442
463
|
return this._data.sectionFillColor;
|
|
443
464
|
}
|
|
444
465
|
set sectionFillColor(value) {
|
|
445
|
-
this.
|
|
446
|
-
this.
|
|
466
|
+
this.setProperty("sectionFillColor", value, isColorRGB(value));
|
|
467
|
+
this.setProperty("cuttingPlaneFillColor", {
|
|
468
|
+
red: this._data.sectionFillColor.r,
|
|
469
|
+
green: this._data.sectionFillColor.g,
|
|
470
|
+
blue: this._data.sectionFillColor.b,
|
|
471
|
+
}, true);
|
|
447
472
|
}
|
|
448
473
|
get sectionUseObjectColor() {
|
|
449
474
|
return this._data.sectionUseObjectColor;
|
|
450
475
|
}
|
|
451
476
|
set sectionUseObjectColor(value) {
|
|
452
|
-
this.
|
|
453
|
-
this.change();
|
|
477
|
+
this.setProperty("sectionUseObjectColor", value);
|
|
454
478
|
}
|
|
455
479
|
get enableSectionHatch() {
|
|
456
480
|
return this._data.enableSectionHatch;
|
|
457
481
|
}
|
|
458
482
|
set enableSectionHatch(value) {
|
|
459
|
-
this.
|
|
460
|
-
this.change();
|
|
483
|
+
this.setProperty("enableSectionHatch", value);
|
|
461
484
|
}
|
|
462
485
|
get sectionHatchColor() {
|
|
463
486
|
return this._data.sectionHatchColor;
|
|
464
487
|
}
|
|
465
488
|
set sectionHatchColor(value) {
|
|
466
|
-
this.
|
|
467
|
-
this.change();
|
|
489
|
+
this.setProperty("sectionHatchColor", value, isColorRGB(value));
|
|
468
490
|
}
|
|
469
491
|
get sectionHatchScale() {
|
|
470
492
|
return this._data.sectionHatchScale;
|
|
471
493
|
}
|
|
472
494
|
set sectionHatchScale(value) {
|
|
473
|
-
this.
|
|
474
|
-
this.change();
|
|
495
|
+
this.setProperty("sectionHatchScale", value);
|
|
475
496
|
}
|
|
476
497
|
get enableSectionOutline() {
|
|
477
498
|
return this._data.enableSectionOutline;
|
|
478
499
|
}
|
|
479
500
|
set enableSectionOutline(value) {
|
|
480
|
-
this.
|
|
481
|
-
this.change();
|
|
501
|
+
this.setProperty("enableSectionOutline", value);
|
|
482
502
|
}
|
|
483
503
|
get sectionOutlineColor() {
|
|
484
504
|
return this._data.sectionOutlineColor;
|
|
485
505
|
}
|
|
486
506
|
set sectionOutlineColor(value) {
|
|
487
|
-
this.
|
|
488
|
-
this.change();
|
|
507
|
+
this.setProperty("sectionOutlineColor", value, isColorRGB(value));
|
|
489
508
|
}
|
|
490
509
|
get sectionOutlineWidth() {
|
|
491
510
|
return this._data.sectionOutlineWidth;
|
|
492
511
|
}
|
|
493
512
|
set sectionOutlineWidth(value) {
|
|
494
|
-
this.
|
|
495
|
-
this.change();
|
|
513
|
+
this.setProperty("sectionOutlineWidth", value);
|
|
496
514
|
}
|
|
497
515
|
get edgesColor() {
|
|
498
516
|
return this._data.edgesColor;
|
|
499
517
|
}
|
|
500
518
|
set edgesColor(value) {
|
|
501
|
-
this.
|
|
502
|
-
this.change();
|
|
519
|
+
this.setProperty("edgesColor", value, isColorRGB(value));
|
|
503
520
|
}
|
|
504
521
|
get facesColor() {
|
|
505
522
|
return this._data.facesColor;
|
|
506
523
|
}
|
|
507
524
|
set facesColor(value) {
|
|
508
|
-
this.
|
|
509
|
-
this.change();
|
|
525
|
+
this.setProperty("facesColor", value, isColorRGB(value));
|
|
510
526
|
}
|
|
511
527
|
get edgesVisibility() {
|
|
512
528
|
return this._data.edgesVisibility;
|
|
513
529
|
}
|
|
514
530
|
set edgesVisibility(value) {
|
|
515
|
-
this.
|
|
516
|
-
this.change();
|
|
531
|
+
this.setProperty("edgesVisibility", value);
|
|
517
532
|
}
|
|
518
533
|
get edgesOverlap() {
|
|
519
534
|
return this._data.edgesOverlap;
|
|
520
535
|
}
|
|
521
536
|
set edgesOverlap(value) {
|
|
522
|
-
this.
|
|
523
|
-
this.change();
|
|
537
|
+
this.setProperty("edgesOverlap", value);
|
|
524
538
|
}
|
|
525
539
|
get facesOverlap() {
|
|
526
540
|
return this._data.facesOverlap;
|
|
527
541
|
}
|
|
528
542
|
set facesOverlap(value) {
|
|
529
|
-
this.
|
|
530
|
-
this.change();
|
|
543
|
+
this.setProperty("facesOverlap", value);
|
|
531
544
|
}
|
|
532
545
|
get facesTransparancy() {
|
|
533
546
|
return this._data.facesTransparancy;
|
|
534
547
|
}
|
|
535
548
|
set facesTransparancy(value) {
|
|
536
|
-
this.
|
|
537
|
-
this.change();
|
|
549
|
+
this.setProperty("facesTransparancy", value);
|
|
538
550
|
}
|
|
539
551
|
get enableCustomHighlight() {
|
|
540
552
|
return this._data.enableCustomHighlight;
|
|
541
553
|
}
|
|
542
554
|
set enableCustomHighlight(value) {
|
|
543
|
-
this.
|
|
544
|
-
this.change();
|
|
555
|
+
this.setProperty("enableCustomHighlight", value);
|
|
545
556
|
}
|
|
546
557
|
get sceneGraph() {
|
|
547
558
|
return this._data.sceneGraph;
|
|
548
559
|
}
|
|
549
560
|
set sceneGraph(value) {
|
|
550
|
-
this.
|
|
551
|
-
|
|
552
|
-
this._data.enablePartialMode = false;
|
|
553
|
-
this.change();
|
|
561
|
+
this.setProperty("sceneGraph", value);
|
|
562
|
+
this.setProperty("enablePartialMode", this.enablePartialMode && !this.sceneGraph);
|
|
554
563
|
}
|
|
555
564
|
get edgeModel() {
|
|
556
565
|
return Boolean(this._data.edgeModel);
|
|
557
566
|
}
|
|
558
567
|
set edgeModel(value) {
|
|
559
|
-
this.
|
|
560
|
-
this.change();
|
|
568
|
+
this.setProperty("edgeModel", value);
|
|
561
569
|
}
|
|
562
570
|
get reverseZoomWheel() {
|
|
563
571
|
return this._data.reverseZoomWheel;
|
|
564
572
|
}
|
|
565
573
|
set reverseZoomWheel(value) {
|
|
566
|
-
this.
|
|
567
|
-
this.change();
|
|
574
|
+
this.setProperty("reverseZoomWheel", value);
|
|
568
575
|
}
|
|
569
576
|
get enableZoomWheel() {
|
|
570
577
|
return this._data.enableZoomWheel;
|
|
571
578
|
}
|
|
572
579
|
set enableZoomWheel(value) {
|
|
573
|
-
this.
|
|
574
|
-
this.change();
|
|
580
|
+
this.setProperty("enableZoomWheel", value);
|
|
575
581
|
}
|
|
576
582
|
get enableGestures() {
|
|
577
583
|
return this._data.enableGestures;
|
|
578
584
|
}
|
|
579
585
|
set enableGestures(value) {
|
|
580
|
-
this.
|
|
581
|
-
this.change();
|
|
586
|
+
this.setProperty("enableGestures", value);
|
|
582
587
|
}
|
|
583
588
|
get geometryType() {
|
|
584
589
|
return this._data.geometryType;
|
|
585
590
|
}
|
|
586
591
|
set geometryType(value) {
|
|
587
|
-
this.
|
|
588
|
-
this.change();
|
|
592
|
+
this.setProperty("geometryType", value);
|
|
589
593
|
}
|
|
590
594
|
get rulerUnit() {
|
|
591
595
|
return this._data.rulerUnit;
|
|
592
596
|
}
|
|
593
597
|
set rulerUnit(value) {
|
|
594
|
-
this.
|
|
595
|
-
this.change();
|
|
598
|
+
this.setProperty("rulerUnit", value);
|
|
596
599
|
}
|
|
597
600
|
get rulerPrecision() {
|
|
598
601
|
return this._data.rulerPrecision;
|
|
599
602
|
}
|
|
600
603
|
set rulerPrecision(value) {
|
|
601
|
-
this.
|
|
602
|
-
this.change();
|
|
604
|
+
this.setProperty("rulerPrecision", value, typeof value === "number" || value === "Default" || value === "Auto");
|
|
603
605
|
}
|
|
604
606
|
get cameraMode() {
|
|
605
|
-
return this._data.cameraMode
|
|
607
|
+
return this._data.cameraMode;
|
|
606
608
|
}
|
|
607
609
|
set cameraMode(value) {
|
|
608
|
-
this.
|
|
609
|
-
|
|
610
|
+
this.setProperty("cameraMode", value, value === "perspective" || value === "orthographic");
|
|
611
|
+
}
|
|
612
|
+
get snapshotMimeType() {
|
|
613
|
+
return this._data.snapshotMimeType;
|
|
614
|
+
}
|
|
615
|
+
set snapshotMimeType(value) {
|
|
616
|
+
this.setProperty("snapshotMimeType", value);
|
|
617
|
+
}
|
|
618
|
+
get snapshotQuality() {
|
|
619
|
+
return this._data.snapshotQuality;
|
|
620
|
+
}
|
|
621
|
+
set snapshotQuality(value) {
|
|
622
|
+
this.setProperty("snapshotQuality", value);
|
|
610
623
|
}
|
|
611
624
|
}
|
|
612
625
|
const CanvasEvents = [
|
|
@@ -34508,7 +34521,7 @@ void main() {
|
|
|
34508
34521
|
const object = intersections[0].object;
|
|
34509
34522
|
const intersectionPoint = intersections[0].point;
|
|
34510
34523
|
const localPoint = object.worldToLocal(intersectionPoint.clone());
|
|
34511
|
-
let snapPoint;
|
|
34524
|
+
let snapPoint = undefined;
|
|
34512
34525
|
let snapDistance = this.getDetectRadius(intersectionPoint);
|
|
34513
34526
|
const geometry = object.geometry;
|
|
34514
34527
|
const positions = geometry.attributes.position.array;
|
|
@@ -36393,7 +36406,7 @@ void main() {
|
|
|
36393
36406
|
}
|
|
36394
36407
|
dispose() {
|
|
36395
36408
|
this.viewer.removeEventListener("optionschange", this.syncOptions);
|
|
36396
|
-
this.viewer.scene.background =
|
|
36409
|
+
this.viewer.scene.background = null;
|
|
36397
36410
|
}
|
|
36398
36411
|
}
|
|
36399
36412
|
|
|
@@ -36469,7 +36482,7 @@ void main() {
|
|
|
36469
36482
|
if (mode === this.getCameraMode(currentCamera))
|
|
36470
36483
|
return;
|
|
36471
36484
|
const target = this.viewer.target.clone();
|
|
36472
|
-
let camera;
|
|
36485
|
+
let camera = null;
|
|
36473
36486
|
if (currentCamera.isOrthographicCamera) {
|
|
36474
36487
|
const fov = currentCamera.userData.fov || 45;
|
|
36475
36488
|
const fieldHeight = (currentCamera.top - currentCamera.bottom) / currentCamera.zoom;
|
|
@@ -36760,7 +36773,6 @@ void main() {
|
|
|
36760
36773
|
}
|
|
36761
36774
|
dispose() {
|
|
36762
36775
|
this.mutationObserver.disconnect();
|
|
36763
|
-
this.mutationObserver = undefined;
|
|
36764
36776
|
}
|
|
36765
36777
|
}
|
|
36766
36778
|
|
|
@@ -38816,11 +38828,13 @@ void main() {
|
|
|
38816
38828
|
canvas.width = 64;
|
|
38817
38829
|
canvas.height = 64;
|
|
38818
38830
|
const context = canvas.getContext("2d");
|
|
38819
|
-
context
|
|
38820
|
-
|
|
38821
|
-
|
|
38822
|
-
|
|
38823
|
-
|
|
38831
|
+
if (context) {
|
|
38832
|
+
context.clearRect(0, 0, 64, 64);
|
|
38833
|
+
context.font = "24px Arial";
|
|
38834
|
+
context.textAlign = "center";
|
|
38835
|
+
context.fillStyle = color.getStyle();
|
|
38836
|
+
context.fillText(text, 32, 41);
|
|
38837
|
+
}
|
|
38824
38838
|
const texture = new CanvasTexture(canvas);
|
|
38825
38839
|
texture.colorSpace = SRGBColorSpace;
|
|
38826
38840
|
return new SpriteMaterial({ map: texture, toneMapped: false });
|
|
@@ -38949,8 +38963,8 @@ void main() {
|
|
|
38949
38963
|
if (object.material)
|
|
38950
38964
|
disposeMaterials(object.material);
|
|
38951
38965
|
}
|
|
38952
|
-
this.handleToObjects
|
|
38953
|
-
this.originalObjects
|
|
38966
|
+
this.handleToObjects.clear();
|
|
38967
|
+
this.originalObjects.clear();
|
|
38954
38968
|
this.scene.traverse(disposeObject);
|
|
38955
38969
|
this.scene.clear();
|
|
38956
38970
|
}
|
|
@@ -39216,44 +39230,54 @@ void main() {
|
|
|
39216
39230
|
centersCache.set(handle, target.clone());
|
|
39217
39231
|
return target;
|
|
39218
39232
|
};
|
|
39219
|
-
|
|
39220
|
-
|
|
39221
|
-
|
|
39222
|
-
|
|
39223
|
-
|
|
39224
|
-
|
|
39225
|
-
|
|
39233
|
+
const calcObjectOffset = (object, target) => {
|
|
39234
|
+
const parent = object.parent;
|
|
39235
|
+
if (!parent || parent.userData.originalCenter === undefined)
|
|
39236
|
+
return target;
|
|
39237
|
+
return target.subVectors(object.userData.originalCenter, parent.userData.originalCenter);
|
|
39238
|
+
};
|
|
39239
|
+
const calcObjectDepth = (object) => {
|
|
39240
|
+
if (object.userData.depth !== undefined)
|
|
39241
|
+
return object.userData.depth;
|
|
39242
|
+
const parent = object.parent;
|
|
39243
|
+
const depth = parent && object !== explodeRoot ? calcObjectDepth(parent) + 1 : 0;
|
|
39244
|
+
object.userData.depth = depth;
|
|
39226
39245
|
object.userData.originalPosition = object.position.clone();
|
|
39227
39246
|
object.userData.originalCenter = calcObjectCenter(object, new Vector3());
|
|
39228
|
-
|
|
39229
|
-
|
|
39247
|
+
object.userData.originalOffset = calcObjectOffset(object, new Vector3());
|
|
39248
|
+
return depth;
|
|
39249
|
+
};
|
|
39230
39250
|
const explodeScale = scale / 100;
|
|
39231
39251
|
const explodeRoot = this.scene;
|
|
39232
|
-
|
|
39233
|
-
|
|
39252
|
+
const explodeObjects = this.getObjects();
|
|
39253
|
+
if (explodeRoot.userData.explodeDepth === undefined) {
|
|
39254
|
+
let maxDepth = 0;
|
|
39255
|
+
explodeObjects.forEach((object) => {
|
|
39256
|
+
const depth = calcObjectDepth(object);
|
|
39257
|
+
if (depth > maxDepth)
|
|
39258
|
+
maxDepth = depth;
|
|
39259
|
+
});
|
|
39260
|
+
explodeRoot.userData.explodeDepth = maxDepth;
|
|
39234
39261
|
}
|
|
39235
39262
|
const maxDepth = explodeRoot.userData.explodeDepth;
|
|
39236
39263
|
const scaledExplodeDepth = explodeScale * maxDepth + 1;
|
|
39237
39264
|
const explodeDepth = 0 | scaledExplodeDepth;
|
|
39238
39265
|
const currentSegmentFraction = scaledExplodeDepth - explodeDepth;
|
|
39239
|
-
|
|
39266
|
+
const explodeObject = (object) => {
|
|
39240
39267
|
if (object.isCamera)
|
|
39241
39268
|
return;
|
|
39242
|
-
if (object.userData.isHighlightWireframe)
|
|
39243
|
-
return;
|
|
39244
39269
|
object.position.copy(object.userData.originalPosition);
|
|
39270
|
+
const depth = object.userData.depth;
|
|
39245
39271
|
if (depth > 0 && depth <= explodeDepth) {
|
|
39246
39272
|
let objectScale = explodeScale * coeff;
|
|
39247
39273
|
if (depth === explodeDepth)
|
|
39248
39274
|
objectScale *= currentSegmentFraction;
|
|
39249
|
-
|
|
39250
|
-
const objectCenter = object.userData.originalCenter;
|
|
39251
|
-
const localOffset = objectCenter.clone().sub(parentCenter).multiplyScalar(objectScale);
|
|
39252
|
-
object.position.add(localOffset);
|
|
39275
|
+
object.position.addScaledVector(object.userData.originalOffset, objectScale);
|
|
39253
39276
|
}
|
|
39254
|
-
|
|
39255
|
-
|
|
39256
|
-
|
|
39277
|
+
};
|
|
39278
|
+
explodeObjects.forEach((object) => {
|
|
39279
|
+
explodeObject(object);
|
|
39280
|
+
});
|
|
39257
39281
|
this.scene.updateMatrixWorld();
|
|
39258
39282
|
return this;
|
|
39259
39283
|
}
|
|
@@ -39356,6 +39380,12 @@ void main() {
|
|
|
39356
39380
|
centersCache.set(handle, target.clone());
|
|
39357
39381
|
return target;
|
|
39358
39382
|
};
|
|
39383
|
+
const calcObjectOffset = (object, target) => {
|
|
39384
|
+
const parent = object.parent;
|
|
39385
|
+
if (!parent || parent.userData.originalCenter === undefined)
|
|
39386
|
+
return target;
|
|
39387
|
+
return target.subVectors(object.userData.originalCenter, parent.userData.originalCenter);
|
|
39388
|
+
};
|
|
39359
39389
|
const calcObjectDepth = (object) => {
|
|
39360
39390
|
if (object.userData.depth !== undefined)
|
|
39361
39391
|
return object.userData.depth;
|
|
@@ -39364,13 +39394,15 @@ void main() {
|
|
|
39364
39394
|
object.userData.depth = depth;
|
|
39365
39395
|
object.userData.originalPosition = object.position.clone();
|
|
39366
39396
|
object.userData.originalCenter = calcObjectCenter(object, new Vector3());
|
|
39397
|
+
object.userData.originalOffset = calcObjectOffset(object, new Vector3());
|
|
39367
39398
|
return depth;
|
|
39368
39399
|
};
|
|
39369
39400
|
const explodeScale = scale / 100;
|
|
39370
39401
|
const explodeRoot = this.scene.children[0];
|
|
39371
|
-
|
|
39402
|
+
const explodeObjects = this.getObjects();
|
|
39403
|
+
if (explodeRoot.userData.explodeDepth === undefined) {
|
|
39372
39404
|
let maxDepth = 0;
|
|
39373
|
-
|
|
39405
|
+
explodeObjects.forEach((object) => {
|
|
39374
39406
|
const depth = calcObjectDepth(object);
|
|
39375
39407
|
if (depth > maxDepth)
|
|
39376
39408
|
maxDepth = depth;
|
|
@@ -39382,29 +39414,26 @@ void main() {
|
|
|
39382
39414
|
const explodeDepth = 0 | scaledExplodeDepth;
|
|
39383
39415
|
const currentSegmentFraction = scaledExplodeDepth - explodeDepth;
|
|
39384
39416
|
const offsetCache = new Map();
|
|
39385
|
-
const
|
|
39417
|
+
const calcExplodeOffset = (object, target) => {
|
|
39386
39418
|
if (offsetCache.has(object))
|
|
39387
39419
|
return target.copy(offsetCache.get(object));
|
|
39388
39420
|
const parent = object.parent;
|
|
39389
39421
|
if (parent && object !== explodeRoot)
|
|
39390
|
-
|
|
39422
|
+
calcExplodeOffset(parent, target);
|
|
39391
39423
|
const depth = object.userData.depth;
|
|
39392
39424
|
if (depth > 0 && depth <= explodeDepth) {
|
|
39393
39425
|
let objectScale = explodeScale * coeff;
|
|
39394
39426
|
if (depth === explodeDepth)
|
|
39395
39427
|
objectScale *= currentSegmentFraction;
|
|
39396
|
-
|
|
39397
|
-
const objectCenter = object.userData.originalCenter;
|
|
39398
|
-
const localOffset = objectCenter.clone().sub(parentCenter).multiplyScalar(objectScale);
|
|
39399
|
-
target.add(localOffset);
|
|
39428
|
+
target.addScaledVector(object.userData.originalOffset, objectScale);
|
|
39400
39429
|
}
|
|
39401
39430
|
offsetCache.set(object, target.clone());
|
|
39402
39431
|
return target;
|
|
39403
39432
|
};
|
|
39404
39433
|
const transformMap = new Map();
|
|
39405
|
-
|
|
39406
|
-
const
|
|
39407
|
-
transformMap.set(object, new Matrix4().makeTranslation(
|
|
39434
|
+
explodeObjects.forEach((object) => {
|
|
39435
|
+
const offset = calcExplodeOffset(object, new Vector3());
|
|
39436
|
+
transformMap.set(object, new Matrix4().makeTranslation(offset));
|
|
39408
39437
|
});
|
|
39409
39438
|
this.gltfLoader.applyObjectTransforms(transformMap);
|
|
39410
39439
|
this.scene.updateMatrixWorld();
|
|
@@ -42763,10 +42792,10 @@ void main() {
|
|
|
42763
42792
|
}
|
|
42764
42793
|
offset += chunkLength;
|
|
42765
42794
|
}
|
|
42766
|
-
if (
|
|
42795
|
+
if (this.content === undefined) {
|
|
42767
42796
|
throw new Error("GLTFBinaryParser: JSON content not found.");
|
|
42768
42797
|
}
|
|
42769
|
-
if (
|
|
42798
|
+
if (this.body === undefined) {
|
|
42770
42799
|
throw new Error("GLTFBinaryParser: Binary buffer chunk not found or type not supported.");
|
|
42771
42800
|
}
|
|
42772
42801
|
}
|
|
@@ -44092,11 +44121,11 @@ void main() {
|
|
|
44092
44121
|
if (this.manager)
|
|
44093
44122
|
this.manager.dispose();
|
|
44094
44123
|
}
|
|
44095
|
-
isSupport(file, format) {
|
|
44124
|
+
isSupport(file, format = "") {
|
|
44096
44125
|
return ((typeof file === "string" || file instanceof globalThis.File || file instanceof ArrayBuffer) &&
|
|
44097
44126
|
/(gltf|glb)$/i.test(format));
|
|
44098
44127
|
}
|
|
44099
|
-
async load(file, format, params) {
|
|
44128
|
+
async load(file, format, params = {}) {
|
|
44100
44129
|
this.manager = new GLTFLoadingManager(file, params);
|
|
44101
44130
|
const scene = new Group$1();
|
|
44102
44131
|
this.gltfLoader = new DynamicGltfLoader(this.viewer.camera, scene, this.viewer.renderer);
|
|
@@ -58476,8 +58505,8 @@ js: import "konva/skia-backend";
|
|
|
58476
58505
|
this.lineWidth = 4;
|
|
58477
58506
|
this.lineType = "solid";
|
|
58478
58507
|
this.fontSize = 34;
|
|
58479
|
-
this.changeActiveDragger = (
|
|
58480
|
-
const draggerName =
|
|
58508
|
+
this.changeActiveDragger = ({ data }) => {
|
|
58509
|
+
const draggerName = data || "";
|
|
58481
58510
|
this._markupContainer.className = this._container.className
|
|
58482
58511
|
.split(" ")
|
|
58483
58512
|
.filter((x) => !x.startsWith("oda-cursor-"))
|
|
@@ -58538,19 +58567,19 @@ js: import "konva/skia-backend";
|
|
|
58538
58567
|
this._resizeObserver = new ResizeObserver(this.resizeContainer);
|
|
58539
58568
|
this._resizeObserver.observe(container);
|
|
58540
58569
|
if (this._viewer) {
|
|
58541
|
-
this._viewer.
|
|
58542
|
-
this._viewer.
|
|
58543
|
-
this._viewer.
|
|
58544
|
-
this._viewer.
|
|
58570
|
+
this._viewer.on("changeactivedragger", this.changeActiveDragger);
|
|
58571
|
+
this._viewer.on("pan", this.pan);
|
|
58572
|
+
this._viewer.on("zoomat", this.zoomAt);
|
|
58573
|
+
this._viewer.on("changecameramode", this.changeCameraMode);
|
|
58545
58574
|
}
|
|
58546
58575
|
}
|
|
58547
58576
|
dispose() {
|
|
58548
58577
|
var _a, _b;
|
|
58549
58578
|
if (this._viewer) {
|
|
58550
|
-
this._viewer.
|
|
58551
|
-
this._viewer.
|
|
58552
|
-
this._viewer.
|
|
58553
|
-
this._viewer.
|
|
58579
|
+
this._viewer.off("changecameramode", this.changeCameraMode);
|
|
58580
|
+
this._viewer.off("zoomat", this.zoomAt);
|
|
58581
|
+
this._viewer.off("pan", this.pan);
|
|
58582
|
+
this._viewer.off("changeactivedragger", this.changeActiveDragger);
|
|
58554
58583
|
}
|
|
58555
58584
|
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
58556
58585
|
this._resizeObserver = undefined;
|
|
@@ -59387,7 +59416,9 @@ js: import "konva/skia-backend";
|
|
|
59387
59416
|
this.canvasEvents.forEach((x) => canvas.addEventListener(x, this.canvaseventlistener));
|
|
59388
59417
|
this._markup.initialize(this.canvas, this.canvasEvents, this, this);
|
|
59389
59418
|
for (const name of components.getComponents().keys()) {
|
|
59390
|
-
|
|
59419
|
+
const component = components.createComponent(name, this);
|
|
59420
|
+
if (component)
|
|
59421
|
+
this._components.push(component);
|
|
59391
59422
|
}
|
|
59392
59423
|
this.syncOptions();
|
|
59393
59424
|
this.syncOverlay();
|
|
@@ -59409,10 +59440,7 @@ js: import "konva/skia-backend";
|
|
|
59409
59440
|
this.setActiveDragger();
|
|
59410
59441
|
this._components.forEach((component) => component.dispose());
|
|
59411
59442
|
this._components.length = 0;
|
|
59412
|
-
|
|
59413
|
-
this._markup.dispose();
|
|
59414
|
-
this._markup = undefined;
|
|
59415
|
-
}
|
|
59443
|
+
this._markup.dispose();
|
|
59416
59444
|
if (this.canvas) {
|
|
59417
59445
|
this.canvasEvents.forEach((x) => this.canvas.removeEventListener(x, this.canvaseventlistener));
|
|
59418
59446
|
this.canvas = undefined;
|
|
@@ -59665,7 +59693,7 @@ js: import "konva/skia-backend";
|
|
|
59665
59693
|
}
|
|
59666
59694
|
}
|
|
59667
59695
|
getComponent(name) {
|
|
59668
|
-
return this._components.find((component) => component.name === name);
|
|
59696
|
+
return this._components.find((component) => component.name === name) || null;
|
|
59669
59697
|
}
|
|
59670
59698
|
drawViewpoint(viewpoint) {
|
|
59671
59699
|
var _a, _b, _c, _d;
|