@itwin/rpcinterface-full-stack-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 +581 -230
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -88818,13 +88818,13 @@ var CurrentImdlVersion;
|
|
|
88818
88818
|
* 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
|
|
88819
88819
|
* greater minor version than CurrentVersion.Minor, although some data may be skipped.
|
|
88820
88820
|
*/
|
|
88821
|
-
CurrentImdlVersion[CurrentImdlVersion["Major"] =
|
|
88821
|
+
CurrentImdlVersion[CurrentImdlVersion["Major"] = 37] = "Major";
|
|
88822
88822
|
/** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
|
|
88823
88823
|
* read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
|
|
88824
88824
|
*/
|
|
88825
88825
|
CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
|
|
88826
88826
|
/** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
|
|
88827
|
-
CurrentImdlVersion[CurrentImdlVersion["Combined"] =
|
|
88827
|
+
CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2424832] = "Combined";
|
|
88828
88828
|
})(CurrentImdlVersion || (CurrentImdlVersion = {}));
|
|
88829
88829
|
/** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
|
|
88830
88830
|
* @internal
|
|
@@ -89169,6 +89169,7 @@ var TileOptions;
|
|
|
89169
89169
|
disableMagnification: false,
|
|
89170
89170
|
alwaysSubdivideIncompleteTiles: false,
|
|
89171
89171
|
edgeOptions,
|
|
89172
|
+
disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),
|
|
89172
89173
|
};
|
|
89173
89174
|
}
|
|
89174
89175
|
TileOptions.fromTreeIdAndContentId = fromTreeIdAndContentId;
|
|
@@ -89203,14 +89204,15 @@ class Parser {
|
|
|
89203
89204
|
}
|
|
89204
89205
|
if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key] === "number" && !Number.isFinite(parsedContentId[key])))
|
|
89205
89206
|
throw new Error("Invalid content Id");
|
|
89207
|
+
const disablePolyfaceDecimation = options.disablePolyfaceDecimation;
|
|
89206
89208
|
let treeId;
|
|
89207
89209
|
if (classifier) {
|
|
89208
|
-
treeId = { ...classifier, animationId };
|
|
89210
|
+
treeId = { ...classifier, animationId, disablePolyfaceDecimation };
|
|
89209
89211
|
}
|
|
89210
89212
|
else {
|
|
89211
89213
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== primary);
|
|
89212
89214
|
const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;
|
|
89213
|
-
treeId = { ...primary, animationId, type: _FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.Primary, enforceDisplayPriority };
|
|
89215
|
+
treeId = { ...primary, animationId, type: _FeatureTable__WEBPACK_IMPORTED_MODULE_2__.BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };
|
|
89214
89216
|
}
|
|
89215
89217
|
return {
|
|
89216
89218
|
contentId: parsedContentId,
|
|
@@ -89313,6 +89315,7 @@ const defaultTileOptions = Object.freeze({
|
|
|
89313
89315
|
useLargerTiles: true,
|
|
89314
89316
|
disableMagnification: false,
|
|
89315
89317
|
alwaysSubdivideIncompleteTiles: false,
|
|
89318
|
+
disablePolyfaceDecimation: false,
|
|
89316
89319
|
edgeOptions: {
|
|
89317
89320
|
type: "compact",
|
|
89318
89321
|
smooth: true,
|
|
@@ -89408,7 +89411,8 @@ var TreeFlags;
|
|
|
89408
89411
|
TreeFlags[TreeFlags["EnforceDisplayPriority"] = 2] = "EnforceDisplayPriority";
|
|
89409
89412
|
TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
|
|
89410
89413
|
TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
|
|
89411
|
-
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents";
|
|
89414
|
+
TreeFlags[TreeFlags["ExpandProjectExtents"] = 16] = "ExpandProjectExtents";
|
|
89415
|
+
TreeFlags[TreeFlags["DisablePolyfaceDecimation"] = 32] = "DisablePolyfaceDecimation";
|
|
89412
89416
|
})(TreeFlags || (TreeFlags = {}));
|
|
89413
89417
|
function animationIdToString(animationId) {
|
|
89414
89418
|
return `A:${animationId}_`;
|
|
@@ -89421,6 +89425,8 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
|
|
|
89421
89425
|
let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;
|
|
89422
89426
|
if (options.optimizeBRepProcessing)
|
|
89423
89427
|
flags |= TreeFlags.OptimizeBRepProcessing;
|
|
89428
|
+
if (options.disablePolyfaceDecimation)
|
|
89429
|
+
flags |= TreeFlags.DisablePolyfaceDecimation;
|
|
89424
89430
|
if (options.useLargerTiles)
|
|
89425
89431
|
flags |= TreeFlags.UseLargerTiles;
|
|
89426
89432
|
if (options.expandProjectExtents)
|
|
@@ -99543,6 +99549,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
99543
99549
|
|
|
99544
99550
|
|
|
99545
99551
|
|
|
99552
|
+
const loggerCategory = "SchemaFormatsProvider";
|
|
99546
99553
|
/**
|
|
99547
99554
|
* Provides default formats and kind of quantities from a given SchemaContext or SchemaLocater.
|
|
99548
99555
|
* @beta
|
|
@@ -99581,7 +99588,14 @@ class SchemaFormatsProvider {
|
|
|
99581
99588
|
this.onFormatsChanged.raiseEvent({ formatsChanged });
|
|
99582
99589
|
}
|
|
99583
99590
|
async getKindOfQuantityFormatFromSchema(itemKey) {
|
|
99584
|
-
|
|
99591
|
+
let kindOfQuantity;
|
|
99592
|
+
try {
|
|
99593
|
+
kindOfQuantity = await this._context.getSchemaItem(itemKey, _Metadata_KindOfQuantity__WEBPACK_IMPORTED_MODULE_5__.KindOfQuantity);
|
|
99594
|
+
}
|
|
99595
|
+
catch {
|
|
99596
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.Logger.logError(loggerCategory, `Failed to find KindOfQuantity ${itemKey.fullName}`);
|
|
99597
|
+
return undefined;
|
|
99598
|
+
}
|
|
99585
99599
|
if (!kindOfQuantity) {
|
|
99586
99600
|
return undefined;
|
|
99587
99601
|
}
|
|
@@ -99626,13 +99640,27 @@ class SchemaFormatsProvider {
|
|
|
99626
99640
|
async getFormat(name) {
|
|
99627
99641
|
const [schemaName, schemaItemName] = _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_2__.SchemaItem.parseFullName(name);
|
|
99628
99642
|
const schemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaKey(schemaName);
|
|
99629
|
-
|
|
99643
|
+
let schema;
|
|
99644
|
+
try {
|
|
99645
|
+
schema = await this._context.getSchema(schemaKey);
|
|
99646
|
+
}
|
|
99647
|
+
catch {
|
|
99648
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.Logger.logError(loggerCategory, `Failed to find schema ${schemaName}`);
|
|
99649
|
+
return undefined;
|
|
99650
|
+
}
|
|
99630
99651
|
if (!schema) {
|
|
99631
99652
|
return undefined;
|
|
99632
99653
|
}
|
|
99633
99654
|
const itemKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaItemKey(schemaItemName, schema.schemaKey);
|
|
99634
99655
|
if (schema.name === "Formats") {
|
|
99635
|
-
|
|
99656
|
+
let format;
|
|
99657
|
+
try {
|
|
99658
|
+
format = await this._context.getSchemaItem(itemKey, _Metadata_Format__WEBPACK_IMPORTED_MODULE_3__.Format);
|
|
99659
|
+
}
|
|
99660
|
+
catch {
|
|
99661
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.Logger.logError(loggerCategory, `Failed to find Format ${itemKey.fullName}`);
|
|
99662
|
+
return undefined;
|
|
99663
|
+
}
|
|
99636
99664
|
if (!format) {
|
|
99637
99665
|
return undefined;
|
|
99638
99666
|
}
|
|
@@ -101662,20 +101690,16 @@ class ECSchemaRpcLocater {
|
|
|
101662
101690
|
return undefined;
|
|
101663
101691
|
}
|
|
101664
101692
|
/**
|
|
101665
|
-
*
|
|
101666
|
-
*
|
|
101667
|
-
* @param
|
|
101668
|
-
* @param
|
|
101693
|
+
* This method is not supported for locating schemas over RPC/HTTP.
|
|
101694
|
+
* Use the asynchronous `getSchema` method instead.
|
|
101695
|
+
* @param _schemaKey Key to look up
|
|
101696
|
+
* @param _matchType How to match key against candidate schemas
|
|
101697
|
+
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
101698
|
+
* @throws Error Always throws an error indicating this method is not supported.
|
|
101699
|
+
* @deprecated in 5.0 Use the asynchronous `getSchema` method for schema retrieval.
|
|
101669
101700
|
*/
|
|
101670
|
-
getSchemaSync(
|
|
101671
|
-
|
|
101672
|
-
return props;
|
|
101673
|
-
});
|
|
101674
|
-
const schema = _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.fromJsonSync(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
|
|
101675
|
-
if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
|
|
101676
|
-
return schema;
|
|
101677
|
-
}
|
|
101678
|
-
return undefined;
|
|
101701
|
+
getSchemaSync(_schemaKey, _matchType, _context) {
|
|
101702
|
+
throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
|
|
101679
101703
|
}
|
|
101680
101704
|
}
|
|
101681
101705
|
|
|
@@ -103890,6 +103914,8 @@ class AccuDraw {
|
|
|
103890
103914
|
onFieldKeyinStatusChange(_index) { }
|
|
103891
103915
|
/** Called to request focus change to the specified input field */
|
|
103892
103916
|
setFocusItem(_index) { }
|
|
103917
|
+
/** Called to get the item field that currently has input focus */
|
|
103918
|
+
getFocusItem() { return undefined; }
|
|
103893
103919
|
static getMinPolarMag(origin) {
|
|
103894
103920
|
return (1.0e-12 * (1.0 + origin.magnitude()));
|
|
103895
103921
|
}
|
|
@@ -113216,7 +113242,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
113216
113242
|
|
|
113217
113243
|
/** @public */
|
|
113218
113244
|
const ITWINJS_CORE_VERSION = _package_json__WEBPACK_IMPORTED_MODULE_0__.version;
|
|
113219
|
-
const COPYRIGHT_NOTICE =
|
|
113245
|
+
const COPYRIGHT_NOTICE = `Copyright © 2017-${new Date().getFullYear()} <a href="https://www.bentley.com" target="_blank" rel="noopener noreferrer">Bentley Systems, Inc.</a>`;
|
|
113220
113246
|
|
|
113221
113247
|
|
|
113222
113248
|
|
|
@@ -113292,6 +113318,7 @@ class IModelApp {
|
|
|
113292
113318
|
static _hubAccess;
|
|
113293
113319
|
static _realityDataAccess;
|
|
113294
113320
|
static _publicPath;
|
|
113321
|
+
static _formatsProviderManager;
|
|
113295
113322
|
// No instances of IModelApp may be created. All members are static and must be on the singleton object IModelApp.
|
|
113296
113323
|
constructor() { }
|
|
113297
113324
|
/** Event raised just before the frontend IModelApp is to be [[shutdown]]. */
|
|
@@ -113366,6 +113393,14 @@ class IModelApp {
|
|
|
113366
113393
|
* The path should always end with a trailing `/`.
|
|
113367
113394
|
*/
|
|
113368
113395
|
static get publicPath() { return this._publicPath; }
|
|
113396
|
+
/** The [[FormatsProvider]] for this session.
|
|
113397
|
+
* @param provider The provider to use for formatting quantities.
|
|
113398
|
+
* @beta
|
|
113399
|
+
*/
|
|
113400
|
+
static get formatsProvider() { return this._formatsProviderManager; }
|
|
113401
|
+
static set formatsProvider(provider) {
|
|
113402
|
+
this._formatsProviderManager.formatsProvider = provider;
|
|
113403
|
+
}
|
|
113369
113404
|
/** @alpha */
|
|
113370
113405
|
static extensionAdmin = this._createExtensionAdmin();
|
|
113371
113406
|
/** Map of classFullName to EntityState class */
|
|
@@ -113466,6 +113501,7 @@ class IModelApp {
|
|
|
113466
113501
|
this._terrainProviderRegistry = new _tile_internal__WEBPACK_IMPORTED_MODULE_26__.TerrainProviderRegistry();
|
|
113467
113502
|
this._realityDataSourceProviders = new _RealityDataSource__WEBPACK_IMPORTED_MODULE_25__.RealityDataSourceProviderRegistry();
|
|
113468
113503
|
this._realityDataAccess = opts.realityDataAccess;
|
|
113504
|
+
this._formatsProviderManager = new _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_19__.FormatsProviderManager(opts.formatsProvider ?? new _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_19__.QuantityTypeFormatsProvider());
|
|
113469
113505
|
this._publicPath = opts.publicPath ?? "";
|
|
113470
113506
|
[
|
|
113471
113507
|
this.renderSystem,
|
|
@@ -113497,6 +113533,8 @@ class IModelApp {
|
|
|
113497
113533
|
this._entityClasses.clear();
|
|
113498
113534
|
this.authorizationClient = undefined;
|
|
113499
113535
|
this._initialized = false;
|
|
113536
|
+
this.quantityFormatter[Symbol.dispose]();
|
|
113537
|
+
this.resetFormatsProvider();
|
|
113500
113538
|
this.onAfterStartup.clear();
|
|
113501
113539
|
}
|
|
113502
113540
|
/** Controls how frequently the application polls for changes that may require a new animation frame to be requested.
|
|
@@ -113747,6 +113785,13 @@ class IModelApp {
|
|
|
113747
113785
|
}
|
|
113748
113786
|
return this.localization.getLocalizedString(`iModelJs:${key.scope}.${key.val}`, key);
|
|
113749
113787
|
}
|
|
113788
|
+
/**
|
|
113789
|
+
* Resets the formatsProvider back to the default [[QuantityTypeFormatsProvider]].
|
|
113790
|
+
* @beta
|
|
113791
|
+
*/
|
|
113792
|
+
static resetFormatsProvider() {
|
|
113793
|
+
this.formatsProvider = new _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_19__.QuantityTypeFormatsProvider();
|
|
113794
|
+
}
|
|
113750
113795
|
/**
|
|
113751
113796
|
* Creates an instance of the ExtensionAdmin
|
|
113752
113797
|
* and registers an event to execute after startup is complete
|
|
@@ -121277,16 +121322,21 @@ class RenderContext {
|
|
|
121277
121322
|
* @public
|
|
121278
121323
|
*/
|
|
121279
121324
|
class DynamicsContext extends RenderContext {
|
|
121280
|
-
|
|
121325
|
+
_foreground;
|
|
121326
|
+
_overlay;
|
|
121281
121327
|
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
|
|
121282
121328
|
addGraphic(graphic) {
|
|
121283
|
-
|
|
121284
|
-
|
|
121285
|
-
|
|
121329
|
+
this.add(graphic, false);
|
|
121330
|
+
}
|
|
121331
|
+
/** @internal */
|
|
121332
|
+
add(graphic, isOverlay) {
|
|
121333
|
+
const key = isOverlay ? "_overlay" : "_foreground";
|
|
121334
|
+
const list = this[key] ?? (this[key] = []);
|
|
121335
|
+
list.push(graphic);
|
|
121286
121336
|
}
|
|
121287
121337
|
/** @internal */
|
|
121288
121338
|
changeDynamics() {
|
|
121289
|
-
this.viewport.changeDynamics(this.
|
|
121339
|
+
this.viewport.changeDynamics(this._foreground, this._overlay);
|
|
121290
121340
|
}
|
|
121291
121341
|
/** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].
|
|
121292
121342
|
* @param options Options describing how to create the builder.
|
|
@@ -122390,10 +122440,10 @@ class ViewManager {
|
|
|
122390
122440
|
this.inDynamicsMode = false;
|
|
122391
122441
|
const cursorVp = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.cursorView;
|
|
122392
122442
|
if (cursorVp)
|
|
122393
|
-
cursorVp.changeDynamics(undefined);
|
|
122443
|
+
cursorVp.changeDynamics(undefined, undefined);
|
|
122394
122444
|
for (const vp of this._viewports) {
|
|
122395
122445
|
if (vp !== cursorVp)
|
|
122396
|
-
vp.changeDynamics(undefined);
|
|
122446
|
+
vp.changeDynamics(undefined, undefined);
|
|
122397
122447
|
}
|
|
122398
122448
|
}
|
|
122399
122449
|
/** @internal */
|
|
@@ -125962,6 +126012,10 @@ class Viewport {
|
|
|
125962
126012
|
changeBackgroundMapProvider(props) {
|
|
125963
126013
|
this.displayStyle.changeBackgroundMapProvider(props);
|
|
125964
126014
|
}
|
|
126015
|
+
/** A reference to the [[TileTree]] used to display the background map in this viewport, if the background map is being displayed. */
|
|
126016
|
+
get backgroundMapTileTreeReference() {
|
|
126017
|
+
return this.backgroundMap;
|
|
126018
|
+
}
|
|
125965
126019
|
/** @internal */
|
|
125966
126020
|
get backgroundMap() { return this._mapTiledGraphicsProvider?.backgroundMap; }
|
|
125967
126021
|
/** @internal */
|
|
@@ -126691,8 +126745,8 @@ class Viewport {
|
|
|
126691
126745
|
return this.view.is3d() && this.view.isCameraOn;
|
|
126692
126746
|
}
|
|
126693
126747
|
/** @internal */
|
|
126694
|
-
changeDynamics(dynamics) {
|
|
126695
|
-
this.target.changeDynamics(dynamics);
|
|
126748
|
+
changeDynamics(dynamics, overlay) {
|
|
126749
|
+
this.target.changeDynamics(dynamics, overlay);
|
|
126696
126750
|
this.invalidateDecorations();
|
|
126697
126751
|
}
|
|
126698
126752
|
_assigningFlashedId = false;
|
|
@@ -136633,6 +136687,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
136633
136687
|
/* harmony export */ FlashMode: () => (/* reexport safe */ _FlashSettings__WEBPACK_IMPORTED_MODULE_22__.FlashMode),
|
|
136634
136688
|
/* harmony export */ FlashSettings: () => (/* reexport safe */ _FlashSettings__WEBPACK_IMPORTED_MODULE_22__.FlashSettings),
|
|
136635
136689
|
/* harmony export */ FlyViewTool: () => (/* reexport safe */ _tools_ViewTool__WEBPACK_IMPORTED_MODULE_114__.FlyViewTool),
|
|
136690
|
+
/* harmony export */ FormatsProviderManager: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.FormatsProviderManager),
|
|
136636
136691
|
/* harmony export */ FormattedQuantityDescription: () => (/* reexport safe */ _properties_FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_70__.FormattedQuantityDescription),
|
|
136637
136692
|
/* harmony export */ FrontendLoggerCategory: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.FrontendLoggerCategory),
|
|
136638
136693
|
/* harmony export */ Frustum2d: () => (/* reexport safe */ _Frustum2d__WEBPACK_IMPORTED_MODULE_24__.Frustum2d),
|
|
@@ -136761,6 +136816,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
136761
136816
|
/* harmony export */ QuadId: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_99__.QuadId),
|
|
136762
136817
|
/* harmony export */ QuantityFormatter: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.QuantityFormatter),
|
|
136763
136818
|
/* harmony export */ QuantityType: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.QuantityType),
|
|
136819
|
+
/* harmony export */ QuantityTypeFormatsProvider: () => (/* reexport safe */ _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_72__.QuantityTypeFormatsProvider),
|
|
136764
136820
|
/* harmony export */ RealityDataError: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.RealityDataError),
|
|
136765
136821
|
/* harmony export */ RealityDataSource: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.RealityDataSource),
|
|
136766
136822
|
/* harmony export */ RealityDataSourceProviderRegistry: () => (/* reexport safe */ _RealityDataSource__WEBPACK_IMPORTED_MODULE_121__.RealityDataSourceProviderRegistry),
|
|
@@ -137832,7 +137888,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
137832
137888
|
* @internal
|
|
137833
137889
|
*/
|
|
137834
137890
|
async function loadScript(jsUrl) {
|
|
137835
|
-
const module = await
|
|
137891
|
+
const module = await import(/* webpackIgnore: true */ /* @vite-ignore */ jsUrl);
|
|
137836
137892
|
return execute(module);
|
|
137837
137893
|
}
|
|
137838
137894
|
/** attempts to execute an extension module */
|
|
@@ -138282,7 +138338,7 @@ var MockRender;
|
|
|
138282
138338
|
get analysisFraction() { return 0; }
|
|
138283
138339
|
set analysisFraction(_fraction) { }
|
|
138284
138340
|
changeScene(_scene) { }
|
|
138285
|
-
changeDynamics(
|
|
138341
|
+
changeDynamics(_foreground, _overlay) { }
|
|
138286
138342
|
changeDecorations(_decs) { }
|
|
138287
138343
|
changeRenderPlan(_plan) { }
|
|
138288
138344
|
drawFrame(_sceneTime) { }
|
|
@@ -150372,9 +150428,8 @@ class RenderCommands {
|
|
|
150372
150428
|
this.addGraphics(gfx.foreground);
|
|
150373
150429
|
this.addBackgroundMapGraphics(gfx.background);
|
|
150374
150430
|
this.addOverlayGraphics(gfx.overlays);
|
|
150375
|
-
|
|
150376
|
-
|
|
150377
|
-
this.addDecorations(dynamics);
|
|
150431
|
+
this.addGraphics(gfx.foregroundDynamics);
|
|
150432
|
+
this.addOverlayGraphics(gfx.overlayDynamics);
|
|
150378
150433
|
const dec = gfx.decorations;
|
|
150379
150434
|
if (undefined !== dec) {
|
|
150380
150435
|
this.addBackground(dec.viewBackground);
|
|
@@ -157332,8 +157387,8 @@ class Target extends _render_RenderTarget__WEBPACK_IMPORTED_MODULE_7__.RenderTar
|
|
|
157332
157387
|
this.changeDrapesOrClassifiers(this._planarClassifiers, planarClassifiers);
|
|
157333
157388
|
this._planarClassifiers = planarClassifiers;
|
|
157334
157389
|
}
|
|
157335
|
-
changeDynamics(
|
|
157336
|
-
this.graphics.
|
|
157390
|
+
changeDynamics(foreground, overlay) {
|
|
157391
|
+
this.graphics.changeDynamics(foreground, overlay);
|
|
157337
157392
|
}
|
|
157338
157393
|
overrideFeatureSymbology(ovr) {
|
|
157339
157394
|
this.uniforms.branch.overrideFeatureSymbology(ovr);
|
|
@@ -158214,26 +158269,29 @@ class TargetGraphics {
|
|
|
158214
158269
|
foreground = [];
|
|
158215
158270
|
background = [];
|
|
158216
158271
|
overlays = [];
|
|
158217
|
-
|
|
158272
|
+
foregroundDynamics = [];
|
|
158273
|
+
overlayDynamics = [];
|
|
158218
158274
|
_decorations;
|
|
158219
158275
|
[Symbol.dispose]() {
|
|
158220
158276
|
this.foreground.length = this.background.length = this.overlays.length = 0;
|
|
158221
|
-
|
|
158277
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.foregroundDynamics);
|
|
158278
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.overlayDynamics);
|
|
158222
158279
|
this._decorations = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._decorations);
|
|
158223
158280
|
}
|
|
158224
158281
|
get isDisposed() {
|
|
158225
158282
|
return 0 === this.foreground.length && 0 === this.background.length && 0 === this.overlays.length
|
|
158226
|
-
&&
|
|
158283
|
+
&& 0 === this.foregroundDynamics.length && 0 === this.overlayDynamics.length && !this._decorations;
|
|
158227
158284
|
}
|
|
158228
158285
|
changeScene(scene) {
|
|
158229
158286
|
this.foreground = scene.foreground;
|
|
158230
158287
|
this.background = scene.background;
|
|
158231
158288
|
this.overlays = scene.overlay;
|
|
158232
158289
|
}
|
|
158233
|
-
|
|
158234
|
-
|
|
158235
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.
|
|
158236
|
-
this.
|
|
158290
|
+
changeDynamics(foreground, overlay) {
|
|
158291
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.foregroundDynamics);
|
|
158292
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.overlayDynamics);
|
|
158293
|
+
this.foregroundDynamics = foreground ?? [];
|
|
158294
|
+
this.overlayDynamics = overlay ?? [];
|
|
158237
158295
|
}
|
|
158238
158296
|
get decorations() { return this._decorations; }
|
|
158239
158297
|
set decorations(decorations) {
|
|
@@ -170171,8 +170229,9 @@ function createClassifierTileTreeReference(classifiers, classifiedTree, iModel,
|
|
|
170171
170229
|
return new ClassifierTreeReference(classifiers, classifiedTree, iModel, source);
|
|
170172
170230
|
}
|
|
170173
170231
|
function createClassifierId(classifier, source) {
|
|
170232
|
+
const disablePolyfaceDecimation = _IModelApp__WEBPACK_IMPORTED_MODULE_2__.IModelApp.tileAdmin.disablePolyfaceDecimation;
|
|
170174
170233
|
if (undefined === classifier)
|
|
170175
|
-
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 };
|
|
170234
|
+
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 };
|
|
170176
170235
|
const type = classifier.flags.isVolumeClassifier ? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.VolumeClassifier : _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.PlanarClassifier;
|
|
170177
170236
|
const scriptInfo = _IModelApp__WEBPACK_IMPORTED_MODULE_2__.IModelApp.tileAdmin.getScriptInfoForTreeId(classifier.modelId, source ? source[_common_internal_Symbols__WEBPACK_IMPORTED_MODULE_5__._scheduleScriptReference] : undefined);
|
|
170178
170237
|
return {
|
|
@@ -170181,6 +170240,7 @@ function createClassifierId(classifier, source) {
|
|
|
170181
170240
|
expansion: classifier.expand,
|
|
170182
170241
|
animationId: scriptInfo?.animationId,
|
|
170183
170242
|
timeline: scriptInfo?.timeline,
|
|
170243
|
+
disablePolyfaceDecimation,
|
|
170184
170244
|
};
|
|
170185
170245
|
}
|
|
170186
170246
|
|
|
@@ -174177,7 +174237,8 @@ class PrimaryTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.T
|
|
|
174177
174237
|
const edgesRequired = visibleEdges || _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RenderMode.SmoothShade !== renderMode || _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.alwaysRequestEdges;
|
|
174178
174238
|
const edges = edgesRequired ? _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.edgeOptions : false;
|
|
174179
174239
|
const sectionCut = this._sectionClip?.clipString;
|
|
174180
|
-
|
|
174240
|
+
const disablePolyfaceDecimation = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.disablePolyfaceDecimation;
|
|
174241
|
+
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges, animationId, sectionCut, disablePolyfaceDecimation };
|
|
174181
174242
|
}
|
|
174182
174243
|
computeBaseTransform(tree) {
|
|
174183
174244
|
return super.computeTransform(tree);
|
|
@@ -174330,7 +174391,7 @@ class MaskTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.Tile
|
|
|
174330
174391
|
return this._owner;
|
|
174331
174392
|
}
|
|
174332
174393
|
createTreeId() {
|
|
174333
|
-
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false };
|
|
174394
|
+
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false, disablePolyfaceDecimation: _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.disablePolyfaceDecimation };
|
|
174334
174395
|
}
|
|
174335
174396
|
}
|
|
174336
174397
|
function createMaskTreeReference(view, model) {
|
|
@@ -174356,7 +174417,7 @@ class ModelMapLayerTileTreeReference extends _tile_internal__WEBPACK_IMPORTED_MO
|
|
|
174356
174417
|
this._owner = primaryTreeSupplier.getOwner(this._id, this.iModel);
|
|
174357
174418
|
}
|
|
174358
174419
|
createTreeId() {
|
|
174359
|
-
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false };
|
|
174420
|
+
return { type: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary, edges: false, disablePolyfaceDecimation: _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.tileAdmin.disablePolyfaceDecimation };
|
|
174360
174421
|
}
|
|
174361
174422
|
get treeOwner() {
|
|
174362
174423
|
const newId = this.createTreeId();
|
|
@@ -179648,11 +179709,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
179648
179709
|
* @beta
|
|
179649
179710
|
*/
|
|
179650
179711
|
class AngleDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
179651
|
-
constructor(name, displayLabel, iconSpec) {
|
|
179712
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
179652
179713
|
const defaultName = "angle";
|
|
179653
|
-
super(
|
|
179714
|
+
super({
|
|
179715
|
+
name: name ? name : defaultName,
|
|
179716
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Angle"),
|
|
179717
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.ANGLE",
|
|
179718
|
+
iconSpec
|
|
179719
|
+
});
|
|
179654
179720
|
}
|
|
179655
179721
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.Angle; }
|
|
179722
|
+
/**
|
|
179723
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
179724
|
+
*/
|
|
179656
179725
|
get quantityType() { return "Angle"; }
|
|
179657
179726
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseAngle"); }
|
|
179658
179727
|
}
|
|
@@ -179691,8 +179760,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
179691
179760
|
class FormattedQuantityDescription extends _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_1__.BaseQuantityDescription {
|
|
179692
179761
|
_formatterSpec;
|
|
179693
179762
|
_parserSpec;
|
|
179694
|
-
constructor(
|
|
179695
|
-
|
|
179763
|
+
constructor(argsOrName, displayLabel, iconSpec, kindOfQuantityName) {
|
|
179764
|
+
if (typeof argsOrName === "string") {
|
|
179765
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
179766
|
+
super(argsOrName, displayLabel, iconSpec, kindOfQuantityName);
|
|
179767
|
+
}
|
|
179768
|
+
else {
|
|
179769
|
+
super(argsOrName.name, argsOrName.displayLabel, argsOrName.iconSpec, argsOrName.kindOfQuantityName);
|
|
179770
|
+
}
|
|
179696
179771
|
}
|
|
179697
179772
|
formatValue(numberValue) {
|
|
179698
179773
|
if (this.formatterSpec) {
|
|
@@ -179768,11 +179843,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
179768
179843
|
* @beta
|
|
179769
179844
|
*/
|
|
179770
179845
|
class LengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
179771
|
-
constructor(name, displayLabel, iconSpec) {
|
|
179846
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
179772
179847
|
const defaultName = "length";
|
|
179773
|
-
super(
|
|
179848
|
+
super({
|
|
179849
|
+
name: name ? name : defaultName,
|
|
179850
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
179851
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
179852
|
+
iconSpec,
|
|
179853
|
+
});
|
|
179774
179854
|
}
|
|
179775
179855
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.Length; }
|
|
179856
|
+
/**
|
|
179857
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
179858
|
+
*/
|
|
179776
179859
|
get quantityType() { return "Length"; }
|
|
179777
179860
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
179778
179861
|
}
|
|
@@ -179781,11 +179864,19 @@ class LengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_
|
|
|
179781
179864
|
* @beta
|
|
179782
179865
|
*/
|
|
179783
179866
|
class SurveyLengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
179784
|
-
constructor(name, displayLabel, iconSpec) {
|
|
179867
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
179785
179868
|
const defaultName = "surveyLength";
|
|
179786
|
-
super(
|
|
179869
|
+
super({
|
|
179870
|
+
name: name ? name : defaultName,
|
|
179871
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
179872
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
179873
|
+
iconSpec,
|
|
179874
|
+
});
|
|
179787
179875
|
}
|
|
179788
179876
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.LengthSurvey; }
|
|
179877
|
+
/**
|
|
179878
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
179879
|
+
*/
|
|
179789
179880
|
get quantityType() { return "LengthSurvey"; }
|
|
179790
179881
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
179791
179882
|
}
|
|
@@ -179794,11 +179885,19 @@ class SurveyLengthDescription extends _FormattedQuantityDescription__WEBPACK_IMP
|
|
|
179794
179885
|
* @beta
|
|
179795
179886
|
*/
|
|
179796
179887
|
class EngineeringLengthDescription extends _FormattedQuantityDescription__WEBPACK_IMPORTED_MODULE_2__.FormattedQuantityDescription {
|
|
179797
|
-
constructor(name, displayLabel, iconSpec) {
|
|
179888
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
179798
179889
|
const defaultName = "engineeringLength";
|
|
179799
|
-
super(
|
|
179890
|
+
super({
|
|
179891
|
+
name: name ? name : defaultName,
|
|
179892
|
+
displayLabel: displayLabel ? displayLabel : _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
179893
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
179894
|
+
iconSpec,
|
|
179895
|
+
});
|
|
179800
179896
|
}
|
|
179801
179897
|
get formatterQuantityType() { return _quantity_formatting_QuantityFormatter__WEBPACK_IMPORTED_MODULE_1__.QuantityType.LengthEngineering; }
|
|
179898
|
+
/**
|
|
179899
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
179900
|
+
*/
|
|
179802
179901
|
get quantityType() { return "LengthEngineering"; }
|
|
179803
179902
|
get parseError() { return _IModelApp__WEBPACK_IMPORTED_MODULE_0__.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
179804
179903
|
}
|
|
@@ -180213,8 +180312,10 @@ class LocalUnitFormatProvider extends _BaseUnitFormattingSettingsProvider__WEBPA
|
|
|
180213
180312
|
__webpack_require__.r(__webpack_exports__);
|
|
180214
180313
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
180215
180314
|
/* harmony export */ AlternateUnitLabelsRegistry: () => (/* binding */ AlternateUnitLabelsRegistry),
|
|
180315
|
+
/* harmony export */ FormatsProviderManager: () => (/* binding */ FormatsProviderManager),
|
|
180216
180316
|
/* harmony export */ QuantityFormatter: () => (/* binding */ QuantityFormatter),
|
|
180217
180317
|
/* harmony export */ QuantityType: () => (/* binding */ QuantityType),
|
|
180318
|
+
/* harmony export */ QuantityTypeFormatsProvider: () => (/* binding */ QuantityTypeFormatsProvider),
|
|
180218
180319
|
/* harmony export */ getQuantityTypeKey: () => (/* binding */ getQuantityTypeKey),
|
|
180219
180320
|
/* harmony export */ isCustomQuantityTypeDefinition: () => (/* binding */ isCustomQuantityTypeDefinition)
|
|
180220
180321
|
/* harmony export */ });
|
|
@@ -180360,12 +180461,66 @@ class StandardQuantityTypeDefinition {
|
|
|
180360
180461
|
return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, unitsProvider, this.persistenceUnit, alternateUnitLabelsProvider);
|
|
180361
180462
|
}
|
|
180362
180463
|
}
|
|
180464
|
+
/**
|
|
180465
|
+
* A default formatsProvider, that provides a limited set of [[FormatDefinition]], associated to a few [[KindOfQuantity]].
|
|
180466
|
+
* Maps each KindOfQuantity to a [[QuantityType]].
|
|
180467
|
+
* When retrieving a valid [[KindOfQuantity]], returns the [[FormatProps]] for the associated [[QuantityType]].
|
|
180468
|
+
* @internal
|
|
180469
|
+
*/
|
|
180470
|
+
class QuantityTypeFormatsProvider {
|
|
180471
|
+
onFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
180472
|
+
constructor() {
|
|
180473
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(() => {
|
|
180474
|
+
this.onFormatsChanged.raiseEvent({ formatsChanged: "all" });
|
|
180475
|
+
});
|
|
180476
|
+
}
|
|
180477
|
+
_kindOfQuantityMap = new Map([
|
|
180478
|
+
["AecUnits.LENGTH", QuantityType.Length],
|
|
180479
|
+
["AecUnits.ANGLE", QuantityType.Angle],
|
|
180480
|
+
["AecUnits.AREA", QuantityType.Area],
|
|
180481
|
+
["AecUnits.VOLUME", QuantityType.Volume],
|
|
180482
|
+
["RoadRailUnits.STATION", QuantityType.Stationing],
|
|
180483
|
+
["RoadRailUnits.LENGTH", QuantityType.LengthSurvey],
|
|
180484
|
+
]);
|
|
180485
|
+
async getFormat(name) {
|
|
180486
|
+
const quantityType = this._kindOfQuantityMap.get(name);
|
|
180487
|
+
if (!quantityType)
|
|
180488
|
+
return undefined;
|
|
180489
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.getFormatPropsByQuantityType(quantityType);
|
|
180490
|
+
}
|
|
180491
|
+
}
|
|
180492
|
+
/**
|
|
180493
|
+
* An implementation of the [[FormatsProvider]] interface that forwards calls to getFormats to the underlying FormatsProvider.
|
|
180494
|
+
* Also fires the onFormatsChanged event when the underlying FormatsProvider fires its own onFormatsChanged event.
|
|
180495
|
+
* @internal
|
|
180496
|
+
*/
|
|
180497
|
+
class FormatsProviderManager {
|
|
180498
|
+
_formatsProvider;
|
|
180499
|
+
onFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
180500
|
+
constructor(_formatsProvider) {
|
|
180501
|
+
this._formatsProvider = _formatsProvider;
|
|
180502
|
+
this._formatsProvider.onFormatsChanged.addListener((args) => {
|
|
180503
|
+
this.onFormatsChanged.raiseEvent(args);
|
|
180504
|
+
});
|
|
180505
|
+
}
|
|
180506
|
+
async getFormat(name) {
|
|
180507
|
+
return this._formatsProvider.getFormat(name);
|
|
180508
|
+
}
|
|
180509
|
+
get formatsProvider() { return this; }
|
|
180510
|
+
set formatsProvider(formatsProvider) {
|
|
180511
|
+
this._formatsProvider = formatsProvider;
|
|
180512
|
+
this._formatsProvider.onFormatsChanged.addListener((args) => {
|
|
180513
|
+
this.onFormatsChanged.raiseEvent(args);
|
|
180514
|
+
});
|
|
180515
|
+
this.onFormatsChanged.raiseEvent({ formatsChanged: "all" });
|
|
180516
|
+
}
|
|
180517
|
+
}
|
|
180363
180518
|
/** Class that supports formatting quantity values into strings and parsing strings into quantity values. This class also maintains
|
|
180364
180519
|
* the "active" unit system and caches FormatterSpecs and ParserSpecs for the "active" unit system to allow synchronous access to
|
|
180365
180520
|
* parsing and formatting values. The support unit systems are defined by [[UnitSystemKey]] and is kept in synch with the unit systems
|
|
180366
180521
|
* provided by the Presentation Manager on the backend. The QuantityFormatter contains a registry of quantity type definitions. These definitions implement
|
|
180367
|
-
* the [[QuantityTypeDefinition]] interface, which among other things, provide default [FormatProps]
|
|
180368
|
-
* to generate both a [FormatterSpec]
|
|
180522
|
+
* the [[QuantityTypeDefinition]] interface, which among other things, provide default [[FormatProps]], and provide methods
|
|
180523
|
+
* to generate both a [[FormatterSpec]] and a [[ParserSpec]]. There are built-in quantity types that are
|
|
180369
180524
|
* identified by the [[QuantityType]] enum. [[CustomQuantityTypeDefinition]] can be registered to extend the available quantity types available
|
|
180370
180525
|
* by frontend tools. The QuantityFormatter also allows the default formats to be overriden.
|
|
180371
180526
|
*
|
|
@@ -180376,6 +180531,10 @@ class QuantityFormatter {
|
|
|
180376
180531
|
_alternateUnitLabelsRegistry = new AlternateUnitLabelsRegistry((0,_BasicUnitsProvider__WEBPACK_IMPORTED_MODULE_4__.getDefaultAlternateUnitLabels)());
|
|
180377
180532
|
/** Registry containing available quantity type definitions. */
|
|
180378
180533
|
_quantityTypeRegistry = new Map();
|
|
180534
|
+
/** Registry containing available FormatterSpec and ParserSpec, mapped by keys.
|
|
180535
|
+
* @beta
|
|
180536
|
+
*/
|
|
180537
|
+
_formatSpecsRegistry = new Map();
|
|
180379
180538
|
/** Active UnitSystem key - must be one of "imperial", "metric", "usCustomary", or "usSurvey". */
|
|
180380
180539
|
_activeUnitSystem = "imperial";
|
|
180381
180540
|
/** Map of FormatSpecs for all available QuantityTypes and the active Unit System */
|
|
@@ -180402,6 +180561,7 @@ class QuantityFormatter {
|
|
|
180402
180561
|
onQuantityFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeUiEvent();
|
|
180403
180562
|
/** Fired when the active UnitsProvider is updated. This will allow cached Formatter and Parser specs to be updated if necessary. */
|
|
180404
180563
|
onUnitsProviderChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeUiEvent();
|
|
180564
|
+
_removeFormatsProviderListener;
|
|
180405
180565
|
/**
|
|
180406
180566
|
* constructor
|
|
180407
180567
|
* @param showMetricOrUnitSystem - Pass in `true` to show Metric formatted quantity values. Defaults to Imperial. To explicitly
|
|
@@ -180415,6 +180575,12 @@ class QuantityFormatter {
|
|
|
180415
180575
|
this._activeUnitSystem = showMetricOrUnitSystem;
|
|
180416
180576
|
}
|
|
180417
180577
|
}
|
|
180578
|
+
[Symbol.dispose]() {
|
|
180579
|
+
if (this._removeFormatsProviderListener) {
|
|
180580
|
+
this._removeFormatsProviderListener();
|
|
180581
|
+
this._removeFormatsProviderListener = undefined;
|
|
180582
|
+
}
|
|
180583
|
+
}
|
|
180418
180584
|
getOverrideFormatPropsByQuantityType(quantityTypeKey, unitSystem) {
|
|
180419
180585
|
const requestedUnitSystem = unitSystem ?? this.activeUnitSystem;
|
|
180420
180586
|
const overrideMap = this._overrideFormatPropsByUnitSystem.get(requestedUnitSystem);
|
|
@@ -180540,6 +180706,46 @@ class QuantityFormatter {
|
|
|
180540
180706
|
*/
|
|
180541
180707
|
async onInitialized() {
|
|
180542
180708
|
await this.initializeQuantityTypesRegistry();
|
|
180709
|
+
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"]];
|
|
180710
|
+
for (const entry of initialKoQs) {
|
|
180711
|
+
try {
|
|
180712
|
+
await this.addFormattingSpecsToRegistry(entry[0], entry[1]);
|
|
180713
|
+
}
|
|
180714
|
+
catch (err) {
|
|
180715
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.Package}.QuantityFormatter`, err.toString());
|
|
180716
|
+
}
|
|
180717
|
+
}
|
|
180718
|
+
this._removeFormatsProviderListener = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.onFormatsChanged.addListener(async (args) => {
|
|
180719
|
+
if (args.formatsChanged === "all") {
|
|
180720
|
+
for (const [name, entry] of this._formatSpecsRegistry.entries()) {
|
|
180721
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(name);
|
|
180722
|
+
if (formatProps) {
|
|
180723
|
+
const persistenceUnitName = entry.formatterSpec.persistenceUnit.name;
|
|
180724
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
180725
|
+
}
|
|
180726
|
+
else {
|
|
180727
|
+
this._formatSpecsRegistry.delete(name); // clear the specs if format was removed, or no longer exists.
|
|
180728
|
+
}
|
|
180729
|
+
}
|
|
180730
|
+
}
|
|
180731
|
+
else {
|
|
180732
|
+
for (const name of args.formatsChanged) {
|
|
180733
|
+
if (this._formatSpecsRegistry.has(name)) {
|
|
180734
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(name);
|
|
180735
|
+
if (formatProps) {
|
|
180736
|
+
const existingEntry = this._formatSpecsRegistry.get(name);
|
|
180737
|
+
if (existingEntry) {
|
|
180738
|
+
const persistenceUnitName = existingEntry.formatterSpec.persistenceUnit.name;
|
|
180739
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
180740
|
+
}
|
|
180741
|
+
}
|
|
180742
|
+
else {
|
|
180743
|
+
this._formatSpecsRegistry.delete(name);
|
|
180744
|
+
}
|
|
180745
|
+
}
|
|
180746
|
+
}
|
|
180747
|
+
}
|
|
180748
|
+
});
|
|
180543
180749
|
// initialize default format and parsing specs
|
|
180544
180750
|
await this.loadFormatAndParsingMapsForSystem();
|
|
180545
180751
|
}
|
|
@@ -180769,26 +180975,51 @@ class QuantityFormatter {
|
|
|
180769
180975
|
requestedSystem = isImperial ? "imperial" : "metric";
|
|
180770
180976
|
return this.getParserSpecByQuantityTypeAndSystem(type, requestedSystem);
|
|
180771
180977
|
}
|
|
180772
|
-
|
|
180773
|
-
|
|
180774
|
-
|
|
180775
|
-
|
|
180776
|
-
|
|
180777
|
-
|
|
180778
|
-
|
|
180779
|
-
|
|
180780
|
-
|
|
180781
|
-
return
|
|
180978
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
180979
|
+
formatQuantity(args, spec) {
|
|
180980
|
+
if (typeof args === "number") {
|
|
180981
|
+
/** Format a quantity value. Default FormatterSpec implementation uses Formatter.formatQuantity. */
|
|
180982
|
+
const magnitude = args;
|
|
180983
|
+
if (spec)
|
|
180984
|
+
return spec.applyFormatting(magnitude);
|
|
180985
|
+
return magnitude.toString();
|
|
180986
|
+
}
|
|
180987
|
+
return this.formatQuantityAsync(args);
|
|
180988
|
+
}
|
|
180989
|
+
async formatQuantityAsync(args) {
|
|
180990
|
+
const { value, valueUnitName, kindOfQuantityName } = args;
|
|
180991
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(kindOfQuantityName);
|
|
180992
|
+
if (!formatProps)
|
|
180993
|
+
return value.toString();
|
|
180994
|
+
const formatSpec = await this.createFormatterSpec({
|
|
180995
|
+
persistenceUnitName: valueUnitName,
|
|
180996
|
+
formatProps,
|
|
180997
|
+
formatName: kindOfQuantityName,
|
|
180998
|
+
});
|
|
180999
|
+
return formatSpec.applyFormatting(value);
|
|
180782
181000
|
}
|
|
180783
|
-
|
|
180784
|
-
|
|
180785
|
-
|
|
180786
|
-
|
|
180787
|
-
|
|
180788
|
-
|
|
180789
|
-
|
|
180790
|
-
return
|
|
180791
|
-
|
|
181001
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
181002
|
+
parseToQuantityValue(args, parserSpec) {
|
|
181003
|
+
if (typeof args === "string") {
|
|
181004
|
+
/** Parse a quantity value. Default ParserSpec implementation uses ParserSpec.parseToQuantityValue. */
|
|
181005
|
+
const inString = args;
|
|
181006
|
+
if (parserSpec)
|
|
181007
|
+
return parserSpec.parseToQuantityValue(inString);
|
|
181008
|
+
return { ok: false, error: _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParseError.InvalidParserSpec };
|
|
181009
|
+
}
|
|
181010
|
+
return this.parseToQuantityValueAsync(args);
|
|
181011
|
+
}
|
|
181012
|
+
async parseToQuantityValueAsync(args) {
|
|
181013
|
+
const { value, valueUnitName, kindOfQuantityName } = args;
|
|
181014
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(kindOfQuantityName);
|
|
181015
|
+
if (!formatProps)
|
|
181016
|
+
return { ok: false, error: _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParseError.InvalidParserSpec };
|
|
181017
|
+
const parserSpec = await this.createParserSpec({
|
|
181018
|
+
persistenceUnitName: valueUnitName,
|
|
181019
|
+
formatProps,
|
|
181020
|
+
formatName: kindOfQuantityName,
|
|
181021
|
+
});
|
|
181022
|
+
return parserSpec.parseToQuantityValue(value);
|
|
180792
181023
|
}
|
|
180793
181024
|
/**
|
|
180794
181025
|
* Get a UnitSystemKey from a string that may have been entered via a key-in. Supports different variation of
|
|
@@ -180858,6 +181089,63 @@ class QuantityFormatter {
|
|
|
180858
181089
|
async getConversion(fromUnit, toUnit) {
|
|
180859
181090
|
return this._unitsProvider.getConversion(fromUnit, toUnit);
|
|
180860
181091
|
}
|
|
181092
|
+
/**
|
|
181093
|
+
* Creates a [[FormatterSpec]] for a given persistence unit name and format properties, using the [[UnitsProvider]] to resolve the persistence unit.
|
|
181094
|
+
* @beta
|
|
181095
|
+
* @param props - A [[CreateFormattingSpecProps]] interface.
|
|
181096
|
+
*/
|
|
181097
|
+
async createFormatterSpec(props) {
|
|
181098
|
+
const { persistenceUnitName, formatProps, formatName } = props;
|
|
181099
|
+
const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
181100
|
+
const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
|
|
181101
|
+
return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.FormatterSpec.create(`${format.name}_format_spec`, format, this._unitsProvider, persistenceUnitProps);
|
|
181102
|
+
}
|
|
181103
|
+
/**
|
|
181104
|
+
* Creates a [[ParserSpec]] for a given persistence unit name and format properties, using the [[UnitsProvider]] to resolve the persistence unit.
|
|
181105
|
+
* @beta
|
|
181106
|
+
* @param props - A [[CreateFormattingSpecProps]] object.
|
|
181107
|
+
*/
|
|
181108
|
+
async createParserSpec(props) {
|
|
181109
|
+
const { persistenceUnitName, formatProps, formatName } = props;
|
|
181110
|
+
const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
|
|
181111
|
+
const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
|
|
181112
|
+
return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
|
|
181113
|
+
}
|
|
181114
|
+
/**
|
|
181115
|
+
* @beta
|
|
181116
|
+
* Returns a [[FormattingSpecEntry]] for a given name, typically a KindOfQuantity full name.
|
|
181117
|
+
*/
|
|
181118
|
+
getSpecsByName(name) {
|
|
181119
|
+
return this._formatSpecsRegistry.get(name);
|
|
181120
|
+
}
|
|
181121
|
+
/**
|
|
181122
|
+
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
|
|
181123
|
+
* @beta
|
|
181124
|
+
* @param name The key used to identify the formatter and parser spec
|
|
181125
|
+
* @param persistenceUnitName The name of the persistence unit
|
|
181126
|
+
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
|
|
181127
|
+
*/
|
|
181128
|
+
async addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps) {
|
|
181129
|
+
if (!formatProps) {
|
|
181130
|
+
formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.getFormat(name);
|
|
181131
|
+
}
|
|
181132
|
+
if (formatProps) {
|
|
181133
|
+
const formatterSpec = await this.createFormatterSpec({
|
|
181134
|
+
persistenceUnitName,
|
|
181135
|
+
formatProps,
|
|
181136
|
+
formatName: name,
|
|
181137
|
+
});
|
|
181138
|
+
const parserSpec = await this.createParserSpec({
|
|
181139
|
+
persistenceUnitName,
|
|
181140
|
+
formatProps,
|
|
181141
|
+
formatName: name,
|
|
181142
|
+
});
|
|
181143
|
+
this._formatSpecsRegistry.set(name, { formatterSpec, parserSpec });
|
|
181144
|
+
}
|
|
181145
|
+
else {
|
|
181146
|
+
throw new Error(`Unable to find format properties for ${name} with persistence unit ${persistenceUnitName}`);
|
|
181147
|
+
}
|
|
181148
|
+
}
|
|
180861
181149
|
}
|
|
180862
181150
|
// ========================================================================================================================================
|
|
180863
181151
|
// Default Data
|
|
@@ -187898,6 +188186,8 @@ class TileAdmin {
|
|
|
187898
188186
|
/** @internal */
|
|
187899
188187
|
optimizeBRepProcessing;
|
|
187900
188188
|
/** @internal */
|
|
188189
|
+
disablePolyfaceDecimation;
|
|
188190
|
+
/** @internal */
|
|
187901
188191
|
useLargerTiles;
|
|
187902
188192
|
/** @internal */
|
|
187903
188193
|
maximumLevelsToSkip;
|
|
@@ -187986,6 +188276,7 @@ class TileAdmin {
|
|
|
187986
188276
|
this.useProjectExtents = options.useProjectExtents ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.useProjectExtents;
|
|
187987
188277
|
this.expandProjectExtents = options.expandProjectExtents ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.expandProjectExtents;
|
|
187988
188278
|
this.optimizeBRepProcessing = options.optimizeBRepProcessing ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.optimizeBRepProcessing;
|
|
188279
|
+
this.disablePolyfaceDecimation = options.disablePolyfaceDecimation ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.disablePolyfaceDecimation;
|
|
187989
188280
|
this.useLargerTiles = options.useLargerTiles ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.useLargerTiles;
|
|
187990
188281
|
this.mobileRealityTileMinToleranceRatio = Math.max(options.mobileRealityTileMinToleranceRatio ?? 3.0, 1.0);
|
|
187991
188282
|
this.cesiumIonKey = options.cesiumIonKey;
|
|
@@ -192336,6 +192627,18 @@ class MapCartoRectangle extends _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0_
|
|
|
192336
192627
|
scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);
|
|
192337
192628
|
return scratchMercatorFractionRange;
|
|
192338
192629
|
}
|
|
192630
|
+
/**
|
|
192631
|
+
* Compute rectangle with angles specified in degrees.
|
|
192632
|
+
* @beta
|
|
192633
|
+
*/
|
|
192634
|
+
toDegrees() {
|
|
192635
|
+
return {
|
|
192636
|
+
north: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.north),
|
|
192637
|
+
south: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.south),
|
|
192638
|
+
east: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.east),
|
|
192639
|
+
west: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.west),
|
|
192640
|
+
};
|
|
192641
|
+
}
|
|
192339
192642
|
}
|
|
192340
192643
|
|
|
192341
192644
|
|
|
@@ -193002,7 +193305,7 @@ class MapLayerImageryProvider {
|
|
|
193002
193305
|
}
|
|
193003
193306
|
}
|
|
193004
193307
|
/** @internal */
|
|
193005
|
-
async makeTileRequest(url, timeoutMs) {
|
|
193308
|
+
async makeTileRequest(url, timeoutMs, authorization) {
|
|
193006
193309
|
// We want to complete the first request before letting other requests go;
|
|
193007
193310
|
// this done to avoid flooding server with requests missing credentials
|
|
193008
193311
|
if (!this._firstRequestPromise)
|
|
@@ -193011,7 +193314,7 @@ class MapLayerImageryProvider {
|
|
|
193011
193314
|
await this._firstRequestPromise;
|
|
193012
193315
|
let response;
|
|
193013
193316
|
try {
|
|
193014
|
-
response = await this.makeRequest(url, timeoutMs);
|
|
193317
|
+
response = await this.makeRequest(url, timeoutMs, authorization);
|
|
193015
193318
|
}
|
|
193016
193319
|
finally {
|
|
193017
193320
|
this.onFirstRequestCompleted.raiseEvent();
|
|
@@ -193021,11 +193324,15 @@ class MapLayerImageryProvider {
|
|
|
193021
193324
|
return response;
|
|
193022
193325
|
}
|
|
193023
193326
|
/** @internal */
|
|
193024
|
-
async makeRequest(url, timeoutMs) {
|
|
193327
|
+
async makeRequest(url, timeoutMs, authorization) {
|
|
193025
193328
|
let response;
|
|
193026
193329
|
let headers;
|
|
193027
193330
|
let hasCreds = false;
|
|
193028
|
-
if (
|
|
193331
|
+
if (authorization) {
|
|
193332
|
+
headers = new Headers();
|
|
193333
|
+
headers.set("Authorization", authorization);
|
|
193334
|
+
}
|
|
193335
|
+
else if (this._settings.userName && this._settings.password) {
|
|
193029
193336
|
hasCreds = true;
|
|
193030
193337
|
headers = new Headers();
|
|
193031
193338
|
this.setRequestAuthorization(headers);
|
|
@@ -195831,6 +196138,18 @@ class QuadId {
|
|
|
195831
196138
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(this.row, other.row) ||
|
|
195832
196139
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(this.column, other.column);
|
|
195833
196140
|
}
|
|
196141
|
+
/** Creates a QuadId from a JSON representation */
|
|
196142
|
+
static fromJSON(props) {
|
|
196143
|
+
return new QuadId(props.level, props.column, props.row);
|
|
196144
|
+
}
|
|
196145
|
+
/** Convert this QuadId to a JSON representation */
|
|
196146
|
+
static toJSON(props) {
|
|
196147
|
+
return {
|
|
196148
|
+
level: props.level,
|
|
196149
|
+
column: props.column,
|
|
196150
|
+
row: props.row,
|
|
196151
|
+
};
|
|
196152
|
+
}
|
|
195834
196153
|
}
|
|
195835
196154
|
|
|
195836
196155
|
|
|
@@ -197671,6 +197990,7 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
197671
197990
|
this._controls.overlay.remove();
|
|
197672
197991
|
this._controls = undefined;
|
|
197673
197992
|
this.unsuspendToolTips();
|
|
197993
|
+
this.removedControlRect();
|
|
197674
197994
|
}
|
|
197675
197995
|
createControlDiv() {
|
|
197676
197996
|
const div = document.createElement("div");
|
|
@@ -197758,6 +198078,10 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
197758
198078
|
style.outlineWidth = button.outlineWidth;
|
|
197759
198079
|
return itemLock;
|
|
197760
198080
|
}
|
|
198081
|
+
/** Called after the controls have been removed from the view. */
|
|
198082
|
+
removedControlRect() { }
|
|
198083
|
+
/** Called after the position of the controls in the supplied view is updated. */
|
|
198084
|
+
changedControlRect(_rect, _vp) { }
|
|
197761
198085
|
/** Use to override the position of the controls in the supplied view. */
|
|
197762
198086
|
modifyControlRect(_rect, _vp) { }
|
|
197763
198087
|
/** Return the ViewRect currently occupied by the controls in the supplied view. */
|
|
@@ -197854,6 +198178,8 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
197854
198178
|
return; // Keep showing at last valid location...
|
|
197855
198179
|
this._controls.div.style.left = `${controlRect.left}px`;
|
|
197856
198180
|
this._controls.div.style.top = `${controlRect.top}px`;
|
|
198181
|
+
this.changedControlRect(controlRect, vp);
|
|
198182
|
+
return;
|
|
197857
198183
|
}
|
|
197858
198184
|
get _isFocusHome() {
|
|
197859
198185
|
return (document.body === document.activeElement);
|
|
@@ -197876,6 +198202,13 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
197876
198202
|
// Indicate when keyboard shortcuts can't be used (i.e. focus not at AccuDraw or Home) by changing compass to monochrome...
|
|
197877
198203
|
return (this._isFocusHome || this._isFocusAccuDraw);
|
|
197878
198204
|
}
|
|
198205
|
+
/** Get the item field that currently has input focus.
|
|
198206
|
+
*/
|
|
198207
|
+
getFocusItem() {
|
|
198208
|
+
if (!this._isFocusAccuDraw)
|
|
198209
|
+
return undefined;
|
|
198210
|
+
return this._focusItem;
|
|
198211
|
+
}
|
|
197879
198212
|
/** Request to set focus to the specified AccuDraw input field to start entering values.
|
|
197880
198213
|
* The focused input field will be indicated by the background color.
|
|
197881
198214
|
*/
|
|
@@ -201220,11 +201553,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
201220
201553
|
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
201221
201554
|
/* harmony import */ var _Marker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Marker */ "../../core/frontend/lib/esm/Marker.js");
|
|
201222
201555
|
/* harmony import */ var _NotificationManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../NotificationManager */ "../../core/frontend/lib/esm/NotificationManager.js");
|
|
201223
|
-
/* harmony import */ var
|
|
201224
|
-
/* harmony import */ var
|
|
201225
|
-
/* harmony import */ var
|
|
201226
|
-
/* harmony import */ var
|
|
201227
|
-
/* harmony import */ var _common_render_GraphicType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/render/GraphicType */ "../../core/frontend/lib/esm/common/render/GraphicType.js");
|
|
201556
|
+
/* harmony import */ var _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PrimitiveTool */ "../../core/frontend/lib/esm/tools/PrimitiveTool.js");
|
|
201557
|
+
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
201558
|
+
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
201559
|
+
/* harmony import */ var _common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/render/GraphicType */ "../../core/frontend/lib/esm/common/render/GraphicType.js");
|
|
201228
201560
|
/*---------------------------------------------------------------------------------------------
|
|
201229
201561
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
201230
201562
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -201245,9 +201577,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
201245
201577
|
|
|
201246
201578
|
|
|
201247
201579
|
|
|
201248
|
-
|
|
201249
201580
|
function translateBold(key) {
|
|
201250
|
-
return `<b>${
|
|
201581
|
+
return `<b>${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(`Measure.Labels.${key}`)}:</b> `;
|
|
201582
|
+
}
|
|
201583
|
+
async function getFormatterSpecByKoQAndPersistenceUnit(koq, persistenceUnitName) {
|
|
201584
|
+
const formatProps = await _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.formatsProvider.getFormat(koq);
|
|
201585
|
+
if (undefined === formatProps)
|
|
201586
|
+
return undefined;
|
|
201587
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.createFormatterSpec({
|
|
201588
|
+
persistenceUnitName,
|
|
201589
|
+
formatProps,
|
|
201590
|
+
formatName: koq
|
|
201591
|
+
});
|
|
201251
201592
|
}
|
|
201252
201593
|
/** @internal */
|
|
201253
201594
|
class MeasureLabel {
|
|
@@ -201311,7 +201652,7 @@ class MeasureMarker extends _Marker__WEBPACK_IMPORTED_MODULE_7__.Marker {
|
|
|
201311
201652
|
onMouseButton(_ev) { return true; } // Never forward event to active tool...
|
|
201312
201653
|
onMouseEnter(ev) {
|
|
201313
201654
|
super.onMouseEnter(ev);
|
|
201314
|
-
if (this.title &&
|
|
201655
|
+
if (this.title && _Tool__WEBPACK_IMPORTED_MODULE_10__.InputSource.Touch === ev.inputSource && ev.viewport)
|
|
201315
201656
|
ev.viewport.openToolTip(this.title, ev.viewPoint, this.tooltipOptions);
|
|
201316
201657
|
}
|
|
201317
201658
|
onMouseLeave() {
|
|
@@ -201348,7 +201689,7 @@ function adjustPoint(ev, segments, locations) {
|
|
|
201348
201689
|
/** Report distance between 2 points using current quantity formatter for length.
|
|
201349
201690
|
* @public
|
|
201350
201691
|
*/
|
|
201351
|
-
class MeasureDistanceTool extends
|
|
201692
|
+
class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
201352
201693
|
static toolId = "Measure.Distance";
|
|
201353
201694
|
static iconSpec = "icon-measure-distance";
|
|
201354
201695
|
/** @internal */
|
|
@@ -201366,6 +201707,12 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201366
201707
|
/** @internal */
|
|
201367
201708
|
_lastMotionAdjustedPt;
|
|
201368
201709
|
/** @internal */
|
|
201710
|
+
_lengthFormatterSpec;
|
|
201711
|
+
/** @internal */
|
|
201712
|
+
_angleFormatterSpec;
|
|
201713
|
+
/** @internal */
|
|
201714
|
+
_removeFormatterListener;
|
|
201715
|
+
/** @internal */
|
|
201369
201716
|
allowView(vp) { return vp.view.isSpatialView() || vp.view.isDrawingView(); }
|
|
201370
201717
|
/** @internal */
|
|
201371
201718
|
isCompatibleViewport(vp, isSelectedViewChange) { return (super.isCompatibleViewport(vp, isSelectedViewChange) && undefined !== vp && this.allowView(vp)); }
|
|
@@ -201376,34 +201723,50 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201376
201723
|
/** @internal */
|
|
201377
201724
|
async onPostInstall() {
|
|
201378
201725
|
await super.onPostInstall();
|
|
201726
|
+
this._lengthFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
201727
|
+
this._angleFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.ANGLE", "Units.RAD");
|
|
201728
|
+
this._removeFormatterListener = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.formatsProvider.onFormatsChanged.addListener(async (args) => {
|
|
201729
|
+
if (args.formatsChanged === "all" || args.formatsChanged.includes("AecUnits.LENGTH"))
|
|
201730
|
+
this._lengthFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
201731
|
+
if (args.formatsChanged === "all" || args.formatsChanged.includes("AecUnits.ANGLE"))
|
|
201732
|
+
this._angleFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.ANGLE", "Units.RAD");
|
|
201733
|
+
});
|
|
201379
201734
|
this.setupAndPromptForNextAction();
|
|
201380
201735
|
}
|
|
201381
201736
|
/** @internal */
|
|
201737
|
+
async onCleanup() {
|
|
201738
|
+
if (this._removeFormatterListener) {
|
|
201739
|
+
this._removeFormatterListener();
|
|
201740
|
+
this._removeFormatterListener = undefined;
|
|
201741
|
+
}
|
|
201742
|
+
await super.onCleanup();
|
|
201743
|
+
}
|
|
201744
|
+
/** @internal */
|
|
201382
201745
|
async onUnsuspend() { this.showPrompt(); }
|
|
201383
201746
|
/** @internal */
|
|
201384
201747
|
showPrompt() {
|
|
201385
|
-
const mainInstruction =
|
|
201748
|
+
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"));
|
|
201386
201749
|
const mouseInstructions = [];
|
|
201387
201750
|
const touchInstructions = [];
|
|
201388
|
-
if (!
|
|
201389
|
-
touchInstructions.push(
|
|
201390
|
-
mouseInstructions.push(
|
|
201751
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createTouchCursorInstructions(touchInstructions))
|
|
201752
|
+
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));
|
|
201753
|
+
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));
|
|
201391
201754
|
if (0 === this._locationData.length) {
|
|
201392
201755
|
if (this._acceptedSegments.length > 0) {
|
|
201393
|
-
touchInstructions.push(
|
|
201394
|
-
mouseInstructions.push(
|
|
201756
|
+
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));
|
|
201757
|
+
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));
|
|
201395
201758
|
}
|
|
201396
201759
|
}
|
|
201397
201760
|
else {
|
|
201398
|
-
touchInstructions.push(
|
|
201399
|
-
mouseInstructions.push(
|
|
201400
|
-
mouseInstructions.push(
|
|
201401
|
-
mouseInstructions.push(
|
|
201761
|
+
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));
|
|
201762
|
+
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));
|
|
201763
|
+
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));
|
|
201764
|
+
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));
|
|
201402
201765
|
}
|
|
201403
201766
|
const sections = [];
|
|
201404
|
-
sections.push(
|
|
201405
|
-
sections.push(
|
|
201406
|
-
const instructions =
|
|
201767
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
201768
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
201769
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
201407
201770
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
201408
201771
|
}
|
|
201409
201772
|
/** @internal */
|
|
@@ -201449,8 +201812,8 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201449
201812
|
totalDistance += adjustedPoints[i].distance(adjustedPoints[i + 1]);
|
|
201450
201813
|
if (0.0 === totalDistance)
|
|
201451
201814
|
return;
|
|
201452
|
-
const formatterSpec =
|
|
201453
|
-
if (
|
|
201815
|
+
const formatterSpec = this._lengthFormatterSpec;
|
|
201816
|
+
if (formatterSpec === undefined)
|
|
201454
201817
|
return;
|
|
201455
201818
|
const formattedTotalDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(totalDistance, formatterSpec);
|
|
201456
201819
|
const distDyn = new MeasureLabel(points[points.length - 1], formattedTotalDistance);
|
|
@@ -201464,7 +201827,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201464
201827
|
seg.refAxes.multiplyVectorInPlace(xVec);
|
|
201465
201828
|
seg.refAxes.multiplyVectorInPlace(yVec);
|
|
201466
201829
|
seg.refAxes.multiplyVectorInPlace(zVec);
|
|
201467
|
-
const builderAxes = context.createGraphicBuilder(
|
|
201830
|
+
const builderAxes = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
201468
201831
|
let basePt = seg.start.clone();
|
|
201469
201832
|
if (xVec.magnitude() > 1.0e-5) {
|
|
201470
201833
|
const segPoints = [];
|
|
@@ -201511,12 +201874,12 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201511
201874
|
}
|
|
201512
201875
|
tmpPoints.push(this._lastMotionPt);
|
|
201513
201876
|
tmpAdjustedPoints.push(this._lastMotionAdjustedPt);
|
|
201514
|
-
const builderDynVis = context.createGraphicBuilder(
|
|
201877
|
+
const builderDynVis = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldDecoration);
|
|
201515
201878
|
const colorDynVis = context.viewport.hilite.color;
|
|
201516
201879
|
builderDynVis.setSymbology(colorDynVis, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 3);
|
|
201517
201880
|
builderDynVis.addLineString(tmpPoints);
|
|
201518
201881
|
context.addDecorationFromBuilder(builderDynVis);
|
|
201519
|
-
const builderDynHid = context.createGraphicBuilder(
|
|
201882
|
+
const builderDynHid = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
201520
201883
|
const colorDynHid = colorDynVis.withAlpha(100);
|
|
201521
201884
|
builderDynHid.setSymbology(colorDynHid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Code2);
|
|
201522
201885
|
builderDynHid.addLineString(tmpPoints);
|
|
@@ -201524,8 +201887,8 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201524
201887
|
this.displayDynamicDistance(context, tmpPoints, tmpAdjustedPoints);
|
|
201525
201888
|
}
|
|
201526
201889
|
if (this._acceptedSegments.length > 0) {
|
|
201527
|
-
const builderAccVis = context.createGraphicBuilder(
|
|
201528
|
-
const builderAccHid = context.createGraphicBuilder(
|
|
201890
|
+
const builderAccVis = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldDecoration);
|
|
201891
|
+
const builderAccHid = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
201529
201892
|
const colorAccVis = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);
|
|
201530
201893
|
const colorAccHid = colorAccVis.withAlpha(100);
|
|
201531
201894
|
builderAccVis.setSymbology(colorAccVis, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 3);
|
|
@@ -201547,7 +201910,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201547
201910
|
return;
|
|
201548
201911
|
if (undefined === this._snapGeomId)
|
|
201549
201912
|
this._snapGeomId = this.iModel.transientIds.getNext();
|
|
201550
|
-
const builderSnapPts = context.createGraphicBuilder(
|
|
201913
|
+
const builderSnapPts = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay, undefined, this._snapGeomId);
|
|
201551
201914
|
const colorAccPts = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);
|
|
201552
201915
|
builderSnapPts.setSymbology(colorAccPts, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.black, 7);
|
|
201553
201916
|
builderSnapPts.addPointString(snapPoints);
|
|
@@ -201576,7 +201939,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201576
201939
|
reportMeasurements() {
|
|
201577
201940
|
if (undefined === this._totalDistanceMarker)
|
|
201578
201941
|
return;
|
|
201579
|
-
const briefMsg = `${
|
|
201942
|
+
const briefMsg = `${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(this._acceptedSegments.length > 1 ? "Measure.Labels.CumulativeDistance" : "Measure.Labels.Distance")}: ${this._totalDistanceMarker.label}`;
|
|
201580
201943
|
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);
|
|
201581
201944
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(msgDetail);
|
|
201582
201945
|
}
|
|
@@ -201587,7 +201950,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201587
201950
|
this._totalDistance += seg.distance;
|
|
201588
201951
|
if (0.0 === this._totalDistance)
|
|
201589
201952
|
return;
|
|
201590
|
-
const formatterSpec =
|
|
201953
|
+
const formatterSpec = this._lengthFormatterSpec;
|
|
201591
201954
|
if (undefined === formatterSpec)
|
|
201592
201955
|
return;
|
|
201593
201956
|
const formattedTotalDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalDistance, formatterSpec);
|
|
@@ -201598,20 +201961,20 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201598
201961
|
const is3d = (undefined === this.targetView || this.targetView.view.is3d());
|
|
201599
201962
|
const isSpatial = (undefined !== this.targetView && this.targetView.view.isSpatialView());
|
|
201600
201963
|
const toolTip = document.createElement("div");
|
|
201601
|
-
const distanceFormatterSpec =
|
|
201964
|
+
const distanceFormatterSpec = this._lengthFormatterSpec;
|
|
201602
201965
|
if (undefined === distanceFormatterSpec)
|
|
201603
201966
|
return toolTip;
|
|
201604
201967
|
let toolTipHtml = "";
|
|
201605
201968
|
const formattedDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(distance, distanceFormatterSpec);
|
|
201606
201969
|
toolTipHtml += `${translateBold("Distance") + formattedDistance}<br>`;
|
|
201607
201970
|
if (is3d) {
|
|
201608
|
-
const angleFormatterSpec =
|
|
201971
|
+
const angleFormatterSpec = this._angleFormatterSpec;
|
|
201609
201972
|
if (undefined !== angleFormatterSpec) {
|
|
201610
201973
|
const formattedSlope = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(slope, angleFormatterSpec);
|
|
201611
201974
|
toolTipHtml += `${translateBold("Slope") + formattedSlope}<br>`;
|
|
201612
201975
|
}
|
|
201613
201976
|
}
|
|
201614
|
-
const coordFormatterSpec =
|
|
201977
|
+
const coordFormatterSpec = this._lengthFormatterSpec;
|
|
201615
201978
|
if (undefined !== coordFormatterSpec) {
|
|
201616
201979
|
let startAdjusted = start;
|
|
201617
201980
|
let endAdjusted = end;
|
|
@@ -201756,19 +202119,19 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201756
202119
|
this.setupAndPromptForNextAction();
|
|
201757
202120
|
if (undefined !== ev.viewport)
|
|
201758
202121
|
ev.viewport.invalidateDecorations();
|
|
201759
|
-
return
|
|
202122
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
201760
202123
|
}
|
|
201761
202124
|
/** @internal */
|
|
201762
202125
|
async onResetButtonUp(ev) {
|
|
201763
202126
|
if (0 === this._locationData.length) {
|
|
201764
202127
|
await this.onReinitialize();
|
|
201765
|
-
return
|
|
202128
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
201766
202129
|
}
|
|
201767
202130
|
await this.acceptNewSegments();
|
|
201768
202131
|
this.setupAndPromptForNextAction();
|
|
201769
202132
|
if (undefined !== ev.viewport)
|
|
201770
202133
|
ev.viewport.invalidateDecorations();
|
|
201771
|
-
return
|
|
202134
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
201772
202135
|
}
|
|
201773
202136
|
/** @internal */
|
|
201774
202137
|
async onUndoPreviousStep() {
|
|
@@ -201799,7 +202162,7 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201799
202162
|
/** Report spatial coordinate at a point as well as cartographic location for geolocated models using current quantity formatters.
|
|
201800
202163
|
* @public
|
|
201801
202164
|
*/
|
|
201802
|
-
class MeasureLocationTool extends
|
|
202165
|
+
class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
201803
202166
|
static toolId = "Measure.Location";
|
|
201804
202167
|
static iconSpec = "icon-measure-location";
|
|
201805
202168
|
/** @internal */
|
|
@@ -201821,20 +202184,20 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201821
202184
|
async onUnsuspend() { this.showPrompt(); }
|
|
201822
202185
|
/** @internal */
|
|
201823
202186
|
showPrompt() {
|
|
201824
|
-
const mainInstruction =
|
|
202187
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("Measure.Location.Prompts.EnterPoint"));
|
|
201825
202188
|
const mouseInstructions = [];
|
|
201826
202189
|
const touchInstructions = [];
|
|
201827
|
-
if (!
|
|
201828
|
-
touchInstructions.push(
|
|
201829
|
-
mouseInstructions.push(
|
|
202190
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createTouchCursorInstructions(touchInstructions))
|
|
202191
|
+
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));
|
|
202192
|
+
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));
|
|
201830
202193
|
if (0 !== this._acceptedLocations.length) {
|
|
201831
|
-
touchInstructions.push(
|
|
201832
|
-
mouseInstructions.push(
|
|
202194
|
+
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));
|
|
202195
|
+
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));
|
|
201833
202196
|
}
|
|
201834
202197
|
const sections = [];
|
|
201835
|
-
sections.push(
|
|
201836
|
-
sections.push(
|
|
201837
|
-
const instructions =
|
|
202198
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
202199
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
202200
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
201838
202201
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
201839
202202
|
}
|
|
201840
202203
|
/** @internal */
|
|
@@ -201847,7 +202210,7 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201847
202210
|
const isSpatial = (undefined !== this.targetView && this.targetView.view.isSpatialView());
|
|
201848
202211
|
const toolTip = document.createElement("div");
|
|
201849
202212
|
let toolTipHtml = "";
|
|
201850
|
-
const coordFormatterSpec = await
|
|
202213
|
+
const coordFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
201851
202214
|
if (undefined !== coordFormatterSpec) {
|
|
201852
202215
|
let pointAdjusted = point;
|
|
201853
202216
|
if (isSpatial) {
|
|
@@ -201863,15 +202226,15 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201863
202226
|
toolTipHtml += "<br>";
|
|
201864
202227
|
}
|
|
201865
202228
|
if (isSpatial) {
|
|
201866
|
-
const latLongFormatterSpec = await
|
|
202229
|
+
const latLongFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.ANGLE", "Units.RAD");
|
|
201867
202230
|
if (undefined !== latLongFormatterSpec && undefined !== coordFormatterSpec) {
|
|
201868
202231
|
try {
|
|
201869
202232
|
const cartographic = await this.iModel.spatialToCartographic(point);
|
|
201870
202233
|
const formattedLat = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(Math.abs(cartographic.latitude), latLongFormatterSpec);
|
|
201871
202234
|
const formattedLong = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(Math.abs(cartographic.longitude), latLongFormatterSpec);
|
|
201872
202235
|
const formattedHeight = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(cartographic.height, coordFormatterSpec);
|
|
201873
|
-
const latDir =
|
|
201874
|
-
const longDir =
|
|
202236
|
+
const latDir = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(cartographic.latitude < 0 ? "Measure.Labels.S" : "Measure.Labels.N");
|
|
202237
|
+
const longDir = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(cartographic.longitude < 0 ? "Measure.Labels.W" : "Measure.Labels.E");
|
|
201875
202238
|
toolTipHtml += `${translateBold("LatLong") + formattedLat + latDir}, ${formattedLong}${longDir}<br>`;
|
|
201876
202239
|
toolTipHtml += `${translateBold("Altitude") + formattedHeight}<br>`;
|
|
201877
202240
|
}
|
|
@@ -201909,12 +202272,12 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201909
202272
|
this.setupAndPromptForNextAction();
|
|
201910
202273
|
if (undefined !== ev.viewport)
|
|
201911
202274
|
ev.viewport.invalidateDecorations();
|
|
201912
|
-
return
|
|
202275
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
201913
202276
|
}
|
|
201914
202277
|
/** @internal */
|
|
201915
202278
|
async onResetButtonUp(_ev) {
|
|
201916
202279
|
await this.onReinitialize();
|
|
201917
|
-
return
|
|
202280
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
201918
202281
|
}
|
|
201919
202282
|
/** @internal */
|
|
201920
202283
|
async onUndoPreviousStep() {
|
|
@@ -201940,7 +202303,7 @@ class MeasureLocationTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.P
|
|
|
201940
202303
|
/** Report area defined by points using current quantity formatter for area.
|
|
201941
202304
|
* @public
|
|
201942
202305
|
*/
|
|
201943
|
-
class MeasureAreaByPointsTool extends
|
|
202306
|
+
class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
201944
202307
|
static toolId = "Measure.AreaByPoints";
|
|
201945
202308
|
static iconSpec = "icon-measure-2d";
|
|
201946
202309
|
/** @internal */
|
|
@@ -201969,12 +202332,12 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
201969
202332
|
/** @internal */
|
|
201970
202333
|
static _orientationName = "enumAsOrientation";
|
|
201971
202334
|
/** @internal */
|
|
201972
|
-
static enumAsOrientationMessage(str) { return
|
|
202335
|
+
static enumAsOrientationMessage(str) { return _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(`Settings.Orientation.${str}`); }
|
|
201973
202336
|
/** @internal */
|
|
201974
202337
|
static _getEnumAsOrientationDescription = () => {
|
|
201975
202338
|
return {
|
|
201976
202339
|
name: MeasureAreaByPointsTool._orientationName,
|
|
201977
|
-
displayLabel:
|
|
202340
|
+
displayLabel: _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("Settings.Orientation.Label"),
|
|
201978
202341
|
typename: "enum",
|
|
201979
202342
|
enum: {
|
|
201980
202343
|
choices: [
|
|
@@ -202042,24 +202405,24 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202042
202405
|
mainMsg += this._isComplete ? "FirstPoint" : "NextPoint";
|
|
202043
202406
|
break;
|
|
202044
202407
|
}
|
|
202045
|
-
const mainInstruction =
|
|
202408
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(mainMsg));
|
|
202046
202409
|
const mouseInstructions = [];
|
|
202047
202410
|
const touchInstructions = [];
|
|
202048
|
-
const acceptMsg =
|
|
202049
|
-
if (!
|
|
202050
|
-
touchInstructions.push(
|
|
202051
|
-
mouseInstructions.push(
|
|
202052
|
-
const resetMsg =
|
|
202053
|
-
touchInstructions.push(
|
|
202054
|
-
mouseInstructions.push(
|
|
202411
|
+
const acceptMsg = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(this._isComplete ? "ElementSet.Inputs.Restart" : "ElementSet.Inputs.AcceptPoint");
|
|
202412
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createTouchCursorInstructions(touchInstructions))
|
|
202413
|
+
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));
|
|
202414
|
+
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));
|
|
202415
|
+
const resetMsg = _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("ElementSet.Inputs.Restart");
|
|
202416
|
+
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));
|
|
202417
|
+
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));
|
|
202055
202418
|
if (this._points.length > 1)
|
|
202056
|
-
mouseInstructions.push(
|
|
202419
|
+
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));
|
|
202057
202420
|
if (0 !== this._points.length)
|
|
202058
|
-
mouseInstructions.push(
|
|
202421
|
+
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));
|
|
202059
202422
|
const sections = [];
|
|
202060
|
-
sections.push(
|
|
202061
|
-
sections.push(
|
|
202062
|
-
const instructions =
|
|
202423
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
202424
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
202425
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
202063
202426
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
202064
202427
|
}
|
|
202065
202428
|
/** @internal */
|
|
@@ -202103,7 +202466,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202103
202466
|
let currentPt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(cursorPt, points[0], normal, this.targetView, true);
|
|
202104
202467
|
if (undefined === currentPt)
|
|
202105
202468
|
currentPt = cursorPt.clone();
|
|
202106
|
-
if (2 === points.length && 0 === (_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.toolAdmin.currentInputState.qualifiers &
|
|
202469
|
+
if (2 === points.length && 0 === (_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.toolAdmin.currentInputState.qualifiers & _Tool__WEBPACK_IMPORTED_MODULE_10__.BeModifierKeys.Control)) {
|
|
202107
202470
|
const xDir = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(points[0], points[1]);
|
|
202108
202471
|
const xLen = xDir.magnitude();
|
|
202109
202472
|
xDir.normalizeInPlace();
|
|
@@ -202129,8 +202492,8 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202129
202492
|
const points = this.getShapePoints(this._lastMotionPt);
|
|
202130
202493
|
if (points.length < 2)
|
|
202131
202494
|
return;
|
|
202132
|
-
const builderAccVis = context.createGraphicBuilder(
|
|
202133
|
-
const builderAccHid = context.createGraphicBuilder(
|
|
202495
|
+
const builderAccVis = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldDecoration);
|
|
202496
|
+
const builderAccHid = context.createGraphicBuilder(_common_render_GraphicType__WEBPACK_IMPORTED_MODULE_12__.GraphicType.WorldOverlay);
|
|
202134
202497
|
const colorAccVis = _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white.adjustedForContrast(context.viewport.view.backgroundColor);
|
|
202135
202498
|
const colorAccHid = colorAccVis.withAlpha(100);
|
|
202136
202499
|
const fillAccVis = context.viewport.hilite.color.withAlpha(50);
|
|
@@ -202167,17 +202530,17 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202167
202530
|
const isSpatial = (undefined !== this.targetView && this.targetView.view.isSpatialView());
|
|
202168
202531
|
const toolTip = document.createElement("div");
|
|
202169
202532
|
let toolTipHtml = "";
|
|
202170
|
-
const areaFormatterSpec = await
|
|
202533
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
202171
202534
|
if (undefined !== areaFormatterSpec) {
|
|
202172
202535
|
const formattedArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._area, areaFormatterSpec);
|
|
202173
202536
|
toolTipHtml += `${translateBold("Area") + formattedArea}<br>`;
|
|
202174
202537
|
}
|
|
202175
|
-
const perimeterFormatterSpec = await
|
|
202538
|
+
const perimeterFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
202176
202539
|
if (undefined !== perimeterFormatterSpec) {
|
|
202177
202540
|
const formattedPerimeter = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._perimeter, perimeterFormatterSpec);
|
|
202178
202541
|
toolTipHtml += `${translateBold("Perimeter") + formattedPerimeter}<br>`;
|
|
202179
202542
|
}
|
|
202180
|
-
const coordFormatterSpec = await
|
|
202543
|
+
const coordFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
202181
202544
|
if (undefined !== coordFormatterSpec) {
|
|
202182
202545
|
let pointAdjusted = this._centroid.clone();
|
|
202183
202546
|
if (isSpatial) {
|
|
@@ -202198,7 +202561,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202198
202561
|
reportMeasurements() {
|
|
202199
202562
|
if (undefined === this._marker)
|
|
202200
202563
|
return;
|
|
202201
|
-
const briefMsg = `${
|
|
202564
|
+
const briefMsg = `${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate("Measure.Labels.Area")}: ${this._marker.label}`;
|
|
202202
202565
|
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);
|
|
202203
202566
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(msgDetail);
|
|
202204
202567
|
}
|
|
@@ -202216,7 +202579,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202216
202579
|
const toolTip = await this.getMarkerToolTip();
|
|
202217
202580
|
this._acceptedMeasurement = new MeasureMarker("1", toolTip, this._centroid, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(25, 25));
|
|
202218
202581
|
this._marker = undefined;
|
|
202219
|
-
const areaFormatterSpec = await
|
|
202582
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
202220
202583
|
if (undefined === areaFormatterSpec)
|
|
202221
202584
|
return;
|
|
202222
202585
|
const formattedTotalArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._area, areaFormatterSpec);
|
|
@@ -202226,23 +202589,23 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202226
202589
|
/** @internal */
|
|
202227
202590
|
async onDataButtonDown(ev) {
|
|
202228
202591
|
if (undefined === this.targetView)
|
|
202229
|
-
return
|
|
202592
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202230
202593
|
if (this._isComplete)
|
|
202231
202594
|
await this.onReinitialize();
|
|
202232
202595
|
if (this._points.length > 1 && !ev.isControlKey) {
|
|
202233
202596
|
const points = this.getShapePoints(ev.point);
|
|
202234
202597
|
if (points.length < 3)
|
|
202235
|
-
return
|
|
202598
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202236
202599
|
this._isComplete = true;
|
|
202237
202600
|
this._points.length = 0;
|
|
202238
202601
|
for (const pt of points)
|
|
202239
202602
|
this._points.push(pt);
|
|
202240
202603
|
await this.updateTotals();
|
|
202241
202604
|
this.setupAndPromptForNextAction();
|
|
202242
|
-
return
|
|
202605
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202243
202606
|
}
|
|
202244
202607
|
if (undefined === this._matrix && undefined === (this._matrix = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.getContextRotation(this.orientation, this.targetView)))
|
|
202245
|
-
return
|
|
202608
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202246
202609
|
const currPt = ev.point.clone();
|
|
202247
202610
|
if (this._points.length > 0) {
|
|
202248
202611
|
const planePt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(currPt, this._points[0], this._matrix.getColumn(2), ev.viewport, true);
|
|
@@ -202251,14 +202614,14 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202251
202614
|
}
|
|
202252
202615
|
this._points.push(currPt);
|
|
202253
202616
|
this.setupAndPromptForNextAction();
|
|
202254
|
-
return
|
|
202617
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202255
202618
|
}
|
|
202256
202619
|
/** @internal */
|
|
202257
202620
|
async onResetButtonUp(ev) {
|
|
202258
202621
|
if (undefined !== ev.viewport)
|
|
202259
202622
|
ev.viewport.invalidateDecorations();
|
|
202260
202623
|
await this.onReinitialize();
|
|
202261
|
-
return
|
|
202624
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202262
202625
|
}
|
|
202263
202626
|
/** @internal */
|
|
202264
202627
|
async onReinitialize() {
|
|
@@ -202288,7 +202651,7 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10
|
|
|
202288
202651
|
/** Base class for mass properties tools.
|
|
202289
202652
|
* @public
|
|
202290
202653
|
*/
|
|
202291
|
-
class MeasureElementTool extends
|
|
202654
|
+
class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.PrimitiveTool {
|
|
202292
202655
|
/** @internal */
|
|
202293
202656
|
_checkedIds = new Map();
|
|
202294
202657
|
/** @internal */
|
|
@@ -202324,33 +202687,33 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202324
202687
|
/** @internal */
|
|
202325
202688
|
showPrompt() {
|
|
202326
202689
|
const mainMsg = (this._useSelection ? (0 === this._acceptedMeasurements.length ? "ElementSet.Prompts.ConfirmSelection" : "ElementSet.Prompts.InspectResult") : "ElementSet.Prompts.IdentifyElement");
|
|
202327
|
-
const mainInstruction =
|
|
202690
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(mainMsg));
|
|
202328
202691
|
const mouseInstructions = [];
|
|
202329
202692
|
const touchInstructions = [];
|
|
202330
202693
|
if (this._useSelection) {
|
|
202331
202694
|
if (0 === this._acceptedMeasurements.length) {
|
|
202332
|
-
touchInstructions.push(
|
|
202333
|
-
mouseInstructions.push(
|
|
202334
|
-
touchInstructions.push(
|
|
202335
|
-
mouseInstructions.push(
|
|
202695
|
+
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));
|
|
202696
|
+
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));
|
|
202697
|
+
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));
|
|
202698
|
+
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));
|
|
202336
202699
|
}
|
|
202337
202700
|
else {
|
|
202338
|
-
touchInstructions.push(
|
|
202339
|
-
mouseInstructions.push(
|
|
202701
|
+
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));
|
|
202702
|
+
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));
|
|
202340
202703
|
}
|
|
202341
202704
|
}
|
|
202342
202705
|
else {
|
|
202343
|
-
touchInstructions.push(
|
|
202344
|
-
mouseInstructions.push(
|
|
202706
|
+
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));
|
|
202707
|
+
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));
|
|
202345
202708
|
if (0 !== this._acceptedMeasurements.length) {
|
|
202346
|
-
touchInstructions.push(
|
|
202347
|
-
mouseInstructions.push(
|
|
202709
|
+
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));
|
|
202710
|
+
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));
|
|
202348
202711
|
}
|
|
202349
202712
|
}
|
|
202350
202713
|
const sections = [];
|
|
202351
|
-
sections.push(
|
|
202352
|
-
sections.push(
|
|
202353
|
-
const instructions =
|
|
202714
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(mouseInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
202715
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createSection(touchInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.inputsLabel));
|
|
202716
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
202354
202717
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.setToolAssistance(instructions);
|
|
202355
202718
|
}
|
|
202356
202719
|
/** @internal */
|
|
@@ -202387,7 +202750,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202387
202750
|
default:
|
|
202388
202751
|
return;
|
|
202389
202752
|
}
|
|
202390
|
-
const briefMsg = `${
|
|
202753
|
+
const briefMsg = `${_Tool__WEBPACK_IMPORTED_MODULE_10__.CoreTools.translate(label)}: ${this._totalMarker.label}`;
|
|
202391
202754
|
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);
|
|
202392
202755
|
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(msgDetail);
|
|
202393
202756
|
}
|
|
@@ -202398,7 +202761,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202398
202761
|
let toolTipHtml = "";
|
|
202399
202762
|
switch (this.getOperation()) {
|
|
202400
202763
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateLengths: {
|
|
202401
|
-
const distanceFormatterSpec = await
|
|
202764
|
+
const distanceFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
202402
202765
|
if (undefined !== distanceFormatterSpec) {
|
|
202403
202766
|
const formattedLength = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.length ? responseProps.length : 0, distanceFormatterSpec);
|
|
202404
202767
|
toolTipHtml += `${translateBold("Length") + formattedLength}<br>`;
|
|
@@ -202406,13 +202769,13 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202406
202769
|
break;
|
|
202407
202770
|
}
|
|
202408
202771
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateAreas: {
|
|
202409
|
-
const areaFormatterSpec = await
|
|
202772
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
202410
202773
|
if (undefined !== areaFormatterSpec) {
|
|
202411
202774
|
const formattedArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.area ? responseProps.area : 0, areaFormatterSpec);
|
|
202412
202775
|
toolTipHtml += `${translateBold("Area") + formattedArea}<br>`;
|
|
202413
202776
|
}
|
|
202414
202777
|
if (responseProps.perimeter) {
|
|
202415
|
-
const perimeterFormatterSpec = await
|
|
202778
|
+
const perimeterFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
202416
202779
|
if (undefined !== perimeterFormatterSpec) {
|
|
202417
202780
|
const formattedPerimeter = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.perimeter, perimeterFormatterSpec);
|
|
202418
202781
|
toolTipHtml += `${translateBold("Perimeter") + formattedPerimeter}<br>`;
|
|
@@ -202421,13 +202784,13 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202421
202784
|
break;
|
|
202422
202785
|
}
|
|
202423
202786
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateVolumes: {
|
|
202424
|
-
const volumeFormatterSpec = await
|
|
202787
|
+
const volumeFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.VOLUME", "Units.CUB_M");
|
|
202425
202788
|
if (undefined !== volumeFormatterSpec) {
|
|
202426
202789
|
const formattedVolume = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.volume ? responseProps.volume : 0, volumeFormatterSpec);
|
|
202427
202790
|
toolTipHtml += `${translateBold("Volume") + formattedVolume}<br>`;
|
|
202428
202791
|
}
|
|
202429
202792
|
if (responseProps.area) {
|
|
202430
|
-
const areaFormatterSpec = await
|
|
202793
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
202431
202794
|
if (undefined !== areaFormatterSpec) {
|
|
202432
202795
|
const formattedArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(responseProps.area, areaFormatterSpec);
|
|
202433
202796
|
toolTipHtml += `${translateBold("Area") + formattedArea}<br>`;
|
|
@@ -202437,7 +202800,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202437
202800
|
}
|
|
202438
202801
|
}
|
|
202439
202802
|
if (responseProps.centroid) {
|
|
202440
|
-
const coordFormatterSpec = await
|
|
202803
|
+
const coordFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
202441
202804
|
if (undefined !== coordFormatterSpec) {
|
|
202442
202805
|
let pointAdjusted = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(responseProps.centroid);
|
|
202443
202806
|
if (isSpatial) {
|
|
@@ -202488,21 +202851,21 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202488
202851
|
return;
|
|
202489
202852
|
switch (operation) {
|
|
202490
202853
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateLengths:
|
|
202491
|
-
const distanceFormatterSpec = await
|
|
202854
|
+
const distanceFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.LENGTH", "Units.M");
|
|
202492
202855
|
if (undefined === distanceFormatterSpec)
|
|
202493
202856
|
return;
|
|
202494
202857
|
const formattedTotalDistance = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalValue, distanceFormatterSpec);
|
|
202495
202858
|
this._totalMarker = new MeasureLabel(labelPt, formattedTotalDistance);
|
|
202496
202859
|
break;
|
|
202497
202860
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateAreas:
|
|
202498
|
-
const areaFormatterSpec = await
|
|
202861
|
+
const areaFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.AREA", "Units.SQ_M");
|
|
202499
202862
|
if (undefined === areaFormatterSpec)
|
|
202500
202863
|
return;
|
|
202501
202864
|
const formattedTotalArea = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalValue, areaFormatterSpec);
|
|
202502
202865
|
this._totalMarker = new MeasureLabel(labelPt, formattedTotalArea);
|
|
202503
202866
|
break;
|
|
202504
202867
|
case _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.MassPropertiesOperation.AccumulateVolumes:
|
|
202505
|
-
const volumeFormatterSpec = await
|
|
202868
|
+
const volumeFormatterSpec = await getFormatterSpecByKoQAndPersistenceUnit("AecUnits.VOLUME", "Units.CUB_M");
|
|
202506
202869
|
if (undefined === volumeFormatterSpec)
|
|
202507
202870
|
return;
|
|
202508
202871
|
const formattedTotalVolume = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.quantityFormatter.formatQuantity(this._totalValue, volumeFormatterSpec);
|
|
@@ -202560,7 +202923,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202560
202923
|
/** @internal */
|
|
202561
202924
|
async onResetButtonUp(_ev) {
|
|
202562
202925
|
await this.onReinitialize();
|
|
202563
|
-
return
|
|
202926
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202564
202927
|
}
|
|
202565
202928
|
/** @internal */
|
|
202566
202929
|
async onDataButtonDown(ev) {
|
|
@@ -202568,20 +202931,20 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202568
202931
|
if (0 === this._acceptedMeasurements.length && undefined !== ev.viewport) {
|
|
202569
202932
|
await this.doMeasureSelectedElements(ev.viewport);
|
|
202570
202933
|
if (0 !== this._acceptedMeasurements.length)
|
|
202571
|
-
return
|
|
202572
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.notifications.outputMessage(new _NotificationManager__WEBPACK_IMPORTED_MODULE_8__.NotifyMessageDetails(_NotificationManager__WEBPACK_IMPORTED_MODULE_8__.OutputMessagePriority.Error,
|
|
202934
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.Yes;
|
|
202935
|
+
_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")));
|
|
202573
202936
|
await this.onReinitialize();
|
|
202574
202937
|
}
|
|
202575
|
-
return
|
|
202938
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.Yes;
|
|
202576
202939
|
}
|
|
202577
202940
|
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);
|
|
202578
202941
|
if (undefined === hit || !hit.isElementHit)
|
|
202579
|
-
return
|
|
202942
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202580
202943
|
const result = this._checkedIds.get(hit.sourceId);
|
|
202581
202944
|
if (undefined === result)
|
|
202582
|
-
return
|
|
202945
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202583
202946
|
if (-1 !== this._acceptedIds.indexOf(hit.sourceId))
|
|
202584
|
-
return
|
|
202947
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.Yes; // Already accepted, not rejected in filterHit to avoid showing "not" cursor...
|
|
202585
202948
|
const toolTip = await this.getMarkerToolTip(result);
|
|
202586
202949
|
const point = result.centroid ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(result.centroid) : ev.point.clone();
|
|
202587
202950
|
const marker = new MeasureMarker((this._acceptedMeasurements.length + 1).toString(), toolTip, point, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(25, 25));
|
|
@@ -202592,7 +202955,7 @@ class MeasureElementTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_10__.Pr
|
|
|
202592
202955
|
this.setupAndPromptForNextAction();
|
|
202593
202956
|
if (undefined !== ev.viewport)
|
|
202594
202957
|
ev.viewport.invalidateDecorations();
|
|
202595
|
-
return
|
|
202958
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
202596
202959
|
}
|
|
202597
202960
|
/** @internal */
|
|
202598
202961
|
async onUndoPreviousStep() {
|
|
@@ -204708,6 +205071,7 @@ class CurrentInputState {
|
|
|
204708
205071
|
lastButton = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data;
|
|
204709
205072
|
inputSource = _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Unknown;
|
|
204710
205073
|
lastMotion = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d();
|
|
205074
|
+
lastMotionEvent;
|
|
204711
205075
|
lastWheelEvent;
|
|
204712
205076
|
lastTouchStart;
|
|
204713
205077
|
touchTapTimer;
|
|
@@ -204725,7 +205089,7 @@ class CurrentInputState {
|
|
|
204725
205089
|
onStartDrag(button) { this.button[button].isDragging = true; }
|
|
204726
205090
|
onInstallTool() {
|
|
204727
205091
|
this.clearKeyQualifiers();
|
|
204728
|
-
this.lastWheelEvent = undefined;
|
|
205092
|
+
this.lastWheelEvent = this.lastMotionEvent = undefined;
|
|
204729
205093
|
this.lastTouchStart = this.touchTapTimer = this.touchTapCount = undefined;
|
|
204730
205094
|
}
|
|
204731
205095
|
clearKeyQualifiers() { this.qualifiers = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.None; }
|
|
@@ -205000,6 +205364,9 @@ class ToolAdmin {
|
|
|
205000
205364
|
this.clearMotionPromises();
|
|
205001
205365
|
// make sure tools don't think the cursor is still in this viewport.
|
|
205002
205366
|
this.onMouseLeave(vp);
|
|
205367
|
+
// Invalidate last motion if for this viewport...
|
|
205368
|
+
if (this.currentInputState.lastMotionEvent?.viewport === vp)
|
|
205369
|
+
this.currentInputState.lastMotionEvent = undefined;
|
|
205003
205370
|
// Remove any events associated with this viewport.
|
|
205004
205371
|
ToolAdmin._toolEvents = ToolAdmin._toolEvents.filter((ev) => ev.vp !== vp);
|
|
205005
205372
|
}
|
|
@@ -205363,6 +205730,7 @@ class ToolAdmin {
|
|
|
205363
205730
|
toolPromise.then(() => {
|
|
205364
205731
|
if (undefined === this._toolMotionPromise)
|
|
205365
205732
|
return; // Only early return if canceled, result from a previous motion is preferable to showing nothing...
|
|
205733
|
+
this.currentInputState.lastMotionEvent = motion; // Save to use for simulation motion...
|
|
205366
205734
|
// Update decorations when dynamics are inactive...
|
|
205367
205735
|
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.viewManager.inDynamicsMode) {
|
|
205368
205736
|
vp.invalidateDecorations();
|
|
@@ -206104,7 +206472,8 @@ class ToolAdmin {
|
|
|
206104
206472
|
}
|
|
206105
206473
|
/** Can be called by tools to invoke their [[InteractiveTool.onDynamicFrame]] method without requiring a motion event. */
|
|
206106
206474
|
simulateMotionEvent() {
|
|
206107
|
-
|
|
206475
|
+
// NOTE: Prefer last resolved motion over current cursor location which could be out of the view, or moved from last AccuSnap etc.
|
|
206476
|
+
this.updateDynamics(this.currentInputState.lastMotionEvent, undefined, true);
|
|
206108
206477
|
}
|
|
206109
206478
|
/** @internal */
|
|
206110
206479
|
setIncompatibleViewportCursor(restore) {
|
|
@@ -210282,12 +210651,14 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
210282
210651
|
get targetHeight() { return this.targetHeightProperty.value; }
|
|
210283
210652
|
set targetHeight(value) { this.targetHeightProperty.value = value; }
|
|
210284
210653
|
syncCameraHeightState() {
|
|
210285
|
-
|
|
210654
|
+
const specs = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.quantityFormatter.getSpecsByName(this.cameraHeightProperty.description.kindOfQuantityName ?? "AecUnits.LENGTH");
|
|
210655
|
+
this.cameraHeightProperty.displayValue = specs ? specs.formatterSpec.applyFormatting(this.cameraHeight) : this.cameraHeight.toFixed(2);
|
|
210286
210656
|
this.cameraHeightProperty.isDisabled = !this.useCameraHeight;
|
|
210287
210657
|
this.syncToolSettingsProperties([this.cameraHeightProperty.syncItem]);
|
|
210288
210658
|
}
|
|
210289
210659
|
syncTargetHeightState() {
|
|
210290
|
-
|
|
210660
|
+
const specs = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.quantityFormatter.getSpecsByName(this.targetHeightProperty.description.kindOfQuantityName ?? "AecUnits.LENGTH");
|
|
210661
|
+
this.targetHeightProperty.displayValue = specs ? specs.formatterSpec.applyFormatting(this.targetHeight) : this.targetHeight.toFixed(2);
|
|
210291
210662
|
this.targetHeightProperty.isDisabled = !this.useTargetHeight;
|
|
210292
210663
|
this.syncToolSettingsProperties([this.targetHeightProperty.syncItem]);
|
|
210293
210664
|
}
|
|
@@ -329435,7 +329806,7 @@ class TestContext {
|
|
|
329435
329806
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
329436
329807
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
329437
329808
|
await core_frontend_1.NoRenderApp.startup({
|
|
329438
|
-
applicationVersion: "5.0.0-dev.
|
|
329809
|
+
applicationVersion: "5.0.0-dev.113",
|
|
329439
329810
|
applicationId: this.settings.gprid,
|
|
329440
329811
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
329441
329812
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -331436,9 +331807,11 @@ class BaseQuantityDescription {
|
|
|
331436
331807
|
displayLabel;
|
|
331437
331808
|
typename;
|
|
331438
331809
|
editor;
|
|
331439
|
-
|
|
331810
|
+
kindOfQuantityName;
|
|
331811
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
331440
331812
|
this.name = name;
|
|
331441
331813
|
this.displayLabel = displayLabel;
|
|
331814
|
+
this.kindOfQuantityName = kindOfQuantityName;
|
|
331442
331815
|
this.typename = _properties_StandardTypeNames__WEBPACK_IMPORTED_MODULE_1__.StandardTypeNames.Number;
|
|
331443
331816
|
this.editor = {
|
|
331444
331817
|
name: _properties_StandardEditorNames__WEBPACK_IMPORTED_MODULE_2__.StandardEditorNames.NumberCustom,
|
|
@@ -331975,28 +332348,6 @@ const getClassName = (obj) => {
|
|
|
331975
332348
|
};
|
|
331976
332349
|
|
|
331977
332350
|
|
|
331978
|
-
/***/ }),
|
|
331979
|
-
|
|
331980
|
-
/***/ "../../core/frontend/lib/esm/extension/providers lazy recursive":
|
|
331981
|
-
/*!******************************************************************************!*\
|
|
331982
|
-
!*** ../../core/frontend/lib/esm/extension/providers/ lazy namespace object ***!
|
|
331983
|
-
\******************************************************************************/
|
|
331984
|
-
/***/ ((module) => {
|
|
331985
|
-
|
|
331986
|
-
function webpackEmptyAsyncContext(req) {
|
|
331987
|
-
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
331988
|
-
// uncaught exception popping up in devtools
|
|
331989
|
-
return Promise.resolve().then(() => {
|
|
331990
|
-
var e = new Error("Cannot find module '" + req + "'");
|
|
331991
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
331992
|
-
throw e;
|
|
331993
|
-
});
|
|
331994
|
-
}
|
|
331995
|
-
webpackEmptyAsyncContext.keys = () => ([]);
|
|
331996
|
-
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
|
|
331997
|
-
webpackEmptyAsyncContext.id = "../../core/frontend/lib/esm/extension/providers lazy recursive";
|
|
331998
|
-
module.exports = webpackEmptyAsyncContext;
|
|
331999
|
-
|
|
332000
332351
|
/***/ }),
|
|
332001
332352
|
|
|
332002
332353
|
/***/ "?088e":
|
|
@@ -354503,7 +354854,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
354503
354854
|
/***/ ((module) => {
|
|
354504
354855
|
|
|
354505
354856
|
"use strict";
|
|
354506
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
354857
|
+
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"}}');
|
|
354507
354858
|
|
|
354508
354859
|
/***/ }),
|
|
354509
354860
|
|