@itwin/ecschema-rpcinterface-tests 5.1.0-dev.20 → 5.1.0-dev.25
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 +583 -351
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -170822,6 +170822,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
170822
170822
|
/* harmony import */ var _SelectTool__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SelectTool */ "../../core/frontend/lib/esm/tools/SelectTool.js");
|
|
170823
170823
|
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
170824
170824
|
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
170825
|
+
/* harmony import */ var _ToolSettings__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ToolSettings */ "../../core/frontend/lib/esm/tools/ToolSettings.js");
|
|
170825
170826
|
/*---------------------------------------------------------------------------------------------
|
|
170826
170827
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
170827
170828
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -170842,6 +170843,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
170842
170843
|
|
|
170843
170844
|
|
|
170844
170845
|
|
|
170846
|
+
|
|
170845
170847
|
/** Identifies the source of the elements in the agenda.
|
|
170846
170848
|
* @public
|
|
170847
170849
|
*/
|
|
@@ -171239,12 +171241,105 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
|
|
|
171239
171241
|
await this.onAgendaModified();
|
|
171240
171242
|
return true;
|
|
171241
171243
|
}
|
|
171242
|
-
/** Get
|
|
171243
|
-
|
|
171244
|
-
|
|
171245
|
-
|
|
171244
|
+
/** Get ids of spatial elements to process from a clip volume created by drag box selection. */
|
|
171245
|
+
static async getVolumeSelectionCandidates(vp, origin, corner, allowOverlaps, filter) {
|
|
171246
|
+
const contents = new Set();
|
|
171247
|
+
if (!vp.view.isSpatialView())
|
|
171248
|
+
return contents;
|
|
171249
|
+
const boxRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range2d.createXYXY(origin.x, origin.y, corner.x, corner.y);
|
|
171250
|
+
if (boxRange.isNull || boxRange.isAlmostZeroX || boxRange.isAlmostZeroY)
|
|
171251
|
+
return contents;
|
|
171252
|
+
const getClipPlane = (viewPt, viewDir, negate) => {
|
|
171253
|
+
const point = vp.viewToWorld(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.createFrom(viewPt));
|
|
171254
|
+
const boresite = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.getBoresite(point, vp);
|
|
171255
|
+
const normal = viewDir.crossProduct(boresite.direction);
|
|
171256
|
+
if (negate)
|
|
171257
|
+
normal.negate(normal);
|
|
171258
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPlane.createNormalAndPoint(normal, point);
|
|
171259
|
+
};
|
|
171260
|
+
const planeSet = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ConvexClipPlaneSet.createEmpty();
|
|
171261
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.low, vp.rotation.rowX(), true));
|
|
171262
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.low, vp.rotation.rowY(), true));
|
|
171263
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.high, vp.rotation.rowX(), false));
|
|
171264
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.high, vp.rotation.rowY(), false));
|
|
171265
|
+
if (0 === planeSet.planes.length)
|
|
171266
|
+
return contents;
|
|
171267
|
+
const clip = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipVector.createCapture([_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPrimitive.createCapture(planeSet)]);
|
|
171268
|
+
const viewRange = vp.computeViewRange();
|
|
171269
|
+
const range = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipUtilities.rangeOfClipperIntersectionWithRange(clip, viewRange);
|
|
171270
|
+
if (range.isNull)
|
|
171271
|
+
return contents;
|
|
171272
|
+
// TODO: Possible to make UnionOfComplexClipPlaneSets from view clip and planes work and remove 2nd containment check?
|
|
171273
|
+
const viewClip = (vp.viewFlags.clipVolume ? vp.view.getViewClip()?.clone() : undefined);
|
|
171274
|
+
if (viewClip) {
|
|
171275
|
+
const viewClipRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipUtilities.rangeOfClipperIntersectionWithRange(viewClip, viewRange);
|
|
171276
|
+
if (viewClipRange.isNull || !viewClipRange.intersectsRange(range))
|
|
171277
|
+
return contents;
|
|
171278
|
+
}
|
|
171279
|
+
const candidates = [];
|
|
171280
|
+
const categories = new Set();
|
|
171281
|
+
try {
|
|
171282
|
+
const viewedModels = [...vp.view.modelSelector.models].join(",");
|
|
171283
|
+
const viewedCategories = [...vp.view.categorySelector.categories].join(",");
|
|
171284
|
+
const ecsql = `SELECT e.ECInstanceId, Category.Id as category FROM bis.SpatialElement e JOIN bis.SpatialIndex i ON e.ECInstanceId=i.ECInstanceId WHERE Model.Id IN (${viewedModels}) AND Category.Id IN (${viewedCategories}) AND i.MinX <= ${range.xHigh} AND i.MinY <= ${range.yHigh} AND i.MinZ <= ${range.zHigh} AND i.MaxX >= ${range.xLow} AND i.MaxY >= ${range.yLow} AND i.MaxZ >= ${range.zLow}`;
|
|
171285
|
+
const reader = vp.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames });
|
|
171286
|
+
for await (const row of reader) {
|
|
171287
|
+
candidates.push(row.ECInstanceId);
|
|
171288
|
+
categories.add(row.category);
|
|
171289
|
+
}
|
|
171290
|
+
}
|
|
171291
|
+
catch { }
|
|
171292
|
+
if (0 === candidates.length)
|
|
171293
|
+
return contents;
|
|
171294
|
+
let offSubCategories;
|
|
171295
|
+
if (0 !== categories.size) {
|
|
171296
|
+
for (const categoryId of categories) {
|
|
171297
|
+
const subcategories = vp.iModel.subcategories.getSubCategories(categoryId);
|
|
171298
|
+
if (undefined === subcategories)
|
|
171299
|
+
continue;
|
|
171300
|
+
for (const subCategoryId of subcategories) {
|
|
171301
|
+
const appearance = vp.iModel.subcategories.getSubCategoryAppearance(subCategoryId);
|
|
171302
|
+
if (undefined === appearance || (!appearance.invisible && !appearance.dontLocate))
|
|
171303
|
+
continue;
|
|
171304
|
+
if (undefined === offSubCategories)
|
|
171305
|
+
offSubCategories = new Array;
|
|
171306
|
+
offSubCategories.push(subCategoryId);
|
|
171307
|
+
}
|
|
171308
|
+
}
|
|
171309
|
+
}
|
|
171310
|
+
const requestProps = {
|
|
171311
|
+
candidates,
|
|
171312
|
+
clip: clip.toJSON(),
|
|
171313
|
+
allowOverlaps,
|
|
171314
|
+
viewFlags: vp.viewFlags.toJSON(),
|
|
171315
|
+
offSubCategories,
|
|
171316
|
+
};
|
|
171317
|
+
const result = await vp.iModel.getGeometryContainment(requestProps);
|
|
171318
|
+
if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS !== result.status || undefined === result.candidatesContainment)
|
|
171319
|
+
return contents;
|
|
171320
|
+
result.candidatesContainment.forEach((status, index) => {
|
|
171321
|
+
if (_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPlaneContainment.StronglyOutside !== status && (undefined === filter || filter(candidates[index])))
|
|
171322
|
+
contents.add(candidates[index]);
|
|
171323
|
+
});
|
|
171324
|
+
if (0 !== contents.size && viewClip) {
|
|
171325
|
+
requestProps.clip = viewClip.toJSON();
|
|
171326
|
+
requestProps.candidates.length = 0;
|
|
171327
|
+
for (const id of contents)
|
|
171328
|
+
requestProps.candidates.push(id);
|
|
171329
|
+
contents.clear();
|
|
171330
|
+
const resultViewClip = await vp.iModel.getGeometryContainment(requestProps);
|
|
171331
|
+
if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS !== resultViewClip.status || undefined === resultViewClip.candidatesContainment)
|
|
171332
|
+
return contents;
|
|
171333
|
+
resultViewClip.candidatesContainment.forEach((status, index) => {
|
|
171334
|
+
if (_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPlaneContainment.StronglyOutside !== status)
|
|
171335
|
+
contents.add(candidates[index]);
|
|
171336
|
+
});
|
|
171337
|
+
}
|
|
171338
|
+
return contents;
|
|
171339
|
+
}
|
|
171340
|
+
/** Get ids of visible elements to process from drag box or crossing line selection. */
|
|
171341
|
+
static getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter) {
|
|
171246
171342
|
let contents = new Set();
|
|
171247
|
-
// TODO: Include option to use IModelConnection.getGeometryContainment instead of readPixels. No/Yes/2dOnly...
|
|
171248
171343
|
const pts = [];
|
|
171249
171344
|
pts[0] = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point2d(Math.floor(origin.x + 0.5), Math.floor(origin.y + 0.5));
|
|
171250
171345
|
pts[1] = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point2d(Math.floor(corner.x + 0.5), Math.floor(corner.y + 0.5));
|
|
@@ -171267,12 +171362,12 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
|
|
|
171267
171362
|
return undefined; // no geometry at this location...
|
|
171268
171363
|
if (!vp.isPixelSelectable(pixel))
|
|
171269
171364
|
return undefined; // reality model, terrain, etc - not selectable
|
|
171270
|
-
if (!
|
|
171365
|
+
if (undefined !== filter && !filter(pixel.elementId))
|
|
171271
171366
|
return undefined;
|
|
171272
171367
|
return pixel.elementId;
|
|
171273
171368
|
};
|
|
171274
171369
|
if (_SelectTool__WEBPACK_IMPORTED_MODULE_10__.SelectionMethod.Box === method) {
|
|
171275
|
-
const outline =
|
|
171370
|
+
const outline = allowOverlaps ? undefined : new Set();
|
|
171276
171371
|
const offset = sRange.clone();
|
|
171277
171372
|
offset.expandInPlace(-2);
|
|
171278
171373
|
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
@@ -171314,6 +171409,33 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
|
|
|
171314
171409
|
}, true);
|
|
171315
171410
|
return contents;
|
|
171316
171411
|
}
|
|
171412
|
+
/** Get ids of elements to process from drag box or crossing line selection using either the depth buffer or clip vector...
|
|
171413
|
+
* @internal
|
|
171414
|
+
*/
|
|
171415
|
+
static async getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter, includeDecorationsForVolume) {
|
|
171416
|
+
let contents;
|
|
171417
|
+
if (_ToolSettings__WEBPACK_IMPORTED_MODULE_13__.ToolSettings.enableVolumeSelection && _SelectTool__WEBPACK_IMPORTED_MODULE_10__.SelectionMethod.Box === method && vp.view.isSpatialView()) {
|
|
171418
|
+
contents = await ElementSetTool.getVolumeSelectionCandidates(vp, origin, corner, allowOverlaps, filter);
|
|
171419
|
+
// Use area select to identify pickable transients...
|
|
171420
|
+
if (includeDecorationsForVolume) {
|
|
171421
|
+
const acceptTransientsFilter = (id) => { return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isTransient(id) && (undefined === filter || filter(id)); };
|
|
171422
|
+
const transients = ElementSetTool.getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, acceptTransientsFilter);
|
|
171423
|
+
for (const id of transients)
|
|
171424
|
+
contents.add(id);
|
|
171425
|
+
}
|
|
171426
|
+
}
|
|
171427
|
+
else {
|
|
171428
|
+
contents = ElementSetTool.getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter);
|
|
171429
|
+
}
|
|
171430
|
+
return contents;
|
|
171431
|
+
}
|
|
171432
|
+
/** Get element ids to process from drag box or crossing line selection.
|
|
171433
|
+
* Sub-classes may override to support selection scopes or apply tool specific filtering.
|
|
171434
|
+
*/
|
|
171435
|
+
async getDragSelectCandidates(vp, origin, corner, method, overlap) {
|
|
171436
|
+
const filter = (id) => { return this.isElementIdValid(id, ModifyElementSource.DragSelect); };
|
|
171437
|
+
return ElementSetTool.getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, overlap, filter, _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.locateManager.options.allowDecorations);
|
|
171438
|
+
}
|
|
171317
171439
|
/** Populate [[ElementSetTool.agenda]] by drag box or crossing line information.
|
|
171318
171440
|
* @see [[ElementSetTool.getDragSelectCandidates]] to filter or augment the set of elements.
|
|
171319
171441
|
*/
|
|
@@ -173637,17 +173759,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
173637
173759
|
/* harmony export */ SelectionTool: () => (/* binding */ SelectionTool)
|
|
173638
173760
|
/* harmony export */ });
|
|
173639
173761
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
173640
|
-
/* harmony import */ var
|
|
173641
|
-
/* harmony import */ var
|
|
173642
|
-
/* harmony import */ var
|
|
173643
|
-
/* harmony import */ var
|
|
173644
|
-
/* harmony import */ var
|
|
173645
|
-
/* harmony import */ var
|
|
173646
|
-
/* harmony import */ var
|
|
173647
|
-
/* harmony import */ var
|
|
173648
|
-
/* harmony import */ var
|
|
173649
|
-
/* harmony import */ var _ToolAdmin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ToolAdmin */ "../../core/frontend/lib/esm/tools/ToolAdmin.js");
|
|
173650
|
-
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
173762
|
+
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
173763
|
+
/* harmony import */ var _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @itwin/appui-abstract */ "../../ui/appui-abstract/lib/esm/appui-abstract.js");
|
|
173764
|
+
/* harmony import */ var _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ElementLocateManager */ "../../core/frontend/lib/esm/ElementLocateManager.js");
|
|
173765
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
173766
|
+
/* harmony import */ var _PrimitiveTool__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PrimitiveTool */ "../../core/frontend/lib/esm/tools/PrimitiveTool.js");
|
|
173767
|
+
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
173768
|
+
/* harmony import */ var _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ToolAdmin */ "../../core/frontend/lib/esm/tools/ToolAdmin.js");
|
|
173769
|
+
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
173770
|
+
/* harmony import */ var _ElementSetTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ElementSetTool */ "../../core/frontend/lib/esm/tools/ElementSetTool.js");
|
|
173651
173771
|
/*---------------------------------------------------------------------------------------------
|
|
173652
173772
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
173653
173773
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -173665,8 +173785,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
173665
173785
|
|
|
173666
173786
|
|
|
173667
173787
|
|
|
173668
|
-
|
|
173669
|
-
|
|
173670
173788
|
// cSpell:ignore buttongroup
|
|
173671
173789
|
/** The method for choosing elements with the [[SelectionTool]]
|
|
173672
173790
|
* @public
|
|
@@ -173712,7 +173830,7 @@ var SelectionProcessing;
|
|
|
173712
173830
|
/** Tool for picking a set of elements of interest, selected by the user.
|
|
173713
173831
|
* @public
|
|
173714
173832
|
*/
|
|
173715
|
-
class SelectionTool extends
|
|
173833
|
+
class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_5__.PrimitiveTool {
|
|
173716
173834
|
static hidden = false;
|
|
173717
173835
|
static toolId = "Select";
|
|
173718
173836
|
static iconSpec = "icon-cursor";
|
|
@@ -173731,7 +173849,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173731
173849
|
set selectionMethod(method) { this._selectionMethodValue.value = method; }
|
|
173732
173850
|
get selectionMode() { return this._selectionModeValue.value; }
|
|
173733
173851
|
set selectionMode(mode) { this._selectionModeValue.value = mode; }
|
|
173734
|
-
static methodsMessage(str) { return
|
|
173852
|
+
static methodsMessage(str) { return _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(`ElementSet.SelectionMethods.${str}`); }
|
|
173735
173853
|
static _methodsName = "selectionMethods";
|
|
173736
173854
|
/* The property descriptions used to generate ToolSettings UI. */
|
|
173737
173855
|
static _getMethodsDescription() {
|
|
@@ -173742,14 +173860,14 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173742
173860
|
editor: {
|
|
173743
173861
|
name: "enum-buttongroup",
|
|
173744
173862
|
params: [{
|
|
173745
|
-
type:
|
|
173863
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.ButtonGroupData,
|
|
173746
173864
|
buttons: [
|
|
173747
173865
|
{ iconSpec: "icon-select-single" },
|
|
173748
173866
|
{ iconSpec: "icon-select-line" },
|
|
173749
173867
|
{ iconSpec: "icon-select-box" },
|
|
173750
173868
|
],
|
|
173751
173869
|
}, {
|
|
173752
|
-
type:
|
|
173870
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.SuppressEditorLabel,
|
|
173753
173871
|
suppressLabelPlaceholder: true,
|
|
173754
173872
|
},
|
|
173755
173873
|
],
|
|
@@ -173763,7 +173881,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173763
173881
|
},
|
|
173764
173882
|
};
|
|
173765
173883
|
}
|
|
173766
|
-
static modesMessage(str) { return
|
|
173884
|
+
static modesMessage(str) { return _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(`ElementSet.SelectionModes.${str}`); }
|
|
173767
173885
|
static _modesName = "selectionModes";
|
|
173768
173886
|
/* The property descriptions used to generate ToolSettings UI. */
|
|
173769
173887
|
static _getModesDescription() {
|
|
@@ -173774,20 +173892,20 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173774
173892
|
editor: {
|
|
173775
173893
|
name: "enum-buttongroup",
|
|
173776
173894
|
params: [{
|
|
173777
|
-
type:
|
|
173895
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.ButtonGroupData,
|
|
173778
173896
|
buttons: [
|
|
173779
173897
|
{ iconSpec: "icon-replace" },
|
|
173780
173898
|
{ iconSpec: "icon-select-plus" },
|
|
173781
173899
|
{
|
|
173782
173900
|
iconSpec: "icon-select-minus",
|
|
173783
173901
|
isEnabledFunction: () => {
|
|
173784
|
-
const tool =
|
|
173785
|
-
return tool instanceof
|
|
173902
|
+
const tool = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.activeTool;
|
|
173903
|
+
return tool instanceof _PrimitiveTool__WEBPACK_IMPORTED_MODULE_5__.PrimitiveTool ? tool.iModel.selectionSet.isActive : false;
|
|
173786
173904
|
},
|
|
173787
173905
|
},
|
|
173788
173906
|
],
|
|
173789
173907
|
}, {
|
|
173790
|
-
type:
|
|
173908
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.SuppressEditorLabel,
|
|
173791
173909
|
suppressLabelPlaceholder: true,
|
|
173792
173910
|
},
|
|
173793
173911
|
],
|
|
@@ -173814,49 +173932,49 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173814
173932
|
mainMsg += (0 === this._points.length ? "StartCorner" : "OppositeCorner");
|
|
173815
173933
|
break;
|
|
173816
173934
|
}
|
|
173817
|
-
const mainInstruction =
|
|
173935
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(mainMsg));
|
|
173818
173936
|
const sections = [];
|
|
173819
173937
|
switch (method) {
|
|
173820
173938
|
case SelectionMethod.Pick:
|
|
173821
173939
|
const mousePickInstructions = [];
|
|
173822
|
-
mousePickInstructions.push(
|
|
173823
|
-
mousePickInstructions.push(
|
|
173824
|
-
mousePickInstructions.push(
|
|
173825
|
-
mousePickInstructions.push(
|
|
173940
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptElement"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173941
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClickDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.BoxCorners"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173942
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.RightClickDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.CrossingLine"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173943
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.shiftKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClickDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.OverlapSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173826
173944
|
if (SelectionMode.Replace === mode) {
|
|
173827
|
-
mousePickInstructions.push(
|
|
173828
|
-
mousePickInstructions.push(
|
|
173945
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createKeyboardInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.ctrlKeyboardInfo, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.InvertSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173946
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.CursorClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.ClearSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173829
173947
|
}
|
|
173830
|
-
sections.push(
|
|
173948
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(mousePickInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173831
173949
|
const touchPickInstructions = [];
|
|
173832
|
-
if (!
|
|
173833
|
-
touchPickInstructions.push(
|
|
173834
|
-
sections.push(
|
|
173950
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createTouchCursorInstructions(touchPickInstructions))
|
|
173951
|
+
touchPickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.OneTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptElement"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Touch));
|
|
173952
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(touchPickInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173835
173953
|
break;
|
|
173836
173954
|
case SelectionMethod.Line:
|
|
173837
173955
|
const mouseLineInstructions = [];
|
|
173838
|
-
mouseLineInstructions.push(
|
|
173956
|
+
mouseLineInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173839
173957
|
if (SelectionMode.Replace === mode)
|
|
173840
|
-
mouseLineInstructions.push(
|
|
173841
|
-
sections.push(
|
|
173958
|
+
mouseLineInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.ctrlKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.InvertSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173959
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(mouseLineInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173842
173960
|
const touchLineInstructions = [];
|
|
173843
|
-
touchLineInstructions.push(
|
|
173844
|
-
sections.push(
|
|
173961
|
+
touchLineInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.OneTouchDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Touch));
|
|
173962
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(touchLineInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173845
173963
|
break;
|
|
173846
173964
|
case SelectionMethod.Box:
|
|
173847
173965
|
const mouseBoxInstructions = [];
|
|
173848
|
-
mouseBoxInstructions.push(
|
|
173849
|
-
mouseBoxInstructions.push(
|
|
173966
|
+
mouseBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173967
|
+
mouseBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.shiftKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.OverlapSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173850
173968
|
if (SelectionMode.Replace === mode)
|
|
173851
|
-
mouseBoxInstructions.push(
|
|
173852
|
-
sections.push(
|
|
173969
|
+
mouseBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.ctrlKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.InvertSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173970
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(mouseBoxInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173853
173971
|
const touchBoxInstructions = [];
|
|
173854
|
-
touchBoxInstructions.push(
|
|
173855
|
-
sections.push(
|
|
173972
|
+
touchBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.OneTouchDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Touch));
|
|
173973
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(touchBoxInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173856
173974
|
break;
|
|
173857
173975
|
}
|
|
173858
|
-
const instructions =
|
|
173859
|
-
|
|
173976
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
173977
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.notifications.setToolAssistance(instructions);
|
|
173860
173978
|
}
|
|
173861
173979
|
initSelectTool() {
|
|
173862
173980
|
const method = this.selectionMethod;
|
|
@@ -173864,8 +173982,8 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173864
173982
|
const enableLocate = SelectionMethod.Pick === method;
|
|
173865
173983
|
this._isSelectByPoints = false;
|
|
173866
173984
|
this._points.length = 0;
|
|
173867
|
-
this.initLocateElements(enableLocate, false, enableLocate ? "default" :
|
|
173868
|
-
|
|
173985
|
+
this.initLocateElements(enableLocate, false, enableLocate ? "default" : _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.crossHairCursor, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoordinateLockOverrides.All);
|
|
173986
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.options.allowDecorations = true; // Always locate to display tool tip even if we reject for adding to selection set...
|
|
173869
173987
|
this.showPrompt(mode, method);
|
|
173870
173988
|
}
|
|
173871
173989
|
processMiss(_ev) {
|
|
@@ -173910,13 +174028,13 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173910
174028
|
selectByPointsDecorate(context) {
|
|
173911
174029
|
if (!this._isSelectByPoints)
|
|
173912
174030
|
return;
|
|
173913
|
-
const ev = new
|
|
173914
|
-
|
|
174031
|
+
const ev = new _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButtonEvent();
|
|
174032
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.fillEventFromCursorLocation(ev);
|
|
173915
174033
|
if (undefined === ev.viewport)
|
|
173916
174034
|
return;
|
|
173917
174035
|
const vp = context.viewport;
|
|
173918
|
-
const bestContrastIsBlack = (
|
|
173919
|
-
const crossingLine = (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod &&
|
|
174036
|
+
const bestContrastIsBlack = (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ColorDef.black === vp.getContrastToBackgroundColor());
|
|
174037
|
+
const crossingLine = (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod && _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset === ev.button));
|
|
173920
174038
|
const overlapSelection = (crossingLine || this.useOverlapSelection(ev));
|
|
173921
174039
|
const position = vp.worldToView(this._points[0]);
|
|
173922
174040
|
position.x = Math.floor(position.x) + 0.5;
|
|
@@ -173944,111 +174062,42 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173944
174062
|
};
|
|
173945
174063
|
context.addCanvasDecoration({ position, drawDecoration });
|
|
173946
174064
|
}
|
|
173947
|
-
selectByPointsProcess(origin, corner, ev, method, overlap) {
|
|
174065
|
+
async selectByPointsProcess(origin, corner, ev, method, overlap) {
|
|
173948
174066
|
const vp = ev.viewport;
|
|
173949
174067
|
if (!vp)
|
|
173950
|
-
return;
|
|
173951
|
-
const
|
|
173952
|
-
|
|
173953
|
-
|
|
173954
|
-
|
|
173955
|
-
|
|
173956
|
-
|
|
173957
|
-
const allowTransients = this.wantPickableDecorations();
|
|
173958
|
-
vp.readPixels(rect, _render_Pixel__WEBPACK_IMPORTED_MODULE_6__.Pixel.Selector.Feature, (pixels) => {
|
|
173959
|
-
if (undefined === pixels)
|
|
173960
|
-
return;
|
|
173961
|
-
const sRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range2d.createNull();
|
|
173962
|
-
sRange.extendPoint(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(vp.cssPixelsToDevicePixels(range.low.x), vp.cssPixelsToDevicePixels(range.low.y)));
|
|
173963
|
-
sRange.extendPoint(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(vp.cssPixelsToDevicePixels(range.high.x), vp.cssPixelsToDevicePixels(range.high.y)));
|
|
173964
|
-
pts[0].x = vp.cssPixelsToDevicePixels(pts[0].x);
|
|
173965
|
-
pts[0].y = vp.cssPixelsToDevicePixels(pts[0].y);
|
|
173966
|
-
pts[1].x = vp.cssPixelsToDevicePixels(pts[1].x);
|
|
173967
|
-
pts[1].y = vp.cssPixelsToDevicePixels(pts[1].y);
|
|
173968
|
-
let contents = new Set();
|
|
173969
|
-
const testPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.createZero();
|
|
173970
|
-
const getPixelElementId = (pixel) => {
|
|
173971
|
-
if (undefined === pixel.elementId || _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isInvalid(pixel.elementId))
|
|
173972
|
-
return undefined; // no geometry at this location...
|
|
173973
|
-
if (!allowTransients && _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isTransient(pixel.elementId))
|
|
173974
|
-
return undefined; // tool didn't request pickable decorations...
|
|
173975
|
-
if (!vp.isPixelSelectable(pixel))
|
|
173976
|
-
return undefined; // reality model, terrain, etc - not selectable
|
|
173977
|
-
return pixel.elementId;
|
|
173978
|
-
};
|
|
173979
|
-
if (SelectionMethod.Box === method) {
|
|
173980
|
-
const outline = overlap ? undefined : new Set();
|
|
173981
|
-
const offset = sRange.clone();
|
|
173982
|
-
offset.expandInPlace(-2);
|
|
173983
|
-
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
173984
|
-
for (testPoint.y = sRange.low.y; testPoint.y <= sRange.high.y; ++testPoint.y) {
|
|
173985
|
-
const pixel = pixels.getPixel(testPoint.x, testPoint.y);
|
|
173986
|
-
const elementId = getPixelElementId(pixel);
|
|
173987
|
-
if (undefined === elementId)
|
|
173988
|
-
continue;
|
|
173989
|
-
if (undefined !== outline && !offset.containsPoint(testPoint))
|
|
173990
|
-
outline.add(elementId.toString());
|
|
173991
|
-
else
|
|
173992
|
-
contents.add(elementId.toString());
|
|
173993
|
-
}
|
|
173994
|
-
}
|
|
173995
|
-
if (undefined !== outline && 0 !== outline.size) {
|
|
173996
|
-
const inside = new Set();
|
|
173997
|
-
contents.forEach((id) => {
|
|
173998
|
-
if (!outline.has(id))
|
|
173999
|
-
inside.add(id);
|
|
174000
|
-
});
|
|
174001
|
-
contents = inside;
|
|
174002
|
-
}
|
|
174003
|
-
}
|
|
174004
|
-
else {
|
|
174005
|
-
const closePoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.createZero();
|
|
174006
|
-
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
174007
|
-
for (testPoint.y = sRange.low.y; testPoint.y <= sRange.high.y; ++testPoint.y) {
|
|
174008
|
-
const pixel = pixels.getPixel(testPoint.x, testPoint.y);
|
|
174009
|
-
const elementId = getPixelElementId(pixel);
|
|
174010
|
-
if (undefined === elementId)
|
|
174011
|
-
continue;
|
|
174012
|
-
const fraction = testPoint.fractionOfProjectionToLine(pts[0], pts[1], 0.0);
|
|
174013
|
-
pts[0].interpolate(fraction, pts[1], closePoint);
|
|
174014
|
-
if (closePoint.distance(testPoint) < 1.5)
|
|
174015
|
-
contents.add(elementId.toString());
|
|
174016
|
-
}
|
|
174017
|
-
}
|
|
174018
|
-
}
|
|
174019
|
-
if (0 === contents.size) {
|
|
174020
|
-
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev))
|
|
174021
|
-
this.syncSelectionMode();
|
|
174022
|
-
return;
|
|
174023
|
-
}
|
|
174024
|
-
switch (this.selectionMode) {
|
|
174025
|
-
case SelectionMode.Replace:
|
|
174026
|
-
if (!ev.isControlKey)
|
|
174027
|
-
this.processSelection(contents, SelectionProcessing.ReplaceSelectionWithElement); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
174028
|
-
else
|
|
174029
|
-
this.processSelection(contents, SelectionProcessing.InvertElementInSelection); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
174030
|
-
break;
|
|
174031
|
-
case SelectionMode.Add:
|
|
174032
|
-
this.processSelection(contents, SelectionProcessing.AddElementToSelection); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
174033
|
-
break;
|
|
174034
|
-
case SelectionMode.Remove:
|
|
174035
|
-
this.processSelection(contents, SelectionProcessing.RemoveElementFromSelection); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
174036
|
-
break;
|
|
174068
|
+
return false;
|
|
174069
|
+
const filter = (id) => { return !_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isTransient(id); };
|
|
174070
|
+
const contents = await _ElementSetTool__WEBPACK_IMPORTED_MODULE_9__.ElementSetTool.getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, overlap, this.wantPickableDecorations() ? undefined : filter, this.wantPickableDecorations());
|
|
174071
|
+
if (0 === contents.size) {
|
|
174072
|
+
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev)) {
|
|
174073
|
+
this.syncSelectionMode();
|
|
174074
|
+
return true;
|
|
174037
174075
|
}
|
|
174038
|
-
|
|
174076
|
+
return false;
|
|
174077
|
+
}
|
|
174078
|
+
switch (this.selectionMode) {
|
|
174079
|
+
case SelectionMode.Replace:
|
|
174080
|
+
if (!ev.isControlKey)
|
|
174081
|
+
return this.processSelection(contents, SelectionProcessing.ReplaceSelectionWithElement);
|
|
174082
|
+
return this.processSelection(contents, SelectionProcessing.InvertElementInSelection);
|
|
174083
|
+
case SelectionMode.Add:
|
|
174084
|
+
return this.processSelection(contents, SelectionProcessing.AddElementToSelection);
|
|
174085
|
+
case SelectionMode.Remove:
|
|
174086
|
+
return this.processSelection(contents, SelectionProcessing.RemoveElementFromSelection);
|
|
174087
|
+
}
|
|
174039
174088
|
}
|
|
174040
174089
|
selectByPointsStart(ev) {
|
|
174041
|
-
if (
|
|
174090
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Data !== ev.button && _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset !== ev.button)
|
|
174042
174091
|
return false;
|
|
174043
174092
|
this._points.length = 0;
|
|
174044
174093
|
this._points.push(ev.point.clone());
|
|
174045
174094
|
this._isSelectByPoints = true;
|
|
174046
|
-
|
|
174047
|
-
|
|
174095
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.enableLocate(false);
|
|
174096
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.setLocateCircleOn(false);
|
|
174048
174097
|
this.showPrompt(this.selectionMode, this.selectionMethod);
|
|
174049
174098
|
return true;
|
|
174050
174099
|
}
|
|
174051
|
-
selectByPointsEnd(ev) {
|
|
174100
|
+
async selectByPointsEnd(ev) {
|
|
174052
174101
|
if (!this._isSelectByPoints)
|
|
174053
174102
|
return false;
|
|
174054
174103
|
const vp = ev.viewport;
|
|
@@ -174058,10 +174107,10 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174058
174107
|
}
|
|
174059
174108
|
const origin = vp.worldToView(this._points[0]);
|
|
174060
174109
|
const corner = vp.worldToView(ev.point);
|
|
174061
|
-
if (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod &&
|
|
174062
|
-
this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Line, true);
|
|
174110
|
+
if (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod && _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset === ev.button))
|
|
174111
|
+
await this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Line, true);
|
|
174063
174112
|
else
|
|
174064
|
-
this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Box, this.useOverlapSelection(ev));
|
|
174113
|
+
await this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Box, this.useOverlapSelection(ev));
|
|
174065
174114
|
this.initSelectTool();
|
|
174066
174115
|
vp.invalidateDecorations();
|
|
174067
174116
|
return true;
|
|
@@ -174072,14 +174121,14 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174072
174121
|
}
|
|
174073
174122
|
async selectDecoration(ev, currHit) {
|
|
174074
174123
|
if (undefined === currHit)
|
|
174075
|
-
currHit = await
|
|
174124
|
+
currHit = await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.doLocate(new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);
|
|
174076
174125
|
if (undefined !== currHit)
|
|
174077
|
-
return (currHit.isElementHit ?
|
|
174078
|
-
return
|
|
174126
|
+
return (currHit.isElementHit ? _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.overrideElementButtonEvent(currHit, ev) : _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.onDecorationButtonEvent(currHit, ev));
|
|
174127
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174079
174128
|
}
|
|
174080
174129
|
async processHit(ev, hit) {
|
|
174081
174130
|
if (hit.isModelHit || hit.isMapHit)
|
|
174082
|
-
return
|
|
174131
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No; // model hit = terrain, reality models, background maps, etc - not selectable
|
|
174083
174132
|
switch (this.selectionMode) {
|
|
174084
174133
|
case SelectionMode.Replace:
|
|
174085
174134
|
await this.processSelection(hit.sourceId, ev.isControlKey ? SelectionProcessing.InvertElementInSelection : SelectionProcessing.ReplaceSelectionWithElement);
|
|
@@ -174091,59 +174140,59 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174091
174140
|
await this.processSelection(hit.sourceId, SelectionProcessing.RemoveElementFromSelection);
|
|
174092
174141
|
break;
|
|
174093
174142
|
}
|
|
174094
|
-
return
|
|
174143
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174095
174144
|
}
|
|
174096
174145
|
async onMouseStartDrag(ev) {
|
|
174097
|
-
|
|
174098
|
-
if (
|
|
174099
|
-
return
|
|
174100
|
-
if (
|
|
174101
|
-
return
|
|
174102
|
-
return this.selectByPointsStart(ev) ?
|
|
174146
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.clear(); // Need to test hit at start drag location, not current AccuSnap...
|
|
174147
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.selectDecoration(ev))
|
|
174148
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174149
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.InputSource.Touch === ev.inputSource && SelectionMethod.Pick === this.selectionMethod)
|
|
174150
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No; // Require method change for line/box selection...allow IdleTool to handle touch move...
|
|
174151
|
+
return this.selectByPointsStart(ev) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174103
174152
|
}
|
|
174104
174153
|
async onMouseEndDrag(ev) {
|
|
174105
|
-
return this.selectByPointsEnd(ev) ?
|
|
174154
|
+
return await this.selectByPointsEnd(ev) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174106
174155
|
}
|
|
174107
174156
|
async onDataButtonUp(ev) {
|
|
174108
174157
|
if (undefined === ev.viewport)
|
|
174109
|
-
return
|
|
174110
|
-
if (this.selectByPointsEnd(ev))
|
|
174111
|
-
return
|
|
174158
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174159
|
+
if (await this.selectByPointsEnd(ev))
|
|
174160
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174112
174161
|
if (SelectionMethod.Pick !== this.selectionMethod) {
|
|
174113
174162
|
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev))
|
|
174114
174163
|
this.syncSelectionMode();
|
|
174115
|
-
if (
|
|
174164
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.InputSource.Touch !== ev.inputSource)
|
|
174116
174165
|
this.selectByPointsStart(ev); // Require touch move and not tap to start crossing line/box selection...
|
|
174117
|
-
return
|
|
174166
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174118
174167
|
}
|
|
174119
|
-
const hit = await
|
|
174168
|
+
const hit = await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.doLocate(new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);
|
|
174120
174169
|
if (hit !== undefined) {
|
|
174121
|
-
if (
|
|
174122
|
-
return
|
|
174123
|
-
if (
|
|
174124
|
-
return
|
|
174170
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.selectDecoration(ev, hit))
|
|
174171
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174172
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.processHit(ev, hit))
|
|
174173
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174125
174174
|
}
|
|
174126
174175
|
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev))
|
|
174127
174176
|
this.syncSelectionMode();
|
|
174128
|
-
return
|
|
174177
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174129
174178
|
}
|
|
174130
174179
|
async onResetButtonUp(ev) {
|
|
174131
174180
|
if (this._isSelectByPoints) {
|
|
174132
174181
|
if (undefined !== ev.viewport)
|
|
174133
174182
|
ev.viewport.invalidateDecorations();
|
|
174134
174183
|
this.initSelectTool();
|
|
174135
|
-
return
|
|
174184
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174136
174185
|
}
|
|
174137
174186
|
// Check for overlapping hits...
|
|
174138
|
-
const lastHit = SelectionMode.Remove === this.selectionMode ? undefined :
|
|
174187
|
+
const lastHit = SelectionMode.Remove === this.selectionMode ? undefined : _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.currHit;
|
|
174139
174188
|
if (lastHit && this.iModel.selectionSet.elements.has(lastHit.sourceId)) {
|
|
174140
|
-
const autoHit =
|
|
174189
|
+
const autoHit = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.currHit;
|
|
174141
174190
|
// Play nice w/auto-locate, only remove previous hit if not currently auto-locating or over previous hit
|
|
174142
174191
|
if (undefined === autoHit || autoHit.isSameHit(lastHit)) {
|
|
174143
|
-
const response = new
|
|
174192
|
+
const response = new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateResponse();
|
|
174144
174193
|
let nextHit;
|
|
174145
174194
|
do {
|
|
174146
|
-
nextHit = await
|
|
174195
|
+
nextHit = await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.doLocate(response, false, ev.point, ev.viewport, ev.inputSource);
|
|
174147
174196
|
} while (undefined !== nextHit && (nextHit.isModelHit || nextHit.isMapHit)); // Ignore reality models, terrain, maps, etc.
|
|
174148
174197
|
// remove element(s) previously selected if in replace mode, or if we have a next element in add mode
|
|
174149
174198
|
if (SelectionMode.Replace === this.selectionMode || undefined !== nextHit)
|
|
@@ -174151,69 +174200,69 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174151
174200
|
// add element(s) located via reset button
|
|
174152
174201
|
if (undefined !== nextHit)
|
|
174153
174202
|
await this.processSelection(nextHit.sourceId, SelectionProcessing.AddElementToSelection);
|
|
174154
|
-
return
|
|
174203
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174155
174204
|
}
|
|
174156
174205
|
}
|
|
174157
|
-
if (
|
|
174158
|
-
return
|
|
174159
|
-
await
|
|
174160
|
-
return
|
|
174206
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.selectDecoration(ev, _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.currHit))
|
|
174207
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174208
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.resetButton();
|
|
174209
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174161
174210
|
}
|
|
174162
174211
|
async onSuspend() {
|
|
174163
174212
|
this._isSuspended = true;
|
|
174164
174213
|
if (this.wantEditManipulators())
|
|
174165
|
-
|
|
174214
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Suspend);
|
|
174166
174215
|
}
|
|
174167
174216
|
async onUnsuspend() {
|
|
174168
174217
|
this._isSuspended = false;
|
|
174169
174218
|
if (this.wantEditManipulators())
|
|
174170
|
-
|
|
174219
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Unsuspend);
|
|
174171
174220
|
this.showPrompt(this.selectionMode, this.selectionMethod);
|
|
174172
174221
|
}
|
|
174173
174222
|
async onTouchMoveStart(ev, startEv) {
|
|
174174
174223
|
if (startEv.isSingleTouch && !this._isSelectByPoints)
|
|
174175
|
-
await
|
|
174176
|
-
return (this._isSuspended || this._isSelectByPoints) ?
|
|
174224
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchMoveStartToButtonDownAndMotion(startEv, ev);
|
|
174225
|
+
return (this._isSuspended || this._isSelectByPoints) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174177
174226
|
}
|
|
174178
174227
|
async onTouchMove(ev) {
|
|
174179
174228
|
if (this._isSelectByPoints)
|
|
174180
|
-
return
|
|
174229
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchMoveToMotion(ev);
|
|
174181
174230
|
}
|
|
174182
174231
|
async onTouchComplete(ev) {
|
|
174183
174232
|
if (this._isSelectByPoints)
|
|
174184
|
-
return
|
|
174233
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchEndToButtonUp(ev);
|
|
174185
174234
|
}
|
|
174186
174235
|
async onTouchCancel(ev) {
|
|
174187
174236
|
if (this._isSelectByPoints)
|
|
174188
|
-
return
|
|
174237
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchEndToButtonUp(ev, _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset);
|
|
174189
174238
|
}
|
|
174190
174239
|
decorate(context) { this.selectByPointsDecorate(context); }
|
|
174191
174240
|
async onModifierKeyTransition(_wentDown, modifier, _event) {
|
|
174192
|
-
return (modifier ===
|
|
174241
|
+
return (modifier === _Tool__WEBPACK_IMPORTED_MODULE_6__.BeModifierKeys.Shift && this._isSelectByPoints) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174193
174242
|
}
|
|
174194
174243
|
async filterHit(hit, out) {
|
|
174195
174244
|
if (!this.wantPickableDecorations() && !hit.isElementHit)
|
|
174196
|
-
return
|
|
174245
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Reject;
|
|
174197
174246
|
const mode = this.selectionMode;
|
|
174198
174247
|
if (SelectionMode.Replace === mode)
|
|
174199
|
-
return
|
|
174248
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Accept;
|
|
174200
174249
|
const isSelected = this.iModel.selectionSet.elements.has(hit.sourceId);
|
|
174201
|
-
const status = ((SelectionMode.Add === mode ? !isSelected : isSelected) ?
|
|
174202
|
-
if (out &&
|
|
174203
|
-
out.explanation =
|
|
174250
|
+
const status = ((SelectionMode.Add === mode ? !isSelected : isSelected) ? _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Accept : _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Reject);
|
|
174251
|
+
if (out && _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Reject === status)
|
|
174252
|
+
out.explanation = _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(`ElementSet.Error.${isSelected ? "AlreadySelected" : "NotSelected"}`);
|
|
174204
174253
|
return status;
|
|
174205
174254
|
}
|
|
174206
174255
|
async onRestartTool() { return this.exitTool(); }
|
|
174207
174256
|
async onCleanup() {
|
|
174208
174257
|
if (this.wantEditManipulators())
|
|
174209
|
-
|
|
174258
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Stop);
|
|
174210
174259
|
}
|
|
174211
174260
|
async onPostInstall() {
|
|
174212
174261
|
await super.onPostInstall();
|
|
174213
174262
|
if (!this.targetView)
|
|
174214
174263
|
return;
|
|
174215
174264
|
if (this.wantEditManipulators())
|
|
174216
|
-
|
|
174265
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Start);
|
|
174217
174266
|
this.initSelectTool();
|
|
174218
174267
|
}
|
|
174219
174268
|
static async startTool() { return new SelectionTool().run(); }
|
|
@@ -174225,7 +174274,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174225
174274
|
}
|
|
174226
174275
|
if (this.wantToolSettings()) {
|
|
174227
174276
|
const syncMode = { value: this._selectionModeValue, propertyName: SelectionTool._modesName };
|
|
174228
|
-
|
|
174277
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, syncMode);
|
|
174229
174278
|
this.syncToolSettingsProperties([syncMode]);
|
|
174230
174279
|
}
|
|
174231
174280
|
}
|
|
@@ -174236,14 +174285,14 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174236
174285
|
if (!this.wantToolSettings())
|
|
174237
174286
|
return undefined;
|
|
174238
174287
|
// load latest values from session
|
|
174239
|
-
|
|
174288
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.getInitialToolSettingValues(this.toolId, [SelectionTool._modesName])?.forEach((value) => {
|
|
174240
174289
|
if (value.propertyName === SelectionTool._modesName)
|
|
174241
174290
|
this._selectionModeValue = value.value;
|
|
174242
174291
|
});
|
|
174243
174292
|
// Make sure a mode of SelectionMode.Remove is valid
|
|
174244
174293
|
if (SelectionMode.Remove === this.selectionMode && !this.iModel.selectionSet.isActive) {
|
|
174245
174294
|
this.selectionMode = SelectionMode.Replace;
|
|
174246
|
-
|
|
174295
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: SelectionTool._modesName, value: this._selectionModeValue });
|
|
174247
174296
|
}
|
|
174248
174297
|
const toolSettings = new Array();
|
|
174249
174298
|
// generate 3 columns - label will be placed in column 0 and button group editors in columns 1 and 2.
|
|
@@ -174262,7 +174311,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174262
174311
|
if (this._selectionMethodValue) {
|
|
174263
174312
|
const currWantManipulators = this.wantEditManipulators();
|
|
174264
174313
|
if (saveWantManipulators !== currWantManipulators)
|
|
174265
|
-
|
|
174314
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, currWantManipulators ? _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Start : _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Stop);
|
|
174266
174315
|
changed = true;
|
|
174267
174316
|
}
|
|
174268
174317
|
}
|
|
@@ -174270,7 +174319,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174270
174319
|
this._selectionModeValue = updatedValue.value;
|
|
174271
174320
|
if (this._selectionModeValue) {
|
|
174272
174321
|
if (this.wantToolSettings())
|
|
174273
|
-
|
|
174322
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: SelectionTool._modesName, value: this._selectionModeValue });
|
|
174274
174323
|
changed = true;
|
|
174275
174324
|
}
|
|
174276
174325
|
}
|
|
@@ -177413,6 +177462,11 @@ class ToolSettings {
|
|
|
177413
177462
|
};
|
|
177414
177463
|
/** Maximum number of times in a second the accuSnap tool's onMotion function is called. */
|
|
177415
177464
|
static maxOnMotionSnapCallPerSecond = 15;
|
|
177465
|
+
/** If true, drag box selection will accept spatial elements that are inside or overlap a clip volume instead of only what is visible in the view.
|
|
177466
|
+
* @note Enabling is not recommended for web applications.
|
|
177467
|
+
* @beta
|
|
177468
|
+
*/
|
|
177469
|
+
static enableVolumeSelection = false;
|
|
177416
177470
|
}
|
|
177417
177471
|
|
|
177418
177472
|
|
|
@@ -183328,7 +183382,13 @@ class BSplineCurve3dBase extends _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_
|
|
|
183328
183382
|
* @param fractionB end fraction.
|
|
183329
183383
|
*/
|
|
183330
183384
|
clonePartialCurve(fractionA, fractionB) {
|
|
183331
|
-
|
|
183385
|
+
let clone;
|
|
183386
|
+
if (fractionA > fractionB) {
|
|
183387
|
+
clone = this.clonePartialCurve(fractionB, fractionA);
|
|
183388
|
+
clone.reverseInPlace();
|
|
183389
|
+
return clone;
|
|
183390
|
+
}
|
|
183391
|
+
clone = this.clone();
|
|
183332
183392
|
const origNumKnots = clone._bcurve.knots.knots.length;
|
|
183333
183393
|
let knotA = clone._bcurve.knots.fractionToKnot(fractionA);
|
|
183334
183394
|
let knotB = clone._bcurve.knots.fractionToKnot(fractionB);
|
|
@@ -191055,11 +191115,13 @@ class ClipUtilities {
|
|
|
191055
191115
|
clippedLocalRegion.tryTransformInPlace(localToWorld);
|
|
191056
191116
|
if (!result)
|
|
191057
191117
|
result = (clippedLocalRegion instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion) ? clippedLocalRegion : _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion.create(clippedLocalRegion);
|
|
191058
|
-
|
|
191059
|
-
result.children.push(...clippedLocalRegion.children);
|
|
191118
|
+
if (clippedLocalRegion instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion)
|
|
191119
|
+
result.children.push(...clippedLocalRegion.children); // avoid nested UnionRegions
|
|
191120
|
+
else
|
|
191121
|
+
result.tryAddChild(clippedLocalRegion);
|
|
191060
191122
|
}
|
|
191061
191123
|
}
|
|
191062
|
-
return result;
|
|
191124
|
+
return result ? _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.simplifyRegionType(result) : undefined;
|
|
191063
191125
|
}
|
|
191064
191126
|
/**
|
|
191065
191127
|
* Compute and return portions of the input curve or region that are within the clipper.
|
|
@@ -195608,7 +195670,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
195608
195670
|
scaleAboutCenterInPlace(scaleFactor) {
|
|
195609
195671
|
this._matrix.scaleColumnsInPlace(scaleFactor, scaleFactor, 1.0);
|
|
195610
195672
|
}
|
|
195611
|
-
/** Return the (signed
|
|
195673
|
+
/** Return the (signed) area between (a fractional portion of) the arc and the chord between those points. */
|
|
195612
195674
|
areaToChordXY(fraction0, fraction1) {
|
|
195613
195675
|
let detJ = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.crossProductXYXY(this._matrix.coffs[0], this._matrix.coffs[3], this._matrix.coffs[1], this._matrix.coffs[4]);
|
|
195614
195676
|
// areas in arc of unit circle with radians limits
|
|
@@ -196771,19 +196833,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
196771
196833
|
/* harmony export */ CurveChain: () => (/* binding */ CurveChain),
|
|
196772
196834
|
/* harmony export */ CurveCollection: () => (/* binding */ CurveCollection)
|
|
196773
196835
|
/* harmony export */ });
|
|
196774
|
-
/* harmony import */ var
|
|
196836
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
196775
196837
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
196776
|
-
/* harmony import */ var
|
|
196838
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
196777
196839
|
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
196778
|
-
/* harmony import */ var
|
|
196779
|
-
/* harmony import */ var
|
|
196780
|
-
/* harmony import */ var
|
|
196781
|
-
/* harmony import */ var
|
|
196782
|
-
/* harmony import */ var
|
|
196840
|
+
/* harmony import */ var _internalContexts_CloneCurvesContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/CloneCurvesContext */ "../../core/geometry/lib/esm/curve/internalContexts/CloneCurvesContext.js");
|
|
196841
|
+
/* harmony import */ var _internalContexts_CloneWithExpandedLineStrings__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internalContexts/CloneWithExpandedLineStrings */ "../../core/geometry/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js");
|
|
196842
|
+
/* harmony import */ var _internalContexts_CountLinearPartsSearchContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./internalContexts/CountLinearPartsSearchContext */ "../../core/geometry/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js");
|
|
196843
|
+
/* harmony import */ var _internalContexts_GapSearchContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./internalContexts/GapSearchContext */ "../../core/geometry/lib/esm/curve/internalContexts/GapSearchContext.js");
|
|
196844
|
+
/* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
|
|
196783
196845
|
/* harmony import */ var _internalContexts_SumLengthsContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internalContexts/SumLengthsContext */ "../../core/geometry/lib/esm/curve/internalContexts/SumLengthsContext.js");
|
|
196784
|
-
/* harmony import */ var
|
|
196785
|
-
/* harmony import */ var
|
|
196786
|
-
/* harmony import */ var
|
|
196846
|
+
/* harmony import */ var _internalContexts_TransformInPlaceContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./internalContexts/TransformInPlaceContext */ "../../core/geometry/lib/esm/curve/internalContexts/TransformInPlaceContext.js");
|
|
196847
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
196848
|
+
/* harmony import */ var _ProxyCurve__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ProxyCurve */ "../../core/geometry/lib/esm/curve/ProxyCurve.js");
|
|
196849
|
+
/* harmony import */ var _internalContexts_AnnounceTangentStrokeHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internalContexts/AnnounceTangentStrokeHandler */ "../../core/geometry/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js");
|
|
196850
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
196787
196851
|
/*---------------------------------------------------------------------------------------------
|
|
196788
196852
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
196789
196853
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -196804,6 +196868,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
196804
196868
|
|
|
196805
196869
|
|
|
196806
196870
|
|
|
196871
|
+
|
|
196872
|
+
|
|
196807
196873
|
/**
|
|
196808
196874
|
* A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
|
|
196809
196875
|
* - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.
|
|
@@ -196844,6 +196910,69 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
196844
196910
|
}
|
|
196845
196911
|
return detailA;
|
|
196846
196912
|
}
|
|
196913
|
+
/**
|
|
196914
|
+
* Announce all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to
|
|
196915
|
+
* the contained curves in the view defined by `options.vectorToEye`.
|
|
196916
|
+
* * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve
|
|
196917
|
+
* tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to
|
|
196918
|
+
* `options.vectorToEye`.
|
|
196919
|
+
* @param spacePoint point in space.
|
|
196920
|
+
* @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused
|
|
196921
|
+
* internally, so it should be cloned in the callback if it needs to be saved.
|
|
196922
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
196923
|
+
*/
|
|
196924
|
+
emitTangents(spacePoint, announceTangent, options) {
|
|
196925
|
+
const strokeHandler = new _internalContexts_AnnounceTangentStrokeHandler__WEBPACK_IMPORTED_MODULE_3__.AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);
|
|
196926
|
+
if (this.children !== undefined) {
|
|
196927
|
+
for (const child of this.children) {
|
|
196928
|
+
if (child instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__.CurvePrimitive)
|
|
196929
|
+
child.emitStrokableParts(strokeHandler, options?.strokeOptions);
|
|
196930
|
+
else if (child instanceof CurveCollection)
|
|
196931
|
+
child.emitTangents(spacePoint, announceTangent, options);
|
|
196932
|
+
}
|
|
196933
|
+
}
|
|
196934
|
+
}
|
|
196935
|
+
/**
|
|
196936
|
+
* Return all points `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the
|
|
196937
|
+
* contained curves in the view defined by `options.vectorToEye`.
|
|
196938
|
+
* * See [[emitTangents]] for the definition of tangency employed.
|
|
196939
|
+
* @param spacePoint point in space.
|
|
196940
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
196941
|
+
* @returns an array of details of all tangent points or undefined if no tangent was found.
|
|
196942
|
+
*/
|
|
196943
|
+
allTangents(spacePoint, options) {
|
|
196944
|
+
const tangents = [];
|
|
196945
|
+
this.emitTangents(spacePoint, (t) => tangents.push(t.clone()), options);
|
|
196946
|
+
return (tangents.length === 0) ? undefined : tangents;
|
|
196947
|
+
}
|
|
196948
|
+
/**
|
|
196949
|
+
* Return the point `P` on the contained curves such that the line containing `spacePoint` and `P` is tangent to the
|
|
196950
|
+
* contained curves in the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.
|
|
196951
|
+
* * See [[emitTangents]] for the definition of tangency employed.
|
|
196952
|
+
* @param spacePoint point in space.
|
|
196953
|
+
* @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.
|
|
196954
|
+
* @returns the detail of the closest tangent point or undefined if no tangent was found.
|
|
196955
|
+
*/
|
|
196956
|
+
closestTangent(spacePoint, options) {
|
|
196957
|
+
const hint = options?.hintPoint ?? spacePoint;
|
|
196958
|
+
let toLocal;
|
|
196959
|
+
if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))
|
|
196960
|
+
toLocal = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_5__.Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);
|
|
196961
|
+
const measureHintDist2 = (pt) => {
|
|
196962
|
+
return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);
|
|
196963
|
+
};
|
|
196964
|
+
let closestTangent;
|
|
196965
|
+
let closestDist2 = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.largeCoordinateResult;
|
|
196966
|
+
const collectClosestTangent = (tangent) => {
|
|
196967
|
+
const dist2 = measureHintDist2(tangent.point);
|
|
196968
|
+
if (!closestTangent || dist2 < closestDist2) {
|
|
196969
|
+
closestTangent = tangent.clone(closestTangent);
|
|
196970
|
+
closestDist2 = dist2;
|
|
196971
|
+
}
|
|
196972
|
+
};
|
|
196973
|
+
this.emitTangents(spacePoint, collectClosestTangent, options);
|
|
196974
|
+
return closestTangent;
|
|
196975
|
+
}
|
|
196847
196976
|
/** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */
|
|
196848
196977
|
reverseInPlace() {
|
|
196849
196978
|
for (const curve of this.children)
|
|
@@ -196857,27 +196986,27 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
196857
196986
|
* "unstructured" so gaps should not be semantically meaningful.
|
|
196858
196987
|
*/
|
|
196859
196988
|
maxGap() {
|
|
196860
|
-
return
|
|
196989
|
+
return _internalContexts_GapSearchContext__WEBPACK_IMPORTED_MODULE_7__.GapSearchContext.maxGap(this);
|
|
196861
196990
|
}
|
|
196862
196991
|
/** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */
|
|
196863
196992
|
checkForNonLinearPrimitives() {
|
|
196864
|
-
return
|
|
196993
|
+
return _internalContexts_CountLinearPartsSearchContext__WEBPACK_IMPORTED_MODULE_8__.CountLinearPartsSearchContext.hasNonLinearPrimitives(this);
|
|
196865
196994
|
}
|
|
196866
196995
|
/** Apply transform recursively to children */
|
|
196867
196996
|
tryTransformInPlace(transform) {
|
|
196868
|
-
return
|
|
196997
|
+
return _internalContexts_TransformInPlaceContext__WEBPACK_IMPORTED_MODULE_9__.TransformInPlaceContext.tryTransformInPlace(this, transform);
|
|
196869
196998
|
}
|
|
196870
196999
|
/** Return a deep copy. */
|
|
196871
197000
|
clone() {
|
|
196872
|
-
return
|
|
197001
|
+
return _internalContexts_CloneCurvesContext__WEBPACK_IMPORTED_MODULE_10__.CloneCurvesContext.clone(this);
|
|
196873
197002
|
}
|
|
196874
197003
|
/** Create a deep copy of transformed curves. */
|
|
196875
197004
|
cloneTransformed(transform) {
|
|
196876
|
-
return
|
|
197005
|
+
return _internalContexts_CloneCurvesContext__WEBPACK_IMPORTED_MODULE_10__.CloneCurvesContext.clone(this, transform);
|
|
196877
197006
|
}
|
|
196878
197007
|
/** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
|
|
196879
197008
|
cloneWithExpandedLineStrings() {
|
|
196880
|
-
return
|
|
197009
|
+
return _internalContexts_CloneWithExpandedLineStrings__WEBPACK_IMPORTED_MODULE_11__.CloneWithExpandedLineStrings.clone(this);
|
|
196881
197010
|
}
|
|
196882
197011
|
/**
|
|
196883
197012
|
* Push all CurvePrimitives contained in the instance onto the `results` array.
|
|
@@ -196887,7 +197016,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
196887
197016
|
collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings = false) {
|
|
196888
197017
|
if (this.children) {
|
|
196889
197018
|
for (const child of this.children) {
|
|
196890
|
-
if (child instanceof
|
|
197019
|
+
if (child instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__.CurvePrimitive)
|
|
196891
197020
|
child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
196892
197021
|
else if (child instanceof CurveCollection)
|
|
196893
197022
|
child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
@@ -196967,7 +197096,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
196967
197096
|
static createCurveLocationDetailOnAnyCurvePrimitive(source, fraction = 0.5) {
|
|
196968
197097
|
if (!source)
|
|
196969
197098
|
return undefined;
|
|
196970
|
-
if (source instanceof
|
|
197099
|
+
if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__.CurvePrimitive) {
|
|
196971
197100
|
return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);
|
|
196972
197101
|
}
|
|
196973
197102
|
else if (source instanceof CurveCollection && source.children !== undefined)
|
|
@@ -196987,7 +197116,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
196987
197116
|
* end of the ray.
|
|
196988
197117
|
*/
|
|
196989
197118
|
projectedParameterRange(ray, lowHigh) {
|
|
196990
|
-
return
|
|
197119
|
+
return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
196991
197120
|
}
|
|
196992
197121
|
/** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */
|
|
196993
197122
|
findParentOfDescendant(descendant) {
|
|
@@ -197076,7 +197205,7 @@ class CurveChain extends CurveCollection {
|
|
|
197076
197205
|
if (index >= 0 && index < n) // try simplest non-cyclic access first
|
|
197077
197206
|
return this.children[index];
|
|
197078
197207
|
if (cyclic) {
|
|
197079
|
-
const index2 =
|
|
197208
|
+
const index2 = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.modulo(index, n);
|
|
197080
197209
|
return this.children[index2];
|
|
197081
197210
|
}
|
|
197082
197211
|
return undefined;
|
|
@@ -197096,7 +197225,7 @@ class CurveChain extends CurveCollection {
|
|
|
197096
197225
|
const children = tree.children;
|
|
197097
197226
|
if (children.length === 1) {
|
|
197098
197227
|
const ls = children[0];
|
|
197099
|
-
if (ls instanceof
|
|
197228
|
+
if (ls instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_13__.LineString3d)
|
|
197100
197229
|
return ls.packedPoints;
|
|
197101
197230
|
}
|
|
197102
197231
|
}
|
|
@@ -197108,7 +197237,7 @@ class CurveChain extends CurveCollection {
|
|
|
197108
197237
|
* @return whether the child was added
|
|
197109
197238
|
*/
|
|
197110
197239
|
tryAddChild(child) {
|
|
197111
|
-
if (child && child instanceof
|
|
197240
|
+
if (child && child instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__.CurvePrimitive) {
|
|
197112
197241
|
this._curves.push(child);
|
|
197113
197242
|
return true;
|
|
197114
197243
|
}
|
|
@@ -197150,7 +197279,7 @@ class CurveChain extends CurveCollection {
|
|
|
197150
197279
|
if (alsoSearchProxies ?? false) {
|
|
197151
197280
|
for (let i = 0; i < this._curves.length; i++) {
|
|
197152
197281
|
const childCurve = this._curves[i];
|
|
197153
|
-
if (childCurve instanceof
|
|
197282
|
+
if (childCurve instanceof _ProxyCurve__WEBPACK_IMPORTED_MODULE_14__.ProxyCurve) {
|
|
197154
197283
|
if (childCurve.proxyCurve === target)
|
|
197155
197284
|
return i;
|
|
197156
197285
|
}
|
|
@@ -197214,8 +197343,8 @@ class BagOfCurves extends CurveCollection {
|
|
|
197214
197343
|
const clone = new BagOfCurves();
|
|
197215
197344
|
let child;
|
|
197216
197345
|
for (child of this.children) {
|
|
197217
|
-
if (child instanceof
|
|
197218
|
-
const ls =
|
|
197346
|
+
if (child instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__.CurvePrimitive) {
|
|
197347
|
+
const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_13__.LineString3d.create();
|
|
197219
197348
|
child.emitStrokes(ls, options);
|
|
197220
197349
|
if (ls)
|
|
197221
197350
|
clone.children.push(ls);
|
|
@@ -198297,19 +198426,19 @@ function optionalUpdate(source, result) {
|
|
|
198297
198426
|
* @public
|
|
198298
198427
|
*/
|
|
198299
198428
|
class CurveLocationDetail {
|
|
198300
|
-
/** The curve being evaluated */
|
|
198429
|
+
/** The curve being evaluated. */
|
|
198301
198430
|
curve;
|
|
198302
|
-
/** Optional ray */
|
|
198431
|
+
/** Optional ray. */
|
|
198303
198432
|
ray;
|
|
198304
|
-
/** The fractional position along the curve */
|
|
198433
|
+
/** The fractional position along the curve. */
|
|
198305
198434
|
fraction;
|
|
198306
|
-
/** Detail condition of the role this point has in some context */
|
|
198435
|
+
/** Detail condition of the role this point has in some context. */
|
|
198307
198436
|
intervalRole;
|
|
198308
|
-
/** The point on the curve */
|
|
198437
|
+
/** The point on the curve. */
|
|
198309
198438
|
point;
|
|
198310
|
-
/** A vector (e.g. tangent vector) in context */
|
|
198439
|
+
/** A vector (e.g. tangent vector) in context. */
|
|
198311
198440
|
vectorInCurveLocationDetail;
|
|
198312
|
-
/** A context-specific numeric value
|
|
198441
|
+
/** A context-specific numeric value (e.g., a distance). */
|
|
198313
198442
|
a;
|
|
198314
198443
|
/**
|
|
198315
198444
|
* Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position
|
|
@@ -198319,12 +198448,12 @@ class CurveLocationDetail {
|
|
|
198319
198448
|
childDetail;
|
|
198320
198449
|
/**
|
|
198321
198450
|
* A status indicator for certain searches.
|
|
198322
|
-
* * e.g
|
|
198451
|
+
* * e.g., CurvePrimitive.moveSignedDistanceFromFraction.
|
|
198323
198452
|
*/
|
|
198324
198453
|
curveSearchStatus;
|
|
198325
|
-
/** (Optional) second fraction, e.g. end of interval of coincident curves */
|
|
198454
|
+
/** (Optional) second fraction, e.g. end of interval of coincident curves. */
|
|
198326
198455
|
fraction1;
|
|
198327
|
-
/** (Optional) second point, e.g. end of interval of coincident curves */
|
|
198456
|
+
/** (Optional) second point, e.g. end of interval of coincident curves. */
|
|
198328
198457
|
point1;
|
|
198329
198458
|
/** A context-specific temporary point, e.g. for intermediate calculations. */
|
|
198330
198459
|
pointQ;
|
|
@@ -198335,26 +198464,26 @@ class CurveLocationDetail {
|
|
|
198335
198464
|
this.point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
198336
198465
|
this.a = 0.0;
|
|
198337
198466
|
}
|
|
198338
|
-
/** Set the (optional) intervalRole field */
|
|
198467
|
+
/** Set the (optional) intervalRole field. */
|
|
198339
198468
|
setIntervalRole(value) {
|
|
198340
198469
|
this.intervalRole = value;
|
|
198341
198470
|
}
|
|
198342
|
-
/** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */
|
|
198471
|
+
/** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1. */
|
|
198343
198472
|
captureFraction1Point1(fraction1, point1) {
|
|
198344
198473
|
this.fraction1 = fraction1;
|
|
198345
198474
|
this.point1 = point1;
|
|
198346
198475
|
}
|
|
198347
|
-
/** Test if this pair has fraction1 defined */
|
|
198476
|
+
/** Test if this pair has fraction1 defined. */
|
|
198348
198477
|
get hasFraction1() {
|
|
198349
198478
|
return this.fraction1 !== undefined;
|
|
198350
198479
|
}
|
|
198351
|
-
/** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */
|
|
198480
|
+
/** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex). */
|
|
198352
198481
|
get isIsolated() {
|
|
198353
198482
|
return this.intervalRole === undefined
|
|
198354
198483
|
|| this.intervalRole === CurveIntervalRole.isolated
|
|
198355
198484
|
|| this.intervalRole === CurveIntervalRole.isolatedAtVertex;
|
|
198356
198485
|
}
|
|
198357
|
-
/** Return the fraction delta. (0 if no fraction1) */
|
|
198486
|
+
/** Return the fraction delta. (0 if no fraction1). */
|
|
198358
198487
|
get fractionDelta() {
|
|
198359
198488
|
return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;
|
|
198360
198489
|
}
|
|
@@ -198375,7 +198504,7 @@ class CurveLocationDetail {
|
|
|
198375
198504
|
this.point1 = undefined;
|
|
198376
198505
|
}
|
|
198377
198506
|
/**
|
|
198378
|
-
* Return a complete copy, WITH CAVEATS
|
|
198507
|
+
* Return a complete copy, WITH CAVEATS.
|
|
198379
198508
|
* * curve member is copied as a reference.
|
|
198380
198509
|
* * point and vector members are cloned.
|
|
198381
198510
|
*/
|
|
@@ -198397,9 +198526,9 @@ class CurveLocationDetail {
|
|
|
198397
198526
|
/**
|
|
198398
198527
|
* Updated in this instance.
|
|
198399
198528
|
* * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)
|
|
198400
|
-
* * point and vector updates are by data copy (not capture of pointers)
|
|
198401
|
-
* @param fraction (required) fraction to install
|
|
198402
|
-
* @param point
|
|
198529
|
+
* * point and vector updates are by data copy (not capture of pointers).
|
|
198530
|
+
* @param fraction (required) fraction to install.
|
|
198531
|
+
* @param point (required) point to install.
|
|
198403
198532
|
* @param vector (optional) vector to install.
|
|
198404
198533
|
* @param a (optional) numeric value to install.
|
|
198405
198534
|
*/
|
|
@@ -198412,9 +198541,9 @@ class CurveLocationDetail {
|
|
|
198412
198541
|
/**
|
|
198413
198542
|
* Updated in this instance.
|
|
198414
198543
|
* * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)
|
|
198415
|
-
* * point and vector updates are by data copy (not capture of the ray members)
|
|
198416
|
-
* @param fraction (required) fraction to install
|
|
198417
|
-
* @param ray (required) point and vector to install
|
|
198544
|
+
* * point and vector updates are by data copy (not capture of the ray members).
|
|
198545
|
+
* @param fraction (required) fraction to install.
|
|
198546
|
+
* @param ray (required) point and vector to install.
|
|
198418
198547
|
* @param a (optional) numeric value to install.
|
|
198419
198548
|
*/
|
|
198420
198549
|
setFR(fraction, ray, a = 0) {
|
|
@@ -198454,7 +198583,7 @@ class CurveLocationDetail {
|
|
|
198454
198583
|
result.point.setFromPoint3d(point);
|
|
198455
198584
|
return result;
|
|
198456
198585
|
}
|
|
198457
|
-
/** Create with CurvePrimitive pointer, fraction, and point coordinates */
|
|
198586
|
+
/** Create with CurvePrimitive pointer, fraction, and point coordinates. */
|
|
198458
198587
|
static createCurveFractionPointDistanceCurveSearchStatus(curve, fraction, point, distance, status, result) {
|
|
198459
198588
|
result = result ? result : new CurveLocationDetail();
|
|
198460
198589
|
result.curve = curve;
|
|
@@ -198550,7 +198679,7 @@ class CurveLocationDetail {
|
|
|
198550
198679
|
* @param fraction candidate fraction
|
|
198551
198680
|
* @param point candidate point
|
|
198552
198681
|
* @param a candidate distance
|
|
198553
|
-
* @returns true if the given distance is smaller (and hence this detail was updated
|
|
198682
|
+
* @returns true if the given distance is smaller (and hence this detail was updated)
|
|
198554
198683
|
*/
|
|
198555
198684
|
updateIfCloserCurveFractionPointDistance(curve, fraction, point, a) {
|
|
198556
198685
|
if (this.a < a)
|
|
@@ -203612,13 +203741,19 @@ class MapCurvePrimitiveToCurveLocationDetailPairArray {
|
|
|
203612
203741
|
* @internal
|
|
203613
203742
|
*/
|
|
203614
203743
|
class PlanarSubdivision {
|
|
203615
|
-
/**
|
|
203744
|
+
/**
|
|
203745
|
+
* Create a graph from an array of curves, and an array of the curves' precomputed intersections.
|
|
203746
|
+
* Z-coordinates are ignored.
|
|
203747
|
+
*/
|
|
203616
203748
|
static assembleHalfEdgeGraph(primitives, allPairs, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
203617
|
-
|
|
203749
|
+
// map from key CurvePrimitive to CurveLocationDetailPair
|
|
203750
|
+
const detailByPrimitive = new MapCurvePrimitiveToCurveLocationDetailPairArray();
|
|
203618
203751
|
for (const pair of allPairs)
|
|
203619
203752
|
detailByPrimitive.insertPair(pair);
|
|
203620
|
-
if (primitives.length > detailByPrimitive.primitiveToPair.size)
|
|
203621
|
-
|
|
203753
|
+
if (primitives.length > detailByPrimitive.primitiveToPair.size) {
|
|
203754
|
+
// otherwise, these single-primitive loops are missing from the graph
|
|
203755
|
+
detailByPrimitive.splitAndAppendMissingClosedPrimitives(primitives, mergeTolerance);
|
|
203756
|
+
}
|
|
203622
203757
|
const graph = new _topology_Graph__WEBPACK_IMPORTED_MODULE_5__.HalfEdgeGraph();
|
|
203623
203758
|
for (const entry of detailByPrimitive.primitiveToPair.entries()) {
|
|
203624
203759
|
const p = entry[0];
|
|
@@ -203629,7 +203764,11 @@ class PlanarSubdivision {
|
|
|
203629
203764
|
const detail = getDetailOnCurve(detailPair, p);
|
|
203630
203765
|
const detail0 = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(p, detail.fraction, detail.point);
|
|
203631
203766
|
const detail1 = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(p, detail.fraction1, detail.point1);
|
|
203632
|
-
return [
|
|
203767
|
+
return [
|
|
203768
|
+
...accumulator,
|
|
203769
|
+
_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detail0, detail0),
|
|
203770
|
+
_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detail1, detail1),
|
|
203771
|
+
];
|
|
203633
203772
|
}, []);
|
|
203634
203773
|
// lexical sort on p intersection fraction
|
|
203635
203774
|
details.sort((pairA, pairB) => {
|
|
@@ -203649,9 +203788,9 @@ class PlanarSubdivision {
|
|
|
203649
203788
|
return graph;
|
|
203650
203789
|
}
|
|
203651
203790
|
/**
|
|
203652
|
-
* Create a pair of mated half edges referencing an interval of a primitive
|
|
203653
|
-
*
|
|
203654
|
-
* @param graph containing graph
|
|
203791
|
+
* Create a pair of mated half edges referencing an interval of a primitive.
|
|
203792
|
+
* * no action if start and end points are identical.
|
|
203793
|
+
* @param graph containing graph
|
|
203655
203794
|
* @param p the curve
|
|
203656
203795
|
* @param point0 start point
|
|
203657
203796
|
* @param fraction0 starting fraction
|
|
@@ -203674,7 +203813,8 @@ class PlanarSubdivision {
|
|
|
203674
203813
|
return { point: point1, fraction: fraction1 };
|
|
203675
203814
|
}
|
|
203676
203815
|
/**
|
|
203677
|
-
* Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative,
|
|
203816
|
+
* Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative,
|
|
203817
|
+
* or sliver loops.
|
|
203678
203818
|
* @param zeroAreaTolerance absolute area tolerance for sliver face detection
|
|
203679
203819
|
* @param isSliverFace whether the loop is known a priori (e.g., via topology) to have zero area
|
|
203680
203820
|
* @returns the area (forced to zero if within tolerance)
|
|
@@ -204447,9 +204587,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204447
204587
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
204448
204588
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
204449
204589
|
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
204450
|
-
/* harmony import */ var
|
|
204590
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
204591
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
204451
204592
|
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
204452
|
-
/* harmony import */ var
|
|
204593
|
+
/* harmony import */ var _StrokeOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
204453
204594
|
/*---------------------------------------------------------------------------------------------
|
|
204454
204595
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
204455
204596
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -204461,6 +204602,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204461
204602
|
|
|
204462
204603
|
|
|
204463
204604
|
|
|
204605
|
+
|
|
204464
204606
|
/**
|
|
204465
204607
|
* Implementation class for computing XY area moments.
|
|
204466
204608
|
* @internal
|
|
@@ -204526,20 +204668,19 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204526
204668
|
return momentData;
|
|
204527
204669
|
}
|
|
204528
204670
|
handleAnyRegion(region) {
|
|
204529
|
-
const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
|
|
204530
204671
|
// guarantee there is no overlapping children
|
|
204531
204672
|
const merged = _RegionOps__WEBPACK_IMPORTED_MODULE_4__.RegionOps.regionBooleanXY(region, undefined, _RegionOps__WEBPACK_IMPORTED_MODULE_4__.RegionBinaryOpType.Union);
|
|
204532
|
-
if (merged)
|
|
204533
|
-
for (const child of merged.children) {
|
|
204534
|
-
const childMoments = child.dispatchToGeometryHandler(this);
|
|
204535
|
-
if (childMoments) {
|
|
204536
|
-
const sign0 = childMoments.signFactor(1.0);
|
|
204537
|
-
summedMoments.accumulateProducts(childMoments, sign0);
|
|
204538
|
-
}
|
|
204539
|
-
}
|
|
204540
|
-
}
|
|
204541
|
-
else {
|
|
204673
|
+
if (!merged)
|
|
204542
204674
|
return undefined;
|
|
204675
|
+
if (merged instanceof _Loop__WEBPACK_IMPORTED_MODULE_5__.Loop)
|
|
204676
|
+
return this.handleLoop(merged);
|
|
204677
|
+
const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
|
|
204678
|
+
for (const child of merged.children) {
|
|
204679
|
+
const childMoments = child.dispatchToGeometryHandler(this);
|
|
204680
|
+
if (childMoments) {
|
|
204681
|
+
const sign0 = childMoments.signFactor(1.0);
|
|
204682
|
+
summedMoments.accumulateProducts(childMoments, sign0);
|
|
204683
|
+
}
|
|
204543
204684
|
}
|
|
204544
204685
|
return summedMoments;
|
|
204545
204686
|
}
|
|
@@ -204555,7 +204696,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204555
204696
|
getStrokeOptions() {
|
|
204556
204697
|
if (this._strokeOptions)
|
|
204557
204698
|
return this._strokeOptions;
|
|
204558
|
-
const options =
|
|
204699
|
+
const options = _StrokeOptions__WEBPACK_IMPORTED_MODULE_6__.StrokeOptions.createForCurves();
|
|
204559
204700
|
// this is unusually fine for stroking, but appropriate for sum.
|
|
204560
204701
|
options.angleTol = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(5.0);
|
|
204561
204702
|
this._strokeOptions = options;
|
|
@@ -204566,22 +204707,22 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204566
204707
|
* * Stroke the curve and accumulate stroke array.
|
|
204567
204708
|
*/
|
|
204568
204709
|
handleCurvePrimitive(cp) {
|
|
204569
|
-
const strokes =
|
|
204710
|
+
const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
204570
204711
|
const options = this.getStrokeOptions();
|
|
204571
204712
|
cp.emitStrokes(strokes, options);
|
|
204572
204713
|
this.handleLineString3d(strokes);
|
|
204573
204714
|
}
|
|
204574
204715
|
/** Handle strongly typed BSplineCurve3d as generic curve primitive. */
|
|
204575
204716
|
handleBSplineCurve3d(g) {
|
|
204576
|
-
|
|
204717
|
+
this.handleCurvePrimitive(g);
|
|
204577
204718
|
}
|
|
204578
204719
|
/** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
|
|
204579
204720
|
handleBSplineCurve3dH(g) {
|
|
204580
|
-
|
|
204721
|
+
this.handleCurvePrimitive(g);
|
|
204581
204722
|
}
|
|
204582
204723
|
/** Handle strongly typed TransitionSpiral as generic curve primitive. */
|
|
204583
204724
|
handleTransitionSpiral(g) {
|
|
204584
|
-
|
|
204725
|
+
this.handleCurvePrimitive(g);
|
|
204585
204726
|
}
|
|
204586
204727
|
}
|
|
204587
204728
|
|
|
@@ -204923,6 +205064,28 @@ class RegionOps {
|
|
|
204923
205064
|
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
|
|
204924
205065
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204925
205066
|
}
|
|
205067
|
+
/**
|
|
205068
|
+
* Simplify the type of the region by stripping redundant parent(s).
|
|
205069
|
+
* * No Boolean operations are performed.
|
|
205070
|
+
* * Invalid inputs (such as childless regions) are not corrected.
|
|
205071
|
+
* @param region region to simplify
|
|
205072
|
+
* @returns
|
|
205073
|
+
* * For a [[UnionRegion]] with exactly one child, return it if it is a [[Loop]],
|
|
205074
|
+
* or if it is a [[ParityRegion]] with multiple children, otherwise return the `ParityRegion`'s `Loop`.
|
|
205075
|
+
* * For a `ParityRegion` with exactly one `Loop`, return it.
|
|
205076
|
+
* * All other inputs returned unchanged.
|
|
205077
|
+
*/
|
|
205078
|
+
static simplifyRegionType(region) {
|
|
205079
|
+
if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
|
|
205080
|
+
if (region.children.length === 1)
|
|
205081
|
+
return this.simplifyRegionType(region.children[0]);
|
|
205082
|
+
}
|
|
205083
|
+
else if (region instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
205084
|
+
if (region.children.length === 1)
|
|
205085
|
+
return region.children[0];
|
|
205086
|
+
}
|
|
205087
|
+
return region;
|
|
205088
|
+
}
|
|
204926
205089
|
/**
|
|
204927
205090
|
* Return areas defined by a boolean operation.
|
|
204928
205091
|
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
@@ -204936,8 +205099,6 @@ class RegionOps {
|
|
|
204936
205099
|
* to connect interior loops to exterior loops.
|
|
204937
205100
|
*/
|
|
204938
205101
|
static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204939
|
-
// Always return UnionRegion for now, but keep return type as AnyRegion.
|
|
204940
|
-
// In the future, we might return the *simplest* region type.
|
|
204941
205102
|
const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
|
|
204942
205103
|
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
|
|
204943
205104
|
context.addMembers(loopsA, loopsB);
|
|
@@ -204956,7 +205117,7 @@ class RegionOps {
|
|
|
204956
205117
|
result.tryAddChild(loop);
|
|
204957
205118
|
}
|
|
204958
205119
|
});
|
|
204959
|
-
return result;
|
|
205120
|
+
return result ? this.simplifyRegionType(result) : undefined;
|
|
204960
205121
|
}
|
|
204961
205122
|
/**
|
|
204962
205123
|
* Return a polyface whose facets are a boolean operation between the input regions.
|
|
@@ -205610,14 +205771,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
205610
205771
|
* @internal
|
|
205611
205772
|
*/
|
|
205612
205773
|
class RegionOpsFaceToFaceSearchCallbacks {
|
|
205613
|
-
/** Announce a representative node on the outer face of a component */
|
|
205614
|
-
startComponent(_node) {
|
|
205615
|
-
|
|
205616
|
-
|
|
205617
|
-
/** Announce face
|
|
205618
|
-
|
|
205619
|
-
|
|
205620
|
-
|
|
205774
|
+
/** Announce a representative node on the outer face of a component. */
|
|
205775
|
+
startComponent(_node) {
|
|
205776
|
+
return true;
|
|
205777
|
+
}
|
|
205778
|
+
/** Announce return to outer face. */
|
|
205779
|
+
finishComponent(_node) {
|
|
205780
|
+
return true;
|
|
205781
|
+
}
|
|
205782
|
+
/** Announce face entry. */
|
|
205783
|
+
enterFace(_facePathStack, _newFaceNode) {
|
|
205784
|
+
return true;
|
|
205785
|
+
}
|
|
205786
|
+
/** Announce face exit. */
|
|
205787
|
+
leaveFace(_facePathStack, _newFaceNode) {
|
|
205788
|
+
return true;
|
|
205789
|
+
}
|
|
205621
205790
|
}
|
|
205622
205791
|
/**
|
|
205623
205792
|
* Implementation of `RegionOpsFaceToFaceSearchCallbacks` for binary boolean sweep with polygonal regions.
|
|
@@ -205680,14 +205849,14 @@ class RegionOpsBinaryBooleanSweepCallbacks extends RegionOpsFaceToFaceSearchCall
|
|
|
205680
205849
|
*/
|
|
205681
205850
|
class RegionOpsFaceToFaceSearch {
|
|
205682
205851
|
/**
|
|
205683
|
-
*
|
|
205852
|
+
* Run a DFS with face-to-face step announcements.
|
|
205684
205853
|
* * false return from any function terminates search immediately.
|
|
205685
205854
|
* * all reachable nodes assumed to have both visit masks clear.
|
|
205686
205855
|
* @param graph containing graph.
|
|
205687
205856
|
* @param seed first node to visit.
|
|
205688
205857
|
* @param faceHasBeenVisited mask marking faces that have been seen.
|
|
205689
205858
|
* @param nodeHasBeenVisited mask marking node-to-node step around face.
|
|
205690
|
-
*
|
|
205859
|
+
* @param callbacks callbacks.
|
|
205691
205860
|
*/
|
|
205692
205861
|
static faceToFaceSearchFromOuterLoop(_graph, seed, faceHasBeenVisited, nodeHasBeenVisited, callbacks) {
|
|
205693
205862
|
if (seed.isMaskSet(faceHasBeenVisited))
|
|
@@ -205701,10 +205870,10 @@ class RegionOpsFaceToFaceSearch {
|
|
|
205701
205870
|
let entryNode = faceWalker;
|
|
205702
205871
|
let mate = faceWalker.edgeMate;
|
|
205703
205872
|
if (!mate.isMaskSet(faceHasBeenVisited)) {
|
|
205704
|
-
//
|
|
205705
|
-
//
|
|
205706
|
-
//
|
|
205707
|
-
//
|
|
205873
|
+
// The faceWalker seed is always on the base of the stack.
|
|
205874
|
+
// The stack then contains even-odd pairs of (entryNode, faceNode).
|
|
205875
|
+
// entryNode is the node where a face was entered.
|
|
205876
|
+
// faceNode is another node around that face.
|
|
205708
205877
|
facePathStack.push(faceWalker);
|
|
205709
205878
|
facePathStack.push(mate);
|
|
205710
205879
|
let faceNode = mate.faceSuccessor;
|
|
@@ -205735,13 +205904,13 @@ class RegionOpsFaceToFaceSearch {
|
|
|
205735
205904
|
entryNode = facePathStack[facePathStack.length - 1];
|
|
205736
205905
|
}
|
|
205737
205906
|
if (faceNode.isMaskSet(nodeHasBeenVisited)) {
|
|
205738
|
-
// this is disaster
|
|
205907
|
+
// this is disaster
|
|
205739
205908
|
return;
|
|
205740
205909
|
}
|
|
205741
205910
|
}
|
|
205742
205911
|
}
|
|
205743
205912
|
}
|
|
205744
|
-
// continue at outermost level
|
|
205913
|
+
// continue at outermost level
|
|
205745
205914
|
faceWalker = faceWalker.faceSuccessor;
|
|
205746
205915
|
} while (faceWalker !== seed);
|
|
205747
205916
|
callbacks.finishComponent(seed);
|
|
@@ -205871,7 +206040,9 @@ class RegionGroupMember {
|
|
|
205871
206040
|
this.parentGroup = parentGroup;
|
|
205872
206041
|
this.sweepState = 0;
|
|
205873
206042
|
}
|
|
205874
|
-
clearState() {
|
|
206043
|
+
clearState() {
|
|
206044
|
+
this.sweepState = 0;
|
|
206045
|
+
}
|
|
205875
206046
|
}
|
|
205876
206047
|
/**
|
|
205877
206048
|
* A `RegionGroup` is
|
|
@@ -206098,9 +206269,8 @@ class RegionBooleanContext {
|
|
|
206098
206269
|
this._announceFaceFunction = announceFaceFunction;
|
|
206099
206270
|
this.binaryOp = binaryOp;
|
|
206100
206271
|
this.graph.clearMask(_topology_Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.EXTERIOR);
|
|
206101
|
-
for (const group of [this.groupA, this.groupB])
|
|
206272
|
+
for (const group of [this.groupA, this.groupB])
|
|
206102
206273
|
group.clearState();
|
|
206103
|
-
}
|
|
206104
206274
|
const faceHasBeenVisitedMask = this.graph.grabMask();
|
|
206105
206275
|
const nodeHasBeenVisitedMask = this.graph.grabMask();
|
|
206106
206276
|
const componentArray = GraphComponentArray.create(this.graph);
|
|
@@ -206181,18 +206351,19 @@ class RegionBooleanContext {
|
|
|
206181
206351
|
return undefined;
|
|
206182
206352
|
}
|
|
206183
206353
|
// obligations to act as sweep callback ...
|
|
206184
|
-
/** Announce a representative node on the outer face of a component */
|
|
206354
|
+
/** Announce a representative node on the outer face of a component. */
|
|
206185
206355
|
startComponent(outerFaceNode) {
|
|
206186
206356
|
outerFaceNode.setMaskAroundFace(_topology_Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.EXTERIOR);
|
|
206187
206357
|
if (this._announceFaceFunction)
|
|
206188
206358
|
this._announceFaceFunction(this.graph, outerFaceNode, -1, faceAreaFromCurvedEdgeData(outerFaceNode));
|
|
206189
206359
|
return true;
|
|
206190
206360
|
}
|
|
206191
|
-
/** Announce return to outer face */
|
|
206361
|
+
/** Announce return to outer face. */
|
|
206192
206362
|
finishComponent(_node) {
|
|
206193
206363
|
return true;
|
|
206194
206364
|
}
|
|
206195
|
-
/**
|
|
206365
|
+
/**
|
|
206366
|
+
* Announce entry to a graph face.
|
|
206196
206367
|
* * Both both sides of a graph edge are from the same RegionGroupMember.
|
|
206197
206368
|
* * Hence "crossing that edge" changes the parity count for the RegionGroupMember that owns that edge by 1.
|
|
206198
206369
|
* * The parity count for other RegionGroupMembers are never affected by this crossing.
|
|
@@ -206213,8 +206384,9 @@ class RegionBooleanContext {
|
|
|
206213
206384
|
return true;
|
|
206214
206385
|
}
|
|
206215
206386
|
}
|
|
206216
|
-
/**
|
|
206217
|
-
*
|
|
206387
|
+
/**
|
|
206388
|
+
* Return xy area between (part of) a curve and the x axis through a reference point.
|
|
206389
|
+
* If detail is undefined or does not have both start and end fractions, just do trapezoid area.
|
|
206218
206390
|
*/
|
|
206219
206391
|
function areaUnderPartialCurveXY(detail, xyStart, xyEnd, referencePoint) {
|
|
206220
206392
|
// area between trapezoid and axis
|
|
@@ -206228,15 +206400,21 @@ function areaUnderPartialCurveXY(detail, xyStart, xyEnd, referencePoint) {
|
|
|
206228
206400
|
let areaToChord = 0.0;
|
|
206229
206401
|
if (detail && detail.curve && detail.hasFraction1) {
|
|
206230
206402
|
if (detail.curve instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d) {
|
|
206231
|
-
//
|
|
206403
|
+
// nothing to do for a line segment
|
|
206232
206404
|
}
|
|
206233
206405
|
else if (detail.curve instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_19__.Arc3d) {
|
|
206234
206406
|
areaToChord = detail.curve.areaToChordXY(detail.fraction, detail.fraction1);
|
|
206235
206407
|
}
|
|
206408
|
+
else {
|
|
206409
|
+
const partial = detail.curve.clonePartialCurve(detail.fraction, detail.fraction1);
|
|
206410
|
+
areaToChord = partial ?
|
|
206411
|
+
_RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYArea(_Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create(partial, _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(detail.point1, detail.point))) ?? 0
|
|
206412
|
+
: 0;
|
|
206413
|
+
}
|
|
206236
206414
|
}
|
|
206237
206415
|
return trapezoidArea + areaToChord;
|
|
206238
206416
|
}
|
|
206239
|
-
/** Compute face area for a face whose edges are decorated with CurveLocationDetail for their (partial) curves */
|
|
206417
|
+
/** Compute face area for a face whose edges are decorated with CurveLocationDetail for their (partial) curves. */
|
|
206240
206418
|
function faceAreaFromCurvedEdgeData(faceSeed) {
|
|
206241
206419
|
let area = 0.0;
|
|
206242
206420
|
let edge = faceSeed;
|
|
@@ -206259,8 +206437,7 @@ class GraphComponent {
|
|
|
206259
206437
|
this.faceAreas = [];
|
|
206260
206438
|
}
|
|
206261
206439
|
/**
|
|
206262
|
-
*
|
|
206263
|
-
*
|
|
206440
|
+
* Visit all vertices and edges in the component to build face area array and composite range.
|
|
206264
206441
|
* @param extendRangeForEdge optional function to compute edge range. If undefined, linear edge is assumed.
|
|
206265
206442
|
* @param faceAreaFunction optional function to compute face area. If undefined, linear edges are assumed.
|
|
206266
206443
|
*/
|
|
@@ -206284,7 +206461,8 @@ class GraphComponent {
|
|
|
206284
206461
|
}
|
|
206285
206462
|
}
|
|
206286
206463
|
}
|
|
206287
|
-
/**
|
|
206464
|
+
/**
|
|
206465
|
+
* Build and hold an array of component data for a HalfEdgeGraph.
|
|
206288
206466
|
* @internal
|
|
206289
206467
|
*/
|
|
206290
206468
|
class GraphComponentArray {
|
|
@@ -208772,6 +208950,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208772
208950
|
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
208773
208951
|
// The fraction and extend parameters allow all combinations to be passed in.
|
|
208774
208952
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
208953
|
+
const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
|
|
208954
|
+
let dist2;
|
|
208775
208955
|
// Arc: X = C + cU + sV
|
|
208776
208956
|
// Line: contains points A0,A1
|
|
208777
208957
|
// Arc point colinear with line if det (A0, A1, X) = 0
|
|
@@ -208782,6 +208962,10 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208782
208962
|
// project back to line.
|
|
208783
208963
|
if (this._worldToLocalPerspective) {
|
|
208784
208964
|
const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
208965
|
+
const radians0 = data.sweep.fractionToRadians(0);
|
|
208966
|
+
const pointB0H = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
|
|
208967
|
+
const radians1 = data.sweep.fractionToRadians(1);
|
|
208968
|
+
const pointB1H = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
208785
208969
|
const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
|
|
208786
208970
|
const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
|
|
208787
208971
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
|
|
@@ -208791,19 +208975,31 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208791
208975
|
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208792
208976
|
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208793
208977
|
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
208978
|
+
if (numRoots <= 0)
|
|
208979
|
+
return;
|
|
208794
208980
|
for (let i = 0; i < numRoots; i++) {
|
|
208795
208981
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
208796
|
-
|
|
208982
|
+
let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
|
|
208797
208983
|
const lineFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
|
|
208798
|
-
if (lineFraction !== undefined
|
|
208799
|
-
this.acceptFraction(extendA0, lineFraction, extendA1) &&
|
|
208800
|
-
|
|
208801
|
-
|
|
208984
|
+
if (lineFraction !== undefined) {
|
|
208985
|
+
if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
208986
|
+
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
208987
|
+
}
|
|
208988
|
+
else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
|
|
208989
|
+
const pointAH = lineFraction < 0.5 ? pointA0H : pointA1H;
|
|
208990
|
+
const pointBH = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0H : pointB1H;
|
|
208991
|
+
if ((dist2 = pointAH.realDistanceSquaredXY(pointBH)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
208992
|
+
this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
|
|
208993
|
+
}
|
|
208802
208994
|
}
|
|
208803
208995
|
}
|
|
208804
208996
|
}
|
|
208805
208997
|
else {
|
|
208806
208998
|
const data = arc.toTransformedVectors(this._worldToLocalAffine);
|
|
208999
|
+
const radians0 = data.sweep.fractionToRadians(0);
|
|
209000
|
+
const pointB0Local = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
|
|
209001
|
+
const radians1 = data.sweep.fractionToRadians(1);
|
|
209002
|
+
const pointB1Local = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
208807
209003
|
let pointA0Local = pointA0;
|
|
208808
209004
|
let pointA1Local = pointA1;
|
|
208809
209005
|
if (this._worldToLocalAffine) {
|
|
@@ -208817,16 +209013,22 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208817
209013
|
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208818
209014
|
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208819
209015
|
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
208820
|
-
|
|
208821
|
-
|
|
209016
|
+
if (numRoots <= 0)
|
|
209017
|
+
return;
|
|
208822
209018
|
for (let i = 0; i < numRoots; i++) {
|
|
208823
209019
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
208824
|
-
|
|
209020
|
+
let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
|
|
208825
209021
|
const lineFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
208826
|
-
if (lineFraction !== undefined
|
|
208827
|
-
this.acceptFraction(extendA0, lineFraction, extendA1,
|
|
208828
|
-
|
|
208829
|
-
|
|
209022
|
+
if (lineFraction !== undefined) {
|
|
209023
|
+
if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
209024
|
+
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
209025
|
+
}
|
|
209026
|
+
else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
|
|
209027
|
+
const pointALocal = lineFraction < 0.5 ? pointA0Local : pointA1Local;
|
|
209028
|
+
const pointBLocal = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0Local : pointB1Local;
|
|
209029
|
+
if ((dist2 = pointALocal.distanceSquaredXY(pointBLocal)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
209030
|
+
this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
|
|
209031
|
+
}
|
|
208830
209032
|
}
|
|
208831
209033
|
}
|
|
208832
209034
|
}
|
|
@@ -208994,7 +209196,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208994
209196
|
}
|
|
208995
209197
|
return ranges;
|
|
208996
209198
|
}
|
|
208997
|
-
dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients
|
|
209199
|
+
dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients
|
|
208998
209200
|
reversed) {
|
|
208999
209201
|
if (!this._xyzwA0)
|
|
209000
209202
|
this._xyzwA0 = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_3__.Point4d.create();
|
|
@@ -209038,7 +209240,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
209038
209240
|
let bezierBFraction = r;
|
|
209039
209241
|
bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
|
|
209040
209242
|
const segmentAFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
|
|
209041
|
-
if (segmentAFraction && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
|
|
209243
|
+
if (segmentAFraction !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
|
|
209042
209244
|
let bezierAFraction = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.interpolate(f0, segmentAFraction, f1);
|
|
209043
209245
|
// We have a near intersection at fractions on the two beziers
|
|
209044
209246
|
// Iterate on the curves for a true intersection
|
|
@@ -209060,7 +209262,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
209060
209262
|
}
|
|
209061
209263
|
}
|
|
209062
209264
|
}
|
|
209063
|
-
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB,
|
|
209265
|
+
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
|
|
209064
209266
|
const bezierSpanA = bcurveA.collectBezierSpans(true);
|
|
209065
209267
|
const bezierSpanB = bcurveB.collectBezierSpans(true);
|
|
209066
209268
|
const numA = bezierSpanA.length;
|
|
@@ -209079,9 +209281,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
209079
209281
|
const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
|
|
209080
209282
|
const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
|
|
209081
209283
|
if (strokeCountA < strokeCountB)
|
|
209082
|
-
this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB,
|
|
209284
|
+
this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, reversed);
|
|
209083
209285
|
else
|
|
209084
|
-
this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !
|
|
209286
|
+
this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !reversed);
|
|
209085
209287
|
}
|
|
209086
209288
|
}
|
|
209087
209289
|
}
|
|
@@ -216442,8 +216644,10 @@ class AngleSweep {
|
|
|
216442
216644
|
* @param fraction fraction of the sweep.
|
|
216443
216645
|
* @param radians0 start angle of sweep (in radians).
|
|
216444
216646
|
* @param radians1 end angle of sweep (in radians).
|
|
216445
|
-
* @param toNegativeFraction
|
|
216446
|
-
*
|
|
216647
|
+
* @param toNegativeFraction exterior fraction handling:
|
|
216648
|
+
* * if true, return `fraction` period-shifted to within one period of the start
|
|
216649
|
+
* * if false, return `fraction` period-shifted to within one period of the end
|
|
216650
|
+
* * if undefined, return the period-shift of `fraction` closest to [0,1].
|
|
216447
216651
|
* @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
|
|
216448
216652
|
* returned unchanged.
|
|
216449
216653
|
*/
|
|
@@ -216457,16 +216661,25 @@ class AngleSweep {
|
|
|
216457
216661
|
fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction
|
|
216458
216662
|
if (fraction + period < 1)
|
|
216459
216663
|
fraction += period; // it's really an interior fraction
|
|
216460
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(fraction)
|
|
216664
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(fraction))
|
|
216461
216665
|
return fraction;
|
|
216462
|
-
|
|
216666
|
+
if (toNegativeFraction === true)
|
|
216667
|
+
return fraction < 0 ? fraction : fraction - period;
|
|
216668
|
+
if (toNegativeFraction === false)
|
|
216669
|
+
return fraction > 1 ? fraction : fraction + period;
|
|
216670
|
+
const fractionDistFrom01 = fraction < 0 ? -fraction : fraction - 1;
|
|
216671
|
+
const fraction2 = fraction < 0 ? fraction + period : fraction - period; // period-shift with opposite sign
|
|
216672
|
+
const fraction2DistFrom01 = fraction2 < 0 ? -fraction2 : fraction2 - 1;
|
|
216673
|
+
return fractionDistFrom01 < fraction2DistFrom01 ? fraction : fraction2; // choose the period-shift closer to [0,1]
|
|
216463
216674
|
}
|
|
216464
216675
|
/**
|
|
216465
216676
|
* Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of
|
|
216466
216677
|
* zero on the desired side.
|
|
216467
216678
|
* @param fraction fraction of the sweep.
|
|
216468
|
-
* @param toNegativeFraction
|
|
216469
|
-
*
|
|
216679
|
+
* @param toNegativeFraction exterior fraction handling:
|
|
216680
|
+
* * if true, return `fraction` period-shifted to within one period of the start
|
|
216681
|
+
* * if false, return `fraction` period-shifted to within one period of the end
|
|
216682
|
+
* * if undefined, return the period-shift of `fraction` closest to [0,1].
|
|
216470
216683
|
* @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
|
|
216471
216684
|
* returned unchanged.
|
|
216472
216685
|
*/
|
|
@@ -239173,8 +239386,7 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
239173
239386
|
distanceSquaredXYZW(other) {
|
|
239174
239387
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);
|
|
239175
239388
|
}
|
|
239176
|
-
/** Return the distance between the instance and other after normalizing by weights
|
|
239177
|
-
*/
|
|
239389
|
+
/** Return the xy distance between the instance and `other` after normalizing by weights */
|
|
239178
239390
|
realDistanceXY(other) {
|
|
239179
239391
|
const wA = this.w;
|
|
239180
239392
|
const wB = other.w;
|
|
@@ -239182,6 +239394,14 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
239182
239394
|
return undefined;
|
|
239183
239395
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);
|
|
239184
239396
|
}
|
|
239397
|
+
/** Return the xy squared distance between the instance and `other` after normalizing by weights */
|
|
239398
|
+
realDistanceSquaredXY(other) {
|
|
239399
|
+
const wA = this.w;
|
|
239400
|
+
const wB = other.w;
|
|
239401
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(wA) || _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(wB))
|
|
239402
|
+
return undefined;
|
|
239403
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);
|
|
239404
|
+
}
|
|
239185
239405
|
/** Return the largest absolute distance between corresponding components
|
|
239186
239406
|
* * x,y,z,w all participate without normalization.
|
|
239187
239407
|
*/
|
|
@@ -239918,6 +240138,7 @@ class BezierCoffs {
|
|
|
239918
240138
|
roots(targetValue, _restrictTo01) {
|
|
239919
240139
|
const bezier = UnivariateBezier.create(this);
|
|
239920
240140
|
bezier.addInPlace(-targetValue);
|
|
240141
|
+
bezier.clampZero();
|
|
239921
240142
|
const roots = UnivariateBezier.deflateRoots(bezier);
|
|
239922
240143
|
return this.filter01(roots, true);
|
|
239923
240144
|
}
|
|
@@ -239981,6 +240202,16 @@ class BezierCoffs {
|
|
|
239981
240202
|
}
|
|
239982
240203
|
return d;
|
|
239983
240204
|
}
|
|
240205
|
+
/** Assist Newton with slow-to-converge roots at e.g., Bezier endpoints. */
|
|
240206
|
+
clampZero(maxAbs = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallFloatingPoint) {
|
|
240207
|
+
if (maxAbs > 0) {
|
|
240208
|
+
for (let i = 0; i < this.coffs.length; ++i) {
|
|
240209
|
+
const coff = this.coffs[i];
|
|
240210
|
+
if (coff && Math.abs(coff) < maxAbs)
|
|
240211
|
+
this.coffs[i] = 0.0;
|
|
240212
|
+
}
|
|
240213
|
+
}
|
|
240214
|
+
}
|
|
239984
240215
|
}
|
|
239985
240216
|
/**
|
|
239986
240217
|
* Static methods to operate on univariate bezier polynomials, with coefficients in simple Float64Array or as components of blocked arrays.
|
|
@@ -244791,10 +245022,10 @@ class SmallSystem {
|
|
|
244791
245022
|
* @param spacePoint homogeneous point in space
|
|
244792
245023
|
*/
|
|
244793
245024
|
static lineSegment3dHXYClosestPointUnbounded(hA0, hA1, spacePoint) {
|
|
244794
|
-
// Considering only x,y,w parts
|
|
245025
|
+
// Considering only x,y,w parts.
|
|
244795
245026
|
// weighted difference of (A1 w0 - A0 w1) is (cartesian) tangent vector along the line as viewed.
|
|
244796
|
-
// The perpendicular (pure vector) W = (-y,x) flip is the direction of projection
|
|
244797
|
-
// Point Q along A is (in full homogeneous)
|
|
245027
|
+
// The perpendicular (pure vector) W = (-y,x) flip is the direction of projection.
|
|
245028
|
+
// Point Q along A is (in full homogeneous) `(1-lambda) A0 + lambda 1 A1`.
|
|
244798
245029
|
// PointQ is colinear with spacePoint and and W when the xyw homogeneous determinant | Q W spacePoint | is zero.
|
|
244799
245030
|
const tx = hA1.x * hA0.w - hA0.x * hA1.w;
|
|
244800
245031
|
const ty = hA1.y * hA0.w - hA0.y * hA1.w;
|
|
@@ -247547,7 +247778,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247547
247778
|
*/
|
|
247548
247779
|
class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
247549
247780
|
_facetIndices;
|
|
247550
|
-
_currentSubsetIndex; // index within _facetIndices
|
|
247781
|
+
_currentSubsetIndex; // index within _facetIndices
|
|
247551
247782
|
_nextSubsetIndex; // index within _facetIndices
|
|
247552
247783
|
constructor(polyface, facetIndices, numWrap) {
|
|
247553
247784
|
super(polyface, numWrap);
|
|
@@ -274303,6 +274534,7 @@ class HalfEdgeGraphSearch {
|
|
|
274303
274534
|
}
|
|
274304
274535
|
/**
|
|
274305
274536
|
* Search the graph for the face with the most negative area.
|
|
274537
|
+
* * If the graph has exactly one connected component, this is its outer face.
|
|
274306
274538
|
* @param oneCandidateNodePerFace graph or an array containing one node from each face to be considered.
|
|
274307
274539
|
* @returns node on the negative area face with largest absolute area, or `undefined` if no negative area face.
|
|
274308
274540
|
*/
|
|
@@ -313143,7 +313375,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
313143
313375
|
/***/ ((module) => {
|
|
313144
313376
|
|
|
313145
313377
|
"use strict";
|
|
313146
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
313378
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.25","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
313147
313379
|
|
|
313148
313380
|
/***/ })
|
|
313149
313381
|
|