@itwin/core-frontend 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/cjs/tools/ElementSetTool.d.ts +9 -1
- package/lib/cjs/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/cjs/tools/ElementSetTool.js +128 -7
- package/lib/cjs/tools/ElementSetTool.js.map +1 -1
- package/lib/cjs/tools/SelectTool.d.ts +2 -2
- package/lib/cjs/tools/SelectTool.d.ts.map +1 -1
- package/lib/cjs/tools/SelectTool.js +26 -97
- package/lib/cjs/tools/SelectTool.js.map +1 -1
- package/lib/cjs/tools/ToolSettings.d.ts +5 -0
- package/lib/cjs/tools/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/tools/ToolSettings.js +5 -0
- package/lib/cjs/tools/ToolSettings.js.map +1 -1
- package/lib/esm/tools/ElementSetTool.d.ts +9 -1
- package/lib/esm/tools/ElementSetTool.d.ts.map +1 -1
- package/lib/esm/tools/ElementSetTool.js +130 -9
- package/lib/esm/tools/ElementSetTool.js.map +1 -1
- package/lib/esm/tools/SelectTool.d.ts +2 -2
- package/lib/esm/tools/SelectTool.d.ts.map +1 -1
- package/lib/esm/tools/SelectTool.js +26 -97
- package/lib/esm/tools/SelectTool.js.map +1 -1
- package/lib/esm/tools/ToolSettings.d.ts +5 -0
- package/lib/esm/tools/ToolSettings.d.ts.map +1 -1
- package/lib/esm/tools/ToolSettings.js +5 -0
- package/lib/esm/tools/ToolSettings.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -20
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Tools
|
|
3
3
|
*/
|
|
4
4
|
import { CompressedId64Set, Id64Arg, Id64Array, Id64String, OrderedId64Array } from "@itwin/core-bentley";
|
|
5
|
-
import { Point3d } from "@itwin/core-geometry";
|
|
5
|
+
import { Point3d, XAndY } from "@itwin/core-geometry";
|
|
6
6
|
import { LocateFilterStatus, LocateResponse } from "../ElementLocateManager";
|
|
7
7
|
import { HitDetail } from "../HitDetail";
|
|
8
8
|
import { IModelConnection } from "../IModelConnection";
|
|
@@ -206,6 +206,14 @@ export declare abstract class ElementSetTool extends PrimitiveTool {
|
|
|
206
206
|
* @see [[ElementSetTool.getLocateCandidates]] to add additional elements.
|
|
207
207
|
*/
|
|
208
208
|
protected buildLocateAgenda(hit: HitDetail): Promise<boolean>;
|
|
209
|
+
/** Get ids of spatial elements to process from a clip volume created by drag box selection. */
|
|
210
|
+
private static getVolumeSelectionCandidates;
|
|
211
|
+
/** Get ids of visible elements to process from drag box or crossing line selection. */
|
|
212
|
+
private static getAreaSelectionCandidates;
|
|
213
|
+
/** Get ids of elements to process from drag box or crossing line selection using either the depth buffer or clip vector...
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
static getAreaOrVolumeSelectionCandidates(vp: Viewport, origin: XAndY, corner: XAndY, method: SelectionMethod, allowOverlaps: boolean, filter?: (id: Id64String) => boolean, includeDecorationsForVolume?: boolean): Promise<Set<Id64String>>;
|
|
209
217
|
/** Get element ids to process from drag box or crossing line selection.
|
|
210
218
|
* Sub-classes may override to support selection scopes or apply tool specific filtering.
|
|
211
219
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementSetTool.d.ts","sourceRoot":"","sources":["../../../src/tools/ElementSetTool.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ElementSetTool.d.ts","sourceRoot":"","sources":["../../../src/tools/ElementSetTool.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAiB,iBAAiB,EAAQ,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE/H,OAAO,EAA0G,OAAO,EAAqB,KAAK,EAAE,MAAM,sBAAsB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GAAG,OAAO,CAAC,YAAY,CAAC;cAIhE,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAOtD;;;MAGE;cACc,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEjD,6HAA6H;cAC7G,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAElD,2KAA2K;cAC3J,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEvD;;OAEG;cACa,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAEhE,0JAA0J;cAC1I,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB/D,yEAAyE;IACnD,aAAa;IASnC,oHAAoH;IAC9F,SAAS;IAM/B;;OAEG;IACmB,cAAc;IAOpC,8GAA8G;IACxF,WAAW;IAIjC,SAAS,KAAK,kBAAkB,IAAI,OAAO,CAAwE;IACnH,SAAS,KAAK,gBAAgB,IAAI,OAAO,CAA+J;IAExM,yEAAyE;IACzE,SAAS,CAAC,2BAA2B,IAAI,IAAI;IAK7C,yEAAyE;IACzE,SAAS,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,yBAAyB,EAAE,GAAG,IAAI;CA0E7G"}
|
|
@@ -21,6 +21,7 @@ const PrimitiveTool_1 = require("./PrimitiveTool");
|
|
|
21
21
|
const SelectTool_1 = require("./SelectTool");
|
|
22
22
|
const Tool_1 = require("./Tool");
|
|
23
23
|
const ToolAssistance_1 = require("./ToolAssistance");
|
|
24
|
+
const ToolSettings_1 = require("./ToolSettings");
|
|
24
25
|
/** Identifies the source of the elements in the agenda.
|
|
25
26
|
* @public
|
|
26
27
|
*/
|
|
@@ -419,12 +420,105 @@ class ElementSetTool extends PrimitiveTool_1.PrimitiveTool {
|
|
|
419
420
|
await this.onAgendaModified();
|
|
420
421
|
return true;
|
|
421
422
|
}
|
|
422
|
-
/** Get
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
/** Get ids of spatial elements to process from a clip volume created by drag box selection. */
|
|
424
|
+
static async getVolumeSelectionCandidates(vp, origin, corner, allowOverlaps, filter) {
|
|
425
|
+
const contents = new Set();
|
|
426
|
+
if (!vp.view.isSpatialView())
|
|
427
|
+
return contents;
|
|
428
|
+
const boxRange = core_geometry_1.Range2d.createXYXY(origin.x, origin.y, corner.x, corner.y);
|
|
429
|
+
if (boxRange.isNull || boxRange.isAlmostZeroX || boxRange.isAlmostZeroY)
|
|
430
|
+
return contents;
|
|
431
|
+
const getClipPlane = (viewPt, viewDir, negate) => {
|
|
432
|
+
const point = vp.viewToWorld(core_geometry_1.Point3d.createFrom(viewPt));
|
|
433
|
+
const boresite = AccuDraw_1.AccuDrawHintBuilder.getBoresite(point, vp);
|
|
434
|
+
const normal = viewDir.crossProduct(boresite.direction);
|
|
435
|
+
if (negate)
|
|
436
|
+
normal.negate(normal);
|
|
437
|
+
return core_geometry_1.ClipPlane.createNormalAndPoint(normal, point);
|
|
438
|
+
};
|
|
439
|
+
const planeSet = core_geometry_1.ConvexClipPlaneSet.createEmpty();
|
|
440
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.low, vp.rotation.rowX(), true));
|
|
441
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.low, vp.rotation.rowY(), true));
|
|
442
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.high, vp.rotation.rowX(), false));
|
|
443
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.high, vp.rotation.rowY(), false));
|
|
444
|
+
if (0 === planeSet.planes.length)
|
|
445
|
+
return contents;
|
|
446
|
+
const clip = core_geometry_1.ClipVector.createCapture([core_geometry_1.ClipPrimitive.createCapture(planeSet)]);
|
|
447
|
+
const viewRange = vp.computeViewRange();
|
|
448
|
+
const range = core_geometry_1.ClipUtilities.rangeOfClipperIntersectionWithRange(clip, viewRange);
|
|
449
|
+
if (range.isNull)
|
|
450
|
+
return contents;
|
|
451
|
+
// TODO: Possible to make UnionOfComplexClipPlaneSets from view clip and planes work and remove 2nd containment check?
|
|
452
|
+
const viewClip = (vp.viewFlags.clipVolume ? vp.view.getViewClip()?.clone() : undefined);
|
|
453
|
+
if (viewClip) {
|
|
454
|
+
const viewClipRange = core_geometry_1.ClipUtilities.rangeOfClipperIntersectionWithRange(viewClip, viewRange);
|
|
455
|
+
if (viewClipRange.isNull || !viewClipRange.intersectsRange(range))
|
|
456
|
+
return contents;
|
|
457
|
+
}
|
|
458
|
+
const candidates = [];
|
|
459
|
+
const categories = new Set();
|
|
460
|
+
try {
|
|
461
|
+
const viewedModels = [...vp.view.modelSelector.models].join(",");
|
|
462
|
+
const viewedCategories = [...vp.view.categorySelector.categories].join(",");
|
|
463
|
+
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}`;
|
|
464
|
+
const reader = vp.iModel.createQueryReader(ecsql, undefined, { rowFormat: core_common_1.QueryRowFormat.UseECSqlPropertyNames });
|
|
465
|
+
for await (const row of reader) {
|
|
466
|
+
candidates.push(row.ECInstanceId);
|
|
467
|
+
categories.add(row.category);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
catch { }
|
|
471
|
+
if (0 === candidates.length)
|
|
472
|
+
return contents;
|
|
473
|
+
let offSubCategories;
|
|
474
|
+
if (0 !== categories.size) {
|
|
475
|
+
for (const categoryId of categories) {
|
|
476
|
+
const subcategories = vp.iModel.subcategories.getSubCategories(categoryId);
|
|
477
|
+
if (undefined === subcategories)
|
|
478
|
+
continue;
|
|
479
|
+
for (const subCategoryId of subcategories) {
|
|
480
|
+
const appearance = vp.iModel.subcategories.getSubCategoryAppearance(subCategoryId);
|
|
481
|
+
if (undefined === appearance || (!appearance.invisible && !appearance.dontLocate))
|
|
482
|
+
continue;
|
|
483
|
+
if (undefined === offSubCategories)
|
|
484
|
+
offSubCategories = new Array;
|
|
485
|
+
offSubCategories.push(subCategoryId);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
const requestProps = {
|
|
490
|
+
candidates,
|
|
491
|
+
clip: clip.toJSON(),
|
|
492
|
+
allowOverlaps,
|
|
493
|
+
viewFlags: vp.viewFlags.toJSON(),
|
|
494
|
+
offSubCategories,
|
|
495
|
+
};
|
|
496
|
+
const result = await vp.iModel.getGeometryContainment(requestProps);
|
|
497
|
+
if (core_bentley_1.BentleyStatus.SUCCESS !== result.status || undefined === result.candidatesContainment)
|
|
498
|
+
return contents;
|
|
499
|
+
result.candidatesContainment.forEach((status, index) => {
|
|
500
|
+
if (core_geometry_1.ClipPlaneContainment.StronglyOutside !== status && (undefined === filter || filter(candidates[index])))
|
|
501
|
+
contents.add(candidates[index]);
|
|
502
|
+
});
|
|
503
|
+
if (0 !== contents.size && viewClip) {
|
|
504
|
+
requestProps.clip = viewClip.toJSON();
|
|
505
|
+
requestProps.candidates.length = 0;
|
|
506
|
+
for (const id of contents)
|
|
507
|
+
requestProps.candidates.push(id);
|
|
508
|
+
contents.clear();
|
|
509
|
+
const resultViewClip = await vp.iModel.getGeometryContainment(requestProps);
|
|
510
|
+
if (core_bentley_1.BentleyStatus.SUCCESS !== resultViewClip.status || undefined === resultViewClip.candidatesContainment)
|
|
511
|
+
return contents;
|
|
512
|
+
resultViewClip.candidatesContainment.forEach((status, index) => {
|
|
513
|
+
if (core_geometry_1.ClipPlaneContainment.StronglyOutside !== status)
|
|
514
|
+
contents.add(candidates[index]);
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
return contents;
|
|
518
|
+
}
|
|
519
|
+
/** Get ids of visible elements to process from drag box or crossing line selection. */
|
|
520
|
+
static getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter) {
|
|
426
521
|
let contents = new Set();
|
|
427
|
-
// TODO: Include option to use IModelConnection.getGeometryContainment instead of readPixels. No/Yes/2dOnly...
|
|
428
522
|
const pts = [];
|
|
429
523
|
pts[0] = new core_geometry_1.Point2d(Math.floor(origin.x + 0.5), Math.floor(origin.y + 0.5));
|
|
430
524
|
pts[1] = new core_geometry_1.Point2d(Math.floor(corner.x + 0.5), Math.floor(corner.y + 0.5));
|
|
@@ -447,12 +541,12 @@ class ElementSetTool extends PrimitiveTool_1.PrimitiveTool {
|
|
|
447
541
|
return undefined; // no geometry at this location...
|
|
448
542
|
if (!vp.isPixelSelectable(pixel))
|
|
449
543
|
return undefined; // reality model, terrain, etc - not selectable
|
|
450
|
-
if (!
|
|
544
|
+
if (undefined !== filter && !filter(pixel.elementId))
|
|
451
545
|
return undefined;
|
|
452
546
|
return pixel.elementId;
|
|
453
547
|
};
|
|
454
548
|
if (SelectTool_1.SelectionMethod.Box === method) {
|
|
455
|
-
const outline =
|
|
549
|
+
const outline = allowOverlaps ? undefined : new Set();
|
|
456
550
|
const offset = sRange.clone();
|
|
457
551
|
offset.expandInPlace(-2);
|
|
458
552
|
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
@@ -494,6 +588,33 @@ class ElementSetTool extends PrimitiveTool_1.PrimitiveTool {
|
|
|
494
588
|
}, true);
|
|
495
589
|
return contents;
|
|
496
590
|
}
|
|
591
|
+
/** Get ids of elements to process from drag box or crossing line selection using either the depth buffer or clip vector...
|
|
592
|
+
* @internal
|
|
593
|
+
*/
|
|
594
|
+
static async getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter, includeDecorationsForVolume) {
|
|
595
|
+
let contents;
|
|
596
|
+
if (ToolSettings_1.ToolSettings.enableVolumeSelection && SelectTool_1.SelectionMethod.Box === method && vp.view.isSpatialView()) {
|
|
597
|
+
contents = await ElementSetTool.getVolumeSelectionCandidates(vp, origin, corner, allowOverlaps, filter);
|
|
598
|
+
// Use area select to identify pickable transients...
|
|
599
|
+
if (includeDecorationsForVolume) {
|
|
600
|
+
const acceptTransientsFilter = (id) => { return core_bentley_1.Id64.isTransient(id) && (undefined === filter || filter(id)); };
|
|
601
|
+
const transients = ElementSetTool.getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, acceptTransientsFilter);
|
|
602
|
+
for (const id of transients)
|
|
603
|
+
contents.add(id);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
contents = ElementSetTool.getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter);
|
|
608
|
+
}
|
|
609
|
+
return contents;
|
|
610
|
+
}
|
|
611
|
+
/** Get element ids to process from drag box or crossing line selection.
|
|
612
|
+
* Sub-classes may override to support selection scopes or apply tool specific filtering.
|
|
613
|
+
*/
|
|
614
|
+
async getDragSelectCandidates(vp, origin, corner, method, overlap) {
|
|
615
|
+
const filter = (id) => { return this.isElementIdValid(id, ModifyElementSource.DragSelect); };
|
|
616
|
+
return ElementSetTool.getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, overlap, filter, IModelApp_1.IModelApp.locateManager.options.allowDecorations);
|
|
617
|
+
}
|
|
497
618
|
/** Populate [[ElementSetTool.agenda]] by drag box or crossing line information.
|
|
498
619
|
* @see [[ElementSetTool.getDragSelectCandidates]] to filter or augment the set of elements.
|
|
499
620
|
*/
|