@inweb/viewer-core 26.9.1 → 26.9.2
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/lib/viewer/IViewer.d.ts +12 -0
- package/lib/viewer/ViewerEvents.d.ts +55 -27
- package/package.json +3 -3
- package/src/viewer/IViewer.ts +13 -0
- package/src/viewer/ViewerEvents.ts +64 -32
package/lib/viewer/IViewer.d.ts
CHANGED
|
@@ -96,6 +96,18 @@ export interface IViewer extends IEventEmitter, ICommandService {
|
|
|
96
96
|
* Returns `true` if viewer has been initialized.
|
|
97
97
|
*/
|
|
98
98
|
isInitialized(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Resizes the output canvas to (width, height) with device pixel ratio taken into account.
|
|
101
|
+
*
|
|
102
|
+
* Fires:
|
|
103
|
+
*
|
|
104
|
+
* - {@link ResizeEvent | resize}
|
|
105
|
+
*
|
|
106
|
+
* @param width - The width of the canvas.
|
|
107
|
+
* @param height - The height of the canvas.
|
|
108
|
+
* @param updateStyle - Setting `updateStyle` to false prevents any style changes to the output canvas.
|
|
109
|
+
*/
|
|
110
|
+
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
99
111
|
/**
|
|
100
112
|
* Updates the viewer.
|
|
101
113
|
*
|
|
@@ -44,6 +44,15 @@ export interface ChangeActiveDraggerEvent {
|
|
|
44
44
|
*/
|
|
45
45
|
data: string;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Event that fires when a camera changes.
|
|
49
|
+
*/
|
|
50
|
+
export interface ChangeCameraEvent {
|
|
51
|
+
/**
|
|
52
|
+
* Event type.
|
|
53
|
+
*/
|
|
54
|
+
type: "changecamera";
|
|
55
|
+
}
|
|
47
56
|
/**
|
|
48
57
|
* Event that fires when the default color of new markup objects has been changed.
|
|
49
58
|
*
|
|
@@ -373,6 +382,44 @@ export interface OpenEvent {
|
|
|
373
382
|
*/
|
|
374
383
|
buffer?: Uint8Array | ArrayBuffer;
|
|
375
384
|
}
|
|
385
|
+
/**
|
|
386
|
+
* Event that fires when camera rotating.
|
|
387
|
+
*
|
|
388
|
+
* @event
|
|
389
|
+
*/
|
|
390
|
+
export interface OrbitEvent {
|
|
391
|
+
/**
|
|
392
|
+
* Event type.
|
|
393
|
+
*/
|
|
394
|
+
type: "orbit";
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Event that fires when camera panning.
|
|
398
|
+
*
|
|
399
|
+
* @event
|
|
400
|
+
*/
|
|
401
|
+
export interface PanEvent {
|
|
402
|
+
/**
|
|
403
|
+
* Event type.
|
|
404
|
+
*/
|
|
405
|
+
type: "pan";
|
|
406
|
+
/**
|
|
407
|
+
* The X coordinate of the mouse pointer in screen coordinates.
|
|
408
|
+
*/
|
|
409
|
+
x: number;
|
|
410
|
+
/**
|
|
411
|
+
* The Y coordinate of the mouse pointer in screen coordinates.
|
|
412
|
+
*/
|
|
413
|
+
y: number;
|
|
414
|
+
/**
|
|
415
|
+
* The X coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
416
|
+
*/
|
|
417
|
+
dX: number;
|
|
418
|
+
/**
|
|
419
|
+
* The Y coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
420
|
+
*/
|
|
421
|
+
dY: number;
|
|
422
|
+
}
|
|
376
423
|
/**
|
|
377
424
|
* Event that fires when rendering occurs.
|
|
378
425
|
*
|
|
@@ -531,33 +578,6 @@ export interface WalkStartEvent {
|
|
|
531
578
|
*/
|
|
532
579
|
type: "walkstart";
|
|
533
580
|
}
|
|
534
|
-
/**
|
|
535
|
-
* Event that fires when camera panning.
|
|
536
|
-
*
|
|
537
|
-
* @event
|
|
538
|
-
*/
|
|
539
|
-
export interface PanEvent {
|
|
540
|
-
/**
|
|
541
|
-
* Event type.
|
|
542
|
-
*/
|
|
543
|
-
type: "pan";
|
|
544
|
-
/**
|
|
545
|
-
* The X coordinate of the mouse pointer in screen coordinates.
|
|
546
|
-
*/
|
|
547
|
-
x: number;
|
|
548
|
-
/**
|
|
549
|
-
* The Y coordinate of the mouse pointer in screen coordinates.
|
|
550
|
-
*/
|
|
551
|
-
y: number;
|
|
552
|
-
/**
|
|
553
|
-
* The X coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
554
|
-
*/
|
|
555
|
-
dX: number;
|
|
556
|
-
/**
|
|
557
|
-
* The Y coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
558
|
-
*/
|
|
559
|
-
dY: number;
|
|
560
|
-
}
|
|
561
581
|
/**
|
|
562
582
|
* Event that fires when zooming to extents or selected objects.
|
|
563
583
|
*
|
|
@@ -629,6 +649,10 @@ export interface ViewerEventMap {
|
|
|
629
649
|
* Event that fires when the active dragger has been changed.
|
|
630
650
|
*/
|
|
631
651
|
changeactivedragger: ChangeActiveDraggerEvent;
|
|
652
|
+
/**
|
|
653
|
+
* Event that fires when a camera changes.
|
|
654
|
+
*/
|
|
655
|
+
changecamera: ChangeCameraEvent;
|
|
632
656
|
/**
|
|
633
657
|
* Event that fires when the markup color has been changed.
|
|
634
658
|
*/
|
|
@@ -701,6 +725,10 @@ export interface ViewerEventMap {
|
|
|
701
725
|
* Event that fires before model opens.
|
|
702
726
|
*/
|
|
703
727
|
open: OpenEvent;
|
|
728
|
+
/**
|
|
729
|
+
* Event that fires when camera rotating.
|
|
730
|
+
*/
|
|
731
|
+
orbit: OrbitEvent;
|
|
704
732
|
/**
|
|
705
733
|
* Event that fires when camera panning.
|
|
706
734
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/viewer-core",
|
|
3
|
-
"version": "26.9.
|
|
3
|
+
"version": "26.9.2",
|
|
4
4
|
"description": "3D CAD and BIM data Viewer core",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test": "karma start karma.conf.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/client": "~26.9.
|
|
30
|
-
"@inweb/eventemitter2": "~26.9.
|
|
29
|
+
"@inweb/client": "~26.9.2",
|
|
30
|
+
"@inweb/eventemitter2": "~26.9.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/viewer/IViewer.ts
CHANGED
|
@@ -129,6 +129,19 @@ export interface IViewer extends IEventEmitter, ICommandService {
|
|
|
129
129
|
*/
|
|
130
130
|
isInitialized(): boolean;
|
|
131
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Resizes the output canvas to (width, height) with device pixel ratio taken into account.
|
|
134
|
+
*
|
|
135
|
+
* Fires:
|
|
136
|
+
*
|
|
137
|
+
* - {@link ResizeEvent | resize}
|
|
138
|
+
*
|
|
139
|
+
* @param width - The width of the canvas.
|
|
140
|
+
* @param height - The height of the canvas.
|
|
141
|
+
* @param updateStyle - Setting `updateStyle` to false prevents any style changes to the output canvas.
|
|
142
|
+
*/
|
|
143
|
+
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
144
|
+
|
|
132
145
|
/**
|
|
133
146
|
* Updates the viewer.
|
|
134
147
|
*
|
|
@@ -50,6 +50,16 @@ export interface ChangeActiveDraggerEvent {
|
|
|
50
50
|
data: string;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Event that fires when a camera changes.
|
|
55
|
+
*/
|
|
56
|
+
export interface ChangeCameraEvent {
|
|
57
|
+
/**
|
|
58
|
+
* Event type.
|
|
59
|
+
*/
|
|
60
|
+
type: "changecamera";
|
|
61
|
+
}
|
|
62
|
+
|
|
53
63
|
/**
|
|
54
64
|
* Event that fires when the default color of new markup objects has been changed.
|
|
55
65
|
*
|
|
@@ -423,6 +433,50 @@ export interface OpenEvent {
|
|
|
423
433
|
buffer?: Uint8Array | ArrayBuffer;
|
|
424
434
|
}
|
|
425
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Event that fires when camera rotating.
|
|
438
|
+
*
|
|
439
|
+
* @event
|
|
440
|
+
*/
|
|
441
|
+
export interface OrbitEvent {
|
|
442
|
+
/**
|
|
443
|
+
* Event type.
|
|
444
|
+
*/
|
|
445
|
+
type: "orbit";
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Event that fires when camera panning.
|
|
450
|
+
*
|
|
451
|
+
* @event
|
|
452
|
+
*/
|
|
453
|
+
export interface PanEvent {
|
|
454
|
+
/**
|
|
455
|
+
* Event type.
|
|
456
|
+
*/
|
|
457
|
+
type: "pan";
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* The X coordinate of the mouse pointer in screen coordinates.
|
|
461
|
+
*/
|
|
462
|
+
x: number;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* The Y coordinate of the mouse pointer in screen coordinates.
|
|
466
|
+
*/
|
|
467
|
+
y: number;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* The X coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
471
|
+
*/
|
|
472
|
+
dX: number;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* The Y coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
476
|
+
*/
|
|
477
|
+
dY: number;
|
|
478
|
+
}
|
|
479
|
+
|
|
426
480
|
/**
|
|
427
481
|
* Event that fires when rendering occurs.
|
|
428
482
|
*
|
|
@@ -602,38 +656,6 @@ export interface WalkStartEvent {
|
|
|
602
656
|
type: "walkstart";
|
|
603
657
|
}
|
|
604
658
|
|
|
605
|
-
/**
|
|
606
|
-
* Event that fires when camera panning.
|
|
607
|
-
*
|
|
608
|
-
* @event
|
|
609
|
-
*/
|
|
610
|
-
export interface PanEvent {
|
|
611
|
-
/**
|
|
612
|
-
* Event type.
|
|
613
|
-
*/
|
|
614
|
-
type: "pan";
|
|
615
|
-
|
|
616
|
-
/**
|
|
617
|
-
* The X coordinate of the mouse pointer in screen coordinates.
|
|
618
|
-
*/
|
|
619
|
-
x: number;
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* The Y coordinate of the mouse pointer in screen coordinates.
|
|
623
|
-
*/
|
|
624
|
-
y: number;
|
|
625
|
-
|
|
626
|
-
/**
|
|
627
|
-
* The X coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
628
|
-
*/
|
|
629
|
-
dX: number;
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* The Y coordinate delta of the mouse pointer relative to the position of the last `Pan` event.
|
|
633
|
-
*/
|
|
634
|
-
dY: number;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
659
|
/**
|
|
638
660
|
* Event that fires when zooming to extents or selected objects.
|
|
639
661
|
*
|
|
@@ -716,6 +738,11 @@ export interface ViewerEventMap {
|
|
|
716
738
|
*/
|
|
717
739
|
changeactivedragger: ChangeActiveDraggerEvent;
|
|
718
740
|
|
|
741
|
+
/**
|
|
742
|
+
* Event that fires when a camera changes.
|
|
743
|
+
*/
|
|
744
|
+
changecamera: ChangeCameraEvent;
|
|
745
|
+
|
|
719
746
|
/**
|
|
720
747
|
* Event that fires when the markup color has been changed.
|
|
721
748
|
*/
|
|
@@ -806,6 +833,11 @@ export interface ViewerEventMap {
|
|
|
806
833
|
*/
|
|
807
834
|
open: OpenEvent;
|
|
808
835
|
|
|
836
|
+
/**
|
|
837
|
+
* Event that fires when camera rotating.
|
|
838
|
+
*/
|
|
839
|
+
orbit: OrbitEvent;
|
|
840
|
+
|
|
809
841
|
/**
|
|
810
842
|
* Event that fires when camera panning.
|
|
811
843
|
*/
|