@xeokit/xeokit-sdk 2.4.0-alpha-20 → 2.4.0-alpha-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.
@@ -9524,6 +9524,12 @@ class Wire {
9524
9524
  });
9525
9525
  }
9526
9526
 
9527
+ if (cfg.onMouseWheel) {
9528
+ wireClickable.addEventListener('wheel', (event) => {
9529
+ cfg.onMouseWheel(event, this);
9530
+ });
9531
+ }
9532
+
9527
9533
  if (cfg.onContextMenu) {
9528
9534
  wireClickable.addEventListener('contextmenu', (event) => {
9529
9535
  cfg.onContextMenu(event, this);
@@ -9679,6 +9685,12 @@ class Dot {
9679
9685
  });
9680
9686
  }
9681
9687
 
9688
+ if (cfg.onMouseWheel) {
9689
+ dotClickable.addEventListener('wheel', (event) => {
9690
+ cfg.onMouseWheel(event, this);
9691
+ });
9692
+ }
9693
+
9682
9694
  if (cfg.onContextMenu) {
9683
9695
  dotClickable.addEventListener('contextmenu', (event) => {
9684
9696
  cfg.onContextMenu(event, this);
@@ -9803,6 +9815,12 @@ class Label {
9803
9815
  });
9804
9816
  }
9805
9817
 
9818
+ if (cfg.onMouseWheel) {
9819
+ label.addEventListener('wheel', (event) => {
9820
+ cfg.onMouseWheel(event, this);
9821
+ });
9822
+ }
9823
+
9806
9824
  if (cfg.onContextMenu) {
9807
9825
  label.addEventListener('contextmenu', (event) => {
9808
9826
  cfg.onContextMenu(event, this);
@@ -9947,11 +9965,16 @@ class AngleMeasurement extends Component {
9947
9965
  cfg.onContextMenu(event, this);
9948
9966
  } : null;
9949
9967
 
9968
+ const onMouseWheel = (event) => {
9969
+ this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
9970
+ };
9971
+
9950
9972
  this._originDot = new Dot(this._container, {
9951
9973
  fillColor: this._color,
9952
9974
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
9953
9975
  onMouseOver,
9954
9976
  onMouseLeave,
9977
+ onMouseWheel,
9955
9978
  onContextMenu
9956
9979
  });
9957
9980
  this._cornerDot = new Dot(this._container, {
@@ -9959,6 +9982,7 @@ class AngleMeasurement extends Component {
9959
9982
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
9960
9983
  onMouseOver,
9961
9984
  onMouseLeave,
9985
+ onMouseWheel,
9962
9986
  onContextMenu
9963
9987
  });
9964
9988
  this._targetDot = new Dot(this._container, {
@@ -9966,6 +9990,7 @@ class AngleMeasurement extends Component {
9966
9990
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
9967
9991
  onMouseOver,
9968
9992
  onMouseLeave,
9993
+ onMouseWheel,
9969
9994
  onContextMenu
9970
9995
  });
9971
9996
 
@@ -9975,6 +10000,7 @@ class AngleMeasurement extends Component {
9975
10000
  zIndex: plugin.zIndex,
9976
10001
  onMouseOver,
9977
10002
  onMouseLeave,
10003
+ onMouseWheel,
9978
10004
  onContextMenu
9979
10005
  });
9980
10006
  this._targetWire = new Wire(this._container, {
@@ -9983,6 +10009,7 @@ class AngleMeasurement extends Component {
9983
10009
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined,
9984
10010
  onMouseOver,
9985
10011
  onMouseLeave,
10012
+ onMouseWheel,
9986
10013
  onContextMenu
9987
10014
  });
9988
10015
 
@@ -9993,6 +10020,7 @@ class AngleMeasurement extends Component {
9993
10020
  zIndex: plugin.zIndex + 2,
9994
10021
  onMouseOver,
9995
10022
  onMouseLeave,
10023
+ onMouseWheel,
9996
10024
  onContextMenu
9997
10025
  });
9998
10026
 
@@ -62385,11 +62413,16 @@ class DistanceMeasurement extends Component {
62385
62413
  cfg.onContextMenu(event, this);
62386
62414
  } : null;
62387
62415
 
62416
+ const onMouseWheel = (event) => {
62417
+ this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
62418
+ };
62419
+
62388
62420
  this._originDot = new Dot(this._container, {
62389
62421
  fillColor: this._color,
62390
62422
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2 : undefined,
62391
62423
  onMouseOver,
62392
62424
  onMouseLeave,
62425
+ onMouseWheel,
62393
62426
  onContextMenu
62394
62427
  });
62395
62428
 
@@ -62398,6 +62431,7 @@ class DistanceMeasurement extends Component {
62398
62431
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2 : undefined,
62399
62432
  onMouseOver,
62400
62433
  onMouseLeave,
62434
+ onMouseWheel,
62401
62435
  onContextMenu
62402
62436
  });
62403
62437
 
@@ -62408,6 +62442,7 @@ class DistanceMeasurement extends Component {
62408
62442
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62409
62443
  onMouseOver,
62410
62444
  onMouseLeave,
62445
+ onMouseWheel,
62411
62446
  onContextMenu
62412
62447
  });
62413
62448
 
@@ -62418,6 +62453,7 @@ class DistanceMeasurement extends Component {
62418
62453
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62419
62454
  onMouseOver,
62420
62455
  onMouseLeave,
62456
+ onMouseWheel,
62421
62457
  onContextMenu
62422
62458
  });
62423
62459
 
@@ -62428,6 +62464,7 @@ class DistanceMeasurement extends Component {
62428
62464
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62429
62465
  onMouseOver,
62430
62466
  onMouseLeave,
62467
+ onMouseWheel,
62431
62468
  onContextMenu
62432
62469
  });
62433
62470
 
@@ -62438,6 +62475,7 @@ class DistanceMeasurement extends Component {
62438
62475
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62439
62476
  onMouseOver,
62440
62477
  onMouseLeave,
62478
+ onMouseWheel,
62441
62479
  onContextMenu
62442
62480
  });
62443
62481
 
@@ -62448,6 +62486,7 @@ class DistanceMeasurement extends Component {
62448
62486
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 4 : undefined,
62449
62487
  onMouseOver,
62450
62488
  onMouseLeave,
62489
+ onMouseWheel,
62451
62490
  onContextMenu
62452
62491
  });
62453
62492
 
@@ -62458,6 +62497,7 @@ class DistanceMeasurement extends Component {
62458
62497
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3 : undefined,
62459
62498
  onMouseOver,
62460
62499
  onMouseLeave,
62500
+ onMouseWheel,
62461
62501
  onContextMenu
62462
62502
  });
62463
62503
 
