@itwin/core-frontend 4.9.0-dev.9 → 4.10.0-dev.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/lib/cjs/AccuDraw.d.ts +7 -0
  3. package/lib/cjs/AccuDraw.d.ts.map +1 -1
  4. package/lib/cjs/AccuDraw.js +16 -8
  5. package/lib/cjs/AccuDraw.js.map +1 -1
  6. package/lib/cjs/PlanarClipMaskState.d.ts +2 -3
  7. package/lib/cjs/PlanarClipMaskState.d.ts.map +1 -1
  8. package/lib/cjs/PlanarClipMaskState.js +7 -7
  9. package/lib/cjs/PlanarClipMaskState.js.map +1 -1
  10. package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.d.ts.map +1 -1
  11. package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js +18 -35
  12. package/lib/cjs/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
  13. package/lib/cjs/render/webgl/PlanarClassifier.js +3 -3
  14. package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
  15. package/lib/cjs/render/webgl/glsl/PlanarClassification.js +1 -1
  16. package/lib/cjs/render/webgl/glsl/PlanarClassification.js.map +1 -1
  17. package/lib/cjs/tile/RealityModelTileTree.d.ts.map +1 -1
  18. package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
  19. package/lib/cjs/tile/RenderGraphicTileTree.d.ts +2 -0
  20. package/lib/cjs/tile/RenderGraphicTileTree.d.ts.map +1 -1
  21. package/lib/cjs/tile/RenderGraphicTileTree.js +2 -0
  22. package/lib/cjs/tile/RenderGraphicTileTree.js.map +1 -1
  23. package/lib/cjs/tile/TileTreeReference.d.ts +13 -5
  24. package/lib/cjs/tile/TileTreeReference.d.ts.map +1 -1
  25. package/lib/cjs/tile/TileTreeReference.js +13 -5
  26. package/lib/cjs/tile/TileTreeReference.js.map +1 -1
  27. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +5 -1
  28. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  29. package/lib/cjs/tile/map/MapLayerImageryProvider.js +5 -1
  30. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  31. package/lib/cjs/tile/map/MapTileTree.d.ts +1 -1
  32. package/lib/cjs/tile/map/MapTileTree.js +1 -1
  33. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  34. package/lib/cjs/tools/AccuDrawTool.d.ts +34 -22
  35. package/lib/cjs/tools/AccuDrawTool.d.ts.map +1 -1
  36. package/lib/cjs/tools/AccuDrawTool.js +151 -88
  37. package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
  38. package/lib/esm/AccuDraw.d.ts +7 -0
  39. package/lib/esm/AccuDraw.d.ts.map +1 -1
  40. package/lib/esm/AccuDraw.js +16 -8
  41. package/lib/esm/AccuDraw.js.map +1 -1
  42. package/lib/esm/PlanarClipMaskState.d.ts +2 -3
  43. package/lib/esm/PlanarClipMaskState.d.ts.map +1 -1
  44. package/lib/esm/PlanarClipMaskState.js +7 -7
  45. package/lib/esm/PlanarClipMaskState.js.map +1 -1
  46. package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.d.ts.map +1 -1
  47. package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js +18 -35
  48. package/lib/esm/common/internal/render/GraphicDescriptionBuilderImpl.js.map +1 -1
  49. package/lib/esm/render/webgl/PlanarClassifier.js +3 -3
  50. package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
  51. package/lib/esm/render/webgl/glsl/PlanarClassification.js +1 -1
  52. package/lib/esm/render/webgl/glsl/PlanarClassification.js.map +1 -1
  53. package/lib/esm/tile/RealityModelTileTree.d.ts.map +1 -1
  54. package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
  55. package/lib/esm/tile/RenderGraphicTileTree.d.ts +2 -0
  56. package/lib/esm/tile/RenderGraphicTileTree.d.ts.map +1 -1
  57. package/lib/esm/tile/RenderGraphicTileTree.js +2 -0
  58. package/lib/esm/tile/RenderGraphicTileTree.js.map +1 -1
  59. package/lib/esm/tile/TileTreeReference.d.ts +13 -5
  60. package/lib/esm/tile/TileTreeReference.d.ts.map +1 -1
  61. package/lib/esm/tile/TileTreeReference.js +13 -5
  62. package/lib/esm/tile/TileTreeReference.js.map +1 -1
  63. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +5 -1
  64. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts.map +1 -1
  65. package/lib/esm/tile/map/MapLayerImageryProvider.js +5 -1
  66. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  67. package/lib/esm/tile/map/MapTileTree.d.ts +1 -1
  68. package/lib/esm/tile/map/MapTileTree.js +1 -1
  69. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  70. package/lib/esm/tools/AccuDrawTool.d.ts +34 -22
  71. package/lib/esm/tools/AccuDrawTool.d.ts.map +1 -1
  72. package/lib/esm/tools/AccuDrawTool.js +151 -89
  73. package/lib/esm/tools/AccuDrawTool.js.map +1 -1
  74. package/lib/public/locales/en/CoreTools.json +5 -0
  75. package/lib/public/scripts/parse-imdl-worker.js +1 -1
  76. package/lib/workers/webpack/parse-imdl-worker.js +1 -1
  77. package/package.json +19 -19
