@inweb/viewer-core 25.3.20 → 25.3.22
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/viewer-core.js +11 -8
- package/dist/viewer-core.js.map +1 -1
- package/dist/viewer-core.module.js +4 -2
- package/dist/viewer-core.module.js.map +1 -1
- package/lib/viewer/CanvasEvents.d.ts +74 -0
- package/lib/viewer/ViewerEvents.d.ts +59 -121
- package/package.json +1 -1
- package/src/viewer/CanvasEvents.ts +101 -8
- package/src/viewer/ViewerEvents.ts +59 -140
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Assembly, File, Model } from "@inweb/client";
|
|
2
|
+
import { CanvasEventMap } from "./CanvasEvents";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Event that fires when model loading has been canceled.
|
|
5
6
|
*
|
|
6
7
|
* @event
|
|
7
8
|
*/
|
|
@@ -13,7 +14,7 @@ export interface CancelEvent {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Event that fires when the active dragger has been changed.
|
|
17
18
|
*
|
|
18
19
|
* @event
|
|
19
20
|
*/
|
|
@@ -30,7 +31,7 @@ export interface ChangeActiveDraggerEvent {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* Event that fires when the markup color has been changed.
|
|
34
35
|
*
|
|
35
36
|
* @event
|
|
36
37
|
*/
|
|
@@ -47,7 +48,7 @@ export interface ChangeMarkupColorEvent {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
+
* Event that fires when the viewer has been cleared.
|
|
51
52
|
*
|
|
52
53
|
* @event
|
|
53
54
|
*/
|
|
@@ -59,7 +60,7 @@ export interface ClearEvent {
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
|
-
*
|
|
63
|
+
* Event that fires after viewer executes the command.
|
|
63
64
|
*
|
|
64
65
|
* @event
|
|
65
66
|
*/
|
|
@@ -81,7 +82,7 @@ export interface CommandEvent {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
/**
|
|
84
|
-
*
|
|
85
|
+
* Event that fires when the model scene description file has been loaded.
|
|
85
86
|
*
|
|
86
87
|
* @event
|
|
87
88
|
*/
|
|
@@ -108,7 +109,7 @@ export interface DatabaseChunkEvent {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
/**
|
|
111
|
-
*
|
|
112
|
+
* Event that fires before viewer resources has been released.
|
|
112
113
|
*
|
|
113
114
|
* @event
|
|
114
115
|
*/
|
|
@@ -120,9 +121,9 @@ export interface DisposeEvent {
|
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
124
|
+
* Event that fires when the model geometry data chunk has been loaded. Note that small files
|
|
125
|
+
* are loaded in one chunk, and `geometrychunk` event does not fire, only the `databasechink`
|
|
126
|
+
* event fires.
|
|
126
127
|
*
|
|
127
128
|
* @event
|
|
128
129
|
*/
|
|
@@ -149,7 +150,7 @@ export interface GeometryChunkEvent {
|
|
|
149
150
|
}
|
|
150
151
|
|
|
151
152
|
/**
|
|
152
|
-
*
|
|
153
|
+
* Event that fires after model has been successfully loaded.
|
|
153
154
|
*
|
|
154
155
|
* @event
|
|
155
156
|
*/
|
|
@@ -176,7 +177,7 @@ export interface GeometryEndEvent {
|
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
/**
|
|
179
|
-
*
|
|
180
|
+
* Event that fires when the model fails to load.
|
|
180
181
|
*
|
|
181
182
|
* @event
|
|
182
183
|
*/
|
|
@@ -203,7 +204,7 @@ export interface GeometryErrorEvent {
|
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
/**
|
|
206
|
-
*
|
|
207
|
+
* Event measuring progress of the model loading process.
|
|
207
208
|
*
|
|
208
209
|
* @event
|
|
209
210
|
*/
|
|
@@ -230,7 +231,7 @@ export interface GeometryProgressEvent {
|
|
|
230
231
|
}
|
|
231
232
|
|
|
232
233
|
/**
|
|
233
|
-
*
|
|
234
|
+
* Event that fires before the model loads.
|
|
234
235
|
*
|
|
235
236
|
* @event
|
|
236
237
|
*/
|
|
@@ -252,7 +253,7 @@ export interface GeometryStartEvent {
|
|
|
252
253
|
}
|
|
253
254
|
|
|
254
255
|
/**
|
|
255
|
-
*
|
|
256
|
+
* Event that fires before model opens.
|
|
256
257
|
*
|
|
257
258
|
* @event
|
|
258
259
|
*/
|
|
@@ -279,7 +280,7 @@ export interface OpenEvent {
|
|
|
279
280
|
}
|
|
280
281
|
|
|
281
282
|
/**
|
|
282
|
-
*
|
|
283
|
+
* Event that fires when rendering occurs.
|
|
283
284
|
*
|
|
284
285
|
* @event
|
|
285
286
|
*/
|
|
@@ -289,13 +290,19 @@ export interface RenderEvent {
|
|
|
289
290
|
*/
|
|
290
291
|
type: "render";
|
|
291
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Render time.
|
|
295
|
+
*/
|
|
292
296
|
time: DOMHighResTimeStamp;
|
|
293
297
|
|
|
298
|
+
/**
|
|
299
|
+
* The milliseconds passed since the previous render.
|
|
300
|
+
*/
|
|
294
301
|
deltaTime: DOMHighResTimeStamp;
|
|
295
302
|
}
|
|
296
303
|
|
|
297
304
|
/**
|
|
298
|
-
*
|
|
305
|
+
* Event that fires when resize occurs.
|
|
299
306
|
*
|
|
300
307
|
* @event
|
|
301
308
|
*/
|
|
@@ -317,7 +324,7 @@ export interface ResizeEvent {
|
|
|
317
324
|
}
|
|
318
325
|
|
|
319
326
|
/**
|
|
320
|
-
*
|
|
327
|
+
* Event that fires when the selection changes.
|
|
321
328
|
*
|
|
322
329
|
* @event
|
|
323
330
|
*/
|
|
@@ -339,7 +346,7 @@ export interface SelectEvent {
|
|
|
339
346
|
}
|
|
340
347
|
|
|
341
348
|
/**
|
|
342
|
-
*
|
|
349
|
+
* Event that fires when an update occurs.
|
|
343
350
|
*
|
|
344
351
|
* @event
|
|
345
352
|
*/
|
|
@@ -356,7 +363,7 @@ export interface UpdateEvent {
|
|
|
356
363
|
}
|
|
357
364
|
|
|
358
365
|
/**
|
|
359
|
-
*
|
|
366
|
+
* Event measuring progress of loading a `VisualizeJS` library.
|
|
360
367
|
*
|
|
361
368
|
* @event
|
|
362
369
|
*/
|
|
@@ -381,7 +388,7 @@ export interface VisualizeProgressEvent {
|
|
|
381
388
|
}
|
|
382
389
|
|
|
383
390
|
/**
|
|
384
|
-
*
|
|
391
|
+
* Event that fires when walk speed changing.
|
|
385
392
|
*
|
|
386
393
|
* @event
|
|
387
394
|
*/
|
|
@@ -392,13 +399,13 @@ export interface WalkSpeedChangeEvent {
|
|
|
392
399
|
type: "walkspeedchange";
|
|
393
400
|
|
|
394
401
|
/**
|
|
395
|
-
*
|
|
402
|
+
* Walk speed multiplier.
|
|
396
403
|
*/
|
|
397
404
|
data: number;
|
|
398
405
|
}
|
|
399
406
|
|
|
400
407
|
/**
|
|
401
|
-
*
|
|
408
|
+
* Event that fires when walk started.
|
|
402
409
|
*
|
|
403
410
|
* @event
|
|
404
411
|
*/
|
|
@@ -410,7 +417,7 @@ export interface WalkStartEvent {
|
|
|
410
417
|
}
|
|
411
418
|
|
|
412
419
|
/**
|
|
413
|
-
*
|
|
420
|
+
* Event that fires when camera panning.
|
|
414
421
|
*
|
|
415
422
|
* @event
|
|
416
423
|
*/
|
|
@@ -439,7 +446,7 @@ export interface PanEvent {
|
|
|
439
446
|
}
|
|
440
447
|
|
|
441
448
|
/**
|
|
442
|
-
*
|
|
449
|
+
* Event that fires when zooming of the camera.
|
|
443
450
|
*
|
|
444
451
|
* @event
|
|
445
452
|
*/
|
|
@@ -456,7 +463,7 @@ export interface ZoomEvent {
|
|
|
456
463
|
}
|
|
457
464
|
|
|
458
465
|
/**
|
|
459
|
-
*
|
|
466
|
+
* Event that fires when zooming of the camera.
|
|
460
467
|
*
|
|
461
468
|
* @event
|
|
462
469
|
*/
|
|
@@ -473,7 +480,7 @@ export interface ZoomAtEvent {
|
|
|
473
480
|
}
|
|
474
481
|
|
|
475
482
|
/**
|
|
476
|
-
*
|
|
483
|
+
* Event that fires when zooming to entity.
|
|
477
484
|
*
|
|
478
485
|
* @event
|
|
479
486
|
*/
|
|
@@ -492,212 +499,124 @@ export interface ZoomToEntityEvent {
|
|
|
492
499
|
/**
|
|
493
500
|
* Viewer Events
|
|
494
501
|
*/
|
|
495
|
-
export interface ViewerEventMap {
|
|
502
|
+
export interface ViewerEventMap extends CanvasEventMap {
|
|
496
503
|
/**
|
|
497
|
-
*
|
|
504
|
+
* Event that fires when model loading has been canceled.
|
|
498
505
|
*/
|
|
499
506
|
cancel: CancelEvent;
|
|
500
507
|
|
|
501
508
|
/**
|
|
502
|
-
*
|
|
509
|
+
* Event that fires when the active dragger has been changed.
|
|
503
510
|
*/
|
|
504
511
|
changeactivedragger: ChangeActiveDraggerEvent;
|
|
505
512
|
|
|
506
513
|
/**
|
|
507
|
-
*
|
|
514
|
+
* Event that fires when the markup color has been changed.
|
|
508
515
|
*/
|
|
509
516
|
changemarkupcolor: ChangeMarkupColorEvent;
|
|
510
517
|
|
|
511
518
|
/**
|
|
512
|
-
*
|
|
519
|
+
* Event that fires when the viewer has been cleared.
|
|
513
520
|
*/
|
|
514
521
|
clear: ClearEvent;
|
|
515
522
|
|
|
516
523
|
/**
|
|
517
|
-
*
|
|
524
|
+
* Event that fires after viewer executes the command.
|
|
518
525
|
*/
|
|
519
526
|
command: CommandEvent;
|
|
520
527
|
|
|
521
528
|
/**
|
|
522
|
-
*
|
|
529
|
+
* Event that fires when the model scene description file has been loaded.
|
|
523
530
|
*/
|
|
524
531
|
databasechunk: DatabaseChunkEvent;
|
|
525
532
|
|
|
526
533
|
/**
|
|
527
|
-
*
|
|
534
|
+
* Event that fires before viewer resources has been released.
|
|
528
535
|
*/
|
|
529
536
|
dispose: DisposeEvent;
|
|
530
537
|
|
|
531
538
|
/**
|
|
532
|
-
*
|
|
539
|
+
* Event that fires when the model geometry data chunk has been loaded.
|
|
533
540
|
*/
|
|
534
541
|
geometrychunk: GeometryChunkEvent;
|
|
535
542
|
|
|
536
543
|
/**
|
|
537
|
-
*
|
|
544
|
+
* Event that fires after model has been successfully loaded.
|
|
538
545
|
*/
|
|
539
546
|
geometryend: GeometryEndEvent;
|
|
540
547
|
|
|
541
548
|
/**
|
|
542
|
-
*
|
|
549
|
+
* Event that fires when the model fails to open.
|
|
543
550
|
*/
|
|
544
551
|
geometryerror: GeometryErrorEvent;
|
|
545
552
|
|
|
546
553
|
/**
|
|
547
|
-
*
|
|
554
|
+
* Event measuring progress of the model loading process.
|
|
548
555
|
*/
|
|
549
556
|
geometryprogress: GeometryProgressEvent;
|
|
550
557
|
|
|
551
558
|
/**
|
|
552
|
-
*
|
|
559
|
+
* Event that fires before the model opens.
|
|
553
560
|
*/
|
|
554
561
|
geometrystart: GeometryStartEvent;
|
|
555
562
|
|
|
556
563
|
/**
|
|
557
|
-
*
|
|
564
|
+
* Event that fires before model opens.
|
|
558
565
|
*/
|
|
559
566
|
open: OpenEvent;
|
|
560
567
|
|
|
561
568
|
/**
|
|
562
|
-
*
|
|
569
|
+
* Event that fires when an rendering occurs.
|
|
563
570
|
*/
|
|
564
571
|
render: RenderEvent;
|
|
565
572
|
|
|
566
573
|
/**
|
|
567
|
-
*
|
|
574
|
+
* Event that fires when resize occurs.
|
|
568
575
|
*/
|
|
569
576
|
resize: ResizeEvent;
|
|
570
577
|
|
|
571
578
|
/**
|
|
572
|
-
*
|
|
579
|
+
* Event that fires when the selection changes.
|
|
573
580
|
*/
|
|
574
581
|
select: SelectEvent;
|
|
575
582
|
|
|
576
583
|
/**
|
|
577
|
-
*
|
|
584
|
+
* Event that fires when an update occurs.
|
|
578
585
|
*/
|
|
579
586
|
update: UpdateEvent;
|
|
580
587
|
|
|
581
588
|
/**
|
|
582
|
-
*
|
|
589
|
+
* Event measuring progress of loading a `VisualizeJS` library.
|
|
583
590
|
*/
|
|
584
591
|
visualizeprogress: VisualizeProgressEvent;
|
|
585
592
|
|
|
586
593
|
/**
|
|
587
|
-
*
|
|
594
|
+
* Event that fires when walk speed changing.
|
|
588
595
|
*/
|
|
589
596
|
walkspeedchange: WalkSpeedChangeEvent;
|
|
590
597
|
|
|
591
598
|
/**
|
|
592
|
-
*
|
|
599
|
+
* Event that fires when walk started.
|
|
593
600
|
*/
|
|
594
601
|
walkstart: WalkStartEvent;
|
|
595
602
|
|
|
596
603
|
/**
|
|
597
|
-
*
|
|
604
|
+
* Event that fires when camera panning.
|
|
598
605
|
*/
|
|
599
606
|
pan: PanEvent;
|
|
600
607
|
|
|
601
608
|
/**
|
|
602
|
-
*
|
|
609
|
+
* Event that fires when zooming of the camera.
|
|
603
610
|
*/
|
|
604
611
|
zoom: ZoomEvent;
|
|
605
612
|
|
|
606
613
|
/**
|
|
607
|
-
*
|
|
614
|
+
* Event that fires when zooming of the camera.
|
|
608
615
|
*/
|
|
609
616
|
zoomat: ZoomAtEvent;
|
|
610
617
|
|
|
611
618
|
/**
|
|
612
|
-
*
|
|
619
|
+
* Event that fires when zooming to entity.
|
|
613
620
|
*/
|
|
614
621
|
zoomtoentity: ZoomToEntityEvent;
|
|
615
|
-
|
|
616
|
-
// Canvas events
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* {@link Viewer} event that fires when the user attempts to open a context menu.
|
|
620
|
-
*/
|
|
621
|
-
contextmenu: PointerEvent;
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* {@link Viewer} event that fires on mouse click.
|
|
625
|
-
*/
|
|
626
|
-
click: MouseEvent;
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* A {@link Viewer} event that fires on mouse double click.
|
|
630
|
-
*/
|
|
631
|
-
dblclick: MouseEvent;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* A {@link Viewer} event that fires on mouse button is down.
|
|
635
|
-
*/
|
|
636
|
-
mousedown: MouseEvent;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* A {@link Viewer} event that fires on mouse leave.
|
|
640
|
-
*/
|
|
641
|
-
mouseleave: MouseEvent;
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* A {@link Viewer} event that fires on mouse move.
|
|
645
|
-
*/
|
|
646
|
-
mousemove: MouseEvent;
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* A {@link Viewer} event that fires on mouse button is up.
|
|
650
|
-
*/
|
|
651
|
-
mouseup: MouseEvent;
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* A {@link Viewer} event is fired when the browser determines that there are unlikely to be
|
|
655
|
-
* any more pointer events.
|
|
656
|
-
*/
|
|
657
|
-
pointercancel: PointerEvent;
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* A {@link Viewer} event that fires on mouse button is down.
|
|
661
|
-
*/
|
|
662
|
-
pointerdown: PointerEvent;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* A {@link Viewer} event that fires on mouse leave.
|
|
666
|
-
*/
|
|
667
|
-
pointerleave: PointerEvent;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* A {@link Viewer} event that fires on mouse move.
|
|
671
|
-
*/
|
|
672
|
-
pointermove: PointerEvent;
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* A {@link Viewer} event that fires on mouse button is up.
|
|
676
|
-
*/
|
|
677
|
-
pointerup: PointerEvent;
|
|
678
|
-
|
|
679
|
-
/**
|
|
680
|
-
* A {@link Viewer} event that fires touch is canceled.
|
|
681
|
-
*/
|
|
682
|
-
touchcancel: TouchEvent;
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* A {@link Viewer} event that fires touch is ended.
|
|
686
|
-
*/
|
|
687
|
-
touchend: TouchEvent;
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* A {@link Viewer} event that fires touch is moving.
|
|
691
|
-
*/
|
|
692
|
-
touchmove: TouchEvent;
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
* A {@link Viewer} event that fires when touch is started.
|
|
696
|
-
*/
|
|
697
|
-
touchstart: TouchEvent;
|
|
698
|
-
|
|
699
|
-
/**
|
|
700
|
-
* A {@link Viewer} event that fires when mouse wheel is moving.
|
|
701
|
-
*/
|
|
702
|
-
wheel: MouseEvent;
|
|
703
622
|
}
|