@@ -62468,6 +62508,7 @@ class DistanceMeasurement extends Component {
62468
62508
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3 : undefined,
62469
62509
  onMouseOver,
62470
62510
  onMouseLeave,
62511
+ onMouseWheel,
62471
62512
  onContextMenu
62472
62513
  });
62473
62514
 
@@ -62478,6 +62519,7 @@ class DistanceMeasurement extends Component {
62478
62519
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3 : undefined,
62479
62520
  onMouseOver,
62480
62521
  onMouseLeave,
62522
+ onMouseWheel,
62481
62523
  onContextMenu
62482
62524
  });
62483
62525
 
@@ -99222,9 +99264,6 @@ class KeyboardPanRotateDollyHandler {
99222
99264
  if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
99223
99265
  return;
99224
99266
  }
99225
- if (!states.mouseover) {
99226
- return;
99227
- }
99228
99267
  keyDownMap[keyCode] = false;
99229
99268
 
99230
99269
  if (keyCode === input.KEY_SHIFT) {
@@ -9520,6 +9520,12 @@ class Wire {
9520
9520
  });
9521
9521
  }
9522
9522
 
9523
+ if (cfg.onMouseWheel) {
9524
+ wireClickable.addEventListener('wheel', (event) => {
9525
+ cfg.onMouseWheel(event, this);
9526
+ });
9527
+ }
9528
+
9523
9529
  if (cfg.onContextMenu) {
9524
9530
  wireClickable.addEventListener('contextmenu', (event) => {
9525
9531
  cfg.onContextMenu(event, this);
@@ -9675,6 +9681,12 @@ class Dot {
9675
9681
  });
9676
9682
  }
9677
9683
 
9684
+ if (cfg.onMouseWheel) {
9685
+ dotClickable.addEventListener('wheel', (event) => {
9686
+ cfg.onMouseWheel(event, this);
9687
+ });
9688
+ }
9689
+
9678
9690
  if (cfg.onContextMenu) {
9679
9691
  dotClickable.addEventListener('contextmenu', (event) => {
9680
9692
  cfg.onContextMenu(event, this);
@@ -9799,6 +9811,12 @@ class Label {
9799
9811
  });
9800
9812
  }
9801
9813
 
9814
+ if (cfg.onMouseWheel) {
9815
+ label.addEventListener('wheel', (event) => {
9816
+ cfg.onMouseWheel(event, this);
9817
+ });
9818
+ }
9819
+
9802
9820
  if (cfg.onContextMenu) {
9803
9821
  label.addEventListener('contextmenu', (event) => {
9804
9822
  cfg.onContextMenu(event, this);
@@ -9943,11 +9961,16 @@ class AngleMeasurement extends Component {
9943
9961
  cfg.onContextMenu(event, this);
9944
9962
  } : null;
9945
9963
 
9964
+ const onMouseWheel = (event) => {
9965
+ this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
9966
+ };
9967
+
9946
9968
  this._originDot = new Dot(this._container, {
9947
9969
  fillColor: this._color,
9948
9970
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
9949
9971
  onMouseOver,
9950
9972
  onMouseLeave,
9973
+ onMouseWheel,
9951
9974
  onContextMenu
9952
9975
  });
9953
9976
  this._cornerDot = new Dot(this._container, {
@@ -9955,6 +9978,7 @@ class AngleMeasurement extends Component {
9955
9978
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
9956
9979
  onMouseOver,
9957
9980
  onMouseLeave,
9981
+ onMouseWheel,
9958
9982
  onContextMenu
9959
9983
  });
9960
9984
  this._targetDot = new Dot(this._container, {
@@ -9962,6 +9986,7 @@ class AngleMeasurement extends Component {
9962
9986
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2: undefined,
9963
9987
  onMouseOver,
9964
9988
  onMouseLeave,
9989
+ onMouseWheel,
9965
9990
  onContextMenu
9966
9991
  });
9967
9992
 
@@ -9971,6 +9996,7 @@ class AngleMeasurement extends Component {
9971
9996
  zIndex: plugin.zIndex,
9972
9997
  onMouseOver,
9973
9998
  onMouseLeave,
9999
+ onMouseWheel,
9974
10000
  onContextMenu
9975
10001
  });
9976
10002
  this._targetWire = new Wire(this._container, {
@@ -9979,6 +10005,7 @@ class AngleMeasurement extends Component {
9979
10005
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1: undefined,
9980
10006
  onMouseOver,
9981
10007
  onMouseLeave,
10008
+ onMouseWheel,
9982
10009
  onContextMenu
9983
10010
  });
9984
10011
 
@@ -9989,6 +10016,7 @@ class AngleMeasurement extends Component {
9989
10016
  zIndex: plugin.zIndex + 2,
9990
10017
  onMouseOver,
9991
10018
  onMouseLeave,
10019
+ onMouseWheel,
9992
10020
  onContextMenu
9993
10021
  });
9994
10022
 
@@ -62381,11 +62409,16 @@ class DistanceMeasurement extends Component {
62381
62409
  cfg.onContextMenu(event, this);
62382
62410
  } : null;
62383
62411
 
62412
+ const onMouseWheel = (event) => {
62413
+ this.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel', event));
62414
+ };
62415
+
62384
62416
  this._originDot = new Dot(this._container, {
62385
62417
  fillColor: this._color,
62386
62418
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2 : undefined,
62387
62419
  onMouseOver,
62388
62420
  onMouseLeave,
62421
+ onMouseWheel,
62389
62422
  onContextMenu
62390
62423
  });
62391
62424
 
@@ -62394,6 +62427,7 @@ class DistanceMeasurement extends Component {
62394
62427
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 2 : undefined,
62395
62428
  onMouseOver,
62396
62429
  onMouseLeave,
62430
+ onMouseWheel,
62397
62431
  onContextMenu
62398
62432
  });
62399
62433
 
@@ -62404,6 +62438,7 @@ class DistanceMeasurement extends Component {
62404
62438
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62405
62439
  onMouseOver,
62406
62440
  onMouseLeave,
62441
+ onMouseWheel,
62407
62442
  onContextMenu
62408
62443
  });
62409
62444
 
@@ -62414,6 +62449,7 @@ class DistanceMeasurement extends Component {
62414
62449
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62415
62450
  onMouseOver,
62416
62451
  onMouseLeave,
62452
+ onMouseWheel,
62417
62453
  onContextMenu
62418
62454
  });
62419
62455
 
@@ -62424,6 +62460,7 @@ class DistanceMeasurement extends Component {
62424
62460
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62425
62461
  onMouseOver,
62426
62462
  onMouseLeave,
62463
+ onMouseWheel,
62427
62464
  onContextMenu
62428
62465
  });
62429
62466
 
@@ -62434,6 +62471,7 @@ class DistanceMeasurement extends Component {
62434
62471
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 1 : undefined,
62435
62472
  onMouseOver,
62436
62473
  onMouseLeave,
62474
+ onMouseWheel,
62437
62475
  onContextMenu
62438
62476
  });
62439
62477
 
@@ -62444,6 +62482,7 @@ class DistanceMeasurement extends Component {
62444
62482
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 4 : undefined,
62445
62483
  onMouseOver,
62446
62484
  onMouseLeave,
62485
+ onMouseWheel,
62447
62486
  onContextMenu
62448
62487
  });