@@ -905,21 +905,30 @@ export class AccuDraw {
905
905
  const rMatrix = this.getRotation();
906
906
  rMatrix.multiplyTransposeVector(this.vector);
907
907
  }
908
+ /** Allow the AccuDraw user interface to supply the distance parser */
909
+ getLengthParser() {
910
+ return IModelApp.quantityFormatter.findParserSpecByQuantityType(QuantityType.Length);
911
+ }
908
912
  stringToDistance(str) {
909
- const parserSpec = IModelApp.quantityFormatter.findParserSpecByQuantityType(QuantityType.Length);
913
+ const parserSpec = this.getLengthParser();
910
914
  if (parserSpec)
911
915
  return parserSpec.parseToQuantityValue(str);
912
916
  return { ok: false, error: ParseError.InvalidParserSpec };
913
917
  }
918
+ /** Allow the AccuDraw user interface to specify bearing */
919
+ get isBearingMode() { return false; }
920
+ /** Allow the AccuDraw user interface to supply the angle/direction parser */
921
+ getAngleParser() {
922
+ // TODO: Use QuantityType.Angle when isBearingMode=false and "Bearing" for isBearingMode=true.
923
+ return IModelApp.quantityFormatter.findParserSpecByQuantityType(QuantityType.Angle);
924
+ }
914
925
  stringToAngle(inString) {
915
- // Need to update once there is an official "Bearing" QuantityType. Once available then
916
- // use QuantityType.Angle for isBearing=false and "Bearing" for isBearing=true.
917
- const parserSpec = IModelApp.quantityFormatter.findParserSpecByQuantityType(QuantityType.Angle);
926
+ const parserSpec = this.getAngleParser();
918
927
  if (parserSpec)
919
928
  return parserSpec.parseToQuantityValue(inString);
920
929
  return { ok: false, error: ParseError.InvalidParserSpec };
921
930
  }
922
- updateFieldValue(index, input, _out) {
931
+ updateFieldValue(index, input) {
923
932
  if (input.length === 0)
924
933
  return BentleyStatus.ERROR;
925
934
  if (input.length === 1)
@@ -1062,8 +1071,7 @@ export class AccuDraw {
1062
1071
  }
1063
1072
  /** Call from an AccuDraw UI event to sync the supplied input field value */
1064
1073
  async processFieldInput(index, input, synchText) {
1065
- const isBearing = false;
1066
- if (BentleyStatus.SUCCESS !== this.updateFieldValue(index, input, { isBearing })) {
1074
+ if (BentleyStatus.SUCCESS !== this.updateFieldValue(index, input)) {
1067
1075
  const saveKeyinStatus = this._keyinStatus[index]; // Don't want this to change when entering '.', etc.
1068
1076
  this.updateFieldLock(index, false);
1069
1077
  this._keyinStatus[index] = saveKeyinStatus;
@@ -1080,7 +1088,7 @@ export class AccuDraw {
1080
1088
  this.onFieldValueChange(index);
1081
1089
  this.setKeyinStatus(index, KeyinStatus.Dynamic);
1082
1090
  }
1083
- if (!isBearing || !this.flags.bearingFixToPlane2D)
1091
+ if (!this.isBearingMode || !this.flags.bearingFixToPlane2D)
1084
1092
  this.updateVector(this._angle);
1085
1093
  else
1086
1094
  this.vector.set(Math.cos(this._angle), Math.sin(this._angle), 0.0);