@itwin/rpcinterface-full-stack-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.
@@ -75310,8 +75310,9 @@ class AccuSnap {
75310
75310
  return realitySnap;
75311
75311
  }
75312
75312
  }
75313
+ const hitVp = thisHit.viewAttachment ? thisHit.viewAttachment.viewport : thisHit.viewport;
75313
75314
  if (undefined !== thisHit.subCategoryId && !thisHit.isExternalIModelHit) {
75314
- const appearance = thisHit.viewport.getSubCategoryAppearance(thisHit.subCategoryId);
75315
+ const appearance = hitVp.getSubCategoryAppearance(thisHit.subCategoryId);
75315
75316
  if (appearance.dontSnap) {
75316
75317
  if (out) {
75317
75318
  out.snapStatus = _ElementLocateManager__WEBPACK_IMPORTED_MODULE_2__.SnapStatus.NotSnappable;
@@ -75324,10 +75325,10 @@ class AccuSnap {
75324
75325
  id: thisHit.sourceId,
75325
75326
  testPoint: thisHit.testPoint,
75326
75327
  closePoint: thisHit.hitPoint,
75327
- worldToView: thisHit.viewport.worldToViewMap.transform0.toJSON(),
75328
- viewFlags: thisHit.viewport.viewFlags,
75328
+ worldToView: hitVp.worldToViewMap.transform0.toJSON(),
75329
+ viewFlags: hitVp.viewFlags,
75329
75330
  snapModes,
75330
- snapAperture: thisHit.viewport.pixelsFromInches(hotDistanceInches),
75331
+ snapAperture: hitVp.pixelsFromInches(hotDistanceInches),
75331
75332
  snapDivisor: keypointDivisor,
75332
75333
  subCategoryId: thisHit.subCategoryId,
75333
75334
  geometryClass: thisHit.geometryClass,
@@ -75381,7 +75382,11 @@ class AccuSnap {
75381
75382
  return parsed instanceof _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.GeometryQuery && "curvePrimitive" === parsed.geometryCategory ? parsed : undefined;
75382
75383
  };
75383
75384
  const snapPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(result.snapPoint);
75384
- const displayTransform = undefined !== thisHit.modelId ? thisHit.viewport.view.computeDisplayTransform({ modelId: thisHit.modelId, elementId: thisHit.sourceId }) : undefined;
75385
+ const displayTransform = undefined !== thisHit.modelId ? thisHit.viewport.view.computeDisplayTransform({
75386
+ modelId: thisHit.modelId,
75387
+ elementId: thisHit.sourceId,
75388
+ viewAttachmentId: thisHit.viewAttachment?.id,
75389
+ }) : undefined;
75385
75390
  displayTransform?.multiplyPoint3d(snapPoint, snapPoint);
75386
75391
  const snap = new _HitDetail__WEBPACK_IMPORTED_MODULE_3__.SnapDetail(thisHit, result.snapMode, result.heat, snapPoint);
75387
75392
  snap.setCurvePrimitive(parseCurve(result.curve), displayTransform, result.geomType);
@@ -78093,7 +78098,8 @@ class DisplayStyleState extends _EntityState__WEBPACK_IMPORTED_MODULE_6__.Elemen
78093
78098
  /** @internal */
78094
78099
  async queryRenderTimelineProps(timelineId) {
78095
78100
  try {
78096
- return await this.iModel.elements.loadProps(timelineId, { renderTimeline: { omitScriptElementIds: true } });
78101
+ const omitScriptElementIds = !_IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.tileAdmin.enableFrontendScheduleScripts;
78102
+ return await this.iModel.elements.loadProps(timelineId, { renderTimeline: { omitScriptElementIds } });
78097
78103
  }
78098
78104
  catch (_) {
78099
78105
  return undefined;
@@ -79423,8 +79429,30 @@ class ElementPicker {
79423
79429
  });
79424
79430
  if (!hitPointWorld)
79425
79431
  continue;
79432
+ let viewAttachment;
79433
+ if (pixel.viewAttachmentId) {
79434
+ const attachmentViewport = vp.view.getAttachmentViewport(pixel.viewAttachmentId);
79435
+ if (attachmentViewport)
79436
+ viewAttachment = { viewport: attachmentViewport, id: pixel.viewAttachmentId };
79437
+ }
79426
79438
  const modelId = pixel.modelId;
79427
- 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);
79439
+ const hit = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitDetail({
79440
+ testPoint: pickPointWorld,
79441
+ viewport: vp,
79442
+ hitSource: options.hitSource,
79443
+ hitPoint: hitPointWorld,
79444
+ sourceId: pixel.elementId,
79445
+ priority: this.getPixelPriority(pixel),
79446
+ distXY: testPointView.distance(elmPoint),
79447
+ distFraction: pixel.distanceFraction,
79448
+ subCategoryId: pixel.subCategoryId,
79449
+ geometryClass: pixel.geometryClass,
79450
+ modelId,
79451
+ sourceIModel: pixel.iModel,
79452
+ tileId: pixel.tileId,
79453
+ isClassifier: pixel.isClassifier,
79454
+ viewAttachment,
79455
+ });
79428
79456
  this.hitList.addHit(hit);
79429
79457
  if (this.hitList.hits.length > options.maxHits)
79430
79458
  this.hitList.hits.length = options.maxHits; // truncate array...
@@ -81800,37 +81828,87 @@ var HitDetailType;
81800
81828
  * @extensions
81801
81829
  */
81802
81830
  class HitDetail {
81803
- /** Create a new HitDetail from the inputs to and results of a locate operation.
81804
- * @param testPoint The world coordinate space point that was used as the locate point.
81805
- * @param viewport The view the locate operation was performed in.
81806
- * @param hitSource The procedure that requested the locate operation.
81807
- * @param hitPoint The approximate world coordinate location on the geometry identified by this HitDetail.
81808
- * @param sourceId The source of the geometry, either a persistent element id or pickable decoration id.
81809
- * @param priority The hit geometry priority/classification.
81810
- * @param distXY The xy distance to hit in view coordinates.
81811
- * @param distFraction The near plane distance fraction to hit.
81812
- * @param subCategoryId The SubCategory for a persistent element hit.
81813
- * @param geometryClass The GeometryClass for a persistent element hit.
81814
- * @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.
81815
- * @param modelId Optionally the Id of the [[ModelState]] from which the hit originated.
81816
- * @param tileId Optionally the Id of the Tile from which the hit originated.
81817
- * @param isClassifier Optionally whether the hit originated from a reality model classification.
81818
- */
81819
- constructor(testPoint, viewport, hitSource, hitPoint, sourceId, priority, distXY, distFraction, subCategoryId, geometryClass, modelId, iModel, tileId, isClassifier) {
81820
- this.testPoint = testPoint;
81821
- this.viewport = viewport;
81822
- this.hitSource = hitSource;
81823
- this.hitPoint = hitPoint;
81824
- this.sourceId = sourceId;
81825
- this.priority = priority;
81826
- this.distXY = distXY;
81827
- this.distFraction = distFraction;
81828
- this.subCategoryId = subCategoryId;
81829
- this.geometryClass = geometryClass;
81830
- this.modelId = modelId;
81831
- this._iModel = iModel;
81832
- this.tileId = tileId;
81833
- this.isClassifier = undefined !== isClassifier ? isClassifier : false;
81831
+ /** The point in world coordinates that was used as the initial locate point. */
81832
+ get testPoint() { return this._props.testPoint; }
81833
+ /** The viewport in which the locate operation was performed. */
81834
+ get viewport() { return this._props.viewport; }
81835
+ /** The procedure that requested the locate operation. */
81836
+ get hitSource() { return this._props.hitSource; }
81837
+ /** The approximate location in world coordinates on the geometry identified by this HitDetail. */
81838
+ get hitPoint() { return this._props.hitPoint; }
81839
+ /** The source of the geometry. This may be a persistent element Id, or a transient Id used for, e.g., pickable decorations. */
81840
+ get sourceId() { return this._props.sourceId; }
81841
+ /** The hit geometry priority/classification. */
81842
+ get priority() { return this._props.priority; }
81843
+ /** The xy distance to the hit in view coordinates. */
81844
+ get distXY() { return this._props.distXY; }
81845
+ /** The distance in view coordinates between the hit and the near plane. */
81846
+ get distFraction() { return this._props.distFraction; }
81847
+ /** The [SubCategory]($backend) to which the hit geometry belongs. */
81848
+ get subCategoryId() { return this._props.subCategoryId; }
81849
+ /** The class of the hit geometry. */
81850
+ get geometryClass() { return this._props.geometryClass; }
81851
+ /** The Id of the [[ModelState]] from which the hit originated. */
81852
+ get modelId() { return this._props.modelId; }
81853
+ /** The IModelConnection from which the hit originated.
81854
+ * This should almost always be left undefined, unless the hit is known to have originated from an iModel
81855
+ * other than the one associated with the viewport.
81856
+ * @internal
81857
+ */
81858
+ get sourceIModel() { return this._props.sourceIModel; }
81859
+ /** @internal chiefly for debugging */
81860
+ get tileId() { return this._props.tileId; }
81861
+ /** True if the hit originated from a reality model classifier.
81862
+ * @alpha
81863
+ */
81864
+ get isClassifier() { return this._props.isClassifier; }
81865
+ /** Information about the [ViewAttachment]($backend) within which the hit geometry resides, if any.
81866
+ * @note Only [[SheetViewState]]s can have view attachments.
81867
+ * @beta
81868
+ */
81869
+ get viewAttachment() { return this._props.viewAttachment; }
81870
+ /** @internal */
81871
+ constructor(arg0, viewport, hitSource, hitPoint, sourceId, priority, distXY, distFraction, subCategoryId, geometryClass, modelId, sourceIModel, tileId, isClassifier) {
81872
+ if (arg0 instanceof _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d) {
81873
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== viewport && undefined !== hitSource && undefined !== hitPoint && undefined !== sourceId);
81874
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== priority && undefined !== distXY && undefined !== distFraction);
81875
+ this._props = {
81876
+ testPoint: arg0,
81877
+ viewport,
81878
+ hitSource,
81879
+ hitPoint,
81880
+ sourceId,
81881
+ priority,
81882
+ distXY,
81883
+ distFraction,
81884
+ subCategoryId,
81885
+ geometryClass,
81886
+ modelId,
81887
+ sourceIModel,
81888
+ tileId,
81889
+ isClassifier,
81890
+ };
81891
+ }
81892
+ else {
81893
+ // Tempting to use { ...arg0 } but spread operator omits getters so, e.g., if input is a HitDetail we would lose all the properties.
81894
+ this._props = {
81895
+ testPoint: arg0.testPoint,
81896
+ viewport: arg0.viewport,
81897
+ hitSource: arg0.hitSource,
81898
+ hitPoint: arg0.hitPoint,
81899
+ sourceId: arg0.sourceId,
81900
+ priority: arg0.priority,
81901
+ distXY: arg0.distXY,
81902
+ distFraction: arg0.distFraction,
81903
+ subCategoryId: arg0.subCategoryId,
81904
+ geometryClass: arg0.geometryClass,
81905
+ modelId: arg0.modelId,
81906
+ sourceIModel: arg0.sourceIModel,
81907
+ tileId: arg0.tileId,
81908
+ isClassifier: arg0.isClassifier,
81909
+ viewAttachment: arg0.viewAttachment,
81910
+ };
81911
+ }
81834
81912
  }
81835
81913
  /** Get the type of HitDetail.
81836
81914
  * @returns HitDetailType.Hit if this is a HitDetail, HitDetailType.Snap if it is a SnapDetail
@@ -81852,8 +81930,7 @@ class HitDetail {
81852
81930
  get isMapHit() { return undefined !== this.viewport.mapLayerFromHit(this); }
81853
81931
  /** Create a deep copy of this HitDetail */
81854
81932
  clone() {
81855
- 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);
81856
- return val;
81933
+ return new HitDetail(this);
81857
81934
  }
81858
81935
  /** Draw this HitDetail as a Decoration. Causes the picked element to *flash* */
81859
81936
  draw(_context) {
@@ -81870,11 +81947,15 @@ class HitDetail {
81870
81947
  * for example, if a [[TiledGraphicsProvider]] is used to display graphics from a different iModel in the viewport.
81871
81948
  * This HitDetail's element, subcategory, and model Ids are defined in the context of this IModelConnection.
81872
81949
  */
81873
- get iModel() { return undefined !== this._iModel ? this._iModel : this.viewport.iModel; }
81950
+ get iModel() {
81951
+ return this.sourceIModel ?? this.viewport.iModel;
81952
+ }
81874
81953
  /** Returns true if this hit originated from an [[IModelConnection]] other than the one associated with the [[Viewport]].
81875
81954
  * @see [[iModel]].
81876
81955
  */
81877
- get isExternalIModelHit() { return this.iModel !== this.viewport.iModel; }
81956
+ get isExternalIModelHit() {
81957
+ return this.iModel !== this.viewport.iModel;
81958
+ }
81878
81959
  }
81879
81960
  /** A SnapDetail is generated from the result of a snap request. In addition to the HitDetail about the reason the element was *picked*,
81880
81961
  * 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.
@@ -81889,7 +81970,7 @@ class SnapDetail extends HitDetail {
81889
81970
  * @param snapPoint The snapped point in the element
81890
81971
  */
81891
81972
  constructor(from, snapMode = SnapMode.Nearest, heat = SnapHeat.None, snapPoint) {
81892
- 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);
81973
+ super(from);
81893
81974
  this.snapMode = snapMode;
81894
81975
  this.heat = heat;
81895
81976
  this.snapPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.fromJSON(snapPoint ? snapPoint : from.hitPoint);
@@ -87556,6 +87637,9 @@ class ViewAttachments {
87556
87637
  for (const attachment of this._attachments)
87557
87638
  attachment.addToScene(context);
87558
87639
  }
87640
+ findById(attachmentId) {
87641
+ return this._attachments.find((attachment) => attachment.viewAttachmentProps.id === attachmentId);
87642
+ }
87559
87643
  }
87560
87644
  /** A view of a [SheetModel]($backend).
87561
87645
  * @public
@@ -87736,6 +87820,16 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_13__.ViewState2
87736
87820
  return super.computeFitRange();
87737
87821
  return new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d(0, 0, -1, size.x, size.y, 1);
87738
87822
  }
87823
+ /** @internal */
87824
+ getAttachmentViewport(id) {
87825
+ return this._attachments?.findById(id)?.viewport;
87826
+ }
87827
+ /** @internal */
87828
+ computeDisplayTransform(args) {
87829
+ // ###TODO check if the attached view has a display transform...
87830
+ const attachment = undefined !== args.viewAttachmentId ? this._attachments?.findById(args.viewAttachmentId) : undefined;
87831
+ return attachment && attachment instanceof OrthographicAttachment ? attachment.toSheet.clone() : undefined;
87832
+ }
87739
87833
  }
87740
87834
  /** A mostly no-op RenderTarget for an Attachment.
87741
87835
  * its Scene and symbology overrides.
@@ -87921,6 +88015,7 @@ class OrthographicAttachment {
87921
88015
  return;
87922
88016
  // Extract scene graphics and insert into on-screen scene context.
87923
88017
  const options = {
88018
+ viewAttachmentId: this._props.id,
87924
88019
  clipVolume: this._clipVolume,
87925
88020
  hline: this._hiddenLineSettings,
87926
88021
  frustum: {
@@ -87966,6 +88061,9 @@ class OrthographicAttachment {
87966
88061
  collectStatistics(_stats) {
87967
88062
  // Handled by discloseTileTrees()
87968
88063
  }
88064
+ get toSheet() {
88065
+ return this._toSheet;
88066
+ }
87969
88067
  }
87970
88068
  function createRasterAttachmentViewport(_view, _rect, _attachment) {
87971
88069
  class RasterAttachmentViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_12__.OffScreenViewport {
@@ -88267,10 +88365,18 @@ class SpatialViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_6__.ViewState
88267
88365
  extents.extendRange(this.getGroundExtents());
88268
88366
  return extents;
88269
88367
  }
88270
- /** Compute world-space range appropriate for fitting the view. If that range is null, use the displayed extents. */
88271
- computeFitRange() {
88368
+ /** 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
88369
+ * view's viewed models, including [GeometricModel]($backend)s and reality models.
88370
+ * 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.
88371
+ * If `options.baseExtents` is defined, it will be unioned with the computed volume.
88372
+ * 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
88373
+ * models' volumes.
88374
+ * @param options Options used to customize how the volume is computed.
88375
+ * @returns A non-null volume in world coordinates encompassing the contents of the view.
88376
+ */
88377
+ computeFitRange(options) {
88272
88378
  // Fit to the union of the ranges of all loaded tile trees.
88273
- const range = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
88379
+ const range = options?.baseExtents?.clone() ?? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
88274
88380
  this.forEachTileTreeRef((ref) => {
88275
88381
  ref.unionFitRange(range);
88276
88382
  });
@@ -89135,7 +89241,16 @@ class TentativePoint {
89135
89241
  const vp = ev.viewport;
89136
89242
  if (vp.isSnapAdjustmentRequired) {
89137
89243
  _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin.adjustPointToACS(point, vp, false);
89138
- 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);
89244
+ const hit = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitDetail({
89245
+ testPoint: point,
89246
+ viewport: vp,
89247
+ hitSource: _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitSource.TentativeSnap,
89248
+ hitPoint: point,
89249
+ sourceId: "",
89250
+ priority: _HitDetail__WEBPACK_IMPORTED_MODULE_2__.HitPriority.Unknown,
89251
+ distXY: 0,
89252
+ distFraction: 0,
89253
+ });
89139
89254
  const snap = new _HitDetail__WEBPACK_IMPORTED_MODULE_2__.SnapDetail(hit);
89140
89255
  this.setCurrSnap(snap);
89141
89256
  _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.toolAdmin.adjustSnapPoint();
@@ -90182,8 +90297,11 @@ class ViewCreator3d {
90182
90297
  * @throws [IModelError]($common) If no 3d models are found in the iModel.
90183
90298
  */
90184
90299
  async createDefaultView(options, modelIds) {
90185
- 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) });
90186
- 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);
90300
+ const rpcOptions = modelIds ? { modelIds: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.sortAndCompress(modelIds) } : {};
90301
+ const rpc = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this._imodel.routingContext.token);
90302
+ const serializedProps = await rpc.getCustomViewState3dData(this._imodel.getRpcProps(), rpcOptions);
90303
+ const baseExtents = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range3d.fromJSON(serializedProps.modelExtents);
90304
+ 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);
90187
90305
  const viewState = _SpatialViewState__WEBPACK_IMPORTED_MODULE_3__.SpatialViewState.createFromProps(props, this._imodel);
90188
90306
  try {
90189
90307
  await viewState.load();
@@ -90194,7 +90312,7 @@ class ViewCreator3d {
90194
90312
  viewState.setStandardRotation(options.standardViewId);
90195
90313
  if (options?.allSubCategoriesVisible)
90196
90314
  viewState.displayStyle.enableAllLoadedSubCategories(viewState.categorySelector.categories);
90197
- const range = viewState.computeFitRange();
90315
+ const range = viewState.computeFitRange({ baseExtents });
90198
90316
  viewState.lookAtVolume(range, options?.vpAspect);
90199
90317
  return viewState;
90200
90318
  }
@@ -92121,6 +92239,12 @@ class ViewState extends _EntityState__WEBPACK_IMPORTED_MODULE_5__.ElementState {
92121
92239
  get secondaryViewports() {
92122
92240
  return [];
92123
92241
  }
92242
+ /** Find the viewport that renders the contents of the view attachment with the specified element Id into this view.
92243
+ * @internal
92244
+ */
92245
+ getAttachmentViewport(_id) {
92246
+ return undefined;
92247
+ }
92124
92248
  }
92125
92249
  /** Defines the state of a view of 3d models.
92126
92250
  * @see [ViewState Parameters]($docs/learning/frontend/views#viewstate-parameters)
@@ -95695,7 +95819,11 @@ class Viewport {
95695
95819
  const pixel = pixels.getPixel(x, y);
95696
95820
  const modelId = pixel.modelId;
95697
95821
  if (undefined !== modelId) {
95698
- const transform = this.view.computeDisplayTransform({ modelId, elementId: pixel.feature?.elementId });
95822
+ const transform = this.view.computeDisplayTransform({
95823
+ modelId,
95824
+ elementId: pixel.feature?.elementId,
95825
+ viewAttachmentId: pixel.viewAttachmentId,
95826
+ });
95699
95827
  transform?.multiplyInversePoint3d(npc, npc);
95700
95828
  }
95701
95829
  }
@@ -105258,6 +105386,7 @@ var Pixel;
105258
105386
  this.planarity = args?.planarity ?? Planarity.Unknown;
105259
105387
  this.iModel = args?.iModel;
105260
105388
  this.tileId = args?.tileId;
105389
+ this.viewAttachmentId = args?.viewAttachmentId;
105261
105390
  }
105262
105391
  /** The Id of the element that produced the pixel. */
105263
105392
  get elementId() {
@@ -109343,8 +109472,10 @@ class MeshBuilder {
109343
109472
  return this.vertexMap.insertKey(vertex, addToMeshOnInsert ? onInsert : undefined);
109344
109473
  }
109345
109474
  addTriangle(triangle) {
109346
- // Prefer to avoid adding vertices originating from degenerate triangles before we get here...
109347
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!triangle.isDegenerate);
109475
+ // Attempt to avoid adding vertices originating from degenerate triangles before we get here.
109476
+ // Removed assert and just return if degenerate at this point because uncommon cases (not worth testing for) can still occur.
109477
+ if (triangle.isDegenerate)
109478
+ return;
109348
109479
  const onInsert = (_vk) => this.mesh.addTriangle(triangle);
109349
109480
  this.triangleSet.insertKey(triangle, onInsert);
109350
109481
  }
@@ -109524,8 +109655,10 @@ class MeshBuilderMap extends _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Di
109524
109655
  }
109525
109656
  toMeshes() {
109526
109657
  const meshes = new _MeshPrimitives__WEBPACK_IMPORTED_MODULE_5__.MeshList(this.features, this.range);
109527
- for (const builder of this._values)
109528
- meshes.push(builder.mesh);
109658
+ for (const builder of this._values) {
109659
+ if (builder.mesh.points.length > 0)
109660
+ meshes.push(builder.mesh);
109661
+ }
109529
109662
  return meshes;
109530
109663
  }
109531
109664
  /**
@@ -110832,7 +110965,7 @@ class BatchState {
110832
110965
  }
110833
110966
  getBatchId(batch, allowAdd) {
110834
110967
  if (allowAdd && 0 === batch.batchId) {
110835
- batch.setContext(this.nextBatchId, this._stack.top.iModel);
110968
+ batch.setContext(this.nextBatchId, this._stack.top);
110836
110969
  this._batches.push(batch);
110837
110970
  }
110838
110971
  return batch.batchId;
@@ -111139,6 +111272,7 @@ class BranchState {
111139
111272
  get appearanceProvider() { return this._opts.appearanceProvider; }
111140
111273
  get secondaryClassifiers() { return this._opts.secondaryClassifiers; }
111141
111274
  get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }
111275
+ get viewAttachmentId() { return this._opts.viewAttachmentId; }
111142
111276
  get symbologyOverrides() {
111143
111277
  return this._opts.symbologyOverrides;
111144
111278
  }
@@ -111168,6 +111302,7 @@ class BranchState {
111168
111302
  // 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.
111169
111303
  appearanceProvider: branch.appearanceProvider ?? (branch.branch.symbologyOverrides ? undefined : prev.appearanceProvider),
111170
111304
  realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,
111305
+ viewAttachmentId: branch.viewAttachmentId ?? prev.viewAttachmentId,
111171
111306
  });
111172
111307
  }
111173
111308
  getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId) {
@@ -115457,15 +115592,19 @@ class Batch extends Graphic {
115457
115592
  get locateOnly() {
115458
115593
  return true === this.options.locateOnly;
115459
115594
  }
115595
+ /** The following are valid only during a draw and reset afterward. */
115460
115596
  get batchId() { return this._context.batchId; }
115461
115597
  get batchIModel() { return this._context.iModel; }
115462
- setContext(batchId, iModel) {
115598
+ get viewAttachmentId() { return this._context.viewAttachmentId; }
115599
+ setContext(batchId, branch) {
115463
115600
  this._context.batchId = batchId;
115464
- this._context.iModel = iModel;
115601
+ this._context.iModel = branch.iModel;
115602
+ this._context.viewAttachmentId = branch.viewAttachmentId;
115465
115603
  }
115466
115604
  resetContext() {
115467
115605
  this._context.batchId = 0;
115468
115606
  this._context.iModel = undefined;
115607
+ this._context.viewAttachmentId = undefined;
115469
115608
  }
115470
115609
  constructor(graphic, features, range, options) {
115471
115610
  super();
@@ -115525,6 +115664,7 @@ class Branch extends Graphic {
115525
115664
  this.clips = opts.clipVolume;
115526
115665
  this.iModel = opts.iModel;
115527
115666
  this.frustum = opts.frustum;
115667
+ this.viewAttachmentId = opts.viewAttachmentId;
115528
115668
  if (opts.hline)
115529
115669
  this.edgeSettings = _EdgeSettings__WEBPACK_IMPORTED_MODULE_6__.EdgeSettings.create(opts.hline);
115530
115670
  if (opts.classifierOrDrape instanceof _PlanarClassifier__WEBPACK_IMPORTED_MODULE_8__.PlanarClassifier)
@@ -121128,7 +121268,7 @@ class PixelBuffer {
121128
121268
  if (undefined !== featureId) {
121129
121269
  const batch = this._batchState.find(featureId);
121130
121270
  if (undefined !== batch)
121131
- return { featureTable: batch.featureTable, iModel: batch.batchIModel, tileId: batch.tileId };
121271
+ return { featureTable: batch.featureTable, iModel: batch.batchIModel, tileId: batch.tileId, viewAttachmentId: batch.viewAttachmentId };
121132
121272
  }
121133
121273
  return undefined;
121134
121274
  }
@@ -121198,11 +121338,12 @@ class PixelBuffer {
121198
121338
  }
121199
121339
  }
121200
121340
  }
121201
- let featureTable, iModel, tileId;
121341
+ let featureTable, iModel, tileId, viewAttachmentId;
121202
121342
  if (undefined !== batchInfo) {
121203
121343
  featureTable = batchInfo.featureTable;
121204
121344
  iModel = batchInfo.iModel;
121205
121345
  tileId = batchInfo.tileId;
121346
+ viewAttachmentId = batchInfo.viewAttachmentId;
121206
121347
  }
121207
121348
  return new _Pixel__WEBPACK_IMPORTED_MODULE_4__.Pixel.Data({
121208
121349
  feature,
@@ -121212,6 +121353,7 @@ class PixelBuffer {
121212
121353
  batchType: featureTable?.type,
121213
121354
  iModel,
121214
121355
  tileId,
121356
+ viewAttachmentId,
121215
121357
  });
121216
121358
  }
121217
121359
  constructor(rect, selector, compositor) {
@@ -277307,7 +277449,7 @@ class TestContext {
277307
277449
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
277308
277450
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
277309
277451
  await core_frontend_1.NoRenderApp.startup({
277310
- applicationVersion: "4.1.0-dev.32",
277452
+ applicationVersion: "4.1.0-dev.35",
277311
277453
  applicationId: this.settings.gprid,
277312
277454
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
277313
277455
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -296681,7 +296823,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
296681
296823
  /***/ ((module) => {
296682
296824
 
296683
296825
  "use strict";
296684
- 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"}}]}}');
296826
+ 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"}}]}}');
296685
296827
 
296686
296828
  /***/ }),
296687
296829