@itwin/ecschema-rpcinterface-tests 5.15.0-dev.3 → 5.15.0-dev.4
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 +339 -114
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -92073,12 +92073,27 @@ class IModelApp {
|
|
|
92073
92073
|
static get publicPath() { return this._publicPath; }
|
|
92074
92074
|
/** The [[FormatsProvider]] for this session.
|
|
92075
92075
|
* @param provider The provider to use for formatting quantities.
|
|
92076
|
+
* @note Prefer [[IModelApp.setFormatsProvider]] when replacing the provider; assigning this property starts an asynchronous reload without returning a promise.
|
|
92076
92077
|
* @beta
|
|
92077
92078
|
*/
|
|
92078
92079
|
static get formatsProvider() { return this._formatsProviderManager; }
|
|
92079
92080
|
static set formatsProvider(provider) {
|
|
92080
92081
|
this._formatsProviderManager.formatsProvider = provider;
|
|
92081
92082
|
}
|
|
92083
|
+
/**
|
|
92084
|
+
* Replaces the formats provider and optionally changes the active unit system.
|
|
92085
|
+
* Resolves after the formatter has rebuilt its formatting and parsing caches.
|
|
92086
|
+
* Incompatible provider entries are logged and skipped, so they do not reject this Promise.
|
|
92087
|
+
* If the reload fails, this Promise rejects and the new provider stays installed. The formatter remains usable, but some cached formats may still come from the previous provider.
|
|
92088
|
+
* If a later setFormatsProvider call supersedes this request, this Promise rejects.
|
|
92089
|
+
* It also rejects if the application shuts down first.
|
|
92090
|
+
* @beta
|
|
92091
|
+
*/
|
|
92092
|
+
static async setFormatsProvider(provider, options) {
|
|
92093
|
+
await this.quantityFormatter.runAndWaitForReload(() => {
|
|
92094
|
+
this._formatsProviderManager.setFormatsProvider(provider, options?.unitSystem);
|
|
92095
|
+
});
|
|
92096
|
+
}
|
|
92082
92097
|
/** @alpha */
|
|
92083
92098
|
static extensionAdmin = this._createExtensionAdmin();
|
|
92084
92099
|
/** Map of classFullName to EntityState class */
|
|
@@ -161177,6 +161192,161 @@ class BaseUnitFormattingSettingsProvider {
|
|
|
161177
161192
|
}
|
|
161178
161193
|
|
|
161179
161194
|
|
|
161195
|
+
/***/ },
|
|
161196
|
+
|
|
161197
|
+
/***/ "../../core/frontend/lib/esm/quantity-formatting/FormatsProviderReloadCoordinator.js"
|
|
161198
|
+
/*!*******************************************************************************************!*\
|
|
161199
|
+
!*** ../../core/frontend/lib/esm/quantity-formatting/FormatsProviderReloadCoordinator.js ***!
|
|
161200
|
+
\*******************************************************************************************/
|
|
161201
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
161202
|
+
|
|
161203
|
+
"use strict";
|
|
161204
|
+
__webpack_require__.r(__webpack_exports__);
|
|
161205
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
161206
|
+
/* harmony export */ FormatsProviderReloadCoordinator: () => (/* binding */ FormatsProviderReloadCoordinator),
|
|
161207
|
+
/* harmony export */ ReloadSupersededError: () => (/* binding */ ReloadSupersededError)
|
|
161208
|
+
/* harmony export */ });
|
|
161209
|
+
/*---------------------------------------------------------------------------------------------
|
|
161210
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
161211
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
161212
|
+
*--------------------------------------------------------------------------------------------*/
|
|
161213
|
+
/** @internal */
|
|
161214
|
+
class ReloadSupersededError extends Error {
|
|
161215
|
+
constructor() {
|
|
161216
|
+
super("QuantityFormatter reload was superseded by a newer request.");
|
|
161217
|
+
this.name = "ReloadSupersededError";
|
|
161218
|
+
}
|
|
161219
|
+
}
|
|
161220
|
+
/**
|
|
161221
|
+
* Serializes formatting reloads and resolves or rejects the caller waiting for formatting to become ready.
|
|
161222
|
+
* @internal
|
|
161223
|
+
*/
|
|
161224
|
+
class FormatsProviderReloadCoordinator {
|
|
161225
|
+
_host;
|
|
161226
|
+
_disposedError;
|
|
161227
|
+
_reloadInFlight = false;
|
|
161228
|
+
_pendingReload;
|
|
161229
|
+
_pendingFormatsChange;
|
|
161230
|
+
_reloadCaller;
|
|
161231
|
+
_isDisposed = false;
|
|
161232
|
+
constructor(_host, _disposedError) {
|
|
161233
|
+
this._host = _host;
|
|
161234
|
+
this._disposedError = _disposedError;
|
|
161235
|
+
}
|
|
161236
|
+
dispose() {
|
|
161237
|
+
if (this._isDisposed)
|
|
161238
|
+
return;
|
|
161239
|
+
this._isDisposed = true;
|
|
161240
|
+
this._pendingReload = undefined;
|
|
161241
|
+
this._pendingFormatsChange = undefined;
|
|
161242
|
+
this._rejectReloadCaller(this._disposedError);
|
|
161243
|
+
}
|
|
161244
|
+
/**
|
|
161245
|
+
* Runs an action that schedules a reload and waits for the reload queue to drain.
|
|
161246
|
+
* A newer call rejects an older call that is still waiting.
|
|
161247
|
+
*/
|
|
161248
|
+
async runAndWaitForReload(action) {
|
|
161249
|
+
if (this._isDisposed)
|
|
161250
|
+
throw this._disposedError;
|
|
161251
|
+
let caller;
|
|
161252
|
+
const reload = new Promise((resolve, reject) => {
|
|
161253
|
+
caller = { resolve, reject };
|
|
161254
|
+
});
|
|
161255
|
+
this._rejectReloadCaller(new ReloadSupersededError());
|
|
161256
|
+
this._reloadCaller = caller;
|
|
161257
|
+
try {
|
|
161258
|
+
action();
|
|
161259
|
+
}
|
|
161260
|
+
catch (error) {
|
|
161261
|
+
if (this._reloadCaller === caller)
|
|
161262
|
+
this._reloadCaller = undefined;
|
|
161263
|
+
throw error;
|
|
161264
|
+
}
|
|
161265
|
+
await reload;
|
|
161266
|
+
}
|
|
161267
|
+
/**
|
|
161268
|
+
* Runs a reload now, or queues it if one is already running.
|
|
161269
|
+
* Pending format changes are merged and kept apart from other pending reloads, so a later unit-system or units-provider reload cannot drop a provider change.
|
|
161270
|
+
* If a reload is already running, this method returns immediately; use [[runAndWaitForReload]] when the caller must wait for completion.
|
|
161271
|
+
* The waiting caller is rejected if any reload fails before the queue drains.
|
|
161272
|
+
*/
|
|
161273
|
+
async scheduleReload(intent) {
|
|
161274
|
+
if (this._isDisposed)
|
|
161275
|
+
return;
|
|
161276
|
+
if (this._reloadInFlight) {
|
|
161277
|
+
if (intent.scope === "formatsChanged")
|
|
161278
|
+
this._pendingFormatsChange = mergeFormatsChanges(this._pendingFormatsChange, intent);
|
|
161279
|
+
else
|
|
161280
|
+
this._pendingReload = intent;
|
|
161281
|
+
return;
|
|
161282
|
+
}
|
|
161283
|
+
this._reloadInFlight = true;
|
|
161284
|
+
let failure;
|
|
161285
|
+
let current = intent;
|
|
161286
|
+
while (current) {
|
|
161287
|
+
try {
|
|
161288
|
+
this._host.startReload();
|
|
161289
|
+
await this._host.executeReload(current);
|
|
161290
|
+
if (this._stopAfterDisposal())
|
|
161291
|
+
return;
|
|
161292
|
+
current = this._takePendingReload();
|
|
161293
|
+
if (!current) {
|
|
161294
|
+
await this._host.finalizeReload();
|
|
161295
|
+
if (this._stopAfterDisposal())
|
|
161296
|
+
return;
|
|
161297
|
+
current = this._takePendingReload();
|
|
161298
|
+
}
|
|
161299
|
+
}
|
|
161300
|
+
catch (error) {
|
|
161301
|
+
if (this._stopAfterDisposal())
|
|
161302
|
+
return;
|
|
161303
|
+
// Keep draining so queued work still runs, but report the failure to the waiting caller.
|
|
161304
|
+
this._host.handleReloadFailure(error);
|
|
161305
|
+
failure = { error };
|
|
161306
|
+
current = this._takePendingReload();
|
|
161307
|
+
}
|
|
161308
|
+
}
|
|
161309
|
+
this._reloadInFlight = false;
|
|
161310
|
+
if (failure)
|
|
161311
|
+
this._rejectReloadCaller(failure.error);
|
|
161312
|
+
else
|
|
161313
|
+
this._resolveReloadCaller();
|
|
161314
|
+
}
|
|
161315
|
+
_stopAfterDisposal() {
|
|
161316
|
+
if (!this._isDisposed)
|
|
161317
|
+
return false;
|
|
161318
|
+
this._reloadInFlight = false;
|
|
161319
|
+
return true;
|
|
161320
|
+
}
|
|
161321
|
+
_takePendingReload() {
|
|
161322
|
+
const next = this._pendingFormatsChange ?? this._pendingReload;
|
|
161323
|
+
if (next === this._pendingFormatsChange)
|
|
161324
|
+
this._pendingFormatsChange = undefined;
|
|
161325
|
+
else
|
|
161326
|
+
this._pendingReload = undefined;
|
|
161327
|
+
return next;
|
|
161328
|
+
}
|
|
161329
|
+
_resolveReloadCaller() {
|
|
161330
|
+
const caller = this._reloadCaller;
|
|
161331
|
+
this._reloadCaller = undefined;
|
|
161332
|
+
caller?.resolve();
|
|
161333
|
+
}
|
|
161334
|
+
_rejectReloadCaller(error) {
|
|
161335
|
+
const caller = this._reloadCaller;
|
|
161336
|
+
this._reloadCaller = undefined;
|
|
161337
|
+
caller?.reject(error);
|
|
161338
|
+
}
|
|
161339
|
+
}
|
|
161340
|
+
function mergeFormatsChanges(pending, next) {
|
|
161341
|
+
if (!pending)
|
|
161342
|
+
return next;
|
|
161343
|
+
const pendingNames = pending.args.formatsChanged;
|
|
161344
|
+
const nextNames = next.args.formatsChanged;
|
|
161345
|
+
const formatsChanged = pendingNames === "all" || nextNames === "all" ? "all" : [...new Set([...pendingNames, ...nextNames])];
|
|
161346
|
+
return { scope: "formatsChanged", args: { formatsChanged } };
|
|
161347
|
+
}
|
|
161348
|
+
|
|
161349
|
+
|
|
161180
161350
|
/***/ },
|
|
161181
161351
|
|
|
161182
161352
|
/***/ "../../core/frontend/lib/esm/quantity-formatting/LocalUnitFormatProvider.js"
|
|
@@ -161285,6 +161455,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
161285
161455
|
/* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
|
|
161286
161456
|
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
161287
161457
|
/* harmony import */ var _AlternateUnitLabels__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AlternateUnitLabels */ "../../core/frontend/lib/esm/quantity-formatting/AlternateUnitLabels.js");
|
|
161458
|
+
/* harmony import */ var _FormatsProviderReloadCoordinator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormatsProviderReloadCoordinator */ "../../core/frontend/lib/esm/quantity-formatting/FormatsProviderReloadCoordinator.js");
|
|
161288
161459
|
/*---------------------------------------------------------------------------------------------
|
|
161289
161460
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
161290
161461
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -161297,6 +161468,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
161297
161468
|
|
|
161298
161469
|
|
|
161299
161470
|
|
|
161471
|
+
|
|
161300
161472
|
// cSpell:ignore FORMATPROPS FORMATKEY ussurvey uscustomary USCUSTOM
|
|
161301
161473
|
/**
|
|
161302
161474
|
* Defines standard format types for tools that need to display measurements to user.
|
|
@@ -161481,12 +161653,24 @@ class FormatsProviderManager {
|
|
|
161481
161653
|
}
|
|
161482
161654
|
get formatsProvider() { return this; }
|
|
161483
161655
|
set formatsProvider(formatsProvider) {
|
|
161656
|
+
this.setFormatsProvider(formatsProvider);
|
|
161657
|
+
}
|
|
161658
|
+
/**
|
|
161659
|
+
* Replaces the underlying formats provider and raises an event indicating that all formats changed.
|
|
161660
|
+
* @param formatsProvider The formats provider to use for subsequent format lookups.
|
|
161661
|
+
* @param impliedUnitSystem The unit system implied by the replacement provider, if any. Not stored here; [[QuantityFormatter]] applies it as the active unit system when handling `onFormatsChanged`.
|
|
161662
|
+
* @internal
|
|
161663
|
+
*/
|
|
161664
|
+
setFormatsProvider(formatsProvider, impliedUnitSystem) {
|
|
161484
161665
|
this._removeProviderListener?.();
|
|
161485
161666
|
this._formatsProvider = formatsProvider;
|
|
161486
161667
|
this._removeProviderListener = this._formatsProvider.onFormatsChanged.addListener((args) => {
|
|
161487
161668
|
this.onFormatsChanged.raiseEvent(args);
|
|
161488
161669
|
});
|
|
161489
|
-
|
|
161670
|
+
const args = { formatsChanged: "all" };
|
|
161671
|
+
if (impliedUnitSystem !== undefined)
|
|
161672
|
+
args.impliedUnitSystem = impliedUnitSystem;
|
|
161673
|
+
this.onFormatsChanged.raiseEvent(args);
|
|
161490
161674
|
}
|
|
161491
161675
|
}
|
|
161492
161676
|
/** The QuantityFormatter class provides methods for formatting and parsing quantities. There are a set of standard quantity types
|
|
@@ -161567,10 +161751,13 @@ class QuantityFormatter {
|
|
|
161567
161751
|
_hasEverBeenReady = false;
|
|
161568
161752
|
_initializedPromise;
|
|
161569
161753
|
_resolveInitialized;
|
|
161570
|
-
|
|
161571
|
-
|
|
161572
|
-
|
|
161754
|
+
_emitSystemChangedOnReady = false;
|
|
161755
|
+
_isDisposed = false;
|
|
161756
|
+
_disposedError = new Error("QuantityFormatter was disposed before the reload completed.");
|
|
161757
|
+
_reloadCoordinator;
|
|
161573
161758
|
_removeFormatsProviderListener;
|
|
161759
|
+
_activeFormatSpecsTarget;
|
|
161760
|
+
_activeParserSpecsTarget;
|
|
161574
161761
|
/**
|
|
161575
161762
|
* constructor
|
|
161576
161763
|
* @param showMetricOrUnitSystem - Pass in `true` to show Metric formatted quantity values. Defaults to Imperial. To explicitly
|
|
@@ -161580,6 +161767,12 @@ class QuantityFormatter {
|
|
|
161580
161767
|
this._initializedPromise = new Promise((resolve) => {
|
|
161581
161768
|
this._resolveInitialized = resolve;
|
|
161582
161769
|
});
|
|
161770
|
+
this._reloadCoordinator = new _FormatsProviderReloadCoordinator__WEBPACK_IMPORTED_MODULE_5__.FormatsProviderReloadCoordinator({
|
|
161771
|
+
startReload: () => { this._isReady = false; },
|
|
161772
|
+
executeReload: async (intent) => this._executeReload(intent),
|
|
161773
|
+
finalizeReload: async () => this.finalizeReload(),
|
|
161774
|
+
handleReloadFailure: (error) => this._handleReloadFailure(error),
|
|
161775
|
+
}, this._disposedError);
|
|
161583
161776
|
if (undefined !== showMetricOrUnitSystem) {
|
|
161584
161777
|
if (typeof showMetricOrUnitSystem === "boolean")
|
|
161585
161778
|
this._activeUnitSystem = showMetricOrUnitSystem ? "metric" : "imperial";
|
|
@@ -161588,70 +161781,44 @@ class QuantityFormatter {
|
|
|
161588
161781
|
}
|
|
161589
161782
|
}
|
|
161590
161783
|
[Symbol.dispose]() {
|
|
161784
|
+
if (this._isDisposed)
|
|
161785
|
+
return;
|
|
161786
|
+
this._isDisposed = true;
|
|
161787
|
+
this._isReady = false;
|
|
161788
|
+
this._emitSystemChangedOnReady = false;
|
|
161789
|
+
this._reloadCoordinator.dispose();
|
|
161591
161790
|
if (this._removeFormatsProviderListener) {
|
|
161592
161791
|
this._removeFormatsProviderListener();
|
|
161593
161792
|
this._removeFormatsProviderListener = undefined;
|
|
161594
161793
|
}
|
|
161595
161794
|
}
|
|
161795
|
+
/** Runs an action that schedules a reload and waits for the reload queue to drain.
|
|
161796
|
+
* The most recent call wins. If another call is made before this reload queue drains, this call is rejected.
|
|
161797
|
+
* @internal
|
|
161798
|
+
*/
|
|
161799
|
+
async runAndWaitForReload(action) {
|
|
161800
|
+
return this._reloadCoordinator.runAndWaitForReload(action);
|
|
161801
|
+
}
|
|
161596
161802
|
/** Schedule an async reload. If no reload is in flight, runs immediately. If a reload is
|
|
161597
|
-
* already in flight, stores the intent as pending
|
|
161598
|
-
*
|
|
161803
|
+
* already in flight, stores the intent as pending. Pending format changes are merged and run before
|
|
161804
|
+
* the latest other pending intent. `finalizeReload()` fires only when the queue is fully drained.
|
|
161599
161805
|
*
|
|
161600
161806
|
* **Await semantics:** When a reload is already in flight, the returned promise resolves
|
|
161601
161807
|
* immediately *without* the requested reload having run. Callers that need to know when
|
|
161602
|
-
*
|
|
161808
|
+
* an explicitly triggered reload has actually completed should use [[runAndWaitForReload]].
|
|
161603
161809
|
*
|
|
161604
|
-
* Reload intents:
|
|
161605
|
-
* - `"full"` — rebuild entire registry + re-register provider listener (onInitialized, setUnitsProvider)
|
|
161606
|
-
* - `"formatsChanged"` — patch registry from provider + load maps (formatsChanged listener)
|
|
161607
|
-
* - `"activeSystem"` — reload format/parsing maps for current unit system (setActiveUnitSystem, reinitializeFormatAndParsingsMaps)
|
|
161608
161810
|
* @internal
|
|
161609
161811
|
*/
|
|
161610
161812
|
async scheduleReload(intent) {
|
|
161611
|
-
|
|
161612
|
-
|
|
161613
|
-
|
|
161614
|
-
|
|
161615
|
-
|
|
161616
|
-
this.
|
|
161617
|
-
|
|
161618
|
-
|
|
161619
|
-
try {
|
|
161620
|
-
await this._executeReload(intent);
|
|
161621
|
-
}
|
|
161622
|
-
catch (err) {
|
|
161623
|
-
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.Package}.QuantityFormatter`, _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err));
|
|
161624
|
-
this._reloadInFlight = false;
|
|
161625
|
-
// If there's a pending reload, still try to run it
|
|
161626
|
-
if (this._pendingReload) {
|
|
161627
|
-
const next = this._pendingReload;
|
|
161628
|
-
this._pendingReload = undefined;
|
|
161629
|
-
return this.scheduleReload(next);
|
|
161630
|
-
}
|
|
161631
|
-
// Restore prior ready state so stale-but-usable specs remain accessible
|
|
161632
|
-
if (this._hasEverBeenReady) {
|
|
161633
|
-
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.Package}.QuantityFormatter`, "Reload failed — restoring previous ready state. Cached specs may be stale.");
|
|
161634
|
-
this._isReady = true;
|
|
161635
|
-
}
|
|
161636
|
-
return;
|
|
161637
|
-
}
|
|
161638
|
-
// Current reload succeeded — check if another was queued
|
|
161639
|
-
if (this._pendingReload) {
|
|
161640
|
-
const next = this._pendingReload;
|
|
161641
|
-
this._pendingReload = undefined;
|
|
161642
|
-
this._reloadInFlight = false;
|
|
161643
|
-
return this.scheduleReload(next);
|
|
161644
|
-
}
|
|
161645
|
-
// Queue is drained — finalize
|
|
161646
|
-
await this.finalizeReload();
|
|
161647
|
-
// A new reload may have been queued during the async finalizeReload window
|
|
161648
|
-
if (this._pendingReload) {
|
|
161649
|
-
const next = this._pendingReload;
|
|
161650
|
-
this._pendingReload = undefined;
|
|
161651
|
-
this._reloadInFlight = false;
|
|
161652
|
-
return this.scheduleReload(next);
|
|
161813
|
+
return this._reloadCoordinator.scheduleReload(intent);
|
|
161814
|
+
}
|
|
161815
|
+
_handleReloadFailure(error) {
|
|
161816
|
+
if (!this._isDisposed)
|
|
161817
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.Package}.QuantityFormatter`, _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(error));
|
|
161818
|
+
if (this._hasEverBeenReady && !this._isDisposed) {
|
|
161819
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.FrontendLoggerCategory.Package}.QuantityFormatter`, "Reload failed — restoring previous ready state. Cached specs may be stale.");
|
|
161820
|
+
this._isReady = true;
|
|
161653
161821
|
}
|
|
161654
|
-
this._reloadInFlight = false;
|
|
161655
161822
|
}
|
|
161656
161823
|
/** Execute the reload work for a given intent. All reload logic is centralized here.
|
|
161657
161824
|
* @internal
|
|
@@ -161660,47 +161827,51 @@ class QuantityFormatter {
|
|
|
161660
161827
|
switch (intent.scope) {
|
|
161661
161828
|
case "full":
|
|
161662
161829
|
await this._reloadCore();
|
|
161830
|
+
return;
|
|
161831
|
+
case "formatsChanged":
|
|
161832
|
+
await this._rebuildRegistryFromProvider(intent.args);
|
|
161663
161833
|
break;
|
|
161664
|
-
case "formatsChanged": {
|
|
161665
|
-
const { args } = intent;
|
|
161666
|
-
await this._rebuildRegistryFromProvider(args);
|
|
161667
|
-
if (args.impliedUnitSystem && args.impliedUnitSystem !== this._activeUnitSystem) {
|
|
161668
|
-
this._activeUnitSystem = args.impliedUnitSystem;
|
|
161669
|
-
}
|
|
161670
|
-
await this.loadFormatAndParsingMapsForSystem(this._activeUnitSystem);
|
|
161671
|
-
if (args.impliedUnitSystem) {
|
|
161672
|
-
this._deferredSystemChangedEmit = { system: this._activeUnitSystem };
|
|
161673
|
-
}
|
|
161674
|
-
break;
|
|
161675
|
-
}
|
|
161676
|
-
case "activeSystem":
|
|
161677
|
-
await this.loadFormatAndParsingMapsForSystem(this._activeUnitSystem);
|
|
161678
|
-
if (intent.emitSystemChanged) {
|
|
161679
|
-
this._deferredSystemChangedEmit = { system: this._activeUnitSystem };
|
|
161680
|
-
}
|
|
161681
|
-
break;
|
|
161682
161834
|
}
|
|
161835
|
+
// Build the active specs in temporary maps so readers keep using complete specs until the new ones are ready.
|
|
161836
|
+
const nextFormatSpecs = new Map();
|
|
161837
|
+
const nextParserSpecs = new Map();
|
|
161838
|
+
this._activeFormatSpecsTarget = nextFormatSpecs;
|
|
161839
|
+
this._activeParserSpecsTarget = nextParserSpecs;
|
|
161840
|
+
try {
|
|
161841
|
+
await this.loadFormatAndParsingMapsForSystem(this._activeUnitSystem);
|
|
161842
|
+
}
|
|
161843
|
+
finally {
|
|
161844
|
+
this._activeFormatSpecsTarget = undefined;
|
|
161845
|
+
this._activeParserSpecsTarget = undefined;
|
|
161846
|
+
}
|
|
161847
|
+
this._activeFormatSpecsByType = nextFormatSpecs;
|
|
161848
|
+
this._activeParserSpecsByType = nextParserSpecs;
|
|
161683
161849
|
}
|
|
161684
161850
|
/** Called when the reload queue is fully drained after a successful reload.
|
|
161685
161851
|
* Sets `isReady` to true, resolves `whenInitialized` (one-shot), and emits ready events.
|
|
161686
161852
|
* @internal
|
|
161687
161853
|
*/
|
|
161688
161854
|
async finalizeReload() {
|
|
161855
|
+
if (this._isDisposed)
|
|
161856
|
+
return;
|
|
161689
161857
|
// Phase 1: Let providers register async work
|
|
161690
161858
|
const collector = new _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.FormattingReadyCollector();
|
|
161691
161859
|
this.onBeforeFormattingReady.raiseEvent(collector);
|
|
161692
161860
|
await collector.awaitAll();
|
|
161861
|
+
if (this._isDisposed)
|
|
161862
|
+
return;
|
|
161693
161863
|
// Phase 2: Signal ready to consumers
|
|
161694
161864
|
this._isReady = true;
|
|
161695
161865
|
this._hasEverBeenReady = true;
|
|
161696
161866
|
this._resolveInitialized();
|
|
161697
161867
|
this.onFormattingReady.emit();
|
|
161698
|
-
|
|
161868
|
+
if (this._isDisposed)
|
|
161869
|
+
return;
|
|
161870
|
+
// Phase 3: Emit unit-system-changed if the unit system was changed since the last ready state, reporting the system that is now active.
|
|
161699
161871
|
// This fires after isReady === true so listeners can safely use the formatter.
|
|
161700
|
-
if (this.
|
|
161701
|
-
|
|
161702
|
-
this.
|
|
161703
|
-
this.onActiveFormattingUnitSystemChanged.emit(args);
|
|
161872
|
+
if (this._emitSystemChangedOnReady) {
|
|
161873
|
+
this._emitSystemChangedOnReady = false;
|
|
161874
|
+
this.onActiveFormattingUnitSystemChanged.emit({ system: this._activeUnitSystem });
|
|
161704
161875
|
}
|
|
161705
161876
|
}
|
|
161706
161877
|
getOverrideFormatPropsByQuantityType(quantityTypeKey, unitSystem) {
|
|
@@ -161771,8 +161942,8 @@ class QuantityFormatter {
|
|
|
161771
161942
|
async loadFormatAndParserSpec(quantityTypeDefinition, formatProps) {
|
|
161772
161943
|
const formatterSpec = await quantityTypeDefinition.generateFormatterSpec(formatProps, this.unitsProvider);
|
|
161773
161944
|
const parserSpec = await quantityTypeDefinition.generateParserSpec(formatProps, this.unitsProvider, this.alternateUnitLabelsProvider);
|
|
161774
|
-
this._activeFormatSpecsByType.set(quantityTypeDefinition.key, formatterSpec);
|
|
161775
|
-
this._activeParserSpecsByType.set(quantityTypeDefinition.key, parserSpec);
|
|
161945
|
+
(this._activeFormatSpecsTarget ?? this._activeFormatSpecsByType).set(quantityTypeDefinition.key, formatterSpec);
|
|
161946
|
+
(this._activeParserSpecsTarget ?? this._activeParserSpecsByType).set(quantityTypeDefinition.key, parserSpec);
|
|
161776
161947
|
}
|
|
161777
161948
|
// repopulate formatSpec and parserSpec entries using only default format
|
|
161778
161949
|
async loadDefaultFormatAndParserSpecForQuantity(typeKey) {
|
|
@@ -161829,17 +162000,20 @@ class QuantityFormatter {
|
|
|
161829
162000
|
* @internal
|
|
161830
162001
|
*/
|
|
161831
162002
|
async onInitialized() {
|
|
162003
|
+
// Register once, before the first reload, so provider changes made while a units-provider reload is running are not missed.
|
|
162004
|
+
this._removeFormatsProviderListener ??= _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.onFormatsChanged.addListener((args) => {
|
|
162005
|
+
if (args.impliedUnitSystem && args.impliedUnitSystem !== this._activeUnitSystem) {
|
|
162006
|
+
this._activeUnitSystem = args.impliedUnitSystem;
|
|
162007
|
+
this._emitSystemChangedOnReady = true;
|
|
162008
|
+
}
|
|
162009
|
+
void this.scheduleReload({ scope: "formatsChanged", args });
|
|
162010
|
+
});
|
|
161832
162011
|
await this.scheduleReload({ scope: "full" });
|
|
161833
162012
|
}
|
|
161834
162013
|
/** Core reload logic — does all async I/O and cache rebuilding without events or state management.
|
|
161835
162014
|
* @internal
|
|
161836
162015
|
*/
|
|
161837
162016
|
async _reloadCore() {
|
|
161838
|
-
// Remove any existing listener before re-registering to avoid duplicates when called via setUnitsProvider.
|
|
161839
|
-
if (this._removeFormatsProviderListener) {
|
|
161840
|
-
this._removeFormatsProviderListener();
|
|
161841
|
-
this._removeFormatsProviderListener = undefined;
|
|
161842
|
-
}
|
|
161843
162017
|
await this.initializeQuantityTypesRegistry();
|
|
161844
162018
|
const initialKoQs = [["DefaultToolsUnits.LENGTH", "Units.M"], ["DefaultToolsUnits.ANGLE", "Units.RAD"], ["DefaultToolsUnits.AREA", "Units.SQ_M"], ["DefaultToolsUnits.VOLUME", "Units.CUB_M"], ["DefaultToolsUnits.LENGTH_COORDINATE", "Units.M"], ["CivilUnits.STATION", "Units.M"], ["CivilUnits.LENGTH", "Units.M"], ["AecUnits.LENGTH", "Units.M"]];
|
|
161845
162019
|
for (const entry of initialKoQs) {
|
|
@@ -161852,10 +162026,6 @@ class QuantityFormatter {
|
|
|
161852
162026
|
}
|
|
161853
162027
|
}
|
|
161854
162028
|
}
|
|
161855
|
-
// Register formatsProvider listener that triggers a queued reload when formats change
|
|
161856
|
-
this._removeFormatsProviderListener = _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.formatsProvider.onFormatsChanged.addListener((args) => {
|
|
161857
|
-
void this.scheduleReload({ scope: "formatsChanged", args });
|
|
161858
|
-
});
|
|
161859
162029
|
// initialize default format and parsing specs
|
|
161860
162030
|
await this.loadFormatAndParsingMapsForSystem();
|
|
161861
162031
|
}
|
|
@@ -161949,6 +162119,9 @@ class QuantityFormatter {
|
|
|
161949
162119
|
await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.quantityFormatter.resetToUseInternalUnitsProvider();
|
|
161950
162120
|
return;
|
|
161951
162121
|
}
|
|
162122
|
+
// Disposal can occur while the reload is awaited, so do not notify afterward.
|
|
162123
|
+
if (this._isDisposed)
|
|
162124
|
+
return;
|
|
161952
162125
|
this.onUnitsProviderChanged.emit();
|
|
161953
162126
|
}
|
|
161954
162127
|
/**
|
|
@@ -161988,7 +162161,11 @@ class QuantityFormatter {
|
|
|
161988
162161
|
this._overrideFormatPropsByUnitSystem = overrideFormatPropsByUnitSystem;
|
|
161989
162162
|
}
|
|
161990
162163
|
unitSystemKey && (this._activeUnitSystem = unitSystemKey);
|
|
161991
|
-
|
|
162164
|
+
if (fireUnitSystemChanged)
|
|
162165
|
+
this._emitSystemChangedOnReady = true;
|
|
162166
|
+
await this.scheduleReload({ scope: "activeSystem" });
|
|
162167
|
+
if (this._isDisposed)
|
|
162168
|
+
return;
|
|
161992
162169
|
_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin && startDefaultTool && await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin.startDefaultTool();
|
|
161993
162170
|
}
|
|
161994
162171
|
/** Set the Active unit system to one of the supported types. This will asynchronously load the formatter and parser specs for the activated system. */
|
|
@@ -162001,7 +162178,10 @@ class QuantityFormatter {
|
|
|
162001
162178
|
if (this._activeUnitSystem === systemType)
|
|
162002
162179
|
return;
|
|
162003
162180
|
this._activeUnitSystem = systemType;
|
|
162004
|
-
|
|
162181
|
+
this._emitSystemChangedOnReady = true;
|
|
162182
|
+
await this.scheduleReload({ scope: "activeSystem" });
|
|
162183
|
+
if (this._isDisposed)
|
|
162184
|
+
return;
|
|
162005
162185
|
// allow settings provider to store the change
|
|
162006
162186
|
await this._unitFormattingSettingsProvider?.storeUnitSystemSetting({ system: systemType });
|
|
162007
162187
|
if (_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin && restartActiveTool)
|
|
@@ -206988,6 +207168,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
206988
207168
|
/* harmony export */ EllipsoidPatch: () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.EllipsoidPatch),
|
|
206989
207169
|
/* harmony export */ EllipticalArcApproximationOptions: () => (/* reexport safe */ _curve_Arc3d__WEBPACK_IMPORTED_MODULE_60__.EllipticalArcApproximationOptions),
|
|
206990
207170
|
/* harmony export */ EllipticalArcSampleMethod: () => (/* reexport safe */ _curve_Arc3d__WEBPACK_IMPORTED_MODULE_60__.EllipticalArcSampleMethod),
|
|
207171
|
+
/* harmony export */ ExteriorFractionSelector: () => (/* reexport safe */ _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.ExteriorFractionSelector),
|
|
206991
207172
|
/* harmony export */ FacetFaceData: () => (/* reexport safe */ _polyface_FacetFaceData__WEBPACK_IMPORTED_MODULE_113__.FacetFaceData),
|
|
206992
207173
|
/* harmony export */ FacetIntersectOptions: () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_115__.FacetIntersectOptions),
|
|
206993
207174
|
/* harmony export */ FacetLocationDetailPair: () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_115__.FacetLocationDetailPair),
|
|
@@ -211269,6 +211450,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
211269
211450
|
/* harmony export */ CurveExtendOptions: () => (/* binding */ CurveExtendOptions)
|
|
211270
211451
|
/* harmony export */ });
|
|
211271
211452
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
211453
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
211272
211454
|
/*---------------------------------------------------------------------------------------------
|
|
211273
211455
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
211274
211456
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -211277,6 +211459,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
211277
211459
|
* @module Curve
|
|
211278
211460
|
*/
|
|
211279
211461
|
|
|
211462
|
+
|
|
211280
211463
|
/**
|
|
211281
211464
|
* Enumeration of condition for extending a curve beyond start or end point.
|
|
211282
211465
|
* * Not all CurvePrimitives support these modes.
|
|
@@ -211344,27 +211527,21 @@ class CurveExtendOptions {
|
|
|
211344
211527
|
* the sweep extended per `extendParam`.
|
|
211345
211528
|
*/
|
|
211346
211529
|
static resolveRadiansToValidSweepFraction(extendParam, radians, sweep) {
|
|
211347
|
-
|
|
211348
|
-
let fraction = sweep.radiansToSignedPeriodicFraction(radians);
|
|
211530
|
+
let fraction = sweep.radiansToSignedPeriodicFraction(radians, 0, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.ExteriorFractionSelector.Closer);
|
|
211349
211531
|
let isValid = true;
|
|
211350
|
-
if (!
|
|
211351
|
-
const fractionPeriod = sweep.fractionPeriod();
|
|
211532
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isIn01(fraction)) {
|
|
211352
211533
|
const mode0 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 0);
|
|
211353
211534
|
const mode1 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);
|
|
211354
|
-
if (mode0
|
|
211355
|
-
if (mode1 === CurveExtendMode.None) { // only extend to negative
|
|
211356
|
-
if (fraction > 1.0)
|
|
211357
|
-
fraction -= fractionPeriod;
|
|
211358
|
-
}
|
|
211359
|
-
}
|
|
211360
|
-
else if (mode1 !== CurveExtendMode.None) { // only extend to positive
|
|
211361
|
-
if (fraction < 0.0)
|
|
211362
|
-
fraction += fractionPeriod;
|
|
211363
|
-
}
|
|
211364
|
-
else { // no extension allowed
|
|
211535
|
+
if (mode0 === CurveExtendMode.None && mode1 === CurveExtendMode.None) {
|
|
211365
211536
|
fraction = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(fraction, 0, 1);
|
|
211366
211537
|
isValid = false;
|
|
211367
211538
|
}
|
|
211539
|
+
else if (mode1 === CurveExtendMode.None && mode0 !== CurveExtendMode.None) {
|
|
211540
|
+
fraction = sweep.radiansToSignedPeriodicFraction(radians, 0, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.ExteriorFractionSelector.Negative);
|
|
211541
|
+
}
|
|
211542
|
+
else if (mode0 === CurveExtendMode.None && mode1 !== CurveExtendMode.None) {
|
|
211543
|
+
fraction = sweep.radiansToSignedPeriodicFraction(radians, 0, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.ExteriorFractionSelector.Positive);
|
|
211544
|
+
}
|
|
211368
211545
|
}
|
|
211369
211546
|
return { fraction, isValid };
|
|
211370
211547
|
}
|
|
@@ -212720,7 +212897,22 @@ class CurveLocationDetail {
|
|
|
212720
212897
|
if (detailA) {
|
|
212721
212898
|
if (!detailB)
|
|
212722
212899
|
return detailA;
|
|
212723
|
-
|
|
212900
|
+
// tiebreakers (exact comparison!)
|
|
212901
|
+
if (detailA.a === detailB.a) {
|
|
212902
|
+
// prefer interior to exterior
|
|
212903
|
+
const isInteriorA = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(detailA.fraction);
|
|
212904
|
+
const isInteriorB = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(detailB.fraction);
|
|
212905
|
+
if (isInteriorA && !isInteriorB)
|
|
212906
|
+
return detailA;
|
|
212907
|
+
if (!isInteriorA && isInteriorB)
|
|
212908
|
+
return detailB;
|
|
212909
|
+
if (!isInteriorA && !isInteriorB) { // prefer exterior closer to [0,1]
|
|
212910
|
+
const distFrom01A = detailA.fraction < 0 ? -detailA.fraction : detailA.fraction - 1;
|
|
212911
|
+
const distFrom01B = detailB.fraction < 0 ? -detailB.fraction : detailB.fraction - 1;
|
|
212912
|
+
return (distFrom01A <= distFrom01B) ? detailA : detailB;
|
|
212913
|
+
}
|
|
212914
|
+
}
|
|
212915
|
+
return detailA.a < detailB.a ? detailA : detailB;
|
|
212724
212916
|
}
|
|
212725
212917
|
return detailB;
|
|
212726
212918
|
}
|
|
@@ -233811,7 +234003,8 @@ class Angle {
|
|
|
233811
234003
|
"use strict";
|
|
233812
234004
|
__webpack_require__.r(__webpack_exports__);
|
|
233813
234005
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
233814
|
-
/* harmony export */ AngleSweep: () => (/* binding */ AngleSweep)
|
|
234006
|
+
/* harmony export */ AngleSweep: () => (/* binding */ AngleSweep),
|
|
234007
|
+
/* harmony export */ ExteriorFractionSelector: () => (/* binding */ ExteriorFractionSelector)
|
|
233815
234008
|
/* harmony export */ });
|
|
233816
234009
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
233817
234010
|
/* harmony import */ var _Angle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
@@ -233824,6 +234017,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
233824
234017
|
*/
|
|
233825
234018
|
|
|
233826
234019
|
|
|
234020
|
+
/**
|
|
234021
|
+
* Selector for how to convert an angle outside of a sweep to an exterior fraction.
|
|
234022
|
+
* @see [[AngleSweep.radiansToSignedPeriodicFractionStartEnd]], [[AngleSweep.angleToSignedPeriodicFraction]], [[AngleSweep.radiansToSignedPeriodicFraction]]
|
|
234023
|
+
* @public
|
|
234024
|
+
*/
|
|
234025
|
+
var ExteriorFractionSelector;
|
|
234026
|
+
(function (ExteriorFractionSelector) {
|
|
234027
|
+
/** Request [[Positive]] or [[Negative]] based on input sign. */
|
|
234028
|
+
ExteriorFractionSelector[ExteriorFractionSelector["SameSign"] = -1] = "SameSign";
|
|
234029
|
+
/** Request positive exterior fraction within one period of 1. */
|
|
234030
|
+
ExteriorFractionSelector[ExteriorFractionSelector["Positive"] = 0] = "Positive";
|
|
234031
|
+
/** Request negative exterior fraction within one period of 0. */
|
|
234032
|
+
ExteriorFractionSelector[ExteriorFractionSelector["Negative"] = 1] = "Negative";
|
|
234033
|
+
/** Request the period-shifted exterior fraction closest to [0,1]. */
|
|
234034
|
+
ExteriorFractionSelector[ExteriorFractionSelector["Closer"] = 2] = "Closer";
|
|
234035
|
+
})(ExteriorFractionSelector || (ExteriorFractionSelector = {}));
|
|
233827
234036
|
/**
|
|
233828
234037
|
* An `AngleSweep` is a pair of angles at start and end of an interval.
|
|
233829
234038
|
*
|
|
@@ -234208,9 +234417,12 @@ class AngleSweep {
|
|
|
234208
234417
|
* @param radians0 start angle of sweep (in radians)
|
|
234209
234418
|
* @param radians1 end angle of sweep (in radians)
|
|
234210
234419
|
* @param zeroSweepDefault return value when the sweep is empty (default 0)
|
|
234420
|
+
* @param selector how to handle an angle outside of the sweep. Default value is
|
|
234421
|
+
* [[ExteriorFractionSelector.SameSign]], to request a fraction with the same sign
|
|
234422
|
+
* as the unbounded fraction `(radians - radians0) / (radians1 - radians0)`.
|
|
234211
234423
|
* @returns fraction, or `zeroSweepDefault` if the sweep is empty.
|
|
234212
234424
|
*/
|
|
234213
|
-
static radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepDefault = 0.0) {
|
|
234425
|
+
static radiansToSignedPeriodicFractionStartEnd(radians, radians0, radians1, zeroSweepDefault = 0.0, selector = ExteriorFractionSelector.SameSign) {
|
|
234214
234426
|
const sweep = radians1 - radians0;
|
|
234215
234427
|
if (_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.isAlmostEqualRadiansNoPeriodShift(0, sweep))
|
|
234216
234428
|
return zeroSweepDefault;
|
|
@@ -234228,7 +234440,14 @@ class AngleSweep {
|
|
|
234228
234440
|
return 1.0;
|
|
234229
234441
|
}
|
|
234230
234442
|
const fraction = (radians - radians0) / sweep;
|
|
234231
|
-
|
|
234443
|
+
let toNegativeFraction;
|
|
234444
|
+
if (selector === ExteriorFractionSelector.Negative)
|
|
234445
|
+
toNegativeFraction = true;
|
|
234446
|
+
else if (selector === ExteriorFractionSelector.Positive)
|
|
234447
|
+
toNegativeFraction = false;
|
|
234448
|
+
else if (selector === ExteriorFractionSelector.SameSign)
|
|
234449
|
+
toNegativeFraction = fraction < 0;
|
|
234450
|
+
return this.fractionToSignedPeriodicFractionStartEnd(fraction, radians0, radians1, toNegativeFraction);
|
|
234232
234451
|
}
|
|
234233
234452
|
/**
|
|
234234
234453
|
* Return the fractionalized position of the given angle (as radians) computed with consideration of
|
|
@@ -234241,10 +234460,13 @@ class AngleSweep {
|
|
|
234241
234460
|
* * allows period shift
|
|
234242
234461
|
* @param radians input angle (in radians)
|
|
234243
234462
|
* @param zeroSweepDefault return value when this sweep is empty (default 0)
|
|
234463
|
+
* @param selector how to handle an angle outside of the sweep. Default value is
|
|
234464
|
+
* [[ExteriorFractionSelector.SameSign]], to request a fraction with the same sign
|
|
234465
|
+
* as the unbounded fraction `(radians - startRadians) / sweepRadians`.
|
|
234244
234466
|
* @returns fraction, or `zeroSweepDefault` if this sweep is empty.
|
|
234245
234467
|
*/
|
|
234246
|
-
radiansToSignedPeriodicFraction(radians, zeroSweepDefault = 0.0) {
|
|
234247
|
-
return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault);
|
|
234468
|
+
radiansToSignedPeriodicFraction(radians, zeroSweepDefault = 0.0, selector = ExteriorFractionSelector.SameSign) {
|
|
234469
|
+
return AngleSweep.radiansToSignedPeriodicFractionStartEnd(radians, this._radians0, this._radians1, zeroSweepDefault, selector);
|
|
234248
234470
|
}
|
|
234249
234471
|
/**
|
|
234250
234472
|
* Return the fractionalized position of the given angle (as Angle) computed with consideration of
|
|
@@ -234257,10 +234479,13 @@ class AngleSweep {
|
|
|
234257
234479
|
* * allows period shift
|
|
234258
234480
|
* @param theta input angle
|
|
234259
234481
|
* @param zeroSweepDefault return value when this sweep is empty (default 0)
|
|
234482
|
+
* @param selector how to handle an angle outside of the sweep. Default value is
|
|
234483
|
+
* [[ExteriorFractionSelector.SameSign]], to request a fraction with the same sign
|
|
234484
|
+
* as the fraction returned by `angleToUnboundedFraction(theta)`.
|
|
234260
234485
|
* @returns fraction, or `zeroSweepDefault` if this sweep is empty.
|
|
234261
234486
|
*/
|
|
234262
|
-
angleToSignedPeriodicFraction(theta, zeroSweepDefault = 0.0) {
|
|
234263
|
-
return this.radiansToSignedPeriodicFraction(theta.radians, zeroSweepDefault);
|
|
234487
|
+
angleToSignedPeriodicFraction(theta, zeroSweepDefault = 0.0, selector = ExteriorFractionSelector.SameSign) {
|
|
234488
|
+
return this.radiansToSignedPeriodicFraction(theta.radians, zeroSweepDefault, selector);
|
|
234264
234489
|
}
|
|
234265
234490
|
/**
|
|
234266
234491
|
* Return the fractionalized position of the given radian angle with respect to the sweep.
|
|
@@ -337329,7 +337554,7 @@ class WMS {
|
|
|
337329
337554
|
(module) {
|
|
337330
337555
|
|
|
337331
337556
|
"use strict";
|
|
337332
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.
|
|
337557
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.4","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 build:workers && npm run -s copy:draco","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:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./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 && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","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","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 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":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.11","@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/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10"},"//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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
|
|
337333
337558
|
|
|
337334
337559
|
/***/ },
|
|
337335
337560
|
|