@xeokit/xeokit-sdk 2.1.0 → 2.2.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.
- package/dist/xeokit-sdk.cjs.js +149 -135
- package/dist/xeokit-sdk.es.js +149 -135
- package/dist/xeokit-sdk.min.cjs.js +1 -1
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/package.json +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -39371,36 +39371,42 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
39371
39371
|
}
|
|
39372
39372
|
|
|
39373
39373
|
/**
|
|
39374
|
-
* {@link Viewer} plugin that
|
|
39375
|
-
*
|
|
39374
|
+
* {@link Viewer} plugin that makes interaction smoother with large models, by temporarily switching
|
|
39375
|
+
* the Viewer to faster, lower-quality rendering modes whenever we interact.
|
|
39376
39376
|
*
|
|
39377
39377
|
* [<img src="https://xeokit.io/img/docs/FastNavPlugin/FastNavPlugin.gif">](https://xeokit.github.io/xeokit-sdk/examples/#performance_FastNavPlugin)
|
|
39378
39378
|
*
|
|
39379
|
-
* FastNavPlugin works by
|
|
39380
|
-
*
|
|
39381
|
-
*
|
|
39379
|
+
* FastNavPlugin works by hiding specified Viewer rendering features, and optionally scaling the Viewer's canvas
|
|
39380
|
+
* resolution, whenever we interact with the Viewer. Then, once we've finished interacting, FastNavPlugin restores those
|
|
39381
|
+
* rendering features and the original canvas scale, after a configured delay.
|
|
39382
39382
|
*
|
|
39383
|
-
*
|
|
39384
|
-
* after we stop, following an optional delay.
|
|
39383
|
+
* Depending on how we configure FastNavPlugin, we essentially switch to a smooth-rendering low-quality view while
|
|
39384
|
+
* interacting, then return to the normal higher-quality view after we stop, following an optional delay.
|
|
39385
39385
|
*
|
|
39386
|
-
* Down-scaling the canvas resolution gives particularly good results. For example, scaling by ````0.5````
|
|
39387
|
-
*
|
|
39388
|
-
*
|
|
39386
|
+
* Down-scaling the canvas resolution gives particularly good results. For example, scaling by ````0.5```` means that
|
|
39387
|
+
* we're rendering a quarter of the pixels while interacting, which can make the Viewer noticeably smoother with big models.
|
|
39388
|
+
*
|
|
39389
|
+
* The screen capture above shows FastNavPlugin in action. In this example, whenever we move the Camera or resize the Canvas,
|
|
39390
|
+
* FastNavPlugin switches off enhanced edges and ambient shadows (SAO), and down-scales the canvas, making it slightly
|
|
39391
|
+
* blurry. When ````0.5```` seconds passes with no interaction, the plugin shows edges and SAO again, and restores the
|
|
39392
|
+
* original canvas scale.
|
|
39389
39393
|
*
|
|
39390
39394
|
* # Usage
|
|
39391
39395
|
*
|
|
39392
39396
|
* In the example below, we'll create a {@link Viewer}, add a {@link FastNavPlugin}, then use an {@link XKTLoaderPlugin} to load a model.
|
|
39393
39397
|
*
|
|
39394
|
-
* Whenever
|
|
39398
|
+
* Whenever we interact with the Viewer, our FastNavPlugin will:
|
|
39395
39399
|
*
|
|
39396
|
-
* *
|
|
39397
|
-
* *
|
|
39398
|
-
* *
|
|
39400
|
+
* * hide edges,
|
|
39401
|
+
* * hide ambient shadows (SAO),
|
|
39402
|
+
* * hide physically-based materials (switching to non-PBR),
|
|
39399
39403
|
* * hide transparent objects, and
|
|
39400
|
-
* *
|
|
39404
|
+
* * scale the canvas resolution by 0.5, causing the GPU to render 75% less pixels.
|
|
39405
|
+
*
|
|
39401
39406
|
* <br><br>
|
|
39402
|
-
* We'll also configure a 0.5 second delay before we transition back to high-quality each time we stop
|
|
39403
|
-
* not continually flipping between low and high quality as we interact.
|
|
39407
|
+
* We'll also configure a 0.5 second delay before we transition back to high-quality each time we stop ineracting, so that we're
|
|
39408
|
+
* not continually flipping between low and high quality as we interact. Since we're only rendering ambient shadows when not interacting, we'll also treat ourselves
|
|
39409
|
+
* to expensive, high-quality SAO settings, that we wouldn't normally configure for an interactive SAO effect.
|
|
39404
39410
|
*
|
|
39405
39411
|
* * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#performance_FastNavPlugin)]
|
|
39406
39412
|
*
|
|
@@ -39420,17 +39426,23 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
39420
39426
|
* viewer.scene.camera.look = [42.45, 49.62, -43.59];
|
|
39421
39427
|
* viewer.scene.camera.up = [0.05, 0.95, 0.15];
|
|
39422
39428
|
*
|
|
39429
|
+
* // Higher-quality SAO settings
|
|
39430
|
+
*
|
|
39431
|
+
* viewer.scene.sao.enabled = true;
|
|
39432
|
+
* viewer.scene.sao.numSamples = 60;
|
|
39433
|
+
* viewer.scene.sao.kernelRadius = 170;
|
|
39434
|
+
*
|
|
39423
39435
|
* // Install a FastNavPlugin
|
|
39424
39436
|
*
|
|
39425
39437
|
* new FastNavPlugin(viewer, {
|
|
39426
|
-
*
|
|
39427
|
-
*
|
|
39428
|
-
*
|
|
39429
|
-
*
|
|
39430
|
-
*
|
|
39431
|
-
*
|
|
39432
|
-
*
|
|
39433
|
-
*
|
|
39438
|
+
* hideEdges: true, // Don't show edges while we interact (default is true)
|
|
39439
|
+
* hideSAO: true, // Don't show ambient shadows while we interact (default is true)
|
|
39440
|
+
* hidePBR: true, // No physically-based rendering while we interact (default is true)
|
|
39441
|
+
* hideTransparentObjects: true, // Hide transparent objects while we interact (default is false)
|
|
39442
|
+
* scaleCanvasResolution: true, // Scale canvas resolution while we interact (default is false)
|
|
39443
|
+
* scaleCanvasResolutionFactor: 0.5, // Factor by which we scale canvas resolution when we interact (default is 0.6)
|
|
39444
|
+
* delayBeforeRestore: true, // When we stop interacting, delay before restoring normal render (default is true)
|
|
39445
|
+
* delayBeforeRestoreSeconds: 0.5 // The delay duration, in seconds (default is 0.5)
|
|
39434
39446
|
* });
|
|
39435
39447
|
*
|
|
39436
39448
|
* // Load a BIM model from XKT
|
|
@@ -39454,40 +39466,40 @@ class FastNavPlugin extends Plugin {
|
|
|
39454
39466
|
* @param {Viewer} viewer The Viewer.
|
|
39455
39467
|
* @param {Object} cfg FastNavPlugin configuration.
|
|
39456
39468
|
* @param {String} [cfg.id="FastNav"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
|
|
39457
|
-
* @param {Boolean} [cfg.
|
|
39458
|
-
* @param {Boolean} [cfg.
|
|
39459
|
-
* @param {Boolean} [cfg.
|
|
39460
|
-
* @param {Boolean} [cfg.
|
|
39461
|
-
* @param {Number} [cfg.
|
|
39462
|
-
* @param {Number} [cfg.
|
|
39463
|
-
* @param {Boolean} [cfg.
|
|
39464
|
-
* @param {Number} [cfg.
|
|
39469
|
+
* @param {Boolean} [cfg.hidePBR=true] Whether to temporarily hide physically-based rendering (PBR) whenever we interact with the Viewer.
|
|
39470
|
+
* @param {Boolean} [cfg.hideSAO=true] Whether to temporarily hide scalable ambient occlusion (SAO) whenever we interact with the Viewer.
|
|
39471
|
+
* @param {Boolean} [cfg.hideEdges=true] Whether to temporarily hide edges whenever we interact with the Viewer.
|
|
39472
|
+
* @param {Boolean} [cfg.hideTransparentObjects=false] Whether to temporarily hide transparent objects whenever we interact with the Viewer.
|
|
39473
|
+
* @param {Number} [cfg.scaleCanvasResolution=false] Whether to temporarily down-scale the canvas resolution whenever we interact with the Viewer.
|
|
39474
|
+
* @param {Number} [cfg.scaleCanvasResolutionFactor=0.6] The factor by which we downscale the canvas resolution whenever we interact with the Viewer.
|
|
39475
|
+
* @param {Boolean} [cfg.delayBeforeRestore=true] Whether to temporarily have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
39476
|
+
* @param {Number} [cfg.delayBeforeRestoreSeconds=0.5] Delay in seconds before restoring normal rendering after we stop interacting with the Viewer.
|
|
39465
39477
|
*/
|
|
39466
39478
|
constructor(viewer, cfg = {}) {
|
|
39467
39479
|
|
|
39468
39480
|
super("FastNav", viewer);
|
|
39469
39481
|
|
|
39470
|
-
this.
|
|
39471
|
-
this.
|
|
39472
|
-
this.
|
|
39473
|
-
this.
|
|
39474
|
-
this.
|
|
39475
|
-
this.
|
|
39476
|
-
this.
|
|
39477
|
-
this.
|
|
39482
|
+
this._hidePBR = cfg.hidePBR !== false;
|
|
39483
|
+
this._hideSAO = cfg.hideSAO !== false;
|
|
39484
|
+
this._hideEdges = cfg.hideEdges !== false;
|
|
39485
|
+
this._hideTransparentObjects = !!cfg.hideTransparentObjects;
|
|
39486
|
+
this._scaleCanvasResolution = !!cfg.scaleCanvasResolution;
|
|
39487
|
+
this._scaleCanvasResolutionFactor = cfg.scaleCanvasResolutionFactor || 0.6;
|
|
39488
|
+
this._delayBeforeRestore = (cfg.delayBeforeRestore !== false);
|
|
39489
|
+
this._delayBeforeRestoreSeconds = cfg.delayBeforeRestoreSeconds || 0.5;
|
|
39478
39490
|
|
|
39479
|
-
let timer = this.
|
|
39491
|
+
let timer = this._delayBeforeRestoreSeconds * 1000;
|
|
39480
39492
|
let fastMode = false;
|
|
39481
39493
|
|
|
39482
39494
|
const switchToLowQuality = () => {
|
|
39483
|
-
timer = (this.
|
|
39495
|
+
timer = (this._delayBeforeRestoreSeconds * 1000);
|
|
39484
39496
|
if (!fastMode) {
|
|
39485
|
-
viewer.scene._renderer.setPBREnabled(this.
|
|
39486
|
-
viewer.scene._renderer.setSAOEnabled(this.
|
|
39487
|
-
viewer.scene._renderer.setTransparentEnabled(this.
|
|
39488
|
-
viewer.scene._renderer.setEdgesEnabled(this.
|
|
39489
|
-
if (this.
|
|
39490
|
-
viewer.scene.canvas.resolutionScale = this.
|
|
39497
|
+
viewer.scene._renderer.setPBREnabled(!this._hidePBR);
|
|
39498
|
+
viewer.scene._renderer.setSAOEnabled(!this._hideSAO);
|
|
39499
|
+
viewer.scene._renderer.setTransparentEnabled(!this._hideTransparentObjects);
|
|
39500
|
+
viewer.scene._renderer.setEdgesEnabled(!this._hideEdges);
|
|
39501
|
+
if (this._scaleCanvasResolution) {
|
|
39502
|
+
viewer.scene.canvas.resolutionScale = this._scaleCanvasResolutionFactor;
|
|
39491
39503
|
} else {
|
|
39492
39504
|
viewer.scene.canvas.resolutionScale = 1;
|
|
39493
39505
|
}
|
|
@@ -39512,7 +39524,7 @@ class FastNavPlugin extends Plugin {
|
|
|
39512
39524
|
return;
|
|
39513
39525
|
}
|
|
39514
39526
|
timer -= tickEvent.deltaTime;
|
|
39515
|
-
if ((!this.
|
|
39527
|
+
if ((!this._delayBeforeRestore) || timer <= 0) {
|
|
39516
39528
|
switchToHighQuality();
|
|
39517
39529
|
}
|
|
39518
39530
|
});
|
|
@@ -39536,199 +39548,201 @@ class FastNavPlugin extends Plugin {
|
|
|
39536
39548
|
}
|
|
39537
39549
|
|
|
39538
39550
|
/**
|
|
39539
|
-
* Gets whether to
|
|
39551
|
+
* Gets whether to temporarily hide physically-based rendering (PBR) whenever we interact with the Viewer.
|
|
39540
39552
|
*
|
|
39541
|
-
* Default is ````
|
|
39553
|
+
* Default is ````true````.
|
|
39542
39554
|
*
|
|
39543
|
-
* @return {Boolean}
|
|
39555
|
+
* @return {Boolean} ````true```` if hiding PBR.
|
|
39544
39556
|
*/
|
|
39545
|
-
get
|
|
39546
|
-
return this.
|
|
39557
|
+
get hidePBR() {
|
|
39558
|
+
return this._hidePBR;
|
|
39547
39559
|
}
|
|
39548
39560
|
|
|
39549
39561
|
/**
|
|
39550
|
-
* Sets whether to
|
|
39562
|
+
* Sets whether to temporarily hide physically-based rendering (PBR) whenever we interact with the Viewer.
|
|
39551
39563
|
*
|
|
39552
|
-
* Default is ````
|
|
39564
|
+
* Default is ````true````.
|
|
39553
39565
|
*
|
|
39554
|
-
* @param {Boolean}
|
|
39566
|
+
* @param {Boolean} hidePBR ````true```` to hide PBR.
|
|
39555
39567
|
*/
|
|
39556
|
-
set
|
|
39557
|
-
this.
|
|
39568
|
+
set hidePBR(hidePBR) {
|
|
39569
|
+
this._hidePBR = hidePBR;
|
|
39558
39570
|
}
|
|
39559
39571
|
|
|
39560
39572
|
/**
|
|
39561
|
-
* Gets whether to
|
|
39573
|
+
* Gets whether to temporarily hide scalable ambient shadows (SAO) whenever we interact with the Viewer.
|
|
39562
39574
|
*
|
|
39563
|
-
* Default is ````
|
|
39575
|
+
* Default is ````true````.
|
|
39564
39576
|
*
|
|
39565
|
-
* @return {Boolean}
|
|
39577
|
+
* @return {Boolean} ````true```` if hiding SAO.
|
|
39566
39578
|
*/
|
|
39567
|
-
get
|
|
39568
|
-
return this.
|
|
39579
|
+
get hideSAO() {
|
|
39580
|
+
return this._hideSAO;
|
|
39569
39581
|
}
|
|
39570
39582
|
|
|
39571
39583
|
/**
|
|
39572
|
-
* Sets whether to
|
|
39584
|
+
* Sets whether to temporarily hide scalable ambient shadows (SAO) whenever we interact with the Viewer.
|
|
39573
39585
|
*
|
|
39574
|
-
* Default is ````
|
|
39586
|
+
* Default is ````true````.
|
|
39575
39587
|
*
|
|
39576
|
-
* @param {Boolean}
|
|
39588
|
+
* @param {Boolean} hideSAO ````true```` to hide SAO.
|
|
39577
39589
|
*/
|
|
39578
|
-
set
|
|
39579
|
-
this.
|
|
39590
|
+
set hideSAO(hideSAO) {
|
|
39591
|
+
this._hideSAO = hideSAO;
|
|
39580
39592
|
}
|
|
39581
39593
|
|
|
39582
39594
|
/**
|
|
39583
|
-
* Gets whether to
|
|
39595
|
+
* Gets whether to temporarily hide edges whenever we interact with the Viewer.
|
|
39584
39596
|
*
|
|
39585
|
-
* Default is ````
|
|
39597
|
+
* Default is ````true````.
|
|
39586
39598
|
*
|
|
39587
|
-
* @return {Boolean}
|
|
39599
|
+
* @return {Boolean} ````true```` if hiding edges.
|
|
39588
39600
|
*/
|
|
39589
|
-
get
|
|
39590
|
-
return this.
|
|
39601
|
+
get hideEdges() {
|
|
39602
|
+
return this._hideEdges;
|
|
39591
39603
|
}
|
|
39592
39604
|
|
|
39593
39605
|
/**
|
|
39594
|
-
* Sets whether to
|
|
39606
|
+
* Sets whether to temporarily hide edges whenever we interact with the Viewer.
|
|
39595
39607
|
*
|
|
39596
|
-
* Default is ````
|
|
39608
|
+
* Default is ````true````.
|
|
39597
39609
|
*
|
|
39598
|
-
* @param {Boolean}
|
|
39610
|
+
* @param {Boolean} hideEdges ````true```` to hide edges.
|
|
39599
39611
|
*/
|
|
39600
|
-
set
|
|
39601
|
-
this.
|
|
39612
|
+
set hideEdges(hideEdges) {
|
|
39613
|
+
this._hideEdges = hideEdges;
|
|
39602
39614
|
}
|
|
39603
39615
|
|
|
39604
39616
|
/**
|
|
39605
|
-
* Gets whether to
|
|
39617
|
+
* Gets whether to temporarily hide transparent objects whenever we interact with the Viewer.
|
|
39606
39618
|
*
|
|
39607
|
-
*
|
|
39619
|
+
* Does not hide X-rayed, selected, highlighted objects.
|
|
39620
|
+
*
|
|
39621
|
+
* Default is ````false````.
|
|
39608
39622
|
*
|
|
39609
|
-
* @return {Boolean}
|
|
39623
|
+
* @return {Boolean} ````true```` if hiding transparent objects.
|
|
39610
39624
|
*/
|
|
39611
|
-
get
|
|
39612
|
-
return this.
|
|
39625
|
+
get hideTransparentObjects() {
|
|
39626
|
+
return this._hideTransparentObjects
|
|
39613
39627
|
}
|
|
39614
39628
|
|
|
39615
39629
|
/**
|
|
39616
|
-
* Sets whether to
|
|
39630
|
+
* Sets whether to temporarily hide transparent objects whenever we interact with the Viewer.
|
|
39617
39631
|
*
|
|
39618
|
-
*
|
|
39632
|
+
* Does not hide X-rayed, selected, highlighted objects.
|
|
39619
39633
|
*
|
|
39620
|
-
*
|
|
39634
|
+
* Default is ````false````.
|
|
39635
|
+
*
|
|
39636
|
+
* @param {Boolean} hideTransparentObjects ````true```` to hide transparent objects.
|
|
39621
39637
|
*/
|
|
39622
|
-
set
|
|
39623
|
-
this.
|
|
39638
|
+
set hideTransparentObjects(hideTransparentObjects) {
|
|
39639
|
+
this._hideTransparentObjects = (hideTransparentObjects !== false);
|
|
39624
39640
|
}
|
|
39625
39641
|
|
|
39626
39642
|
/**
|
|
39627
|
-
* Gets whether to
|
|
39643
|
+
* Gets whether to temporarily scale the canvas resolution whenever we interact with the Viewer.
|
|
39628
39644
|
*
|
|
39629
|
-
* Default is ````
|
|
39645
|
+
* Default is ````false````.
|
|
39630
39646
|
*
|
|
39631
|
-
* The
|
|
39647
|
+
* The scaling factor is configured via {@link FastNavPlugin#scaleCanvasResolutionFactor}.
|
|
39632
39648
|
*
|
|
39633
|
-
* @return {Boolean}
|
|
39649
|
+
* @return {Boolean} ````true```` if scaling the canvas resolution.
|
|
39634
39650
|
*/
|
|
39635
|
-
get
|
|
39636
|
-
return this.
|
|
39651
|
+
get scaleCanvasResolution() {
|
|
39652
|
+
return this._scaleCanvasResolution;
|
|
39637
39653
|
}
|
|
39638
39654
|
|
|
39639
39655
|
/**
|
|
39640
|
-
* Sets whether to
|
|
39656
|
+
* Sets whether to temporarily scale the canvas resolution whenever we interact with the Viewer.
|
|
39641
39657
|
*
|
|
39642
|
-
* Default is ````
|
|
39658
|
+
* Default is ````false````.
|
|
39643
39659
|
*
|
|
39644
|
-
* The
|
|
39660
|
+
* The scaling factor is configured via {@link FastNavPlugin#scaleCanvasResolutionFactor}.
|
|
39645
39661
|
*
|
|
39646
|
-
* @param {Boolean}
|
|
39662
|
+
* @param {Boolean} scaleCanvasResolution ````true```` to scale the canvas resolution.
|
|
39647
39663
|
*/
|
|
39648
|
-
set
|
|
39649
|
-
this.
|
|
39664
|
+
set scaleCanvasResolution(scaleCanvasResolution) {
|
|
39665
|
+
this._scaleCanvasResolution = scaleCanvasResolution;
|
|
39650
39666
|
}
|
|
39651
39667
|
|
|
39652
39668
|
/**
|
|
39653
|
-
* Gets the factor by which we
|
|
39654
|
-
*
|
|
39655
|
-
* This allows us to render a low-resolution image to the canvas while we're moving the camera.
|
|
39656
|
-
*
|
|
39657
|
-
* Accepted range is ````[0.0 .. 1.0]````.
|
|
39669
|
+
* Gets the factor by which we temporarily scale the canvas resolution when we interact with the viewer.
|
|
39658
39670
|
*
|
|
39659
39671
|
* Default is ````0.6````.
|
|
39660
39672
|
*
|
|
39661
|
-
*
|
|
39673
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
39674
|
+
*
|
|
39675
|
+
* @return {Number} Factor by which we scale the canvas resolution.
|
|
39662
39676
|
*/
|
|
39663
|
-
get
|
|
39664
|
-
return this.
|
|
39677
|
+
get scaleCanvasResolutionFactor() {
|
|
39678
|
+
return this._scaleCanvasResolutionFactor;
|
|
39665
39679
|
}
|
|
39666
39680
|
|
|
39667
39681
|
/**
|
|
39668
|
-
* Sets the factor by which we
|
|
39669
|
-
*
|
|
39670
|
-
* This allows us to render a low-resolution image to the canvas while we're moving the camera.
|
|
39682
|
+
* Sets the factor by which we temporarily scale the canvas resolution when we interact with the viewer.
|
|
39671
39683
|
*
|
|
39672
39684
|
* Accepted range is ````[0.0 .. 1.0]````.
|
|
39673
39685
|
*
|
|
39674
39686
|
* Default is ````0.6````.
|
|
39675
39687
|
*
|
|
39676
|
-
*
|
|
39688
|
+
* Enable canvas resolution scaling by setting {@link FastNavPlugin#scaleCanvasResolution} ````true````.
|
|
39689
|
+
*
|
|
39690
|
+
* @param {Number} scaleCanvasResolutionFactor Factor by which we scale the canvas resolution.
|
|
39677
39691
|
*/
|
|
39678
|
-
set
|
|
39679
|
-
this.
|
|
39692
|
+
set scaleCanvasResolutionFactor(scaleCanvasResolutionFactor) {
|
|
39693
|
+
this._scaleCanvasResolutionFactor = scaleCanvasResolutionFactor || 0.6;
|
|
39680
39694
|
}
|
|
39681
39695
|
|
|
39682
39696
|
/**
|
|
39683
|
-
* Gets whether to have a delay before
|
|
39697
|
+
* Gets whether to have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
39684
39698
|
*
|
|
39685
|
-
* The delay duration is configured via {@link FastNavPlugin#
|
|
39699
|
+
* The delay duration is configured via {@link FastNavPlugin#delayBeforeRestoreSeconds}.
|
|
39686
39700
|
*
|
|
39687
39701
|
* Default is ````true````.
|
|
39688
39702
|
*
|
|
39689
39703
|
* @return {Boolean} Whether to have a delay.
|
|
39690
39704
|
*/
|
|
39691
|
-
get
|
|
39692
|
-
return this.
|
|
39705
|
+
get delayBeforeRestore() {
|
|
39706
|
+
return this._delayBeforeRestore;
|
|
39693
39707
|
}
|
|
39694
39708
|
|
|
39695
39709
|
/**
|
|
39696
|
-
* Sets whether to have a delay before
|
|
39710
|
+
* Sets whether to have a delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
39697
39711
|
*
|
|
39698
|
-
* The delay duration is configured via {@link FastNavPlugin#
|
|
39712
|
+
* The delay duration is configured via {@link FastNavPlugin#delayBeforeRestoreSeconds}.
|
|
39699
39713
|
*
|
|
39700
39714
|
* Default is ````true````.
|
|
39701
39715
|
*
|
|
39702
|
-
* @param {Boolean}
|
|
39716
|
+
* @param {Boolean} delayBeforeRestore Whether to have a delay.
|
|
39703
39717
|
*/
|
|
39704
|
-
set
|
|
39705
|
-
this.
|
|
39718
|
+
set delayBeforeRestore(delayBeforeRestore) {
|
|
39719
|
+
this._delayBeforeRestore = delayBeforeRestore;
|
|
39706
39720
|
}
|
|
39707
39721
|
|
|
39708
39722
|
/**
|
|
39709
|
-
* Gets the delay
|
|
39723
|
+
* Gets the delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
39710
39724
|
*
|
|
39711
|
-
* The delay is enabled when {@link FastNavPlugin#
|
|
39725
|
+
* The delay is enabled when {@link FastNavPlugin#delayBeforeRestore} is ````true````.
|
|
39712
39726
|
*
|
|
39713
39727
|
* Default is ````0.5```` seconds.
|
|
39714
39728
|
*
|
|
39715
|
-
* @return {Number}
|
|
39729
|
+
* @return {Number} Delay in seconds.
|
|
39716
39730
|
*/
|
|
39717
|
-
get
|
|
39718
|
-
return this.
|
|
39731
|
+
get delayBeforeRestoreSeconds() {
|
|
39732
|
+
return this._delayBeforeRestoreSeconds;
|
|
39719
39733
|
}
|
|
39720
39734
|
|
|
39721
39735
|
/**
|
|
39722
|
-
* Sets the delay
|
|
39736
|
+
* Sets the delay before restoring normal rendering after we stop interacting with the Viewer.
|
|
39723
39737
|
*
|
|
39724
|
-
* The delay is enabled when {@link FastNavPlugin#
|
|
39738
|
+
* The delay is enabled when {@link FastNavPlugin#delayBeforeRestore} is ````true````.
|
|
39725
39739
|
*
|
|
39726
39740
|
* Default is ````0.5```` seconds.
|
|
39727
39741
|
*
|
|
39728
|
-
* @param {Number}
|
|
39742
|
+
* @param {Number} delayBeforeRestoreSeconds Delay in seconds.
|
|
39729
39743
|
*/
|
|
39730
|
-
set
|
|
39731
|
-
this.
|
|
39744
|
+
set delayBeforeRestoreSeconds(delayBeforeRestoreSeconds) {
|
|
39745
|
+
this._delayBeforeRestoreSeconds = delayBeforeRestoreSeconds !== null && delayBeforeRestoreSeconds !== undefined ? delayBeforeRestoreSeconds : 0.5;
|
|
39732
39746
|
}
|
|
39733
39747
|
|
|
39734
39748
|
/**
|