@itwin/ecschema-rpcinterface-tests 5.0.0-dev.111 → 5.0.0-dev.113
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/lib/dist/bundled-tests.js +580 -229
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -59183,13 +59183,13 @@ var CurrentImdlVersion;
|
|
|
59183
59183
|
* front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
|
|
59184
59184
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
59185
59185
|
*/
|
|
59186
|
-
CurrentImdlVersion[CurrentImdlVersion["Major"] =
|
|
59186
|
+
CurrentImdlVersion[CurrentImdlVersion["Major"] = 37] = "Major";
|
|
59187
59187
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
59188
59188
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
59189
59189
|
*/
|
|
59190
59190
|
CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
|
|
59191
59191
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
59192
|
-
CurrentImdlVersion[CurrentImdlVersion["Combined"] =
|
|
59192
|
+
CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2424832] = "Combined";
|
|
59193
59193
|
})(CurrentImdlVersion || (CurrentImdlVersion = {}));
|
|
59194
59194
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
59195
59195
|
* @internal
|
|
@@ -59534,6 +59534,7 @@ var TileOptions;
|
|
|
59534
59534
|
disableMagnification: false,
|
|
59535
59535
|
alwaysSubdivideIncompleteTiles: false,
|
|
59536
59536
|
edgeOptions,
|
|
59537
|
+
disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),
|
|
59537
59538
|
};
|
|
59538
59539
|
}
|
|
59539
59540
|
TileOptions.fromTreeIdAndContentId = fromTreeIdAndContentId;
|
|
@@ -59568,14 +59569,15 @@ class Parser {
|
|
|
59568
59569
|
}
|
|
59569
59570
|
if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key] === "number" && !Number.isFinite(parsedContentId[key])))
|
|
59570
59571
|
throw new Error("Invalid content Id");
|
|
59572
|
+
const disablePolyfaceDecimation = options.disablePolyfaceDecimation;
|
|
59571
59573
|
let treeId;
|
|
59572
59574
|
if (classifier) {
|
|
59573
|
-
treeId = { ...classifier, animationId };
|
|
59575
|
+
treeId = { ...classifier, animationId, disablePolyfaceDecimation };
|
|
59574
59576
|
}
|
|
59575
59577
|
else {
|
|
59576
59578
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== primary);
|
|
59577
59579
|
const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;
|
|
59578
|
-
treeId = { ...primary, animationId, type: _FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.Primary, enforceDisplayPriority };
|
|
59580
|
+
treeId = { ...primary, animationId, type: _FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };
|
|
59579
59581
|
}
|
|
59580
59582
|
return {
|
|
59581
59583
|
contentId: parsedContentId,
|
|
@@ -59678,6 +59680,7 @@ const defaultTileOptions = Object.freeze({
|
|
|
59678
59680
|
useLargerTiles: true,
|
|
59679
59681
|
disableMagnification: false,
|
|
59680
59682
|
alwaysSubdivideIncompleteTiles: false,
|
|
59683
|
+
disablePolyfaceDecimation: false,
|
|
59681
59684
|
edgeOptions: {
|
|
59682
59685
|
type: "compact",
|
|
59683
59686
|
smooth: true,
|
|
@@ -59773,7 +59776,8 @@ var TreeFlags;
|
|
|
59773
59776
|
TreeFlags[TreeFlags["EnforceDisplayPriority"] = 2] = "EnforceDisplayPriority";
|
|
59774
59777
|
TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
|
|
59775
59778
|
TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
|
|
59776
|
-
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents";
|
|
59779
|
+
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents";
|
|
59780
|
+
TreeFlags[TreeFlags["DisablePolyfaceDecimation"] = 32] = "DisablePolyfaceDecimation";
|
|
59777
59781
|
})(TreeFlags || (TreeFlags = {}));
|
|
59778
59782
|
function animationIdToString(animationId) {
|
|
59779
59783
|
return `A:${animationId}_`;
|
|
@@ -59786,6 +59790,8 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
59786
59790
|
let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;
|
|
59787
59791
|
if (options.optimizeBRepProcessing)
|
|
59788
59792
|
flags |= TreeFlags.OptimizeBRepProcessing;
|
|
59793
|
+
if (options.disablePolyfaceDecimation)
|
|
59794
|
+
flags |= TreeFlags.DisablePolyfaceDecimation;
|
|
59789
59795
|
if (options.useLargerTiles)
|
|
59790
59796
|
flags |= TreeFlags.UseLargerTiles;
|
|
59791
59797
|
if (options.expandProjectExtents)
|
|
@@ -69908,6 +69914,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
69908
69914
|
|
|
69909
69915
|
|
|
69910
69916
|
|
|
69917
|
+
const loggerCategory = "SchemaFormatsProvider";
|
|
69911
69918
|
/**
|
|
69912
69919
|
* Provides default formats and kind of quantities from a given SchemaContext or SchemaLocater.
|
|
69913
69920
|
* @beta
|
|
@@ -69946,7 +69953,14 @@ class SchemaFormatsProvider {
|
|
|
69946
69953
|
this.onFormatsChanged.raiseEvent({ formatsChanged });
|
|
69947
69954
|
}
|
|
69948
69955
|
async getKindOfQuantityFormatFromSchema(itemKey) {
|
|
69949
|
-
|
|
69956
|
+
let kindOfQuantity;
|
|
69957
|
+
try {
|
|
69958
|
+
kindOfQuantity = await this._context.getSchemaItem(itemKey, _Metadata_KindOfQuantity__WEBPACK_IMPORTED_MODULE_5__.KindOfQuantity);
|
|
69959
|
+
}
|
|
69960
|
+
catch {
|
|
69961
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.Logger.logError(loggerCategory, `Failed to find KindOfQuantity ${itemKey.fullName}`);
|
|
69962
|
+
return undefined;
|
|
69963
|
+
}
|
|
69950
69964
|
if (!kindOfQuantity) {
|
|
69951
69965
|
return undefined;
|
|
69952
69966
|
}
|
|
@@ -69991,13 +70005,27 @@ class SchemaFormatsProvider {
|
|
|
69991
70005
|
async getFormat(name) {
|
|
69992
70006
|
const [schemaName, schemaItemName] = _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_2__.SchemaItem.parseFullName(name);
|
|
69993
70007
|
const schemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaKey(schemaName);
|
|
69994
|
-
|
|
70008
|
+
let schema;
|
|
70009
|
+
try {
|
|
70010
|
+
schema = await this._context.getSchema(schemaKey);
|
|
70011
|
+
}
|
|
70012
|
+
catch {
|
|
70013
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.Logger.logError(loggerCategory, `Failed to find schema ${schemaName}`);
|
|
70014
|
+
return undefined;
|
|
70015
|
+
}
|
|
69995
70016
|
if (!schema) {
|
|
69996
70017
|
return undefined;
|
|
69997
70018
|
}
|
|
69998
70019
|
const itemKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaItemKey(schemaItemName, schema.schemaKey);
|
|
69999
70020
|
if (schema.name === "Formats") {
|
|
70000
|
-
|
|
70021
|
+
let format;
|
|
70022
|
+
try {
|
|
70023
|
+
format = await this._context.getSchemaItem(itemKey, _Metadata_Format__WEBPACK_IMPORTED_MODULE_3__.Format);
|
|
70024
|
+
}
|
|
70025
|
+
catch {
|
|
70026
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.Logger.logError(loggerCategory, `Failed to find Format ${itemKey.fullName}`);
|
|
70027
|
+
return undefined;
|
|
70028
|
+
}
|
|
70001
70029
|
if (!format) {
|
|
70002
70030
|
return undefined;
|
|
70003
70031
|
}
|
|
@@ -72027,20 +72055,16 @@ class ECSchemaRpcLocater {
|
|
|
72027
72055
|
return undefined;
|
|
72028
72056
|
}
|
|
72029
72057
|
/**
|
|
72030
|
-
*
|
|
72031
|
-
*
|
|
72032
|
-
* @param
|
|
72033
|
-
* @param
|
|
72058
|
+
* This method is not supported for locating schemas over RPC/HTTP.
|
|
72059
|
+
* Use the asynchronous `getSchema` method instead.
|
|
72060
|
+
* @param _schemaKey Key to look up
|
|
72061
|
+
* @param _matchType How to match key against candidate schemas
|
|
72062
|
+
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
72063
|
+
* @throws Error Always throws an error indicating this method is not supported.
|
|
72064
|
+
* @deprecated in 5.0 Use the asynchronous `getSchema` method for schema retrieval.
|
|
72034
72065
|
*/
|
|
72035
|
-
getSchemaSync(
|
|
72036
|
-
|
|
72037
|
-
return props;
|
|
72038
|
-
});
|
|
72039
|
-
const schema = _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.fromJsonSync(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
|
|
72040
|
-
if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
|
|
72041
|
-
return schema;
|
|
72042
|
-
}
|
|
72043
|
-
return undefined;
|
|
72066
|
+
getSchemaSync(_schemaKey, _matchType, _context) {
|
|
72067
|
+
throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
|
|
72044
72068
|
}
|
|
72045
72069
|
}
|
|
72046
72070
|
|
|
@@ -74255,6 +74279,8 @@ class AccuDraw {
|
|
|
74255
74279
|
onFieldKeyinStatusChange(_index) { }
|
|
74256
74280
|
/** Called to request focus change to the specified input field */
|
|
74257
74281
|
setFocusItem(_index) { }
|
|
74282
|
+
/** Called to get the item field that currently has input focus */
|
|
74283
|
+
getFocusItem() { return undefined; }
|
|
74258
74284
|
static getMinPolarMag(origin) {
|
|
74259
74285
|
return (1.0e-12 * (1.0 + origin.magnitude()));
|
|
74260
74286
|
}
|
|
@@ -83581,7 +83607,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
83581
83607
|
|
|
83582
83608
|
/** @public */
|
|
83583
83609
|
const ITWINJS_CORE_VERSION = _package_json__WEBPACK_IMPORTED_MODULE_0__.version;
|
|
83584
|
-
const COPYRIGHT_NOTICE =
|
|
83610
|
+
const COPYRIGHT_NOTICE = `Copyright © 2017-${new Date().getFullYear()} <a href="https://www.bentley.com" target="_blank" rel="noopener noreferrer">Bentley Systems, Inc.</a>`;
|
|
83585
83611
|
|
|
83586
83612
|
|
|
83587
83613
|
|
|
@@ -83657,6 +83683,7 @@ class IModelApp {
|
|
|
83657
83683
|
static _hubAccess;
|
|
83658
83684
|
static _realityDataAccess;
|
|
83659
83685
|
static _publicPath;
|
|
83686
|
+
static _formatsProviderManager;
|
|
83660
83687
|
// No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.
|
|
83661
83688
|
constructor() { }
|
|
83662
83689
|
/** Event raised just before the frontend IModelApp is to be [[shutdown]]. */
|
|
@@ -83731,6 +83758,14 @@ class IModelApp {
|
|
|
83731
83758
|
* The path should always end with a trailing `/`.
|
|
83732
83759
|
*/
|
|
83733
83760
|
static get publicPath() { return this._publicPath; }
|
|
83761
|
+
/** The [[FormatsProvider]] for this session.
|
|
83762
|
+
* @param provider The provider to use for formatting quantities.
|
|
83763
|
+
* @beta
|
|
83764
|
+
*/
|
|
83765
|
+
static get formatsProvider() { return this._formatsProviderManager; }
|
|
83766
|
+
static set formatsProvider(provider) {
|
|
83767
|
+
this._formatsProviderManager.formatsProvider = provider;
|
|
83768
|
+
}
|
|
83734
83769
|
/** @alpha */
|
|
83735
83770
|
static extensionAdmin = this._createExtensionAdmin();
|
|
83736
83771
|
/** Map of classFullName to EntityState class */
|
|
@@ -83831,6 +83866,7 @@ class IModelApp {
|
|
|
83831
83866
|
this._terrainProviderRegistry = new _tile_internal__WEBPACK_IMPORTED_MODULE_26__.TerrainProviderRegistry();
|
|
83832
83867
|
this._realityDataSourceProviders = new _RealityDataSource__WEBPACK_IMPORTED_MODULE_25__.RealityDataSourceProviderRegistry();
|
|
83833
83868
|
this._realityDataAccess = opts.realityDataAccess;
|
|
83869
|
+
this._formatsProviderManager = new _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_19__.FormatsProviderManager(opts.formatsProvider ?? new _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_19__.QuantityTypeFormatsProvider());
|
|
83834
83870
|
this._publicPath = opts.publicPath ?? "";
|
|
83835
83871
|
[
|
|
83836
83872
|
this.renderSystem,
|
|
@@ -83862,6 +83898,8 @@ class IModelApp {
|
|
|
83862
83898
|
this._entityClasses.clear();
|
|
83863
83899
|
this.authorizationClient = undefined;
|
|
83864
83900
|
this._initialized = false;
|
|
83901
|
+
this.quantityFormatter[Symbol.dispose]();
|
|
83902
|
+
this.resetFormatsProvider();
|
|
83865
83903
|
this.onAfterStartup.clear();
|
|
83866
83904
|
}
|
|
83867
83905
|
/** Controls how frequently the application polls for changes that may require a new animation frame to be requested.
|
|
@@ -84112,6 +84150,13 @@ class IModelApp {
|
|
|
84112
84150
|
}
|
|
84113
84151
|
return this.localization.getLocalizedString(`iModelJs:${key.scope}.${key.val}`, key);
|
|
84114
84152
|
}
|
|
84153
|
+
/**
|
|
84154
|
+
* Resets the formatsProvider back to the default [[QuantityTypeFormatsProvider]].
|
|
84155
|
+
* @beta
|
|
84156
|
+
*/
|
|
84157
|
+
static resetFormatsProvider() {
|
|
84158
|
+
this.formatsProvider = new _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_19__.QuantityTypeFormatsProvider();
|
|
84159
|
+
}
|
|
84115
84160
|
/**
|
|
84116
84161
|
* Creates an instance of the ExtensionAdmin
|
|
84117
84162
|
* and registers an event to execute after startup is complete
|
|
@@ -91642,16 +91687,21 @@ class RenderContext {
|
|
|
91642
91687
|
* @public
|
|
91643
91688
|
*/
|
|
91644
91689
|
class DynamicsContext extends RenderContext {
|
|
91645
|
-
|
|
91690
|
+
_foreground;
|
|
91691
|
+
_overlay;
|
|
91646
91692
|
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
|
|
91647
91693
|
addGraphic(graphic) {
|
|
91648
|
-
|
|
91649
|
-
|
|
91650
|
-
|
|
91694
|
+
this.add(graphic, false);
|
|
91695
|
+
}
|
|
91696
|
+
/** @internal */
|
|
91697
|
+
add(graphic, isOverlay) {
|
|
91698
|
+
const key = isOverlay ? "_overlay" : "_foreground";
|
|
91699
|
+
const list = this[key] ?? (this[key] = []);
|
|
91700
|
+
list.push(graphic);
|
|
91651
91701
|
}
|
|
91652
91702
|
/** @internal */
|
|
91653
91703
|
changeDynamics() {
|
|
91654
|
-
this.viewport.changeDynamics(this.
|
|
91704
|
+
this.viewport.changeDynamics(this._foreground, this._overlay);
|
|
91655
91705
|
}
|
|
91656
91706
|
/** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].
|
|
91657
91707
|
* @param options Options describing how to create the builder.
|
|
@@ -92755,10 +92805,10 @@ class ViewManager {
|
|
|
92755
92805
|
this.inDynamicsMode = false;
|
|
92756
92806
|
const cursorVp = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.cursorView;
|
|
92757
92807
|
if (cursorVp)
|
|
92758
|
-
cursorVp.changeDynamics(undefined);
|
|
92808
|
+
cursorVp.changeDynamics(undefined, undefined);
|
|
92759
92809
|
for (const vp of this._viewports) {
|
|
92760
92810
|
if (vp !== cursorVp)
|
|
92761
|
-
vp.changeDynamics(undefined);
|
|
92811
|
+
vp.changeDynamics(undefined, undefined);
|
|
92762
92812
|
}
|
|
92763
92813
|
}
|
|
92764
92814
|
/** @internal */
|
|
@@ -96327,6 +96377,10 @@ class Viewport {
|
|
|
96327
96377
|
changeBackgroundMapProvider(props) {
|
|
96328
96378
|
this.displayStyle.changeBackgroundMapProvider(props);
|
|
96329
96379
|
}
|
|
96380
|
+
/** A reference to the [[TileTree]] used to display the background map in this viewport, if the background map is being displayed. */
|
|
96381
|
+
get backgroundMapTileTreeReference() {
|
|
96382
|
+
return this.backgroundMap;
|
|
96383
|
+
}
|
|
96330
96384
|
/** @internal */
|
|
96331
96385
|
get backgroundMap() { return this._mapTiledGraphicsProvider?.backgroundMap; }
|
|
96332
96386
|
/** @internal */
|
|
@@ -97056,8 +97110,8 @@ class Viewport {
|
|
|
97056
97110
|
return this.view.is3d() && this.view.isCameraOn;
|
|
97057
97111
|
}
|
|
97058
97112
|
/** @internal */
|
|
97059
|
-
changeDynamics(dynamics) {
|
|
97060
|
-
this.target.changeDynamics(dynamics);
|
|
97113
|
+
changeDynamics(dynamics, overlay) {
|
|
97114
|
+
this.target.changeDynamics(dynamics, overlay);
|
|
97061
97115
|
this.invalidateDecorations();
|
|
97062
97116
|
}
|
|
97063
97117
|
_assigningFlashedId = false;
|
|
@@ -106998,6 +107052,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
106998
107052
|
/* harmony export */ FlashMode: () => (/* reexport safe */ _FlashSettings__WEBPACK_IMPORTED_MODULE_22__.FlashMode),
|
|
106999
107053
|
/* harmony export */ FlashSettings: () => (/* reexport safe */ _FlashSettings__WEBPACK_IMPORTED_MODULE_22__.FlashSettings),
|
|
107000
107054
|
/* harmony export */ FlyViewTool: () => (/* reexport safe */ _tools_ViewTool__WEBPACK_IMPORTED_MODULE_114__.FlyViewTool),
|
|
107055
|
+
/* harmony export */ FormatsProviderManager: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.FormatsProviderManager),
|
|
107001
107056
|
/* harmony export */ FormattedQuantityDescription: () => (/* reexport safe */ _properties_FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_70__.FormattedQuantityDescription),
|
|
107002
107057
|
/* harmony export */ FrontendLoggerCategory: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory),
|
|
107003
107058
|
/* harmony export */ Frustum2d: () => (/* reexport safe */ _Frustum2d__WEBPACK_IMPORTED_MODULE_24__.Frustum2d),
|
|
@@ -107126,6 +107181,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
107126
107181
|
/* harmony export */ QuadId: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_99__.QuadId),
|
|
107127
107182
|
/* harmony export */ QuantityFormatter: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.QuantityFormatter),
|
|
107128
107183
|
/* harmony export */ QuantityType: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.QuantityType),
|
|
107184
|
+
/* harmony export */ QuantityTypeFormatsProvider: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.QuantityTypeFormatsProvider),
|
|
107129
107185
|
/* harmony export */ RealityDataError: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.RealityDataError),
|
|
107130
107186
|
/* harmony export */ RealityDataSource: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.RealityDataSource),
|
|
107131
107187
|
/* harmony export */ RealityDataSourceProviderRegistry: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.RealityDataSourceProviderRegistry),
|
|
@@ -108197,7 +108253,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
108197
108253
|
* @internal
|
|
108198
108254
|
*/
|
|
108199
108255
|
async function loadScript(jsUrl) {
|
|
108200
|
-
const module = await
|
|
108256
|
+
const module = await import(/* webpackIgnore: true */ /* @vite-ignore */ jsUrl);
|
|
108201
108257
|
return execute(module);
|
|
108202
108258
|
}
|
|
108203
108259
|
/** attempts to execute an extension module */
|
|
@@ -108647,7 +108703,7 @@ var MockRender;
|
|
|
108647
108703
|
get analysisFraction() { return 0; }
|
|
108648
108704
|
set analysisFraction(_fraction) { }
|
|
108649
108705
|
changeScene(_scene) { }
|
|
108650
|
-
changeDynamics(
|
|
108706
|
+
changeDynamics(_foreground, _overlay) { }
|
|
108651
108707
|
changeDecorations(_decs) { }
|
|
108652
108708
|
changeRenderPlan(_plan) { }
|
|
108653
108709
|
drawFrame(_sceneTime) { }
|
|
@@ -120737,9 +120793,8 @@ class RenderCommands {
|
|
|
120737
120793
|
this.addGraphics(gfx.foreground);
|
|
120738
120794
|
this.addBackgroundMapGraphics(gfx.background);
|
|
120739
120795
|
this.addOverlayGraphics(gfx.overlays);
|
|
120740
|
-
|
|
120741
|
-
|
|
120742
|
-
this.addDecorations(dynamics);
|
|
120796
|
+
this.addGraphics(gfx.foregroundDynamics);
|
|
120797
|
+
this.addOverlayGraphics(gfx.overlayDynamics);
|
|
120743
120798
|
const dec = gfx.decorations;
|
|
120744
120799
|
if (undefined !== dec) {
|
|
120745
120800
|
this.addBackground(dec.viewBackground);
|
|
@@ -127697,8 +127752,8 @@ class Target extends _render_RenderTarget__WEBPACK_IMPORTED_MODULE_7__.RenderTar
|
|
|
127697
127752
|
this.changeDrapesOrClassifiers(this._planarClassifiers, planarClassifiers);
|
|
127698
127753
|
this._planarClassifiers = planarClassifiers;
|
|
127699
127754
|
}
|
|
127700
|
-
changeDynamics(
|
|
127701
|
-
this.graphics.
|
|
127755
|
+
changeDynamics(foreground, overlay) {
|
|
127756
|
+
this.graphics.changeDynamics(foreground, overlay);
|
|
127702
127757
|
}
|
|
127703
127758
|
overrideFeatureSymbology(ovr) {
|
|
127704
127759
|
this.uniforms.branch.overrideFeatureSymbology(ovr);
|
|
@@ -128579,26 +128634,29 @@ class TargetGraphics {
|
|
|
128579
128634
|
foreground = [];
|
|
128580
128635
|
background = [];
|
|
128581
128636
|
overlays = [];
|
|
128582
|
-
|
|
128637
|
+
foregroundDynamics = [];
|
|
128638
|
+
overlayDynamics = [];
|
|
128583
128639
|
_decorations;
|
|
128584
128640
|
[Symbol.dispose]() {
|
|
128585
128641
|
this.foreground.length = this.background.length = this.overlays.length = 0;
|
|
128586
|
-
|
|
128642
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.foregroundDynamics);
|
|
128643
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.overlayDynamics);
|
|
128587
128644
|
this._decorations = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._decorations);
|
|
128588
128645
|
}
|
|
128589
128646
|
get isDisposed() {
|
|
128590
128647
|
return 0 === this.foreground.length && 0 === this.background.length && 0 === this.overlays.length
|
|
128591
|
-
&&
|
|
128648
|
+
&& 0 === this.foregroundDynamics.length && 0 === this.overlayDynamics.length && !this._decorations;
|
|
128592
128649
|
}
|
|
128593
128650
|
changeScene(scene) {
|
|
128594
128651
|
this.foreground = scene.foreground;
|
|
128595
128652
|
this.background = scene.background;
|
|
128596
128653
|
this.overlays = scene.overlay;
|
|
128597
128654
|
}
|
|
128598
|
-
|
|
128599
|
-
|
|
128600
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.
|
|
128601
|
-
this.
|
|
128655
|
+
changeDynamics(foreground, overlay) {
|
|
128656
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.foregroundDynamics);
|
|
128657
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.overlayDynamics);
|
|
128658
|
+
this.foregroundDynamics = foreground ?? [];
|
|
128659
|
+
this.overlayDynamics = overlay ?? [];
|
|
128602
128660
|
}
|
|
128603
128661
|
get decorations() { return this._decorations; }
|
|
128604
128662
|
set decorations(decorations) {
|
|
@@ -140536,8 +140594,9 @@ function createClassifierTileTreeReference(classifiers, classifiedTree, iModel,
|
|
|
140536
140594
|
return new ClassifierTreeReference(classifiers, classifiedTree, iModel, source);
|
|
140537
140595
|
}
|
|
140538
140596
|
function createClassifierId(classifier, source) {
|
|
140597
|
+
const disablePolyfaceDecimation = _IModelApp__WEBPACK_IMPORTED_MODULE_2__.IModelApp.tileAdmin.disablePolyfaceDecimation;
|
|
140539
140598
|
if (undefined === classifier)
|
|
140540
|
-
return { modelId: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid, type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.PlanarClassifier, expansion: 0, animationId: undefined };
|
|
140599
|
+
return { modelId: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid, type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.PlanarClassifier, expansion: 0, animationId: undefined, disablePolyfaceDecimation };
|
|
140541
140600
|
const type = classifier.flags.isVolumeClassifier ? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.VolumeClassifier : _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.PlanarClassifier;
|
|
140542
140601
|
const scriptInfo = _IModelApp__WEBPACK_IMPORTED_MODULE_2__.IModelApp.tileAdmin.getScriptInfoForTreeId(classifier.modelId, source ? source[_common_internal_Symbols__WEBPACK_IMPORTED_MODULE_5__._scheduleScriptReference] : undefined);
|
|
140543
140602
|
return {
|
|
@@ -140546,6 +140605,7 @@ function createClassifierId(classifier, source) {
|
|
|
140546
140605
|
expansion: classifier.expand,
|
|
140547
140606
|
animationId: scriptInfo?.animationId,
|
|
140548
140607
|
timeline: scriptInfo?.timeline,
|
|
140608
|
+
disablePolyfaceDecimation,
|
|
140549
140609
|
};
|
|
140550
140610
|
}
|
|
140551
140611
|
|
|
@@ -144542,7 +144602,8 @@ class PrimaryTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.T
|
|
|
144542
144602
|
const edgesRequired = visibleEdges || _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RenderMode.SmoothShade !== renderMode || _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.alwaysRequestEdges;
|
|
144543
144603
|
const edges = edgesRequired ? _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.edgeOptions : false;
|
|
144544
144604
|
const sectionCut = this._sectionClip?.clipString;
|
|
144545
|
-
|
|
144605
|
+
const disablePolyfaceDecimation = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.disablePolyfaceDecimation;
|
|
144606
|
+
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges, animationId, sectionCut, disablePolyfaceDecimation };
|
|
144546
144607
|
}
|
|
144547
144608
|
computeBaseTransform(tree) {
|
|
144548
144609
|
return super.computeTransform(tree);
|
|
@@ -144695,7 +144756,7 @@ class MaskTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.Tile
|
|
|
144695
144756
|
return this._owner;
|
|
144696
144757
|
}
|
|
144697
144758
|
createTreeId() {
|
|
144698
|
-
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false };
|
|
144759
|
+
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false, disablePolyfaceDecimation: _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.disablePolyfaceDecimation };
|
|
144699
144760
|
}
|
|
144700
144761
|
}
|
|
144701
144762
|
function createMaskTreeReference(view, model) {
|
|
@@ -144721,7 +144782,7 @@ class ModelMapLayerTileTreeReference extends _tile_internal__WEBPACK_IMPORTED_MO
|
|
|
144721
144782
|
this._owner = primaryTreeSupplier.getOwner(this._id, this.iModel);
|
|
144722
144783
|
}
|
|
144723
144784
|
createTreeId() {
|
|
144724
|
-
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false };
|
|
144785
|
+
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false, disablePolyfaceDecimation: _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.disablePolyfaceDecimation };
|
|
144725
144786
|
}
|
|
144726
144787
|
get treeOwner() {
|
|
144727
144788
|
const newId = this.createTreeId();
|
|
@@ -150013,11 +150074,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
150013
150074
|
* @beta
|
|
150014
150075
|
*/
|
|
150015
150076
|
class AngleDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
150016
|
-
constructor(name, displayLabel, iconSpec) {
|
|
150077
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
150017
150078
|
const defaultName = "angle";
|
|
150018
|
-
super(
|
|
150079
|
+
super({
|
|
150080
|
+
name: name ? name : defaultName,
|
|
150081
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Angle"),
|
|
150082
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.ANGLE",
|
|
150083
|
+
iconSpec
|
|
150084
|
+
});
|
|
150019
150085
|
}
|
|
150020
150086
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.Angle; }
|
|
150087
|
+
/**
|
|
150088
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
150089
|
+
*/
|
|
150021
150090
|
get quantityType() { return "Angle"; }
|
|
150022
150091
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseAngle"); }
|
|
150023
150092
|
}
|
|
@@ -150056,8 +150125,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
150056
150125
|
class FormattedQuantityDescription extends _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_1__.BaseQuantityDescription {
|
|
150057
150126
|
_formatterSpec;
|
|
150058
150127
|
_parserSpec;
|
|
150059
|
-
constructor(
|
|
150060
|
-
|
|
150128
|
+
constructor(argsOrName, displayLabel, iconSpec, kindOfQuantityName) {
|
|
150129
|
+
if (typeof argsOrName === "string") {
|
|
150130
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
150131
|
+
super(argsOrName, displayLabel, iconSpec, kindOfQuantityName);
|
|
150132
|
+
}
|
|
150133
|
+
else {
|
|
150134
|
+
super(argsOrName.name, argsOrName.displayLabel, argsOrName.iconSpec, argsOrName.kindOfQuantityName);
|
|
150135
|
+
}
|
|
150061
150136
|
}
|
|
150062
150137
|
formatValue(numberValue) {
|
|
150063
150138
|
if (this.formatterSpec) {
|
|
@@ -150133,11 +150208,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
150133
150208
|
* @beta
|
|
150134
150209
|
*/
|
|
150135
150210
|
class LengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
150136
|
-
constructor(name, displayLabel, iconSpec) {
|
|
150211
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
150137
150212
|
const defaultName = "length";
|
|
150138
|
-
super(
|
|
150213
|
+
super({
|
|
150214
|
+
name: name ? name : defaultName,
|
|
150215
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
150216
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
150217
|
+
iconSpec,
|
|
150218
|
+
});
|
|
150139
150219
|
}
|
|
150140
150220
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.Length; }
|
|
150221
|
+
/**
|
|
150222
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
150223
|
+
*/
|
|
150141
150224
|
get quantityType() { return "Length"; }
|
|
150142
150225
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
150143
150226
|
}
|
|
@@ -150146,11 +150229,19 @@ class LengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_
|
|
|
150146
150229
|
* @beta
|
|
150147
150230
|
*/
|
|
150148
150231
|
class SurveyLengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
150149
|
-
constructor(name, displayLabel, iconSpec) {
|
|
150232
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
150150
150233
|
const defaultName = "surveyLength";
|
|
150151
|
-
super(
|
|
150234
|
+
super({
|
|
150235
|
+
name: name ? name : defaultName,
|
|
150236
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
150237
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
150238
|
+
iconSpec,
|
|
150239
|
+
});
|
|
150152
150240
|
}
|
|
150153
150241
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.LengthSurvey; }
|
|
150242
|
+
/**
|
|
150243
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
150244
|
+
*/
|
|
150154
150245
|
get quantityType() { return "LengthSurvey"; }
|
|
150155
150246
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
150156
150247
|
}
|
|
@@ -150159,11 +150250,19 @@ class SurveyLengthDescription extends _FormattedQuantityDescription__WEBPACK_IMP
|
|
|
150159
150250
|
* @beta
|
|
150160
150251
|
*/
|
|
150161
150252
|
class EngineeringLengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
150162
|
-
constructor(name, displayLabel, iconSpec) {
|
|
150253
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
150163
150254
|
const defaultName = "engineeringLength";
|
|
150164
|
-
super(
|
|
150255
|
+
super({
|
|
150256
|
+
name: name ? name : defaultName,
|
|
150257
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
150258
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
150259
|
+
iconSpec,
|
|
150260
|
+
});
|
|
150165
150261
|
}
|
|
150166
150262
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.LengthEngineering; }
|
|
150263
|
+
/**
|
|
150264
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
150265
|
+
*/
|
|
150167
150266
|
get quantityType() { return "LengthEngineering"; }
|
|
150168
150267
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
150169
150268
|
}
|
|
@@ -150578,8 +150677,10 @@ class LocalUnitFormatProvider extends _BaseUnitFormattingSettingsProvider__WEBPA
|
|
|
150578
150677
|
__webpack_require__.r(__webpack_exports__);
|
|
150579
150678
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
150580
150679
|
/* harmony export */ AlternateUnitLabelsRegistry: () => (/* binding */ AlternateUnitLabelsRegistry),
|
|
150680
|
+
/* harmony export */ FormatsProviderManager: () => (/* binding */ FormatsProviderManager),
|
|
150581
150681
|
/* harmony export */ QuantityFormatter: () => (/* binding */ QuantityFormatter),
|
|
150582
150682
|
/* harmony export */ QuantityType: () => (/* binding */ QuantityType),
|
|
150683
|
+
/* harmony export */ QuantityTypeFormatsProvider: () => (/* binding */ QuantityTypeFormatsProvider),
|
|
150583
150684
|
/* harmony export */ getQuantityTypeKey: () => (/* binding */ getQuantityTypeKey),
|
|
150584
150685
|
/* harmony export */ isCustomQuantityTypeDefinition: () => (/* binding */ isCustomQuantityTypeDefinition)
|
|
150585
150686
|
/* harmony export */ });
|
|
@@ -150725,12 +150826,66 @@ class StandardQuantityTypeDefinition {
|
|
|
150725
150826
|
return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, unitsProvider, this.persistenceUnit, alternateUnitLabelsProvider);
|
|
150726
150827
|
}
|
|
150727
150828
|
}
|
|
150829
|
+
/**
|
|
150830
|
+
* A default formatsProvider, that provides a limited set of [[FormatDefinition]], associated to a few [[KindOfQuantity]].
|
|
150831
|
+
* Maps each KindOfQuantity to a [[QuantityType]].
|
|
150832
|
+
* When retrieving a valid [[KindOfQuantity]], returns the [[FormatProps]] for the associated [[QuantityType]].
|
|
150833
|
+
* @internal
|
|
150834
|
+
*/
|
|
150835
|
+
class QuantityTypeFormatsProvider {
|
|
150836
|
+
onFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
150837
|
+
constructor() {
|
|
150838
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(() => {
|
|
150839
|
+
this.onFormatsChanged.raiseEvent({ formatsChanged: "all" });
|
|
150840
|
+
});
|
|
150841
|
+
}
|
|
150842
|
+
_kindOfQuantityMap = new Map([
|
|
150843
|
+
["AecUnits.LENGTH", QuantityType.Length],
|
|
150844
|
+
["AecUnits.ANGLE", QuantityType.Angle],
|
|
150845
|
+
["AecUnits.AREA", QuantityType.Area],
|
|
150846
|
+
["AecUnits.VOLUME", QuantityType.Volume],
|
|
150847
|
+
["RoadRailUnits.STATION", QuantityType.Stationing],
|
|
150848
|
+
["RoadRailUnits.LENGTH", QuantityType.LengthSurvey],
|
|
150849
|
+
]);
|
|
150850
|
+
async getFormat(name) {
|
|
150851
|
+
const quantityType = this._kindOfQuantityMap.get(name);
|
|
150852
|
+
if (!quantityType)
|
|
150853
|
+
return undefined;
|
|
150854
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);
|
|
150855
|
+
}
|
|
150856
|
+
}
|
|
150857
|
+
/**
|
|
150858
|
+
* An implementation of the [[FormatsProvider]] interface that forwards calls to getFormats to the underlying FormatsProvider.
|
|
150859
|
+
* Also fires the onFormatsChanged event when the underlying FormatsProvider fires its own onFormatsChanged event.
|
|
150860
|
+
* @internal
|
|
150861
|
+
*/
|
|
150862
|
+
class FormatsProviderManager {
|
|
150863
|
+
_formatsProvider;
|
|
150864
|
+
onFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
150865
|
+
constructor(_formatsProvider) {
|
|
150866
|
+
this._formatsProvider = _formatsProvider;
|
|
150867
|
+
this._formatsProvider.onFormatsChanged.addListener((args) => {
|
|
150868
|
+
this.onFormatsChanged.raiseEvent(args);
|
|
150869
|
+
});
|
|
150870
|
+
}
|
|
150871
|
+
async getFormat(name) {
|
|
150872
|
+
return this._formatsProvider.getFormat(name);
|
|
150873
|
+
}
|
|
150874
|
+
get formatsProvider() { return this; }
|
|
150875
|
+
set formatsProvider(formatsProvider) {
|
|
150876
|
+
this._formatsProvider = formatsProvider;
|
|
150877
|
+
this._formatsProvider.onFormatsChanged.addListener((args) => {
|
|
150878
|
+
this.onFormatsChanged.raiseEvent(args);
|
|
150879
|
+
});
|
|
150880
|
+
this.onFormatsChanged.raiseEvent({ formatsChanged: "all" });
|
|
150881
|
+
}
|
|
150882
|
+
}
|
|
150728
150883
|
/** Class that supports formatting quantity values into strings and parsing strings into quantity values. This class also maintains
|
|
150729
150884
|
* the "active" unit system and caches FormatterSpecs and ParserSpecs for the "active" unit system to allow synchronous access to
|
|
150730
150885
|
* parsing and formatting values. The support unit systems are defined by [[UnitSystemKey]] and is kept in synch with the unit systems
|
|
150731
150886
|
* provided by the Presentation Manager on the backend. The QuantityFormatter contains a registry of quantity type definitions. These definitions implement
|
|
150732
|
-
* the [[QuantityTypeDefinition]] interface, which among other things, provide default [FormatProps]
|
|
150733
|
-
* to generate both a [FormatterSpec]
|
|
150887
|
+
* the [[QuantityTypeDefinition]] interface, which among other things, provide default [[FormatProps]], and provide methods
|
|
150888
|
+
* to generate both a [[FormatterSpec]] and a [[ParserSpec]]. There are built-in quantity types that are
|
|
150734
150889
|
* identified by the [[QuantityType]] enum. [[CustomQuantityTypeDefinition]] can be registered to extend the available quantity types available
|
|
150735
150890
|
* by frontend tools. The QuantityFormatter also allows the default formats to be overriden.
|
|
150736
150891
|
*
|
|
@@ -150741,6 +150896,10 @@ class QuantityFormatter {
|
|
|
150741
150896
|
_alternateUnitLabelsRegistry = new AlternateUnitLabelsRegistry((0,_BasicUnitsProvider__WEBPACK_IMPORTED_MODULE_4__.getDefaultAlternateUnitLabels)());
|
|
150742
150897
|
/** Registry containing available quantity type definitions. */
|
|
150743
150898
|
_quantityTypeRegistry = new Map();
|
|
150899
|
+
/** Registry containing available FormatterSpec and ParserSpec, mapped by keys.
|
|
150900
|
+
* @beta
|
|
150901
|
+
*/
|
|
150902
|
+
_formatSpecsRegistry = new Map();
|
|
150744
150903
|
/** Active UnitSystem key - must be one of "imperial", "metric", "usCustomary", or "usSurvey". */
|
|
150745
150904
|
_activeUnitSystem = "imperial";
|
|
150746
150905
|
/** Map of FormatSpecs for all available QuantityTypes and the active Unit System */
|
|
@@ -150767,6 +150926,7 @@ class QuantityFormatter {
|
|
|
150767
150926
|
onQuantityFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeUiEvent();
|
|
150768
150927
|
/** Fired when the active UnitsProvider is updated. This will allow cached Formatter and Parser specs to be updated if necessary. */
|
|
150769
150928
|
onUnitsProviderChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeUiEvent();
|
|
150929
|
+
_removeFormatsProviderListener;
|
|
150770
150930
|
/**
|
|
150771
150931
|
* constructor
|
|
150772
150932
|
* @param showMetricOrUnitSystem - Pass in `true` to show Metric formatted quantity values. Defaults to Imperial. To explicitly
|
|
@@ -150780,6 +150940,12 @@ class QuantityFormatter {
|
|
|
150780
150940
|
this._activeUnitSystem = showMetricOrUnitSystem;
|
|
150781
150941
|
}
|
|
150782
150942
|
}
|
|
150943
|
+
[Symbol.dispose]() {
|
|
150944
|
+
if (this._removeFormatsProviderListener) {
|
|
150945
|
+
this._removeFormatsProviderListener();
|
|
150946
|
+
this._removeFormatsProviderListener = undefined;
|
|
150947
|
+
}
|
|
150948
|
+
}
|
|
150783
150949
|
getOverrideFormatPropsByQuantityType(quantityTypeKey, unitSystem) {
|
|
150784
150950
|
const requestedUnitSystem = unitSystem ?? this.activeUnitSystem;
|
|
150785
150951
|
const overrideMap = this._overrideFormatPropsByUnitSystem.get(requestedUnitSystem);
|
|
@@ -150905,6 +151071,46 @@ class QuantityFormatter {
|
|
|
150905
151071
|
*/
|
|
150906
151072
|
async onInitialized() {
|
|
150907
151073
|
await this.initializeQuantityTypesRegistry();
|
|
151074
|
+
const initialKoQs = [["AecUnits.LENGTH", "Units.M"], ["AecUnits.ANGLE", "Units.RAD"], ["AecUnits.AREA", "Units.SQ_M"], ["AecUnits.VOLUME", "Units.CUB_M"], ["RoadRailUnits.STATION", "Units.M"], ["RoadRailUnits.LENGTH", "Units.M"]];
|
|
151075
|
+
for (const entry of initialKoQs) {
|
|
151076
|
+
try {
|
|
151077
|
+
await this.addFormattingSpecsToRegistry(entry[0], entry[1]);
|
|
151078
|
+
}
|
|
151079
|
+
catch (err) {
|
|
151080
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.Package}.QuantityFormatter`, err.toString());
|
|
151081
|
+
}
|
|
151082
|
+
}
|
|
151083
|
+
this._removeFormatsProviderListener = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.onFormatsChanged.addListener(async (args) => {
|
|
151084
|
+
if (args.formatsChanged === "all") {
|
|
151085
|
+
for (const [name, entry] of this._formatSpecsRegistry.entries()) {
|
|
151086
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(name);
|
|
151087
|
+
if (formatProps) {
|
|
151088
|
+
const persistenceUnitName = entry.formatterSpec.persistenceUnit.name;
|
|
151089
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
151090
|
+
}
|
|
151091
|
+
else {
|
|
151092
|
+
this._formatSpecsRegistry.delete(name); // clear the specs if format was removed, or no longer exists.
|
|
151093
|
+
}
|
|
151094
|
+
}
|
|
151095
|
+
}
|
|
151096
|
+
else {
|
|
151097
|
+
for (const name of args.formatsChanged) {
|
|
151098
|
+
if (this._formatSpecsRegistry.has(name)) {
|
|
151099
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(name);
|
|
151100
|
+
if (formatProps) {
|
|
151101
|
+
const existingEntry = this._formatSpecsRegistry.get(name);
|
|
151102
|
+
if (existingEntry) {
|
|
151103
|
+
const persistenceUnitName = existingEntry.formatterSpec.persistenceUnit.name;
|
|
151104
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
151105
|
+
}
|
|
151106
|
+
}
|
|
151107
|
+
else {
|
|
151108
|
+
this._formatSpecsRegistry.delete(name);
|
|
151109
|
+
}
|
|
151110
|
+
}
|
|
151111
|
+
}
|
|
151112
|
+
}
|
|
151113
|
+
});
|
|
150908
151114
|
// initialize default format and parsing specs
|
|
150909
151115
|
await this.loadFormatAndParsingMapsForSystem();
|
|
150910
151116
|
}
|
|
@@ -151134,26 +151340,51 @@ class QuantityFormatter {
|
|
|
151134
151340
|
requestedSystem = isImperial ? "imperial" : "metric";
|
|
151135
151341
|
return this.getParserSpecByQuantityTypeAndSystem(type, requestedSystem);
|
|
151136
151342
|
}
|
|
151137
|
-
|
|
151138
|
-
|
|
151139
|
-
|
|
151140
|
-
|
|
151141
|
-
|
|
151142
|
-
|
|
151143
|
-
|
|
151144
|
-
|
|
151145
|
-
|
|
151146
|
-
return
|
|
151343
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
151344
|
+
formatQuantity(args, spec) {
|
|
151345
|
+
if (typeof args === "number") {
|
|
151346
|
+
/** Format a quantity value. Default FormatterSpec implementation uses Formatter.formatQuantity. */
|
|
151347
|
+
const magnitude = args;
|
|
151348
|
+
if (spec)
|
|
151349
|
+
return spec.applyFormatting(magnitude);
|
|
151350
|
+
return magnitude.toString();
|
|
151351
|
+
}
|
|
151352
|
+
return this.formatQuantityAsync(args);
|
|
151353
|
+
}
|
|
151354
|
+
async formatQuantityAsync(args) {
|
|
151355
|
+
const { value, valueUnitName, kindOfQuantityName } = args;
|
|
151356
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(kindOfQuantityName);
|
|
151357
|
+
if (!formatProps)
|
|
151358
|
+
return value.toString();
|
|
151359
|
+
const formatSpec = await this.createFormatterSpec({
|
|
151360
|
+
persistenceUnitName: valueUnitName,
|
|
151361
|
+
formatProps,
|
|
151362
|
+
formatName: kindOfQuantityName,
|
|
151363
|
+
});
|
|
151364
|
+
return formatSpec.applyFormatting(value);
|
|
151147
151365
|
}
|
|
151148
|
-
|
|
151149
|
-
|
|
151150
|
-
|
|
151151
|
-
|
|
151152
|
-
|
|
151153
|
-
|
|
151154
|
-
|
|
151155
|
-
return
|
|
151156
|
-
|
|
151366
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
151367
|
+
parseToQuantityValue(args, parserSpec) {
|
|
151368
|
+
if (typeof args === "string") {
|
|
151369
|
+
/** Parse a quantity value. Default ParserSpec implementation uses ParserSpec.parseToQuantityValue. */
|
|
151370
|
+
const inString = args;
|
|
151371
|
+
if (parserSpec)
|
|
151372
|
+
return parserSpec.parseToQuantityValue(inString);
|
|
151373
|
+
return { ok: false, error: _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParseError.InvalidParserSpec };
|
|
151374
|
+
}
|
|
151375
|
+
return this.parseToQuantityValueAsync(args);
|
|
151376
|
+
}
|
|
151377
|
+
async parseToQuantityValueAsync(args) {
|
|
151378
|
+
const { value, valueUnitName, kindOfQuantityName } = args;
|
|
151379
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(kindOfQuantityName);
|
|
151380
|
+
if (!formatProps)
|
|
151381
|
+
return { ok: false, error: _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParseError.InvalidParserSpec };
|
|
151382
|
+
const parserSpec = await this.createParserSpec({
|
|
151383
|
+
persistenceUnitName: valueUnitName,
|
|
151384
|
+
formatProps,
|
|
151385
|
+
formatName: kindOfQuantityName,
|
|
151386
|
+
});
|
|
151387
|
+
return parserSpec.parseToQuantityValue(value);
|
|
151157
151388
|
}
|
|
151158
151389
|
/**
|
|
151159
151390
|
* Get a UnitSystemKey from a string that may have been entered via a key-in. Supports different variation of
|
|
@@ -151223,6 +151454,63 @@ class QuantityFormatter {
|
|
|
151223
151454
|
async getConversion(fromUnit, toUnit) {
|
|
151224
151455
|
return this._unitsProvider.getConversion(fromUnit, toUnit);
|
|
151225
151456
|
}
|
|
151457
|
+
/**
|
|
151458
|
+
* Creates a [[FormatterSpec]] for a given persistence unit name and format properties, using the [[UnitsProvider]] to resolve the persistence unit.
|
|
151459
|
+
* @beta
|
|
151460
|
+
* @param props - A [[CreateFormattingSpecProps]] interface.
|
|
151461
|
+
*/
|
|
151462
|
+
async createFormatterSpec(props) {
|
|
151463
|
+
const { persistenceUnitName, formatProps, formatName } = props;
|
|
151464
|
+
const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
151465
|
+
const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
|
|
151466
|
+
return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.FormatterSpec.create(`${format.name}_format_spec`, format, this._unitsProvider, persistenceUnitProps);
|
|
151467
|
+
}
|
|
151468
|
+
/**
|
|
151469
|
+
* Creates a [[ParserSpec]] for a given persistence unit name and format properties, using the [[UnitsProvider]] to resolve the persistence unit.
|
|
151470
|
+
* @beta
|
|
151471
|
+
* @param props - A [[CreateFormattingSpecProps]] object.
|
|
151472
|
+
*/
|
|
151473
|
+
async createParserSpec(props) {
|
|
151474
|
+
const { persistenceUnitName, formatProps, formatName } = props;
|
|
151475
|
+
const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
151476
|
+
const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
|
|
151477
|
+
return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
|
|
151478
|
+
}
|
|
151479
|
+
/**
|
|
151480
|
+
* @beta
|
|
151481
|
+
* Returns a [[FormattingSpecEntry]] for a given name, typically a KindOfQuantity full name.
|
|
151482
|
+
*/
|
|
151483
|
+
getSpecsByName(name) {
|
|
151484
|
+
return this._formatSpecsRegistry.get(name);
|
|
151485
|
+
}
|
|
151486
|
+
/**
|
|
151487
|
+
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
|
|
151488
|
+
* @beta
|
|
151489
|
+
* @param name The key used to identify the formatter and parser spec
|
|
151490
|
+
* @param persistenceUnitName The name of the persistence unit
|
|
151491
|
+
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
|
|
151492
|
+
*/
|
|
151493
|
+
async addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps) {
|
|
151494
|
+
if (!formatProps) {
|
|
151495
|
+
formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(name);
|
|
151496
|
+
}
|
|
151497
|
+
if (formatProps) {
|
|
151498
|
+
const formatterSpec = await this.createFormatterSpec({
|
|
151499
|
+
persistenceUnitName,
|
|
151500
|
+
formatProps,
|
|
151501
|
+
formatName: name,
|
|
151502
|
+
});
|
|
151503
|
+
const parserSpec = await this.createParserSpec({
|
|
151504
|
+
persistenceUnitName,
|
|
151505
|
+
formatProps,
|
|
151506
|
+
formatName: name,
|
|
151507
|
+
});
|
|
151508
|
+
this._formatSpecsRegistry.set(name, { formatterSpec, parserSpec });
|
|
151509
|
+
}
|
|
151510
|
+
else {
|
|
151511
|
+
throw new Error(`Unable to find format properties for ${name} with persistence unit ${persistenceUnitName}`);
|
|
151512
|
+
}
|
|
151513
|
+
}
|
|
151226
151514
|
}
|
|
151227
151515
|
// ========================================================================================================================================
|
|
151228
151516
|
// Default Data
|
|
@@ -158263,6 +158551,8 @@ class TileAdmin {
|
|
|
158263
158551
|
/** @internal */
|
|
158264
158552
|
optimizeBRepProcessing;
|
|
158265
158553
|
/** @internal */
|
|
158554
|
+
disablePolyfaceDecimation;
|
|
158555
|
+
/** @internal */
|
|
158266
158556
|
useLargerTiles;
|
|
158267
158557
|
/** @internal */
|
|
158268
158558
|
maximumLevelsToSkip;
|
|
@@ -158351,6 +158641,7 @@ class TileAdmin {
|
|
|
158351
158641
|
this.useProjectExtents = options.useProjectExtents ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.useProjectExtents;
|
|
158352
158642
|
this.expandProjectExtents = options.expandProjectExtents ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.expandProjectExtents;
|
|
158353
158643
|
this.optimizeBRepProcessing = options.optimizeBRepProcessing ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.optimizeBRepProcessing;
|
|
158644
|
+
this.disablePolyfaceDecimation = options.disablePolyfaceDecimation ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.disablePolyfaceDecimation;
|
|
158354
158645
|
this.useLargerTiles = options.useLargerTiles ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.useLargerTiles;
|
|
158355
158646
|
this.mobileRealityTileMinToleranceRatio = Math.max(options.mobileRealityTileMinToleranceRatio ?? 3.0, 1.0);
|
|
158356
158647
|
this.cesiumIonKey = options.cesiumIonKey;
|
|
@@ -162701,6 +162992,18 @@ class MapCartoRectangle extends _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0_
|
|
|
162701
162992
|
scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);
|
|
162702
162993
|
return scratchMercatorFractionRange;
|
|
162703
162994
|
}
|
|
162995
|
+
/**
|
|
162996
|
+
* Compute rectangle with angles specified in degrees.
|
|
162997
|
+
* @beta
|
|
162998
|
+
*/
|
|
162999
|
+
toDegrees() {
|
|
163000
|
+
return {
|
|
163001
|
+
north: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.north),
|
|
163002
|
+
south: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.south),
|
|
163003
|
+
east: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.east),
|
|
163004
|
+
west: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.west),
|
|
163005
|
+
};
|
|
163006
|
+
}
|
|
162704
163007
|
}
|
|
162705
163008
|
|
|
162706
163009
|
|
|
@@ -163367,7 +163670,7 @@ class MapLayerImageryProvider {
|
|
|
163367
163670
|
}
|
|
163368
163671
|
}
|
|
163369
163672
|
/** @internal */
|
|
163370
|
-
async makeTileRequest(url, timeoutMs) {
|
|
163673
|
+
async makeTileRequest(url, timeoutMs, authorization) {
|
|
163371
163674
|
// We want to complete the first request before letting other requests go;
|
|
163372
163675
|
// this done to avoid flooding server with requests missing credentials
|
|
163373
163676
|
if (!this._firstRequestPromise)
|
|
@@ -163376,7 +163679,7 @@ class MapLayerImageryProvider {
|
|
|
163376
163679
|
await this._firstRequestPromise;
|
|
163377
163680
|
let response;
|
|
163378
163681
|
try {
|
|
163379
|
-
response = await this.makeRequest(url, timeoutMs);
|
|
163682
|
+
response = await this.makeRequest(url, timeoutMs, authorization);
|
|
163380
163683
|
}
|
|
163381
163684
|
finally {
|
|
163382
163685
|
this.onFirstRequestCompleted.raiseEvent();
|
|
@@ -163386,11 +163689,15 @@ class MapLayerImageryProvider {
|
|
|
163386
163689
|
return response;
|
|
163387
163690
|
}
|
|
163388
163691
|
/** @internal */
|
|
163389
|
-
async makeRequest(url, timeoutMs) {
|
|
163692
|
+
async makeRequest(url, timeoutMs, authorization) {
|
|
163390
163693
|
let response;
|
|
163391
163694
|
let headers;
|
|
163392
163695
|
let hasCreds = false;
|
|
163393
|
-
if (
|
|
163696
|
+
if (authorization) {
|
|
163697
|
+
headers = new Headers();
|
|
163698
|
+
headers.set("Authorization", authorization);
|
|
163699
|
+
}
|
|
163700
|
+
else if (this._settings.userName && this._settings.password) {
|
|
163394
163701
|
hasCreds = true;
|
|
163395
163702
|
headers = new Headers();
|
|
163396
163703
|
this.setRequestAuthorization(headers);
|
|
@@ -166196,6 +166503,18 @@ class QuadId {
|
|
|
166196
166503
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(this.row, other.row) ||
|
|
166197
166504
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(this.column, other.column);
|
|
166198
166505
|
}
|
|
166506
|
+
/** Creates a QuadId from a JSON representation */
|
|
166507
|
+
static fromJSON(props) {
|
|
166508
|
+
return new QuadId(props.level, props.column, props.row);
|
|
166509
|
+
}
|
|
166510
|
+
/** Convert this QuadId to a JSON representation */
|
|
166511
|
+
static toJSON(props) {
|
|
166512
|
+
return {
|
|
166513
|
+
level: props.level,
|
|
166514
|
+
column: props.column,
|
|
166515
|
+
row: props.row,
|
|
166516
|
+
};
|
|
166517
|
+
}
|
|
166199
166518
|
}
|
|
166200
166519
|
|
|
166201
166520
|
|
|
@@ -168036,6 +168355,7 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168036
168355
|
this._controls.overlay.remove();
|
|
168037
168356
|
this._controls = undefined;
|
|
168038
168357
|
this.unsuspendToolTips();
|
|
168358
|
+
this.removedControlRect();
|
|
168039
168359
|
}
|
|
168040
168360
|
createControlDiv() {
|
|
168041
168361
|
const div = document.createElement("div");
|
|
@@ -168123,6 +168443,10 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168123
168443
|
style.outlineWidth = button.outlineWidth;
|
|
168124
168444
|
return itemLock;
|
|
168125
168445
|
}
|
|
168446
|
+
/** Called after the controls have been removed from the view. */
|
|
168447
|
+
removedControlRect() { }
|
|
168448
|
+
/** Called after the position of the controls in the supplied view is updated. */
|
|
168449
|
+
changedControlRect(_rect, _vp) { }
|
|
168126
168450
|
/** Use to override the position of the controls in the supplied view. */
|
|
168127
168451
|
modifyControlRect(_rect, _vp) { }
|
|
168128
168452
|
/** Return the ViewRect currently occupied by the controls in the supplied view. */
|
|
@@ -168219,6 +168543,8 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168219
168543
|
return; // Keep showing at last valid location...
|
|
168220
168544
|
this._controls.div.style.left = `${controlRect.left}px`;
|
|
168221
168545
|
this._controls.div.style.top = `${controlRect.top}px`;
|
|
168546
|
+
this.changedControlRect(controlRect, vp);
|
|
168547
|
+
return;
|
|
168222
168548
|
}
|
|
168223
168549
|
get _isFocusHome() {
|
|
168224
168550
|
return (document.body === document.activeElement);
|
|
@@ -168241,6 +168567,13 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168241
168567
|
// Indicate when keyboard shortcuts can't be used (i.e. focus not at AccuDraw or Home) by changing compass to monochrome...
|
|
168242
168568
|
return (this._isFocusHome || this._isFocusAccuDraw);
|
|
168243
168569
|
}
|
|
168570
|
+
/** Get the item field that currently has input focus.
|
|
168571
|
+
*/
|
|
168572
|
+
getFocusItem() {
|
|
168573
|
+
if (!this._isFocusAccuDraw)
|
|
168574
|
+
return undefined;
|
|
168575
|
+
return this._focusItem;
|
|
168576
|
+
}
|
|
168244
168577
|
/** Request to set focus to the specified AccuDraw input field to start entering values.
|
|
168245
168578
|
* The focused input field will be indicated by the background color.
|
|
168246
168579
|
*/
|
|
@@ -171585,11 +171918,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
171585
171918
|
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
171586
171919
|
/* harmony import */ var _Marker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Marker */ "../../core/frontend/lib/esm/Marker.js");
|
|
171587
171920
|
/* harmony import */ var _NotificationManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../NotificationManager */ "../../core/frontend/lib/esm/NotificationManager.js");
|
|
171588
|
-
/* harmony import */ var
|
|
171589
|
-
/* harmony import */ var
|
|
171590
|
-
/* harmony import */ var
|
|
171591
|
-
/* harmony import */ var
|
|
171592
|
-
/* harmony import */ var _common_render_GraphicType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/render/GraphicType */ "../../core/frontend/lib/esm/common/render/GraphicType.js");
|
|
171921
|
+
/* harmony import */ var _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PrimitiveTool */ "../../core/frontend/lib/esm/tools/PrimitiveTool.js");
|
|
171922
|
+
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
171923
|
+
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
171924
|
+
/* harmony import */ var _common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/render/GraphicType */ "../../core/frontend/lib/esm/common/render/GraphicType.js");
|
|
171593
171925
|
/*---------------------------------------------------------------------------------------------
|
|
171594
171926
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
171595
171927
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -171610,9 +171942,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
171610
171942
|
|
|
171611
171943
|
|
|
171612
171944
|
|
|
171613
|
-
|
|
171614
171945
|
function translateBold(key) {
|
|
171615
|
-
return `<b>${
|
|
171946
|
+
return `<b>${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(`Measure.Labels.${key}`)}:</b> `;
|
|
171947
|
+
}
|
|
171948
|
+
async function getFormatterSpecByKoQAndPersistenceUnit(koq, persistenceUnitName) {
|
|
171949
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.formatsProvider.getFormat(koq);
|
|
171950
|
+
if (undefined === formatProps)
|
|
171951
|
+
return undefined;
|
|
171952
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.createFormatterSpec({
|
|
171953
|
+
persistenceUnitName,
|
|
171954
|
+
formatProps,
|
|
171955
|
+
formatName: koq
|
|
171956
|
+
});
|
|
171616
171957
|
}
|
|
171617
171958
|
/** @internal */
|
|
171618
171959
|
class MeasureLabel {
|
|
@@ -171676,7 +172017,7 @@ class MeasureMarker extends _Marker__WEBPACK_IMPORTED_MODULE_7__.Marker {
|
|
|
171676
172017
|
onMouseButton(_ev) { return true; } // Never forward event to active tool...
|
|
171677
172018
|
onMouseEnter(ev) {
|
|
171678
172019
|
super.onMouseEnter(ev);
|
|
171679
|
-
if (this.title &&
|
|
172020
|
+
if (this.title && _Tool__WEBPACK_IMPORTED_MODULE_10__.InputSource.Touch === ev.inputSource && ev.viewport)
|
|
171680
172021
|
ev.viewport.openToolTip(this.title, ev.viewPoint, this.tooltipOptions);
|
|
171681
172022
|
}
|
|
171682
172023
|
onMouseLeave() {
|
|
@@ -171713,7 +172054,7 @@ function adjustPoint(ev, segments, locations) {
|
|
|
171713
172054
|
/** Report distance between 2 points using current quantity formatter for length.
|
|
171714
172055
|
* @public
|
|
171715
172056
|
*/
|
|
171716
|
-
class MeasureDistanceTool extends
|
|
172057
|
+
class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
171717
172058
|
static toolId = "Measure.Distance";
|
|
171718
172059
|
static iconSpec = "icon-measure-distance";
|
|
171719
172060
|
/** @internal */
|
|
@@ -171731,6 +172072,12 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171731
172072
|
/** @internal */
|
|
171732
172073
|
_lastMotionAdjustedPt;
|
|
171733
172074
|
/** @internal */
|
|
172075
|
+
_lengthFormatterSpec;
|
|
172076
|
+
/** @internal */
|
|
172077
|
+
_angleFormatterSpec;
|
|
172078
|
+
/** @internal */
|
|
172079
|
+
_removeFormatterListener;
|
|
172080
|
+
/** @internal */
|
|
171734
172081
|
allowView(vp) { return vp.view.isSpatialView() || vp.view.isDrawingView(); }
|
|
171735
172082
|
/** @internal */
|
|
171736
172083
|
isCompatibleViewport(vp, isSelectedViewChange) { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && this.allowView(vp)); }
|
|
@@ -171741,34 +172088,50 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171741
172088
|
/** @internal */
|
|
171742
172089
|
async onPostInstall() {
|
|
171743
172090
|
await super.onPostInstall();
|
|
172091
|
+
this._lengthFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172092
|
+
this._angleFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.ANGLE", "Units.RAD");
|
|
172093
|
+
this._removeFormatterListener = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.formatsProvider.onFormatsChanged.addListener(async (args) => {
|
|
172094
|
+
if (args.formatsChanged === "all" || args.formatsChanged.includes("AecUnits.LENGTH"))
|
|
172095
|
+
this._lengthFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172096
|
+
if (args.formatsChanged === "all" || args.formatsChanged.includes("AecUnits.ANGLE"))
|
|
172097
|
+
this._angleFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.ANGLE", "Units.RAD");
|
|
172098
|
+
});
|
|
171744
172099
|
this.setupAndPromptForNextAction();
|
|
171745
172100
|
}
|
|
171746
172101
|
/** @internal */
|
|
172102
|
+
async onCleanup() {
|
|
172103
|
+
if (this._removeFormatterListener) {
|
|
172104
|
+
this._removeFormatterListener();
|
|
172105
|
+
this._removeFormatterListener = undefined;
|
|
172106
|
+
}
|
|
172107
|
+
await super.onCleanup();
|
|
172108
|
+
}
|
|
172109
|
+
/** @internal */
|
|
171747
172110
|
async onUnsuspend() { this.showPrompt(); }
|
|
171748
172111
|
/** @internal */
|
|
171749
172112
|
showPrompt() {
|
|
171750
|
-
const mainInstruction =
|
|
172113
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(0 === this._locationData.length ? "Measure.Distance.Prompts.FirstPoint" : "Measure.Distance.Prompts.NextPoint"));
|
|
171751
172114
|
const mouseInstructions = [];
|
|
171752
172115
|
const touchInstructions = [];
|
|
171753
|
-
if (!
|
|
171754
|
-
touchInstructions.push(
|
|
171755
|
-
mouseInstructions.push(
|
|
172116
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createTouchCursorInstructions(touchInstructions))
|
|
172117
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.OneTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172118
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
171756
172119
|
if (0 === this._locationData.length) {
|
|
171757
172120
|
if (this._acceptedSegments.length > 0) {
|
|
171758
|
-
touchInstructions.push(
|
|
171759
|
-
mouseInstructions.push(
|
|
172121
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172122
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
171760
172123
|
}
|
|
171761
172124
|
}
|
|
171762
172125
|
else {
|
|
171763
|
-
touchInstructions.push(
|
|
171764
|
-
mouseInstructions.push(
|
|
171765
|
-
mouseInstructions.push(
|
|
171766
|
-
mouseInstructions.push(
|
|
172126
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Cancel"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172127
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Cancel"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172128
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.ctrlKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AdditionalPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172129
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createKeyboardInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createKeyboardInfo([_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.ctrlKey, "Z"]), _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.UndoLastPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
171767
172130
|
}
|
|
171768
172131
|
const sections = [];
|
|
171769
|
-
sections.push(
|
|
171770
|
-
sections.push(
|
|
171771
|
-
const instructions =
|
|
172132
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
172133
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
172134
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
171772
172135
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
171773
172136
|
}
|
|
171774
172137
|
/** @internal */
|
|
@@ -171814,8 +172177,8 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171814
172177
|
totalDistance += adjustedPoints[i].distance(adjustedPoints[i + 1]);
|
|
171815
172178
|
if (0.0 === totalDistance)
|
|
171816
172179
|
return;
|
|
171817
|
-
const formatterSpec =
|
|
171818
|
-
if (
|
|
172180
|
+
const formatterSpec = this._lengthFormatterSpec;
|
|
172181
|
+
if (formatterSpec === undefined)
|
|
171819
172182
|
return;
|
|
171820
172183
|
const formattedTotalDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(totalDistance, formatterSpec);
|
|
171821
172184
|
const distDyn = new MeasureLabel(points[points.length - 1], formattedTotalDistance);
|
|
@@ -171829,7 +172192,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171829
172192
|
seg.refAxes.multiplyVectorInPlace(xVec);
|
|
171830
172193
|
seg.refAxes.multiplyVectorInPlace(yVec);
|
|
171831
172194
|
seg.refAxes.multiplyVectorInPlace(zVec);
|
|
171832
|
-
const builderAxes = context.createGraphicBuilder(
|
|
172195
|
+
const builderAxes = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
171833
172196
|
let basePt = seg.start.clone();
|
|
171834
172197
|
if (xVec.magnitude() > 1.0e-5) {
|
|
171835
172198
|
const segPoints = [];
|
|
@@ -171876,12 +172239,12 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171876
172239
|
}
|
|
171877
172240
|
tmpPoints.push(this._lastMotionPt);
|
|
171878
172241
|
tmpAdjustedPoints.push(this._lastMotionAdjustedPt);
|
|
171879
|
-
const builderDynVis = context.createGraphicBuilder(
|
|
172242
|
+
const builderDynVis = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldDecoration);
|
|
171880
172243
|
const colorDynVis = context.viewport.hilite.color;
|
|
171881
172244
|
builderDynVis.setSymbology(colorDynVis, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 3);
|
|
171882
172245
|
builderDynVis.addLineString(tmpPoints);
|
|
171883
172246
|
context.addDecorationFromBuilder(builderDynVis);
|
|
171884
|
-
const builderDynHid = context.createGraphicBuilder(
|
|
172247
|
+
const builderDynHid = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
171885
172248
|
const colorDynHid = colorDynVis.withAlpha(100);
|
|
171886
172249
|
builderDynHid.setSymbology(colorDynHid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Code2);
|
|
171887
172250
|
builderDynHid.addLineString(tmpPoints);
|
|
@@ -171889,8 +172252,8 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171889
172252
|
this.displayDynamicDistance(context, tmpPoints, tmpAdjustedPoints);
|
|
171890
172253
|
}
|
|
171891
172254
|
if (this._acceptedSegments.length > 0) {
|
|
171892
|
-
const builderAccVis = context.createGraphicBuilder(
|
|
171893
|
-
const builderAccHid = context.createGraphicBuilder(
|
|
172255
|
+
const builderAccVis = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldDecoration);
|
|
172256
|
+
const builderAccHid = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
171894
172257
|
const colorAccVis = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);
|
|
171895
172258
|
const colorAccHid = colorAccVis.withAlpha(100);
|
|
171896
172259
|
builderAccVis.setSymbology(colorAccVis, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 3);
|
|
@@ -171912,7 +172275,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171912
172275
|
return;
|
|
171913
172276
|
if (undefined === this._snapGeomId)
|
|
171914
172277
|
this._snapGeomId = this.iModel.transientIds.getNext();
|
|
171915
|
-
const builderSnapPts = context.createGraphicBuilder(
|
|
172278
|
+
const builderSnapPts = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay, undefined, this._snapGeomId);
|
|
171916
172279
|
const colorAccPts = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);
|
|
171917
172280
|
builderSnapPts.setSymbology(colorAccPts, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 7);
|
|
171918
172281
|
builderSnapPts.addPointString(snapPoints);
|
|
@@ -171941,7 +172304,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171941
172304
|
reportMeasurements() {
|
|
171942
172305
|
if (undefined === this._totalDistanceMarker)
|
|
171943
172306
|
return;
|
|
171944
|
-
const briefMsg = `${
|
|
172307
|
+
const briefMsg = `${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(this._acceptedSegments.length > 1 ? "Measure.Labels.CumulativeDistance" : "Measure.Labels.Distance")}: ${this._totalDistanceMarker.label}`;
|
|
171945
172308
|
const msgDetail = new _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessagePriority.Info, briefMsg, undefined, _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessageType.Sticky);
|
|
171946
172309
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(msgDetail);
|
|
171947
172310
|
}
|
|
@@ -171952,7 +172315,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171952
172315
|
this._totalDistance += seg.distance;
|
|
171953
172316
|
if (0.0 === this._totalDistance)
|
|
171954
172317
|
return;
|
|
171955
|
-
const formatterSpec =
|
|
172318
|
+
const formatterSpec = this._lengthFormatterSpec;
|
|
171956
172319
|
if (undefined === formatterSpec)
|
|
171957
172320
|
return;
|
|
171958
172321
|
const formattedTotalDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalDistance, formatterSpec);
|
|
@@ -171963,20 +172326,20 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
171963
172326
|
const is3d = (undefined === this.targetView || this.targetView.view.is3d());
|
|
171964
172327
|
const isSpatial = (undefined !== this.targetView && this.targetView.view.isSpatialView());
|
|
171965
172328
|
const toolTip = document.createElement("div");
|
|
171966
|
-
const distanceFormatterSpec =
|
|
172329
|
+
const distanceFormatterSpec = this._lengthFormatterSpec;
|
|
171967
172330
|
if (undefined === distanceFormatterSpec)
|
|
171968
172331
|
return toolTip;
|
|
171969
172332
|
let toolTipHtml = "";
|
|
171970
172333
|
const formattedDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(distance, distanceFormatterSpec);
|
|
171971
172334
|
toolTipHtml += `${translateBold("Distance") + formattedDistance}<br>`;
|
|
171972
172335
|
if (is3d) {
|
|
171973
|
-
const angleFormatterSpec =
|
|
172336
|
+
const angleFormatterSpec = this._angleFormatterSpec;
|
|
171974
172337
|
if (undefined !== angleFormatterSpec) {
|
|
171975
172338
|
const formattedSlope = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(slope, angleFormatterSpec);
|
|
171976
172339
|
toolTipHtml += `${translateBold("Slope") + formattedSlope}<br>`;
|
|
171977
172340
|
}
|
|
171978
172341
|
}
|
|
171979
|
-
const coordFormatterSpec =
|
|
172342
|
+
const coordFormatterSpec = this._lengthFormatterSpec;
|
|
171980
172343
|
if (undefined !== coordFormatterSpec) {
|
|
171981
172344
|
let startAdjusted = start;
|
|
171982
172345
|
let endAdjusted = end;
|
|
@@ -172121,19 +172484,19 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172121
172484
|
this.setupAndPromptForNextAction();
|
|
172122
172485
|
if (undefined !== ev.viewport)
|
|
172123
172486
|
ev.viewport.invalidateDecorations();
|
|
172124
|
-
return
|
|
172487
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172125
172488
|
}
|
|
172126
172489
|
/** @internal */
|
|
172127
172490
|
async onResetButtonUp(ev) {
|
|
172128
172491
|
if (0 === this._locationData.length) {
|
|
172129
172492
|
await this.onReinitialize();
|
|
172130
|
-
return
|
|
172493
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172131
172494
|
}
|
|
172132
172495
|
await this.acceptNewSegments();
|
|
172133
172496
|
this.setupAndPromptForNextAction();
|
|
172134
172497
|
if (undefined !== ev.viewport)
|
|
172135
172498
|
ev.viewport.invalidateDecorations();
|
|
172136
|
-
return
|
|
172499
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172137
172500
|
}
|
|
172138
172501
|
/** @internal */
|
|
172139
172502
|
async onUndoPreviousStep() {
|
|
@@ -172164,7 +172527,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172164
172527
|
/** Report spatial coordinate at a point as well as cartographic location for geolocated models using current quantity formatters.
|
|
172165
172528
|
* @public
|
|
172166
172529
|
*/
|
|
172167
|
-
class MeasureLocationTool extends
|
|
172530
|
+
class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
172168
172531
|
static toolId = "Measure.Location";
|
|
172169
172532
|
static iconSpec = "icon-measure-location";
|
|
172170
172533
|
/** @internal */
|
|
@@ -172186,20 +172549,20 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172186
172549
|
async onUnsuspend() { this.showPrompt(); }
|
|
172187
172550
|
/** @internal */
|
|
172188
172551
|
showPrompt() {
|
|
172189
|
-
const mainInstruction =
|
|
172552
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("Measure.Location.Prompts.EnterPoint"));
|
|
172190
172553
|
const mouseInstructions = [];
|
|
172191
172554
|
const touchInstructions = [];
|
|
172192
|
-
if (!
|
|
172193
|
-
touchInstructions.push(
|
|
172194
|
-
mouseInstructions.push(
|
|
172555
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createTouchCursorInstructions(touchInstructions))
|
|
172556
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.OneTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172557
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172195
172558
|
if (0 !== this._acceptedLocations.length) {
|
|
172196
|
-
touchInstructions.push(
|
|
172197
|
-
mouseInstructions.push(
|
|
172559
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172560
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172198
172561
|
}
|
|
172199
172562
|
const sections = [];
|
|
172200
|
-
sections.push(
|
|
172201
|
-
sections.push(
|
|
172202
|
-
const instructions =
|
|
172563
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
172564
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
172565
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
172203
172566
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
172204
172567
|
}
|
|
172205
172568
|
/** @internal */
|
|
@@ -172212,7 +172575,7 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172212
172575
|
const isSpatial = (undefined !== this.targetView && this.targetView.view.isSpatialView());
|
|
172213
172576
|
const toolTip = document.createElement("div");
|
|
172214
172577
|
let toolTipHtml = "";
|
|
172215
|
-
const coordFormatterSpec = await
|
|
172578
|
+
const coordFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172216
172579
|
if (undefined !== coordFormatterSpec) {
|
|
172217
172580
|
let pointAdjusted = point;
|
|
172218
172581
|
if (isSpatial) {
|
|
@@ -172228,15 +172591,15 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172228
172591
|
toolTipHtml += "<br>";
|
|
172229
172592
|
}
|
|
172230
172593
|
if (isSpatial) {
|
|
172231
|
-
const latLongFormatterSpec = await
|
|
172594
|
+
const latLongFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.ANGLE", "Units.RAD");
|
|
172232
172595
|
if (undefined !== latLongFormatterSpec && undefined !== coordFormatterSpec) {
|
|
172233
172596
|
try {
|
|
172234
172597
|
const cartographic = await this.iModel.spatialToCartographic(point);
|
|
172235
172598
|
const formattedLat = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(Math.abs(cartographic.latitude), latLongFormatterSpec);
|
|
172236
172599
|
const formattedLong = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(Math.abs(cartographic.longitude), latLongFormatterSpec);
|
|
172237
172600
|
const formattedHeight = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);
|
|
172238
|
-
const latDir =
|
|
172239
|
-
const longDir =
|
|
172601
|
+
const latDir = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(cartographic.latitude < 0 ? "Measure.Labels.S" : "Measure.Labels.N");
|
|
172602
|
+
const longDir = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(cartographic.longitude < 0 ? "Measure.Labels.W" : "Measure.Labels.E");
|
|
172240
172603
|
toolTipHtml += `${translateBold("LatLong") + formattedLat + latDir}, ${formattedLong}${longDir}<br>`;
|
|
172241
172604
|
toolTipHtml += `${translateBold("Altitude") + formattedHeight}<br>`;
|
|
172242
172605
|
}
|
|
@@ -172274,12 +172637,12 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172274
172637
|
this.setupAndPromptForNextAction();
|
|
172275
172638
|
if (undefined !== ev.viewport)
|
|
172276
172639
|
ev.viewport.invalidateDecorations();
|
|
172277
|
-
return
|
|
172640
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172278
172641
|
}
|
|
172279
172642
|
/** @internal */
|
|
172280
172643
|
async onResetButtonUp(_ev) {
|
|
172281
172644
|
await this.onReinitialize();
|
|
172282
|
-
return
|
|
172645
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172283
172646
|
}
|
|
172284
172647
|
/** @internal */
|
|
172285
172648
|
async onUndoPreviousStep() {
|
|
@@ -172305,7 +172668,7 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
172305
172668
|
/** Report area defined by points using current quantity formatter for area.
|
|
172306
172669
|
* @public
|
|
172307
172670
|
*/
|
|
172308
|
-
class MeasureAreaByPointsTool extends
|
|
172671
|
+
class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
172309
172672
|
static toolId = "Measure.AreaByPoints";
|
|
172310
172673
|
static iconSpec = "icon-measure-2d";
|
|
172311
172674
|
/** @internal */
|
|
@@ -172334,12 +172697,12 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172334
172697
|
/** @internal */
|
|
172335
172698
|
static _orientationName = "enumAsOrientation";
|
|
172336
172699
|
/** @internal */
|
|
172337
|
-
static enumAsOrientationMessage(str) { return
|
|
172700
|
+
static enumAsOrientationMessage(str) { return _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(`Settings.Orientation.${str}`); }
|
|
172338
172701
|
/** @internal */
|
|
172339
172702
|
static _getEnumAsOrientationDescription = () => {
|
|
172340
172703
|
return {
|
|
172341
172704
|
name: MeasureAreaByPointsTool._orientationName,
|
|
172342
|
-
displayLabel:
|
|
172705
|
+
displayLabel: _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("Settings.Orientation.Label"),
|
|
172343
172706
|
typename: "enum",
|
|
172344
172707
|
enum: {
|
|
172345
172708
|
choices: [
|
|
@@ -172407,24 +172770,24 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172407
172770
|
mainMsg += this._isComplete ? "FirstPoint" : "NextPoint";
|
|
172408
172771
|
break;
|
|
172409
172772
|
}
|
|
172410
|
-
const mainInstruction =
|
|
172773
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(mainMsg));
|
|
172411
172774
|
const mouseInstructions = [];
|
|
172412
172775
|
const touchInstructions = [];
|
|
172413
|
-
const acceptMsg =
|
|
172414
|
-
if (!
|
|
172415
|
-
touchInstructions.push(
|
|
172416
|
-
mouseInstructions.push(
|
|
172417
|
-
const resetMsg =
|
|
172418
|
-
touchInstructions.push(
|
|
172419
|
-
mouseInstructions.push(
|
|
172776
|
+
const acceptMsg = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(this._isComplete ? "ElementSet.Inputs.Restart" : "ElementSet.Inputs.AcceptPoint");
|
|
172777
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createTouchCursorInstructions(touchInstructions))
|
|
172778
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.OneTouchTap, acceptMsg, false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172779
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, acceptMsg, false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172780
|
+
const resetMsg = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart");
|
|
172781
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, resetMsg, false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
172782
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, resetMsg, false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172420
172783
|
if (this._points.length > 1)
|
|
172421
|
-
mouseInstructions.push(
|
|
172784
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.ctrlKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AdditionalPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172422
172785
|
if (0 !== this._points.length)
|
|
172423
|
-
mouseInstructions.push(
|
|
172786
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createKeyboardInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createKeyboardInfo([_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.ctrlKey, "Z"]), _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.UndoLastPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172424
172787
|
const sections = [];
|
|
172425
|
-
sections.push(
|
|
172426
|
-
sections.push(
|
|
172427
|
-
const instructions =
|
|
172788
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
172789
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
172790
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
172428
172791
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
172429
172792
|
}
|
|
172430
172793
|
/** @internal */
|
|
@@ -172468,7 +172831,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172468
172831
|
let currentPt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(cursorPt, points[0], normal, this.targetView, true);
|
|
172469
172832
|
if (undefined === currentPt)
|
|
172470
172833
|
currentPt = cursorPt.clone();
|
|
172471
|
-
if (2 === points.length && 0 === (_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.toolAdmin.currentInputState.qualifiers &
|
|
172834
|
+
if (2 === points.length && 0 === (_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.toolAdmin.currentInputState.qualifiers & _Tool__WEBPACK_IMPORTED_MODULE_10__.BeModifierKeys.Control)) {
|
|
172472
172835
|
const xDir = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(points[0], points[1]);
|
|
172473
172836
|
const xLen = xDir.magnitude();
|
|
172474
172837
|
xDir.normalizeInPlace();
|
|
@@ -172494,8 +172857,8 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172494
172857
|
const points = this.getShapePoints(this._lastMotionPt);
|
|
172495
172858
|
if (points.length < 2)
|
|
172496
172859
|
return;
|
|
172497
|
-
const builderAccVis = context.createGraphicBuilder(
|
|
172498
|
-
const builderAccHid = context.createGraphicBuilder(
|
|
172860
|
+
const builderAccVis = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldDecoration);
|
|
172861
|
+
const builderAccHid = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
172499
172862
|
const colorAccVis = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);
|
|
172500
172863
|
const colorAccHid = colorAccVis.withAlpha(100);
|
|
172501
172864
|
const fillAccVis = context.viewport.hilite.color.withAlpha(50);
|
|
@@ -172532,17 +172895,17 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172532
172895
|
const isSpatial = (undefined !== this.targetView && this.targetView.view.isSpatialView());
|
|
172533
172896
|
const toolTip = document.createElement("div");
|
|
172534
172897
|
let toolTipHtml = "";
|
|
172535
|
-
const areaFormatterSpec = await
|
|
172898
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
172536
172899
|
if (undefined !== areaFormatterSpec) {
|
|
172537
172900
|
const formattedArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._area, areaFormatterSpec);
|
|
172538
172901
|
toolTipHtml += `${translateBold("Area") + formattedArea}<br>`;
|
|
172539
172902
|
}
|
|
172540
|
-
const perimeterFormatterSpec = await
|
|
172903
|
+
const perimeterFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172541
172904
|
if (undefined !== perimeterFormatterSpec) {
|
|
172542
172905
|
const formattedPerimeter = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._perimeter, perimeterFormatterSpec);
|
|
172543
172906
|
toolTipHtml += `${translateBold("Perimeter") + formattedPerimeter}<br>`;
|
|
172544
172907
|
}
|
|
172545
|
-
const coordFormatterSpec = await
|
|
172908
|
+
const coordFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172546
172909
|
if (undefined !== coordFormatterSpec) {
|
|
172547
172910
|
let pointAdjusted = this._centroid.clone();
|
|
172548
172911
|
if (isSpatial) {
|
|
@@ -172563,7 +172926,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172563
172926
|
reportMeasurements() {
|
|
172564
172927
|
if (undefined === this._marker)
|
|
172565
172928
|
return;
|
|
172566
|
-
const briefMsg = `${
|
|
172929
|
+
const briefMsg = `${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("Measure.Labels.Area")}: ${this._marker.label}`;
|
|
172567
172930
|
const msgDetail = new _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessagePriority.Info, briefMsg, undefined, _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessageType.Sticky);
|
|
172568
172931
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(msgDetail);
|
|
172569
172932
|
}
|
|
@@ -172581,7 +172944,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172581
172944
|
const toolTip = await this.getMarkerToolTip();
|
|
172582
172945
|
this._acceptedMeasurement = new MeasureMarker("1", toolTip, this._centroid, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(25, 25));
|
|
172583
172946
|
this._marker = undefined;
|
|
172584
|
-
const areaFormatterSpec = await
|
|
172947
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
172585
172948
|
if (undefined === areaFormatterSpec)
|
|
172586
172949
|
return;
|
|
172587
172950
|
const formattedTotalArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._area, areaFormatterSpec);
|
|
@@ -172591,23 +172954,23 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172591
172954
|
/** @internal */
|
|
172592
172955
|
async onDataButtonDown(ev) {
|
|
172593
172956
|
if (undefined === this.targetView)
|
|
172594
|
-
return
|
|
172957
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172595
172958
|
if (this._isComplete)
|
|
172596
172959
|
await this.onReinitialize();
|
|
172597
172960
|
if (this._points.length > 1 && !ev.isControlKey) {
|
|
172598
172961
|
const points = this.getShapePoints(ev.point);
|
|
172599
172962
|
if (points.length < 3)
|
|
172600
|
-
return
|
|
172963
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172601
172964
|
this._isComplete = true;
|
|
172602
172965
|
this._points.length = 0;
|
|
172603
172966
|
for (const pt of points)
|
|
172604
172967
|
this._points.push(pt);
|
|
172605
172968
|
await this.updateTotals();
|
|
172606
172969
|
this.setupAndPromptForNextAction();
|
|
172607
|
-
return
|
|
172970
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172608
172971
|
}
|
|
172609
172972
|
if (undefined === this._matrix && undefined === (this._matrix = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.getContextRotation(this.orientation, this.targetView)))
|
|
172610
|
-
return
|
|
172973
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172611
172974
|
const currPt = ev.point.clone();
|
|
172612
172975
|
if (this._points.length > 0) {
|
|
172613
172976
|
const planePt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(currPt, this._points[0], this._matrix.getColumn(2), ev.viewport, true);
|
|
@@ -172616,14 +172979,14 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172616
172979
|
}
|
|
172617
172980
|
this._points.push(currPt);
|
|
172618
172981
|
this.setupAndPromptForNextAction();
|
|
172619
|
-
return
|
|
172982
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172620
172983
|
}
|
|
172621
172984
|
/** @internal */
|
|
172622
172985
|
async onResetButtonUp(ev) {
|
|
172623
172986
|
if (undefined !== ev.viewport)
|
|
172624
172987
|
ev.viewport.invalidateDecorations();
|
|
172625
172988
|
await this.onReinitialize();
|
|
172626
|
-
return
|
|
172989
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172627
172990
|
}
|
|
172628
172991
|
/** @internal */
|
|
172629
172992
|
async onReinitialize() {
|
|
@@ -172653,7 +173016,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
172653
173016
|
/** Base class for mass properties tools.
|
|
172654
173017
|
* @public
|
|
172655
173018
|
*/
|
|
172656
|
-
class MeasureElementTool extends
|
|
173019
|
+
class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
172657
173020
|
/** @internal */
|
|
172658
173021
|
_checkedIds = new Map();
|
|
172659
173022
|
/** @internal */
|
|
@@ -172689,33 +173052,33 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172689
173052
|
/** @internal */
|
|
172690
173053
|
showPrompt() {
|
|
172691
173054
|
const mainMsg = (this._useSelection ? (0 === this._acceptedMeasurements.length ? "ElementSet.Prompts.ConfirmSelection" : "ElementSet.Prompts.InspectResult") : "ElementSet.Prompts.IdentifyElement");
|
|
172692
|
-
const mainInstruction =
|
|
173055
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(mainMsg));
|
|
172693
173056
|
const mouseInstructions = [];
|
|
172694
173057
|
const touchInstructions = [];
|
|
172695
173058
|
if (this._useSelection) {
|
|
172696
173059
|
if (0 === this._acceptedMeasurements.length) {
|
|
172697
|
-
touchInstructions.push(
|
|
172698
|
-
mouseInstructions.push(
|
|
172699
|
-
touchInstructions.push(
|
|
172700
|
-
mouseInstructions.push(
|
|
173060
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.OneTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
173061
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
173062
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.RejectSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
173063
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.RejectSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172701
173064
|
}
|
|
172702
173065
|
else {
|
|
172703
|
-
touchInstructions.push(
|
|
172704
|
-
mouseInstructions.push(
|
|
173066
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Exit"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
173067
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Exit"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172705
173068
|
}
|
|
172706
173069
|
}
|
|
172707
173070
|
else {
|
|
172708
|
-
touchInstructions.push(
|
|
172709
|
-
mouseInstructions.push(
|
|
173071
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.OneTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptElement"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
173072
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.AcceptElement"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172710
173073
|
if (0 !== this._acceptedMeasurements.length) {
|
|
172711
|
-
touchInstructions.push(
|
|
172712
|
-
mouseInstructions.push(
|
|
173074
|
+
touchInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.TwoTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Touch));
|
|
173075
|
+
mouseInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceImage.RightClick, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistanceInputMethod.Mouse));
|
|
172713
173076
|
}
|
|
172714
173077
|
}
|
|
172715
173078
|
const sections = [];
|
|
172716
|
-
sections.push(
|
|
172717
|
-
sections.push(
|
|
172718
|
-
const instructions =
|
|
173079
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
173080
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
173081
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
172719
173082
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
172720
173083
|
}
|
|
172721
173084
|
/** @internal */
|
|
@@ -172752,7 +173115,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172752
173115
|
default:
|
|
172753
173116
|
return;
|
|
172754
173117
|
}
|
|
172755
|
-
const briefMsg = `${
|
|
173118
|
+
const briefMsg = `${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(label)}: ${this._totalMarker.label}`;
|
|
172756
173119
|
const msgDetail = new _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessagePriority.Info, briefMsg, undefined, _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessageType.Sticky);
|
|
172757
173120
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(msgDetail);
|
|
172758
173121
|
}
|
|
@@ -172763,7 +173126,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172763
173126
|
let toolTipHtml = "";
|
|
172764
173127
|
switch (this.getOperation()) {
|
|
172765
173128
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateLengths: {
|
|
172766
|
-
const distanceFormatterSpec = await
|
|
173129
|
+
const distanceFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172767
173130
|
if (undefined !== distanceFormatterSpec) {
|
|
172768
173131
|
const formattedLength = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.length ? responseProps.length : 0, distanceFormatterSpec);
|
|
172769
173132
|
toolTipHtml += `${translateBold("Length") + formattedLength}<br>`;
|
|
@@ -172771,13 +173134,13 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172771
173134
|
break;
|
|
172772
173135
|
}
|
|
172773
173136
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateAreas: {
|
|
172774
|
-
const areaFormatterSpec = await
|
|
173137
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
172775
173138
|
if (undefined !== areaFormatterSpec) {
|
|
172776
173139
|
const formattedArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.area ? responseProps.area : 0, areaFormatterSpec);
|
|
172777
173140
|
toolTipHtml += `${translateBold("Area") + formattedArea}<br>`;
|
|
172778
173141
|
}
|
|
172779
173142
|
if (responseProps.perimeter) {
|
|
172780
|
-
const perimeterFormatterSpec = await
|
|
173143
|
+
const perimeterFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172781
173144
|
if (undefined !== perimeterFormatterSpec) {
|
|
172782
173145
|
const formattedPerimeter = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.perimeter, perimeterFormatterSpec);
|
|
172783
173146
|
toolTipHtml += `${translateBold("Perimeter") + formattedPerimeter}<br>`;
|
|
@@ -172786,13 +173149,13 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172786
173149
|
break;
|
|
172787
173150
|
}
|
|
172788
173151
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateVolumes: {
|
|
172789
|
-
const volumeFormatterSpec = await
|
|
173152
|
+
const volumeFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.VOLUME", "Units.CUB_M");
|
|
172790
173153
|
if (undefined !== volumeFormatterSpec) {
|
|
172791
173154
|
const formattedVolume = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.volume ? responseProps.volume : 0, volumeFormatterSpec);
|
|
172792
173155
|
toolTipHtml += `${translateBold("Volume") + formattedVolume}<br>`;
|
|
172793
173156
|
}
|
|
172794
173157
|
if (responseProps.area) {
|
|
172795
|
-
const areaFormatterSpec = await
|
|
173158
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
172796
173159
|
if (undefined !== areaFormatterSpec) {
|
|
172797
173160
|
const formattedArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.area, areaFormatterSpec);
|
|
172798
173161
|
toolTipHtml += `${translateBold("Area") + formattedArea}<br>`;
|
|
@@ -172802,7 +173165,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172802
173165
|
}
|
|
172803
173166
|
}
|
|
172804
173167
|
if (responseProps.centroid) {
|
|
172805
|
-
const coordFormatterSpec = await
|
|
173168
|
+
const coordFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172806
173169
|
if (undefined !== coordFormatterSpec) {
|
|
172807
173170
|
let pointAdjusted = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(responseProps.centroid);
|
|
172808
173171
|
if (isSpatial) {
|
|
@@ -172853,21 +173216,21 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172853
173216
|
return;
|
|
172854
173217
|
switch (operation) {
|
|
172855
173218
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateLengths:
|
|
172856
|
-
const distanceFormatterSpec = await
|
|
173219
|
+
const distanceFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
172857
173220
|
if (undefined === distanceFormatterSpec)
|
|
172858
173221
|
return;
|
|
172859
173222
|
const formattedTotalDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalValue, distanceFormatterSpec);
|
|
172860
173223
|
this._totalMarker = new MeasureLabel(labelPt, formattedTotalDistance);
|
|
172861
173224
|
break;
|
|
172862
173225
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateAreas:
|
|
172863
|
-
const areaFormatterSpec = await
|
|
173226
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
172864
173227
|
if (undefined === areaFormatterSpec)
|
|
172865
173228
|
return;
|
|
172866
173229
|
const formattedTotalArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalValue, areaFormatterSpec);
|
|
172867
173230
|
this._totalMarker = new MeasureLabel(labelPt, formattedTotalArea);
|
|
172868
173231
|
break;
|
|
172869
173232
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateVolumes:
|
|
172870
|
-
const volumeFormatterSpec = await
|
|
173233
|
+
const volumeFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.VOLUME", "Units.CUB_M");
|
|
172871
173234
|
if (undefined === volumeFormatterSpec)
|
|
172872
173235
|
return;
|
|
172873
173236
|
const formattedTotalVolume = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalValue, volumeFormatterSpec);
|
|
@@ -172925,7 +173288,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172925
173288
|
/** @internal */
|
|
172926
173289
|
async onResetButtonUp(_ev) {
|
|
172927
173290
|
await this.onReinitialize();
|
|
172928
|
-
return
|
|
173291
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172929
173292
|
}
|
|
172930
173293
|
/** @internal */
|
|
172931
173294
|
async onDataButtonDown(ev) {
|
|
@@ -172933,20 +173296,20 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172933
173296
|
if (0 === this._acceptedMeasurements.length && undefined !== ev.viewport) {
|
|
172934
173297
|
await this.doMeasureSelectedElements(ev.viewport);
|
|
172935
173298
|
if (0 !== this._acceptedMeasurements.length)
|
|
172936
|
-
return
|
|
172937
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessagePriority.Error,
|
|
173299
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.Yes;
|
|
173300
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessagePriority.Error, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Error.NotSupportedElmType")));
|
|
172938
173301
|
await this.onReinitialize();
|
|
172939
173302
|
}
|
|
172940
|
-
return
|
|
173303
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.Yes;
|
|
172941
173304
|
}
|
|
172942
173305
|
const hit = await _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.locateManager.doLocate(new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_4__.LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);
|
|
172943
173306
|
if (undefined === hit || !hit.isElementHit)
|
|
172944
|
-
return
|
|
173307
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172945
173308
|
const result = this._checkedIds.get(hit.sourceId);
|
|
172946
173309
|
if (undefined === result)
|
|
172947
|
-
return
|
|
173310
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172948
173311
|
if (-1 !== this._acceptedIds.indexOf(hit.sourceId))
|
|
172949
|
-
return
|
|
173312
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.Yes; // Already accepted, not rejected in filterHit to avoid showing "not" cursor...
|
|
172950
173313
|
const toolTip = await this.getMarkerToolTip(result);
|
|
172951
173314
|
const point = result.centroid ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(result.centroid) : ev.point.clone();
|
|
172952
173315
|
const marker = new MeasureMarker((this._acceptedMeasurements.length + 1).toString(), toolTip, point, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(25, 25));
|
|
@@ -172957,7 +173320,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
172957
173320
|
this.setupAndPromptForNextAction();
|
|
172958
173321
|
if (undefined !== ev.viewport)
|
|
172959
173322
|
ev.viewport.invalidateDecorations();
|
|
172960
|
-
return
|
|
173323
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
172961
173324
|
}
|
|
172962
173325
|
/** @internal */
|
|
172963
173326
|
async onUndoPreviousStep() {
|
|
@@ -175073,6 +175436,7 @@ class CurrentInputState {
|
|
|
175073
175436
|
lastButton = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data;
|
|
175074
175437
|
inputSource = _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Unknown;
|
|
175075
175438
|
lastMotion = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d();
|
|
175439
|
+
lastMotionEvent;
|
|
175076
175440
|
lastWheelEvent;
|
|
175077
175441
|
lastTouchStart;
|
|
175078
175442
|
touchTapTimer;
|
|
@@ -175090,7 +175454,7 @@ class CurrentInputState {
|
|
|
175090
175454
|
onStartDrag(button) { this.button[button].isDragging = true; }
|
|
175091
175455
|
onInstallTool() {
|
|
175092
175456
|
this.clearKeyQualifiers();
|
|
175093
|
-
this.lastWheelEvent = undefined;
|
|
175457
|
+
this.lastWheelEvent = this.lastMotionEvent = undefined;
|
|
175094
175458
|
this.lastTouchStart = this.touchTapTimer = this.touchTapCount = undefined;
|
|
175095
175459
|
}
|
|
175096
175460
|
clearKeyQualifiers() { this.qualifiers = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.None; }
|
|
@@ -175365,6 +175729,9 @@ class ToolAdmin {
|
|
|
175365
175729
|
this.clearMotionPromises();
|
|
175366
175730
|
// make sure tools don't think the cursor is still in this viewport.
|
|
175367
175731
|
this.onMouseLeave(vp);
|
|
175732
|
+
// Invalidate last motion if for this viewport...
|
|
175733
|
+
if (this.currentInputState.lastMotionEvent?.viewport === vp)
|
|
175734
|
+
this.currentInputState.lastMotionEvent = undefined;
|
|
175368
175735
|
// Remove any events associated with this viewport.
|
|
175369
175736
|
ToolAdmin._toolEvents = ToolAdmin._toolEvents.filter((ev) => ev.vp !== vp);
|
|
175370
175737
|
}
|
|
@@ -175728,6 +176095,7 @@ class ToolAdmin {
|
|
|
175728
176095
|
toolPromise.then(() => {
|
|
175729
176096
|
if (undefined === this._toolMotionPromise)
|
|
175730
176097
|
return; // Only early return if canceled, result from a previous motion is preferable to showing nothing...
|
|
176098
|
+
this.currentInputState.lastMotionEvent = motion; // Save to use for simulation motion...
|
|
175731
176099
|
// Update decorations when dynamics are inactive...
|
|
175732
176100
|
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.viewManager.inDynamicsMode) {
|
|
175733
176101
|
vp.invalidateDecorations();
|
|
@@ -176469,7 +176837,8 @@ class ToolAdmin {
|
|
|
176469
176837
|
}
|
|
176470
176838
|
/** Can be called by tools to invoke their [[InteractiveTool.onDynamicFrame]] method without requiring a motion event. */
|
|
176471
176839
|
simulateMotionEvent() {
|
|
176472
|
-
|
|
176840
|
+
// NOTE: Prefer last resolved motion over current cursor location which could be out of the view, or moved from last AccuSnap etc.
|
|
176841
|
+
this.updateDynamics(this.currentInputState.lastMotionEvent, undefined, true);
|
|
176473
176842
|
}
|
|
176474
176843
|
/** @internal */
|
|
176475
176844
|
setIncompatibleViewportCursor(restore) {
|
|
@@ -180647,12 +181016,14 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
180647
181016
|
get targetHeight() { return this.targetHeightProperty.value; }
|
|
180648
181017
|
set targetHeight(value) { this.targetHeightProperty.value = value; }
|
|
180649
181018
|
syncCameraHeightState() {
|
|
180650
|
-
|
|
181019
|
+
const specs = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.quantityFormatter.getSpecsByName(this.cameraHeightProperty.description.kindOfQuantityName ?? "AecUnits.LENGTH");
|
|
181020
|
+
this.cameraHeightProperty.displayValue = specs ? specs.formatterSpec.applyFormatting(this.cameraHeight) : this.cameraHeight.toFixed(2);
|
|
180651
181021
|
this.cameraHeightProperty.isDisabled = !this.useCameraHeight;
|
|
180652
181022
|
this.syncToolSettingsProperties([this.cameraHeightProperty.syncItem]);
|
|
180653
181023
|
}
|
|
180654
181024
|
syncTargetHeightState() {
|
|
180655
|
-
|
|
181025
|
+
const specs = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.quantityFormatter.getSpecsByName(this.targetHeightProperty.description.kindOfQuantityName ?? "AecUnits.LENGTH");
|
|
181026
|
+
this.targetHeightProperty.displayValue = specs ? specs.formatterSpec.applyFormatting(this.targetHeight) : this.targetHeight.toFixed(2);
|
|
180656
181027
|
this.targetHeightProperty.isDisabled = !this.useTargetHeight;
|
|
180657
181028
|
this.syncToolSettingsProperties([this.targetHeightProperty.syncItem]);
|
|
180658
181029
|
}
|
|
@@ -301734,9 +302105,11 @@ class BaseQuantityDescription {
|
|
|
301734
302105
|
displayLabel;
|
|
301735
302106
|
typename;
|
|
301736
302107
|
editor;
|
|
301737
|
-
|
|
302108
|
+
kindOfQuantityName;
|
|
302109
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
301738
302110
|
this.name = name;
|
|
301739
302111
|
this.displayLabel = displayLabel;
|
|
302112
|
+
this.kindOfQuantityName = kindOfQuantityName;
|
|
301740
302113
|
this.typename = _properties_StandardTypeNames__WEBPACK_IMPORTED_MODULE_1__.StandardTypeNames.Number;
|
|
301741
302114
|
this.editor = {
|
|
301742
302115
|
name: _properties_StandardEditorNames__WEBPACK_IMPORTED_MODULE_2__.StandardEditorNames.NumberCustom,
|
|
@@ -302273,28 +302646,6 @@ const getClassName = (obj) => {
|
|
|
302273
302646
|
};
|
|
302274
302647
|
|
|
302275
302648
|
|
|
302276
|
-
/***/ }),
|
|
302277
|
-
|
|
302278
|
-
/***/ "../../core/frontend/lib/esm/extension/providers lazy recursive":
|
|
302279
|
-
/*!******************************************************************************!*\
|
|
302280
|
-
!*** ../../core/frontend/lib/esm/extension/providers/ lazy namespace object ***!
|
|
302281
|
-
\******************************************************************************/
|
|
302282
|
-
/***/ ((module) => {
|
|
302283
|
-
|
|
302284
|
-
function webpackEmptyAsyncContext(req) {
|
|
302285
|
-
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
302286
|
-
// uncaught exception popping up in devtools
|
|
302287
|
-
return Promise.resolve().then(() => {
|
|
302288
|
-
var e = new Error("Cannot find module '" + req + "'");
|
|
302289
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
302290
|
-
throw e;
|
|
302291
|
-
});
|
|
302292
|
-
}
|
|
302293
|
-
webpackEmptyAsyncContext.keys = () => ([]);
|
|
302294
|
-
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
|
|
302295
|
-
webpackEmptyAsyncContext.id = "../../core/frontend/lib/esm/extension/providers lazy recursive";
|
|
302296
|
-
module.exports = webpackEmptyAsyncContext;
|
|
302297
|
-
|
|
302298
302649
|
/***/ }),
|
|
302299
302650
|
|
|
302300
302651
|
/***/ "?088e":
|
|
@@ -312367,7 +312718,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
312367
312718
|
/***/ ((module) => {
|
|
312368
312719
|
|
|
312369
312720
|
"use strict";
|
|
312370
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
312721
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.113","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
312371
312722
|
|
|
312372
312723
|
/***/ })
|
|
312373
312724
|
|