@inweb/viewer-visualize 25.3.13 → 25.3.17
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/README.md +20 -20
- package/dist/viewer-visualize.js +313 -1
- package/dist/viewer-visualize.js.map +1 -1
- package/dist/viewer-visualize.min.js +1 -1
- package/dist/viewer-visualize.module.js +330 -2
- package/dist/viewer-visualize.module.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/package.json +5 -5
- package/src/Viewer/Commands/ApplyModelTransform.ts +2 -4
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaCloud.ts +1 -1
- package/src/index.ts +3 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Viewer.visualize
|
|
2
2
|
|
|
3
|
-
`Viewer.visualize` is
|
|
3
|
+
`Viewer.visualize` is JavaScript library powered by [Visualize](https://www.opendesign.com/products/visualize) for in-browser visualization of 3D CAD and BIM data in browser from `VSFX` files stored on the [Open Cloud Server](https://cloud.opendesign.com/docs/index.html#/opencloud_server), on the web, or on your local computer.
|
|
4
4
|
|
|
5
|
-
This library enables you to integrate advanced
|
|
5
|
+
This library enables you to integrate advanced visualization capabilities into your web applications, including user interaction with scenes and objects, markups, and collaboration using the [inWEB Open Cloud](https://www.opendesign.com/products/open-cloud) platform.
|
|
6
6
|
|
|
7
7
|
> `VSFX` is an internal [Visualize SDK](https://cloud.opendesign.com/docs/index.html#/visualizejs) file format with support for streaming and partial viewing.
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@ This library enables you to integrate advanced [Visualize](https://www.opendesig
|
|
|
10
10
|
|
|
11
11
|
### CDN or static hosting
|
|
12
12
|
|
|
13
|
-
For CDN, you can use [unpkg](https://unpkg.com/) or [jsDelivr](https://www.jsdelivr.com/) (replace `25.
|
|
13
|
+
For CDN, you can use [unpkg](https://unpkg.com/) or [jsDelivr](https://www.jsdelivr.com/) (replace `25.3` with a version you need):
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
<script src="https://unpkg.com/@inweb/viewer-visualize@25.
|
|
15
|
+
```html
|
|
16
|
+
<script src="https://unpkg.com/@inweb/viewer-visualize@25.3/dist/viewer-visualize.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
The global namespace for `Viewer.visualize` is `ODA.Visualize`.
|
|
@@ -36,24 +36,24 @@ import { Viewer } from "@inweb/viewer-visualize";
|
|
|
36
36
|
|
|
37
37
|
Download and render file from the `Open Cloud Server`:
|
|
38
38
|
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// login to the server
|
|
44
|
-
await client.signInWithEmail("email", "password");
|
|
45
|
-
|
|
46
|
-
// get file list from the server
|
|
47
|
-
const files = await client.getFiles();
|
|
39
|
+
```html
|
|
40
|
+
<script src="https://unpkg.com/@inweb/client@25.3/dist/client.js"></script>
|
|
41
|
+
<script src="https://unpkg.com/@inweb/viewer-visualize@25.3/dist/viewer-visualize.js"></script>
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
const
|
|
43
|
+
<script>
|
|
44
|
+
const client = new ODA.Api.Client({ serverUrl: "https://cloud.opendesign.com/api" });
|
|
45
|
+
const viewer = new ODA.Visualize.Viewer(client);
|
|
51
46
|
|
|
52
|
-
|
|
53
|
-
await viewer.initialize(canvas);
|
|
47
|
+
init();
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
await
|
|
49
|
+
async function init() {
|
|
50
|
+
await client.signInWithEmail("email", "password");
|
|
51
|
+
const files = await client.getFiles();
|
|
52
|
+
await viewer.initialize(canvas);
|
|
53
|
+
await viewer.open(files.result[0]);
|
|
54
|
+
viewer.setActiveDragger("Orbit");
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
To learn more, see [First application guide](https://cloud.opendesign.com/docs/index.html#/guide).
|
package/dist/viewer-visualize.js
CHANGED
|
@@ -356,6 +356,317 @@
|
|
|
356
356
|
|
|
357
357
|
const CANVAS_EVENTS = [ "click", "dblclick", "mousedown", "mousemove", "mouseup", "mouseleave", "pointerdown", "pointermove", "pointerup", "pointerleave", "pointercancel", "wheel", "touchstart", "touchmove", "touchend", "touchcancel" ];
|
|
358
358
|
|
|
359
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
360
|
+
const composeMatrixFromTransform = (translate, rotate, scale, modelCenter, matrix) => {
|
|
361
|
+
const translateMatrix = matrix.setTranslation([translate.x, translate.y, translate.z]);
|
|
362
|
+
const rotateMatrix = matrix.setToRotation(rotate.angle, [rotate.x, rotate.y, rotate.z], modelCenter);
|
|
363
|
+
const scaleMatrix = matrix.setToScaling(scale, modelCenter);
|
|
364
|
+
return translateMatrix.postMultBy(rotateMatrix).postMultBy(scaleMatrix);
|
|
365
|
+
};
|
|
366
|
+
function applyModelTransform(viewer, model) {
|
|
367
|
+
var _a;
|
|
368
|
+
if (!viewer.visualizeJs)
|
|
369
|
+
return;
|
|
370
|
+
if (!model.getModelTransformMatrix)
|
|
371
|
+
return; // Model.getModelTransformMatrix() since 24.3.14
|
|
372
|
+
const visLib = viewer.visLib();
|
|
373
|
+
const visViewer = visLib.getViewer();
|
|
374
|
+
const modelItr = visViewer.getModelIterator();
|
|
375
|
+
for (; !modelItr.done(); modelItr.step()) {
|
|
376
|
+
const modelPtr = modelItr.getModel();
|
|
377
|
+
const transform = model.getModelTransformMatrix(modelPtr.getDatabaseHandle());
|
|
378
|
+
if (transform) {
|
|
379
|
+
const extents = modelPtr.getExtents();
|
|
380
|
+
const matrix = composeMatrixFromTransform(transform.translate, transform.rotation, transform.scale, extents.center(), new visLib.Matrix3d());
|
|
381
|
+
modelPtr.setModelingMatrix(matrix, true);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
modelItr.delete();
|
|
385
|
+
(_a = visViewer.clearViewExtentsCache) === null || _a === void 0 ? void 0 : _a.call(visViewer);
|
|
386
|
+
viewer.update();
|
|
387
|
+
}
|
|
388
|
+
commands("VisualizeJS").registerCommand("applyModelTransform", applyModelTransform);
|
|
389
|
+
|
|
390
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
391
|
+
commands("VisualizeJS").registerCommand("clearMarkup", (viewer) => viewer.clearOverlay());
|
|
392
|
+
commands("VisualizeJS").registerCommandAlias("clearMarkup", "clearOverlay");
|
|
393
|
+
|
|
394
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
395
|
+
commands("VisualizeJS").registerCommand("clearSlices", (viewer) => viewer.clearSlices());
|
|
396
|
+
|
|
397
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
398
|
+
function createPreview(viewer, type = "image/jpeg", encoderOptions = 0.25) {
|
|
399
|
+
var _a;
|
|
400
|
+
if (!viewer.visualizeJs)
|
|
401
|
+
return "";
|
|
402
|
+
return ((_a = viewer.canvas) === null || _a === void 0 ? void 0 : _a.toDataURL(type, encoderOptions)) || "";
|
|
403
|
+
}
|
|
404
|
+
commands("VisualizeJS").registerCommand("createPreview", createPreview);
|
|
405
|
+
|
|
406
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
407
|
+
function explode(viewer, index = 0) {
|
|
408
|
+
if (!viewer.visualizeJs)
|
|
409
|
+
return;
|
|
410
|
+
const visViewer = viewer.visViewer();
|
|
411
|
+
visViewer.explode(index);
|
|
412
|
+
viewer.update();
|
|
413
|
+
viewer.emit({ type: "explode", data: index });
|
|
414
|
+
}
|
|
415
|
+
commands("VisualizeJS").registerCommand("explode", explode);
|
|
416
|
+
commands("VisualizeJS").registerCommand("collect", (viewer) => explode(viewer, 0));
|
|
417
|
+
|
|
418
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
419
|
+
function getDefaultViewPositions(viewer) {
|
|
420
|
+
if (!viewer.visualizeJs)
|
|
421
|
+
return [];
|
|
422
|
+
const visLib = viewer.visLib();
|
|
423
|
+
const defViewPos = visLib.DefaultViewPosition;
|
|
424
|
+
return Object.keys(defViewPos).filter((x) => x !== "values");
|
|
425
|
+
}
|
|
426
|
+
commands("VisualizeJS").registerCommand("getDefaultViewPositions", getDefaultViewPositions);
|
|
427
|
+
|
|
428
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
429
|
+
function getModels(viewer) {
|
|
430
|
+
if (!viewer.visualizeJs)
|
|
431
|
+
return [];
|
|
432
|
+
const visViewer = viewer.visViewer();
|
|
433
|
+
const handles = [];
|
|
434
|
+
const modelItr = visViewer.getModelIterator();
|
|
435
|
+
for (; !modelItr.done(); modelItr.step()) {
|
|
436
|
+
const modelPtr = modelItr.getModel();
|
|
437
|
+
if (modelPtr.getName()[0] !== "$")
|
|
438
|
+
handles.push(modelPtr.getDatabaseHandle());
|
|
439
|
+
}
|
|
440
|
+
modelItr.delete();
|
|
441
|
+
return handles;
|
|
442
|
+
}
|
|
443
|
+
commands("VisualizeJS").registerCommand("getModels", getModels);
|
|
444
|
+
|
|
445
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
446
|
+
function getSelected(viewer) {
|
|
447
|
+
if (!viewer.visualizeJs)
|
|
448
|
+
return [];
|
|
449
|
+
const visViewer = viewer.visViewer();
|
|
450
|
+
const handles = [];
|
|
451
|
+
const selectionSet = visViewer.getSelected();
|
|
452
|
+
if (!selectionSet.isNull() && selectionSet.numItems() !== 0) {
|
|
453
|
+
const itr = selectionSet.getIterator();
|
|
454
|
+
for (; !itr.done(); itr.step()) {
|
|
455
|
+
const entityId = itr.getEntity();
|
|
456
|
+
const entityPtr = entityId.getType() === 1
|
|
457
|
+
? entityId.openObject()
|
|
458
|
+
: entityId.getType() === 2
|
|
459
|
+
? entityId.openObjectAsInsert()
|
|
460
|
+
: null;
|
|
461
|
+
if (entityPtr) {
|
|
462
|
+
const handle = entityPtr.getNativeDatabaseHandle();
|
|
463
|
+
if (handle !== "-1")
|
|
464
|
+
handles.push(handle);
|
|
465
|
+
entityPtr.delete();
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
itr.delete();
|
|
469
|
+
}
|
|
470
|
+
return handles;
|
|
471
|
+
}
|
|
472
|
+
commands("VisualizeJS").registerCommand("getSelected", getSelected);
|
|
473
|
+
|
|
474
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
475
|
+
function hideSelected(viewer) {
|
|
476
|
+
if (!viewer.visualizeJs)
|
|
477
|
+
return;
|
|
478
|
+
const visViewer = viewer.visViewer();
|
|
479
|
+
visViewer.hideSelectedObjects(false);
|
|
480
|
+
viewer.update();
|
|
481
|
+
viewer.emit({ type: "hide" });
|
|
482
|
+
}
|
|
483
|
+
commands("VisualizeJS").registerCommand("hideSelected", hideSelected);
|
|
484
|
+
|
|
485
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
486
|
+
function isolateSelected(viewer) {
|
|
487
|
+
if (!viewer.visualizeJs)
|
|
488
|
+
return;
|
|
489
|
+
const visViewer = viewer.visViewer();
|
|
490
|
+
visViewer.isolateSelectedObjects(false);
|
|
491
|
+
viewer.update();
|
|
492
|
+
viewer.emit({ type: "isolate" });
|
|
493
|
+
}
|
|
494
|
+
commands("VisualizeJS").registerCommand("isolateSelected", isolateSelected);
|
|
495
|
+
|
|
496
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
497
|
+
function regenerateAll(viewer) {
|
|
498
|
+
if (!viewer.visualizeJs)
|
|
499
|
+
return;
|
|
500
|
+
const visViewer = viewer.visViewer();
|
|
501
|
+
visViewer.regenAll();
|
|
502
|
+
viewer.update();
|
|
503
|
+
viewer.emit({ type: "regenerateall" });
|
|
504
|
+
}
|
|
505
|
+
commands("VisualizeJS").registerCommand("regenerateAll", regenerateAll);
|
|
506
|
+
|
|
507
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
508
|
+
function resetView(viewer) {
|
|
509
|
+
if (!viewer.visualizeJs)
|
|
510
|
+
return;
|
|
511
|
+
viewer.executeCommand("setActiveDragger", "");
|
|
512
|
+
viewer.executeCommand("clearSlices");
|
|
513
|
+
viewer.executeCommand("clearOverlay");
|
|
514
|
+
viewer.executeCommand("setMarkupColor");
|
|
515
|
+
viewer.executeCommand("unselect");
|
|
516
|
+
viewer.executeCommand("showAll");
|
|
517
|
+
viewer.executeCommand("explode", 0);
|
|
518
|
+
viewer.executeCommand("zoomToExtents", true);
|
|
519
|
+
viewer.executeCommand("k3DViewSW");
|
|
520
|
+
viewer.emit({ type: "resetview" });
|
|
521
|
+
}
|
|
522
|
+
commands("VisualizeJS").registerCommand("resetView", resetView);
|
|
523
|
+
|
|
524
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
525
|
+
function selectModel(viewer, handle) {
|
|
526
|
+
if (!viewer.visualizeJs)
|
|
527
|
+
return;
|
|
528
|
+
const visViewer = viewer.visViewer();
|
|
529
|
+
const activeView = visViewer.activeView;
|
|
530
|
+
const modelItr = visViewer.getModelIterator();
|
|
531
|
+
for (; !modelItr.done(); modelItr.step()) {
|
|
532
|
+
const modelPtr = modelItr.getModel();
|
|
533
|
+
if (modelPtr.getDatabaseHandle() === handle) {
|
|
534
|
+
const selectionSet = activeView.selectCrossing([0, 9999, 9999, 0], modelPtr);
|
|
535
|
+
visViewer.setSelected(selectionSet);
|
|
536
|
+
const handles = viewer.getSelected();
|
|
537
|
+
viewer.update();
|
|
538
|
+
viewer.emitEvent({ type: "select", data: selectionSet, handles });
|
|
539
|
+
selectionSet.delete();
|
|
540
|
+
break;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
modelItr.delete();
|
|
544
|
+
}
|
|
545
|
+
commands("VisualizeJS").registerCommand("selectModel", selectModel);
|
|
546
|
+
|
|
547
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
548
|
+
commands("VisualizeJS").registerCommand("setActiveDragger", (viewer, dragger = "") => {
|
|
549
|
+
viewer.setActiveDragger(dragger);
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
553
|
+
function setDefaultViewPosition(viewer, position = "") {
|
|
554
|
+
if (!viewer.visualizeJs)
|
|
555
|
+
return;
|
|
556
|
+
const visLib = viewer.visLib();
|
|
557
|
+
const visViewer = viewer.visViewer();
|
|
558
|
+
const defViewPos = visLib.DefaultViewPosition;
|
|
559
|
+
visViewer.setDefaultViewPositionWithAnimation(defViewPos[position]);
|
|
560
|
+
viewer.update();
|
|
561
|
+
viewer.emit({ type: "viewposition", data: position });
|
|
562
|
+
}
|
|
563
|
+
commands("VisualizeJS").registerCommand("setDefaultViewPosition", setDefaultViewPosition);
|
|
564
|
+
commands("VisualizeJS").registerCommand("k3DViewTop", (viewer) => setDefaultViewPosition(viewer, "k3DViewTop"));
|
|
565
|
+
commands("VisualizeJS").registerCommand("k3DViewBottom", (viewer) => setDefaultViewPosition(viewer, "k3DViewBottom"));
|
|
566
|
+
commands("VisualizeJS").registerCommand("k3DViewLeft", (viewer) => setDefaultViewPosition(viewer, "k3DViewLeft"));
|
|
567
|
+
commands("VisualizeJS").registerCommand("k3DViewRight", (viewer) => setDefaultViewPosition(viewer, "k3DViewRight"));
|
|
568
|
+
commands("VisualizeJS").registerCommand("k3DViewFront", (viewer) => setDefaultViewPosition(viewer, "k3DViewFront"));
|
|
569
|
+
commands("VisualizeJS").registerCommand("k3DViewBack", (viewer) => setDefaultViewPosition(viewer, "k3DViewBack"));
|
|
570
|
+
commands("VisualizeJS").registerCommand("k3DViewSE", (viewer) => setDefaultViewPosition(viewer, "k3DViewSE"));
|
|
571
|
+
commands("VisualizeJS").registerCommand("k3DViewSW", (viewer) => setDefaultViewPosition(viewer, "k3DViewSW"));
|
|
572
|
+
commands("VisualizeJS").registerCommand("k3DViewNE", (viewer) => setDefaultViewPosition(viewer, "k3DViewNE"));
|
|
573
|
+
commands("VisualizeJS").registerCommand("k3DViewNW", (viewer) => setDefaultViewPosition(viewer, "k3DViewNW"));
|
|
574
|
+
|
|
575
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
576
|
+
commands("VisualizeJS").registerCommand("setMarkupColor", (viewer, r = 255, g = 0, b = 0) => {
|
|
577
|
+
viewer.setMarkupColor(r, g, b);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
581
|
+
function setSelected(viewer, handles = []) {
|
|
582
|
+
if (!viewer.visualizeJs)
|
|
583
|
+
return;
|
|
584
|
+
const visLib = viewer.visLib();
|
|
585
|
+
const visViewer = visLib.getViewer();
|
|
586
|
+
const selectionSet = new visLib.OdTvSelectionSet();
|
|
587
|
+
handles === null || handles === void 0 ? void 0 : handles.forEach((handle) => {
|
|
588
|
+
const entityId = visViewer.getEntityByOriginalHandle(handle + "");
|
|
589
|
+
if (!entityId.isNull())
|
|
590
|
+
selectionSet.appendEntity(entityId);
|
|
591
|
+
});
|
|
592
|
+
visViewer.setSelected(selectionSet);
|
|
593
|
+
viewer.update();
|
|
594
|
+
viewer.emitEvent({ type: "select", data: selectionSet, handles });
|
|
595
|
+
selectionSet.delete();
|
|
596
|
+
}
|
|
597
|
+
commands("VisualizeJS").registerCommand("setSelected", setSelected);
|
|
598
|
+
|
|
599
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
600
|
+
function showAll(viewer) {
|
|
601
|
+
if (!viewer.visualizeJs)
|
|
602
|
+
return;
|
|
603
|
+
const visViewer = viewer.visViewer();
|
|
604
|
+
visViewer.unisolateSelectedObjects(false);
|
|
605
|
+
viewer.update();
|
|
606
|
+
viewer.emit({ type: "showall" });
|
|
607
|
+
}
|
|
608
|
+
commands("VisualizeJS").registerCommand("showAll", showAll);
|
|
609
|
+
|
|
610
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
611
|
+
function unselect(viewer) {
|
|
612
|
+
if (!viewer.visualizeJs)
|
|
613
|
+
return;
|
|
614
|
+
const visViewer = viewer.visViewer();
|
|
615
|
+
visViewer.unselect();
|
|
616
|
+
viewer.update();
|
|
617
|
+
viewer.emitEvent({ type: "select", data: visViewer.getSelected(), handles: [] });
|
|
618
|
+
}
|
|
619
|
+
commands("VisualizeJS").registerCommand("unselect", unselect);
|
|
620
|
+
|
|
621
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
622
|
+
function zoomToExtents(viewer, force = false, animate = viewer.options.cameraAnimation) {
|
|
623
|
+
if (!viewer.visualizeJs)
|
|
624
|
+
return;
|
|
625
|
+
const visViewer = viewer.visViewer();
|
|
626
|
+
const saveEnableAmination = visViewer.getEnableAnimation();
|
|
627
|
+
visViewer.setEnableAnimation(animate);
|
|
628
|
+
visViewer.zoomExtents(force);
|
|
629
|
+
visViewer.update();
|
|
630
|
+
visViewer.setEnableAnimation(saveEnableAmination);
|
|
631
|
+
viewer.update();
|
|
632
|
+
viewer.emitEvent({ type: "zoom" });
|
|
633
|
+
}
|
|
634
|
+
commands("VisualizeJS").registerCommand("zoomToExtents", zoomToExtents);
|
|
635
|
+
commands("VisualizeJS").registerCommandAlias("zoomToExtents", "zoomExtents");
|
|
636
|
+
|
|
637
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
638
|
+
function zoomToObjects(viewer, handles = []) {
|
|
639
|
+
var _a;
|
|
640
|
+
if (!viewer.visualizeJs)
|
|
641
|
+
return;
|
|
642
|
+
const visLib = viewer.visLib();
|
|
643
|
+
const visViewer = viewer.visViewer();
|
|
644
|
+
const selectionSet = new visLib.OdTvSelectionSet();
|
|
645
|
+
handles.forEach((handle) => {
|
|
646
|
+
const entityId = visViewer.getEntityByOriginalHandle(handle + "");
|
|
647
|
+
if (!entityId.isNull())
|
|
648
|
+
selectionSet.appendEntity(entityId);
|
|
649
|
+
});
|
|
650
|
+
(_a = visViewer.zoomToObjects) === null || _a === void 0 ? void 0 : _a.call(visViewer, selectionSet);
|
|
651
|
+
viewer.update();
|
|
652
|
+
viewer.emitEvent({ type: "zoom" });
|
|
653
|
+
selectionSet.delete();
|
|
654
|
+
}
|
|
655
|
+
commands("VisualizeJS").registerCommand("zoomToObjects", zoomToObjects);
|
|
656
|
+
|
|
657
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
658
|
+
function zoomToSelected(viewer) {
|
|
659
|
+
var _a;
|
|
660
|
+
if (!viewer.visualizeJs)
|
|
661
|
+
return;
|
|
662
|
+
const visViewer = viewer.visViewer();
|
|
663
|
+
const selectionSet = visViewer.getSelected();
|
|
664
|
+
(_a = visViewer.zoomToObjects) === null || _a === void 0 ? void 0 : _a.call(visViewer, selectionSet);
|
|
665
|
+
viewer.update();
|
|
666
|
+
viewer.emitEvent({ type: "zoom" });
|
|
667
|
+
}
|
|
668
|
+
commands("VisualizeJS").registerCommand("zoomToSelected", zoomToSelected);
|
|
669
|
+
|
|
359
670
|
class EventEmitter2 {
|
|
360
671
|
constructor() {
|
|
361
672
|
this._listeners = undefined;
|
|
@@ -14728,7 +15039,7 @@
|
|
|
14728
15039
|
width: (_a = params.width) !== null && _a !== void 0 ? _a : 200,
|
|
14729
15040
|
height: (_b = params.height) !== null && _b !== void 0 ? _b : 200,
|
|
14730
15041
|
stroke: (_c = params.color) !== null && _c !== void 0 ? _c : "#ff0000",
|
|
14731
|
-
strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d :
|
|
15042
|
+
strokeWidth: (_d = params.lineWidth) !== null && _d !== void 0 ? _d : 4,
|
|
14732
15043
|
draggable: true,
|
|
14733
15044
|
strokeScaleEnabled: false,
|
|
14734
15045
|
globalCompositeOperation: "source-over",
|
|
@@ -16973,6 +17284,7 @@
|
|
|
16973
17284
|
}
|
|
16974
17285
|
|
|
16975
17286
|
exports.OdBaseDragger = OdBaseDragger;
|
|
17287
|
+
exports.Options = Options;
|
|
16976
17288
|
exports.Viewer = Viewer;
|
|
16977
17289
|
exports.commands = commands;
|
|
16978
17290
|
|