@xtctwins/tctwins-core 1.0.21 → 1.0.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.
@@ -11012,11 +11012,13 @@ class Label {
11012
11012
  style.color = "white";
11013
11013
  style.padding = "4px";
11014
11014
  style.border = "solid 1px";
11015
+ style.borderRadius = "20px";
11015
11016
  style.background = "lightgreen";
11016
11017
  style.position = "absolute";
11017
11018
  style["z-index"] = cfg.zIndex === undefined ? "5000005" : cfg.zIndex;
11018
11019
  style.width = "auto";
11019
11020
  style.height = "auto";
11021
+ style.fontSize = "14px";
11020
11022
  style.visibility = "visible";
11021
11023
  style.top = 0 + "px";
11022
11024
  style.left = 0 + "px";
@@ -11186,7 +11188,7 @@ class AngleMeasurement extends Component {
11186
11188
  }
11187
11189
 
11188
11190
  this._color = cfg.color ? cfg.color : plugin.defaultColor;
11189
- this._borderColor = cfg.borderColor ? cfg.borderColor : "white";
11191
+ this._borderColor = plugin.defaultColor ? plugin.defaultColor : "white";
11190
11192
  var scene = this.plugin.viewer.scene;
11191
11193
 
11192
11194
  this._originMarker = new Marker(scene, cfg.origin);
@@ -12011,7 +12013,8 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
12011
12013
  *
12012
12014
  * @param {AngleMeasurementsPlugin} angleMeasurementsPlugin The AngleMeasurementsPlugin to control.
12013
12015
  * @param {*} [cfg] Configuration
12014
- * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
12016
+ * @param {container} [cfg.container] container that hold myAnglePivotMarker
12017
+ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-space coordinates to page coordinates.
12015
12018
  * @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
12016
12019
  * @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
12017
12020
  * @param {_offsetX} [cfg._offsetX] _offsetX of the mouse
@@ -12019,6 +12022,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
12019
12022
  * */
12020
12023
  constructor(angleMeasurementsPlugin, cfg = {}) {
12021
12024
  super(angleMeasurementsPlugin.viewer.scene);
12025
+ this.cfg = cfg;
12022
12026
 
12023
12027
  this._canvasToPagePos = cfg.canvasToPagePos;
12024
12028
 
@@ -12050,7 +12054,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
12050
12054
 
12051
12055
  _initMarkerDiv() {
12052
12056
  const markerDiv = document.createElement("div");
12053
- markerDiv.setAttribute("id", "myAngleMeasureMarker");
12057
+ markerDiv.setAttribute("id", "myAnglePivotMarker");
12054
12058
  const canvas = this.scene.canvas.canvas;
12055
12059
  canvas.parentNode.insertBefore(markerDiv, canvas);
12056
12060
 
@@ -12069,7 +12073,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
12069
12073
 
12070
12074
  _destroyMarkerDiv() {
12071
12075
  if (this.markerDiv) {
12072
- const element = document.getElementById("myAngleMeasureMarker");
12076
+ const element = document.getElementById("myAnglePivotMarker");
12073
12077
  element.parentNode.removeChild(element);
12074
12078
  this._markerDiv = null;
12075
12079
  }
@@ -13039,6 +13043,12 @@ const TOUCH_CANCELING$1 = 7;
13039
13043
  class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
13040
13044
  /**
13041
13045
  * Creates a AngleMeasurementsTouchControl bound to the given AngleMeasurementsPlugin.
13046
+ * @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
13047
+ * @param {container} [cfg.container] container that hold myDistancePivotMarker_touch
13048
+ * @param {boolean} [cfg.snapToEdge=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
13049
+ * @param {boolean} [cfg.snapToVertex=true] Whether to initially enable snap-to-vertex and snap-to-edge for this AngleMeasurementsMouseControl.
13050
+ * @param {_offsetX} [cfg._offsetX] _offsetX of the mouse
13051
+ * @param {_offsetY} [cfg._offsetY] _offsetY of the mouse
13042
13052
  */
13043
13053
  constructor(angleMeasurementsPlugin, cfg = {}) {
13044
13054
  super(angleMeasurementsPlugin.viewer.scene);
@@ -13049,6 +13059,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
13049
13059
  this._active = false;
13050
13060
 
13051
13061
  const markerDiv = document.createElement("div");
13062
+ markerDiv.setAttribute("id", "myDistancePivotMarker_touch");
13052
13063
  const canvas = this.scene.canvas.canvas;
13053
13064
  canvas.parentNode.insertBefore(markerDiv, canvas);
13054
13065
 
@@ -15149,7 +15160,11 @@ class Spinner extends Component {
15149
15160
  <div class="sk-circle12 sk-circle"></div>\
15150
15161
  </div>';
15151
15162
  element.setAttribute("class", "loading-circle");
15152
- this._canvas.parentElement.appendChild(element);
15163
+ if (this._canvas.parentElement) this._canvas.parentElement.appendChild(element);
15164
+ else {
15165
+ const viewer = document.getElementById("myViewer");
15166
+ viewer.appendChild(element);
15167
+ }
15153
15168
  this._element = element;
15154
15169
  this._isCustom = false;
15155
15170
  this._adjustPosition();
@@ -15166,7 +15181,11 @@ class Spinner extends Component {
15166
15181
  const defaultCSSNode = document.createElement("style");
15167
15182
  defaultCSSNode.innerHTML = defaultCSS;
15168
15183
  defaultCSSNode.id = elementId;
15169
- this._canvas.parentElement.appendChild(defaultCSSNode);
15184
+ if (this._canvas.parentElement) this._canvas.parentElement.appendChild(defaultCSSNode);
15185
+ else {
15186
+ const viewer = document.getElementById("myViewer");
15187
+ viewer.appendChild(defaultCSSNode);
15188
+ }
15170
15189
  }
15171
15190
 
15172
15191
  /**
@@ -85813,7 +85832,7 @@ class DistanceMeasurement extends Component {
85813
85832
  this._eventSubs = {};
85814
85833
 
85815
85834
  this._color = cfg.color ? cfg.color : plugin.defaultColor;
85816
- this._borderColor = cfg.borderColor ? cfg.borderColor : "white";
85835
+ this._borderColor = plugin.defaultColor ? plugin.defaultColor : "white";
85817
85836
  var scene = this.plugin.viewer.scene;
85818
85837
 
85819
85838
  this._originMarker = new Marker(scene, cfg.origin);
@@ -86898,6 +86917,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
86898
86917
  *
86899
86918
  * @param {DistanceMeasurementsPlugin} distanceMeasurementsPlugin The AngleMeasurementsPlugin to control.
86900
86919
  * @param [cfg] Configuration
86920
+ * @param {container} [cfg.container] container that hold myDistancePivotMarker
86901
86921
  * @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
86902
86922
  * @param {boolean} [cfg.snapping=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsMouseControl.
86903
86923
  * @param {_offsetX} [cfg._offsetX] _offsetX of the mouse
@@ -86906,6 +86926,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
86906
86926
 
86907
86927
  constructor(distanceMeasurementsPlugin, cfg = {}) {
86908
86928
  super(distanceMeasurementsPlugin.viewer.scene);
86929
+ this.cfg = cfg;
86909
86930
 
86910
86931
  this.pointerLens = cfg.pointerLens;
86911
86932
 
@@ -86941,7 +86962,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
86941
86962
 
86942
86963
  _initMarkerDiv() {
86943
86964
  const markerDiv = document.createElement("div");
86944
- markerDiv.setAttribute("id", "myDistanceMarker");
86965
+ markerDiv.setAttribute("id", "myDistancePivotMarker");
86945
86966
  const canvas = this.scene.canvas.canvas;
86946
86967
  canvas.parentNode.insertBefore(markerDiv, canvas);
86947
86968
  markerDiv.style.background = "black";
@@ -86959,7 +86980,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
86959
86980
 
86960
86981
  _destroyMarkerDiv() {
86961
86982
  if (this._markerDiv) {
86962
- const element = document.getElementById("myDistanceMarker");
86983
+ const element = document.getElementById("myDistancePivotMarker");
86963
86984
  element.parentNode.removeChild(element);
86964
86985
  this._markerDiv = null;
86965
86986
  }
@@ -87870,6 +87891,12 @@ const TOUCH_CANCELING = 7;
87870
87891
  class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
87871
87892
  /**
87872
87893
  * Creates a DistanceMeasurementsTouchControl bound to the given DistanceMeasurementsPlugin.
87894
+ * @param {PointerLens} [cfg.pointerLens] A PointerLens to use to provide a magnified view of the cursor when snapping is enabled.
87895
+ * @param {container} [cfg.container] container that hold myDistancePivotMarker_touch
87896
+ * @param {boolean} [cfg.snapToEdge=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsTouchControl.
87897
+ * @param {boolean} [cfg.snapToVertex=true] Whether to initially enable snap-to-vertex and snap-to-edge for this DistanceMeasurementsTouchControl.
87898
+ * @param {_offsetX} [cfg._offsetX] _offsetX of the mouse
87899
+ * @param {_offsetY} [cfg._offsetY] _offsetY of the mouse
87873
87900
  */
87874
87901
  constructor(distanceMeasurementsPlugin, cfg = {}) {
87875
87902
  super(distanceMeasurementsPlugin.viewer.scene);
@@ -87881,6 +87908,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
87881
87908
  this._active = false;
87882
87909
 
87883
87910
  const markerDiv = document.createElement("div");
87911
+ markerDiv.setAttribute("id", "myDistancePivotMarker_touch");
87884
87912
  const canvas = this.scene.canvas.canvas;
87885
87913
  canvas.parentNode.insertBefore(markerDiv, canvas);
87886
87914