62449
62488
 
@@ -62454,6 +62493,7 @@ class DistanceMeasurement extends Component {
62454
62493
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3 : undefined,
62455
62494
  onMouseOver,
62456
62495
  onMouseLeave,
62496
+ onMouseWheel,
62457
62497
  onContextMenu
62458
62498
  });
62459
62499
 
@@ -62464,6 +62504,7 @@ class DistanceMeasurement extends Component {
62464
62504
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3 : undefined,
62465
62505
  onMouseOver,
62466
62506
  onMouseLeave,
62507
+ onMouseWheel,
62467
62508
  onContextMenu
62468
62509
  });
62469
62510
 
@@ -62474,6 +62515,7 @@ class DistanceMeasurement extends Component {
62474
62515
  zIndex: plugin.zIndex !== undefined ? plugin.zIndex + 3 : undefined,
62475
62516
  onMouseOver,
62476
62517
  onMouseLeave,
62518
+ onMouseWheel,
62477
62519
  onContextMenu
62478
62520
  });
62479
62521
 
@@ -99218,9 +99260,6 @@ class KeyboardPanRotateDollyHandler {
99218
99260
  if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
99219
99261
  return;
99220
99262
  }
99221
- if (!states.mouseover) {
99222
- return;
99223
- }
99224
99263
  keyDownMap[keyCode] = false;
99225
99264
 
