@itwin/rpcinterface-full-stack-tests 5.0.0-dev.104 → 5.0.0-dev.106
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 +758 -238
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +13 -13
|
@@ -99043,6 +99043,168 @@ function propertyTypeToString(type) {
|
|
|
99043
99043
|
}
|
|
99044
99044
|
|
|
99045
99045
|
|
|
99046
|
+
/***/ }),
|
|
99047
|
+
|
|
99048
|
+
/***/ "../../core/ecschema-metadata/lib/esm/SchemaFormatsProvider.js":
|
|
99049
|
+
/*!*********************************************************************!*\
|
|
99050
|
+
!*** ../../core/ecschema-metadata/lib/esm/SchemaFormatsProvider.js ***!
|
|
99051
|
+
\*********************************************************************/
|
|
99052
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
99053
|
+
|
|
99054
|
+
"use strict";
|
|
99055
|
+
__webpack_require__.r(__webpack_exports__);
|
|
99056
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
99057
|
+
/* harmony export */ SchemaFormatsProvider: () => (/* binding */ SchemaFormatsProvider)
|
|
99058
|
+
/* harmony export */ });
|
|
99059
|
+
/* harmony import */ var _Context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Context */ "../../core/ecschema-metadata/lib/esm/Context.js");
|
|
99060
|
+
/* harmony import */ var _SchemaKey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SchemaKey */ "../../core/ecschema-metadata/lib/esm/SchemaKey.js");
|
|
99061
|
+
/* harmony import */ var _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Metadata/SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
|
|
99062
|
+
/* harmony import */ var _Metadata_Format__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Metadata/Format */ "../../core/ecschema-metadata/lib/esm/Metadata/Format.js");
|
|
99063
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
99064
|
+
/* harmony import */ var _Metadata_KindOfQuantity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Metadata/KindOfQuantity */ "../../core/ecschema-metadata/lib/esm/Metadata/KindOfQuantity.js");
|
|
99065
|
+
/* harmony import */ var _Metadata_OverrideFormat__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Metadata/OverrideFormat */ "../../core/ecschema-metadata/lib/esm/Metadata/OverrideFormat.js");
|
|
99066
|
+
/*---------------------------------------------------------------------------------------------
|
|
99067
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
99068
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
99069
|
+
*--------------------------------------------------------------------------------------------*/
|
|
99070
|
+
/** @packageDocumentation
|
|
99071
|
+
* @module Metadata
|
|
99072
|
+
*/
|
|
99073
|
+
|
|
99074
|
+
|
|
99075
|
+
|
|
99076
|
+
|
|
99077
|
+
|
|
99078
|
+
|
|
99079
|
+
|
|
99080
|
+
/**
|
|
99081
|
+
* Provides default formats and kind of quantities from a given SchemaContext or SchemaLocater.
|
|
99082
|
+
* @beta
|
|
99083
|
+
*/
|
|
99084
|
+
class SchemaFormatsProvider {
|
|
99085
|
+
_context;
|
|
99086
|
+
_unitSystem;
|
|
99087
|
+
_formatsRetrieved = new Set();
|
|
99088
|
+
onFormatsChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_4__.BeEvent();
|
|
99089
|
+
/**
|
|
99090
|
+
*
|
|
99091
|
+
* @param contextOrLocater The SchemaContext or a different ISchemaLocater implementation used to retrieve the schema. The SchemaContext
|
|
99092
|
+
* class implements the ISchemaLocater interface. If the provided locater is not a SchemaContext instance a new SchemaContext will be
|
|
99093
|
+
* created and the locater will be added.
|
|
99094
|
+
* @param unitSystem Used to lookup a default format through a schema specific algorithm, when the format retrieved is associated with a KindOfQuantity.
|
|
99095
|
+
*/
|
|
99096
|
+
constructor(contextOrLocater, unitSystem) {
|
|
99097
|
+
if (contextOrLocater instanceof _Context__WEBPACK_IMPORTED_MODULE_0__.SchemaContext) {
|
|
99098
|
+
this._context = contextOrLocater;
|
|
99099
|
+
}
|
|
99100
|
+
else {
|
|
99101
|
+
this._context = new _Context__WEBPACK_IMPORTED_MODULE_0__.SchemaContext();
|
|
99102
|
+
this._context.addLocater(contextOrLocater);
|
|
99103
|
+
}
|
|
99104
|
+
this._unitSystem = unitSystem;
|
|
99105
|
+
}
|
|
99106
|
+
get context() { return this._context; }
|
|
99107
|
+
get unitSystem() { return this._unitSystem; }
|
|
99108
|
+
set unitSystem(unitSystem) {
|
|
99109
|
+
this._unitSystem = unitSystem;
|
|
99110
|
+
this.clear();
|
|
99111
|
+
}
|
|
99112
|
+
clear() {
|
|
99113
|
+
const formatsChanged = Array.from(this._formatsRetrieved);
|
|
99114
|
+
this._formatsRetrieved.clear();
|
|
99115
|
+
this.onFormatsChanged.raiseEvent({ formatsChanged });
|
|
99116
|
+
}
|
|
99117
|
+
async getKindOfQuantityFormatFromSchema(itemKey) {
|
|
99118
|
+
const kindOfQuantity = await this._context.getSchemaItem(itemKey, _Metadata_KindOfQuantity__WEBPACK_IMPORTED_MODULE_5__.KindOfQuantity);
|
|
99119
|
+
if (!kindOfQuantity) {
|
|
99120
|
+
return undefined;
|
|
99121
|
+
}
|
|
99122
|
+
// Find the first presentation format that matches the provided unit system.
|
|
99123
|
+
const unitSystemGroupNames = getUnitSystemGroupNames(this._unitSystem);
|
|
99124
|
+
const presentationFormats = kindOfQuantity.presentationFormats;
|
|
99125
|
+
for (const system of unitSystemGroupNames) {
|
|
99126
|
+
for (const format of presentationFormats) {
|
|
99127
|
+
const unit = format.units && format.units[0][0];
|
|
99128
|
+
if (!unit) {
|
|
99129
|
+
continue;
|
|
99130
|
+
}
|
|
99131
|
+
const currentUnitSystem = await unit.unitSystem;
|
|
99132
|
+
if (currentUnitSystem && currentUnitSystem.name.toUpperCase() === system) {
|
|
99133
|
+
this._formatsRetrieved.add(itemKey.fullName);
|
|
99134
|
+
return (0,_Metadata_OverrideFormat__WEBPACK_IMPORTED_MODULE_6__.getFormatProps)(format);
|
|
99135
|
+
}
|
|
99136
|
+
}
|
|
99137
|
+
}
|
|
99138
|
+
// If no matching presentation format was found, use persistence unit format if it matches unit system.
|
|
99139
|
+
const persistenceUnit = await kindOfQuantity.persistenceUnit;
|
|
99140
|
+
const persistenceUnitSystem = await persistenceUnit?.unitSystem;
|
|
99141
|
+
if (persistenceUnitSystem && unitSystemGroupNames.includes(persistenceUnitSystem.name.toUpperCase())) {
|
|
99142
|
+
this._formatsRetrieved.add(itemKey.fullName);
|
|
99143
|
+
return getPersistenceUnitFormatProps(persistenceUnit);
|
|
99144
|
+
}
|
|
99145
|
+
const defaultFormat = kindOfQuantity.defaultPresentationFormat;
|
|
99146
|
+
if (!defaultFormat) {
|
|
99147
|
+
return undefined;
|
|
99148
|
+
}
|
|
99149
|
+
this._formatsRetrieved.add(itemKey.fullName);
|
|
99150
|
+
return (0,_Metadata_OverrideFormat__WEBPACK_IMPORTED_MODULE_6__.getFormatProps)(defaultFormat);
|
|
99151
|
+
}
|
|
99152
|
+
/**
|
|
99153
|
+
* Retrieves a Format from a SchemaContext. If the format is part of a KindOfQuantity, the first presentation format in the KindOfQuantity that matches the current unit system will be retrieved.
|
|
99154
|
+
* If no presentation format matches the current unit system, the persistence unit format will be retrieved if it matches the current unit system.
|
|
99155
|
+
* Else, the default presentation format will be retrieved.
|
|
99156
|
+
* @param name The full name of the Format or KindOfQuantity.
|
|
99157
|
+
* @returns
|
|
99158
|
+
*/
|
|
99159
|
+
async getFormat(name) {
|
|
99160
|
+
const [schemaName, schemaItemName] = _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_2__.SchemaItem.parseFullName(name);
|
|
99161
|
+
const schemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaKey(schemaName);
|
|
99162
|
+
const schema = await this._context.getSchema(schemaKey);
|
|
99163
|
+
if (!schema) {
|
|
99164
|
+
return undefined;
|
|
99165
|
+
}
|
|
99166
|
+
const itemKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaItemKey(schemaItemName, schema.schemaKey);
|
|
99167
|
+
if (schema.name === "Formats") {
|
|
99168
|
+
const format = await this._context.getSchemaItem(itemKey, _Metadata_Format__WEBPACK_IMPORTED_MODULE_3__.Format);
|
|
99169
|
+
if (!format) {
|
|
99170
|
+
return undefined;
|
|
99171
|
+
}
|
|
99172
|
+
return format.toJSON(true);
|
|
99173
|
+
}
|
|
99174
|
+
return this.getKindOfQuantityFormatFromSchema(itemKey);
|
|
99175
|
+
}
|
|
99176
|
+
}
|
|
99177
|
+
function getUnitSystemGroupNames(unitSystem) {
|
|
99178
|
+
switch (unitSystem) {
|
|
99179
|
+
case "imperial":
|
|
99180
|
+
return ["IMPERIAL", "USCUSTOM", "INTERNATIONAL", "FINANCE"];
|
|
99181
|
+
case "metric":
|
|
99182
|
+
return ["SI", "METRIC", "INTERNATIONAL", "FINANCE"];
|
|
99183
|
+
case "usCustomary":
|
|
99184
|
+
return ["USCUSTOM", "INTERNATIONAL", "FINANCE"];
|
|
99185
|
+
case "usSurvey":
|
|
99186
|
+
return ["USSURVEY", "USCUSTOM", "INTERNATIONAL", "FINANCE"];
|
|
99187
|
+
}
|
|
99188
|
+
return [];
|
|
99189
|
+
}
|
|
99190
|
+
function getPersistenceUnitFormatProps(persistenceUnit) {
|
|
99191
|
+
// Same as Format "DefaultRealU" in Formats ecschema
|
|
99192
|
+
return {
|
|
99193
|
+
formatTraits: ["keepSingleZero", "keepDecimalPoint", "showUnitLabel"],
|
|
99194
|
+
precision: 6,
|
|
99195
|
+
type: "Decimal",
|
|
99196
|
+
composite: {
|
|
99197
|
+
units: [
|
|
99198
|
+
{
|
|
99199
|
+
name: persistenceUnit.fullName,
|
|
99200
|
+
label: persistenceUnit.label,
|
|
99201
|
+
},
|
|
99202
|
+
],
|
|
99203
|
+
},
|
|
99204
|
+
};
|
|
99205
|
+
}
|
|
99206
|
+
|
|
99207
|
+
|
|
99046
99208
|
/***/ }),
|
|
99047
99209
|
|
|
99048
99210
|
/***/ "../../core/ecschema-metadata/lib/esm/SchemaJsonLocater.js":
|
|
@@ -100641,7 +100803,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
100641
100803
|
/* harmony export */ Schema: () => (/* reexport safe */ _Metadata_Schema__WEBPACK_IMPORTED_MODULE_25__.Schema),
|
|
100642
100804
|
/* harmony export */ SchemaCache: () => (/* reexport safe */ _Context__WEBPACK_IMPORTED_MODULE_1__.SchemaCache),
|
|
100643
100805
|
/* harmony export */ SchemaContext: () => (/* reexport safe */ _Context__WEBPACK_IMPORTED_MODULE_1__.SchemaContext),
|
|
100644
|
-
/* harmony export */
|
|
100806
|
+
/* harmony export */ SchemaFormatsProvider: () => (/* reexport safe */ _SchemaFormatsProvider__WEBPACK_IMPORTED_MODULE_38__.SchemaFormatsProvider),
|
|
100807
|
+
/* harmony export */ SchemaGraph: () => (/* reexport safe */ _utils_SchemaGraph__WEBPACK_IMPORTED_MODULE_39__.SchemaGraph),
|
|
100645
100808
|
/* harmony export */ SchemaGraphUtil: () => (/* reexport safe */ _Deserialization_SchemaGraphUtil__WEBPACK_IMPORTED_MODULE_3__.SchemaGraphUtil),
|
|
100646
100809
|
/* harmony export */ SchemaItem: () => (/* reexport safe */ _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_26__.SchemaItem),
|
|
100647
100810
|
/* harmony export */ SchemaItemKey: () => (/* reexport safe */ _SchemaKey__WEBPACK_IMPORTED_MODULE_31__.SchemaItemKey),
|
|
@@ -100721,7 +100884,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
100721
100884
|
/* harmony import */ var _UnitProvider_SchemaUnitProvider__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./UnitProvider/SchemaUnitProvider */ "../../core/ecschema-metadata/lib/esm/UnitProvider/SchemaUnitProvider.js");
|
|
100722
100885
|
/* harmony import */ var _Validation_SchemaWalker__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./Validation/SchemaWalker */ "../../core/ecschema-metadata/lib/esm/Validation/SchemaWalker.js");
|
|
100723
100886
|
/* harmony import */ var _SchemaPartVisitorDelegate__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./SchemaPartVisitorDelegate */ "../../core/ecschema-metadata/lib/esm/SchemaPartVisitorDelegate.js");
|
|
100724
|
-
/* harmony import */ var
|
|
100887
|
+
/* harmony import */ var _SchemaFormatsProvider__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./SchemaFormatsProvider */ "../../core/ecschema-metadata/lib/esm/SchemaFormatsProvider.js");
|
|
100888
|
+
/* harmony import */ var _utils_SchemaGraph__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./utils/SchemaGraph */ "../../core/ecschema-metadata/lib/esm/utils/SchemaGraph.js");
|
|
100725
100889
|
/*---------------------------------------------------------------------------------------------
|
|
100726
100890
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
100727
100891
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -100763,6 +100927,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
100763
100927
|
|
|
100764
100928
|
|
|
100765
100929
|
|
|
100930
|
+
|
|
100766
100931
|
|
|
100767
100932
|
|
|
100768
100933
|
/** @docs-package-description
|
|
@@ -104288,6 +104453,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
104288
104453
|
/* harmony import */ var _tools_Tool__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tools/Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
104289
104454
|
/* harmony import */ var _tools_ToolSettings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tools/ToolSettings */ "../../core/frontend/lib/esm/tools/ToolSettings.js");
|
|
104290
104455
|
/* harmony import */ var _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common/internal/Symbols */ "../../core/frontend/lib/esm/common/internal/Symbols.js");
|
|
104456
|
+
/* harmony import */ var _AccuDraw__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AccuDraw */ "../../core/frontend/lib/esm/AccuDraw.js");
|
|
104291
104457
|
/*---------------------------------------------------------------------------------------------
|
|
104292
104458
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
104293
104459
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -104304,6 +104470,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
104304
104470
|
|
|
104305
104471
|
|
|
104306
104472
|
|
|
104473
|
+
|
|
104307
104474
|
// cspell:ignore dont primitivetools
|
|
104308
104475
|
/** Virtual cursor for using AccuSnap with touch input.
|
|
104309
104476
|
* @internal
|
|
@@ -104842,6 +105009,56 @@ class AccuSnap {
|
|
|
104842
105009
|
intersect.primitive = tpSegment; // Just save single segment that was intersected for line strings/shapes...
|
|
104843
105010
|
return intersect;
|
|
104844
105011
|
}
|
|
105012
|
+
static doPostProcessSnapMode(snap, snapMode) {
|
|
105013
|
+
const accuDraw = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuDraw;
|
|
105014
|
+
if (!accuDraw.isEnabled || accuDraw.isDeactivated)
|
|
105015
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Disabled; // AccuDraw is require for this snap mode...
|
|
105016
|
+
if (_HitDetail__WEBPACK_IMPORTED_MODULE_3__.HitGeomType.Surface === snap.geomType)
|
|
105017
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible; // Only valid for edge and curve hits...
|
|
105018
|
+
const curve = snap.getCurvePrimitive();
|
|
105019
|
+
if (undefined === curve)
|
|
105020
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105021
|
+
const rMatrix = _AccuDraw__WEBPACK_IMPORTED_MODULE_9__.AccuDraw.getSnapRotation(snap, snap.viewport);
|
|
105022
|
+
if (undefined === rMatrix)
|
|
105023
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105024
|
+
// Compute snap from AccuDraw origin when active or set AccuDraw rotation if accepted...
|
|
105025
|
+
if (!accuDraw.isActive) {
|
|
105026
|
+
accuDraw.setContext(_AccuDraw__WEBPACK_IMPORTED_MODULE_9__.AccuDrawFlags.SmartRotation); // Automatically orient compass to snap location if accepted...
|
|
105027
|
+
snap.setSnapMode(snapMode);
|
|
105028
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success;
|
|
105029
|
+
}
|
|
105030
|
+
const zVec = rMatrix.rowZ(); // This is a row matrix...
|
|
105031
|
+
const spacePoint = _AccuDraw__WEBPACK_IMPORTED_MODULE_9__.AccuDrawHintBuilder.projectPointToPlaneInView(accuDraw.origin, snap.getPoint(), zVec, snap.viewport, true);
|
|
105032
|
+
if (undefined === spacePoint)
|
|
105033
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105034
|
+
let detail;
|
|
105035
|
+
if (_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.PerpendicularPoint === snapMode)
|
|
105036
|
+
detail = curve.closestPoint(spacePoint, true);
|
|
105037
|
+
else
|
|
105038
|
+
detail = curve.closestTangent(spacePoint, { hintPoint: snap.getPoint(), vectorToEye: zVec, extend: true });
|
|
105039
|
+
if (undefined === detail?.curve)
|
|
105040
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105041
|
+
// Close point may not be perpendicular when curve can't be extended...
|
|
105042
|
+
if (_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.PerpendicularPoint === snapMode && !curve.isExtensibleFractionSpace) {
|
|
105043
|
+
const curvePlanePoint = _AccuDraw__WEBPACK_IMPORTED_MODULE_9__.AccuDrawHintBuilder.projectPointToPlaneInView(accuDraw.origin, detail.point, zVec, snap.viewport, true);
|
|
105044
|
+
if (undefined === curvePlanePoint)
|
|
105045
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105046
|
+
const curveNormal = detail.point.vectorTo(curvePlanePoint);
|
|
105047
|
+
const curveTangent = curve.fractionToPointAndUnitTangent(detail.fraction);
|
|
105048
|
+
if (!curveTangent.getDirectionRef().isPerpendicularTo(curveNormal)) {
|
|
105049
|
+
const curveExtensionPoint = _AccuDraw__WEBPACK_IMPORTED_MODULE_9__.AccuDrawHintBuilder.projectPointToLineInView(accuDraw.origin, curveTangent.getOriginRef(), curveTangent.getDirectionRef(), snap.viewport, true);
|
|
105050
|
+
if (undefined === curveExtensionPoint)
|
|
105051
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105052
|
+
detail.point.setFrom(curveExtensionPoint);
|
|
105053
|
+
}
|
|
105054
|
+
}
|
|
105055
|
+
const point = _AccuDraw__WEBPACK_IMPORTED_MODULE_9__.AccuDrawHintBuilder.projectPointToPlaneInView(detail.point, accuDraw.origin, zVec, snap.viewport, true);
|
|
105056
|
+
if (undefined === point)
|
|
105057
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoSnapPossible;
|
|
105058
|
+
snap.setSnapPoint(point, _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapHeat.InRange); // Force hot snap...
|
|
105059
|
+
snap.setSnapMode(snapMode);
|
|
105060
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success;
|
|
105061
|
+
}
|
|
104845
105062
|
/** @internal */
|
|
104846
105063
|
static async requestSnap(thisHit, snapModes, hotDistanceInches, keypointDivisor, hitList, out) {
|
|
104847
105064
|
if (thisHit.isModelHit || thisHit.isMapHit || thisHit.isClassifier) {
|
|
@@ -104878,6 +105095,16 @@ class AccuSnap {
|
|
|
104878
105095
|
return undefined;
|
|
104879
105096
|
}
|
|
104880
105097
|
}
|
|
105098
|
+
const haveTangentPoint = snapModes.includes(_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.TangentPoint);
|
|
105099
|
+
const havePerpendicularPoint = snapModes.includes(_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.PerpendicularPoint);
|
|
105100
|
+
const postProcessSnapMode = (havePerpendicularPoint ? _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.PerpendicularPoint : (haveTangentPoint ? _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.TangentPoint : undefined));
|
|
105101
|
+
if (undefined !== postProcessSnapMode) {
|
|
105102
|
+
// NOTE: These are not valid backend snap modes. Instead make the snap request using nearest
|
|
105103
|
+
// snap in order to get the candidate curve to use to compute the desired snap point...
|
|
105104
|
+
snapModes = snapModes.filter(snapMode => (snapMode !== _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.PerpendicularPoint && snapMode !== _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.TangentPoint));
|
|
105105
|
+
if (!snapModes.includes(_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.Nearest))
|
|
105106
|
+
snapModes.push(_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.Nearest);
|
|
105107
|
+
}
|
|
104881
105108
|
const requestProps = {
|
|
104882
105109
|
id: thisHit.sourceId,
|
|
104883
105110
|
testPoint: thisHit.testPoint,
|
|
@@ -104965,6 +105192,11 @@ class AccuSnap {
|
|
|
104965
105192
|
displayTransform?.matrix.multiplyVector(snap.normal, snap.normal);
|
|
104966
105193
|
snap.normal.normalizeInPlace();
|
|
104967
105194
|
}
|
|
105195
|
+
if (undefined !== postProcessSnapMode && _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.Nearest === result.snapMode) {
|
|
105196
|
+
if (_ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success !== this.doPostProcessSnapMode(snap, postProcessSnapMode))
|
|
105197
|
+
return undefined;
|
|
105198
|
+
return snap;
|
|
105199
|
+
}
|
|
104968
105200
|
if (_HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapMode.Intersection !== snap.snapMode)
|
|
104969
105201
|
return snap;
|
|
104970
105202
|
if (undefined === result.intersectId)
|
|
@@ -105165,7 +105397,9 @@ class AccuSnap {
|
|
|
105165
105397
|
}
|
|
105166
105398
|
}
|
|
105167
105399
|
/** @internal */
|
|
105168
|
-
onPreButtonEvent(ev) {
|
|
105400
|
+
onPreButtonEvent(ev) {
|
|
105401
|
+
return (undefined !== this.touchCursor) ? this.touchCursor.isButtonHandled(ev) : false;
|
|
105402
|
+
}
|
|
105169
105403
|
/** @internal */
|
|
105170
105404
|
onTouchStart(ev) {
|
|
105171
105405
|
if (undefined !== this.touchCursor)
|
|
@@ -111612,6 +111846,8 @@ var SnapMode;
|
|
|
111612
111846
|
SnapMode[SnapMode["Origin"] = 16] = "Origin";
|
|
111613
111847
|
SnapMode[SnapMode["Bisector"] = 32] = "Bisector";
|
|
111614
111848
|
SnapMode[SnapMode["Intersection"] = 64] = "Intersection";
|
|
111849
|
+
SnapMode[SnapMode["PerpendicularPoint"] = 128] = "PerpendicularPoint";
|
|
111850
|
+
SnapMode[SnapMode["TangentPoint"] = 256] = "TangentPoint";
|
|
111615
111851
|
})(SnapMode || (SnapMode = {}));
|
|
111616
111852
|
/**
|
|
111617
111853
|
* @public
|
|
@@ -111886,6 +112122,11 @@ class SnapDetail extends HitDetail {
|
|
|
111886
112122
|
this.adjustedPoint.setFrom(point);
|
|
111887
112123
|
this.heat = heat;
|
|
111888
112124
|
}
|
|
112125
|
+
/** Change the snap mode. */
|
|
112126
|
+
setSnapMode(snapMode) {
|
|
112127
|
+
this.snapMode = snapMode;
|
|
112128
|
+
this.sprite = _Sprites__WEBPACK_IMPORTED_MODULE_4__.IconSprites.getSpriteFromUrl(SnapDetail.getSnapSpriteUrl(snapMode));
|
|
112129
|
+
}
|
|
111889
112130
|
/** Set curve primitive and HitGeometryType for this SnapDetail. */
|
|
111890
112131
|
setCurvePrimitive(primitive, localToWorld, geomType) {
|
|
111891
112132
|
this.primitive = primitive;
|
|
@@ -111977,6 +112218,8 @@ class SnapDetail extends HitDetail {
|
|
|
111977
112218
|
case SnapMode.Origin: return `${_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.publicPath}sprites/SnapOrigin.png`;
|
|
111978
112219
|
case SnapMode.Bisector: return `${_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.publicPath}sprites/SnapBisector.png`;
|
|
111979
112220
|
case SnapMode.Intersection: return `${_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.publicPath}sprites/SnapIntersection.png`;
|
|
112221
|
+
case SnapMode.PerpendicularPoint: return `${_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.publicPath}sprites/SnapPerpendicularPoint.png`;
|
|
112222
|
+
case SnapMode.TangentPoint: return `${_IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.publicPath}sprites/SnapTangentPoint.png`;
|
|
111980
112223
|
}
|
|
111981
112224
|
return "";
|
|
111982
112225
|
}
|
|
@@ -135511,7 +135754,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
135511
135754
|
/* harmony export */ AccuDrawRotateCycleTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotateCycleTool),
|
|
135512
135755
|
/* harmony export */ AccuDrawRotateElementTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotateElementTool),
|
|
135513
135756
|
/* harmony export */ AccuDrawRotateFrontTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotateFrontTool),
|
|
135514
|
-
/* harmony export */ AccuDrawRotatePerpendicularTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotatePerpendicularTool),
|
|
135515
135757
|
/* harmony export */ AccuDrawRotateSideTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotateSideTool),
|
|
135516
135758
|
/* harmony export */ AccuDrawRotateTopTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotateTopTool),
|
|
135517
135759
|
/* harmony export */ AccuDrawRotateViewTool: () => (/* reexport safe */ _tools_AccuDrawTool__WEBPACK_IMPORTED_MODULE_99__.AccuDrawRotateViewTool),
|
|
@@ -154819,6 +155061,10 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
|
|
|
154819
155061
|
return hasAlpha ? "translucent" : opaquePass;
|
|
154820
155062
|
}
|
|
154821
155063
|
_wantWoWReversal(target) {
|
|
155064
|
+
if (this.isGlyph) {
|
|
155065
|
+
// Raster text is always subject to white-on-white reversal.
|
|
155066
|
+
return true;
|
|
155067
|
+
}
|
|
154822
155068
|
const fillFlags = this.fillFlags;
|
|
154823
155069
|
if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FillFlags.None !== (fillFlags & _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FillFlags.Background)) {
|
|
154824
155070
|
return false; // fill color explicitly from background
|
|
@@ -194815,7 +195061,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
194815
195061
|
/* harmony export */ AccuDrawRotateCycleTool: () => (/* binding */ AccuDrawRotateCycleTool),
|
|
194816
195062
|
/* harmony export */ AccuDrawRotateElementTool: () => (/* binding */ AccuDrawRotateElementTool),
|
|
194817
195063
|
/* harmony export */ AccuDrawRotateFrontTool: () => (/* binding */ AccuDrawRotateFrontTool),
|
|
194818
|
-
/* harmony export */ AccuDrawRotatePerpendicularTool: () => (/* binding */ AccuDrawRotatePerpendicularTool),
|
|
194819
195064
|
/* harmony export */ AccuDrawRotateSideTool: () => (/* binding */ AccuDrawRotateSideTool),
|
|
194820
195065
|
/* harmony export */ AccuDrawRotateTopTool: () => (/* binding */ AccuDrawRotateTopTool),
|
|
194821
195066
|
/* harmony export */ AccuDrawRotateViewTool: () => (/* binding */ AccuDrawRotateViewTool),
|
|
@@ -194838,9 +195083,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
194838
195083
|
/* harmony import */ var _AccuDraw__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../AccuDraw */ "../../core/frontend/lib/esm/AccuDraw.js");
|
|
194839
195084
|
/* harmony import */ var _AccuSnap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../AccuSnap */ "../../core/frontend/lib/esm/AccuSnap.js");
|
|
194840
195085
|
/* harmony import */ var _AuxCoordSys__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../AuxCoordSys */ "../../core/frontend/lib/esm/AuxCoordSys.js");
|
|
194841
|
-
/* harmony import */ var
|
|
194842
|
-
/* harmony import */ var
|
|
194843
|
-
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
195086
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
195087
|
+
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
194844
195088
|
/*---------------------------------------------------------------------------------------------
|
|
194845
195089
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
194846
195090
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -194855,7 +195099,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
194855
195099
|
|
|
194856
195100
|
|
|
194857
195101
|
|
|
194858
|
-
|
|
194859
195102
|
// cSpell:ignore dont unlockedz
|
|
194860
195103
|
function normalizedDifference(point1, point2, out) {
|
|
194861
195104
|
return point2.vectorTo(point1).normalizeWithLength(out).mag;
|
|
@@ -194871,7 +195114,7 @@ function normalizedCrossProduct(vec1, vec2, out) {
|
|
|
194871
195114
|
class AccuDrawShortcuts {
|
|
194872
195115
|
/** Disable/Enable AccuDraw for the session */
|
|
194873
195116
|
static sessionToggle() {
|
|
194874
|
-
const accudraw =
|
|
195117
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
194875
195118
|
if (accudraw.isEnabled)
|
|
194876
195119
|
accudraw.disableForSession();
|
|
194877
195120
|
else
|
|
@@ -194879,7 +195122,7 @@ class AccuDrawShortcuts {
|
|
|
194879
195122
|
}
|
|
194880
195123
|
/** Suspend/Unsuspend AccuDraw for the active tool */
|
|
194881
195124
|
static suspendToggle() {
|
|
194882
|
-
const accudraw =
|
|
195125
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
194883
195126
|
if (!accudraw.isEnabled)
|
|
194884
195127
|
return;
|
|
194885
195128
|
if (accudraw.isActive)
|
|
@@ -194889,7 +195132,7 @@ class AccuDrawShortcuts {
|
|
|
194889
195132
|
accudraw.refreshDecorationsAndDynamics();
|
|
194890
195133
|
}
|
|
194891
195134
|
static rotateAxesByPoint(isSnapped, aboutCurrentZ) {
|
|
194892
|
-
const accudraw =
|
|
195135
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
194893
195136
|
if (!accudraw.isEnabled)
|
|
194894
195137
|
return false;
|
|
194895
195138
|
const vp = accudraw.currentView;
|
|
@@ -194917,7 +195160,7 @@ class AccuDrawShortcuts {
|
|
|
194917
195160
|
return true;
|
|
194918
195161
|
}
|
|
194919
195162
|
static updateACSByPoints(acs, vp, points, isDynamics) {
|
|
194920
|
-
const accudraw =
|
|
195163
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
194921
195164
|
if (!accudraw.isEnabled)
|
|
194922
195165
|
return false;
|
|
194923
195166
|
let accept = false;
|
|
@@ -194973,9 +195216,9 @@ class AccuDrawShortcuts {
|
|
|
194973
195216
|
}
|
|
194974
195217
|
return accept;
|
|
194975
195218
|
}
|
|
194976
|
-
static processPendingHints() {
|
|
195219
|
+
static processPendingHints() { _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.processHints(); }
|
|
194977
195220
|
static requestInputFocus() {
|
|
194978
|
-
const accudraw =
|
|
195221
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
194979
195222
|
if (!accudraw.isEnabled)
|
|
194980
195223
|
return;
|
|
194981
195224
|
accudraw.grabInputFocus();
|
|
@@ -194983,7 +195226,7 @@ class AccuDrawShortcuts {
|
|
|
194983
195226
|
}
|
|
194984
195227
|
// Helper method for GUI implementation...
|
|
194985
195228
|
static async itemFieldNavigate(index, str, forward) {
|
|
194986
|
-
const accudraw =
|
|
195229
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
194987
195230
|
if (!accudraw.isEnabled)
|
|
194988
195231
|
return;
|
|
194989
195232
|
if (accudraw.getFieldLock(index))
|
|
@@ -195019,10 +195262,10 @@ class AccuDrawShortcuts {
|
|
|
195019
195262
|
accudraw.setFocusItem(index);
|
|
195020
195263
|
accudraw.dontMoveFocus = true;
|
|
195021
195264
|
}
|
|
195022
|
-
static itemFieldNewInput(index) {
|
|
195023
|
-
static itemFieldCompletedInput(index) {
|
|
195265
|
+
static itemFieldNewInput(index) { _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.setKeyinStatus(index, _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.KeyinStatus.Partial); }
|
|
195266
|
+
static itemFieldCompletedInput(index) { _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.setKeyinStatus(index, _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.KeyinStatus.Dynamic); }
|
|
195024
195267
|
static async itemFieldAcceptInput(index, str) {
|
|
195025
|
-
const accudraw =
|
|
195268
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195026
195269
|
await accudraw.processFieldInput(index, str, true);
|
|
195027
195270
|
accudraw.setKeyinStatus(index, _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.KeyinStatus.Dynamic);
|
|
195028
195271
|
if (accudraw.getFieldLock(index))
|
|
@@ -195060,7 +195303,7 @@ class AccuDrawShortcuts {
|
|
|
195060
195303
|
accudraw.setFocusItem(index);
|
|
195061
195304
|
}
|
|
195062
195305
|
static itemFieldLockToggle(index) {
|
|
195063
|
-
const accudraw =
|
|
195306
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195064
195307
|
if (!accudraw.isEnabled)
|
|
195065
195308
|
return;
|
|
195066
195309
|
if (accudraw.getFieldLock(index)) {
|
|
@@ -195105,21 +195348,21 @@ class AccuDrawShortcuts {
|
|
|
195105
195348
|
accudraw.clearTentative();
|
|
195106
195349
|
}
|
|
195107
195350
|
static choosePreviousValue(index) {
|
|
195108
|
-
const accudraw =
|
|
195351
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195109
195352
|
accudraw.getSavedValue(index, false);
|
|
195110
195353
|
accudraw.refreshDecorationsAndDynamics();
|
|
195111
195354
|
}
|
|
195112
195355
|
static chooseNextValue(index) {
|
|
195113
|
-
const accudraw =
|
|
195356
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195114
195357
|
accudraw.getSavedValue(index, true);
|
|
195115
195358
|
accudraw.refreshDecorationsAndDynamics();
|
|
195116
195359
|
}
|
|
195117
195360
|
static clearSavedValues() {
|
|
195118
|
-
const accudraw =
|
|
195361
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195119
195362
|
accudraw.clearSavedValues();
|
|
195120
195363
|
}
|
|
195121
195364
|
static itemRotationModeChange(rotation) {
|
|
195122
|
-
const accudraw =
|
|
195365
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195123
195366
|
const vp = accudraw.currentView;
|
|
195124
195367
|
const is3d = vp ? vp.view.is3d() : true;
|
|
195125
195368
|
if (!is3d && (_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Front === rotation || _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Side === rotation))
|
|
@@ -195129,7 +195372,7 @@ class AccuDrawShortcuts {
|
|
|
195129
195372
|
}
|
|
195130
195373
|
// Shortcut implementations for GUI entry points...
|
|
195131
195374
|
static setOrigin(explicitOrigin) {
|
|
195132
|
-
const accudraw =
|
|
195375
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195133
195376
|
if (!accudraw.isEnabled)
|
|
195134
195377
|
return;
|
|
195135
195378
|
if (explicitOrigin) {
|
|
@@ -195144,8 +195387,8 @@ class AccuDrawShortcuts {
|
|
|
195144
195387
|
accudraw.flags.haveValidOrigin = true;
|
|
195145
195388
|
}
|
|
195146
195389
|
else {
|
|
195147
|
-
const ev = new
|
|
195148
|
-
|
|
195390
|
+
const ev = new _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButtonEvent();
|
|
195391
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.toolAdmin.fillEventFromLastDataButton(ev);
|
|
195149
195392
|
if (ev.viewport) {
|
|
195150
195393
|
accudraw.published.origin.setFrom(ev.point);
|
|
195151
195394
|
accudraw.flags.haveValidOrigin = true;
|
|
@@ -195174,7 +195417,7 @@ class AccuDrawShortcuts {
|
|
|
195174
195417
|
accudraw.refreshDecorationsAndDynamics(); // NOTE: Will already grab input focus through processHints...
|
|
195175
195418
|
}
|
|
195176
195419
|
static changeCompassMode() {
|
|
195177
|
-
const accudraw =
|
|
195420
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195178
195421
|
if (!accudraw.isEnabled)
|
|
195179
195422
|
return;
|
|
195180
195423
|
let axisLockStatus = accudraw.locked & _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.LockedStates.XY_BM;
|
|
@@ -195204,10 +195447,10 @@ class AccuDrawShortcuts {
|
|
|
195204
195447
|
this.requestInputFocus();
|
|
195205
195448
|
}
|
|
195206
195449
|
static lockSmart() {
|
|
195207
|
-
const accudraw =
|
|
195450
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195208
195451
|
if (!accudraw.isEnabled)
|
|
195209
195452
|
return;
|
|
195210
|
-
const accuSnap =
|
|
195453
|
+
const accuSnap = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuSnap;
|
|
195211
195454
|
// Don't want AccuSnap to influence axis or Z...
|
|
195212
195455
|
if (accuSnap.isHot) {
|
|
195213
195456
|
accuSnap.clear();
|
|
@@ -195289,7 +195532,7 @@ class AccuDrawShortcuts {
|
|
|
195289
195532
|
}
|
|
195290
195533
|
/** Disable indexing when not currently indexed; if indexed, enable respective lock. */
|
|
195291
195534
|
static lockIndex() {
|
|
195292
|
-
const accudraw =
|
|
195535
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195293
195536
|
if (!accudraw.isEnabled)
|
|
195294
195537
|
return;
|
|
195295
195538
|
if (accudraw.flags.indexLocked) {
|
|
@@ -195329,7 +195572,7 @@ class AccuDrawShortcuts {
|
|
|
195329
195572
|
this.requestInputFocus();
|
|
195330
195573
|
}
|
|
195331
195574
|
static lockX() {
|
|
195332
|
-
const accudraw =
|
|
195575
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195333
195576
|
if (!accudraw.isEnabled)
|
|
195334
195577
|
return;
|
|
195335
195578
|
accudraw.clearTentative();
|
|
@@ -195353,7 +195596,7 @@ class AccuDrawShortcuts {
|
|
|
195353
195596
|
this.requestInputFocus();
|
|
195354
195597
|
}
|
|
195355
195598
|
static lockY() {
|
|
195356
|
-
const accudraw =
|
|
195599
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195357
195600
|
if (!accudraw.isEnabled)
|
|
195358
195601
|
return;
|
|
195359
195602
|
accudraw.clearTentative();
|
|
@@ -195377,7 +195620,7 @@ class AccuDrawShortcuts {
|
|
|
195377
195620
|
this.requestInputFocus();
|
|
195378
195621
|
}
|
|
195379
195622
|
static lockZ() {
|
|
195380
|
-
const accudraw =
|
|
195623
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195381
195624
|
if (!accudraw.isEnabled)
|
|
195382
195625
|
return;
|
|
195383
195626
|
const vp = accudraw.currentView;
|
|
@@ -195399,7 +195642,7 @@ class AccuDrawShortcuts {
|
|
|
195399
195642
|
this.requestInputFocus();
|
|
195400
195643
|
}
|
|
195401
195644
|
static lockDistance() {
|
|
195402
|
-
const accudraw =
|
|
195645
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195403
195646
|
if (!accudraw.isEnabled)
|
|
195404
195647
|
return;
|
|
195405
195648
|
const isSnapped = accudraw.clearTentative();
|
|
@@ -195425,14 +195668,14 @@ class AccuDrawShortcuts {
|
|
|
195425
195668
|
this.requestInputFocus();
|
|
195426
195669
|
}
|
|
195427
195670
|
static lockAngle() {
|
|
195428
|
-
const accudraw =
|
|
195671
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195429
195672
|
if (!accudraw.isEnabled)
|
|
195430
195673
|
return;
|
|
195431
195674
|
accudraw.doLockAngle(accudraw.clearTentative());
|
|
195432
195675
|
this.requestInputFocus();
|
|
195433
195676
|
}
|
|
195434
195677
|
static setStandardRotation(rotation) {
|
|
195435
|
-
const accudraw =
|
|
195678
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195436
195679
|
if (!accudraw.isEnabled)
|
|
195437
195680
|
return;
|
|
195438
195681
|
if (_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Context === rotation) {
|
|
@@ -195450,7 +195693,7 @@ class AccuDrawShortcuts {
|
|
|
195450
195693
|
this.requestInputFocus();
|
|
195451
195694
|
}
|
|
195452
195695
|
static alignView() {
|
|
195453
|
-
const accudraw =
|
|
195696
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195454
195697
|
if (!accudraw.isEnabled)
|
|
195455
195698
|
return;
|
|
195456
195699
|
const vp = accudraw.currentView;
|
|
@@ -195468,9 +195711,9 @@ class AccuDrawShortcuts {
|
|
|
195468
195711
|
vp.animateFrustumChange();
|
|
195469
195712
|
this.requestInputFocus();
|
|
195470
195713
|
}
|
|
195471
|
-
static rotateToBase() { this.setStandardRotation(
|
|
195714
|
+
static rotateToBase() { this.setStandardRotation(_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.flags.baseRotation); }
|
|
195472
195715
|
static rotateToACS() {
|
|
195473
|
-
const accudraw =
|
|
195716
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195474
195717
|
if (!accudraw.isEnabled)
|
|
195475
195718
|
return;
|
|
195476
195719
|
// NOTE: Match current ACS orientation..reset auxRotationPlane to top!
|
|
@@ -195478,7 +195721,7 @@ class AccuDrawShortcuts {
|
|
|
195478
195721
|
this.setStandardRotation(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.ACS);
|
|
195479
195722
|
}
|
|
195480
195723
|
static rotateCycle() {
|
|
195481
|
-
const accudraw =
|
|
195724
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195482
195725
|
if (!accudraw.isEnabled)
|
|
195483
195726
|
return;
|
|
195484
195727
|
const vp = accudraw.currentView;
|
|
@@ -195541,7 +195784,7 @@ class AccuDrawShortcuts {
|
|
|
195541
195784
|
this.setStandardRotation(rotation);
|
|
195542
195785
|
}
|
|
195543
195786
|
static rotate90(axis) {
|
|
195544
|
-
const accudraw =
|
|
195787
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195545
195788
|
if (!accudraw.isEnabled)
|
|
195546
195789
|
return;
|
|
195547
195790
|
const newRotation = new _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.ThreeAxes();
|
|
@@ -195568,22 +195811,19 @@ class AccuDrawShortcuts {
|
|
|
195568
195811
|
this.requestInputFocus();
|
|
195569
195812
|
}
|
|
195570
195813
|
static async rotateAxes(aboutCurrentZ) {
|
|
195571
|
-
return
|
|
195814
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.run("AccuDraw.RotateAxes", aboutCurrentZ);
|
|
195572
195815
|
}
|
|
195573
195816
|
static async rotateToElement() {
|
|
195574
|
-
return
|
|
195575
|
-
}
|
|
195576
|
-
static async rotatePerpendicular() {
|
|
195577
|
-
return _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tools.run("AccuDraw.RotatePerpendicular");
|
|
195817
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.run("AccuDraw.RotateElement");
|
|
195578
195818
|
}
|
|
195579
195819
|
static async defineACSByElement() {
|
|
195580
|
-
return
|
|
195820
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.run("AccuDraw.DefineACSByElement");
|
|
195581
195821
|
}
|
|
195582
195822
|
static async defineACSByPoints() {
|
|
195583
|
-
return
|
|
195823
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.run("AccuDraw.DefineACSByPoints");
|
|
195584
195824
|
}
|
|
195585
195825
|
static getACS(acsName, useOrigin, useRotation) {
|
|
195586
|
-
const accudraw =
|
|
195826
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195587
195827
|
if (!accudraw.isEnabled)
|
|
195588
195828
|
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR;
|
|
195589
195829
|
const vp = accudraw.currentView;
|
|
@@ -195642,7 +195882,7 @@ class AccuDrawShortcuts {
|
|
|
195642
195882
|
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS;
|
|
195643
195883
|
}
|
|
195644
195884
|
static writeACS(_acsName) {
|
|
195645
|
-
const accudraw =
|
|
195885
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195646
195886
|
if (!accudraw.isEnabled)
|
|
195647
195887
|
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR;
|
|
195648
195888
|
const vp = accudraw.currentView;
|
|
@@ -195668,13 +195908,13 @@ class AccuDrawShortcuts {
|
|
|
195668
195908
|
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS;
|
|
195669
195909
|
}
|
|
195670
195910
|
static itemFieldUnlockAll() {
|
|
195671
|
-
const accudraw =
|
|
195911
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195672
195912
|
if (accudraw.isEnabled)
|
|
195673
195913
|
accudraw.unlockAllFields();
|
|
195674
195914
|
}
|
|
195675
195915
|
}
|
|
195676
195916
|
/** @beta */
|
|
195677
|
-
class AccuDrawSessionToggleTool extends
|
|
195917
|
+
class AccuDrawSessionToggleTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195678
195918
|
static toolId = "AccuDraw.SessionToggle";
|
|
195679
195919
|
async run() {
|
|
195680
195920
|
AccuDrawShortcuts.sessionToggle();
|
|
@@ -195682,7 +195922,7 @@ class AccuDrawSessionToggleTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool
|
|
|
195682
195922
|
}
|
|
195683
195923
|
}
|
|
195684
195924
|
/** @beta */
|
|
195685
|
-
class AccuDrawSuspendToggleTool extends
|
|
195925
|
+
class AccuDrawSuspendToggleTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195686
195926
|
static toolId = "AccuDraw.SuspendToggle";
|
|
195687
195927
|
async run() {
|
|
195688
195928
|
AccuDrawShortcuts.suspendToggle();
|
|
@@ -195690,7 +195930,7 @@ class AccuDrawSuspendToggleTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool
|
|
|
195690
195930
|
}
|
|
195691
195931
|
}
|
|
195692
195932
|
/** @beta */
|
|
195693
|
-
class AccuDrawSetOriginTool extends
|
|
195933
|
+
class AccuDrawSetOriginTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195694
195934
|
static toolId = "AccuDraw.SetOrigin";
|
|
195695
195935
|
async run() {
|
|
195696
195936
|
AccuDrawShortcuts.setOrigin();
|
|
@@ -195698,7 +195938,7 @@ class AccuDrawSetOriginTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195698
195938
|
}
|
|
195699
195939
|
}
|
|
195700
195940
|
/** @beta */
|
|
195701
|
-
class AccuDrawSetLockSmartTool extends
|
|
195941
|
+
class AccuDrawSetLockSmartTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195702
195942
|
static toolId = "AccuDraw.LockSmart";
|
|
195703
195943
|
async run() {
|
|
195704
195944
|
AccuDrawShortcuts.lockSmart();
|
|
@@ -195706,7 +195946,7 @@ class AccuDrawSetLockSmartTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195706
195946
|
}
|
|
195707
195947
|
}
|
|
195708
195948
|
/** @beta */
|
|
195709
|
-
class AccuDrawSetLockIndexTool extends
|
|
195949
|
+
class AccuDrawSetLockIndexTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195710
195950
|
static toolId = "AccuDraw.LockIndex";
|
|
195711
195951
|
async run() {
|
|
195712
195952
|
AccuDrawShortcuts.lockIndex();
|
|
@@ -195714,7 +195954,7 @@ class AccuDrawSetLockIndexTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195714
195954
|
}
|
|
195715
195955
|
}
|
|
195716
195956
|
/** @beta */
|
|
195717
|
-
class AccuDrawSetLockXTool extends
|
|
195957
|
+
class AccuDrawSetLockXTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195718
195958
|
static toolId = "AccuDraw.LockX";
|
|
195719
195959
|
async run() {
|
|
195720
195960
|
AccuDrawShortcuts.lockX();
|
|
@@ -195722,7 +195962,7 @@ class AccuDrawSetLockXTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195722
195962
|
}
|
|
195723
195963
|
}
|
|
195724
195964
|
/** @beta */
|
|
195725
|
-
class AccuDrawSetLockYTool extends
|
|
195965
|
+
class AccuDrawSetLockYTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195726
195966
|
static toolId = "AccuDraw.LockY";
|
|
195727
195967
|
async run() {
|
|
195728
195968
|
AccuDrawShortcuts.lockY();
|
|
@@ -195730,7 +195970,7 @@ class AccuDrawSetLockYTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195730
195970
|
}
|
|
195731
195971
|
}
|
|
195732
195972
|
/** @beta */
|
|
195733
|
-
class AccuDrawSetLockZTool extends
|
|
195973
|
+
class AccuDrawSetLockZTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195734
195974
|
static toolId = "AccuDraw.LockZ";
|
|
195735
195975
|
async run() {
|
|
195736
195976
|
AccuDrawShortcuts.lockZ();
|
|
@@ -195738,7 +195978,7 @@ class AccuDrawSetLockZTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195738
195978
|
}
|
|
195739
195979
|
}
|
|
195740
195980
|
/** @beta */
|
|
195741
|
-
class AccuDrawSetLockDistanceTool extends
|
|
195981
|
+
class AccuDrawSetLockDistanceTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195742
195982
|
static toolId = "AccuDraw.LockDistance";
|
|
195743
195983
|
async run() {
|
|
195744
195984
|
AccuDrawShortcuts.lockDistance();
|
|
@@ -195746,7 +195986,7 @@ class AccuDrawSetLockDistanceTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Too
|
|
|
195746
195986
|
}
|
|
195747
195987
|
}
|
|
195748
195988
|
/** @beta */
|
|
195749
|
-
class AccuDrawSetLockAngleTool extends
|
|
195989
|
+
class AccuDrawSetLockAngleTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195750
195990
|
static toolId = "AccuDraw.LockAngle";
|
|
195751
195991
|
async run() {
|
|
195752
195992
|
AccuDrawShortcuts.lockAngle();
|
|
@@ -195754,7 +195994,7 @@ class AccuDrawSetLockAngleTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195754
195994
|
}
|
|
195755
195995
|
}
|
|
195756
195996
|
/** @beta */
|
|
195757
|
-
class AccuDrawChangeModeTool extends
|
|
195997
|
+
class AccuDrawChangeModeTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195758
195998
|
static toolId = "AccuDraw.ChangeMode";
|
|
195759
195999
|
async run() {
|
|
195760
196000
|
AccuDrawShortcuts.changeCompassMode();
|
|
@@ -195762,7 +196002,7 @@ class AccuDrawChangeModeTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195762
196002
|
}
|
|
195763
196003
|
}
|
|
195764
196004
|
/** @beta */
|
|
195765
|
-
class AccuDrawRotateCycleTool extends
|
|
196005
|
+
class AccuDrawRotateCycleTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195766
196006
|
static toolId = "AccuDraw.RotateCycle";
|
|
195767
196007
|
async run() {
|
|
195768
196008
|
AccuDrawShortcuts.rotateCycle();
|
|
@@ -195770,7 +196010,7 @@ class AccuDrawRotateCycleTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195770
196010
|
}
|
|
195771
196011
|
}
|
|
195772
196012
|
/** @beta */
|
|
195773
|
-
class AccuDrawRotateTopTool extends
|
|
196013
|
+
class AccuDrawRotateTopTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195774
196014
|
static toolId = "AccuDraw.RotateTop";
|
|
195775
196015
|
async run() {
|
|
195776
196016
|
AccuDrawShortcuts.setStandardRotation(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Top);
|
|
@@ -195778,7 +196018,7 @@ class AccuDrawRotateTopTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195778
196018
|
}
|
|
195779
196019
|
}
|
|
195780
196020
|
/** @beta */
|
|
195781
|
-
class AccuDrawRotateFrontTool extends
|
|
196021
|
+
class AccuDrawRotateFrontTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195782
196022
|
static toolId = "AccuDraw.RotateFront";
|
|
195783
196023
|
async run() {
|
|
195784
196024
|
AccuDrawShortcuts.setStandardRotation(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Front);
|
|
@@ -195786,7 +196026,7 @@ class AccuDrawRotateFrontTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195786
196026
|
}
|
|
195787
196027
|
}
|
|
195788
196028
|
/** @beta */
|
|
195789
|
-
class AccuDrawRotateSideTool extends
|
|
196029
|
+
class AccuDrawRotateSideTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195790
196030
|
static toolId = "AccuDraw.RotateSide";
|
|
195791
196031
|
async run() {
|
|
195792
196032
|
AccuDrawShortcuts.setStandardRotation(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Side);
|
|
@@ -195794,7 +196034,7 @@ class AccuDrawRotateSideTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195794
196034
|
}
|
|
195795
196035
|
}
|
|
195796
196036
|
/** @beta */
|
|
195797
|
-
class AccuDrawRotateViewTool extends
|
|
196037
|
+
class AccuDrawRotateViewTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195798
196038
|
static toolId = "AccuDraw.RotateView";
|
|
195799
196039
|
async run() {
|
|
195800
196040
|
AccuDrawShortcuts.setStandardRotation(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.View);
|
|
@@ -195802,7 +196042,7 @@ class AccuDrawRotateViewTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool {
|
|
|
195802
196042
|
}
|
|
195803
196043
|
}
|
|
195804
196044
|
/** @beta */
|
|
195805
|
-
class AccuDrawRotate90AboutXTool extends
|
|
196045
|
+
class AccuDrawRotate90AboutXTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195806
196046
|
static toolId = "AccuDraw.Rotate90AboutX";
|
|
195807
196047
|
async run() {
|
|
195808
196048
|
AccuDrawShortcuts.rotate90(0);
|
|
@@ -195810,7 +196050,7 @@ class AccuDrawRotate90AboutXTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool
|
|
|
195810
196050
|
}
|
|
195811
196051
|
}
|
|
195812
196052
|
/** @beta */
|
|
195813
|
-
class AccuDrawRotate90AboutYTool extends
|
|
196053
|
+
class AccuDrawRotate90AboutYTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195814
196054
|
static toolId = "AccuDraw.Rotate90AboutY";
|
|
195815
196055
|
async run() {
|
|
195816
196056
|
AccuDrawShortcuts.rotate90(1);
|
|
@@ -195818,7 +196058,7 @@ class AccuDrawRotate90AboutYTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool
|
|
|
195818
196058
|
}
|
|
195819
196059
|
}
|
|
195820
196060
|
/** @beta */
|
|
195821
|
-
class AccuDrawRotate90AboutZTool extends
|
|
196061
|
+
class AccuDrawRotate90AboutZTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.Tool {
|
|
195822
196062
|
static toolId = "AccuDraw.Rotate90AboutZ";
|
|
195823
196063
|
async run() {
|
|
195824
196064
|
AccuDrawShortcuts.rotate90(2);
|
|
@@ -195826,13 +196066,13 @@ class AccuDrawRotate90AboutZTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.Tool
|
|
|
195826
196066
|
}
|
|
195827
196067
|
}
|
|
195828
196068
|
/** @internal */
|
|
195829
|
-
class AccuDrawShortcutsTool extends
|
|
196069
|
+
class AccuDrawShortcutsTool extends _Tool__WEBPACK_IMPORTED_MODULE_6__.InputCollector {
|
|
195830
196070
|
_complete = false;
|
|
195831
|
-
get allowShortcut() { return this.wantActivateOnStart ?
|
|
196071
|
+
get allowShortcut() { return this.wantActivateOnStart ? _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.isEnabled : true; }
|
|
195832
196072
|
get wantActivateOnStart() { return false; } // Whether to automatically enable AccuDraw before the 1st data button...
|
|
195833
196073
|
get wantClearSnapOnStart() { return false; } // Whether to preserve active Tentative/AccuSnap on install...
|
|
195834
196074
|
get wantManipulationImmediate() { return false; } // Whether additional input is required to process on install...
|
|
195835
|
-
get wantExitOnDataButtonUp() { return false; } // Whether to exit on button up instead of down
|
|
196075
|
+
get wantExitOnDataButtonUp() { return false; } // Whether to exit on button up instead of down...
|
|
195836
196076
|
async onInstall() {
|
|
195837
196077
|
if (!this.allowShortcut)
|
|
195838
196078
|
return false;
|
|
@@ -195841,7 +196081,7 @@ class AccuDrawShortcutsTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.InputColl
|
|
|
195841
196081
|
async onPostInstall() {
|
|
195842
196082
|
await super.onPostInstall();
|
|
195843
196083
|
if (this.wantActivateOnStart)
|
|
195844
|
-
|
|
196084
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.activate();
|
|
195845
196085
|
this.onManipulationStart();
|
|
195846
196086
|
if (this.wantManipulationImmediate && this.doManipulation(undefined, false)) {
|
|
195847
196087
|
this._complete = true;
|
|
@@ -195849,18 +196089,18 @@ class AccuDrawShortcutsTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.InputColl
|
|
|
195849
196089
|
}
|
|
195850
196090
|
// NOTE: InputCollector inherits suspended primitive's state, set everything...
|
|
195851
196091
|
if (this.wantClearSnapOnStart) {
|
|
195852
|
-
this.initLocateElements(false, true, undefined,
|
|
196092
|
+
this.initLocateElements(false, true, undefined, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoordinateLockOverrides.None); // This clears the active Tentative/AccuSnap, some shortcuts have special behavior when invoked with an active snap...
|
|
195853
196093
|
}
|
|
195854
196094
|
else {
|
|
195855
|
-
|
|
195856
|
-
this.changeLocateState(false, true, undefined,
|
|
196095
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.locateManager.initLocateOptions();
|
|
196096
|
+
this.changeLocateState(false, true, undefined, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoordinateLockOverrides.None);
|
|
195857
196097
|
}
|
|
195858
196098
|
this.doManipulation(undefined, true);
|
|
195859
196099
|
;
|
|
195860
196100
|
}
|
|
195861
196101
|
async onCleanup() {
|
|
195862
196102
|
if (this._complete)
|
|
195863
|
-
|
|
196103
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.savedStateInputCollector.ignoreFlags = this.onManipulationComplete();
|
|
195864
196104
|
}
|
|
195865
196105
|
async exitTool() {
|
|
195866
196106
|
await super.exitTool();
|
|
@@ -195872,12 +196112,12 @@ class AccuDrawShortcutsTool extends _Tool__WEBPACK_IMPORTED_MODULE_7__.InputColl
|
|
|
195872
196112
|
if (!this.wantExitOnDataButtonUp)
|
|
195873
196113
|
await this.exitTool();
|
|
195874
196114
|
}
|
|
195875
|
-
return
|
|
196115
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
195876
196116
|
}
|
|
195877
196117
|
async onDataButtonUp(_ev) {
|
|
195878
196118
|
if (this._complete && this.wantExitOnDataButtonUp)
|
|
195879
196119
|
await this.exitTool();
|
|
195880
|
-
return
|
|
196120
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
195881
196121
|
}
|
|
195882
196122
|
async onMouseMotion(ev) {
|
|
195883
196123
|
this.doManipulation(ev, true);
|
|
@@ -195895,14 +196135,14 @@ class AccuDrawRotateAxesTool extends AccuDrawShortcutsTool {
|
|
|
195895
196135
|
this.aboutCurrentZ = aboutCurrentZ;
|
|
195896
196136
|
}
|
|
195897
196137
|
/** @internal */
|
|
195898
|
-
get allowShortcut() { return
|
|
196138
|
+
get allowShortcut() { return _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.isActive; } // Require compass to already be active for this shortcut...
|
|
195899
196139
|
/** @internal */
|
|
195900
196140
|
get wantActivateOnStart() { return true; } // State is demoted to inactive when a tool install, still need this...
|
|
195901
196141
|
/** @internal */
|
|
195902
196142
|
get wantManipulationImmediate() {
|
|
195903
196143
|
if (_AccuSnap__WEBPACK_IMPORTED_MODULE_3__.TentativeOrAccuSnap.isHot)
|
|
195904
196144
|
return true;
|
|
195905
|
-
const accudraw =
|
|
196145
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195906
196146
|
if (_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.CompassMode.Polar === accudraw.compassMode)
|
|
195907
196147
|
return accudraw.getFieldLock(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.ItemField.ANGLE_Item);
|
|
195908
196148
|
return accudraw.getFieldLock(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.ItemField.X_Item) && accudraw.getFieldLock(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.ItemField.Y_Item);
|
|
@@ -195910,12 +196150,12 @@ class AccuDrawRotateAxesTool extends AccuDrawShortcutsTool {
|
|
|
195910
196150
|
/** @internal */
|
|
195911
196151
|
onManipulationStart() {
|
|
195912
196152
|
if (this.aboutCurrentZ)
|
|
195913
|
-
|
|
195914
|
-
|
|
196153
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.changeBaseRotationMode(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Context); // Establish current orientation as base for when defining compass rotation by x axis...
|
|
196154
|
+
_Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.outputPromptByKey("AccuDraw.RotateAxes.Prompts.FirstPoint");
|
|
195915
196155
|
}
|
|
195916
196156
|
/** @internal */
|
|
195917
196157
|
doManipulation(ev, isMotion) {
|
|
195918
|
-
const vp = ev ? ev.viewport :
|
|
196158
|
+
const vp = ev ? ev.viewport : _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.currentView;
|
|
195919
196159
|
if (!vp)
|
|
195920
196160
|
return false;
|
|
195921
196161
|
if (!AccuDrawShortcuts.rotateAxesByPoint(_AccuSnap__WEBPACK_IMPORTED_MODULE_3__.TentativeOrAccuSnap.isHot, this.aboutCurrentZ))
|
|
@@ -195923,7 +196163,7 @@ class AccuDrawRotateAxesTool extends AccuDrawShortcutsTool {
|
|
|
195923
196163
|
vp.invalidateDecorations();
|
|
195924
196164
|
if (!isMotion) {
|
|
195925
196165
|
AccuDrawShortcuts.itemFieldUnlockAll();
|
|
195926
|
-
|
|
196166
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tentativePoint.clear(true);
|
|
195927
196167
|
}
|
|
195928
196168
|
return true;
|
|
195929
196169
|
}
|
|
@@ -195938,15 +196178,15 @@ class AccuDrawRotateAxesTool extends AccuDrawShortcutsTool {
|
|
|
195938
196178
|
/** @beta */
|
|
195939
196179
|
class AccuDrawRotateElementTool extends AccuDrawShortcutsTool {
|
|
195940
196180
|
static toolId = "AccuDraw.RotateElement";
|
|
195941
|
-
_moveOrigin = !
|
|
196181
|
+
_moveOrigin = !_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.isActive || _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tentativePoint.isActive; // Preserve current origin if AccuDraw already active and not tentative snap...
|
|
195942
196182
|
/** @internal */
|
|
195943
196183
|
get wantActivateOnStart() { return true; }
|
|
195944
196184
|
/** @internal */
|
|
195945
|
-
get wantManipulationImmediate() { return
|
|
196185
|
+
get wantManipulationImmediate() { return _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tentativePoint.isSnapped; }
|
|
195946
196186
|
/** @internal */
|
|
195947
196187
|
onManipulationStart() {
|
|
195948
|
-
|
|
195949
|
-
|
|
196188
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.setContext(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.FixedOrigin); // Don't move compass when updateOrientation returns false...
|
|
196189
|
+
_Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.outputPromptByKey("AccuDraw.RotateElement.Prompts.FirstPoint");
|
|
195950
196190
|
}
|
|
195951
196191
|
/** @internal */
|
|
195952
196192
|
onManipulationComplete() {
|
|
@@ -195957,7 +196197,7 @@ class AccuDrawRotateElementTool extends AccuDrawShortcutsTool {
|
|
|
195957
196197
|
}
|
|
195958
196198
|
/** @internal */
|
|
195959
196199
|
updateOrientation(snap, viewport, _isMotion) {
|
|
195960
|
-
const accudraw =
|
|
196200
|
+
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw;
|
|
195961
196201
|
const rMatrix = _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDraw.getSnapRotation(snap, viewport);
|
|
195962
196202
|
if (undefined === rMatrix)
|
|
195963
196203
|
return false;
|
|
@@ -195967,7 +196207,7 @@ class AccuDrawRotateElementTool extends AccuDrawShortcutsTool {
|
|
|
195967
196207
|
}
|
|
195968
196208
|
/** @internal */
|
|
195969
196209
|
doManipulation(ev, isMotion) {
|
|
195970
|
-
const viewport = ev ? ev.viewport :
|
|
196210
|
+
const viewport = ev ? ev.viewport : _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.currentView;
|
|
195971
196211
|
if (!viewport)
|
|
195972
196212
|
return false;
|
|
195973
196213
|
const snap = _AccuSnap__WEBPACK_IMPORTED_MODULE_3__.TentativeOrAccuSnap.getCurrentSnap(false);
|
|
@@ -195976,60 +196216,7 @@ class AccuDrawRotateElementTool extends AccuDrawShortcutsTool {
|
|
|
195976
196216
|
if (undefined === ev)
|
|
195977
196217
|
AccuDrawShortcuts.processPendingHints(); // Would normally be processed after button down, necessary when called from post install...
|
|
195978
196218
|
if (!isMotion)
|
|
195979
|
-
|
|
195980
|
-
return true;
|
|
195981
|
-
}
|
|
195982
|
-
}
|
|
195983
|
-
/** @beta */
|
|
195984
|
-
class AccuDrawRotatePerpendicularTool extends AccuDrawRotateElementTool {
|
|
195985
|
-
static toolId = "AccuDraw.RotatePerpendicular";
|
|
195986
|
-
_location;
|
|
195987
|
-
/** @internal */
|
|
195988
|
-
get wantExitOnDataButtonUp() { return true; } // Complete on button up since button down clears tentative...
|
|
195989
|
-
/** @internal */
|
|
195990
|
-
onManipulationComplete() {
|
|
195991
|
-
if (undefined !== this._location) {
|
|
195992
|
-
// Use tentative to hold adjusted snap location for suspended tool...
|
|
195993
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tentativePoint.setPoint(this._location.point);
|
|
195994
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tentativePoint.viewport = this._location.viewport;
|
|
195995
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tentativePoint.showTentative();
|
|
195996
|
-
}
|
|
195997
|
-
return _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.SetRMatrix | _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.Disable;
|
|
195998
|
-
}
|
|
195999
|
-
/** @internal */
|
|
196000
|
-
updateOrientation(snap, viewport, isMotion) {
|
|
196001
|
-
const curve = snap.getCurvePrimitive();
|
|
196002
|
-
if (undefined === curve)
|
|
196003
|
-
return false;
|
|
196004
|
-
const accudraw = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.accuDraw;
|
|
196005
|
-
const rMatrix = _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDraw.getSnapRotation(snap, viewport);
|
|
196006
|
-
if (undefined === rMatrix)
|
|
196007
|
-
return false;
|
|
196008
|
-
const zVec = rMatrix.getRow(2); // This is a row matrix...
|
|
196009
|
-
const spacePoint = _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawHintBuilder.projectPointToPlaneInView(accudraw.origin, snap.getPoint(), zVec, viewport, true);
|
|
196010
|
-
if (undefined === spacePoint)
|
|
196011
|
-
return false;
|
|
196012
|
-
const detail = curve.closestPoint(spacePoint, true);
|
|
196013
|
-
if (undefined === detail?.curve)
|
|
196014
|
-
return false;
|
|
196015
|
-
const point = _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawHintBuilder.projectPointToPlaneInView(detail.point, accudraw.origin, zVec, viewport, true);
|
|
196016
|
-
if (undefined === point)
|
|
196017
|
-
return false;
|
|
196018
|
-
const xVec = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d();
|
|
196019
|
-
if (normalizedDifference(point, accudraw.origin, xVec) < _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians)
|
|
196020
|
-
return false;
|
|
196021
|
-
; // Closest point and compass origin coincide...
|
|
196022
|
-
const yVec = xVec.unitCrossProduct(zVec);
|
|
196023
|
-
if (undefined === yVec)
|
|
196024
|
-
return false;
|
|
196025
|
-
rMatrix.setColumns(xVec, yVec, zVec);
|
|
196026
|
-
_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRigidFromMatrix3d(rMatrix, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XZY, rMatrix);
|
|
196027
|
-
rMatrix.transposeInPlace();
|
|
196028
|
-
snap.setSnapPoint(point, _HitDetail__WEBPACK_IMPORTED_MODULE_5__.SnapHeat.InRange); // Force hot snap so that adjust point uses it for alignments...
|
|
196029
|
-
accudraw.setContext(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.SetRMatrix | _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.AlwaysSetOrigin, accudraw.origin, rMatrix);
|
|
196030
|
-
accudraw.adjustPoint(point, viewport, false); // Update internals for new snap location...
|
|
196031
|
-
if (!isMotion)
|
|
196032
|
-
this._location = { point, viewport };
|
|
196219
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.changeBaseRotationMode(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.RotationMode.Context); // Hold temporary rotation for tool duration...
|
|
196033
196220
|
return true;
|
|
196034
196221
|
}
|
|
196035
196222
|
}
|
|
@@ -196040,7 +196227,7 @@ class DefineACSByElementTool extends AccuDrawShortcutsTool {
|
|
|
196040
196227
|
_rMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createIdentity();
|
|
196041
196228
|
_acs;
|
|
196042
196229
|
/** @internal */
|
|
196043
|
-
onManipulationStart() {
|
|
196230
|
+
onManipulationStart() { _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.outputPromptByKey("AccuDraw.DefineACSByElement.Prompts.FirstPoint"); }
|
|
196044
196231
|
/** @internal */
|
|
196045
196232
|
updateOrientation(snap, vp) {
|
|
196046
196233
|
const rMatrix = _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDraw.getSnapRotation(snap, vp);
|
|
@@ -196058,7 +196245,7 @@ class DefineACSByElementTool extends AccuDrawShortcutsTool {
|
|
|
196058
196245
|
const snapDetail = _AccuSnap__WEBPACK_IMPORTED_MODULE_3__.TentativeOrAccuSnap.getCurrentSnap(false);
|
|
196059
196246
|
if (undefined === snapDetail || !this.updateOrientation(snapDetail, vp))
|
|
196060
196247
|
return false;
|
|
196061
|
-
|
|
196248
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.viewManager.invalidateDecorationsAllViews();
|
|
196062
196249
|
if (isMotion)
|
|
196063
196250
|
return true;
|
|
196064
196251
|
if (!this._acs)
|
|
@@ -196086,24 +196273,24 @@ class DefineACSByPointsTool extends AccuDrawShortcutsTool {
|
|
|
196086
196273
|
_acs;
|
|
196087
196274
|
/** @internal */
|
|
196088
196275
|
onManipulationStart() {
|
|
196089
|
-
if (!
|
|
196090
|
-
|
|
196276
|
+
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tentativePoint.isActive) {
|
|
196277
|
+
_Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.outputPromptByKey("AccuDraw.DefineACSByPoints.Prompts.FirstPoint");
|
|
196091
196278
|
return;
|
|
196092
196279
|
}
|
|
196093
|
-
const origin =
|
|
196094
|
-
|
|
196095
|
-
|
|
196280
|
+
const origin = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tentativePoint.getPoint().clone();
|
|
196281
|
+
_Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.outputPromptByKey("AccuDraw.DefineACSByPoints.Prompts.SecondPoint");
|
|
196282
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.setContext(_AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.SetOrigin | _AccuDraw__WEBPACK_IMPORTED_MODULE_2__.AccuDrawFlags.FixedOrigin, origin);
|
|
196096
196283
|
this._points.push(origin);
|
|
196097
|
-
|
|
196284
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tentativePoint.clear(true);
|
|
196098
196285
|
}
|
|
196099
196286
|
/** @internal */
|
|
196100
196287
|
doManipulation(ev, isMotion) {
|
|
196101
196288
|
if (!ev || !ev.viewport)
|
|
196102
196289
|
return false;
|
|
196103
|
-
|
|
196290
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.viewManager.invalidateDecorationsAllViews();
|
|
196104
196291
|
if (isMotion)
|
|
196105
196292
|
return false;
|
|
196106
|
-
|
|
196293
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.activate();
|
|
196107
196294
|
this._points.push(ev.point.clone());
|
|
196108
196295
|
const vp = ev.viewport;
|
|
196109
196296
|
if (!this._acs)
|
|
@@ -196113,15 +196300,15 @@ class DefineACSByPointsTool extends AccuDrawShortcutsTool {
|
|
|
196113
196300
|
AccuDrawShortcuts.rotateToACS();
|
|
196114
196301
|
return true;
|
|
196115
196302
|
}
|
|
196116
|
-
|
|
196303
|
+
_Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.outputPromptByKey(`AccuDraw.DefineACSByPoints.Prompts${1 === this._points.length ? ".SecondPoint" : ".NextPoint"}`);
|
|
196117
196304
|
return false;
|
|
196118
196305
|
}
|
|
196119
196306
|
/** @internal */
|
|
196120
196307
|
decorate(context) {
|
|
196121
196308
|
const tmpPoints = [];
|
|
196122
196309
|
this._points.forEach((pt) => tmpPoints.push(pt));
|
|
196123
|
-
const ev = new
|
|
196124
|
-
|
|
196310
|
+
const ev = new _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButtonEvent();
|
|
196311
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.toolAdmin.fillEventFromCursorLocation(ev);
|
|
196125
196312
|
tmpPoints.push(ev.point);
|
|
196126
196313
|
const vp = context.viewport;
|
|
196127
196314
|
if (!this._acs)
|
|
@@ -209917,6 +210104,20 @@ class Geometry {
|
|
|
209917
210104
|
static isAlmostEqualEitherNumber(a, b, c, tolerance = Geometry.smallAngleRadians) {
|
|
209918
210105
|
return this.isAlmostEqualNumber(a, b, tolerance) || this.isAlmostEqualNumber(a, c, tolerance);
|
|
209919
210106
|
}
|
|
210107
|
+
/**
|
|
210108
|
+
* Toleranced test for equality to any of `count` numbers supplied by `iterator`.
|
|
210109
|
+
* @param a value to test
|
|
210110
|
+
* @param values array of values to test against, or an object that provides the i_th value, where 0 <= i < length.
|
|
210111
|
+
* @param tolerance relative tolerance. Default value is [[smallAngleRadians]].
|
|
210112
|
+
* @returns true if and only if `a` is almost equal to at least one value supplied by `iterator`.
|
|
210113
|
+
*/
|
|
210114
|
+
static isAlmostEqualAnyNumber(a, values, tolerance = Geometry.smallAngleRadians) {
|
|
210115
|
+
const value = Array.isArray(values) ? (i) => values[i] : values.iter;
|
|
210116
|
+
for (let i = 0; i < values.length; i++)
|
|
210117
|
+
if (this.isAlmostEqualNumber(a, value(i), tolerance))
|
|
210118
|
+
return true;
|
|
210119
|
+
return false;
|
|
210120
|
+
}
|
|
209920
210121
|
/**
|
|
209921
210122
|
* Toleranced equality test using tolerance `tolerance * ( 1 + abs(a.x) + abs(a.y) + abs(b.x) + abs(b.y) )`.
|
|
209922
210123
|
* * [[smallAngleRadians]] is used if tolerance is `undefined`.
|
|
@@ -223227,6 +223428,42 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
223227
223428
|
}
|
|
223228
223429
|
return result;
|
|
223229
223430
|
}
|
|
223431
|
+
/** Override of [[CurvePrimitive.emitTangents]] for Arc3d. */
|
|
223432
|
+
emitTangents(spacePoint, announceTangent, options) {
|
|
223433
|
+
const centerToPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(this.centerRef, spacePoint);
|
|
223434
|
+
let centerToLocalPoint;
|
|
223435
|
+
if (options?.vectorToEye) {
|
|
223436
|
+
const arcToView = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_4__.Matrix3d.createColumns(this.matrixRef.getColumn(0), this.matrixRef.getColumn(1), options.vectorToEye);
|
|
223437
|
+
centerToLocalPoint = arcToView.multiplyInverse(centerToPoint);
|
|
223438
|
+
}
|
|
223439
|
+
else {
|
|
223440
|
+
centerToLocalPoint = this.matrixRef.multiplyInverse(centerToPoint);
|
|
223441
|
+
}
|
|
223442
|
+
if (centerToLocalPoint === undefined)
|
|
223443
|
+
return;
|
|
223444
|
+
// centerToLocalPoint is a vector in the local coordinate system of the as-viewed arc.
|
|
223445
|
+
// In other words, the local arc is the unit circle.
|
|
223446
|
+
// alpha is the angle from the local x-axis to centerToLocalPoint.
|
|
223447
|
+
// beta is the nonnegative angle from centerToLocalPoint to a tangency radial.
|
|
223448
|
+
// Tangency angles are preserved by local <-> world transformation.
|
|
223449
|
+
if (centerToLocalPoint !== undefined) {
|
|
223450
|
+
const hypotenuseSquared = centerToLocalPoint.magnitudeSquaredXY();
|
|
223451
|
+
if (hypotenuseSquared >= 1.0) { // localPoint lies outside or on the unit circle...
|
|
223452
|
+
// ...and forms a right triangle with unit radial leg to tangent point
|
|
223453
|
+
const distanceToTangency = Math.sqrt(hypotenuseSquared - 1.0);
|
|
223454
|
+
const alpha = Math.atan2(centerToLocalPoint.y, centerToLocalPoint.x);
|
|
223455
|
+
const beta = Math.atan2(distanceToTangency, 1);
|
|
223456
|
+
const angles = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSmallAngleRadians(beta) ? [alpha] : [alpha + beta, alpha - beta];
|
|
223457
|
+
for (const theta of angles) {
|
|
223458
|
+
const f = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_14__.CurveExtendOptions.resolveRadiansToValidSweepFraction(options?.extend ?? false, theta, this.sweep);
|
|
223459
|
+
if (f.isValid) {
|
|
223460
|
+
const tangent = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_12__.CurveLocationDetail.createCurveFractionPoint(this, f.fraction, this.fractionToPoint(f.fraction));
|
|
223461
|
+
announceTangent(tangent);
|
|
223462
|
+
}
|
|
223463
|
+
}
|
|
223464
|
+
}
|
|
223465
|
+
}
|
|
223466
|
+
}
|
|
223230
223467
|
/** Reverse the sweep of the arc. */
|
|
223231
223468
|
reverseInPlace() {
|
|
223232
223469
|
this._sweep.reverseInPlace();
|
|
@@ -225541,38 +225778,42 @@ class CurveExtendOptions {
|
|
|
225541
225778
|
return fraction;
|
|
225542
225779
|
}
|
|
225543
225780
|
/**
|
|
225544
|
-
* Adjust a radians value to an angle sweep,
|
|
225545
|
-
* * If radians is within the sweep, convert it to a fraction of the sweep.
|
|
225546
|
-
* * If radians is outside
|
|
225547
|
-
*
|
|
225548
|
-
*
|
|
225781
|
+
* Adjust a radians value to an angle sweep, extending beyond or clamping to [0,1] according to `extendParam`:
|
|
225782
|
+
* * If `radians` is within the sweep, convert it to a fraction of the sweep.
|
|
225783
|
+
* * If `radians` is outside the sweep and `extendParam` does not allow extension at both ends, adjust the fraction:
|
|
225784
|
+
* * fraction below 0 if `extendParam` allows extension only at start
|
|
225785
|
+
* * fraction above 1 if `extendParam` allows extension only at end
|
|
225786
|
+
* * fraction clamped to [0,1] if `extendParam` disallows extension at both ends
|
|
225787
|
+
* @returns adjusted fraction of sweep, and a boolean indicating whether it is valid, i.e. whether `radians` lies in
|
|
225788
|
+
* the sweep extended per `extendParam`.
|
|
225549
225789
|
*/
|
|
225550
|
-
static
|
|
225790
|
+
static resolveRadiansToValidSweepFraction(extendParam, radians, sweep) {
|
|
225551
225791
|
let fraction = sweep.radiansToSignedPeriodicFraction(radians);
|
|
225792
|
+
let isValid = true;
|
|
225552
225793
|
if (!sweep.isRadiansInSweep(radians)) {
|
|
225553
225794
|
const fractionPeriod = sweep.fractionPeriod();
|
|
225554
225795
|
const mode0 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 0);
|
|
225555
225796
|
const mode1 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);
|
|
225556
225797
|
if (mode0 !== CurveExtendMode.None) {
|
|
225557
|
-
if (mode1
|
|
225558
|
-
// both extensions possible; let the sweep resolve to the "closer" end
|
|
225559
|
-
fraction = sweep.radiansToSignedPeriodicFraction(radians);
|
|
225560
|
-
}
|
|
225561
|
-
else {
|
|
225562
|
-
// only extend to negative
|
|
225798
|
+
if (mode1 === CurveExtendMode.None) { // only extend to negative
|
|
225563
225799
|
if (fraction > 1.0)
|
|
225564
225800
|
fraction -= fractionPeriod;
|
|
225565
225801
|
}
|
|
225566
225802
|
}
|
|
225567
|
-
else if (mode1 !== CurveExtendMode.None) {
|
|
225803
|
+
else if (mode1 !== CurveExtendMode.None) { // only extend to positive
|
|
225568
225804
|
if (fraction < 0.0)
|
|
225569
225805
|
fraction += fractionPeriod;
|
|
225570
225806
|
}
|
|
225571
|
-
else { //
|
|
225807
|
+
else { // no extension allowed
|
|
225572
225808
|
fraction = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(fraction, 0, 1);
|
|
225809
|
+
isValid = false;
|
|
225573
225810
|
}
|
|
225574
225811
|
}
|
|
225575
|
-
return fraction;
|
|
225812
|
+
return { fraction, isValid };
|
|
225813
|
+
}
|
|
225814
|
+
/** Call [[resolveRadiansToValidSweepFraction]] and return only the fraction. */
|
|
225815
|
+
static resolveRadiansToSweepFraction(extendParam, radians, sweep) {
|
|
225816
|
+
return this.resolveRadiansToValidSweepFraction(extendParam, radians, sweep).fraction;
|
|
225576
225817
|
}
|
|
225577
225818
|
}
|
|
225578
225819
|
|
|
@@ -226992,7 +227233,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
226992
227233
|
/* harmony export */ CurvePrimitive: () => (/* binding */ CurvePrimitive)
|
|
226993
227234
|
/* harmony export */ });
|
|
226994
227235
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
226995
|
-
/* harmony import */ var
|
|
227236
|
+
/* harmony import */ var _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/Query/StrokeCountMap */ "../../core/geometry/lib/esm/curve/Query/StrokeCountMap.js");
|
|
226996
227237
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
226997
227238
|
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
226998
227239
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
@@ -227001,8 +227242,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
227001
227242
|
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
227002
227243
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
227003
227244
|
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
227004
|
-
/* harmony import */ var
|
|
227245
|
+
/* harmony import */ var _internalContexts_AppendPlaneIntersectionStrokeHandler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internalContexts/AppendPlaneIntersectionStrokeHandler */ "../../core/geometry/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js");
|
|
227005
227246
|
/* harmony import */ var _internalContexts_ClosestPointStrokeHandler__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/ClosestPointStrokeHandler */ "../../core/geometry/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js");
|
|
227247
|
+
/* harmony import */ var _internalContexts_AnnounceTangentStrokeHandler__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internalContexts/AnnounceTangentStrokeHandler */ "../../core/geometry/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js");
|
|
227006
227248
|
/* harmony import */ var _internalContexts_CurveLengthContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internalContexts/CurveLengthContext */ "../../core/geometry/lib/esm/curve/internalContexts/CurveLengthContext.js");
|
|
227007
227249
|
/*---------------------------------------------------------------------------------------------
|
|
227008
227250
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -227024,6 +227266,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
227024
227266
|
|
|
227025
227267
|
|
|
227026
227268
|
|
|
227269
|
+
|
|
227027
227270
|
/**
|
|
227028
227271
|
* A curve primitive is bounded.
|
|
227029
227272
|
* A curve primitive maps fractions in 0..1 to points in space.
|
|
@@ -227412,12 +227655,8 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
227412
227655
|
* * Since CurvePrimitive should always have start and end available as candidate points, this method should always
|
|
227413
227656
|
* succeed.
|
|
227414
227657
|
* @param spacePoint point in space.
|
|
227415
|
-
* @param extend
|
|
227416
|
-
*
|
|
227417
|
-
* * true: extend the curve at both start and end
|
|
227418
|
-
* * CurveExtendOptions: extend the curve in the specified manner at both start and end
|
|
227419
|
-
* * CurveExtendOptions[]: first entry applies to curve start; second, to curve end; any other entries ignored
|
|
227420
|
-
* @param result optional pre-allocated detail to populate and return.
|
|
227658
|
+
* @param extend (optional) compute the closest point to the curve extended according to variant type (default false)
|
|
227659
|
+
* @param result (optional) pre-allocated detail to populate and return.
|
|
227421
227660
|
* @returns details of the closest point.
|
|
227422
227661
|
*/
|
|
227423
227662
|
closestPoint(spacePoint, extend, result) {
|
|
@@ -227425,6 +227664,62 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
227425
227664
|
this.emitStrokableParts(strokeHandler);
|
|
227426
227665
|
return strokeHandler.claimResult();
|
|
227427
227666
|
}
|
|
227667
|
+
/**
|
|
227668
|
+
* Announce all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in
|
|
227669
|
+
* the view defined by `options.vectorToEye`.
|
|
227670
|
+
* * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve
|
|
227671
|
+
* tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to
|
|
227672
|
+
* `options.vectorToEye`.
|
|
227673
|
+
* @param spacePoint point in space.
|
|
227674
|
+
* @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused
|
|
227675
|
+
* internally, so it should be cloned in the callback if it needs to be saved.
|
|
227676
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
227677
|
+
*/
|
|
227678
|
+
emitTangents(spacePoint, announceTangent, options) {
|
|
227679
|
+
const strokeHandler = new _internalContexts_AnnounceTangentStrokeHandler__WEBPACK_IMPORTED_MODULE_11__.AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);
|
|
227680
|
+
this.emitStrokableParts(strokeHandler, options?.strokeOptions);
|
|
227681
|
+
}
|
|
227682
|
+
/**
|
|
227683
|
+
* Return all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in
|
|
227684
|
+
* the view defined by `options.vectorToEye`.
|
|
227685
|
+
* * See [[emitTangents]] for the definition of tangency employed.
|
|
227686
|
+
* @param spacePoint point in space.
|
|
227687
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
227688
|
+
* @returns an array of details of all tangent points or undefined if no tangent was found.
|
|
227689
|
+
*/
|
|
227690
|
+
allTangents(spacePoint, options) {
|
|
227691
|
+
const tangents = [];
|
|
227692
|
+
this.emitTangents(spacePoint, (t) => tangents.push(t.clone()), options);
|
|
227693
|
+
return (tangents.length === 0) ? undefined : tangents;
|
|
227694
|
+
}
|
|
227695
|
+
/**
|
|
227696
|
+
* Return the point `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in
|
|
227697
|
+
* the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.
|
|
227698
|
+
* * See [[emitTangents]] for the definition of tangency employed.
|
|
227699
|
+
* @param spacePoint point in space.
|
|
227700
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
227701
|
+
* @returns the detail of the closest tangent point or undefined if no tangent was found.
|
|
227702
|
+
*/
|
|
227703
|
+
closestTangent(spacePoint, options) {
|
|
227704
|
+
const hint = options?.hintPoint ?? spacePoint;
|
|
227705
|
+
let toLocal;
|
|
227706
|
+
if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))
|
|
227707
|
+
toLocal = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);
|
|
227708
|
+
const measureHintDist2 = (pt) => {
|
|
227709
|
+
return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);
|
|
227710
|
+
};
|
|
227711
|
+
let closestTangent;
|
|
227712
|
+
let closestDist2 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.largeCoordinateResult;
|
|
227713
|
+
const collectClosestTangent = (tangent) => {
|
|
227714
|
+
const dist2 = measureHintDist2(tangent.point);
|
|
227715
|
+
if (!closestTangent || dist2 < closestDist2) {
|
|
227716
|
+
closestTangent = tangent.clone(closestTangent);
|
|
227717
|
+
closestDist2 = dist2;
|
|
227718
|
+
}
|
|
227719
|
+
};
|
|
227720
|
+
this.emitTangents(spacePoint, collectClosestTangent, options);
|
|
227721
|
+
return closestTangent;
|
|
227722
|
+
}
|
|
227428
227723
|
/**
|
|
227429
227724
|
* Find intervals of this curvePrimitive that are interior to a clipper
|
|
227430
227725
|
* @param clipper clip structure (e.g. clip planes)
|
|
@@ -227472,7 +227767,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
227472
227767
|
* @returns Return the number of CurveLocationDetail's added to the result array.
|
|
227473
227768
|
*/
|
|
227474
227769
|
appendPlaneIntersectionPoints(plane, result) {
|
|
227475
|
-
const strokeHandler = new
|
|
227770
|
+
const strokeHandler = new _internalContexts_AppendPlaneIntersectionStrokeHandler__WEBPACK_IMPORTED_MODULE_12__.AppendPlaneIntersectionStrokeHandler(plane, result);
|
|
227476
227771
|
const n0 = result.length;
|
|
227477
227772
|
this.emitStrokableParts(strokeHandler);
|
|
227478
227773
|
return result.length - n0;
|
|
@@ -227569,7 +227864,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
|
|
|
227569
227864
|
computeAndAttachRecursiveStrokeCounts(options, parentMap) {
|
|
227570
227865
|
const n = this.computeStrokeCountForOptions(options);
|
|
227571
227866
|
const a = this.curveLength();
|
|
227572
|
-
CurvePrimitive.installStrokeCountMap(this,
|
|
227867
|
+
CurvePrimitive.installStrokeCountMap(this, _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_13__.StrokeCountMap.createWithCurvePrimitive(this, n, a, 0, a), parentMap);
|
|
227573
227868
|
}
|
|
227574
227869
|
/**
|
|
227575
227870
|
* Evaluate strokes at fractions indicated in a StrokeCountMap.
|
|
@@ -229666,9 +229961,8 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePri
|
|
|
229666
229961
|
handler.startCurvePrimitive(this);
|
|
229667
229962
|
if (n > 1) {
|
|
229668
229963
|
const df = 1.0 / (n - 1);
|
|
229669
|
-
//
|
|
229670
|
-
//
|
|
229671
|
-
// Do NOT apply min strokes per primitive.
|
|
229964
|
+
// this is a line string; there is no need for chordTol and angleTol within a segment
|
|
229965
|
+
// DO NOT apply min strokes per primitive
|
|
229672
229966
|
if (options && options.hasMaxEdgeLength) {
|
|
229673
229967
|
for (let i = 1; i < n; i++) {
|
|
229674
229968
|
const numStroke = options.applyMaxEdgeLength(1, this._points.getPoint3dAtUncheckedPointIndex(i - 1).distance(this._points.getPoint3dAtUncheckedPointIndex(i)));
|
|
@@ -234597,6 +234891,204 @@ class UnionRegion extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveCol
|
|
|
234597
234891
|
}
|
|
234598
234892
|
|
|
234599
234893
|
|
|
234894
|
+
/***/ }),
|
|
234895
|
+
|
|
234896
|
+
/***/ "../../core/geometry/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js":
|
|
234897
|
+
/*!******************************************************************************************!*\
|
|
234898
|
+
!*** ../../core/geometry/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js ***!
|
|
234899
|
+
\******************************************************************************************/
|
|
234900
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
234901
|
+
|
|
234902
|
+
"use strict";
|
|
234903
|
+
__webpack_require__.r(__webpack_exports__);
|
|
234904
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
234905
|
+
/* harmony export */ AnnounceTangentStrokeHandler: () => (/* binding */ AnnounceTangentStrokeHandler)
|
|
234906
|
+
/* harmony export */ });
|
|
234907
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
234908
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
234909
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
234910
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
234911
|
+
/* harmony import */ var _numerics_Newton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../numerics/Newton */ "../../core/geometry/lib/esm/numerics/Newton.js");
|
|
234912
|
+
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
234913
|
+
/* harmony import */ var _NewtonRtoRStrokeHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NewtonRtoRStrokeHandler */ "../../core/geometry/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js");
|
|
234914
|
+
/*---------------------------------------------------------------------------------------------
|
|
234915
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
234916
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
234917
|
+
*--------------------------------------------------------------------------------------------*/
|
|
234918
|
+
/** @packageDocumentation
|
|
234919
|
+
* @module Curve
|
|
234920
|
+
*/
|
|
234921
|
+
|
|
234922
|
+
|
|
234923
|
+
|
|
234924
|
+
|
|
234925
|
+
|
|
234926
|
+
|
|
234927
|
+
|
|
234928
|
+
/**
|
|
234929
|
+
* Context for searching for the tangent(s) to a CurvePrimitive.
|
|
234930
|
+
* @internal
|
|
234931
|
+
*/
|
|
234932
|
+
class AnnounceTangentStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORTED_MODULE_1__.NewtonRtoRStrokeHandler {
|
|
234933
|
+
_curve;
|
|
234934
|
+
_announceTangent;
|
|
234935
|
+
_spacePoint;
|
|
234936
|
+
_vectorToEye;
|
|
234937
|
+
_distanceTol;
|
|
234938
|
+
_distanceTolSquared;
|
|
234939
|
+
// fraction and function value on one side of an interval that may bracket a root
|
|
234940
|
+
_fractionA = 0;
|
|
234941
|
+
_functionA = 0;
|
|
234942
|
+
// fraction and function value on the other side of an interval that may bracket a root
|
|
234943
|
+
_fractionB = 0;
|
|
234944
|
+
_functionB = 0;
|
|
234945
|
+
_numThisCurve = 0;
|
|
234946
|
+
// scratch vars to use within methods
|
|
234947
|
+
_fractionMRU;
|
|
234948
|
+
_curveMRU;
|
|
234949
|
+
_workRay;
|
|
234950
|
+
_workDetail;
|
|
234951
|
+
_newtonSolver;
|
|
234952
|
+
/** Constructor */
|
|
234953
|
+
constructor(spacePoint, announceTangent, options) {
|
|
234954
|
+
super();
|
|
234955
|
+
this._announceTangent = announceTangent;
|
|
234956
|
+
this._spacePoint = spacePoint;
|
|
234957
|
+
this._vectorToEye = options?.vectorToEye ?? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.unitZ();
|
|
234958
|
+
this._distanceTol = options?.distanceTol ?? _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance;
|
|
234959
|
+
this._distanceTolSquared = this._distanceTol * this._distanceTol;
|
|
234960
|
+
this._workRay = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_4__.Ray3d.createZero();
|
|
234961
|
+
this.startCurvePrimitive(undefined);
|
|
234962
|
+
this._newtonSolver = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_5__.Newton1dUnboundedApproximateDerivative(this);
|
|
234963
|
+
}
|
|
234964
|
+
/** Specified by IStrokeHandler. */
|
|
234965
|
+
needPrimaryGeometryForStrokes() {
|
|
234966
|
+
return true;
|
|
234967
|
+
}
|
|
234968
|
+
/** Specified by IStrokeHandler. */
|
|
234969
|
+
startCurvePrimitive(curve) {
|
|
234970
|
+
this._curve = curve;
|
|
234971
|
+
this._fractionA = 0.0;
|
|
234972
|
+
this._numThisCurve = 0;
|
|
234973
|
+
this._functionA = 0.0;
|
|
234974
|
+
}
|
|
234975
|
+
/** Specified by IStrokeHandler. */
|
|
234976
|
+
endCurvePrimitive() {
|
|
234977
|
+
}
|
|
234978
|
+
/** Specified by IStrokeHandler. */
|
|
234979
|
+
announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
|
|
234980
|
+
this.startCurvePrimitive(cp);
|
|
234981
|
+
if (numStrokes < 1)
|
|
234982
|
+
numStrokes = 1;
|
|
234983
|
+
const df = 1.0 / numStrokes;
|
|
234984
|
+
for (let i = 0; i <= numStrokes; i++) {
|
|
234985
|
+
const fraction = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fraction0, i * df, fraction1);
|
|
234986
|
+
cp.fractionToPointAndDerivative(fraction, this._workRay);
|
|
234987
|
+
this.announceRay(fraction, this._workRay);
|
|
234988
|
+
}
|
|
234989
|
+
}
|
|
234990
|
+
announceCandidate(cp, fraction, point) {
|
|
234991
|
+
if (this._parentCurvePrimitive)
|
|
234992
|
+
cp = this._parentCurvePrimitive;
|
|
234993
|
+
if (this._curveMRU === cp && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualOptional(this._fractionMRU, fraction, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallFloatingPoint))
|
|
234994
|
+
return; // avoid announcing duplicate tangents in succession (e.g., at interior stroke point)
|
|
234995
|
+
this._workDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._workDetail);
|
|
234996
|
+
this._announceTangent(this._workDetail);
|
|
234997
|
+
this._fractionMRU = fraction;
|
|
234998
|
+
this._curveMRU = cp;
|
|
234999
|
+
}
|
|
235000
|
+
/** Specified by IStrokeHandler. */
|
|
235001
|
+
announceSegmentInterval(cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
235002
|
+
let fraction;
|
|
235003
|
+
let point;
|
|
235004
|
+
const distance0 = this._spacePoint.distanceSquared(point0);
|
|
235005
|
+
const distance1 = this._spacePoint.distanceSquared(point1);
|
|
235006
|
+
if (distance0 < distance1) {
|
|
235007
|
+
fraction = fraction0;
|
|
235008
|
+
point = point0;
|
|
235009
|
+
}
|
|
235010
|
+
else {
|
|
235011
|
+
fraction = fraction1;
|
|
235012
|
+
point = point1;
|
|
235013
|
+
}
|
|
235014
|
+
// evaluate at midpoint; the endpoints may be at corners, which have ambiguous tangent
|
|
235015
|
+
const value = this.evaluateFunction(undefined, (fraction0 + fraction1) / 2, cp);
|
|
235016
|
+
if (value !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol(value, this._distanceTol))
|
|
235017
|
+
this.announceCandidate(cp, fraction, point);
|
|
235018
|
+
}
|
|
235019
|
+
/**
|
|
235020
|
+
* Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this
|
|
235021
|
+
* fractional interval.
|
|
235022
|
+
* * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and
|
|
235023
|
+
* `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke
|
|
235024
|
+
* segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,
|
|
235025
|
+
* this method can miss a root of `f`.
|
|
235026
|
+
*/
|
|
235027
|
+
searchInterval() {
|
|
235028
|
+
// directly announce at endpoint if we are extra certain it's a root; Newton can miss it if it has multiplicity > 1
|
|
235029
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol(this._functionA, this._distanceTolSquared))
|
|
235030
|
+
this.announceSolutionFraction(this._fractionA);
|
|
235031
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol(this._functionB, this._distanceTolSquared))
|
|
235032
|
+
this.announceSolutionFraction(this._fractionB);
|
|
235033
|
+
if (this._functionA * this._functionB < 0) {
|
|
235034
|
+
// by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.
|
|
235035
|
+
const fraction = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);
|
|
235036
|
+
if (fraction) {
|
|
235037
|
+
this._newtonSolver.setX(fraction);
|
|
235038
|
+
if (this._newtonSolver.runIterations())
|
|
235039
|
+
this.announceSolutionFraction(this._newtonSolver.getX());
|
|
235040
|
+
}
|
|
235041
|
+
}
|
|
235042
|
+
}
|
|
235043
|
+
announceSolutionFraction(fraction) {
|
|
235044
|
+
if (this._curve)
|
|
235045
|
+
this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));
|
|
235046
|
+
}
|
|
235047
|
+
/**
|
|
235048
|
+
* Evaluate the univariate real-valued function for which we are finding roots.
|
|
235049
|
+
* * For finding the tangents to curve `X` from point `Q` as seen in a view plane with normal `N`, this
|
|
235050
|
+
* function is `f(t) := (Q - X(t)) dot (X'(t) cross N)`. The second vector in the dot product defines a
|
|
235051
|
+
* _tangent plane_ at `X(t)`.
|
|
235052
|
+
* * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.
|
|
235053
|
+
* @param pointAndDerivative pre-evaluated curve
|
|
235054
|
+
* @param fraction fraction at which to evaluate `curve`
|
|
235055
|
+
* @param curve curve to evaluate at `fraction`
|
|
235056
|
+
* @returns distance of `Q` from the tangent plane at `X(t)`.
|
|
235057
|
+
*/
|
|
235058
|
+
evaluateFunction(pointAndDerivative, fraction, curve) {
|
|
235059
|
+
if (pointAndDerivative)
|
|
235060
|
+
this._workRay.setFrom(pointAndDerivative);
|
|
235061
|
+
else if (fraction !== undefined && curve)
|
|
235062
|
+
this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);
|
|
235063
|
+
else
|
|
235064
|
+
return undefined;
|
|
235065
|
+
const cross = this._vectorToEye.unitCrossProduct(this._workRay.direction); // normalized so we return true distance
|
|
235066
|
+
return cross ? cross.dotProductStartEnd(this._workRay.origin, this._spacePoint) : undefined;
|
|
235067
|
+
}
|
|
235068
|
+
/** Specified by NewtonRtoRStrokeHandler. */
|
|
235069
|
+
evaluate(fraction) {
|
|
235070
|
+
const curve = this._parentCurvePrimitive ?? this._curve;
|
|
235071
|
+
const value = this.evaluateFunction(undefined, fraction, curve);
|
|
235072
|
+
if (value === undefined)
|
|
235073
|
+
return false;
|
|
235074
|
+
this.currentF = value;
|
|
235075
|
+
return true;
|
|
235076
|
+
}
|
|
235077
|
+
announceRay(fraction, data) {
|
|
235078
|
+
this._functionB = this.evaluateFunction(data);
|
|
235079
|
+
this._fractionB = fraction;
|
|
235080
|
+
if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval
|
|
235081
|
+
this.searchInterval();
|
|
235082
|
+
this._functionA = this._functionB;
|
|
235083
|
+
this._fractionA = this._fractionB;
|
|
235084
|
+
}
|
|
235085
|
+
/** Specified by IStrokeHandler. */
|
|
235086
|
+
announcePointTangent(_point, _fraction, _tangent) {
|
|
235087
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "No callers expected. IStrokeHandler probably didn't need to specify this method.");
|
|
235088
|
+
}
|
|
235089
|
+
}
|
|
235090
|
+
|
|
235091
|
+
|
|
234600
235092
|
/***/ }),
|
|
234601
235093
|
|
|
234602
235094
|
/***/ "../../core/geometry/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js":
|
|
@@ -235137,22 +235629,25 @@ class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORT
|
|
|
235137
235629
|
_closestPoint;
|
|
235138
235630
|
_spacePoint;
|
|
235139
235631
|
_extend;
|
|
235632
|
+
// fraction and function value on one side of an interval that may bracket a root
|
|
235140
235633
|
_fractionA = 0;
|
|
235141
235634
|
_functionA = 0;
|
|
235142
|
-
|
|
235635
|
+
// fraction and function value on the other side of an interval that may bracket a root
|
|
235143
235636
|
_fractionB = 0;
|
|
235637
|
+
_functionB = 0;
|
|
235144
235638
|
_numThisCurve = 0;
|
|
235145
|
-
// scratch vars
|
|
235639
|
+
// scratch vars to use within methods
|
|
235146
235640
|
_workPoint;
|
|
235147
235641
|
_workRay;
|
|
235148
235642
|
_newtonSolver;
|
|
235643
|
+
/** Constructor */
|
|
235149
235644
|
constructor(spacePoint, extend, result) {
|
|
235150
235645
|
super();
|
|
235151
235646
|
this._spacePoint = spacePoint;
|
|
235152
235647
|
this._workPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
235153
235648
|
this._workRay = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
|
|
235154
235649
|
this._closestPoint = result;
|
|
235155
|
-
this._extend = extend;
|
|
235650
|
+
this._extend = extend ?? false;
|
|
235156
235651
|
this.startCurvePrimitive(undefined);
|
|
235157
235652
|
this._newtonSolver = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_3__.Newton1dUnboundedApproximateDerivative(this);
|
|
235158
235653
|
}
|
|
@@ -235203,7 +235698,7 @@ class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORT
|
|
|
235203
235698
|
}
|
|
235204
235699
|
announceSegmentInterval(cp, point0, point1, _numStrokes, fraction0, fraction1) {
|
|
235205
235700
|
let localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);
|
|
235206
|
-
// only consider extending the segment if the immediate caller says we are at endpoints
|
|
235701
|
+
// only consider extending the segment if the immediate caller says we are at endpoints
|
|
235207
235702
|
if (!this._extend)
|
|
235208
235703
|
localFraction = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.clampToStartEnd(localFraction, 0.0, 1.0);
|
|
235209
235704
|
else {
|
|
@@ -235216,13 +235711,22 @@ class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORT
|
|
|
235216
235711
|
const globalFraction = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.interpolate(fraction0, localFraction, fraction1);
|
|
235217
235712
|
this.announceCandidate(cp, globalFraction, this._workPoint);
|
|
235218
235713
|
}
|
|
235714
|
+
/**
|
|
235715
|
+
* Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this
|
|
235716
|
+
* fractional interval.
|
|
235717
|
+
* * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and
|
|
235718
|
+
* `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke
|
|
235719
|
+
* segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,
|
|
235720
|
+
* this method can miss a root of `f`.
|
|
235721
|
+
*/
|
|
235219
235722
|
searchInterval() {
|
|
235220
235723
|
if (this._functionA * this._functionB > 0)
|
|
235221
|
-
return;
|
|
235724
|
+
return; // stroke segment has no root; ASSUME the function has no root either
|
|
235222
235725
|
if (this._functionA === 0)
|
|
235223
235726
|
this.announceSolutionFraction(this._fractionA);
|
|
235224
235727
|
if (this._functionB === 0)
|
|
235225
235728
|
this.announceSolutionFraction(this._fractionB);
|
|
235729
|
+
// by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.
|
|
235226
235730
|
if (this._functionA * this._functionB < 0) {
|
|
235227
235731
|
const fraction = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);
|
|
235228
235732
|
if (fraction) {
|
|
@@ -235232,28 +235736,41 @@ class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORT
|
|
|
235232
235736
|
}
|
|
235233
235737
|
}
|
|
235234
235738
|
}
|
|
235235
|
-
evaluateB(fractionB, dataB) {
|
|
235236
|
-
this._functionB = dataB.dotProductToPoint(this._spacePoint);
|
|
235237
|
-
this._fractionB = fractionB;
|
|
235238
|
-
}
|
|
235239
235739
|
announceSolutionFraction(fraction) {
|
|
235240
235740
|
if (this._curve)
|
|
235241
235741
|
this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));
|
|
235242
235742
|
}
|
|
235743
|
+
/**
|
|
235744
|
+
* Evaluate the univariate real-valued function for which we are finding roots.
|
|
235745
|
+
* * For finding the closest point to curve X from point Q, this function is `f(t) := Q-X(t) dot X'(t)`.
|
|
235746
|
+
* * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.
|
|
235747
|
+
* @param pointAndDerivative pre-evaluated curve
|
|
235748
|
+
* @param fraction fraction at which to evaluate `curve`
|
|
235749
|
+
* @param curve curve to evaluate at `fraction`
|
|
235750
|
+
*/
|
|
235751
|
+
evaluateFunction(pointAndDerivative, fraction, curve) {
|
|
235752
|
+
if (pointAndDerivative)
|
|
235753
|
+
this._workRay.setFrom(pointAndDerivative);
|
|
235754
|
+
else if (fraction !== undefined && curve)
|
|
235755
|
+
this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);
|
|
235756
|
+
else
|
|
235757
|
+
return undefined;
|
|
235758
|
+
return this._workRay.dotProductToPoint(this._spacePoint);
|
|
235759
|
+
}
|
|
235243
235760
|
evaluate(fraction) {
|
|
235244
235761
|
let curve = this._curve;
|
|
235245
235762
|
if (this._parentCurvePrimitive)
|
|
235246
235763
|
curve = this._parentCurvePrimitive;
|
|
235247
|
-
|
|
235248
|
-
|
|
235249
|
-
|
|
235250
|
-
|
|
235251
|
-
|
|
235252
|
-
return false;
|
|
235764
|
+
const value = this.evaluateFunction(undefined, fraction, curve);
|
|
235765
|
+
if (value === undefined)
|
|
235766
|
+
return false;
|
|
235767
|
+
this.currentF = value;
|
|
235768
|
+
return true;
|
|
235253
235769
|
}
|
|
235254
235770
|
announceRay(fraction, data) {
|
|
235255
|
-
this.
|
|
235256
|
-
|
|
235771
|
+
this._functionB = this.evaluateFunction(data);
|
|
235772
|
+
this._fractionB = fraction;
|
|
235773
|
+
if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval
|
|
235257
235774
|
this.searchInterval();
|
|
235258
235775
|
this._functionA = this._functionB;
|
|
235259
235776
|
this._fractionA = this._fractionB;
|
|
@@ -239713,7 +240230,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
239713
240230
|
* @module Curve
|
|
239714
240231
|
*/
|
|
239715
240232
|
|
|
239716
|
-
/**
|
|
240233
|
+
/**
|
|
240234
|
+
* Intermediate class for managing the parentCurve announcements from an IStrokeHandler.
|
|
239717
240235
|
* @internal
|
|
239718
240236
|
*/
|
|
239719
240237
|
class NewtonRtoRStrokeHandler extends _numerics_Newton__WEBPACK_IMPORTED_MODULE_0__.NewtonEvaluatorRtoR {
|
|
@@ -239722,10 +240240,11 @@ class NewtonRtoRStrokeHandler extends _numerics_Newton__WEBPACK_IMPORTED_MODULE_
|
|
|
239722
240240
|
super();
|
|
239723
240241
|
this._parentCurvePrimitive = undefined;
|
|
239724
240242
|
}
|
|
239725
|
-
/**
|
|
240243
|
+
/**
|
|
240244
|
+
* Retain the parentCurvePrimitive.
|
|
239726
240245
|
* * Calling this method tells the handler that the parent curve is to be used for detail searches.
|
|
239727
240246
|
* * Example: Transition spiral search is based on linestring first, then the exact spiral.
|
|
239728
|
-
* * Example: CurveChainWithDistanceIndex does NOT do this announcement
|
|
240247
|
+
* * Example: CurveChainWithDistanceIndex does NOT do this announcement; the constituents act independently.
|
|
239729
240248
|
*/
|
|
239730
240249
|
startParentCurvePrimitive(curve) {
|
|
239731
240250
|
this._parentCurvePrimitive = curve;
|
|
@@ -243896,7 +244415,7 @@ class AngleSweep {
|
|
|
243896
244415
|
}
|
|
243897
244416
|
/** Read-property for signed start-to-end sweep in degrees. */
|
|
243898
244417
|
get sweepDegrees() {
|
|
243899
|
-
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.
|
|
244418
|
+
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.sweepRadians);
|
|
243900
244419
|
}
|
|
243901
244420
|
/** Read-property for degrees at the start of this AngleSweep. */
|
|
243902
244421
|
get startRadians() {
|
|
@@ -244075,20 +244594,20 @@ class AngleSweep {
|
|
|
244075
244594
|
/** Convert fractional position in the sweep to radians. */
|
|
244076
244595
|
fractionToRadians(fraction) {
|
|
244077
244596
|
return fraction < 0.5 ?
|
|
244078
|
-
this._radians0 + fraction *
|
|
244079
|
-
this._radians1 + (fraction - 1.0) *
|
|
244597
|
+
this._radians0 + fraction * this.sweepRadians :
|
|
244598
|
+
this._radians1 + (fraction - 1.0) * this.sweepRadians;
|
|
244080
244599
|
}
|
|
244081
244600
|
/** Convert fractional position in the sweep to strongly typed Angle object. */
|
|
244082
244601
|
fractionToAngle(fraction) {
|
|
244083
244602
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.createRadians(this.fractionToRadians(fraction));
|
|
244084
244603
|
}
|
|
244085
244604
|
/**
|
|
244086
|
-
* Return 2PI divided by the sweep radians
|
|
244605
|
+
* Return 2PI divided by the sweep radians.
|
|
244087
244606
|
* * This is the number of fractional intervals required to cover a whole circle.
|
|
244088
244607
|
* @returns period of the sweep, or 1 if sweep is empty.
|
|
244089
244608
|
*/
|
|
244090
244609
|
fractionPeriod() {
|
|
244091
|
-
return this.isEmpty ? 1.0 : _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.pi2Radians / Math.abs(this.
|
|
244610
|
+
return this.isEmpty ? 1.0 : _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.pi2Radians / Math.abs(this.sweepRadians);
|
|
244092
244611
|
}
|
|
244093
244612
|
/**
|
|
244094
244613
|
* Return the fractionalized position of the given angle (as Angle) computed without consideration of
|
|
@@ -244104,7 +244623,7 @@ class AngleSweep {
|
|
|
244104
244623
|
* @returns unbounded fraction, or 1 if sweep is empty.
|
|
244105
244624
|
*/
|
|
244106
244625
|
angleToUnboundedFraction(theta) {
|
|
244107
|
-
return this.isEmpty ? 1.0 : (theta.radians - this._radians0) /
|
|
244626
|
+
return this.isEmpty ? 1.0 : (theta.radians - this._radians0) / this.sweepRadians;
|
|
244108
244627
|
}
|
|
244109
244628
|
/**
|
|
244110
244629
|
* Convert a sweep fraction to the equivalent period-shifted fraction inside the sweep, or within one period of zero
|
|
@@ -244398,7 +244917,7 @@ class AngleSweep {
|
|
|
244398
244917
|
isAlmostEqualAllowPeriodShift(other, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians) {
|
|
244399
244918
|
return this.isCCW === other.isCCW // this rules out equating opposite sweeps like [0,-100] and [0,260]
|
|
244400
244919
|
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this._radians0, other._radians0, radianTol)
|
|
244401
|
-
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this.
|
|
244920
|
+
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansAllowPeriodShift(this.sweepRadians, other.sweepRadians, radianTol);
|
|
244402
244921
|
}
|
|
244403
244922
|
/**
|
|
244404
244923
|
* Test if two angle sweeps match within the given tolerance.
|
|
@@ -244408,7 +244927,7 @@ class AngleSweep {
|
|
|
244408
244927
|
*/
|
|
244409
244928
|
isAlmostEqualNoPeriodShift(other, radianTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleRadians) {
|
|
244410
244929
|
return _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this._radians0, other._radians0, radianTol)
|
|
244411
|
-
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this.
|
|
244930
|
+
&& _Angle__WEBPACK_IMPORTED_MODULE_0__.Angle.isAlmostEqualRadiansNoPeriodShift(this.sweepRadians, other.sweepRadians, radianTol);
|
|
244412
244931
|
}
|
|
244413
244932
|
/**
|
|
244414
244933
|
* Test if start and end angles match with radians tolerance.
|
|
@@ -253093,28 +253612,27 @@ class Matrix3d {
|
|
|
253093
253612
|
return count === 3;
|
|
253094
253613
|
}
|
|
253095
253614
|
/**
|
|
253096
|
-
* Adjust the matrix in place to make
|
|
253097
|
-
* *
|
|
253098
|
-
* *
|
|
253099
|
-
*
|
|
253100
|
-
*
|
|
253101
|
-
* @param axisOrder how to reorder the matrix columns
|
|
253102
|
-
* @return whether the adjusted matrix is `rigid` on return
|
|
253615
|
+
* Adjust the matrix in place to make it rigid:
|
|
253616
|
+
* * Columns are perpendicular and have unit length.
|
|
253617
|
+
* * Transpose equals inverse.
|
|
253618
|
+
* @param axisOrder how to reorder the matrix columns. A left-handed ordering will return a mirror.
|
|
253619
|
+
* @return whether the adjusted matrix is rigid on return
|
|
253103
253620
|
*/
|
|
253104
253621
|
makeRigid(axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ) {
|
|
253105
253622
|
const maxAbs = this.maxAbs();
|
|
253106
253623
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(maxAbs))
|
|
253107
253624
|
return false;
|
|
253108
253625
|
const scale = 1.0 / maxAbs;
|
|
253109
|
-
this.scaleColumnsInPlace(scale, scale, scale);
|
|
253626
|
+
this.scaleColumnsInPlace(scale, scale, scale); // improve numerical stability
|
|
253110
253627
|
this.axisOrderCrossProductsInPlace(axisOrder);
|
|
253111
253628
|
return this.normalizeColumnsInPlace();
|
|
253112
253629
|
}
|
|
253113
253630
|
/**
|
|
253114
|
-
* Create a new orthogonal matrix
|
|
253115
|
-
*
|
|
253116
|
-
*
|
|
253117
|
-
*
|
|
253631
|
+
* Create a new orthogonal matrix by calling [[makeRigid]] on a clone of `source`.
|
|
253632
|
+
* @param source input matrix
|
|
253633
|
+
* @param axisOrder how to reorder the matrix columns. A left-handed ordering will return a mirror.
|
|
253634
|
+
* @param result optional preallocated result to populate and return
|
|
253635
|
+
* @returns rigid matrix, or `undefined` if the operation failed.
|
|
253118
253636
|
*/
|
|
253119
253637
|
static createRigidFromMatrix3d(source, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ, result) {
|
|
253120
253638
|
result = source.clone(result);
|
|
@@ -274164,7 +274682,7 @@ class FacetOrientationFixup {
|
|
|
274164
274682
|
_facetOrientation;
|
|
274165
274683
|
_components;
|
|
274166
274684
|
_visitor;
|
|
274167
|
-
_mesh;
|
|
274685
|
+
_mesh; // we could get by with just a Polyface/Visitor but for the call to reverseSingleFacet
|
|
274168
274686
|
constructor(mesh) {
|
|
274169
274687
|
this._visitor = mesh.createVisitor(1);
|
|
274170
274688
|
this._edges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_0__.PolyfaceQuery.createIndexedEdges(this._visitor);
|
|
@@ -279656,6 +280174,7 @@ class PolyfaceData {
|
|
|
279656
280174
|
if (this.colorIndex !== this.pointIndex)
|
|
279657
280175
|
PolyfaceData.reverseIndices(facetStartIndex, this.colorIndex, true);
|
|
279658
280176
|
PolyfaceData.reverseIndices(facetStartIndex, this.edgeVisible, false);
|
|
280177
|
+
// TODO: reverse auxData.indices, edgeMateIndex
|
|
279659
280178
|
}
|
|
279660
280179
|
}
|
|
279661
280180
|
/**
|
|
@@ -279675,6 +280194,7 @@ class PolyfaceData {
|
|
|
279675
280194
|
if (this.colorIndex !== this.pointIndex)
|
|
279676
280195
|
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.colorIndex, true);
|
|
279677
280196
|
PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.edgeVisible, false);
|
|
280197
|
+
// TODO: reverse auxData.indices, edgeMateIndex
|
|
279678
280198
|
}
|
|
279679
280199
|
/** Scale all the normals by -1. */
|
|
279680
280200
|
reverseNormals() {
|
|
@@ -305055,12 +305575,12 @@ class Triangulator {
|
|
|
305055
305575
|
* * Return false if clearly negative or almost zero.
|
|
305056
305576
|
* @param nodeA node on the diagonal edge of candidate for edge flip.
|
|
305057
305577
|
*/
|
|
305058
|
-
static
|
|
305578
|
+
static computeCircumcircleDeterminantIsStrongPositive(nodeA) {
|
|
305059
305579
|
// Assume triangle A1,A2,B2 is ccw.
|
|
305060
305580
|
// Shift the triangle to the origin (by negated A coords).
|
|
305061
305581
|
// The Delaunay condition is computed by projecting the origin and the shifted triangle
|
|
305062
305582
|
// points up to the paraboloid z = x*x + y*y. Due to the radially symmetric convexity of
|
|
305063
|
-
// this surface and the ccw orientation of this triangle, "A is inside triangle A1,A2,B2"
|
|
305583
|
+
// this surface and the ccw orientation of this triangle, "A is inside the circumcircle of triangle A1,A2,B2"
|
|
305064
305584
|
// is equivalent to "the volume of the parallelepiped formed by the projected points is
|
|
305065
305585
|
// negative, as computed by the triple product."
|
|
305066
305586
|
const nodeA1 = nodeA.faceSuccessor;
|
|
@@ -305093,7 +305613,7 @@ class Triangulator {
|
|
|
305093
305613
|
}
|
|
305094
305614
|
/**
|
|
305095
305615
|
* * Visit each node of the graph array
|
|
305096
|
-
* * If a flip would be possible, test the results of flipping using
|
|
305616
|
+
* * If a flip would be possible, test the results of flipping using circumcircle condition
|
|
305097
305617
|
* * If revealed to be an improvement, conduct the flip, mark involved nodes as unvisited, and repeat until all nodes are visited
|
|
305098
305618
|
*/
|
|
305099
305619
|
static flipTriangles(graph) {
|
|
@@ -305106,7 +305626,7 @@ class Triangulator {
|
|
|
305106
305626
|
}
|
|
305107
305627
|
/**
|
|
305108
305628
|
* * Visit each node of the graph array
|
|
305109
|
-
* * If a flip would be possible, test the results of flipping using
|
|
305629
|
+
* * If a flip would be possible, test the results of flipping using circumcircle condition
|
|
305110
305630
|
* * If revealed to be an improvement, conduct the flip, mark involved nodes as unvisited, and repeat until all nodes are visited
|
|
305111
305631
|
*/
|
|
305112
305632
|
static flipTrianglesInEdgeSet(graph, edgeSet) {
|
|
@@ -305119,7 +305639,7 @@ class Triangulator {
|
|
|
305119
305639
|
while (undefined !== (node = edgeSet.chooseAndRemoveAny())) {
|
|
305120
305640
|
if (node.isMaskSet(barrierMasks)) // Flip not allowed
|
|
305121
305641
|
continue;
|
|
305122
|
-
if (Triangulator.
|
|
305642
|
+
if (Triangulator.computeCircumcircleDeterminantIsStrongPositive(node)) {
|
|
305123
305643
|
// Flip the triangles
|
|
305124
305644
|
Triangulator.flipEdgeBetweenTriangles(node.edgeMate.faceSuccessor, node.edgeMate.facePredecessor, node.edgeMate, node.faceSuccessor, node, node.facePredecessor);
|
|
305125
305645
|
// keep looking at the 2 faces
|
|
@@ -305470,7 +305990,7 @@ class Triangulator {
|
|
|
305470
305990
|
// triangle B1 A1 D is on the other side of AB
|
|
305471
305991
|
// The condition for flipping is:
|
|
305472
305992
|
// ! both triangles must be TRIANGULATED_NODE_MASK
|
|
305473
|
-
// !
|
|
305993
|
+
// ! circumcircle condition flags D as in the circle of ABC
|
|
305474
305994
|
// after flip, node A moves to the vertex of D, and is the effective "ear", with the cap edge C A1
|
|
305475
305995
|
// after flip, consider the A1 D (whose nodes are A1 and flipped A!!!)
|
|
305476
305996
|
//
|
|
@@ -305490,7 +306010,7 @@ class Triangulator {
|
|
|
305490
306010
|
let a0 = b0.facePredecessor;
|
|
305491
306011
|
let b1 = a0.edgeMate;
|
|
305492
306012
|
while (Triangulator.isInteriorTriangle(a0) && Triangulator.isInteriorTriangle(b1)) {
|
|
305493
|
-
const detA = Triangulator.
|
|
306013
|
+
const detA = Triangulator.computeCircumcircleDeterminantIsStrongPositive(a0);
|
|
305494
306014
|
if (!detA)
|
|
305495
306015
|
break;
|
|
305496
306016
|
// Flip the triangles
|
|
@@ -328001,7 +328521,7 @@ class TestContext {
|
|
|
328001
328521
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
328002
328522
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
328003
328523
|
await core_frontend_1.NoRenderApp.startup({
|
|
328004
|
-
applicationVersion: "5.0.0-dev.
|
|
328524
|
+
applicationVersion: "5.0.0-dev.106",
|
|
328005
328525
|
applicationId: this.settings.gprid,
|
|
328006
328526
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
328007
328527
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -353045,7 +353565,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
353045
353565
|
/***/ ((module) => {
|
|
353046
353566
|
|
|
353047
353567
|
"use strict";
|
|
353048
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
353568
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.106","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:*"},"//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/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"}}');
|
|
353049
353569
|
|
|
353050
353570
|
/***/ }),
|
|
353051
353571
|
|