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