@itwin/ecschema-rpcinterface-tests 4.1.0-dev.32 → 4.1.0-dev.35

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.
@@ -72734,8 +72734,9 @@ class AccuSnap {
72734
72734
  return realitySnap;
72735
72735
  }
72736
72736
  }
72737
+ const hitVp = thisHit.viewAttachment ? thisHit.viewAttachment.viewport : thisHit.viewport;
72737
72738
  if (undefined !== thisHit.subCategoryId && !thisHit.isExternalIModelHit) {
72738
- const appearance = thisHit.viewport.getSubCategoryAppearance(thisHit.subCategoryId);
72739
+ const appearance = hitVp.getSubCategoryAppearance(thisHit.subCategoryId);
72739
72740
  if (appearance.dontSnap) {
72740
72741
  if (out) {
72741
72742
  out.snapStatus = _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NotSnappable;
@@ -72748,10 +72749,10 @@ class AccuSnap {
72748
72749
  id: thisHit.sourceId,
72749
72750
  testPoint: thisHit.testPoint,
72750
72751
  closePoint: thisHit.hitPoint,
72751
- worldToView: thisHit.viewport.worldToViewMap.transform0.toJSON(),
72752
- viewFlags: thisHit.viewport.viewFlags,
72752
+ worldToView: hitVp.worldToViewMap.transform0.toJSON(),
72753
+ viewFlags: hitVp.viewFlags,
72753
72754
  snapModes,
72754
- snapAperture: thisHit.viewport.pixelsFromInches(hotDistanceInches),
72755
+ snapAperture: hitVp.pixelsFromInches(hotDistanceInches),
72755
72756
  snapDivisor: keypointDivisor,
72756
72757
  subCategoryId: thisHit.subCategoryId,
72757
72758
  geometryClass: thisHit.geometryClass,
@@ -72805,7 +72806,11 @@ class AccuSnap {
72805
72806
  return parsed instanceof _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.GeometryQuery && "curvePrimitive" === parsed.geometryCategory ? parsed : undefined;
72806
72807
  };
72807
72808
  const snapPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(result.snapPoint);
72808
- const displayTransform = undefined !== thisHit.modelId ? thisHit.viewport.view.computeDisplayTransform({ modelId: thisHit.modelId, elementId: thisHit.sourceId }) : undefined;
72809
+ const displayTransform = undefined !== thisHit.modelId ? thisHit.viewport.view.computeDisplayTransform({
72810
+ modelId: thisHit.modelId,
72811
+ elementId: thisHit.sourceId,
72812
+ viewAttachmentId: thisHit.viewAttachment?.id,
72813
+ }) : undefined;
72809
72814
  displayTransform?.multiplyPoint3d(snapPoint, snapPoint);
72810
72815
  const snap = new _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapDetail(thisHit, result.snapMode, result.heat, snapPoint);
72811
72816
  snap.setCurvePrimitive(parseCurve(result.curve), displayTransform, result.geomType);
@@ -75517,7 +75522,8 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
75517
75522
  /** @internal */
75518
75523
  async queryRenderTimelineProps(timelineId) {
75519
75524
  try {
75520
- return await this.iModel.elements.loadProps(timelineId, { renderTimeline: { omitScriptElementIds: true } });
75525
+ const omitScriptElementIds = !_IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.tileAdmin.enableFrontendScheduleScripts;
75526
+ return await this.iModel.elements.loadProps(timelineId, { renderTimeline: { omitScriptElementIds } });
75521
75527
  }
75522
75528
  catch (_) {
75523
75529
  return undefined;
@@ -76847,8 +76853,30 @@ class ElementPicker {
76847
76853
  });
76848
76854
  if (!hitPointWorld)
76849
76855
  continue;
76856
+ let viewAttachment;
76857
+ if (pixel.viewAttachmentId) {
76858
+ const attachmentViewport = vp.view.getAttachmentViewport(pixel.viewAttachmentId);
76859
+ if (attachmentViewport)
76860
+ viewAttachment = { viewport: attachmentViewport, id: pixel.viewAttachmentId };
76861
+ }
76850
76862
  const modelId = pixel.modelId;
76851
- const hit = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitDetail(pickPointWorld, vp, options.hitSource, hitPointWorld, pixel.elementId, this.getPixelPriority(pixel), testPointView.distance(elmPoint), pixel.distanceFraction, pixel.subCategoryId, pixel.geometryClass, modelId, pixel.iModel, pixel.tileId, pixel.isClassifier);
76863
+ const hit = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitDetail({
76864
+ testPoint: pickPointWorld,
76865
+ viewport: vp,
76866
+ hitSource: options.hitSource,
76867
+ hitPoint: hitPointWorld,
76868
+ sourceId: pixel.elementId,
76869
+ priority: this.getPixelPriority(pixel),
76870
+ distXY: testPointView.distance(elmPoint),
76871
+ distFraction: pixel.distanceFraction,
76872
+ subCategoryId: pixel.subCategoryId,
76873
+ geometryClass: pixel.geometryClass,
76874
+ modelId,
76875
+ sourceIModel: pixel.iModel,
76876
+ tileId: pixel.tileId,
76877
+ isClassifier: pixel.isClassifier,
76878
+ viewAttachment,
76879
+ });
76852
76880
  this.hitList.addHit(hit);
76853
76881
  if (this.hitList.hits.length > options.maxHits)
76854
76882
  this.hitList.hits.length = options.maxHits; // truncate array...
@@ -79224,37 +79252,87 @@ var HitDetailType;
79224
79252
  * @extensions
79225
79253
  */
79226
79254
  class HitDetail {
79227
- /** Create a new HitDetail from the inputs to and results of a locate operation.
79228
- * @param testPoint The world coordinate space point that was used as the locate point.
79229
- * @param viewport The view the locate operation was performed in.
79230
- * @param hitSource The procedure that requested the locate operation.
79231
- * @param hitPoint The approximate world coordinate location on the geometry identified by this HitDetail.
79232
- * @param sourceId The source of the geometry, either a persistent element id or pickable decoration id.
79233
- * @param priority The hit geometry priority/classification.
79234
- * @param distXY The xy distance to hit in view coordinates.
79235
- * @param distFraction The near plane distance fraction to hit.
79236
- * @param subCategoryId The SubCategory for a persistent element hit.
79237
- * @param geometryClass The GeometryClass for a persistent element hit.
79238
- * @param iModel The IModelConnection from which the hit originated. This should almost always be left undefined, unless the hit is known to have originated from an iModel other than the one associated with the viewport.
79239
- * @param modelId Optionally the Id of the [[ModelState]] from which the hit originated.
79240
- * @param tileId Optionally the Id of the Tile from which the hit originated.
79241
- * @param isClassifier Optionally whether the hit originated from a reality model classification.
79242
- */
79243
- constructor(testPoint, viewport, hitSource, hitPoint, sourceId, priority, distXY, distFraction, subCategoryId, geometryClass, modelId, iModel, tileId, isClassifier) {
79244
- this.testPoint = testPoint;
79245
- this.viewport = viewport;
79246
- this.hitSource = hitSource;
79247
- this.hitPoint = hitPoint;
79248
- this.sourceId = sourceId;
79249
- this.priority = priority;
79250
- this.distXY = distXY;
79251
- this.distFraction = distFraction;
79252
- this.subCategoryId = subCategoryId;
79253
- this.geometryClass = geometryClass;
79254
- this.modelId = modelId;
79255
- this._iModel = iModel;
79256
- this.tileId = tileId;
79257
- this.isClassifier = undefined !== isClassifier ? isClassifier : false;
79255
+ /** The point in world coordinates that was used as the initial locate point. */
79256
+ get testPoint() { return this._props.testPoint; }
79257
+ /** The viewport in which the locate operation was performed. */
79258
+ get viewport() { return this._props.viewport; }
79259
+ /** The procedure that requested the locate operation. */
79260
+ get hitSource() { return this._props.hitSource; }
79261
+ /** The approximate location in world coordinates on the geometry identified by this HitDetail. */
79262
+ get hitPoint() { return this._props.hitPoint; }
79263
+ /** The source of the geometry. This may be a persistent element Id, or a transient Id used for, e.g., pickable decorations. */
79264
+ get sourceId() { return this._props.sourceId; }
79265
+ /** The hit geometry priority/classification. */
79266
+ get priority() { return this._props.priority; }
79267
+ /** The xy distance to the hit in view coordinates. */
79268
+ get distXY() { return this._props.distXY; }
79269
+ /** The distance in view coordinates between the hit and the near plane. */
79270
+ get distFraction() { return this._props.distFraction; }
79271
+ /** The [SubCategory]($backend) to which the hit geometry belongs. */
79272
+ get subCategoryId() { return this._props.subCategoryId; }
79273
+ /** The class of the hit geometry. */
79274
+ get geometryClass() { return this._props.geometryClass; }
79275
+ /** The Id of the [[ModelState]] from which the hit originated. */
79276
+ get modelId() { return this._props.modelId; }
79277
+ /** The IModelConnection from which the hit originated.
79278
+ * This should almost always be left undefined, unless the hit is known to have originated from an iModel
79279
+ * other than the one associated with the viewport.
79280
+ * @internal
79281
+ */
79282
+ get sourceIModel() { return this._props.sourceIModel; }
79283
+ /** @internal chiefly for debugging */
79284
+ get tileId() { return this._props.tileId; }
79285
+ /** True if the hit originated from a reality model classifier.
79286
+ * @alpha
79287
+ */
79288
+ get isClassifier() { return this._props.isClassifier; }
79289
+ /** Information about the [ViewAttachment]($backend) within which the hit geometry resides, if any.
79290
+ * @note Only [[SheetViewState]]s can have view attachments.
79291
+ * @beta
79292
+ */
79293
+ get viewAttachment() { return this._props.viewAttachment; }
79294
+ /** @internal */
79295
+ constructor(arg0, viewport, hitSource, hitPoint, sourceId, priority, distXY, distFraction, subCategoryId, geometryClass, modelId, sourceIModel, tileId, isClassifier) {
79296
+ if (arg0 instanceof _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d) {
79297
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== viewport && undefined !== hitSource && undefined !== hitPoint && undefined !== sourceId);
79298
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== priority && undefined !== distXY && undefined !== distFraction);
79299
+ this._props = {
79300
+ testPoint: arg0,
79301
+ viewport,
79302
+ hitSource,
79303
+ hitPoint,
79304
+ sourceId,
79305
+ priority,
79306
+ distXY,
79307
+ distFraction,
79308
+ subCategoryId,
79309
+ geometryClass,
79310
+ modelId,
79311
+ sourceIModel,
79312
+ tileId,
79313
+ isClassifier,
79314
+ };
79315
+ }
79316
+ else {
79317
+ // Tempting to use { ...arg0 } but spread operator omits getters so, e.g., if input is a HitDetail we would lose all the properties.
79318
+ this._props = {
79319
+ testPoint: arg0.testPoint,
79320
+ viewport: arg0.viewport,
79321
+ hitSource: arg0.hitSource,
79322
+ hitPoint: arg0.hitPoint,
79323
+ sourceId: arg0.sourceId,
79324
+ priority: arg0.priority,
79325
+ distXY: arg0.distXY,
79326
+ distFraction: arg0.distFraction,
79327
+ subCategoryId: arg0.subCategoryId,
79328
+ geometryClass: arg0.geometryClass,
79329
+ modelId: arg0.modelId,
79330
+ sourceIModel: arg0.sourceIModel,
79331
+ tileId: arg0.tileId,
79332
+ isClassifier: arg0.isClassifier,
79333
+ viewAttachment: arg0.viewAttachment,
79334
+ };
79335
+ }
79258
79336
  }
79259
79337
  /** Get the type of HitDetail.
79260
79338
  * @returns HitDetailType.Hit if this is a HitDetail, HitDetailType.Snap if it is a SnapDetail
@@ -79276,8 +79354,7 @@ class HitDetail {
79276
79354
  get isMapHit() { return undefined !== this.viewport.mapLayerFromHit(this); }
79277
79355
  /** Create a deep copy of this HitDetail */
79278
79356
  clone() {
79279
- const val = new HitDetail(this.testPoint, this.viewport, this.hitSource, this.hitPoint, this.sourceId, this.priority, this.distXY, this.distFraction, this.subCategoryId, this.geometryClass, this.modelId, this._iModel, this.tileId, this.isClassifier);
79280
- return val;
79357
+ return new HitDetail(this);
79281
79358
  }
79282
79359
  /** Draw this HitDetail as a Decoration. Causes the picked element to *flash* */
79283
79360
  draw(_context) {
@@ -79294,11 +79371,15 @@ class HitDetail {
79294
79371
  * for example, if a [[TiledGraphicsProvider]] is used to display graphics from a different iModel in the viewport.
79295
79372
  * This HitDetail's element, subcategory, and model Ids are defined in the context of this IModelConnection.
79296
79373
  */
79297
- get iModel() { return undefined !== this._iModel ? this._iModel : this.viewport.iModel; }
79374
+ get iModel() {
79375
+ return this.sourceIModel ?? this.viewport.iModel;
79376
+ }
79298
79377
  /** Returns true if this hit originated from an [[IModelConnection]] other than the one associated with the [[Viewport]].
79299
79378
  * @see [[iModel]].
79300
79379
  */
79301
- get isExternalIModelHit() { return this.iModel !== this.viewport.iModel; }
79380
+ get isExternalIModelHit() {
79381
+ return this.iModel !== this.viewport.iModel;
79382
+ }
79302
79383
  }
79303
79384
  /** A SnapDetail is generated from the result of a snap request. In addition to the HitDetail about the reason the element was *picked*,
79304
79385
  * it holds the *exact* point on the element from the snapping logic, plus additional information that varies with the type of element and snap mode.
@@ -79313,7 +79394,7 @@ class SnapDetail extends HitDetail {
79313
79394
  * @param snapPoint The snapped point in the element
79314
79395
  */
79315
79396
  constructor(from, snapMode = SnapMode.Nearest, heat = SnapHeat.None, snapPoint) {
79316
- super(from.testPoint, from.viewport, from.hitSource, from.hitPoint, from.sourceId, from.priority, from.distXY, from.distFraction, from.subCategoryId, from.geometryClass, from.modelId, from.iModel, from.tileId, from.isClassifier);
79397
+ super(from);
79317
79398
  this.snapMode = snapMode;
79318
79399
  this.heat = heat;
79319
79400
  this.snapPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(snapPoint ? snapPoint : from.hitPoint);
@@ -84980,6 +85061,9 @@ class ViewAttachments {
84980
85061
  for (const attachment of this._attachments)
84981
85062
  attachment.addToScene(context);
84982
85063
  }
85064
+ findById(attachmentId) {
85065
+ return this._attachments.find((attachment) => attachment.viewAttachmentProps.id === attachmentId);
85066
+ }
84983
85067
  }
84984
85068
  /** A view of a [SheetModel]($backend).
84985
85069
  * @public
@@ -85160,6 +85244,16 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_13__.ViewState2
85160
85244
  return super.computeFitRange();
85161
85245
  return new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d(0, 0, -1, size.x, size.y, 1);
85162
85246
  }
85247
+ /** @internal */
85248
+ getAttachmentViewport(id) {
85249
+ return this._attachments?.findById(id)?.viewport;
85250
+ }
85251
+ /** @internal */
85252
+ computeDisplayTransform(args) {
85253
+ // ###TODO check if the attached view has a display transform...
85254
+ const attachment = undefined !== args.viewAttachmentId ? this._attachments?.findById(args.viewAttachmentId) : undefined;
85255
+ return attachment && attachment instanceof OrthographicAttachment ? attachment.toSheet.clone() : undefined;
85256
+ }
85163
85257
  }
85164
85258
  /** A mostly no-op RenderTarget for an Attachment.
85165
85259
  * its Scene and symbology overrides.
@@ -85345,6 +85439,7 @@ class OrthographicAttachment {
85345
85439
  return;
85346
85440
  // Extract scene graphics and insert into on-screen scene context.
85347
85441
  const options = {
85442
+ viewAttachmentId: this._props.id,
85348
85443
  clipVolume: this._clipVolume,
85349
85444
  hline: this._hiddenLineSettings,
85350
85445
  frustum: {
@@ -85390,6 +85485,9 @@ class OrthographicAttachment {
85390
85485
  collectStatistics(_stats) {
85391
85486
  // Handled by discloseTileTrees()
85392
85487
  }
85488
+ get toSheet() {
85489
+ return this._toSheet;
85490
+ }
85393
85491
  }
85394
85492
  function createRasterAttachmentViewport(_view, _rect, _attachment) {
85395
85493
  class RasterAttachmentViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_12__.OffScreenViewport {
@@ -85691,10 +85789,18 @@ class SpatialViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_6__.ViewState
85691
85789
  extents.extendRange(this.getGroundExtents());
85692
85790
  return extents;
85693
85791
  }
85694
- /** Compute world-space range appropriate for fitting the view. If that range is null, use the displayed extents. */
85695
- computeFitRange() {
85792
+ /** Compute a volume in world coordinates tightly encompassing the contents of the view. The volume is computed from the union of the volumes of the
85793
+ * view's viewed models, including [GeometricModel]($backend)s and reality models.
85794
+ * Those volumes are obtained from the [[TileTree]]s used to render those models, so any tile tree that has not yet been loaded will not contribute to the computation.
85795
+ * If `options.baseExtents` is defined, it will be unioned with the computed volume.
85796
+ * If the computed volume is null (empty), a default volume will be computed from [IModel.projectExtents]($common), which may be a looser approximation of the
85797
+ * models' volumes.
85798
+ * @param options Options used to customize how the volume is computed.
85799
+ * @returns A non-null volume in world coordinates encompassing the contents of the view.
85800
+ */
85801
+ computeFitRange(options) {
85696
85802
  // Fit to the union of the ranges of all loaded tile trees.
85697
- const range = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
85803
+ const range = options?.baseExtents?.clone() ?? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
85698
85804
  this.forEachTileTreeRef((ref) => {
85699
85805
  ref.unionFitRange(range);
85700
85806
  });
@@ -86559,7 +86665,16 @@ class TentativePoint {
86559
86665
  const vp = ev.viewport;
86560
86666
  if (vp.isSnapAdjustmentRequired) {
86561
86667
  _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin.adjustPointToACS(point, vp, false);
86562
- const hit = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitDetail(point, vp, _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitSource.TentativeSnap, point, "", _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitPriority.Unknown, 0, 0);
86668
+ const hit = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitDetail({
86669
+ testPoint: point,
86670
+ viewport: vp,
86671
+ hitSource: _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitSource.TentativeSnap,
86672
+ hitPoint: point,
86673
+ sourceId: "",
86674
+ priority: _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitPriority.Unknown,
86675
+ distXY: 0,
86676
+ distFraction: 0,
86677
+ });
86563
86678
  const snap = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.SnapDetail(hit);
86564
86679
  this.setCurrSnap(snap);
86565
86680
  _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin.adjustSnapPoint();
@@ -87606,8 +87721,11 @@ class ViewCreator3d {
87606
87721
  * @throws [IModelError]($common) If no 3d models are found in the iModel.
87607
87722
  */
87608
87723
  async createDefaultView(options, modelIds) {
87609
- const serializedProps = await _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this._imodel.routingContext.token).getCustomViewState3dData(this._imodel.getRpcProps(), modelIds === undefined ? {} : { modelIds: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.sortAndCompress(modelIds) });
87610
- const props = await this._createViewStateProps(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressArray(serializedProps.modelIds), _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressArray(serializedProps.categoryIds), _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range3d.fromJSON(serializedProps.modelExtents), options);
87724
+ const rpcOptions = modelIds ? { modelIds: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.sortAndCompress(modelIds) } : {};
87725
+ const rpc = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this._imodel.routingContext.token);
87726
+ const serializedProps = await rpc.getCustomViewState3dData(this._imodel.getRpcProps(), rpcOptions);
87727
+ const baseExtents = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range3d.fromJSON(serializedProps.modelExtents);
87728
+ const props = await this._createViewStateProps(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressArray(serializedProps.modelIds), _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressArray(serializedProps.categoryIds), baseExtents, options);
87611
87729
  const viewState = _SpatialViewState__WEBPACK_IMPORTED_MODULE_3__.SpatialViewState.createFromProps(props, this._imodel);
87612
87730
  try {
87613
87731
  await viewState.load();
@@ -87618,7 +87736,7 @@ class ViewCreator3d {
87618
87736
  viewState.setStandardRotation(options.standardViewId);
87619
87737
  if (options?.allSubCategoriesVisible)
87620
87738
  viewState.displayStyle.enableAllLoadedSubCategories(viewState.categorySelector.categories);
87621
- const range = viewState.computeFitRange();
87739
+ const range = viewState.computeFitRange({ baseExtents });
87622
87740
  viewState.lookAtVolume(range, options?.vpAspect);
87623
87741
  return viewState;
87624
87742
  }
@@ -89545,6 +89663,12 @@ class ViewState extends _EntityState__WEBPACK_IMPORTED_MODULE_5__.ElementState {
89545
89663
  get secondaryViewports() {
89546
89664
  return [];
89547
89665
  }
89666
+ /** Find the viewport that renders the contents of the view attachment with the specified element Id into this view.
89667
+ * @internal
89668
+ */
89669
+ getAttachmentViewport(_id) {
89670
+ return undefined;
89671
+ }
89548
89672
  }
89549
89673
  /** Defines the state of a view of 3d models.
89550
89674
  * @see [ViewState Parameters]($docs/learning/frontend/views#viewstate-parameters)
@@ -93119,7 +93243,11 @@ class Viewport {
93119
93243
  const pixel = pixels.getPixel(x, y);
93120
93244
  const modelId = pixel.modelId;
93121
93245
  if (undefined !== modelId) {
93122
- const transform = this.view.computeDisplayTransform({ modelId, elementId: pixel.feature?.elementId });
93246
+ const transform = this.view.computeDisplayTransform({
93247
+ modelId,
93248
+ elementId: pixel.feature?.elementId,
93249
+ viewAttachmentId: pixel.viewAttachmentId,
93250
+ });
93123
93251
  transform?.multiplyInversePoint3d(npc, npc);
93124
93252
  }
93125
93253
  }
@@ -102682,6 +102810,7 @@ var Pixel;
102682
102810
  this.planarity = args?.planarity ?? Planarity.Unknown;
102683
102811
  this.iModel = args?.iModel;
102684
102812
  this.tileId = args?.tileId;
102813
+ this.viewAttachmentId = args?.viewAttachmentId;
102685
102814
  }
102686
102815
  /** The Id of the element that produced the pixel. */
102687
102816
  get elementId() {
@@ -106767,8 +106896,10 @@ class MeshBuilder {
106767
106896
  return this.vertexMap.insertKey(vertex, addToMeshOnInsert ? onInsert : undefined);
106768
106897
  }
106769
106898
  addTriangle(triangle) {
106770
- // Prefer to avoid adding vertices originating from degenerate triangles before we get here...
106771
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!triangle.isDegenerate);
106899
+ // Attempt to avoid adding vertices originating from degenerate triangles before we get here.
106900
+ // Removed assert and just return if degenerate at this point because uncommon cases (not worth testing for) can still occur.
106901
+ if (triangle.isDegenerate)
106902
+ return;
106772
106903
  const onInsert = (_vk) => this.mesh.addTriangle(triangle);
106773
106904
  this.triangleSet.insertKey(triangle, onInsert);
106774
106905
  }
@@ -106948,8 +107079,10 @@ class MeshBuilderMap extends _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Di
106948
107079
  }
106949
107080
  toMeshes() {
106950
107081
  const meshes = new _MeshPrimitives__WEBPACK_IMPORTED_MODULE_5__.MeshList(this.features, this.range);
106951
- for (const builder of this._values)
106952
- meshes.push(builder.mesh);
107082
+ for (const builder of this._values) {
107083
+ if (builder.mesh.points.length > 0)
107084
+ meshes.push(builder.mesh);
107085
+ }
106953
107086
  return meshes;
106954
107087
  }
106955
107088
  /**
@@ -108256,7 +108389,7 @@ class BatchState {
108256
108389
  }
108257
108390
  getBatchId(batch, allowAdd) {
108258
108391
  if (allowAdd && 0 === batch.batchId) {
108259
- batch.setContext(this.nextBatchId, this._stack.top.iModel);
108392
+ batch.setContext(this.nextBatchId, this._stack.top);
108260
108393
  this._batches.push(batch);
108261
108394
  }
108262
108395
  return batch.batchId;
@@ -108563,6 +108696,7 @@ class BranchState {
108563
108696
  get appearanceProvider() { return this._opts.appearanceProvider; }
108564
108697
  get secondaryClassifiers() { return this._opts.secondaryClassifiers; }
108565
108698
  get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }
108699
+ get viewAttachmentId() { return this._opts.viewAttachmentId; }
108566
108700
  get symbologyOverrides() {
108567
108701
  return this._opts.symbologyOverrides;
108568
108702
  }
@@ -108592,6 +108726,7 @@ class BranchState {
108592
108726
  // The branch can augment the symbology overrides. If it doesn't want to, allow its parent to do so, unless this branch supplies its own symbology overrides.
108593
108727
  appearanceProvider: branch.appearanceProvider ?? (branch.branch.symbologyOverrides ? undefined : prev.appearanceProvider),
108594
108728
  realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,
108729
+ viewAttachmentId: branch.viewAttachmentId ?? prev.viewAttachmentId,
108595
108730
  });
108596
108731
  }
108597
108732
  getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId) {
@@ -112881,15 +113016,19 @@ class Batch extends Graphic {
112881
113016
  get locateOnly() {
112882
113017
  return true === this.options.locateOnly;
112883
113018
  }
113019
+ /** The following are valid only during a draw and reset afterward. */
112884
113020
  get batchId() { return this._context.batchId; }
112885
113021
  get batchIModel() { return this._context.iModel; }
112886
- setContext(batchId, iModel) {
113022
+ get viewAttachmentId() { return this._context.viewAttachmentId; }
113023
+ setContext(batchId, branch) {
112887
113024
  this._context.batchId = batchId;
112888
- this._context.iModel = iModel;
113025
+ this._context.iModel = branch.iModel;
113026
+ this._context.viewAttachmentId = branch.viewAttachmentId;
112889
113027
  }
112890
113028
  resetContext() {
112891
113029
  this._context.batchId = 0;
112892
113030
  this._context.iModel = undefined;
113031
+ this._context.viewAttachmentId = undefined;
112893
113032
  }
112894
113033
  constructor(graphic, features, range, options) {
112895
113034
  super();
@@ -112949,6 +113088,7 @@ class Branch extends Graphic {
112949
113088
  this.clips = opts.clipVolume;
112950
113089
  this.iModel = opts.iModel;
112951
113090
  this.frustum = opts.frustum;
113091
+ this.viewAttachmentId = opts.viewAttachmentId;
112952
113092
  if (opts.hline)
112953
113093
  this.edgeSettings = _EdgeSettings__WEBPACK_IMPORTED_MODULE_6__.EdgeSettings.create(opts.hline);
112954
113094
  if (opts.classifierOrDrape instanceof _PlanarClassifier__WEBPACK_IMPORTED_MODULE_8__.PlanarClassifier)
@@ -118552,7 +118692,7 @@ class PixelBuffer {
118552
118692
  if (undefined !== featureId) {
118553
118693
  const batch = this._batchState.find(featureId);
118554
118694
  if (undefined !== batch)
118555
- return { featureTable: batch.featureTable, iModel: batch.batchIModel, tileId: batch.tileId };
118695
+ return { featureTable: batch.featureTable, iModel: batch.batchIModel, tileId: batch.tileId, viewAttachmentId: batch.viewAttachmentId };
118556
118696
  }
118557
118697
  return undefined;
118558
118698
  }
@@ -118622,11 +118762,12 @@ class PixelBuffer {
118622
118762
  }
118623
118763
  }
118624
118764
  }
118625
- let featureTable, iModel, tileId;
118765
+ let featureTable, iModel, tileId, viewAttachmentId;
118626
118766
  if (undefined !== batchInfo) {
118627
118767
  featureTable = batchInfo.featureTable;
118628
118768
  iModel = batchInfo.iModel;
118629
118769
  tileId = batchInfo.tileId;
118770
+ viewAttachmentId = batchInfo.viewAttachmentId;
118630
118771
  }
118631
118772
  return new _Pixel__WEBPACK_IMPORTED_MODULE_4__.Pixel.Data({
118632
118773
  feature,
@@ -118636,6 +118777,7 @@ class PixelBuffer {
118636
118777
  batchType: featureTable?.type,
118637
118778
  iModel,
118638
118779
  tileId,
118780
+ viewAttachmentId,
118639
118781
  });
118640
118782
  }
118641
118783
  constructor(rect, selector, compositor) {
@@ -285039,7 +285181,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
285039
285181
  /***/ ((module) => {
285040
285182
 
285041
285183
  "use strict";
285042
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.1.0-dev.32","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 ES2020 --outDir lib/esm","clean":"rimraf 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 --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","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:^4.1.0-dev.32","@itwin/core-bentley":"workspace:^4.1.0-dev.32","@itwin/core-common":"workspace:^4.1.0-dev.32","@itwin/core-geometry":"workspace:^4.1.0-dev.32","@itwin/core-orbitgt":"workspace:^4.1.0-dev.32","@itwin/core-quantity":"workspace:^4.1.0-dev.32"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.36.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"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","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
285184
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.1.0-dev.35","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 ES2020 --outDir lib/esm","clean":"rimraf 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 --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","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:^4.1.0-dev.35","@itwin/core-bentley":"workspace:^4.1.0-dev.35","@itwin/core-common":"workspace:^4.1.0-dev.35","@itwin/core-geometry":"workspace:^4.1.0-dev.35","@itwin/core-orbitgt":"workspace:^4.1.0-dev.35","@itwin/core-quantity":"workspace:^4.1.0-dev.35"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.36.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"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","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
285043
285185
 
285044
285186
  /***/ })
285045
285187