@itwin/ecschema-rpcinterface-tests 5.1.0-dev.61 → 5.1.0-dev.64
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/backend/BackendInit.js.map +1 -1
- package/lib/common/Settings.js +4 -4
- package/lib/common/Settings.js.map +1 -1
- package/lib/common/SideChannels.js.map +1 -1
- package/lib/dist/bundled-tests.js +432 -212
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/frontend/SchemaRpcInterface.test.js.map +1 -1
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/package.json +15 -15
|
@@ -43188,8 +43188,7 @@ class WhiteOnWhiteReversalSettings {
|
|
|
43188
43188
|
"use strict";
|
|
43189
43189
|
__webpack_require__.r(__webpack_exports__);
|
|
43190
43190
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
43191
|
-
/* harmony export */ TextAnnotation: () => (/* binding */ TextAnnotation)
|
|
43192
|
-
/* harmony export */ textAnnotationFrameShapes: () => (/* binding */ textAnnotationFrameShapes)
|
|
43191
|
+
/* harmony export */ TextAnnotation: () => (/* binding */ TextAnnotation)
|
|
43193
43192
|
/* harmony export */ });
|
|
43194
43193
|
/* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
|
|
43195
43194
|
/* harmony import */ var _TextBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TextBlock */ "../../core/common/lib/esm/annotation/TextBlock.js");
|
|
@@ -43202,10 +43201,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43202
43201
|
*/
|
|
43203
43202
|
|
|
43204
43203
|
|
|
43205
|
-
/** Set of predefined shapes that can be computed and drawn around the margins of a [[TextBlock]]
|
|
43206
|
-
* @beta
|
|
43207
|
-
*/
|
|
43208
|
-
const textAnnotationFrameShapes = ["none", "line", "rectangle", "circle", "equilateralTriangle", "diamond", "square", "pentagon", "hexagon", "octagon", "capsule", "roundedRectangle"];
|
|
43209
43204
|
/**
|
|
43210
43205
|
* Represents a formatted block of text positioned in 2d or 3d space.
|
|
43211
43206
|
* [TextAnnotation2d]($backend) and [TextAnnotation3d]($backend) elements store a single TextAnnotation from which their geometric representation is generated.
|
|
@@ -43230,16 +43225,13 @@ class TextAnnotation {
|
|
|
43230
43225
|
anchor;
|
|
43231
43226
|
/** An offset applied to the anchor point that can be used to position annotations within the same geometry stream relative to one another. */
|
|
43232
43227
|
offset;
|
|
43233
|
-
/** The frame settings of the text annotation. */
|
|
43234
|
-
frame;
|
|
43235
43228
|
/** The leaders of the text annotation. */
|
|
43236
43229
|
leaders;
|
|
43237
|
-
constructor(offset, angles, textBlock, anchor,
|
|
43230
|
+
constructor(offset, angles, textBlock, anchor, leaders) {
|
|
43238
43231
|
this.offset = offset;
|
|
43239
43232
|
this.orientation = angles;
|
|
43240
43233
|
this.textBlock = textBlock;
|
|
43241
43234
|
this.anchor = anchor;
|
|
43242
|
-
this.frame = frame;
|
|
43243
43235
|
this.leaders = leaders;
|
|
43244
43236
|
}
|
|
43245
43237
|
/** Creates a new TextAnnotation. */
|
|
@@ -43248,11 +43240,8 @@ class TextAnnotation {
|
|
|
43248
43240
|
const angles = args?.orientation ?? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.YawPitchRollAngles();
|
|
43249
43241
|
const textBlock = args?.textBlock ?? _TextBlock__WEBPACK_IMPORTED_MODULE_1__.TextBlock.createEmpty();
|
|
43250
43242
|
const anchor = args?.anchor ?? { vertical: "top", horizontal: "left" };
|
|
43251
|
-
// If the user supplies a frame, but doesn't supply a shape, default the shape to "rectangle"
|
|
43252
|
-
const shape = args?.frame?.shape ?? "rectangle";
|
|
43253
|
-
const frame = args?.frame ? { shape, ...args.frame } : undefined;
|
|
43254
43243
|
const leaders = args?.leaders ?? undefined;
|
|
43255
|
-
return new TextAnnotation(offset, angles, textBlock, anchor,
|
|
43244
|
+
return new TextAnnotation(offset, angles, textBlock, anchor, leaders);
|
|
43256
43245
|
}
|
|
43257
43246
|
/**
|
|
43258
43247
|
* Creates a new TextAnnotation instance from its JSON representation.
|
|
@@ -43263,7 +43252,6 @@ class TextAnnotation {
|
|
|
43263
43252
|
orientation: props?.orientation ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.YawPitchRollAngles.fromJSON(props.orientation) : undefined,
|
|
43264
43253
|
textBlock: props?.textBlock ? _TextBlock__WEBPACK_IMPORTED_MODULE_1__.TextBlock.create(props.textBlock) : undefined,
|
|
43265
43254
|
anchor: props?.anchor ? { ...props.anchor } : undefined,
|
|
43266
|
-
frame: props?.frame ? { shape: "rectangle", ...props.frame } : undefined,
|
|
43267
43255
|
leaders: props?.leaders ? props.leaders.map((leader) => ({
|
|
43268
43256
|
startPoint: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Point3d.fromJSON(leader.startPoint),
|
|
43269
43257
|
attachment: leader.attachment,
|
|
@@ -43277,7 +43265,7 @@ class TextAnnotation {
|
|
|
43277
43265
|
*/
|
|
43278
43266
|
toJSON() {
|
|
43279
43267
|
const props = {};
|
|
43280
|
-
// Even if the text block is empty, we want to record its style
|
|
43268
|
+
// Even if the text block is empty, we want to record its style ID and overrides, e.g.,
|
|
43281
43269
|
// so the user can pick up where they left off editing it next time.
|
|
43282
43270
|
props.textBlock = this.textBlock.toJSON();
|
|
43283
43271
|
if (!this.offset.isZero) {
|
|
@@ -43289,8 +43277,6 @@ class TextAnnotation {
|
|
|
43289
43277
|
if (this.anchor.vertical !== "top" || this.anchor.horizontal !== "left") {
|
|
43290
43278
|
props.anchor = { ...this.anchor };
|
|
43291
43279
|
}
|
|
43292
|
-
// Default frame to "none"
|
|
43293
|
-
props.frame = this.frame ? { ...this.frame } : undefined;
|
|
43294
43280
|
props.leaders = this.leaders?.map((leader) => ({
|
|
43295
43281
|
startPoint: leader.startPoint.toJSON(),
|
|
43296
43282
|
attachment: leader.attachment,
|
|
@@ -43304,16 +43290,23 @@ class TextAnnotation {
|
|
|
43304
43290
|
* at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.
|
|
43305
43291
|
* The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].
|
|
43306
43292
|
* The anchor point will coincide with (0, 0, 0) unless an [[offset]] is present.
|
|
43293
|
+
* If a scale factor is specified, the transform will also scale the annotation by that factor. Usually, this should come from the [[Drawing]] containing the annotation.
|
|
43307
43294
|
* @param boundingBox A box fully containing the [[textBlock]]. This range should include the margins.
|
|
43295
|
+
* @param scaleFactor A factor by which to scale the annotation. Default: 1 (no scaling).
|
|
43308
43296
|
* @see [[computeAnchorPoint]] to compute the transform's anchor point.
|
|
43309
43297
|
* @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`.
|
|
43310
43298
|
*/
|
|
43311
|
-
computeTransform(boundingBox) {
|
|
43299
|
+
computeTransform(boundingBox, scaleFactor = 1) {
|
|
43312
43300
|
const anchorPt = this.computeAnchorPoint(boundingBox);
|
|
43313
43301
|
const matrix = this.orientation.toMatrix3d();
|
|
43314
|
-
const
|
|
43302
|
+
const transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.createIdentity();
|
|
43315
43303
|
const translation = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.createTranslation(this.offset.minus(anchorPt));
|
|
43316
|
-
|
|
43304
|
+
const scaleTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.createScaleAboutPoint(anchorPt, scaleFactor);
|
|
43305
|
+
const rotation = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.createFixedPointAndMatrix(anchorPt, matrix);
|
|
43306
|
+
transform.multiplyTransformTransform(translation, transform);
|
|
43307
|
+
transform.multiplyTransformTransform(scaleTransform, transform);
|
|
43308
|
+
transform.multiplyTransformTransform(rotation, transform);
|
|
43309
|
+
return transform;
|
|
43317
43310
|
}
|
|
43318
43311
|
/** Compute the anchor point of this annotation as specified by [[anchor]].
|
|
43319
43312
|
* @param boundingBox A box fully containing the [[textBlock]].
|
|
@@ -43374,12 +43367,6 @@ class TextAnnotation {
|
|
|
43374
43367
|
!this.offset.isAlmostEqual(other.offset) ||
|
|
43375
43368
|
!this.textBlock.equals(other.textBlock))
|
|
43376
43369
|
return false;
|
|
43377
|
-
const framesMatch = this.frame?.shape === other.frame?.shape
|
|
43378
|
-
&& this.frame?.fill === other.frame?.fill
|
|
43379
|
-
&& this.frame?.border === other.frame?.border
|
|
43380
|
-
&& this.frame?.borderWeight === other.frame?.borderWeight;
|
|
43381
|
-
if (!framesMatch)
|
|
43382
|
-
return false;
|
|
43383
43370
|
return this.areLeadersEqual(this.leaders, other.leaders);
|
|
43384
43371
|
}
|
|
43385
43372
|
}
|
|
@@ -43405,6 +43392,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43405
43392
|
/* harmony export */ TextBlockComponent: () => (/* binding */ TextBlockComponent),
|
|
43406
43393
|
/* harmony export */ TextRun: () => (/* binding */ TextRun)
|
|
43407
43394
|
/* harmony export */ });
|
|
43395
|
+
/* harmony import */ var _TextStyle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TextStyle */ "../../core/common/lib/esm/annotation/TextStyle.js");
|
|
43408
43396
|
/*---------------------------------------------------------------------------------------------
|
|
43409
43397
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
43410
43398
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -43412,29 +43400,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43412
43400
|
/** @packageDocumentation
|
|
43413
43401
|
* @module Annotation
|
|
43414
43402
|
*/
|
|
43403
|
+
|
|
43415
43404
|
/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.
|
|
43416
|
-
*
|
|
43405
|
+
* The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents. Each component can specify an optional [[styleOverrides]] to customize that formatting.
|
|
43417
43406
|
* @beta
|
|
43418
43407
|
*/
|
|
43419
43408
|
class TextBlockComponent {
|
|
43420
|
-
_styleName;
|
|
43421
43409
|
_styleOverrides;
|
|
43422
43410
|
/** @internal */
|
|
43423
43411
|
constructor(props) {
|
|
43424
|
-
this.
|
|
43425
|
-
this._styleOverrides = { ...props.styleOverrides };
|
|
43426
|
-
}
|
|
43427
|
-
/** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.
|
|
43428
|
-
* @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of
|
|
43429
|
-
* the components sub-components and clears any [[styleOverrides]].
|
|
43430
|
-
*/
|
|
43431
|
-
get styleName() {
|
|
43432
|
-
return this._styleName;
|
|
43433
|
-
}
|
|
43434
|
-
set styleName(styleName) {
|
|
43435
|
-
this.applyStyle(styleName);
|
|
43412
|
+
this._styleOverrides = _TextStyle__WEBPACK_IMPORTED_MODULE_0__.TextStyleSettings.cloneProps(props?.styleOverrides ?? {});
|
|
43436
43413
|
}
|
|
43437
|
-
/** Deviations in individual properties of the [[
|
|
43414
|
+
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend) specified by `styleId` on the [[TextBlock]].
|
|
43438
43415
|
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.fontName` to "Comic Sans".
|
|
43439
43416
|
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
43440
43417
|
*/
|
|
@@ -43442,20 +43419,13 @@ class TextBlockComponent {
|
|
|
43442
43419
|
return this._styleOverrides;
|
|
43443
43420
|
}
|
|
43444
43421
|
set styleOverrides(overrides) {
|
|
43445
|
-
this._styleOverrides =
|
|
43422
|
+
this._styleOverrides = _TextStyle__WEBPACK_IMPORTED_MODULE_0__.TextStyleSettings.cloneProps(overrides);
|
|
43446
43423
|
}
|
|
43447
|
-
/** Reset any [[styleOverrides]] applied to this component
|
|
43448
|
-
clearStyleOverrides() {
|
|
43424
|
+
/** Reset any [[styleOverrides]] applied to this component. */
|
|
43425
|
+
clearStyleOverrides(_options) {
|
|
43449
43426
|
this.styleOverrides = {};
|
|
43450
43427
|
}
|
|
43451
|
-
/**
|
|
43452
|
-
applyStyle(styleName, options) {
|
|
43453
|
-
this._styleName = styleName;
|
|
43454
|
-
if (!(options?.preserveOverrides)) {
|
|
43455
|
-
this.clearStyleOverrides();
|
|
43456
|
-
}
|
|
43457
|
-
}
|
|
43458
|
-
/** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */
|
|
43428
|
+
/** Returns true if [[styleOverrides]] specifies any deviations from the [[TextBlock]]'s [AnnotationTextStyle]($backend). */
|
|
43459
43429
|
get overridesStyle() {
|
|
43460
43430
|
return Object.keys(this.styleOverrides).length > 0;
|
|
43461
43431
|
}
|
|
@@ -43470,15 +43440,14 @@ class TextBlockComponent {
|
|
|
43470
43440
|
/** Convert this component to its JSON representation. */
|
|
43471
43441
|
toJSON() {
|
|
43472
43442
|
return {
|
|
43473
|
-
|
|
43474
|
-
styleOverrides: { ...this.styleOverrides },
|
|
43443
|
+
styleOverrides: _TextStyle__WEBPACK_IMPORTED_MODULE_0__.TextStyleSettings.cloneProps(this.styleOverrides),
|
|
43475
43444
|
};
|
|
43476
43445
|
}
|
|
43477
43446
|
/** Returns true if `this` is equivalent to `other`. */
|
|
43478
43447
|
equals(other) {
|
|
43479
43448
|
const myKeys = Object.keys(this.styleOverrides);
|
|
43480
43449
|
const yrKeys = Object.keys(other._styleOverrides);
|
|
43481
|
-
if (
|
|
43450
|
+
if (myKeys.length !== yrKeys.length) {
|
|
43482
43451
|
return false;
|
|
43483
43452
|
}
|
|
43484
43453
|
for (const name of myKeys) {
|
|
@@ -43522,8 +43491,8 @@ class TextRun extends TextBlockComponent {
|
|
|
43522
43491
|
baselineShift;
|
|
43523
43492
|
constructor(props) {
|
|
43524
43493
|
super(props);
|
|
43525
|
-
this.content = props
|
|
43526
|
-
this.baselineShift = props
|
|
43494
|
+
this.content = props?.content ?? "";
|
|
43495
|
+
this.baselineShift = props?.baselineShift ?? "none";
|
|
43527
43496
|
}
|
|
43528
43497
|
clone() {
|
|
43529
43498
|
return new TextRun(this.toJSON());
|
|
@@ -43560,8 +43529,8 @@ class FractionRun extends TextBlockComponent {
|
|
|
43560
43529
|
denominator;
|
|
43561
43530
|
constructor(props) {
|
|
43562
43531
|
super(props);
|
|
43563
|
-
this.numerator = props
|
|
43564
|
-
this.denominator = props
|
|
43532
|
+
this.numerator = props?.numerator ?? "";
|
|
43533
|
+
this.denominator = props?.denominator ?? "";
|
|
43565
43534
|
}
|
|
43566
43535
|
toJSON() {
|
|
43567
43536
|
return {
|
|
@@ -43657,7 +43626,7 @@ class Paragraph extends TextBlockComponent {
|
|
|
43657
43626
|
runs;
|
|
43658
43627
|
constructor(props) {
|
|
43659
43628
|
super(props);
|
|
43660
|
-
this.runs = props
|
|
43629
|
+
this.runs = props?.runs?.map((run) => Run.fromJSON(run)) ?? [];
|
|
43661
43630
|
}
|
|
43662
43631
|
toJSON() {
|
|
43663
43632
|
return {
|
|
@@ -43672,13 +43641,16 @@ class Paragraph extends TextBlockComponent {
|
|
|
43672
43641
|
clone() {
|
|
43673
43642
|
return new Paragraph(this.toJSON());
|
|
43674
43643
|
}
|
|
43675
|
-
/**
|
|
43676
|
-
|
|
43677
|
-
|
|
43678
|
-
|
|
43679
|
-
|
|
43680
|
-
|
|
43681
|
-
|
|
43644
|
+
/**
|
|
43645
|
+
* Clears any [[styleOverrides]] applied to this Paragraph.
|
|
43646
|
+
* Will also clear [[styleOverrides]] from all child components unless [[ClearTextStyleOptions.preserveChildrenOverrides]] is `true`.
|
|
43647
|
+
*/
|
|
43648
|
+
clearStyleOverrides(options) {
|
|
43649
|
+
super.clearStyleOverrides();
|
|
43650
|
+
if (options?.preserveChildrenOverrides)
|
|
43651
|
+
return;
|
|
43652
|
+
for (const run of this.runs) {
|
|
43653
|
+
run.clearStyleOverrides();
|
|
43682
43654
|
}
|
|
43683
43655
|
}
|
|
43684
43656
|
/** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */
|
|
@@ -43703,6 +43675,11 @@ class Paragraph extends TextBlockComponent {
|
|
|
43703
43675
|
* @beta
|
|
43704
43676
|
*/
|
|
43705
43677
|
class TextBlock extends TextBlockComponent {
|
|
43678
|
+
/** The ID of the [AnnotationTextStyle]($backend) that provides the base formatting for the contents of this TextBlock.
|
|
43679
|
+
* @note Assigning to this property retains all style overrides on the TextBlock and its child components.
|
|
43680
|
+
* Call [[clearStyleOverrides]] to clear the TextBlock's and optionally all children's style overrides.
|
|
43681
|
+
*/
|
|
43682
|
+
styleId;
|
|
43706
43683
|
/** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.
|
|
43707
43684
|
* A value less than or equal to zero indicates no wrapping is to be applied.
|
|
43708
43685
|
* Default: 0
|
|
@@ -43716,6 +43693,7 @@ class TextBlock extends TextBlockComponent {
|
|
|
43716
43693
|
paragraphs;
|
|
43717
43694
|
constructor(props) {
|
|
43718
43695
|
super(props);
|
|
43696
|
+
this.styleId = props.styleId;
|
|
43719
43697
|
this.width = props.width ?? 0;
|
|
43720
43698
|
this.justification = props.justification ?? "left";
|
|
43721
43699
|
// Assign default margins if not provided
|
|
@@ -43730,6 +43708,7 @@ class TextBlock extends TextBlockComponent {
|
|
|
43730
43708
|
toJSON() {
|
|
43731
43709
|
return {
|
|
43732
43710
|
...super.toJSON(),
|
|
43711
|
+
styleId: this.styleId,
|
|
43733
43712
|
width: this.width,
|
|
43734
43713
|
justification: this.justification,
|
|
43735
43714
|
margins: this.margins,
|
|
@@ -43740,9 +43719,9 @@ class TextBlock extends TextBlockComponent {
|
|
|
43740
43719
|
static create(props) {
|
|
43741
43720
|
return new TextBlock(props);
|
|
43742
43721
|
}
|
|
43743
|
-
/** Create an empty text block containing no [[paragraphs]] and an empty [[
|
|
43722
|
+
/** Create an empty text block containing no [[paragraphs]] and an empty [[styleId]]. */
|
|
43744
43723
|
static createEmpty() {
|
|
43745
|
-
return TextBlock.create({
|
|
43724
|
+
return TextBlock.create({ styleId: "" });
|
|
43746
43725
|
}
|
|
43747
43726
|
/** Returns true if every paragraph in this text block is empty. */
|
|
43748
43727
|
get isEmpty() {
|
|
@@ -43751,13 +43730,16 @@ class TextBlock extends TextBlockComponent {
|
|
|
43751
43730
|
clone() {
|
|
43752
43731
|
return new TextBlock(this.toJSON());
|
|
43753
43732
|
}
|
|
43754
|
-
/**
|
|
43755
|
-
|
|
43756
|
-
|
|
43757
|
-
|
|
43758
|
-
|
|
43759
|
-
|
|
43760
|
-
|
|
43733
|
+
/**
|
|
43734
|
+
* Clears any [[styleOverrides]] applied to this TextBlock.
|
|
43735
|
+
* Will also clear [[styleOverrides]] from all child components unless [[ClearTextStyleOptions.preserveChildrenOverrides]] is `true`.
|
|
43736
|
+
*/
|
|
43737
|
+
clearStyleOverrides(options) {
|
|
43738
|
+
super.clearStyleOverrides();
|
|
43739
|
+
if (options?.preserveChildrenOverrides)
|
|
43740
|
+
return;
|
|
43741
|
+
for (const paragraph of this.paragraphs) {
|
|
43742
|
+
paragraph.clearStyleOverrides();
|
|
43761
43743
|
}
|
|
43762
43744
|
}
|
|
43763
43745
|
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
@@ -43765,14 +43747,17 @@ class TextBlock extends TextBlockComponent {
|
|
|
43765
43747
|
return this.paragraphs.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? " ");
|
|
43766
43748
|
}
|
|
43767
43749
|
/** Add and return a new paragraph.
|
|
43768
|
-
*
|
|
43769
|
-
* the paragraph will inherit
|
|
43750
|
+
* By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.
|
|
43751
|
+
* @param seedFromLast If true and [[paragraphs]] is not empty, the new paragraph will inherit the style overrides of the last [[Paragraph]] in this block.
|
|
43770
43752
|
*/
|
|
43771
|
-
appendParagraph() {
|
|
43772
|
-
|
|
43753
|
+
appendParagraph(seedFromLast = false) {
|
|
43754
|
+
let styleOverrides = {};
|
|
43755
|
+
if (seedFromLast && this.paragraphs.length > 0) {
|
|
43756
|
+
const seed = this.paragraphs[this.paragraphs.length - 1];
|
|
43757
|
+
styleOverrides = { ...seed.styleOverrides };
|
|
43758
|
+
}
|
|
43773
43759
|
const paragraph = Paragraph.create({
|
|
43774
|
-
|
|
43775
|
-
styleOverrides: seed?.styleOverrides ?? undefined,
|
|
43760
|
+
styleOverrides
|
|
43776
43761
|
});
|
|
43777
43762
|
this.paragraphs.push(paragraph);
|
|
43778
43763
|
return paragraph;
|
|
@@ -43788,6 +43773,9 @@ class TextBlock extends TextBlockComponent {
|
|
|
43788
43773
|
if (!(other instanceof TextBlock)) {
|
|
43789
43774
|
return false;
|
|
43790
43775
|
}
|
|
43776
|
+
if (this.styleId !== other.styleId || !super.equals(other)) {
|
|
43777
|
+
return false;
|
|
43778
|
+
}
|
|
43791
43779
|
if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {
|
|
43792
43780
|
return false;
|
|
43793
43781
|
}
|
|
@@ -43850,9 +43838,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43850
43838
|
"use strict";
|
|
43851
43839
|
__webpack_require__.r(__webpack_exports__);
|
|
43852
43840
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
43853
|
-
/* harmony export */
|
|
43854
|
-
/* harmony export */
|
|
43841
|
+
/* harmony export */ TextStyleSettings: () => (/* binding */ TextStyleSettings),
|
|
43842
|
+
/* harmony export */ textAnnotationFrameShapes: () => (/* binding */ textAnnotationFrameShapes)
|
|
43855
43843
|
/* harmony export */ });
|
|
43844
|
+
/* harmony import */ var _ColorDef__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ColorDef */ "../../core/common/lib/esm/ColorDef.js");
|
|
43856
43845
|
/*---------------------------------------------------------------------------------------------
|
|
43857
43846
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
43858
43847
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -43860,8 +43849,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43860
43849
|
/** @packageDocumentation
|
|
43861
43850
|
* @module Annotation
|
|
43862
43851
|
*/
|
|
43852
|
+
|
|
43853
|
+
/** Set of predefined shapes that can be computed and drawn around the margins of a [[TextBlock]]
|
|
43854
|
+
* @beta
|
|
43855
|
+
*/
|
|
43856
|
+
const textAnnotationFrameShapes = ["none", "line", "rectangle", "circle", "equilateralTriangle", "diamond", "square", "pentagon", "hexagon", "octagon", "capsule", "roundedRectangle"];
|
|
43857
|
+
;
|
|
43858
|
+
function deepFreeze(obj) {
|
|
43859
|
+
if (obj === null || typeof obj !== "object" || Object.isFrozen(obj))
|
|
43860
|
+
return;
|
|
43861
|
+
Object.getOwnPropertyNames(obj).forEach((prop) => {
|
|
43862
|
+
const value = obj[prop];
|
|
43863
|
+
if (value && typeof value === "object") {
|
|
43864
|
+
deepFreeze(value);
|
|
43865
|
+
}
|
|
43866
|
+
});
|
|
43867
|
+
Object.freeze(obj);
|
|
43868
|
+
}
|
|
43863
43869
|
/** A description of the formatting to be applied to a [[TextBlockComponent]].
|
|
43864
|
-
* Named instances of these settings can be stored as [
|
|
43870
|
+
* Named instances of these settings can be stored as [AnnotationTextStyle]($backend)s in an iModel.
|
|
43865
43871
|
* @note This is an immutable type. Use [[clone]] to create a modified copy.
|
|
43866
43872
|
* @see [[TextStyleSettingsProps]] for documentation of each of the settings.
|
|
43867
43873
|
* @beta
|
|
@@ -43869,7 +43875,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43869
43875
|
class TextStyleSettings {
|
|
43870
43876
|
/** The color of the text. */
|
|
43871
43877
|
color;
|
|
43872
|
-
/** The name of a font stored in
|
|
43878
|
+
/** The name of a font stored in an iModel, used to draw the contents of a [[TextRun]].
|
|
43873
43879
|
*/
|
|
43874
43880
|
fontName;
|
|
43875
43881
|
/** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.
|
|
@@ -43919,7 +43925,9 @@ class TextStyleSettings {
|
|
|
43919
43925
|
* These are equally spaced from the left edge of the TextBlock. Default is 4 meters.
|
|
43920
43926
|
*/
|
|
43921
43927
|
tabInterval;
|
|
43922
|
-
/**
|
|
43928
|
+
/** The frame settings of the [[TextAnnotation]]. */
|
|
43929
|
+
frame;
|
|
43930
|
+
/** A fully-populated JSON representation of the default settings. A real `fontName` must be provided before use. */
|
|
43923
43931
|
static defaultProps = {
|
|
43924
43932
|
color: "subcategory",
|
|
43925
43933
|
fontName: "",
|
|
@@ -43936,13 +43944,19 @@ class TextStyleSettings {
|
|
|
43936
43944
|
superScriptScale: 2 / 3,
|
|
43937
43945
|
widthFactor: 1,
|
|
43938
43946
|
leader: {
|
|
43939
|
-
color: "
|
|
43947
|
+
color: "inherit",
|
|
43940
43948
|
wantElbow: false,
|
|
43941
43949
|
elbowLength: 1.0,
|
|
43942
43950
|
terminatorHeightFactor: 1.0,
|
|
43943
43951
|
terminatorWidthFactor: 1.0,
|
|
43944
43952
|
},
|
|
43945
43953
|
tabInterval: 4,
|
|
43954
|
+
frame: {
|
|
43955
|
+
shape: "none",
|
|
43956
|
+
fill: "none",
|
|
43957
|
+
border: _ColorDef__WEBPACK_IMPORTED_MODULE_0__.ColorDef.black.toJSON(),
|
|
43958
|
+
borderWeight: 1,
|
|
43959
|
+
},
|
|
43946
43960
|
};
|
|
43947
43961
|
/** Settings initialized to all default values. */
|
|
43948
43962
|
static defaults = new TextStyleSettings({});
|
|
@@ -43973,11 +43987,30 @@ class TextStyleSettings {
|
|
|
43973
43987
|
};
|
|
43974
43988
|
this.leader = Object.freeze(leader);
|
|
43975
43989
|
this.tabInterval = props.tabInterval ?? defaults.tabInterval;
|
|
43990
|
+
const frame = {
|
|
43991
|
+
shape: props.frame?.shape ?? defaults.frame.shape,
|
|
43992
|
+
fill: props.frame?.fill ?? defaults.frame.fill,
|
|
43993
|
+
border: props.frame?.border ?? defaults.frame.border,
|
|
43994
|
+
borderWeight: props.frame?.borderWeight ?? defaults.frame.borderWeight,
|
|
43995
|
+
};
|
|
43996
|
+
// Cast to indicate to TypeScript that the frame properties are all defined
|
|
43997
|
+
this.frame = Object.freeze(frame);
|
|
43976
43998
|
}
|
|
43977
43999
|
/** Create a copy of these settings, modified according to the properties defined by `alteredProps`. */
|
|
43978
44000
|
clone(alteredProps) {
|
|
43979
44001
|
return alteredProps ? new TextStyleSettings(alteredProps, this) : this;
|
|
43980
44002
|
}
|
|
44003
|
+
/** Creates a deep copy of the `TextStyleSettingsProps`. */
|
|
44004
|
+
static cloneProps(props) {
|
|
44005
|
+
const copy = { ...props };
|
|
44006
|
+
if (props.leader) {
|
|
44007
|
+
copy.leader = { ...props.leader };
|
|
44008
|
+
}
|
|
44009
|
+
if (props.frame) {
|
|
44010
|
+
copy.frame = { ...props.frame };
|
|
44011
|
+
}
|
|
44012
|
+
return copy;
|
|
44013
|
+
}
|
|
43981
44014
|
/** Create settings from their JSON representation. */
|
|
43982
44015
|
static fromJSON(props) {
|
|
43983
44016
|
return props ? new TextStyleSettings(props) : TextStyleSettings.defaults;
|
|
@@ -43994,47 +44027,49 @@ class TextStyleSettings {
|
|
|
43994
44027
|
&& this.leader.elbowLength === other.elbowLength && this.leader.terminatorHeightFactor === other.terminatorHeightFactor
|
|
43995
44028
|
&& this.leader.terminatorWidthFactor === other.terminatorWidthFactor;
|
|
43996
44029
|
}
|
|
44030
|
+
frameEquals(other) {
|
|
44031
|
+
return this.frame?.shape === other.shape
|
|
44032
|
+
&& this.frame?.fill === other.fill
|
|
44033
|
+
&& this.frame?.border === other.border
|
|
44034
|
+
&& this.frame?.borderWeight === other.borderWeight;
|
|
44035
|
+
}
|
|
43997
44036
|
equals(other) {
|
|
43998
44037
|
return this.color === other.color && this.fontName === other.fontName
|
|
43999
44038
|
&& this.lineHeight === other.lineHeight && this.lineSpacingFactor === other.lineSpacingFactor && this.widthFactor === other.widthFactor
|
|
44000
44039
|
&& this.isBold === other.isBold && this.isItalic === other.isItalic && this.isUnderlined === other.isUnderlined
|
|
44001
44040
|
&& this.stackedFractionType === other.stackedFractionType && this.stackedFractionScale === other.stackedFractionScale
|
|
44002
44041
|
&& this.subScriptOffsetFactor === other.subScriptOffsetFactor && this.subScriptScale === other.subScriptScale
|
|
44003
|
-
&& this.superScriptOffsetFactor === other.superScriptOffsetFactor
|
|
44004
|
-
&& this.
|
|
44005
|
-
&& this.
|
|
44006
|
-
|
|
44007
|
-
}
|
|
44008
|
-
Object.freeze(TextStyleSettings.defaultProps);
|
|
44009
|
-
Object.freeze(TextStyleSettings.defaults);
|
|
44010
|
-
/** A named, immutable [[TextStyleSettings]] stored in a [Workspace]($backend).
|
|
44011
|
-
* @see [[TextBlockComponent.styleName]] to define the text style for a component of a [[TextBlock]].
|
|
44012
|
-
* @note This is an immutable type. Use [[clone]] to create a modified copy.
|
|
44013
|
-
* @beta
|
|
44014
|
-
*/
|
|
44015
|
-
class TextStyle {
|
|
44016
|
-
name;
|
|
44017
|
-
settings;
|
|
44018
|
-
constructor(name, settings) {
|
|
44019
|
-
this.name = name;
|
|
44020
|
-
this.settings = settings;
|
|
44021
|
-
}
|
|
44022
|
-
/** Create a style from its JSON representation. */
|
|
44023
|
-
static fromJSON(json) {
|
|
44024
|
-
return TextStyle.create(json.name, TextStyleSettings.fromJSON(json.settings));
|
|
44042
|
+
&& this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale
|
|
44043
|
+
&& this.tabInterval === other.tabInterval
|
|
44044
|
+
&& this.leaderEquals(other.leader)
|
|
44045
|
+
&& this.frameEquals(other.frame);
|
|
44025
44046
|
}
|
|
44026
|
-
/**
|
|
44027
|
-
|
|
44028
|
-
|
|
44029
|
-
|
|
44030
|
-
|
|
44031
|
-
|
|
44032
|
-
|
|
44033
|
-
|
|
44034
|
-
|
|
44035
|
-
|
|
44047
|
+
/**
|
|
44048
|
+
* Returns a list of validation errors for this instance.
|
|
44049
|
+
*
|
|
44050
|
+
* A TextStyleSettings object may contain values that are invalid in all contexts.
|
|
44051
|
+
* If this method returns any error strings, using the settings will likely result in rendering failures or runtime exceptions.
|
|
44052
|
+
*
|
|
44053
|
+
* This method only checks for universally invalid values. Additional domain-specific validation may be required depending on the context in which these settings are used.
|
|
44054
|
+
*
|
|
44055
|
+
* @returns An array of error strings describing the invalid values, or an empty array if the settings are valid.
|
|
44056
|
+
*/
|
|
44057
|
+
getValidationErrors() {
|
|
44058
|
+
const errorMessages = [];
|
|
44059
|
+
if (this.fontName.trim() === "") {
|
|
44060
|
+
errorMessages.push("fontName must be provided");
|
|
44061
|
+
}
|
|
44062
|
+
if (this.lineHeight <= 0) {
|
|
44063
|
+
errorMessages.push("lineHeight must be greater than 0");
|
|
44064
|
+
}
|
|
44065
|
+
if (this.stackedFractionScale <= 0) {
|
|
44066
|
+
errorMessages.push("stackedFractionScale must be greater than 0");
|
|
44067
|
+
}
|
|
44068
|
+
return errorMessages;
|
|
44036
44069
|
}
|
|
44037
44070
|
}
|
|
44071
|
+
deepFreeze(TextStyleSettings.defaultProps);
|
|
44072
|
+
deepFreeze(TextStyleSettings.defaults);
|
|
44038
44073
|
|
|
44039
44074
|
|
|
44040
44075
|
/***/ }),
|
|
@@ -44367,7 +44402,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44367
44402
|
/* harmony export */ TextBlockComponent: () => (/* reexport safe */ _annotation_TextBlock__WEBPACK_IMPORTED_MODULE_3__.TextBlockComponent),
|
|
44368
44403
|
/* harmony export */ TextRun: () => (/* reexport safe */ _annotation_TextBlock__WEBPACK_IMPORTED_MODULE_3__.TextRun),
|
|
44369
44404
|
/* harmony export */ TextString: () => (/* reexport safe */ _geometry_TextString__WEBPACK_IMPORTED_MODULE_56__.TextString),
|
|
44370
|
-
/* harmony export */ TextStyle: () => (/* reexport safe */ _annotation_TextStyle__WEBPACK_IMPORTED_MODULE_6__.TextStyle),
|
|
44371
44405
|
/* harmony export */ TextStyleSettings: () => (/* reexport safe */ _annotation_TextStyle__WEBPACK_IMPORTED_MODULE_6__.TextStyleSettings),
|
|
44372
44406
|
/* harmony export */ TextureMapUnits: () => (/* reexport safe */ _MaterialProps__WEBPACK_IMPORTED_MODULE_83__.TextureMapUnits),
|
|
44373
44407
|
/* harmony export */ TextureMapping: () => (/* reexport safe */ _TextureMapping__WEBPACK_IMPORTED_MODULE_111__.TextureMapping),
|
|
@@ -44440,7 +44474,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44440
44474
|
/* harmony export */ readElementMeshes: () => (/* reexport safe */ _ElementMesh__WEBPACK_IMPORTED_MODULE_29__.readElementMeshes),
|
|
44441
44475
|
/* harmony export */ readTileContentDescription: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_157__.readTileContentDescription),
|
|
44442
44476
|
/* harmony export */ rpcOverIpcStrings: () => (/* reexport safe */ _ipc_IpcSession__WEBPACK_IMPORTED_MODULE_75__.rpcOverIpcStrings),
|
|
44443
|
-
/* harmony export */ textAnnotationFrameShapes: () => (/* reexport safe */
|
|
44477
|
+
/* harmony export */ textAnnotationFrameShapes: () => (/* reexport safe */ _annotation_TextStyle__WEBPACK_IMPORTED_MODULE_6__.textAnnotationFrameShapes),
|
|
44444
44478
|
/* harmony export */ tileFormatFromNumber: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_156__.tileFormatFromNumber)
|
|
44445
44479
|
/* harmony export */ });
|
|
44446
44480
|
/* harmony import */ var _AmbientOcclusion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AmbientOcclusion */ "../../core/common/lib/esm/AmbientOcclusion.js");
|
|
@@ -77228,7 +77262,7 @@ class AccuDraw {
|
|
|
77228
77262
|
applyDistanceRoundOff(distance, vp) {
|
|
77229
77263
|
if (!this._distanceRoundOff.active || !this._distanceRoundOff.units.size)
|
|
77230
77264
|
return undefined;
|
|
77231
|
-
let roundValue = this._distanceRoundOff.units.values().next().value;
|
|
77265
|
+
let roundValue = this._distanceRoundOff.units.values().next().value ?? 0;
|
|
77232
77266
|
if (this._distanceRoundOff.units.size > 1) {
|
|
77233
77267
|
// NOTE: Set isn't ordered, find smallest entry...
|
|
77234
77268
|
this._distanceRoundOff.units.forEach((thisRoundValue) => {
|
|
@@ -77252,7 +77286,7 @@ class AccuDraw {
|
|
|
77252
77286
|
applyAngleRoundOff(angle, distance, vp) {
|
|
77253
77287
|
if (!this._angleRoundOff.active || !this._angleRoundOff.units.size)
|
|
77254
77288
|
return undefined;
|
|
77255
|
-
let roundValue = this._angleRoundOff.units.values().next().value;
|
|
77289
|
+
let roundValue = this._angleRoundOff.units.values().next().value ?? 0;
|
|
77256
77290
|
if (this._angleRoundOff.units.size > 1) {
|
|
77257
77291
|
// NOTE: Set isn't ordered, find smallest entry...
|
|
77258
77292
|
this._angleRoundOff.units.forEach((thisRoundValue) => {
|
|
@@ -78765,6 +78799,8 @@ class AccuSnap {
|
|
|
78765
78799
|
this.errorKey = out.reason;
|
|
78766
78800
|
this.errorIcon.deactivate();
|
|
78767
78801
|
const vp = ev.viewport;
|
|
78802
|
+
if (undefined === vp)
|
|
78803
|
+
return;
|
|
78768
78804
|
let errorSprite;
|
|
78769
78805
|
switch (out.snapStatus) {
|
|
78770
78806
|
case _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.FilteredByApp:
|
|
@@ -79149,8 +79185,10 @@ class AccuSnap {
|
|
|
79149
79185
|
// points not on the grid. This causes them to be "pulled" off the grid when they are accepted. On
|
|
79150
79186
|
// the other hand, when NOT locating, we need to use the raw point so we can snap to elements
|
|
79151
79187
|
// away from the grid.
|
|
79152
|
-
const testPoint = this.isLocateEnabled ? ev.point : ev.rawPoint;
|
|
79153
79188
|
const vp = ev.viewport;
|
|
79189
|
+
if (undefined === vp)
|
|
79190
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NoElements;
|
|
79191
|
+
const testPoint = this.isLocateEnabled ? ev.point : ev.rawPoint;
|
|
79154
79192
|
const picker = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.picker;
|
|
79155
79193
|
const options = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.options.clone(); // Copy to avoid changing out from under active Tool...
|
|
79156
79194
|
// NOTE: Since TestHit will use the same HitSource as the input hit we only need to sets this for DoPick...
|
|
@@ -79192,6 +79230,8 @@ class AccuSnap {
|
|
|
79192
79230
|
}
|
|
79193
79231
|
}
|
|
79194
79232
|
const thisList = this.aSnapHits;
|
|
79233
|
+
if (undefined === thisList)
|
|
79234
|
+
return undefined;
|
|
79195
79235
|
let thisHit;
|
|
79196
79236
|
let firstRejected;
|
|
79197
79237
|
const filterResponse = new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.LocateResponse();
|
|
@@ -79225,7 +79265,7 @@ class AccuSnap {
|
|
|
79225
79265
|
// if we don't have any more candidate hits, get a new list at the current location
|
|
79226
79266
|
if (!this.aSnapHits || (0 === this.aSnapHits.length)) {
|
|
79227
79267
|
out.snapStatus = this.findHits(ev);
|
|
79228
|
-
hit = (_ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success !== out.snapStatus) ? undefined : await this.getAccuSnapDetail(this.aSnapHits, out);
|
|
79268
|
+
hit = (_ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success !== out.snapStatus || undefined === this.aSnapHits) ? undefined : await this.getAccuSnapDetail(this.aSnapHits, out);
|
|
79229
79269
|
}
|
|
79230
79270
|
else {
|
|
79231
79271
|
// drop the current hit from the list and then retest the list (without the dropped hit) to find the new snap
|
|
@@ -79252,13 +79292,16 @@ class AccuSnap {
|
|
|
79252
79292
|
*/
|
|
79253
79293
|
async onMotion(ev) {
|
|
79254
79294
|
this.clearToolTip(ev);
|
|
79295
|
+
const vp = ev.viewport;
|
|
79296
|
+
if (undefined === vp)
|
|
79297
|
+
return;
|
|
79255
79298
|
const out = new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.LocateResponse();
|
|
79256
79299
|
out.snapStatus = _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Disabled;
|
|
79257
79300
|
let hit;
|
|
79258
79301
|
if (this.isActive) {
|
|
79259
79302
|
if (this._doSnapping) {
|
|
79260
79303
|
out.snapStatus = this.findHits(ev);
|
|
79261
|
-
hit = (_ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success !== out.snapStatus) ? undefined : await this.getAccuSnapDetail(this.aSnapHits, out);
|
|
79304
|
+
hit = (_ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.Success !== out.snapStatus || undefined === this.aSnapHits) ? undefined : await this.getAccuSnapDetail(this.aSnapHits, out);
|
|
79262
79305
|
if (!this._doSnapping)
|
|
79263
79306
|
hit = undefined; // Snap no longer requested...
|
|
79264
79307
|
}
|
|
@@ -79273,7 +79316,7 @@ class AccuSnap {
|
|
|
79273
79316
|
this.setCurrHit(hit);
|
|
79274
79317
|
// set up active error before calling displayToolTip to indicate error or show locate message...
|
|
79275
79318
|
this.showSnapError(out, ev);
|
|
79276
|
-
this.displayToolTip(ev.viewPoint,
|
|
79319
|
+
this.displayToolTip(ev.viewPoint, vp, ev.rawPoint);
|
|
79277
79320
|
if (undefined !== this.touchCursor && _tools_Tool__WEBPACK_IMPORTED_MODULE_6__.InputSource.Mouse === ev.inputSource) {
|
|
79278
79321
|
this.touchCursor = undefined;
|
|
79279
79322
|
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.invalidateDecorationsAllViews();
|
|
@@ -79871,7 +79914,7 @@ class AuxCoordSystem2dState extends AuxCoordSystemState {
|
|
|
79871
79914
|
super(props, iModel);
|
|
79872
79915
|
this.origin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.fromJSON(props.origin);
|
|
79873
79916
|
this.angle = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asDouble(props.angle);
|
|
79874
|
-
this._rMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(this.angle));
|
|
79917
|
+
this._rMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(this.angle)) ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createIdentity();
|
|
79875
79918
|
}
|
|
79876
79919
|
toJSON() {
|
|
79877
79920
|
const val = super.toJSON();
|
|
@@ -148770,7 +148813,7 @@ var RealityTreeId;
|
|
|
148770
148813
|
function compareWithoutModelId(lhs, rhs) {
|
|
148771
148814
|
return (compareRealityDataSourceKeys(lhs.rdSourceKey, rhs.rdSourceKey) ||
|
|
148772
148815
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.deduplicateVertices, rhs.deduplicateVertices) ||
|
|
148773
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.
|
|
148816
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.produceGeometry, rhs.produceGeometry) ||
|
|
148774
148817
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.maskModelIds, rhs.maskModelIds) ||
|
|
148775
148818
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.comparePossiblyUndefined)((ltf, rtf) => compareTransforms(ltf, rtf), lhs.transform, rhs.transform));
|
|
148776
148819
|
}
|
|
@@ -148964,10 +149007,11 @@ class RealityModelTileTreeParams {
|
|
|
148964
149007
|
loader;
|
|
148965
149008
|
rootTile;
|
|
148966
149009
|
baseUrl;
|
|
149010
|
+
reprojectGeometry;
|
|
148967
149011
|
get location() { return this.loader.tree.location; }
|
|
148968
149012
|
get yAxisUp() { return this.loader.tree.yAxisUp; }
|
|
148969
149013
|
get priority() { return this.loader.priority; }
|
|
148970
|
-
constructor(tileTreeId, iModel, modelId, loader, gcsConverterAvailable, rootToEcef, baseUrl) {
|
|
149014
|
+
constructor(tileTreeId, iModel, modelId, loader, gcsConverterAvailable, rootToEcef, baseUrl, reprojectGeometry) {
|
|
148971
149015
|
this.gcsConverterAvailable = gcsConverterAvailable;
|
|
148972
149016
|
this.rootToEcef = rootToEcef;
|
|
148973
149017
|
this.loader = loader;
|
|
@@ -148983,6 +149027,7 @@ class RealityModelTileTreeParams {
|
|
|
148983
149027
|
usesGeometricError: loader.tree.usesGeometricError,
|
|
148984
149028
|
});
|
|
148985
149029
|
this.baseUrl = baseUrl;
|
|
149030
|
+
this.reprojectGeometry = reprojectGeometry;
|
|
148986
149031
|
}
|
|
148987
149032
|
}
|
|
148988
149033
|
class RealityModelTileProps {
|
|
@@ -149089,7 +149134,7 @@ class RealityModelTileLoader extends _tile_internal__WEBPACK_IMPORTED_MODULE_8__
|
|
|
149089
149134
|
_viewFlagOverrides;
|
|
149090
149135
|
_deduplicateVertices;
|
|
149091
149136
|
constructor(tree, batchedIdMap, opts) {
|
|
149092
|
-
super(opts?.produceGeometry
|
|
149137
|
+
super(opts?.produceGeometry);
|
|
149093
149138
|
this.tree = tree;
|
|
149094
149139
|
this._batchedIdMap = batchedIdMap;
|
|
149095
149140
|
this._deduplicateVertices = opts?.deduplicateVertices ?? false;
|
|
@@ -149321,9 +149366,9 @@ class RealityModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_8__.R
|
|
|
149321
149366
|
const props = await getTileTreeProps(rdSource, tilesetToDb, iModel);
|
|
149322
149367
|
const loader = new RealityModelTileLoader(props, new _tile_internal__WEBPACK_IMPORTED_MODULE_8__.BatchedTileIdMap(iModel), opts);
|
|
149323
149368
|
const gcsConverterAvailable = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_8__.getGcsConverterAvailable)(iModel);
|
|
149324
|
-
//The full tileset url is needed so that it includes the url's search parameters if any are present
|
|
149369
|
+
// The full tileset url is needed so that it includes the url's search parameters if any are present
|
|
149325
149370
|
const baseUrl = rdSource instanceof _RealityDataSourceTilesetUrlImpl__WEBPACK_IMPORTED_MODULE_9__.RealityDataSourceTilesetUrlImpl ? rdSource.getTilesetUrl() : undefined;
|
|
149326
|
-
const params = new RealityModelTileTreeParams(tileTreeId, iModel, modelId, loader, gcsConverterAvailable, props.tilesetToEcef, baseUrl);
|
|
149371
|
+
const params = new RealityModelTileTreeParams(tileTreeId, iModel, modelId, loader, gcsConverterAvailable, props.tilesetToEcef, baseUrl, opts?.produceGeometry === "reproject");
|
|
149327
149372
|
return new RealityModelTileTree(params);
|
|
149328
149373
|
}
|
|
149329
149374
|
return undefined;
|
|
@@ -149417,14 +149462,14 @@ class RealityTreeReference extends RealityModelTileTree.Reference {
|
|
|
149417
149462
|
get treeOwner() {
|
|
149418
149463
|
return realityTreeSupplier.getOwner(this.createTreeId(this.modelId), this.iModel);
|
|
149419
149464
|
}
|
|
149420
|
-
_createGeometryTreeReference() {
|
|
149465
|
+
_createGeometryTreeReference(options) {
|
|
149421
149466
|
const ref = new RealityTreeReference({
|
|
149422
149467
|
iModel: this.iModel,
|
|
149423
149468
|
modelId: this.modelId,
|
|
149424
149469
|
source: this._source,
|
|
149425
149470
|
rdSourceKey: this._rdSourceKey,
|
|
149426
149471
|
name: this._name,
|
|
149427
|
-
produceGeometry:
|
|
149472
|
+
produceGeometry: options?.reprojectGeometry ? "reproject" : "yes",
|
|
149428
149473
|
getDisplaySettings: () => _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityModelDisplaySettings.defaults,
|
|
149429
149474
|
});
|
|
149430
149475
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== ref.collectTileGeometry);
|
|
@@ -149655,7 +149700,7 @@ class RealityTileLoader {
|
|
|
149655
149700
|
const blob = data;
|
|
149656
149701
|
const streamBuffer = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ByteStream.fromUint8Array(blob);
|
|
149657
149702
|
const realityTile = tile;
|
|
149658
|
-
return this._produceGeometry ? this.loadGeometryFromStream(realityTile, streamBuffer, system) : this.loadGraphicsFromStream(realityTile, streamBuffer, system, isCanceled);
|
|
149703
|
+
return (this._produceGeometry && this._produceGeometry !== "no") ? this.loadGeometryFromStream(realityTile, streamBuffer, system) : this.loadGraphicsFromStream(realityTile, streamBuffer, system, isCanceled);
|
|
149659
149704
|
}
|
|
149660
149705
|
_getFormat(streamBuffer) {
|
|
149661
149706
|
const position = streamBuffer.curPos;
|
|
@@ -149671,7 +149716,15 @@ class RealityTileLoader {
|
|
|
149671
149716
|
const reader = _tile_internal__WEBPACK_IMPORTED_MODULE_7__.B3dmReader.create(streamBuffer, iModel, modelId, is3d, tile.contentRange, system, yAxisUp, tile.isLeaf, tile.center, tile.transformToRoot, undefined, this.getBatchIdMap());
|
|
149672
149717
|
if (reader)
|
|
149673
149718
|
reader.defaultWrapMode = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_6__.GltfWrapMode.ClampToEdge;
|
|
149674
|
-
|
|
149719
|
+
const geom = reader?.readGltfAndCreateGeometry(tile.tree.iModelTransform);
|
|
149720
|
+
const xForm = tile.reprojectionTransform;
|
|
149721
|
+
if (tile.tree.reprojectGeometry && geom?.polyfaces && xForm) {
|
|
149722
|
+
const polyfaces = geom.polyfaces.map((pf) => pf.cloneTransformed(xForm));
|
|
149723
|
+
return { geometry: { polyfaces } };
|
|
149724
|
+
}
|
|
149725
|
+
else {
|
|
149726
|
+
return { geometry: geom };
|
|
149727
|
+
}
|
|
149675
149728
|
}
|
|
149676
149729
|
async loadGraphicsFromStream(tile, streamBuffer, system, isCanceled) {
|
|
149677
149730
|
const format = this._getFormat(streamBuffer);
|
|
@@ -160615,6 +160668,12 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
|
|
|
160615
160668
|
/** @internal */
|
|
160616
160669
|
_copyright;
|
|
160617
160670
|
/** @internal */
|
|
160671
|
+
tree;
|
|
160672
|
+
/** @internal */
|
|
160673
|
+
get reprojectionTransform() {
|
|
160674
|
+
return this._reprojectionTransform;
|
|
160675
|
+
}
|
|
160676
|
+
/** @internal */
|
|
160618
160677
|
constructor(props, tree) {
|
|
160619
160678
|
super(props, tree);
|
|
160620
160679
|
this.transformToRoot = props.transformToRoot;
|
|
@@ -160623,6 +160682,7 @@ class RealityTile extends _internal__WEBPACK_IMPORTED_MODULE_5__.Tile {
|
|
|
160623
160682
|
this.rangeCorners = props.rangeCorners;
|
|
160624
160683
|
this.region = props.region;
|
|
160625
160684
|
this._geometricError = props.geometricError;
|
|
160685
|
+
this.tree = tree;
|
|
160626
160686
|
if (undefined === this.transformToRoot)
|
|
160627
160687
|
return;
|
|
160628
160688
|
// Can transform be non-rigid?? -- if so would have to handle (readonly) radius.
|
|
@@ -161283,6 +161343,9 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
|
|
|
161283
161343
|
_ecefToDb;
|
|
161284
161344
|
/** @internal */
|
|
161285
161345
|
baseUrl;
|
|
161346
|
+
/** If set to true, tile geometry will be reprojected using the tile's reprojection transform when geometry is collected.
|
|
161347
|
+
* @internal */
|
|
161348
|
+
reprojectGeometry;
|
|
161286
161349
|
/** @internal */
|
|
161287
161350
|
constructor(params) {
|
|
161288
161351
|
super(params);
|
|
@@ -161301,6 +161364,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
|
|
|
161301
161364
|
}
|
|
161302
161365
|
}
|
|
161303
161366
|
this.baseUrl = params.baseUrl;
|
|
161367
|
+
this.reprojectGeometry = params.reprojectGeometry;
|
|
161304
161368
|
}
|
|
161305
161369
|
/** The mapping of per-feature JSON properties from this tile tree's batch table, if one is defined.
|
|
161306
161370
|
* @beta
|
|
@@ -164666,6 +164730,10 @@ var TileGraphicType;
|
|
|
164666
164730
|
* @extensions
|
|
164667
164731
|
*/
|
|
164668
164732
|
class TileTreeReference /* implements RenderMemory.Consumer */ {
|
|
164733
|
+
/** If set to true, tile geometry will be reprojected using the tile's reprojection transform when geometry is collected from the referenced TileTree.
|
|
164734
|
+
* @internal
|
|
164735
|
+
*/
|
|
164736
|
+
reprojectGeometry;
|
|
164669
164737
|
/** Force a new tree owner / tile tree to be created for the current tile tree reference
|
|
164670
164738
|
* @internal
|
|
164671
164739
|
*/
|
|
@@ -164861,7 +164929,7 @@ class TileTreeReference /* implements RenderMemory.Consumer */ {
|
|
|
164861
164929
|
* Return `undefined` if geometry collection is not supported.
|
|
164862
164930
|
* @see [[createGeometryTreeReference]].
|
|
164863
164931
|
*/
|
|
164864
|
-
_createGeometryTreeReference() {
|
|
164932
|
+
_createGeometryTreeReference(_options) {
|
|
164865
164933
|
return undefined;
|
|
164866
164934
|
}
|
|
164867
164935
|
/** If defined, supplies the implementation of [[GeometryTileTreeReference.collectTileGeometry]].
|
|
@@ -164886,12 +164954,14 @@ class TileTreeReference /* implements RenderMemory.Consumer */ {
|
|
|
164886
164954
|
* Currently, only terrain and reality model tiles support geometry collection.
|
|
164887
164955
|
* @note Do not override this method - override [[_createGeometryTreeReference]] instead.
|
|
164888
164956
|
*/
|
|
164889
|
-
createGeometryTreeReference() {
|
|
164957
|
+
createGeometryTreeReference(options) {
|
|
164890
164958
|
if (this.collectTileGeometry) {
|
|
164891
164959
|
// Unclear why compiler doesn't detect that `this` satisfies the GeometryTileTreeReference interface...it must be looking only at the types, not this particular instance.
|
|
164892
|
-
|
|
164960
|
+
const ref = this;
|
|
164961
|
+
ref.reprojectGeometry = options?.reprojectGeometry;
|
|
164962
|
+
return ref;
|
|
164893
164963
|
}
|
|
164894
|
-
return this._createGeometryTreeReference();
|
|
164964
|
+
return this._createGeometryTreeReference(options);
|
|
164895
164965
|
}
|
|
164896
164966
|
/** Create a [[TileTreeReference]] that displays a pre-defined [[RenderGraphic]].
|
|
164897
164967
|
* The reference can be used to add dynamic content to a [[Viewport]]'s scene as a [[TiledGraphicsProvider]], as in the following example:
|
|
@@ -172787,6 +172857,8 @@ class ViewClipTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitive
|
|
|
172787
172857
|
zHigh = projection;
|
|
172788
172858
|
}
|
|
172789
172859
|
}
|
|
172860
|
+
if (undefined === zLow || undefined === zHigh)
|
|
172861
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range1d.createNull();
|
|
172790
172862
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range1d.createXX(zLow, zHigh);
|
|
172791
172863
|
}
|
|
172792
172864
|
/** @internal */
|
|
@@ -173095,8 +173167,11 @@ class ViewClipByShapeTool extends ViewClipTool {
|
|
|
173095
173167
|
points.push(pt.clone());
|
|
173096
173168
|
if (undefined === this._matrix)
|
|
173097
173169
|
return points;
|
|
173170
|
+
const vp = ev.viewport;
|
|
173171
|
+
if (undefined === vp)
|
|
173172
|
+
return points;
|
|
173098
173173
|
const normal = this._matrix.getColumn(2);
|
|
173099
|
-
let currentPt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(ev.point, points[0], normal,
|
|
173174
|
+
let currentPt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(ev.point, points[0], normal, vp, true);
|
|
173100
173175
|
if (undefined === currentPt)
|
|
173101
173176
|
currentPt = ev.point.clone();
|
|
173102
173177
|
if (2 === points.length && !ev.isControlKey) {
|
|
@@ -173105,7 +173180,7 @@ class ViewClipByShapeTool extends ViewClipTool {
|
|
|
173105
173180
|
xDir.normalizeInPlace();
|
|
173106
173181
|
const yDir = xDir.crossProduct(normal);
|
|
173107
173182
|
yDir.normalizeInPlace();
|
|
173108
|
-
const cornerPt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToLineInView(currentPt, points[1], yDir,
|
|
173183
|
+
const cornerPt = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToLineInView(currentPt, points[1], yDir, vp, true);
|
|
173109
173184
|
if (undefined !== cornerPt) {
|
|
173110
173185
|
points.push(cornerPt);
|
|
173111
173186
|
cornerPt.plusScaled(xDir, -xLen, currentPt);
|
|
@@ -173172,7 +173247,8 @@ class ViewClipByShapeTool extends ViewClipTool {
|
|
|
173172
173247
|
return _Tool__WEBPACK_IMPORTED_MODULE_9__.EventHandled.No;
|
|
173173
173248
|
const currPt = ev.point.clone();
|
|
173174
173249
|
if (this._points.length > 0) {
|
|
173175
|
-
const
|
|
173250
|
+
const vp = ev.viewport;
|
|
173251
|
+
const planePt = (vp ? _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(currPt, this._points[0], this._matrix.getColumn(2), vp, true) : undefined);
|
|
173176
173252
|
if (undefined !== planePt)
|
|
173177
173253
|
currPt.setFrom(planePt);
|
|
173178
173254
|
}
|
|
@@ -173698,6 +173774,8 @@ class ViewClipDecoration extends _EditManipulator__WEBPACK_IMPORTED_MODULE_7__.E
|
|
|
173698
173774
|
if (compressed.length < clipShape.polygon.length) {
|
|
173699
173775
|
clip = clip.clone();
|
|
173700
173776
|
clipShape = ViewClipTool.isSingleClipShape(clip);
|
|
173777
|
+
if (undefined === clipShape)
|
|
173778
|
+
return false;
|
|
173701
173779
|
clipShape.setPolygon(compressed);
|
|
173702
173780
|
this._clipView.view.setViewClip(clip);
|
|
173703
173781
|
}
|
|
@@ -174100,7 +174178,7 @@ class ViewClipDecoration extends _EditManipulator__WEBPACK_IMPORTED_MODULE_7__.E
|
|
|
174100
174178
|
if (this._clipView !== vp)
|
|
174101
174179
|
return;
|
|
174102
174180
|
if (undefined !== this._clipShape) {
|
|
174103
|
-
ViewClipTool.drawClipShape(context, this._clipShape, this._clipShapeExtents, _EditManipulator__WEBPACK_IMPORTED_MODULE_7__.EditManipulator.HandleUtils.adjustForBackgroundColor(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white, vp), 3, this._clipId);
|
|
174181
|
+
ViewClipTool.drawClipShape(context, this._clipShape, this._clipShapeExtents ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range1d.createNull(), _EditManipulator__WEBPACK_IMPORTED_MODULE_7__.EditManipulator.HandleUtils.adjustForBackgroundColor(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef.white, vp), 3, this._clipId);
|
|
174104
174182
|
}
|
|
174105
174183
|
else if (undefined !== this._clipPlanes) {
|
|
174106
174184
|
if (undefined !== this._clipPlanesLoops)
|
|
@@ -174145,9 +174223,12 @@ class ViewClipDecoration extends _EditManipulator__WEBPACK_IMPORTED_MODULE_7__.E
|
|
|
174145
174223
|
}
|
|
174146
174224
|
}
|
|
174147
174225
|
}
|
|
174148
|
-
else
|
|
174149
|
-
this._controls[iFace].
|
|
174150
|
-
|
|
174226
|
+
else {
|
|
174227
|
+
const floatingOrigin = this._controls[iFace].floatingOrigin;
|
|
174228
|
+
if (undefined !== floatingOrigin && vp.isPointVisibleXY(floatingOrigin, _CoordSystem__WEBPACK_IMPORTED_MODULE_4__.CoordSystem.World, 0.1)) {
|
|
174229
|
+
this._controls[iFace].origin.setFrom(this._controls[iFace].floatingOrigin);
|
|
174230
|
+
this._controls[iFace].floatingOrigin = undefined;
|
|
174231
|
+
}
|
|
174151
174232
|
}
|
|
174152
174233
|
}
|
|
174153
174234
|
const anchorRay = ViewClipTool.getClipRayTransformed(this._controls[iFace].origin, this._controls[iFace].direction, undefined !== this._clipShape ? this._clipShape.transformFromClip : undefined);
|
|
@@ -174714,6 +174795,8 @@ class ElementAgenda {
|
|
|
174714
174795
|
return;
|
|
174715
174796
|
}
|
|
174716
174797
|
const group = this.groupMarks.pop();
|
|
174798
|
+
if (undefined === group)
|
|
174799
|
+
return;
|
|
174717
174800
|
this.setEntriesHiliteState(false, group.start, this.length); // make sure removed entries aren't left hilited...
|
|
174718
174801
|
this.elements.splice(group.start);
|
|
174719
174802
|
}
|
|
@@ -175836,8 +175919,11 @@ class IdleTool extends _Tool__WEBPACK_IMPORTED_MODULE_1__.InteractiveTool {
|
|
|
175836
175919
|
return _Tool__WEBPACK_IMPORTED_MODULE_1__.EventHandled.Yes;
|
|
175837
175920
|
}
|
|
175838
175921
|
else if (ev.isDoubleTap) {
|
|
175922
|
+
const vp = ev.viewport;
|
|
175923
|
+
if (undefined === vp)
|
|
175924
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_1__.EventHandled.No;
|
|
175839
175925
|
// Fit view on single finger double tap.
|
|
175840
|
-
const tool = new _ViewTool__WEBPACK_IMPORTED_MODULE_2__.FitViewTool(
|
|
175926
|
+
const tool = new _ViewTool__WEBPACK_IMPORTED_MODULE_2__.FitViewTool(vp, true);
|
|
175841
175927
|
return await tool.run() ? _Tool__WEBPACK_IMPORTED_MODULE_1__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_1__.EventHandled.No;
|
|
175842
175928
|
}
|
|
175843
175929
|
return _Tool__WEBPACK_IMPORTED_MODULE_1__.EventHandled.No;
|
|
@@ -176410,7 +176496,8 @@ class MeasureDistanceTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Pr
|
|
|
176410
176496
|
if (undefined !== snap) {
|
|
176411
176497
|
if (undefined !== snap.primitive) {
|
|
176412
176498
|
const locDetail = snap.primitive.closestPoint(point, false);
|
|
176413
|
-
|
|
176499
|
+
const snapPlane = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.create(point, undefined !== snap.normal ? snap.normal : normal);
|
|
176500
|
+
if (undefined !== locDetail && (_HitDetail__WEBPACK_IMPORTED_MODULE_5__.HitGeomType.Segment === snap.geomType || (snapPlane && snap.primitive.isInPlane(snapPlane)))) {
|
|
176414
176501
|
const locRay = snap.primitive.fractionToPointAndUnitTangent(locDetail.fraction);
|
|
176415
176502
|
tangent.setFrom(locRay.direction);
|
|
176416
176503
|
if (undefined !== snap.normal)
|
|
@@ -176930,7 +177017,8 @@ class MeasureAreaByPointsTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9_
|
|
|
176930
177017
|
return _Tool__WEBPACK_IMPORTED_MODULE_10__.EventHandled.No;
|
|
176931
177018
|
const currPt = ev.point.clone();
|
|
176932
177019
|
if (this._points.length > 0) {
|
|
176933
|
-
const
|
|
177020
|
+
const vp = ev.viewport;
|
|
177021
|
+
const planePt = (vp ? _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.projectPointToPlaneInView(currPt, this._points[0], this._matrix.getColumn(2), vp, true) : undefined);
|
|
176934
177022
|
if (undefined !== planePt)
|
|
176935
177023
|
currPt.setFrom(planePt);
|
|
176936
177024
|
}
|
|
@@ -177432,8 +177520,9 @@ class PrimitiveTool extends _Tool__WEBPACK_IMPORTED_MODULE_4__.InteractiveTool {
|
|
|
177432
177520
|
if (view.isSpatialView() && this.targetView.view.isSpatialView())
|
|
177433
177521
|
return true; // No specific target, two spatial views are considered compatible.
|
|
177434
177522
|
let allowView = false;
|
|
177523
|
+
const targetView = this.targetView;
|
|
177435
177524
|
view.forEachModel((model) => {
|
|
177436
|
-
if (!allowView &&
|
|
177525
|
+
if (!allowView && targetView.view.viewsModel(model.id))
|
|
177437
177526
|
allowView = true;
|
|
177438
177527
|
});
|
|
177439
177528
|
return allowView; // Accept if this view shares a model in common with target.
|
|
@@ -179390,11 +179479,15 @@ class CurrentInputState {
|
|
|
179390
179479
|
}
|
|
179391
179480
|
updateDownPoint(ev) { this.button[ev.button].downUorPt = ev.point; }
|
|
179392
179481
|
onButtonDown(button) {
|
|
179393
|
-
|
|
179394
|
-
const center = this.viewport.npcToView(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.NpcCenter);
|
|
179395
|
-
viewPt.z = center.z;
|
|
179482
|
+
let isDoubleClick = false;
|
|
179396
179483
|
const now = Date.now();
|
|
179397
|
-
const
|
|
179484
|
+
const vp = this.viewport;
|
|
179485
|
+
if (undefined !== vp) {
|
|
179486
|
+
const viewPt = vp.worldToView(this.button[button].downRawPt);
|
|
179487
|
+
const center = vp.npcToView(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.NpcCenter);
|
|
179488
|
+
viewPt.z = center.z;
|
|
179489
|
+
isDoubleClick = ((now - this.button[button].downTime) < _ToolSettings__WEBPACK_IMPORTED_MODULE_14__.ToolSettings.doubleClickTimeout.milliseconds) && (viewPt.distance(this.viewPoint) < vp.pixelsFromInches(_ToolSettings__WEBPACK_IMPORTED_MODULE_14__.ToolSettings.doubleClickToleranceInches));
|
|
179490
|
+
}
|
|
179398
179491
|
this.button[button].init(this.point, this.rawPoint, now, true, isDoubleClick, false, this.inputSource);
|
|
179399
179492
|
this.lastButton = button;
|
|
179400
179493
|
}
|
|
@@ -179473,10 +179566,13 @@ class CurrentInputState {
|
|
|
179473
179566
|
return false;
|
|
179474
179567
|
if ((Date.now() - state.downTime) <= _ToolSettings__WEBPACK_IMPORTED_MODULE_14__.ToolSettings.startDragDelay.milliseconds)
|
|
179475
179568
|
return false;
|
|
179476
|
-
const
|
|
179569
|
+
const vp = this.viewport;
|
|
179570
|
+
if (undefined === vp)
|
|
179571
|
+
return false;
|
|
179572
|
+
const viewPt = vp.worldToView(state.downRawPt);
|
|
179477
179573
|
const deltaX = Math.abs(this._viewPoint.x - viewPt.x);
|
|
179478
179574
|
const deltaY = Math.abs(this._viewPoint.y - viewPt.y);
|
|
179479
|
-
return ((deltaX + deltaY) >
|
|
179575
|
+
return ((deltaX + deltaY) > vp.pixelsFromInches(_ToolSettings__WEBPACK_IMPORTED_MODULE_14__.ToolSettings.startDragDistanceInches));
|
|
179480
179576
|
}
|
|
179481
179577
|
}
|
|
179482
179578
|
/** Controls the operation of [[Tool]]s, administering the current [[ViewTool]], [[PrimitiveTool]], and [[IdleTool]] and forwarding events to the appropriate tool.
|
|
@@ -179643,9 +179739,11 @@ class ToolAdmin {
|
|
|
179643
179739
|
ToolAdmin._toolEvents = ToolAdmin._toolEvents.filter((ev) => ev.vp !== vp);
|
|
179644
179740
|
}
|
|
179645
179741
|
getMousePosition(event) {
|
|
179742
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
179646
179743
|
return event.vp.mousePosFromEvent(event.ev);
|
|
179647
179744
|
}
|
|
179648
179745
|
getMouseMovement(event) {
|
|
179746
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
179649
179747
|
return event.vp.mouseMovementFromEvent(event.ev);
|
|
179650
179748
|
}
|
|
179651
179749
|
getMouseButton(button) {
|
|
@@ -179657,6 +179755,7 @@ class ToolAdmin {
|
|
|
179657
179755
|
}
|
|
179658
179756
|
async onMouseButton(event, isDown) {
|
|
179659
179757
|
const ev = event.ev;
|
|
179758
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
179660
179759
|
const vp = event.vp;
|
|
179661
179760
|
const pos = this.getMousePosition(event);
|
|
179662
179761
|
const button = this.getMouseButton(ev.button);
|
|
@@ -179666,7 +179765,7 @@ class ToolAdmin {
|
|
|
179666
179765
|
async onWheel(event) {
|
|
179667
179766
|
const ev = event.ev;
|
|
179668
179767
|
const vp = event.vp;
|
|
179669
|
-
if (this.filterViewport(vp))
|
|
179768
|
+
if (undefined === vp || this.filterViewport(vp))
|
|
179670
179769
|
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes;
|
|
179671
179770
|
const current = this.currentInputState;
|
|
179672
179771
|
current.setKeyQualifiers(ev);
|
|
@@ -179699,7 +179798,9 @@ class ToolAdmin {
|
|
|
179699
179798
|
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes;
|
|
179700
179799
|
}
|
|
179701
179800
|
async sendTapEvent(touchEv) {
|
|
179702
|
-
touchEv.viewport
|
|
179801
|
+
const vp = touchEv.viewport;
|
|
179802
|
+
if (undefined !== vp)
|
|
179803
|
+
vp.setAnimator();
|
|
179703
179804
|
const overlayHit = this.pickCanvasDecoration(touchEv);
|
|
179704
179805
|
if (undefined !== overlayHit && undefined !== overlayHit.onMouseButton && overlayHit.onMouseButton(touchEv))
|
|
179705
179806
|
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes;
|
|
@@ -179726,7 +179827,7 @@ class ToolAdmin {
|
|
|
179726
179827
|
async onTouch(event) {
|
|
179727
179828
|
const touchEvent = event.ev;
|
|
179728
179829
|
const vp = event.vp;
|
|
179729
|
-
if (this.filterViewport(vp))
|
|
179830
|
+
if (undefined === vp || this.filterViewport(vp))
|
|
179730
179831
|
return;
|
|
179731
179832
|
const ev = new _Tool__WEBPACK_IMPORTED_MODULE_13__.BeTouchEvent({ touchEvent });
|
|
179732
179833
|
const current = this.currentInputState;
|
|
@@ -179865,6 +179966,7 @@ class ToolAdmin {
|
|
|
179865
179966
|
case "mouseup": return this.onMouseButton(event, false);
|
|
179866
179967
|
case "mousemove": return this.onMouseMove(event);
|
|
179867
179968
|
case "mouseover": return this.onMouseEnter(event);
|
|
179969
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
179868
179970
|
case "mouseout": return this.onMouseLeave(event.vp);
|
|
179869
179971
|
case "wheel": return this.onWheel(event);
|
|
179870
179972
|
case "keydown": return this.onKeyTransition(event, true);
|
|
@@ -180041,6 +180143,8 @@ class ToolAdmin {
|
|
|
180041
180143
|
}
|
|
180042
180144
|
pickCanvasDecoration(ev) {
|
|
180043
180145
|
const vp = ev.viewport;
|
|
180146
|
+
if (undefined === vp)
|
|
180147
|
+
return undefined;
|
|
180044
180148
|
const decoration = (undefined === this.viewTool) ? vp.pickCanvasDecoration(ev.viewPoint) : undefined;
|
|
180045
180149
|
this.setCanvasDecoration(vp, decoration, ev);
|
|
180046
180150
|
return decoration;
|
|
@@ -180166,6 +180270,8 @@ class ToolAdmin {
|
|
|
180166
180270
|
}
|
|
180167
180271
|
async onMouseMove(event) {
|
|
180168
180272
|
const vp = event.vp;
|
|
180273
|
+
if (undefined === vp)
|
|
180274
|
+
return;
|
|
180169
180275
|
const pos = this.getMousePosition(event);
|
|
180170
180276
|
const mov = this.getMouseMovement(event);
|
|
180171
180277
|
// Sometimes the mouse goes down in a view, but we lose focus while its down so we never receive the up event.
|
|
@@ -180717,30 +180823,48 @@ class ToolAdmin {
|
|
|
180717
180823
|
setAdjustedDataPoint(ev) { this.currentInputState.adjustLastDataPoint(ev); }
|
|
180718
180824
|
/** Can be called by tools that wish to emulate mouse button down/up events for onTouchTap. */
|
|
180719
180825
|
async convertTouchTapToButtonDownAndUp(ev, button = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data) {
|
|
180826
|
+
const vp = ev.viewport;
|
|
180827
|
+
if (undefined === vp)
|
|
180828
|
+
return;
|
|
180720
180829
|
const pt2d = ev.viewPoint;
|
|
180721
|
-
await this.onButtonDown(
|
|
180722
|
-
return this.onButtonUp(
|
|
180830
|
+
await this.onButtonDown(vp, pt2d, button, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch);
|
|
180831
|
+
return this.onButtonUp(vp, pt2d, button, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch);
|
|
180723
180832
|
}
|
|
180724
180833
|
/** Can be called by tools that wish to emulate moving the mouse with a button depressed for onTouchMoveStart.
|
|
180725
180834
|
* @note Calls the tool's onMouseStartDrag method from onMotion.
|
|
180726
180835
|
*/
|
|
180727
180836
|
async convertTouchMoveStartToButtonDownAndMotion(startEv, ev, button = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data) {
|
|
180728
|
-
|
|
180729
|
-
|
|
180837
|
+
const startVp = startEv.viewport;
|
|
180838
|
+
if (undefined === startVp)
|
|
180839
|
+
return;
|
|
180840
|
+
const vp = ev.viewport;
|
|
180841
|
+
if (undefined === vp)
|
|
180842
|
+
return;
|
|
180843
|
+
await this.onButtonDown(startVp, startEv.viewPoint, button, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch);
|
|
180844
|
+
return this.onMotion(vp, ev.viewPoint, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch, true);
|
|
180730
180845
|
}
|
|
180731
180846
|
/** Can be called by tools that wish to emulate pressing the mouse button for onTouchStart or onTouchMoveStart. */
|
|
180732
180847
|
async convertTouchStartToButtonDown(ev, button = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data) {
|
|
180733
|
-
|
|
180848
|
+
const vp = ev.viewport;
|
|
180849
|
+
if (undefined === vp)
|
|
180850
|
+
return;
|
|
180851
|
+
return this.onButtonDown(vp, ev.viewPoint, button, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch);
|
|
180734
180852
|
}
|
|
180735
180853
|
/** Can be called by tools that wish to emulate releasing the mouse button for onTouchEnd or onTouchComplete.
|
|
180736
180854
|
* @note Calls the tool's onMouseEndDrag method if convertTouchMoveStartToButtonDownAndMotion was called for onTouchMoveStart.
|
|
180737
180855
|
*/
|
|
180738
180856
|
async convertTouchEndToButtonUp(ev, button = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data) {
|
|
180739
|
-
|
|
180857
|
+
const vp = ev.viewport;
|
|
180858
|
+
if (undefined === vp)
|
|
180859
|
+
return;
|
|
180860
|
+
return this.onButtonUp(vp, ev.viewPoint, button, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch);
|
|
180740
180861
|
}
|
|
180741
180862
|
/** Can be called by tools that wish to emulate a mouse motion event for onTouchMove. */
|
|
180742
180863
|
async convertTouchMoveToMotion(ev) {
|
|
180743
|
-
|
|
180864
|
+
const vp = ev.viewport;
|
|
180865
|
+
if (undefined === vp)
|
|
180866
|
+
return;
|
|
180867
|
+
return this.onMotion(vp, ev.viewPoint, _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Touch);
|
|
180744
180868
|
}
|
|
180745
180869
|
/** Can be called by tools to invoke their [[InteractiveTool.onDynamicFrame]] method without requiring a motion event. */
|
|
180746
180870
|
simulateMotionEvent() {
|
|
@@ -181445,11 +181569,13 @@ class ViewingToolHandle {
|
|
|
181445
181569
|
}
|
|
181446
181570
|
// if we have a valid depth point, set the focus distance to
|
|
181447
181571
|
changeFocusFromDepthPoint() {
|
|
181448
|
-
if (undefined
|
|
181449
|
-
|
|
181450
|
-
|
|
181451
|
-
|
|
181452
|
-
|
|
181572
|
+
if (undefined === this._depthPoint)
|
|
181573
|
+
return;
|
|
181574
|
+
const view = this.viewTool.viewport?.view;
|
|
181575
|
+
if (undefined === view)
|
|
181576
|
+
return;
|
|
181577
|
+
if (view.is3d() && view.isCameraOn)
|
|
181578
|
+
view.changeFocusFromPoint(this._depthPoint); // set the focus distance to the depth point
|
|
181453
181579
|
}
|
|
181454
181580
|
}
|
|
181455
181581
|
/** @internal */
|
|
@@ -181939,11 +182065,15 @@ class ViewManip extends ViewTool {
|
|
|
181939
182065
|
return inDynamics || (doUpdate && hitHandle.checkOneShot());
|
|
181940
182066
|
}
|
|
181941
182067
|
lensAngleMatches(angle, tolerance) {
|
|
181942
|
-
const cameraView = this.viewport
|
|
182068
|
+
const cameraView = this.viewport?.view;
|
|
182069
|
+
if (undefined === cameraView)
|
|
182070
|
+
return false;
|
|
181943
182071
|
return !cameraView.is3d() ? false : Math.abs(cameraView.calcLensAngle().radians - angle.radians) < tolerance;
|
|
181944
182072
|
}
|
|
181945
182073
|
get isZUp() {
|
|
181946
|
-
const view = this.viewport
|
|
182074
|
+
const view = this.viewport?.view;
|
|
182075
|
+
if (undefined === view)
|
|
182076
|
+
return true;
|
|
181947
182077
|
const viewX = view.getXVector();
|
|
181948
182078
|
const viewY = view.getXVector();
|
|
181949
182079
|
const zVec = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ();
|
|
@@ -182086,9 +182216,12 @@ class ViewTargetCenter extends ViewingToolHandle {
|
|
|
182086
182216
|
testHandleForHit(ptScreen, out) {
|
|
182087
182217
|
if (this.viewTool.isDraggingRequired)
|
|
182088
182218
|
return false; // Target center handle is not movable in this mode, but it's still nice to display the point we're rotating about...
|
|
182089
|
-
const
|
|
182219
|
+
const vp = this.viewTool.viewport;
|
|
182220
|
+
if (undefined === vp)
|
|
182221
|
+
return false;
|
|
182222
|
+
const targetPt = vp.worldToView(this.viewTool.targetCenterWorld);
|
|
182090
182223
|
const distance = targetPt.distanceXY(ptScreen);
|
|
182091
|
-
const locateThreshold =
|
|
182224
|
+
const locateThreshold = vp.pixelsFromInches(0.15);
|
|
182092
182225
|
if (distance > locateThreshold)
|
|
182093
182226
|
return false;
|
|
182094
182227
|
out.distance = distance;
|
|
@@ -182165,7 +182298,10 @@ class HandleWithInertia extends ViewingToolHandle {
|
|
|
182165
182298
|
doManipulation(ev, inDynamics) {
|
|
182166
182299
|
if (_ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.viewingInertia.enabled && !inDynamics && undefined !== this._inertiaVec)
|
|
182167
182300
|
return this.beginAnimation();
|
|
182168
|
-
const
|
|
182301
|
+
const vp = ev.viewport;
|
|
182302
|
+
if (undefined === vp)
|
|
182303
|
+
return false;
|
|
182304
|
+
const thisPtNpc = vp.worldToNpc(ev.point);
|
|
182169
182305
|
thisPtNpc.z = this._lastPtNpc.z;
|
|
182170
182306
|
this._inertiaVec = undefined;
|
|
182171
182307
|
if (this._lastPtNpc.isAlmostEqual(thisPtNpc, 1.0e-10))
|
|
@@ -182178,7 +182314,9 @@ class HandleWithInertia extends ViewingToolHandle {
|
|
|
182178
182314
|
this._duration = _ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.viewingInertia.duration;
|
|
182179
182315
|
if (this._duration.isTowardsFuture) { // ensure duration is towards future. Otherwise, don't start animation
|
|
182180
182316
|
this._end = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.fromNow(this._duration);
|
|
182181
|
-
this.viewTool.viewport
|
|
182317
|
+
const vp = this.viewTool.viewport;
|
|
182318
|
+
if (undefined !== vp)
|
|
182319
|
+
vp.setAnimator(this);
|
|
182182
182320
|
}
|
|
182183
182321
|
return true;
|
|
182184
182322
|
}
|
|
@@ -182192,7 +182330,10 @@ class HandleWithInertia extends ViewingToolHandle {
|
|
|
182192
182330
|
const pt = this._lastPtNpc.plusScaled(this._inertiaVec, remaining);
|
|
182193
182331
|
// if we're not moving any more, or if the duration has elapsed, we're done
|
|
182194
182332
|
if (remaining <= 0 || (this._lastPtNpc.minus(pt).magnitudeSquared() < .000001)) {
|
|
182195
|
-
this.viewTool.viewport
|
|
182333
|
+
const vp = this.viewTool.viewport;
|
|
182334
|
+
if (undefined === vp)
|
|
182335
|
+
return false;
|
|
182336
|
+
vp.saveViewUndo();
|
|
182196
182337
|
return true; // remove this as the animator
|
|
182197
182338
|
}
|
|
182198
182339
|
this.perform(pt); // perform the viewing operation
|
|
@@ -182206,10 +182347,12 @@ class ViewPan extends HandleWithInertia {
|
|
|
182206
182347
|
get handleType() { return ViewHandleType.Pan; }
|
|
182207
182348
|
getHandleCursor() { return this.viewTool.inHandleModify ? _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.viewManager.grabbingCursor : _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.viewManager.grabCursor; }
|
|
182208
182349
|
firstPoint(ev) {
|
|
182350
|
+
this._inertiaVec = undefined;
|
|
182209
182351
|
const tool = this.viewTool;
|
|
182210
182352
|
const vp = tool.viewport;
|
|
182353
|
+
if (undefined === vp)
|
|
182354
|
+
return false;
|
|
182211
182355
|
vp.worldToNpc(ev.point, this._lastPtNpc);
|
|
182212
|
-
this._inertiaVec = undefined;
|
|
182213
182356
|
// if the camera is on, we need to find the element under the starting point to get the z
|
|
182214
182357
|
if (this.needDepthPoint(ev, false)) {
|
|
182215
182358
|
this.pickDepthPoint(ev);
|
|
@@ -182231,6 +182374,8 @@ class ViewPan extends HandleWithInertia {
|
|
|
182231
182374
|
perform(thisPtNpc) {
|
|
182232
182375
|
const tool = this.viewTool;
|
|
182233
182376
|
const vp = tool.viewport;
|
|
182377
|
+
if (undefined === vp)
|
|
182378
|
+
return false;
|
|
182234
182379
|
const view = vp.view;
|
|
182235
182380
|
const lastWorld = vp.npcToWorld(this._lastPtNpc);
|
|
182236
182381
|
const thisWorld = vp.npcToWorld(thisPtNpc);
|
|
@@ -182249,7 +182394,10 @@ class ViewPan extends HandleWithInertia {
|
|
|
182249
182394
|
}
|
|
182250
182395
|
/** @internal */
|
|
182251
182396
|
needDepthPoint(ev, _isPreview) {
|
|
182252
|
-
|
|
182397
|
+
const vp = ev.viewport;
|
|
182398
|
+
if (undefined === vp)
|
|
182399
|
+
return false;
|
|
182400
|
+
return vp.isCameraOn && _Tool__WEBPACK_IMPORTED_MODULE_18__.CoordSource.User === ev.coordsFrom;
|
|
182253
182401
|
}
|
|
182254
182402
|
}
|
|
182255
182403
|
/** ViewingToolHandle for performing the "rotate view" operation */
|
|
@@ -182268,6 +182416,8 @@ class ViewRotate extends HandleWithInertia {
|
|
|
182268
182416
|
this._inertiaVec = undefined;
|
|
182269
182417
|
const tool = this.viewTool;
|
|
182270
182418
|
const vp = ev.viewport;
|
|
182419
|
+
if (undefined === vp)
|
|
182420
|
+
return false;
|
|
182271
182421
|
this.pickDepthPoint(ev);
|
|
182272
182422
|
if (undefined !== this._depthPoint)
|
|
182273
182423
|
tool.setTargetCenterWorld(this._depthPoint, false, false);
|
|
@@ -182282,6 +182432,8 @@ class ViewRotate extends HandleWithInertia {
|
|
|
182282
182432
|
perform(ptNpc) {
|
|
182283
182433
|
const tool = this.viewTool;
|
|
182284
182434
|
const vp = tool.viewport;
|
|
182435
|
+
if (undefined === vp)
|
|
182436
|
+
return false;
|
|
182285
182437
|
if (this._anchorPtNpc.isAlmostEqual(ptNpc, 1.0e-2)) // too close to anchor pt
|
|
182286
182438
|
ptNpc.setFrom(this._anchorPtNpc);
|
|
182287
182439
|
const currentFrustum = vp.getFrustum(_CoordSystem__WEBPACK_IMPORTED_MODULE_6__.CoordSystem.World, false);
|
|
@@ -182317,8 +182469,8 @@ class ViewRotate extends HandleWithInertia {
|
|
|
182317
182469
|
const xAxis = _ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.preserveWorldUp && !vp.viewingGlobe ? (undefined !== this._depthPoint ? vp.view.getUpVector(this._depthPoint) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ()) : vp.rotation.getRow(1);
|
|
182318
182470
|
// Movement in screen y == rotation about screen X...
|
|
182319
182471
|
const yAxis = vp.rotation.getRow(0);
|
|
182320
|
-
const xRMatrix = xDelta ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(xAxis, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(Math.PI / (viewRect.width / xDelta))) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity;
|
|
182321
|
-
const yRMatrix = yDelta ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(yAxis, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(Math.PI / (viewRect.height / yDelta))) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity;
|
|
182472
|
+
const xRMatrix = (xDelta ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(xAxis, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(Math.PI / (viewRect.width / xDelta))) : undefined) ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity;
|
|
182473
|
+
const yRMatrix = (yDelta ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(yAxis, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(Math.PI / (viewRect.height / yDelta))) : undefined) ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity;
|
|
182322
182474
|
const worldRMatrix = yRMatrix.multiplyMatrixMatrix(xRMatrix);
|
|
182323
182475
|
const result = worldRMatrix.getAxisAndAngleOfRotation();
|
|
182324
182476
|
angle = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(-result.angle.radians);
|
|
@@ -182349,11 +182501,14 @@ class ViewRotate extends HandleWithInertia {
|
|
|
182349
182501
|
}
|
|
182350
182502
|
/** @internal */
|
|
182351
182503
|
needDepthPoint(ev, _isPreview) {
|
|
182352
|
-
|
|
182504
|
+
const vp = ev.viewport;
|
|
182505
|
+
if (undefined === vp)
|
|
182506
|
+
return false;
|
|
182507
|
+
return (!this.viewTool.targetCenterLocked && vp.view.allow3dManipulations());
|
|
182353
182508
|
}
|
|
182354
182509
|
/** @internal */
|
|
182355
182510
|
adjustDepthPoint(isValid, vp, plane, source) {
|
|
182356
|
-
if (vp.viewingGlobe && this.viewTool.isPointVisible(vp.iModel.ecefLocation.earthCenter)) {
|
|
182511
|
+
if (vp.viewingGlobe && vp.iModel.ecefLocation && this.viewTool.isPointVisible(vp.iModel.ecefLocation.earthCenter)) {
|
|
182357
182512
|
plane.getOriginRef().setFrom(vp.iModel.ecefLocation.earthCenter);
|
|
182358
182513
|
plane.getNormalRef().setFrom(vp.view.getZVector());
|
|
182359
182514
|
return true;
|
|
@@ -182380,6 +182535,8 @@ class ViewLook extends ViewingToolHandle {
|
|
|
182380
182535
|
firstPoint(ev) {
|
|
182381
182536
|
const tool = this.viewTool;
|
|
182382
182537
|
const vp = ev.viewport;
|
|
182538
|
+
if (undefined === vp)
|
|
182539
|
+
return true;
|
|
182383
182540
|
const view = vp.view;
|
|
182384
182541
|
if (!view || !view.is3d() || !view.allow3dManipulations())
|
|
182385
182542
|
return false;
|
|
@@ -182404,11 +182561,13 @@ class ViewLook extends ViewingToolHandle {
|
|
|
182404
182561
|
doManipulation(ev, _inDynamics) {
|
|
182405
182562
|
const tool = this.viewTool;
|
|
182406
182563
|
const viewport = tool.viewport;
|
|
182564
|
+
if (undefined === viewport)
|
|
182565
|
+
return false;
|
|
182407
182566
|
if (ev.viewport !== viewport)
|
|
182408
182567
|
return false;
|
|
182409
182568
|
const worldTransform = this.getLookTransform(viewport, this._firstPtView, ev.viewPoint);
|
|
182410
182569
|
const frustum = this._frustum.transformBy(worldTransform);
|
|
182411
|
-
|
|
182570
|
+
viewport.setupViewFromFrustum(frustum);
|
|
182412
182571
|
return true;
|
|
182413
182572
|
}
|
|
182414
182573
|
getLookTransform(vp, firstPt, currPt) {
|
|
@@ -182481,7 +182640,8 @@ class AnimatedHandle extends ViewingToolHandle {
|
|
|
182481
182640
|
}
|
|
182482
182641
|
this._lastPtView.setFrom(this._anchorPtView);
|
|
182483
182642
|
this._lastMotionTime = Date.now();
|
|
182484
|
-
tool.viewport
|
|
182643
|
+
if (undefined !== tool.viewport)
|
|
182644
|
+
tool.viewport.setAnimator(this);
|
|
182485
182645
|
return true;
|
|
182486
182646
|
}
|
|
182487
182647
|
getDirection() {
|
|
@@ -182490,10 +182650,13 @@ class AnimatedHandle extends ViewingToolHandle {
|
|
|
182490
182650
|
return dir.magnitudeSquared() < this._deadZone ? undefined : dir; // dead zone around starting point
|
|
182491
182651
|
}
|
|
182492
182652
|
getInputVector() {
|
|
182653
|
+
const vp = this.viewTool.viewport;
|
|
182654
|
+
if (undefined === vp)
|
|
182655
|
+
return undefined;
|
|
182493
182656
|
const dir = this.getDirection();
|
|
182494
182657
|
if (undefined === dir)
|
|
182495
182658
|
return undefined;
|
|
182496
|
-
const viewRect =
|
|
182659
|
+
const viewRect = vp.viewRect;
|
|
182497
182660
|
return new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d(dir.x * (2.0 / viewRect.width), dir.y * (2.0 / viewRect.height));
|
|
182498
182661
|
}
|
|
182499
182662
|
onReinitialize() {
|
|
@@ -182569,6 +182732,8 @@ class ViewScroll extends AnimatedHandle {
|
|
|
182569
182732
|
dist.scaleInPlace(_ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.scrollSpeed * this.getElapsedTime());
|
|
182570
182733
|
const tool = this.viewTool;
|
|
182571
182734
|
const viewport = tool.viewport;
|
|
182735
|
+
if (undefined === viewport)
|
|
182736
|
+
return false;
|
|
182572
182737
|
if (viewport.isCameraOn) {
|
|
182573
182738
|
const points = new Array(2);
|
|
182574
182739
|
points[0] = this._anchorPtView.clone();
|
|
@@ -182589,7 +182754,10 @@ class ViewScroll extends AnimatedHandle {
|
|
|
182589
182754
|
}
|
|
182590
182755
|
/** @internal */
|
|
182591
182756
|
needDepthPoint(ev, _isPreview) {
|
|
182592
|
-
|
|
182757
|
+
const vp = ev.viewport;
|
|
182758
|
+
if (undefined === vp)
|
|
182759
|
+
return false;
|
|
182760
|
+
return vp.isCameraOn && _Tool__WEBPACK_IMPORTED_MODULE_18__.CoordSource.User === ev.coordsFrom;
|
|
182593
182761
|
}
|
|
182594
182762
|
}
|
|
182595
182763
|
/** ViewingToolHandle for performing the "zoom view" operation */
|
|
@@ -182639,6 +182807,8 @@ class ViewZoom extends ViewingToolHandle {
|
|
|
182639
182807
|
}
|
|
182640
182808
|
firstPoint(ev) {
|
|
182641
182809
|
const vp = ev.viewport;
|
|
182810
|
+
if (undefined === vp)
|
|
182811
|
+
return false;
|
|
182642
182812
|
this.viewTool.inDynamicUpdate = true;
|
|
182643
182813
|
if (this.needDepthPoint(ev, false)) {
|
|
182644
182814
|
this.pickDepthPoint(ev);
|
|
@@ -182683,6 +182853,8 @@ class ViewZoom extends ViewingToolHandle {
|
|
|
182683
182853
|
if (undefined === this._startFrust || undefined === this.getDirection()) // on anchor point?
|
|
182684
182854
|
return false;
|
|
182685
182855
|
const viewport = this.viewTool.viewport;
|
|
182856
|
+
if (undefined === viewport)
|
|
182857
|
+
return false;
|
|
182686
182858
|
const view = viewport.view;
|
|
182687
182859
|
const thisPtNpc = viewport.viewToNpc(this._lastPtView);
|
|
182688
182860
|
const dist = this._anchorPtNpc.minus(thisPtNpc);
|
|
@@ -182709,7 +182881,10 @@ class ViewZoom extends ViewingToolHandle {
|
|
|
182709
182881
|
}
|
|
182710
182882
|
/** @internal */
|
|
182711
182883
|
needDepthPoint(ev, _isPreview) {
|
|
182712
|
-
|
|
182884
|
+
const vp = ev.viewport;
|
|
182885
|
+
if (undefined === vp)
|
|
182886
|
+
return false;
|
|
182887
|
+
return vp.isCameraOn && _Tool__WEBPACK_IMPORTED_MODULE_18__.CoordSource.User === ev.coordsFrom;
|
|
182713
182888
|
}
|
|
182714
182889
|
}
|
|
182715
182890
|
/** @internal */
|
|
@@ -182773,11 +182948,17 @@ class NavigateMotion {
|
|
|
182773
182948
|
const yAngle = -(accumulator.y / yExtent) * Math.PI;
|
|
182774
182949
|
const viewRot = vp.rotation;
|
|
182775
182950
|
const invViewRot = viewRot.inverse();
|
|
182951
|
+
if (undefined === invViewRot)
|
|
182952
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182776
182953
|
const pitchAngle = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(this.modifyPitchAngleToPreventInversion(yAngle));
|
|
182777
182954
|
const pitchMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitX(), pitchAngle);
|
|
182955
|
+
if (undefined === pitchMatrix)
|
|
182956
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182778
182957
|
const pitchTimesView = pitchMatrix.multiplyMatrixMatrix(viewRot);
|
|
182779
182958
|
const inverseViewTimesPitchTimesView = invViewRot.multiplyMatrixMatrix(pitchTimesView);
|
|
182780
182959
|
const yawMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(xAngle));
|
|
182960
|
+
if (undefined === yawMatrix)
|
|
182961
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182781
182962
|
const yawTimesInverseViewTimesPitchTimesView = yawMatrix.multiplyMatrixMatrix(inverseViewTimesPitchTimesView);
|
|
182782
182963
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(view.getEyePoint(), yawTimesInverseViewTimesPitchTimesView, result);
|
|
182783
182964
|
}
|
|
@@ -182788,11 +182969,17 @@ class NavigateMotion {
|
|
|
182788
182969
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182789
182970
|
const viewRot = vp.rotation;
|
|
182790
182971
|
const invViewRot = viewRot.inverse();
|
|
182972
|
+
if (undefined === invViewRot)
|
|
182973
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182791
182974
|
const pitchAngle = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(this.modifyPitchAngleToPreventInversion(pitchRate * this._seconds));
|
|
182792
182975
|
const pitchMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitX(), pitchAngle);
|
|
182976
|
+
if (undefined === pitchMatrix)
|
|
182977
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182793
182978
|
const pitchTimesView = pitchMatrix.multiplyMatrixMatrix(viewRot);
|
|
182794
182979
|
const inverseViewTimesPitchTimesView = invViewRot.multiplyMatrixMatrix(pitchTimesView);
|
|
182795
182980
|
const yawMatrix = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(yawRate * this._seconds));
|
|
182981
|
+
if (undefined === yawMatrix)
|
|
182982
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
182796
182983
|
const yawTimesInverseViewTimesPitchTimesView = yawMatrix.multiplyMatrixMatrix(inverseViewTimesPitchTimesView);
|
|
182797
182984
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(view.getEyePoint(), yawTimesInverseViewTimesPitchTimesView, result);
|
|
182798
182985
|
}
|
|
@@ -182850,6 +183037,8 @@ class NavigateMotion {
|
|
|
182850
183037
|
if (!view.is3d() || !view.isCameraOn)
|
|
182851
183038
|
return;
|
|
182852
183039
|
const angles = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.YawPitchRollAngles.createFromMatrix3d(this.viewport.rotation);
|
|
183040
|
+
if (undefined === angles)
|
|
183041
|
+
return;
|
|
182853
183042
|
angles.pitch.setRadians(0); // reset pitch to zero
|
|
182854
183043
|
_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(view.getEyePoint(), angles.toMatrix3d(), this.transform);
|
|
182855
183044
|
}
|
|
@@ -182862,7 +183051,7 @@ class ViewNavigate extends AnimatedHandle {
|
|
|
182862
183051
|
getMaxAngularVelocity() { return Math.PI / 4; }
|
|
182863
183052
|
getNavigateMode() {
|
|
182864
183053
|
const state = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.toolAdmin.currentInputState;
|
|
182865
|
-
return (state.isShiftDown ||
|
|
183054
|
+
return (state.isShiftDown || (false === this.viewTool.viewport?.isCameraOn)) ? 0 /* NavigateMode.Pan */ :
|
|
182866
183055
|
state.isControlDown ? 1 /* NavigateMode.Look */ : 2 /* NavigateMode.Travel */;
|
|
182867
183056
|
}
|
|
182868
183057
|
// called in animation loop
|
|
@@ -182872,6 +183061,8 @@ class ViewNavigate extends AnimatedHandle {
|
|
|
182872
183061
|
const motion = this.getNavigateMotion(this.getElapsedTime());
|
|
182873
183062
|
if (undefined !== motion) {
|
|
182874
183063
|
const vp = this.viewTool.viewport;
|
|
183064
|
+
if (undefined === vp)
|
|
183065
|
+
return false;
|
|
182875
183066
|
const frust = vp.getWorldFrustum();
|
|
182876
183067
|
frust.multiply(motion.transform);
|
|
182877
183068
|
vp.setupViewFromFrustum(frust);
|
|
@@ -182943,6 +183134,7 @@ class ViewLookAndMove extends ViewNavigate {
|
|
|
182943
183134
|
_pointerLockKeyEngagementListener;
|
|
182944
183135
|
constructor(viewManip) {
|
|
182945
183136
|
super(viewManip);
|
|
183137
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
182946
183138
|
this._navigateMotion = new NavigateMotion(this.viewTool.viewport);
|
|
182947
183139
|
}
|
|
182948
183140
|
get handleType() { return ViewHandleType.LookAndMove; }
|
|
@@ -183065,10 +183257,10 @@ class ViewLookAndMove extends ViewNavigate {
|
|
|
183065
183257
|
getMaxAngularVelocityY() { return this.getMaxAngularVelocity(); }
|
|
183066
183258
|
getLinearVelocity() {
|
|
183067
183259
|
const positionInput = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
183068
|
-
const vp = this.viewTool.viewport;
|
|
183069
183260
|
const position = this.getTouchStartPosition(this._touchStartL);
|
|
183070
183261
|
if (undefined !== position) {
|
|
183071
|
-
const
|
|
183262
|
+
const vp = this.viewTool.viewport;
|
|
183263
|
+
const outerRadius = vp ? this.getTouchControlRadius(vp) : 1;
|
|
183072
183264
|
const offset = this.getTouchOffset(this._touchStartL, outerRadius);
|
|
183073
183265
|
const inputL = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d(offset.x * (1.0 / outerRadius), offset.y * (1.0 / outerRadius));
|
|
183074
183266
|
positionInput.x = inputL.x * this.getMaxLinearVelocity();
|
|
@@ -183083,10 +183275,10 @@ class ViewLookAndMove extends ViewNavigate {
|
|
|
183083
183275
|
}
|
|
183084
183276
|
getAngularVelocity() {
|
|
183085
183277
|
const angularInput = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
183086
|
-
const vp = this.viewTool.viewport;
|
|
183087
183278
|
const position = this.getTouchStartPosition(this._touchStartR);
|
|
183088
183279
|
if (undefined !== position) {
|
|
183089
|
-
const
|
|
183280
|
+
const vp = this.viewTool.viewport;
|
|
183281
|
+
const outerRadius = vp ? this.getTouchControlRadius(vp) : 1;
|
|
183090
183282
|
const offset = this.getTouchOffset(this._touchStartR, outerRadius);
|
|
183091
183283
|
const inputA = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d(offset.x * (1.0 / outerRadius), offset.y * (1.0 / outerRadius));
|
|
183092
183284
|
angularInput.x = inputA.x * -this.getMaxAngularVelocityX();
|
|
@@ -183339,7 +183531,8 @@ class ViewLookAndMove extends ViewNavigate {
|
|
|
183339
183531
|
if (tool.inDynamicUpdate)
|
|
183340
183532
|
return;
|
|
183341
183533
|
tool.changeViewport(vp);
|
|
183342
|
-
tool.viewport
|
|
183534
|
+
if (undefined !== tool.viewport)
|
|
183535
|
+
tool.viewport.setAnimator(this);
|
|
183343
183536
|
tool.inDynamicUpdate = true;
|
|
183344
183537
|
tool.inHandleModify = true;
|
|
183345
183538
|
vp.npcToView(_itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.NpcCenter, this._anchorPtView);
|
|
@@ -183504,6 +183697,8 @@ class ViewLookAndMove extends ViewNavigate {
|
|
|
183504
183697
|
const position = this.getTouchStartPosition(touchStart);
|
|
183505
183698
|
if (undefined === position)
|
|
183506
183699
|
return offset;
|
|
183700
|
+
if (undefined === touchStart?.viewport)
|
|
183701
|
+
return offset;
|
|
183507
183702
|
const lastTouch = _Tool__WEBPACK_IMPORTED_MODULE_18__.BeTouchEvent.findTouchById(this._touchLast.touchEvent.targetTouches, touchStart.touchEvent.changedTouches[0].identifier);
|
|
183508
183703
|
if (undefined === lastTouch)
|
|
183509
183704
|
return offset;
|
|
@@ -183719,6 +183914,7 @@ class ViewWalk extends ViewNavigate {
|
|
|
183719
183914
|
_navigateMotion;
|
|
183720
183915
|
constructor(viewManip) {
|
|
183721
183916
|
super(viewManip);
|
|
183917
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
183722
183918
|
this._navigateMotion = new NavigateMotion(this.viewTool.viewport);
|
|
183723
183919
|
}
|
|
183724
183920
|
get handleType() { return ViewHandleType.Walk; }
|
|
@@ -183753,6 +183949,7 @@ class ViewFly extends ViewNavigate {
|
|
|
183753
183949
|
_navigateMotion;
|
|
183754
183950
|
constructor(viewManip) {
|
|
183755
183951
|
super(viewManip);
|
|
183952
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
183756
183953
|
this._navigateMotion = new NavigateMotion(this.viewTool.viewport);
|
|
183757
183954
|
}
|
|
183758
183955
|
get handleType() { return ViewHandleType.Fly; }
|
|
@@ -184319,6 +184516,8 @@ class WindowAreaTool extends ViewTool {
|
|
|
184319
184516
|
}
|
|
184320
184517
|
computeWindowCorners() {
|
|
184321
184518
|
const vp = this.viewport;
|
|
184519
|
+
if (undefined === vp)
|
|
184520
|
+
return undefined;
|
|
184322
184521
|
const corners = this._corners;
|
|
184323
184522
|
corners[0].setFrom(this._firstPtWorld);
|
|
184324
184523
|
corners[1].setFrom(this._secondPtWorld);
|
|
@@ -184407,13 +184606,15 @@ class WindowAreaTool extends ViewTool {
|
|
|
184407
184606
|
const corners = this.computeWindowCorners();
|
|
184408
184607
|
if (undefined === corners)
|
|
184409
184608
|
return;
|
|
184410
|
-
let delta;
|
|
184411
184609
|
const vp = this.viewport;
|
|
184610
|
+
if (undefined === vp)
|
|
184611
|
+
return;
|
|
184412
184612
|
const view = vp.view;
|
|
184413
184613
|
vp.viewToWorldArray(corners);
|
|
184414
184614
|
const opts = {
|
|
184415
184615
|
onExtentsError: (stat) => view.outputStatusMessage(stat),
|
|
184416
184616
|
};
|
|
184617
|
+
let delta;
|
|
184417
184618
|
let globalAlignment;
|
|
184418
184619
|
if (view.is3d() && view.isCameraOn) {
|
|
184419
184620
|
const windowArray = [corners[0].clone(), corners[1].clone()];
|
|
@@ -184485,7 +184686,10 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184485
184686
|
const vec = this._lastPtView.minus(pt);
|
|
184486
184687
|
// if we're not moving any more, or if the duration has elapsed, we're done
|
|
184487
184688
|
if (remaining <= 0 || (vec.magnitudeSquared() < .000001)) {
|
|
184488
|
-
this.viewport
|
|
184689
|
+
const vp = this.viewport;
|
|
184690
|
+
if (undefined === vp)
|
|
184691
|
+
return false;
|
|
184692
|
+
vp.saveViewUndo();
|
|
184489
184693
|
return true; // remove this as the animator
|
|
184490
184694
|
}
|
|
184491
184695
|
this._lastPtView.setFrom(pt);
|
|
@@ -184501,6 +184705,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184501
184705
|
}
|
|
184502
184706
|
onStart(ev) {
|
|
184503
184707
|
const vp = this.viewport;
|
|
184708
|
+
if (undefined === vp)
|
|
184709
|
+
return;
|
|
184504
184710
|
vp.getWorldFrustum(this._frustum);
|
|
184505
184711
|
const visiblePoint = vp.pickNearestVisibleGeometry(ev.rawPoint);
|
|
184506
184712
|
if (undefined !== visiblePoint) {
|
|
@@ -184523,8 +184729,10 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184523
184729
|
if (undefined === ev || 0.0 === this._startDistance)
|
|
184524
184730
|
return 1.0;
|
|
184525
184731
|
const vp = this.viewport;
|
|
184732
|
+
if (undefined === vp)
|
|
184733
|
+
return 1.0;
|
|
184526
184734
|
const distance = (2 === ev.touchCount ? _Tool__WEBPACK_IMPORTED_MODULE_18__.BeTouchEvent.getTouchPosition(ev.touchEvent.targetTouches[0], vp).distance(_Tool__WEBPACK_IMPORTED_MODULE_18__.BeTouchEvent.getTouchPosition(ev.touchEvent.targetTouches[1], vp)) : 0.0);
|
|
184527
|
-
const threshold =
|
|
184735
|
+
const threshold = vp.pixelsFromInches(_ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.touchZoomChangeThresholdInches);
|
|
184528
184736
|
if (0.0 === distance || Math.abs(this._startDistance - distance) < threshold)
|
|
184529
184737
|
return 1.0;
|
|
184530
184738
|
// Remove inertia if the viewing operation includes zoom, only use it for pan and rotate.
|
|
@@ -184536,6 +184744,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184536
184744
|
if (undefined === ev || ev.touchCount < 2 || this._rotate2dDisabled)
|
|
184537
184745
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(0.0);
|
|
184538
184746
|
const vp = this.viewport;
|
|
184747
|
+
if (undefined === vp)
|
|
184748
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(0.0);
|
|
184539
184749
|
const direction = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector2d.createStartEnd(_Tool__WEBPACK_IMPORTED_MODULE_18__.BeTouchEvent.getTouchPosition(ev.touchEvent.targetTouches[0], vp), _Tool__WEBPACK_IMPORTED_MODULE_18__.BeTouchEvent.getTouchPosition(ev.touchEvent.targetTouches[1], vp));
|
|
184540
184750
|
const rotation = this._startDirection.angleTo(direction);
|
|
184541
184751
|
if (undefined === this._rotate2dThreshold) {
|
|
@@ -184555,15 +184765,18 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184555
184765
|
}
|
|
184556
184766
|
handle2dPan() {
|
|
184557
184767
|
const screenDist = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(this._startPtView.x - this._lastPtView.x, this._startPtView.y - this._lastPtView.y);
|
|
184558
|
-
this.viewport
|
|
184768
|
+
if (undefined !== this.viewport)
|
|
184769
|
+
this.viewport.scroll(screenDist, { noSaveInUndo: true });
|
|
184559
184770
|
}
|
|
184560
184771
|
handle2dRotateZoom(ev) {
|
|
184561
184772
|
const vp = this.viewport;
|
|
184773
|
+
if (undefined === vp)
|
|
184774
|
+
return;
|
|
184562
184775
|
const rotation = this.computeRotation(ev);
|
|
184563
184776
|
const zoomRatio = this.computeZoomRatio(ev);
|
|
184564
184777
|
const targetWorld = vp.viewToWorld(this._lastPtView);
|
|
184565
184778
|
const translateTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslation(this._startPtWorld.minus(targetWorld));
|
|
184566
|
-
const rotationTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(targetWorld, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(vp.view.getZVector(), rotation));
|
|
184779
|
+
const rotationTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(targetWorld, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(vp.view.getZVector(), rotation) ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
|
|
184567
184780
|
const scaleTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createScaleAboutPoint(this._startPtWorld, zoomRatio);
|
|
184568
184781
|
const transform = translateTransform.multiplyTransformTransform(rotationTransform);
|
|
184569
184782
|
scaleTransform.multiplyTransformTransform(transform, transform);
|
|
@@ -184572,6 +184785,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184572
184785
|
}
|
|
184573
184786
|
handle3dRotate() {
|
|
184574
184787
|
const vp = this.viewport;
|
|
184788
|
+
if (undefined === vp)
|
|
184789
|
+
return;
|
|
184575
184790
|
const viewRect = vp.viewRect;
|
|
184576
184791
|
const xExtent = viewRect.width;
|
|
184577
184792
|
const yExtent = viewRect.height;
|
|
@@ -184579,8 +184794,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184579
184794
|
const yDelta = this._lastPtView.y - this._startPtView.y;
|
|
184580
184795
|
const xAxis = _ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.preserveWorldUp ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ() : vp.rotation.getRow(1);
|
|
184581
184796
|
const yAxis = vp.rotation.getRow(0);
|
|
184582
|
-
const xRMatrix = (
|
|
184583
|
-
const yRMatrix = (
|
|
184797
|
+
const xRMatrix = (xDelta ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(xAxis, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(Math.PI / (xExtent / xDelta))) : undefined) ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity;
|
|
184798
|
+
const yRMatrix = (yDelta ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createRotationAroundVector(yAxis, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(Math.PI / (yExtent / yDelta))) : undefined) ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity;
|
|
184584
184799
|
const worldRMatrix = yRMatrix.multiplyMatrixMatrix(xRMatrix);
|
|
184585
184800
|
const result = worldRMatrix.getAxisAndAngleOfRotation();
|
|
184586
184801
|
const radians = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(-result.angle.radians);
|
|
@@ -184594,6 +184809,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184594
184809
|
}
|
|
184595
184810
|
handle3dPanZoom(ev) {
|
|
184596
184811
|
const vp = this.viewport;
|
|
184812
|
+
if (undefined === vp)
|
|
184813
|
+
return;
|
|
184597
184814
|
const zoomRatio = this.computeZoomRatio(ev);
|
|
184598
184815
|
if (vp.isCameraOn) {
|
|
184599
184816
|
const targetWorld = vp.viewToWorld(this._lastPtView);
|
|
@@ -184652,6 +184869,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184652
184869
|
}
|
|
184653
184870
|
perform(ev) {
|
|
184654
184871
|
const vp = this.viewport;
|
|
184872
|
+
if (undefined === vp)
|
|
184873
|
+
return;
|
|
184655
184874
|
vp.setupViewFromFrustum(this._frustum);
|
|
184656
184875
|
const singleTouch = this._singleTouch;
|
|
184657
184876
|
return (!this._only2dManipulations && vp.view.allow3dManipulations()) ?
|
|
@@ -184674,7 +184893,8 @@ class DefaultViewTouchTool extends ViewManip {
|
|
|
184674
184893
|
this._duration = _ToolSettings__WEBPACK_IMPORTED_MODULE_20__.ToolSettings.viewingInertia.duration;
|
|
184675
184894
|
if (this._duration.isTowardsFuture) { // ensure duration is towards future. Otherwise, don't start animation
|
|
184676
184895
|
this._end = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.fromNow(this._duration);
|
|
184677
|
-
this.viewport
|
|
184896
|
+
if (undefined !== this.viewport)
|
|
184897
|
+
this.viewport.setAnimator(this);
|
|
184678
184898
|
}
|
|
184679
184899
|
}
|
|
184680
184900
|
return this.exitTool();
|
|
@@ -304967,10 +305187,10 @@ class Settings {
|
|
|
304967
305187
|
});
|
|
304968
305188
|
}
|
|
304969
305189
|
toString() {
|
|
304970
|
-
return `Configurations:
|
|
304971
|
-
oidc client id: ${this.oidcClientId},
|
|
304972
|
-
oidc scopes: ${this.oidcScopes},
|
|
304973
|
-
applicationId: ${this.gprid},
|
|
305190
|
+
return `Configurations:
|
|
305191
|
+
oidc client id: ${this.oidcClientId},
|
|
305192
|
+
oidc scopes: ${this.oidcScopes},
|
|
305193
|
+
applicationId: ${this.gprid},
|
|
304974
305194
|
log level: ${this.logLevel}`;
|
|
304975
305195
|
}
|
|
304976
305196
|
}
|
|
@@ -317781,7 +318001,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
317781
318001
|
/***/ ((module) => {
|
|
317782
318002
|
|
|
317783
318003
|
"use strict";
|
|
317784
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
318004
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.64","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","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run 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.2.2-dev.2","@types/chai-as-promised":"^7","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","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"}}');
|
|
317785
318005
|
|
|
317786
318006
|
/***/ })
|
|
317787
318007
|
|