99226
99265
  if (keyCode === input.KEY_SHIFT) {
@@ -2405,7 +2405,7 @@ _this7._onEntityModelDestroyed=null;});}else{this._onEntityDestroyed=this._entit
2405
2405
  */},{key:"visible",get:function get(){return!!this._visible;}/**
2406
2406
  * Destroys this Marker.
2407
2407
  */},{key:"destroy",value:function destroy(){this.fire("destroyed",true);this.scene.camera.off(this._onCameraViewMatrix);this.scene.camera.off(this._onCameraProjMatrix);if(this._entity){if(this._onEntityDestroyed!==null){this._entity.off(this._onEntityDestroyed);}if(this._onEntityModelDestroyed!==null){this._entity.model.off(this._onEntityModelDestroyed);}}this._renderer.removeMarker(this);_get(_getPrototypeOf(Marker.prototype),"destroy",this).call(this);}}]);return Marker;}(Component);/** @private */var Wire=/*#__PURE__*/function(){function Wire(parentElement){var _this8=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Wire);this._color=cfg.color||"black";this._highlightClass="viewer-ruler-wire-highlighted";this._wire=document.createElement('div');this._wire.className+=this._wire.className?' viewer-ruler-wire':'viewer-ruler-wire';this._wireClickable=document.createElement('div');this._wireClickable.className+=this._wireClickable.className?' viewer-ruler-wire-clickable':'viewer-ruler-wire-clickable';this._thickness=cfg.thickness||1.0;this._thicknessClickable=cfg.thicknessClickable||6.0;var wire=this._wire;var wireStyle=wire.style;wireStyle.border="solid "+this._thickness+"px "+this._color;wireStyle.position="absolute";wireStyle["z-index"]=cfg.zIndex===undefined?"2000001":cfg.zIndex;wireStyle.width=0+"px";wireStyle.height=0+"px";wireStyle.visibility="visible";wireStyle.top=0+"px";wireStyle.left=0+"px";wireStyle['-webkit-transform-origin']="0 0";wireStyle['-moz-transform-origin']="0 0";wireStyle['-ms-transform-origin']="0 0";wireStyle['-o-transform-origin']="0 0";wireStyle['transform-origin']="0 0";wireStyle['-webkit-transform']='rotate(0deg)';wireStyle['-moz-transform']='rotate(0deg)';wireStyle['-ms-transform']='rotate(0deg)';wireStyle['-o-transform']='rotate(0deg)';wireStyle['transform']='rotate(0deg)';wireStyle["opacity"]=1.0;wireStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(wire);var wireClickable=this._wireClickable;var wireClickableStyle=wireClickable.style;wireClickableStyle.border="solid "+this._thicknessClickable+"px "+this._color;wireClickableStyle.position="absolute";wireClickableStyle["z-index"]=cfg.zIndex===undefined?"2000002":cfg.zIndex+1;wireClickableStyle.width=0+"px";wireClickableStyle.height=0+"px";wireClickableStyle.visibility="visible";wireClickableStyle.top=0+"px";wireClickableStyle.left=0+"px";// wireClickableStyle["pointer-events"] = "none";
2408
- wireClickableStyle['-webkit-transform-origin']="0 0";wireClickableStyle['-moz-transform-origin']="0 0";wireClickableStyle['-ms-transform-origin']="0 0";wireClickableStyle['-o-transform-origin']="0 0";wireClickableStyle['transform-origin']="0 0";wireClickableStyle['-webkit-transform']='rotate(0deg)';wireClickableStyle['-moz-transform']='rotate(0deg)';wireClickableStyle['-ms-transform']='rotate(0deg)';wireClickableStyle['-o-transform']='rotate(0deg)';wireClickableStyle['transform']='rotate(0deg)';wireClickableStyle["opacity"]=0.0;wireClickableStyle["pointer-events"]="all";if(cfg.onContextMenu);parentElement.appendChild(wireClickable);if(cfg.onMouseOver){wireClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this8);});}if(cfg.onMouseLeave){wireClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this8);});}if(cfg.onContextMenu){wireClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this8);event.preventDefault();});}this._x1=0;this._y1=0;this._x2=0;this._y2=0;this._update();}_createClass(Wire,[{key:"_visible",get:function get(){return this._wire.style.visibility==="visible";}},{key:"_update",value:function _update(){var length=Math.abs(Math.sqrt((this._x1-this._x2)*(this._x1-this._x2)+(this._y1-this._y2)*(this._y1-this._y2)));var angle=Math.atan2(this._y2-this._y1,this._x2-this._x1)*180.0/Math.PI;var wireStyle=this._wire.style;wireStyle["width"]=Math.round(length)+'px';wireStyle["left"]=Math.round(this._x1)+'px';wireStyle["top"]=Math.round(this._y1)+'px';wireStyle['-webkit-transform']='rotate('+angle+'deg)';wireStyle['-moz-transform']='rotate('+angle+'deg)';wireStyle['-ms-transform']='rotate('+angle+'deg)';wireStyle['-o-transform']='rotate('+angle+'deg)';wireStyle['transform']='rotate('+angle+'deg)';var wireClickableStyle=this._wireClickable.style;wireClickableStyle["width"]=Math.round(length)+'px';wireClickableStyle["left"]=Math.round(this._x1)+'px';wireClickableStyle["top"]=Math.round(this._y1)+'px';wireClickableStyle['-webkit-transform']='rotate('+angle+'deg)';wireClickableStyle['-moz-transform']='rotate('+angle+'deg)';wireClickableStyle['-ms-transform']='rotate('+angle+'deg)';wireClickableStyle['-o-transform']='rotate('+angle+'deg)';wireClickableStyle['transform']='rotate('+angle+'deg)';}},{key:"setStartAndEnd",value:function setStartAndEnd(x1,y1,x2,y2){this._x1=x1;this._y1=y1;this._x2=x2;this._y2=y2;this._update();}},{key:"setColor",value:function setColor(color){this._color=color||"black";this._wire.style.border="solid "+this._thickness+"px "+this._color;}},{key:"setOpacity",value:function setOpacity(opacity){this._wire.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){visible=!!visible;if(this._visible===visible){return;}this._wire.style.visibility=visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._wireClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._wire.classList.add(this._highlightClass);}else{this._wire.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(visible){this._wire.parentElement.removeChild(this._wire);this._wireClickable.parentElement.removeChild(this._wireClickable);}}]);return Wire;}();/** @private */var Dot=/*#__PURE__*/function(){function Dot(parentElement){var _this9=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Dot);this._highlightClass="viewer-ruler-dot-highlighted";this._x=0;this._y=0;this._visible=true;this._dot=document.createElement('div');this._dot.className+=this._dot.className?' viewer-ruler-dot':'viewer-ruler-dot';this._dotClickable=document.createElement('div');this._dotClickable.className+=this._dotClickable.className?' viewer-ruler-dot-clickable':'viewer-ruler-dot-clickable';var dot=this._dot;var dotStyle=dot.style;dotStyle["border-radius"]=25+"px";dotStyle.border="solid 2px white";dotStyle.background="lightgreen";dotStyle.position="absolute";dotStyle["z-index"]=cfg.zIndex===undefined?"40000005":cfg.zIndex;dotStyle.width=8+"px";dotStyle.height=8+"px";dotStyle.visibility=cfg.visible!==false?"visible":"hidden";dotStyle.top=0+"px";dotStyle.left=0+"px";dotStyle["box-shadow"]="0 2px 5px 0 #182A3D;";dotStyle["opacity"]=1.0;dotStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dot);var dotClickable=this._dotClickable;var dotClickableStyle=dotClickable.style;dotClickableStyle["border-radius"]=35+"px";dotClickableStyle.border="solid 10px white";dotClickableStyle.position="absolute";dotClickableStyle["z-index"]=cfg.zIndex===undefined?"40000007":cfg.zIndex+1;dotClickableStyle.width=8+"px";dotClickableStyle.height=8+"px";dotClickableStyle.visibility="visible";dotClickableStyle.top=0+"px";dotClickableStyle.left=0+"px";dotClickableStyle["opacity"]=0.0;dotClickableStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dotClickable);if(cfg.onMouseOver){dotClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this9);});}if(cfg.onMouseLeave){dotClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this9);});}if(cfg.onContextMenu){dotClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this9);event.preventDefault();});}this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.borderColor);}_createClass(Dot,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var dotStyle=this._dot.style;dotStyle["left"]=Math.round(x)-4+'px';dotStyle["top"]=Math.round(y)-4+'px';var dotClickableStyle=this._dotClickable.style;dotClickableStyle["left"]=Math.round(x)-9+'px';dotClickableStyle["top"]=Math.round(y)-9+'px';}},{key:"setFillColor",value:function setFillColor(color){this._dot.style.background=color||"lightgreen";}},{key:"setBorderColor",value:function setBorderColor(color){this._dot.style.border="solid 2px"+(color||"black");}},{key:"setOpacity",value:function setOpacity(opacity){this._dot.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._dot.style.visibility=this._visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._dotClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._dot.classList.add(this._highlightClass);}else{this._dot.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(){this.setVisible(false);this._dot.parentElement.removeChild(this._dot);this._dotClickable.parentElement.removeChild(this._dotClickable);}}]);return Dot;}();/** @private */var Label=/*#__PURE__*/function(){function Label(parentElement){var _this10=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Label);this._highlightClass="viewer-ruler-label-highlighted";this._prefix=cfg.prefix||"";this._x=0;this._y=0;this._visible=true;this._culled=false;this._label=document.createElement('div');this._label.className+=this._label.className?' viewer-ruler-label':'viewer-ruler-label';var label=this._label;var style=label.style;style["border-radius"]=5+"px";style.color="white";style.padding="4px";style.border="solid 1px";style.background="lightgreen";style.position="absolute";style["z-index"]=cfg.zIndex===undefined?"5000005":cfg.zIndex;style.width="auto";style.height="auto";style.visibility="visible";style.top=0+"px";style.left=0+"px";style["pointer-events"]="all";style["opacity"]=1.0;if(cfg.onContextMenu);label.innerText="";parentElement.appendChild(label);this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.fillColor);this.setText(cfg.text);if(cfg.onMouseOver){label.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this10);event.preventDefault();});}if(cfg.onMouseLeave){label.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this10);event.preventDefault();});}if(cfg.onContextMenu){label.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this10);event.preventDefault();});}}_createClass(Label,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosOnWire",value:function setPosOnWire(x1,y1,x2,y2){var x=x1+(x2-x1)*0.5;var y=y1+(y2-y1)*0.5;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosBetweenWires",value:function setPosBetweenWires(x1,y1,x2,y2,x3,y3){var x=(x1+x2+x3)/3;var y=(y1+y2+y3)/3;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setText",value:function setText(text){this._label.innerHTML=this._prefix+(text||"");}},{key:"setFillColor",value:function setFillColor(color){this._fillColor=color||"lightgreen";this._label.style.background=this._fillColor;}},{key:"setBorderColor",value:function setBorderColor(color){this._borderColor=color||"black";this._label.style.border="solid 1px "+this._borderColor;}},{key:"setOpacity",value:function setOpacity(opacity){this._label.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setCulled",value:function setCulled(culled){if(this._culled===culled){return;}this._culled=!!culled;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._label.classList.add(this._highlightClass);}else{this._label.classList.remove(this._highlightClass);}}},{key:"setClickable",value:function setClickable(clickable){this._label.style["pointer-events"]=!!clickable?"all":"none";}},{key:"destroy",value:function destroy(){this._label.parentElement.removeChild(this._label);}}]);return Label;}();var originVec=math.vec3();var targetVec=math.vec3();/**
2408
+ wireClickableStyle['-webkit-transform-origin']="0 0";wireClickableStyle['-moz-transform-origin']="0 0";wireClickableStyle['-ms-transform-origin']="0 0";wireClickableStyle['-o-transform-origin']="0 0";wireClickableStyle['transform-origin']="0 0";wireClickableStyle['-webkit-transform']='rotate(0deg)';wireClickableStyle['-moz-transform']='rotate(0deg)';wireClickableStyle['-ms-transform']='rotate(0deg)';wireClickableStyle['-o-transform']='rotate(0deg)';wireClickableStyle['transform']='rotate(0deg)';wireClickableStyle["opacity"]=0.0;wireClickableStyle["pointer-events"]="all";if(cfg.onContextMenu);parentElement.appendChild(wireClickable);if(cfg.onMouseOver){wireClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this8);});}if(cfg.onMouseLeave){wireClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this8);});}if(cfg.onMouseWheel){wireClickable.addEventListener('wheel',function(event){cfg.onMouseWheel(event,_this8);});}if(cfg.onContextMenu){wireClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this8);event.preventDefault();});}this._x1=0;this._y1=0;this._x2=0;this._y2=0;this._update();}_createClass(Wire,[{key:"_visible",get:function get(){return this._wire.style.visibility==="visible";}},{key:"_update",value:function _update(){var length=Math.abs(Math.sqrt((this._x1-this._x2)*(this._x1-this._x2)+(this._y1-this._y2)*(this._y1-this._y2)));var angle=Math.atan2(this._y2-this._y1,this._x2-this._x1)*180.0/Math.PI;var wireStyle=this._wire.style;wireStyle["width"]=Math.round(length)+'px';wireStyle["left"]=Math.round(this._x1)+'px';wireStyle["top"]=Math.round(this._y1)+'px';wireStyle['-webkit-transform']='rotate('+angle+'deg)';wireStyle['-moz-transform']='rotate('+angle+'deg)';wireStyle['-ms-transform']='rotate('+angle+'deg)';wireStyle['-o-transform']='rotate('+angle+'deg)';wireStyle['transform']='rotate('+angle+'deg)';var wireClickableStyle=this._wireClickable.style;wireClickableStyle["width"]=Math.round(length)+'px';wireClickableStyle["left"]=Math.round(this._x1)+'px';wireClickableStyle["top"]=Math.round(this._y1)+'px';wireClickableStyle['-webkit-transform']='rotate('+angle+'deg)';wireClickableStyle['-moz-transform']='rotate('+angle+'deg)';wireClickableStyle['-ms-transform']='rotate('+angle+'deg)';wireClickableStyle['-o-transform']='rotate('+angle+'deg)';wireClickableStyle['transform']='rotate('+angle+'deg)';}},{key:"setStartAndEnd",value:function setStartAndEnd(x1,y1,x2,y2){this._x1=x1;this._y1=y1;this._x2=x2;this._y2=y2;this._update();}},{key:"setColor",value:function setColor(color){this._color=color||"black";this._wire.style.border="solid "+this._thickness+"px "+this._color;}},{key:"setOpacity",value:function setOpacity(opacity){this._wire.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){visible=!!visible;if(this._visible===visible){return;}this._wire.style.visibility=visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._wireClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._wire.classList.add(this._highlightClass);}else{this._wire.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(visible){this._wire.parentElement.removeChild(this._wire);this._wireClickable.parentElement.removeChild(this._wireClickable);}}]);return Wire;}();/** @private */var Dot=/*#__PURE__*/function(){function Dot(parentElement){var _this9=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Dot);this._highlightClass="viewer-ruler-dot-highlighted";this._x=0;this._y=0;this._visible=true;this._dot=document.createElement('div');this._dot.className+=this._dot.className?' viewer-ruler-dot':'viewer-ruler-dot';this._dotClickable=document.createElement('div');this._dotClickable.className+=this._dotClickable.className?' viewer-ruler-dot-clickable':'viewer-ruler-dot-clickable';var dot=this._dot;var dotStyle=dot.style;dotStyle["border-radius"]=25+"px";dotStyle.border="solid 2px white";dotStyle.background="lightgreen";dotStyle.position="absolute";dotStyle["z-index"]=cfg.zIndex===undefined?"40000005":cfg.zIndex;dotStyle.width=8+"px";dotStyle.height=8+"px";dotStyle.visibility=cfg.visible!==false?"visible":"hidden";dotStyle.top=0+"px";dotStyle.left=0+"px";dotStyle["box-shadow"]="0 2px 5px 0 #182A3D;";dotStyle["opacity"]=1.0;dotStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dot);var dotClickable=this._dotClickable;var dotClickableStyle=dotClickable.style;dotClickableStyle["border-radius"]=35+"px";dotClickableStyle.border="solid 10px white";dotClickableStyle.position="absolute";dotClickableStyle["z-index"]=cfg.zIndex===undefined?"40000007":cfg.zIndex+1;dotClickableStyle.width=8+"px";dotClickableStyle.height=8+"px";dotClickableStyle.visibility="visible";dotClickableStyle.top=0+"px";dotClickableStyle.left=0+"px";dotClickableStyle["opacity"]=0.0;dotClickableStyle["pointer-events"]="none";if(cfg.onContextMenu);parentElement.appendChild(dotClickable);if(cfg.onMouseOver){dotClickable.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this9);});}if(cfg.onMouseLeave){dotClickable.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this9);});}if(cfg.onMouseWheel){dotClickable.addEventListener('wheel',function(event){cfg.onMouseWheel(event,_this9);});}if(cfg.onContextMenu){dotClickable.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this9);event.preventDefault();});}this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.borderColor);}_createClass(Dot,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var dotStyle=this._dot.style;dotStyle["left"]=Math.round(x)-4+'px';dotStyle["top"]=Math.round(y)-4+'px';var dotClickableStyle=this._dotClickable.style;dotClickableStyle["left"]=Math.round(x)-9+'px';dotClickableStyle["top"]=Math.round(y)-9+'px';}},{key:"setFillColor",value:function setFillColor(color){this._dot.style.background=color||"lightgreen";}},{key:"setBorderColor",value:function setBorderColor(color){this._dot.style.border="solid 2px"+(color||"black");}},{key:"setOpacity",value:function setOpacity(opacity){this._dot.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._dot.style.visibility=this._visible?"visible":"hidden";}},{key:"setClickable",value:function setClickable(clickable){this._dotClickable.style["pointer-events"]=!!clickable?"all":"none";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._dot.classList.add(this._highlightClass);}else{this._dot.classList.remove(this._highlightClass);}}},{key:"destroy",value:function destroy(){this.setVisible(false);this._dot.parentElement.removeChild(this._dot);this._dotClickable.parentElement.removeChild(this._dotClickable);}}]);return Dot;}();/** @private */var Label=/*#__PURE__*/function(){function Label(parentElement){var _this10=this;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,Label);this._highlightClass="viewer-ruler-label-highlighted";this._prefix=cfg.prefix||"";this._x=0;this._y=0;this._visible=true;this._culled=false;this._label=document.createElement('div');this._label.className+=this._label.className?' viewer-ruler-label':'viewer-ruler-label';var label=this._label;var style=label.style;style["border-radius"]=5+"px";style.color="white";style.padding="4px";style.border="solid 1px";style.background="lightgreen";style.position="absolute";style["z-index"]=cfg.zIndex===undefined?"5000005":cfg.zIndex;style.width="auto";style.height="auto";style.visibility="visible";style.top=0+"px";style.left=0+"px";style["pointer-events"]="all";style["opacity"]=1.0;if(cfg.onContextMenu);label.innerText="";parentElement.appendChild(label);this.setPos(cfg.x||0,cfg.y||0);this.setFillColor(cfg.fillColor);this.setBorderColor(cfg.fillColor);this.setText(cfg.text);if(cfg.onMouseOver){label.addEventListener('mouseover',function(event){cfg.onMouseOver(event,_this10);event.preventDefault();});}if(cfg.onMouseLeave){label.addEventListener('mouseleave',function(event){cfg.onMouseLeave(event,_this10);event.preventDefault();});}if(cfg.onMouseWheel){label.addEventListener('wheel',function(event){cfg.onMouseWheel(event,_this10);});}if(cfg.onContextMenu){label.addEventListener('contextmenu',function(event){cfg.onContextMenu(event,_this10);event.preventDefault();});}}_createClass(Label,[{key:"setPos",value:function setPos(x,y){this._x=x;this._y=y;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosOnWire",value:function setPosOnWire(x1,y1,x2,y2){var x=x1+(x2-x1)*0.5;var y=y1+(y2-y1)*0.5;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setPosBetweenWires",value:function setPosBetweenWires(x1,y1,x2,y2,x3,y3){var x=(x1+x2+x3)/3;var y=(y1+y2+y3)/3;var style=this._label.style;style["left"]=Math.round(x)-20+'px';style["top"]=Math.round(y)-12+'px';}},{key:"setText",value:function setText(text){this._label.innerHTML=this._prefix+(text||"");}},{key:"setFillColor",value:function setFillColor(color){this._fillColor=color||"lightgreen";this._label.style.background=this._fillColor;}},{key:"setBorderColor",value:function setBorderColor(color){this._borderColor=color||"black";this._label.style.border="solid 1px "+this._borderColor;}},{key:"setOpacity",value:function setOpacity(opacity){this._label.style.opacity=opacity;}},{key:"setVisible",value:function setVisible(visible){if(this._visible===visible){return;}this._visible=!!visible;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setCulled",value:function setCulled(culled){if(this._culled===culled){return;}this._culled=!!culled;this._label.style.visibility=this._visible&&!this._culled?"visible":"hidden";}},{key:"setHighlighted",value:function setHighlighted(highlighted){if(this._highlighted===highlighted){return;}this._highlighted=!!highlighted;if(this._highlighted){this._label.classList.add(this._highlightClass);}else{this._label.classList.remove(this._highlightClass);}}},{key:"setClickable",value:function setClickable(clickable){this._label.style["pointer-events"]=!!clickable?"all":"none";}},{key:"destroy",value:function destroy(){this._label.parentElement.removeChild(this._label);}}]);return Label;}();var originVec=math.vec3();var targetVec=math.vec3();/**
2409
2409
  * @desc Measures the angle indicated by three 3D points.
2410
2410
  *
2411
2411
  * See {@link AngleMeasurementsPlugin} for more info.
@@ -2414,7 +2414,7 @@ wireClickableStyle['-webkit-transform-origin']="0 0";wireClickableStyle['-moz-tr
2414
2414
  */function AngleMeasurement(plugin){var _this11;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,AngleMeasurement);_this11=_super2.call(this,plugin.viewer.scene,cfg);/**
2415
2415
  * The {@link AngleMeasurementsPlugin} that owns this AngleMeasurement.
2416
2416
  * @type {AngleMeasurementsPlugin}
2417
- */_this11.plugin=plugin;_this11._container=cfg.container;if(!_this11._container){throw"config missing: container";}_this11._color=cfg.color||plugin.defaultColor;var scene=_this11.plugin.viewer.scene;_this11._originMarker=new Marker(scene,cfg.origin);_this11._cornerMarker=new Marker(scene,cfg.corner);_this11._targetMarker=new Marker(scene,cfg.target);_this11._originWorld=math.vec3();_this11._cornerWorld=math.vec3();_this11._targetWorld=math.vec3();_this11._wp=new Float64Array(12);_this11._vp=new Float64Array(12);_this11._pp=new Float64Array(12);_this11._cp=new Int16Array(6);var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this11));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this11));}:null;var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this11));}:null;_this11._originDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._cornerDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._targetDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._originWire=new Wire(_this11._container,{color:_this11._color||"blue",thickness:1,zIndex:plugin.zIndex,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._targetWire=new Wire(_this11._container,{color:_this11._color||"red",thickness:1,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._angleLabel=new Label(_this11._container,{fillColor:_this11._color||"#00BBFF",prefix:"",text:"",zIndex:plugin.zIndex+2,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this11._wpDirty=false;_this11._vpDirty=false;_this11._cpDirty=false;_this11._visible=false;_this11._originVisible=false;_this11._cornerVisible=false;_this11._targetVisible=false;_this11._originWireVisible=false;_this11._targetWireVisible=false;_this11._angleVisible=false;_this11._labelsVisible=false;_this11._clickable=false;_this11._originMarker.on("worldPos",function(value){_this11._originWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
2417
+ */_this11.plugin=plugin;_this11._container=cfg.container;if(!_this11._container){throw"config missing: container";}_this11._color=cfg.color||plugin.defaultColor;var scene=_this11.plugin.viewer.scene;_this11._originMarker=new Marker(scene,cfg.origin);_this11._cornerMarker=new Marker(scene,cfg.corner);_this11._targetMarker=new Marker(scene,cfg.target);_this11._originWorld=math.vec3();_this11._cornerWorld=math.vec3();_this11._targetWorld=math.vec3();_this11._wp=new Float64Array(12);_this11._vp=new Float64Array(12);_this11._pp=new Float64Array(12);_this11._cp=new Int16Array(6);var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this11));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this11));}:null;var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this11));}:null;var onMouseWheel=function onMouseWheel(event){_this11.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel',event));};_this11._originDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._cornerDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._targetDot=new Dot(_this11._container,{fillColor:_this11._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._originWire=new Wire(_this11._container,{color:_this11._color||"blue",thickness:1,zIndex:plugin.zIndex,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._targetWire=new Wire(_this11._container,{color:_this11._color||"red",thickness:1,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._angleLabel=new Label(_this11._container,{fillColor:_this11._color||"#00BBFF",prefix:"",text:"",zIndex:plugin.zIndex+2,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this11._wpDirty=false;_this11._vpDirty=false;_this11._cpDirty=false;_this11._visible=false;_this11._originVisible=false;_this11._cornerVisible=false;_this11._targetVisible=false;_this11._originWireVisible=false;_this11._targetWireVisible=false;_this11._angleVisible=false;_this11._labelsVisible=false;_this11._clickable=false;_this11._originMarker.on("worldPos",function(value){_this11._originWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
2418
2418
  });_this11._cornerMarker.on("worldPos",function(value){_this11._cornerWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
2419
2419
  });_this11._targetMarker.on("worldPos",function(value){_this11._targetWorld.set(value||[0,0,0]);_this11._wpDirty=true;_this11._needUpdate(0);// No lag
2420
2420
  });_this11._onViewMatrix=scene.camera.on("viewMatrix",function(){_this11._vpDirty=true;_this11._needUpdate(0);// No lag
@@ -15990,7 +15990,7 @@ origin:eye,direction:look});look=hit?hit.worldPos:math.addVec3(eye,look,tempVec3
15990
15990
  */function DistanceMeasurement(plugin){var _this67;var cfg=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,DistanceMeasurement);_this67=_super44.call(this,plugin.viewer.scene,cfg);/**
15991
15991
  * The {@link DistanceMeasurementsPlugin} that owns this DistanceMeasurement.
15992
15992
  * @type {DistanceMeasurementsPlugin}
15993
- */_this67.plugin=plugin;_this67._container=cfg.container;if(!_this67._container){throw"config missing: container";}_this67._eventSubs={};var scene=_this67.plugin.viewer.scene;_this67._originMarker=new Marker(scene,cfg.origin);_this67._targetMarker=new Marker(scene,cfg.target);_this67._originWorld=math.vec3();_this67._targetWorld=math.vec3();_this67._wp=new Float64Array(24);_this67._vp=new Float64Array(24);_this67._pp=new Float64Array(24);_this67._cp=new Float64Array(8);_this67._xAxisLabelCulled=false;_this67._yAxisLabelCulled=false;_this67._zAxisLabelCulled=false;_this67._color=cfg.color||_this67.plugin.defaultColor;var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this67));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this67));}:null;var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this67));}:null;_this67._originDot=new Dot(_this67._container,{fillColor:_this67._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._targetDot=new Dot(_this67._container,{fillColor:_this67._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._lengthWire=new Wire(_this67._container,{color:_this67._color,thickness:2,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._xAxisWire=new Wire(_this67._container,{color:"#FF0000",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._yAxisWire=new Wire(_this67._container,{color:"green",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._zAxisWire=new Wire(_this67._container,{color:"blue",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._lengthLabel=new Label(_this67._container,{fillColor:_this67._color,prefix:"",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+4:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._xAxisLabel=new Label(_this67._container,{fillColor:"red",prefix:"X",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._yAxisLabel=new Label(_this67._container,{fillColor:"green",prefix:"Y",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._zAxisLabel=new Label(_this67._container,{fillColor:"blue",prefix:"Z",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onContextMenu:onContextMenu});_this67._wpDirty=false;_this67._vpDirty=false;_this67._cpDirty=false;_this67._visible=false;_this67._originVisible=false;_this67._targetVisible=false;_this67._wireVisible=false;_this67._axisVisible=false;_this67._xAxisVisible=false;_this67._yAxisVisible=false;_this67._zAxisVisible=false;_this67._axisEnabled=true;_this67._labelsVisible=false;_this67._clickable=false;_this67._originMarker.on("worldPos",function(value){_this67._originWorld.set(value||[0,0,0]);_this67._wpDirty=true;_this67._needUpdate(0);// No lag
15993
+ */_this67.plugin=plugin;_this67._container=cfg.container;if(!_this67._container){throw"config missing: container";}_this67._eventSubs={};var scene=_this67.plugin.viewer.scene;_this67._originMarker=new Marker(scene,cfg.origin);_this67._targetMarker=new Marker(scene,cfg.target);_this67._originWorld=math.vec3();_this67._targetWorld=math.vec3();_this67._wp=new Float64Array(24);_this67._vp=new Float64Array(24);_this67._pp=new Float64Array(24);_this67._cp=new Float64Array(8);_this67._xAxisLabelCulled=false;_this67._yAxisLabelCulled=false;_this67._zAxisLabelCulled=false;_this67._color=cfg.color||_this67.plugin.defaultColor;var onMouseOver=cfg.onMouseOver?function(event){cfg.onMouseOver(event,_assertThisInitialized(_this67));}:null;var onMouseLeave=cfg.onMouseLeave?function(event){cfg.onMouseLeave(event,_assertThisInitialized(_this67));}:null;var onContextMenu=cfg.onContextMenu?function(event){cfg.onContextMenu(event,_assertThisInitialized(_this67));}:null;var onMouseWheel=function onMouseWheel(event){_this67.plugin.viewer.scene.canvas.canvas.dispatchEvent(new WheelEvent('wheel',event));};_this67._originDot=new Dot(_this67._container,{fillColor:_this67._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._targetDot=new Dot(_this67._container,{fillColor:_this67._color,zIndex:plugin.zIndex!==undefined?plugin.zIndex+2:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._lengthWire=new Wire(_this67._container,{color:_this67._color,thickness:2,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._xAxisWire=new Wire(_this67._container,{color:"#FF0000",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._yAxisWire=new Wire(_this67._container,{color:"green",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._zAxisWire=new Wire(_this67._container,{color:"blue",thickness:1,thicknessClickable:6,zIndex:plugin.zIndex!==undefined?plugin.zIndex+1:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._lengthLabel=new Label(_this67._container,{fillColor:_this67._color,prefix:"",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+4:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._xAxisLabel=new Label(_this67._container,{fillColor:"red",prefix:"X",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._yAxisLabel=new Label(_this67._container,{fillColor:"green",prefix:"Y",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._zAxisLabel=new Label(_this67._container,{fillColor:"blue",prefix:"Z",text:"",zIndex:plugin.zIndex!==undefined?plugin.zIndex+3:undefined,onMouseOver:onMouseOver,onMouseLeave:onMouseLeave,onMouseWheel:onMouseWheel,onContextMenu:onContextMenu});_this67._wpDirty=false;_this67._vpDirty=false;_this67._cpDirty=false;_this67._visible=false;_this67._originVisible=false;_this67._targetVisible=false;_this67._wireVisible=false;_this67._axisVisible=false;_this67._xAxisVisible=false;_this67._yAxisVisible=false;_this67._zAxisVisible=false;_this67._axisEnabled=true;_this67._labelsVisible=false;_this67._clickable=false;_this67._originMarker.on("worldPos",function(value){_this67._originWorld.set(value||[0,0,0]);_this67._wpDirty=true;_this67._needUpdate(0);// No lag
15994
15994
  });_this67._targetMarker.on("worldPos",function(value){_this67._targetWorld.set(value||[0,0,0]);_this67._wpDirty=true;_this67._needUpdate(0);// No lag
15995
15995
  });_this67._onViewMatrix=scene.camera.on("viewMatrix",function(){_this67._vpDirty=true;_this67._needUpdate(0);// No lag
15996
15996
  });_this67._onProjMatrix=scene.camera.on("projMatrix",function(){_this67._cpDirty=true;_this67._needUpdate();});_this67._onCanvasBoundary=scene.canvas.on("boundary",function(){_this67._cpDirty=true;_this67._needUpdate(0);// No lag
@@ -21911,7 +21911,7 @@ if(pickedSubs||pickedNothingSubs||pickedSurfaceSubs){pickController.pickCursorPo
21911
21911
  pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo;pickController.schedulePickSurface=pickedSurfaceSubs;pickController.update();var firstClickPickResult=pickController.pickResult;var firstClickPickSurface=pickController.pickedSurface;_this93._timeout=setTimeout(function(){if(firstClickPickResult){cameraControl.fire("picked",firstClickPickResult,true);if(firstClickPickSurface){cameraControl.fire("pickedSurface",firstClickPickResult,true);if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.setPivotPos(firstClickPickResult.worldPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("pickedNothing",{canvasPos:states.pointerCanvasPos},true);}_this93._clicks=0;},configs.doubleClickTimeFrame);}else{// Second click
21912
21912
  if(_this93._timeout!==null){window.clearTimeout(_this93._timeout);_this93._timeout=null;}pickController.pickCursorPos=states.pointerCanvasPos;pickController.schedulePickEntity=configs.doublePickFlyTo||doublePickedSubs||doublePickedSurfaceSubs;pickController.schedulePickSurface=pickController.schedulePickEntity&&doublePickedSurfaceSubs;pickController.update();if(pickController.pickResult){cameraControl.fire("doublePicked",pickController.pickResult,true);if(pickController.pickedSurface){cameraControl.fire("doublePickedSurface",pickController.pickResult,true);}if(configs.doublePickFlyTo){flyCameraTo(pickController.pickResult);if(!configs.firstPerson&&configs.followPointer){var pickedEntityAABB=pickController.pickResult.entity.aabb;var pickedEntityCenterPos=math.getAABB3Center(pickedEntityAABB);controllers.pivotController.setPivotPos(pickedEntityCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}else{cameraControl.fire("doublePickedNothing",{canvasPos:states.pointerCanvasPos},true);if(configs.doublePickFlyTo){flyCameraTo();if(!configs.firstPerson&&configs.followPointer){var sceneAABB=scene.aabb;var sceneCenterPos=math.getAABB3Center(sceneAABB);controllers.pivotController.setPivotPos(sceneCenterPos);if(controllers.pivotController.startPivot()){controllers.pivotController.showPivot();}}}}_this93._clicks=0;}},false);}_createClass(MousePickHandler,[{key:"reset",value:function reset(){this._clicks=0;this._lastPickedEntityId=null;if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}},{key:"destroy",value:function destroy(){var canvas=this._scene.canvas.canvas;canvas.removeEventListener("mousemove",this._canvasMouseMoveHandler);canvas.removeEventListener("mousedown",this._canvasMouseDownHandler);document.removeEventListener("mouseup",this._documentMouseUpHandler);canvas.removeEventListener("mouseup",this._canvasMouseUpHandler);if(this._timeout){window.clearTimeout(this._timeout);this._timeout=null;}}}]);return MousePickHandler;}();/**
21913
21913
  * @private
21914
- */var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];var canvas=scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}keyDownMap[keyCode]=true;if(keyCode===input.KEY_SHIFT){canvas.style.cursor="move";}});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}keyDownMap[keyCode]=false;if(keyCode===input.KEY_SHIFT){canvas.style.cursor=null;}});this._onTick=scene.on("tick",function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}var cameraControl=controllers.cameraControl;var elapsedSecs=e.deltaTime/1000.0;//-------------------------------------------------------------------------------------------------
21914
+ */var KeyboardPanRotateDollyHandler=/*#__PURE__*/function(){function KeyboardPanRotateDollyHandler(scene,controllers,configs,states,updates){_classCallCheck(this,KeyboardPanRotateDollyHandler);this._scene=scene;var input=scene.input;var keyDownMap=[];var canvas=scene.canvas.canvas;var mouseMovedSinceLastKeyboardDolly=true;this._onSceneMouseMove=input.on("mousemove",function(){mouseMovedSinceLastKeyboardDolly=true;});this._onSceneKeyDown=input.on("keydown",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}keyDownMap[keyCode]=true;if(keyCode===input.KEY_SHIFT){canvas.style.cursor="move";}});this._onSceneKeyUp=input.on("keyup",function(keyCode){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}keyDownMap[keyCode]=false;if(keyCode===input.KEY_SHIFT){canvas.style.cursor=null;}});this._onTick=scene.on("tick",function(e){if(!(configs.active&&configs.pointerEnabled)||!scene.input.keyboardEnabled){return;}if(!states.mouseover){return;}var cameraControl=controllers.cameraControl;var elapsedSecs=e.deltaTime/1000.0;//-------------------------------------------------------------------------------------------------
21915
21915
  // Keyboard rotation
21916
21916
  //-------------------------------------------------------------------------------------------------
21917
21917
  if(!configs.planView){var rotateYPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_POS,keyDownMap);var rotateYNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_Y_NEG,keyDownMap);var rotateXPos=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_POS,keyDownMap);var rotateXNeg=cameraControl._isKeyDownForAction(cameraControl.ROTATE_X_NEG,keyDownMap);var orbitDelta=elapsedSecs*configs.keyboardRotationRate;if(rotateYPos||rotateYNeg||rotateXPos||rotateXNeg){if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}if(rotateYPos){updates.rotateDeltaY+=orbitDelta;}else if(rotateYNeg){updates.rotateDeltaY-=orbitDelta;}if(rotateXPos){updates.rotateDeltaX+=orbitDelta;}else if(rotateXNeg){updates.rotateDeltaX-=orbitDelta;}if(!configs.firstPerson&&configs.followPointer){controllers.pivotController.startPivot();}}}//-------------------------------------------------------------------------------------------------