@itwin/core-frontend 3.6.0-dev.52 → 3.6.0-dev.54

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.
Files changed (79) hide show
  1. package/lib/cjs/DisplayStyleState.d.ts +2 -2
  2. package/lib/cjs/DisplayStyleState.js +2 -2
  3. package/lib/cjs/DisplayStyleState.js.map +1 -1
  4. package/lib/cjs/IModelConnection.d.ts +1 -1
  5. package/lib/cjs/IModelConnection.js +1 -1
  6. package/lib/cjs/IModelConnection.js.map +1 -1
  7. package/lib/cjs/IpcApp.d.ts +1 -1
  8. package/lib/cjs/IpcApp.d.ts.map +1 -1
  9. package/lib/cjs/IpcApp.js +1 -1
  10. package/lib/cjs/IpcApp.js.map +1 -1
  11. package/lib/cjs/NativeApp.d.ts +1 -1
  12. package/lib/cjs/NativeApp.d.ts.map +1 -1
  13. package/lib/cjs/NativeApp.js +1 -1
  14. package/lib/cjs/NativeApp.js.map +1 -1
  15. package/lib/cjs/Viewport.d.ts +2 -2
  16. package/lib/cjs/Viewport.js +2 -2
  17. package/lib/cjs/Viewport.js.map +1 -1
  18. package/lib/cjs/render/GraphicBuilder.d.ts +1 -1
  19. package/lib/cjs/render/GraphicBuilder.js +1 -1
  20. package/lib/cjs/render/GraphicBuilder.js.map +1 -1
  21. package/lib/cjs/render/RenderMaterial.d.ts +1 -1
  22. package/lib/cjs/render/RenderMaterial.d.ts.map +1 -1
  23. package/lib/cjs/render/RenderMaterial.js.map +1 -1
  24. package/lib/cjs/render/RenderSystem.d.ts +4 -4
  25. package/lib/cjs/render/RenderSystem.js +4 -4
  26. package/lib/cjs/render/RenderSystem.js.map +1 -1
  27. package/lib/cjs/render/RenderTarget.d.ts +1 -1
  28. package/lib/cjs/render/RenderTarget.d.ts.map +1 -1
  29. package/lib/cjs/render/RenderTarget.js +1 -1
  30. package/lib/cjs/render/RenderTarget.js.map +1 -1
  31. package/lib/cjs/render/primitives/DisplayParams.d.ts.map +1 -1
  32. package/lib/cjs/render/primitives/DisplayParams.js +2 -1
  33. package/lib/cjs/render/primitives/DisplayParams.js.map +1 -1
  34. package/lib/cjs/render/webgl/glsl/Surface.js +1 -1
  35. package/lib/cjs/render/webgl/glsl/Surface.js.map +1 -1
  36. package/lib/cjs/tile/ImdlReader.d.ts +6 -0
  37. package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
  38. package/lib/cjs/tile/ImdlReader.js +15 -2
  39. package/lib/cjs/tile/ImdlReader.js.map +1 -1
  40. package/lib/esm/DisplayStyleState.d.ts +2 -2
  41. package/lib/esm/DisplayStyleState.js +2 -2
  42. package/lib/esm/DisplayStyleState.js.map +1 -1
  43. package/lib/esm/IModelConnection.d.ts +1 -1
  44. package/lib/esm/IModelConnection.js +1 -1
  45. package/lib/esm/IModelConnection.js.map +1 -1
  46. package/lib/esm/IpcApp.d.ts +1 -1
  47. package/lib/esm/IpcApp.d.ts.map +1 -1
  48. package/lib/esm/IpcApp.js +1 -1
  49. package/lib/esm/IpcApp.js.map +1 -1
  50. package/lib/esm/NativeApp.d.ts +1 -1
  51. package/lib/esm/NativeApp.d.ts.map +1 -1
  52. package/lib/esm/NativeApp.js +1 -1
  53. package/lib/esm/NativeApp.js.map +1 -1
  54. package/lib/esm/Viewport.d.ts +2 -2
  55. package/lib/esm/Viewport.js +2 -2
  56. package/lib/esm/Viewport.js.map +1 -1
  57. package/lib/esm/render/GraphicBuilder.d.ts +1 -1
  58. package/lib/esm/render/GraphicBuilder.js +1 -1
  59. package/lib/esm/render/GraphicBuilder.js.map +1 -1
  60. package/lib/esm/render/RenderMaterial.d.ts +1 -1
  61. package/lib/esm/render/RenderMaterial.d.ts.map +1 -1
  62. package/lib/esm/render/RenderMaterial.js.map +1 -1
  63. package/lib/esm/render/RenderSystem.d.ts +4 -4
  64. package/lib/esm/render/RenderSystem.js +4 -4
  65. package/lib/esm/render/RenderSystem.js.map +1 -1
  66. package/lib/esm/render/RenderTarget.d.ts +1 -1
  67. package/lib/esm/render/RenderTarget.d.ts.map +1 -1
  68. package/lib/esm/render/RenderTarget.js +1 -1
  69. package/lib/esm/render/RenderTarget.js.map +1 -1
  70. package/lib/esm/render/primitives/DisplayParams.d.ts.map +1 -1
  71. package/lib/esm/render/primitives/DisplayParams.js +2 -1
  72. package/lib/esm/render/primitives/DisplayParams.js.map +1 -1
  73. package/lib/esm/render/webgl/glsl/Surface.js +1 -1
  74. package/lib/esm/render/webgl/glsl/Surface.js.map +1 -1
  75. package/lib/esm/tile/ImdlReader.d.ts +6 -0
  76. package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
  77. package/lib/esm/tile/ImdlReader.js +15 -2
  78. package/lib/esm/tile/ImdlReader.js.map +1 -1
  79. package/package.json +20 -20
@@ -241,7 +241,7 @@ export declare abstract class GraphicBuilder {
241
241
  protected constructor(options: ViewportGraphicBuilderOptions | CustomGraphicBuilderOptions);
242
242
  /** The Id to be associated with the graphic for picking.
243
243
  * @see [[GraphicBuilderOptions.pickable]] for more options.
244
- * @deprecated This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.
244
+ * @deprecated in 3.x. This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.
245
245
  */
246
246
  get pickId(): Id64String | undefined;
247
247
  /** Whether the builder's geometry is defined in [[CoordSystem.View]] coordinates.
@@ -122,7 +122,7 @@ class GraphicBuilder {
122
122
  }
123
123
  /** The Id to be associated with the graphic for picking.
124
124
  * @see [[GraphicBuilderOptions.pickable]] for more options.
125
- * @deprecated This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.
125
+ * @deprecated in 3.x. This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.
126
126
  */
127
127
  get pickId() {
128
128
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"GraphicBuilder.js","sourceRoot":"","sources":["../../../src/render/GraphicBuilder.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAy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BAAG,CAAC,WAAW,CAAC;YAClB,CAAC,CAAC,iBAAG,CAAC,cAAc,CAAC;YACrB,CAAC,CAAC,iBAAG,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE;YAC9B,CAAC,CAAC,iBAAG,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE;SAChC,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAG,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,iBAAG,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAG,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,iBAAG,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAG,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,iBAAG,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;OAMG;IACI,YAAY,CAAC,SAAmB,EAAE,SAAmB,EAAE,SAAiB,EAAE,UAAU,GAAG,wBAAU,CAAC,KAAK;QAC5G,IAAI,CAAC,qBAAqB,CAAC,2BAAa,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACvG,CAAC;IAED;;;;;OAKG;IACI,eAAe,CAAC,SAAmB,IAAI,IAAI,CAAC,qBAAqB,CAAC,2BAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;CACvH;AA/UD,wCA+UC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n AnyCurvePrimitive, Arc3d, Loop, Path, Point2d, Point3d, Polyface, Range3d, SolidPrimitive, Transform,\r\n} from \"@itwin/core-geometry\";\r\nimport { AnalysisStyle, ColorDef, Feature, Frustum, GeometryClass, GraphicParams, LinePixels, Npc } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { RenderGraphic } from \"./RenderGraphic\";\r\nimport { GraphicPrimitive } from \"./GraphicPrimitive\";\r\n\r\n/**\r\n * Describes the type of a [[GraphicBuilder]], which defines the coordinate system in which the builder's geometry is defined and\r\n * controls the behavior of the [[RenderGraphic]] produced by the builder.\r\n * @note For those types for which depth-testing is disabled, the order in which the individual geometric primitives are drawn determines which geometry draws on top of other geometry.\r\n * - Within a [[GraphicList]], each [[RenderGraphic]] is rendered in the order in which it appears in the list; and\r\n * - Within a single [[RenderGraphic]], each geometric primitive is rendered in the ordered in which it was added to the GraphicBuilder.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GraphicType {\r\n /**\r\n * Renders behind all other graphics. For example, the border of a [[SheetViewState]] is of this type.\r\n * Coordinates: [[CoordSystem.View]].\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\r\n * Lighting: none.\r\n * Depth-testing: disabled.\r\n * @see [[Decorations.viewBackground]]\r\n */\r\n ViewBackground,\r\n /** Used for the scene itself, dynamics, and 'normal' decorations. */\r\n /**\r\n * Renders as if it were part of the scene. All of the [[ViewFlags]] applied to the view's normal geometry also applies to these types of decorations.\r\n * Coordinates: [[CoordSystem.World]].\r\n * Lighting and [[RenderMode]]: from view.\r\n * Depth-testing: enabled.\r\n * @see [[Decorations.normal]].\r\n */\r\n Scene,\r\n /** Renders within the scene. Coordinates: world. RenderMode: smooth. Lighting: default. Z-testing: enabled */\r\n /** Renders within the scene, but ignores the view's [[ViewFlags]].\r\n * Coordinates: [[CoordSystem.World]].\r\n * Lighting: default.\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\r\n * Depth-testing: enabled.\r\n * @see [[Decorations.world]].\r\n */\r\n WorldDecoration,\r\n /**\r\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldDecoration]] only in that depth-testing is disabled.\r\n * For example, the ACS triad and [[WindowAreaTool]] decorations are of this type.\r\n * Coordinates: [[CoordSystem.World]].\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\r\n * Lighting: default.\r\n * Depth-testing: disabled.\r\n * Renders atop the scene. Coordinates: world. RenderMode: smooth. Lighting: none. Z-testing: disabled\r\n * @note Overlay decorations typically employ some degree of transparency to ensure that they do not fully obscure the scene.\r\n * @see [[Decorations.worldOverlay]]\r\n */\r\n WorldOverlay,\r\n /**\r\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldOverlay]] only in that their geometry is defined in view coordinates rather than world.\r\n * Coordinates: [[CoordSystem.View]].\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\r\n * Lighting: default.\r\n * Depth-testing: disabled.\r\n * @note For more flexibility in defining view overlay decorations, consider using a [[CanvasDecorationList]].\r\n * @see [[Decorations.viewOverlay]]\r\n */\r\n ViewOverlay,\r\n}\r\n\r\n/** Options used when constructing a `Batch` - that is, a [[RenderGraphic]] with an associated [FeatureTable]($common) describing individual [Feature]($common)s within the\r\n * graphic. Individual features can be resymbolized in a variety of ways including flashing and hiliting.\r\n * For example, to prevent graphics produced by [[readElementGraphics]] from being hilited when their corresponding element is in the [[SelectionSet]],\r\n * pass `{ noHilite: true }` to [[readElementGraphics]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BatchOptions {\r\n /** Identifies the [[Tile]] associated with the batch, chiefly for debugging purposes.\r\n * @beta\r\n */\r\n tileId?: string;\r\n /** If true, features within the batch will not be flashed on mouseover. */\r\n noFlash?: boolean;\r\n /** If true, features within the batch will not be hilited when their corresponding element is in the [[SelectionSet]]. */\r\n noHilite?: boolean;\r\n /** If true, features within the batch will not be emphasized when the corresponding [[Feature]] is emphasized using [FeatureOverrides]($common). */\r\n noEmphasis?: boolean;\r\n /** If true, the contents of the batch will only be drawn by [[Viewport.readPixels]], not [[Viewport.renderFrame]], causing them to be locatable but invisible. */\r\n locateOnly?: boolean;\r\n}\r\n\r\n/** Options used as part of [[GraphicBuilderOptions]] to describe a [pickable]($docs/learning/frontend/ViewDecorations#pickable-view-graphic-decorations) [[RenderGraphic]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PickableGraphicOptions extends BatchOptions {\r\n /** A unique identifier for the graphic.\r\n * @see [[IModelConnection.transientIds]] to obtain a unique Id in the context of an iModel.\r\n * @see [[GraphicBuilder.activatePickableId]] or [[GraphicBuilder.activateFeature]] to change the pickable object while adding geometry.\r\n */\r\n id: Id64String;\r\n /** Optional Id of the subcategory with which the graphic should be associated. */\r\n subCategoryId?: Id64String;\r\n /** Optional geometry class for the graphic - defaults to [GeometryClass.Primary]($common). */\r\n geometryClass?: GeometryClass;\r\n /** The optional Id of the model with which the graphic should be associated. */\r\n modelId?: Id64String;\r\n}\r\n\r\n/** Options for creating a [[GraphicBuilder]] used by functions like [[DecorateContext.createGraphic]] and [[RenderSystem.createGraphic]].\r\n * @see [[ViewportGraphicBuilderOptions]] to create a graphic builder for a [[Viewport]].\r\n * @see [[CustomGraphicBuilderOptions]] to create a graphic builder unassociated with any [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicBuilderOptions {\r\n /** The type of graphic to produce. */\r\n type: GraphicType;\r\n\r\n /** The local-to-world transform in which the builder's geometry is to be defined - by default, an identity transform. */\r\n placement?: Transform;\r\n\r\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\r\n pickable?: PickableGraphicOptions;\r\n\r\n /** If true, the order in which geometry is added to the builder is preserved.\r\n * This is useful for overlay and background graphics because they draw without using the depth buffer. For example, to draw an overlay containing a red shape with a white outline,\r\n * you would add the shape to the GraphicBuilder first, followed by the outline, to ensure the outline draws \"in front of\" the shape.\r\n * It defaults to true for overlays and background graphics, and false for other graphic types.\r\n * It is not useful for other types of graphics and imposes a performance penalty due to increased number of draw calls.\r\n * For overlay and background graphics that do not need to draw in any particular order, the performance penalty can be eliminated by setting this to `false`.\r\n */\r\n preserveOrder?: boolean;\r\n\r\n /** Controls whether normals are generated for surfaces. Normals allow 3d geometry to receive lighting; without them the geometry will be unaffected by lighting.\r\n * By default, normals are generated only for graphics of type [[GraphicType.Scene]]; or for any type of graphic if [[GraphicBuilder.wantEdges]] is true, because\r\n * normals are required to prevent z-fighting between surfaces and their edges. This default can be overridden by explicitly specifying `true` or `false`.\r\n * @see [[GraphicType]] for a description of whether and how different types of graphics are affected by lighting.\r\n */\r\n wantNormals?: boolean;\r\n\r\n /** Controls whether edges are generated for surfaces.\r\n * Edges are only displayed if [ViewFlags.renderMode]($common) is not [RenderMode.SmoothShade]($common) or [ViewFlags.visibleEdges]($common) is `true`.\r\n * Since all decoration graphics except [[GraphicType.Scene]] are drawn in smooth shaded mode with no visible edges, by default edges are only produced for scene graphics, and\r\n * - if a [[Viewport]] is supplied with the options - only if [ViewFlags.edgesRequired]($common) is true for the viewport.\r\n * That default can be overridden by explicitly specifying `true` or `false`. This can be useful for non-scene decorations contained in a [[GraphicBranch]] that applies [ViewFlagOverrides]($common)\r\n * that change the edge display settings; or for scene decorations that might be cached for reuse after the viewport's edge settings are changed.\r\n * @note Edges will tend to z-fight with their surfaces unless the graphic is [[pickable]].\r\n */\r\n generateEdges?: boolean;\r\n\r\n /** If defined, specifies a point about which the graphic will rotate such that it always faces the viewer.\r\n * This can be particular useful for planar regions to create a billboarding effect - e.g., to implement [[Marker]]-like WebGL decorations.\r\n * The graphic's [[placement]] transform is not applied to the point.\r\n * @note This has no effect for graphics displayed in a 2d view.\r\n */\r\n viewIndependentOrigin?: Point3d;\r\n}\r\n\r\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] to be displayed in a specific [[Viewport]].\r\n * The level of detail of the graphic will be computed from the position of its geometry within the viewport's [Frustum]($common).\r\n * Default values for [[GraphicBuilderOptions.wantNormals]] and [[GraphicBuilderOptions.generateEdges]] will be determined by the viewport's [ViewFlags]($common).\r\n * The [[GraphicBuilder.iModel]] will be set to the viewport's [[IModelConnection]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewportGraphicBuilderOptions extends GraphicBuilderOptions {\r\n /** The viewport in which the resultant [[RenderGraphic]] is to be drawn. */\r\n viewport: Viewport;\r\n\r\n /** If true, [[ViewState.getAspectRatioSkew]] will be taken into account when computing the level of detail for the produced graphics. */\r\n applyAspectRatioSkew?: boolean;\r\n\r\n iModel?: never;\r\n computeChordTolerance?: never;\r\n}\r\n\r\n/** Arguments used to compute the chord tolerance (level of detail) of the [[RenderGraphic]]s produced by a [[GraphicBuilder]].\r\n * Generally, the chord tolerance should be roughly equivalent to the size in meters of one pixel on screen where the graphic is to be displayed.\r\n * For [[GraphicType.ViewOverlay]] and [[GraphicType.ViewBackground]], which already define their geometry in pixels, the chord tolerance should typically be 1.\r\n * @see [[CustomGraphicBuilderOptions.computeChordTolerance]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ComputeChordToleranceArgs {\r\n /** The graphic builder being used to produce the graphics. */\r\n readonly graphic: GraphicBuilder;\r\n /** A function that computes a range enclosing all of the geometry that was added to the builder. */\r\n readonly computeRange: () => Range3d;\r\n}\r\n\r\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] that is not associated with any particular [[Viewport]] and may not be associated with\r\n * any particular [[IModelConnection]].\r\n * This is primarily useful when the same graphic is to be saved and reused for display in multiple viewports and for which a chord tolerance can be computed\r\n * independently of each viewport's [Frustum]($common).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CustomGraphicBuilderOptions extends GraphicBuilderOptions {\r\n /** Optionally, the IModelConnection with which the graphic is associated. */\r\n iModel?: IModelConnection;\r\n /** A function that can compute the level of detail for the graphics produced by the builder. */\r\n computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\r\n\r\n applyAspectRatioSkew?: never;\r\n viewport?: never;\r\n}\r\n\r\n/** Provides methods for constructing a [[RenderGraphic]] from geometric primitives.\r\n * GraphicBuilder is primarily used for creating [[Decorations]] to be displayed inside a [[Viewport]].\r\n *\r\n * The typical process for constructing a [[RenderGraphic]] proceeds as follows:\r\n * 1. Use [[DecorateContext.createGraphic]] or [[RenderSystem.createGraphic]] to obtain a builder.\r\n * 2. Set up the symbology using [[GraphicBuilder.activateGraphicParams]] or [[GraphicBuilder.setSymbology]].\r\n * 3. Add one or more geometric primitives using methods like [[GraphicBuilder.addShape]] and [[GraphicBuilder.addLineString]], possibly setting new symbology in between.\r\n * 4. Use [[GraphicBuilder.finish]] to produce the finished [[RenderGraphic]].\r\n *\r\n * @note Most of the methods which add geometry to the builder take ownership of their inputs rather than cloning them.\r\n * So, for example, if you pass an array of points to addLineString(), you should not subsequently modify that array.\r\n *\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class GraphicBuilder {\r\n /** The local coordinate system transform applied to this builder's geometry.\r\n * @see [[GraphicBuilderOptions.placement]].\r\n */\r\n public readonly placement: Transform;\r\n\r\n /** The iModel associated with this builder, if any. */\r\n public readonly iModel?: IModelConnection;\r\n\r\n /** The type of graphic to be produced by this builder.\r\n * @see [[GraphicBuilderOptions.type]].\r\n */\r\n public readonly type: GraphicType;\r\n\r\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\r\n public readonly pickable?: Readonly<PickableGraphicOptions>;\r\n\r\n /** If true, the order in which geometry is added to the builder is preserved.\r\n * @see [[GraphicBuilderOptions.preserveOrder]] for more details.\r\n */\r\n public readonly preserveOrder: boolean;\r\n\r\n /** Controls whether normals are generated for surfaces.\r\n * @note Normals are required for proper edge display, so by default they are always produced if [[wantEdges]] is `true`.\r\n * @see [[GraphicBuilderOptions.wantNormals]] for more details.\r\n */\r\n public readonly wantNormals: boolean;\r\n\r\n /** Controls whether edges are generated for surfaces.\r\n * @see [[GraphicBuilderOptions.generateEdges]] for more details.\r\n */\r\n public readonly wantEdges: boolean;\r\n\r\n /** @alpha */\r\n public readonly analysisStyle?: AnalysisStyle;\r\n\r\n protected readonly _computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\r\n protected readonly _options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions;\r\n\r\n /** @internal */\r\n protected constructor(options: ViewportGraphicBuilderOptions | CustomGraphicBuilderOptions) {\r\n // Stored for potential use later in creating a new GraphicBuilder from this one (see PrimitiveBuilder.finishGraphic).\r\n this._options = options;\r\n\r\n const vp = options.viewport;\r\n this.placement = options.placement ?? Transform.createIdentity();\r\n this.iModel = vp?.iModel ?? options.iModel;\r\n this.type = options.type;\r\n this.pickable = options.pickable;\r\n this.wantEdges = options.generateEdges ?? (this.type === GraphicType.Scene && (!vp || vp.viewFlags.edgesRequired()));\r\n this.wantNormals = options.wantNormals ?? (this.wantEdges || this.type === GraphicType.Scene);\r\n this.preserveOrder = options.preserveOrder ?? (this.isOverlay || this.isViewBackground);\r\n\r\n if (!options.viewport) {\r\n this._computeChordTolerance = options.computeChordTolerance;\r\n return;\r\n }\r\n\r\n this.analysisStyle = options.viewport.displayStyle.settings.analysisStyle;\r\n\r\n this._computeChordTolerance = (args: ComputeChordToleranceArgs) => {\r\n let pixelSize = 1;\r\n if (!this.isViewCoordinates) {\r\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\r\n pixelSize = options.viewport.getPixelSizeAtPoint(args.computeRange().center);\r\n pixelSize = options.viewport.target.adjustPixelSizeForLOD(pixelSize);\r\n\r\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\r\n const skew = options.applyAspectRatioSkew ? options.viewport.view.getAspectRatioSkew() : 0;\r\n if (skew > 1)\r\n pixelSize /= skew;\r\n }\r\n\r\n return pixelSize * 0.25;\r\n };\r\n }\r\n\r\n /** The Id to be associated with the graphic for picking.\r\n * @see [[GraphicBuilderOptions.pickable]] for more options.\r\n * @deprecated This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.\r\n */\r\n public get pickId(): Id64String | undefined {\r\n return this.pickable?.id;\r\n }\r\n\r\n /** Whether the builder's geometry is defined in [[CoordSystem.View]] coordinates.\r\n * @see [[isWorldCoordinates]].\r\n */\r\n public get isViewCoordinates(): boolean {\r\n return this.type === GraphicType.ViewBackground || this.type === GraphicType.ViewOverlay;\r\n }\r\n\r\n /** Whether the builder's geometry is defined in [[CoordSystem.World]] coordinates.\r\n * @see [[isViewCoordinates]].\r\n */\r\n public get isWorldCoordinates(): boolean {\r\n return !this.isViewCoordinates;\r\n }\r\n\r\n /** True if the builder produces a graphic of [[GraphicType.Scene]]. */\r\n public get isSceneGraphic(): boolean {\r\n return this.type === GraphicType.Scene;\r\n }\r\n\r\n /** True if the builder produces a graphic of [[GraphicType.ViewBackground]]. */\r\n public get isViewBackground(): boolean {\r\n return this.type === GraphicType.ViewBackground;\r\n }\r\n\r\n /** True if the builder produces a graphic of [[GraphicType.WorldOverlay]] or [[GraphicType.ViewOerlay]]. */\r\n public get isOverlay(): boolean {\r\n return this.type === GraphicType.ViewOverlay || this.type === GraphicType.WorldOverlay;\r\n }\r\n\r\n /**\r\n * Processes the accumulated symbology and geometry to produce a renderable graphic.\r\n * This function can only be called once; after the [[RenderGraphic]] has been extracted the [[GraphicBuilder]] should no longer be used.\r\n */\r\n public abstract finish(): RenderGraphic;\r\n\r\n /** Sets the current active symbology for this builder. Any new geometry subsequently added to the builder will be drawn using the specified symbology.\r\n * @param graphicParams The symbology to apply to subsequent geometry.\r\n * @see [[GraphicBuilder.setSymbology]] for a convenient way to set common symbology options.\r\n */\r\n public abstract activateGraphicParams(graphicParams: GraphicParams): void;\r\n\r\n /** Called by [[activateFeature]] after validation to change the [Feature]($common) to be associated with subsequently-added geometry.\r\n * This default implementation does nothing.\r\n */\r\n protected _activateFeature(_feature: Feature): void { }\r\n\r\n /** Change the [Feature]($common) to be associated with subsequently-added geometry. This permits multiple features to be batched together into a single graphic\r\n * for more efficient rendering.\r\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\r\n */\r\n public activateFeature(feature: Feature): void {\r\n assert(undefined !== this._options.pickable, \"GraphicBuilder.activateFeature has no effect if PickableGraphicOptions were not supplied\");\r\n if (this._options.pickable)\r\n this._activateFeature(feature);\r\n }\r\n\r\n /** Change the pickable Id to be associated with subsequently-added geometry. This permits multiple pickable objects to be batched together into a single graphic\r\n * for more efficient rendering. This method calls [[activateFeature]], using the subcategory Id and [GeometryClass]($common) specified in [[GraphicBuilder.pickable]]\r\n * at construction, if any.\r\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\r\n */\r\n public activatePickableId(id: Id64String): void {\r\n const pick = this._options.pickable;\r\n this.activateFeature(new Feature(id, pick?.subCategoryId, pick?.geometryClass));\r\n }\r\n\r\n /**\r\n * Appends a 3d line string to the builder.\r\n * @param points Array of vertices in the line string.\r\n */\r\n public abstract addLineString(points: Point3d[]): void;\r\n\r\n /**\r\n * Appends a 2d line string to the builder.\r\n * @param points Array of vertices in the line string.\r\n * @param zDepth Z value in local coordinates to use for each point.\r\n */\r\n public abstract addLineString2d(points: Point2d[], zDepth: number): void;\r\n\r\n /**\r\n * Appends a 3d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\r\n * @param points Array of vertices in the point string.\r\n */\r\n public abstract addPointString(points: Point3d[]): void;\r\n\r\n /**\r\n * Appends a 2d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\r\n * @param points Array of vertices in the point string.\r\n * @param zDepth Z value in local coordinates to use for each point.\r\n */\r\n public abstract addPointString2d(points: Point2d[], zDepth: number): void;\r\n\r\n /**\r\n * Appends a closed 3d planar region to the builder.\r\n * @param points Array of vertices of the shape.\r\n */\r\n public abstract addShape(points: Point3d[]): void;\r\n\r\n /**\r\n * Appends a closed 2d region to the builder.\r\n * @param points Array of vertices of the shape.\r\n * @param zDepth Z value in local coordinates to use for each point.\r\n */\r\n public abstract addShape2d(points: Point2d[], zDepth: number): void;\r\n\r\n /**\r\n * Appends a 3d open arc or closed ellipse to the builder.\r\n * @param arc Description of the arc or ellipse.\r\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\r\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\r\n */\r\n public abstract addArc(arc: Arc3d, isEllipse: boolean, filled: boolean): void;\r\n\r\n /**\r\n * Appends a 2d open arc or closed ellipse to the builder.\r\n * @param arc Description of the arc or ellipse.\r\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\r\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\r\n * @param zDepth Z value in local coordinates to use for each point in the arc or ellipse.\r\n */\r\n public abstract addArc2d(ellipse: Arc3d, isEllipse: boolean, filled: boolean, zDepth: number): void;\r\n\r\n /** Append a 3d open path to the builder. */\r\n public abstract addPath(path: Path): void;\r\n\r\n /** Append a 3d planar region to the builder. */\r\n public abstract addLoop(loop: Loop): void;\r\n\r\n /** Append a [CurvePrimitive]($core-geometry) to the builder. */\r\n public addCurvePrimitive(curve: AnyCurvePrimitive): void {\r\n switch (curve.curvePrimitiveType) {\r\n case \"lineString\":\r\n this.addLineString(curve.points);\r\n break;\r\n case \"lineSegment\":\r\n this.addLineString([curve.startPoint(), curve.endPoint()]);\r\n break;\r\n case \"arc\":\r\n this.addArc(curve, false, false);\r\n break;\r\n default:\r\n const path = new Path();\r\n if (path.tryAddChild(curve))\r\n this.addPath(path);\r\n\r\n break;\r\n }\r\n }\r\n\r\n /** Append a mesh to the builder.\r\n * @param meshData Describes the mesh\r\n * @param filled If the mesh describes a planar region, indicates whether its interior area should be drawn with fill in [[RenderMode.Wireframe]].\r\n */\r\n public abstract addPolyface(meshData: Polyface, filled: boolean): void;\r\n\r\n /** Append a solid primitive to the builder. */\r\n public abstract addSolidPrimitive(solidPrimitive: SolidPrimitive): void;\r\n\r\n /** Append any primitive to the builder.\r\n * @param primitive The graphic primitive to append.\r\n */\r\n public addPrimitive(primitive: GraphicPrimitive): void {\r\n switch (primitive.type) {\r\n case \"linestring\":\r\n this.addLineString(primitive.points);\r\n break;\r\n case \"linestring2d\":\r\n this.addLineString2d(primitive.points, primitive.zDepth);\r\n break;\r\n case \"pointstring\":\r\n this.addPointString(primitive.points);\r\n break;\r\n case \"pointstring2d\":\r\n this.addPointString2d(primitive.points, primitive.zDepth);\r\n break;\r\n case \"shape\":\r\n this.addShape(primitive.points);\r\n break;\r\n case \"shape2d\":\r\n this.addShape2d(primitive.points, primitive.zDepth);\r\n break;\r\n case \"arc\":\r\n this.addArc(primitive.arc, true === primitive.isEllipse, true === primitive.filled);\r\n break;\r\n case \"arc2d\":\r\n this.addArc2d(primitive.arc, true === primitive.isEllipse, true === primitive.filled, primitive.zDepth);\r\n break;\r\n case \"path\":\r\n this.addPath(primitive.path);\r\n break;\r\n case \"loop\":\r\n this.addLoop(primitive.loop);\r\n break;\r\n case \"polyface\":\r\n this.addPolyface(primitive.polyface, true === primitive.filled);\r\n break;\r\n case \"solidPrimitive\":\r\n this.addSolidPrimitive(primitive.solidPrimitive);\r\n break;\r\n }\r\n }\r\n\r\n /** Add Range3d edges. Useful for debugging. */\r\n public addRangeBox(range: Range3d) {\r\n this.addFrustum(Frustum.fromRange(range));\r\n }\r\n\r\n /** Add Frustum edges. Useful for debugging. */\r\n public addFrustum(frustum: Frustum) {\r\n this.addRangeBoxFromCorners(frustum.points);\r\n }\r\n\r\n /** Add range edges from corner points */\r\n public addRangeBoxFromCorners(p: Point3d[]) {\r\n this.addLineString([\r\n p[Npc.LeftBottomFront],\r\n p[Npc.LeftTopFront],\r\n p[Npc.RightTopFront],\r\n p[Npc.RightBottomFront],\r\n p[Npc.RightBottomRear],\r\n p[Npc.RightTopRear],\r\n p[Npc.LeftTopRear],\r\n p[Npc.LeftBottomRear],\r\n p[Npc.LeftBottomFront].clone(),\r\n p[Npc.RightBottomFront].clone(),\r\n ]);\r\n\r\n this.addLineString([p[Npc.LeftTopFront].clone(), p[Npc.LeftTopRear].clone()]);\r\n this.addLineString([p[Npc.RightTopFront].clone(), p[Npc.RightTopRear].clone()]);\r\n this.addLineString([p[Npc.LeftBottomRear].clone(), p[Npc.RightBottomRear].clone()]);\r\n }\r\n\r\n /** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.\r\n * @param lineColor The color in which to draw lines.\r\n * @param fillColor The color in which to draw filled regions.\r\n * @param lineWidth The width in pixels to draw lines. The renderer will clamp this value to an integer in the range [1, 32].\r\n * @param linePixels The pixel pattern in which to draw lines.\r\n * @see [[GraphicBuilder.activateGraphicParams]] for additional symbology options.\r\n */\r\n public setSymbology(lineColor: ColorDef, fillColor: ColorDef, lineWidth: number, linePixels = LinePixels.Solid) {\r\n this.activateGraphicParams(GraphicParams.fromSymbology(lineColor, fillColor, lineWidth, linePixels));\r\n }\r\n\r\n /** Set the current active symbology for this builder to be a blanking fill before adding a planar region.\r\n * A planar region drawn with blanking fill renders behind other geometry in the same graphic.\r\n * Blanking fill is not affected by the fill [[ViewFlags]] being disabled.\r\n * An example would be to add a line to a graphic containing a shape with blanking fill so that the line is always shown in front of the fill.\r\n * @param fillColor The color in which to draw filled regions.\r\n */\r\n public setBlankingFill(fillColor: ColorDef) { this.activateGraphicParams(GraphicParams.fromBlankingFill(fillColor)); }\r\n}\r\n"]}
1
+ {"version":3,"file":"GraphicBuilder.js","sourceRoot":"","sources":["../../../src/render/GraphicBuilder.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,wDAE8B;AAC9B,oDAA8H;AAM9H;;;;;;;;GAQG;AACH,IAAY,WAkDX;AAlDD,WAAY,WAAW;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,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE;YAC9B,CAAC,CAAC,iBAAG,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE;SAChC,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAG,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,iBAAG,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAG,CAAC,aAAa,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,iBAAG,CAAC,YAAY,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAChF,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,iBAAG,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,iBAAG,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;OAMG;IACI,YAAY,CAAC,SAAmB,EAAE,SAAmB,EAAE,SAAiB,EAAE,UAAU,GAAG,wBAAU,CAAC,KAAK;QAC5G,IAAI,CAAC,qBAAqB,CAAC,2BAAa,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACvG,CAAC;IAED;;;;;OAKG;IACI,eAAe,CAAC,SAAmB,IAAI,IAAI,CAAC,qBAAqB,CAAC,2BAAa,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;CACvH;AA/UD,wCA+UC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n AnyCurvePrimitive, Arc3d, Loop, Path, Point2d, Point3d, Polyface, Range3d, SolidPrimitive, Transform,\r\n} from \"@itwin/core-geometry\";\r\nimport { AnalysisStyle, ColorDef, Feature, Frustum, GeometryClass, GraphicParams, LinePixels, Npc } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { RenderGraphic } from \"./RenderGraphic\";\r\nimport { GraphicPrimitive } from \"./GraphicPrimitive\";\r\n\r\n/**\r\n * Describes the type of a [[GraphicBuilder]], which defines the coordinate system in which the builder's geometry is defined and\r\n * controls the behavior of the [[RenderGraphic]] produced by the builder.\r\n * @note For those types for which depth-testing is disabled, the order in which the individual geometric primitives are drawn determines which geometry draws on top of other geometry.\r\n * - Within a [[GraphicList]], each [[RenderGraphic]] is rendered in the order in which it appears in the list; and\r\n * - Within a single [[RenderGraphic]], each geometric primitive is rendered in the ordered in which it was added to the GraphicBuilder.\r\n * @public\r\n * @extensions\r\n */\r\nexport enum GraphicType {\r\n /**\r\n * Renders behind all other graphics. For example, the border of a [[SheetViewState]] is of this type.\r\n * Coordinates: [[CoordSystem.View]].\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\r\n * Lighting: none.\r\n * Depth-testing: disabled.\r\n * @see [[Decorations.viewBackground]]\r\n */\r\n ViewBackground,\r\n /** Used for the scene itself, dynamics, and 'normal' decorations. */\r\n /**\r\n * Renders as if it were part of the scene. All of the [[ViewFlags]] applied to the view's normal geometry also applies to these types of decorations.\r\n * Coordinates: [[CoordSystem.World]].\r\n * Lighting and [[RenderMode]]: from view.\r\n * Depth-testing: enabled.\r\n * @see [[Decorations.normal]].\r\n */\r\n Scene,\r\n /** Renders within the scene. Coordinates: world. RenderMode: smooth. Lighting: default. Z-testing: enabled */\r\n /** Renders within the scene, but ignores the view's [[ViewFlags]].\r\n * Coordinates: [[CoordSystem.World]].\r\n * Lighting: default.\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]].\r\n * Depth-testing: enabled.\r\n * @see [[Decorations.world]].\r\n */\r\n WorldDecoration,\r\n /**\r\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldDecoration]] only in that depth-testing is disabled.\r\n * For example, the ACS triad and [[WindowAreaTool]] decorations are of this type.\r\n * Coordinates: [[CoordSystem.World]].\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\r\n * Lighting: default.\r\n * Depth-testing: disabled.\r\n * Renders atop the scene. Coordinates: world. RenderMode: smooth. Lighting: none. Z-testing: disabled\r\n * @note Overlay decorations typically employ some degree of transparency to ensure that they do not fully obscure the scene.\r\n * @see [[Decorations.worldOverlay]]\r\n */\r\n WorldOverlay,\r\n /**\r\n * Renders as an overlay on top of the scene. These decorations differ from [[GraphicType.WorldOverlay]] only in that their geometry is defined in view coordinates rather than world.\r\n * Coordinates: [[CoordSystem.View]].\r\n * [[RenderMode]]: [[RenderMode.SmoothShade]]\r\n * Lighting: default.\r\n * Depth-testing: disabled.\r\n * @note For more flexibility in defining view overlay decorations, consider using a [[CanvasDecorationList]].\r\n * @see [[Decorations.viewOverlay]]\r\n */\r\n ViewOverlay,\r\n}\r\n\r\n/** Options used when constructing a `Batch` - that is, a [[RenderGraphic]] with an associated [FeatureTable]($common) describing individual [Feature]($common)s within the\r\n * graphic. Individual features can be resymbolized in a variety of ways including flashing and hiliting.\r\n * For example, to prevent graphics produced by [[readElementGraphics]] from being hilited when their corresponding element is in the [[SelectionSet]],\r\n * pass `{ noHilite: true }` to [[readElementGraphics]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface BatchOptions {\r\n /** Identifies the [[Tile]] associated with the batch, chiefly for debugging purposes.\r\n * @beta\r\n */\r\n tileId?: string;\r\n /** If true, features within the batch will not be flashed on mouseover. */\r\n noFlash?: boolean;\r\n /** If true, features within the batch will not be hilited when their corresponding element is in the [[SelectionSet]]. */\r\n noHilite?: boolean;\r\n /** If true, features within the batch will not be emphasized when the corresponding [[Feature]] is emphasized using [FeatureOverrides]($common). */\r\n noEmphasis?: boolean;\r\n /** If true, the contents of the batch will only be drawn by [[Viewport.readPixels]], not [[Viewport.renderFrame]], causing them to be locatable but invisible. */\r\n locateOnly?: boolean;\r\n}\r\n\r\n/** Options used as part of [[GraphicBuilderOptions]] to describe a [pickable]($docs/learning/frontend/ViewDecorations#pickable-view-graphic-decorations) [[RenderGraphic]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PickableGraphicOptions extends BatchOptions {\r\n /** A unique identifier for the graphic.\r\n * @see [[IModelConnection.transientIds]] to obtain a unique Id in the context of an iModel.\r\n * @see [[GraphicBuilder.activatePickableId]] or [[GraphicBuilder.activateFeature]] to change the pickable object while adding geometry.\r\n */\r\n id: Id64String;\r\n /** Optional Id of the subcategory with which the graphic should be associated. */\r\n subCategoryId?: Id64String;\r\n /** Optional geometry class for the graphic - defaults to [GeometryClass.Primary]($common). */\r\n geometryClass?: GeometryClass;\r\n /** The optional Id of the model with which the graphic should be associated. */\r\n modelId?: Id64String;\r\n}\r\n\r\n/** Options for creating a [[GraphicBuilder]] used by functions like [[DecorateContext.createGraphic]] and [[RenderSystem.createGraphic]].\r\n * @see [[ViewportGraphicBuilderOptions]] to create a graphic builder for a [[Viewport]].\r\n * @see [[CustomGraphicBuilderOptions]] to create a graphic builder unassociated with any [[Viewport]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicBuilderOptions {\r\n /** The type of graphic to produce. */\r\n type: GraphicType;\r\n\r\n /** The local-to-world transform in which the builder's geometry is to be defined - by default, an identity transform. */\r\n placement?: Transform;\r\n\r\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\r\n pickable?: PickableGraphicOptions;\r\n\r\n /** If true, the order in which geometry is added to the builder is preserved.\r\n * This is useful for overlay and background graphics because they draw without using the depth buffer. For example, to draw an overlay containing a red shape with a white outline,\r\n * you would add the shape to the GraphicBuilder first, followed by the outline, to ensure the outline draws \"in front of\" the shape.\r\n * It defaults to true for overlays and background graphics, and false for other graphic types.\r\n * It is not useful for other types of graphics and imposes a performance penalty due to increased number of draw calls.\r\n * For overlay and background graphics that do not need to draw in any particular order, the performance penalty can be eliminated by setting this to `false`.\r\n */\r\n preserveOrder?: boolean;\r\n\r\n /** Controls whether normals are generated for surfaces. Normals allow 3d geometry to receive lighting; without them the geometry will be unaffected by lighting.\r\n * By default, normals are generated only for graphics of type [[GraphicType.Scene]]; or for any type of graphic if [[GraphicBuilder.wantEdges]] is true, because\r\n * normals are required to prevent z-fighting between surfaces and their edges. This default can be overridden by explicitly specifying `true` or `false`.\r\n * @see [[GraphicType]] for a description of whether and how different types of graphics are affected by lighting.\r\n */\r\n wantNormals?: boolean;\r\n\r\n /** Controls whether edges are generated for surfaces.\r\n * Edges are only displayed if [ViewFlags.renderMode]($common) is not [RenderMode.SmoothShade]($common) or [ViewFlags.visibleEdges]($common) is `true`.\r\n * Since all decoration graphics except [[GraphicType.Scene]] are drawn in smooth shaded mode with no visible edges, by default edges are only produced for scene graphics, and\r\n * - if a [[Viewport]] is supplied with the options - only if [ViewFlags.edgesRequired]($common) is true for the viewport.\r\n * That default can be overridden by explicitly specifying `true` or `false`. This can be useful for non-scene decorations contained in a [[GraphicBranch]] that applies [ViewFlagOverrides]($common)\r\n * that change the edge display settings; or for scene decorations that might be cached for reuse after the viewport's edge settings are changed.\r\n * @note Edges will tend to z-fight with their surfaces unless the graphic is [[pickable]].\r\n */\r\n generateEdges?: boolean;\r\n\r\n /** If defined, specifies a point about which the graphic will rotate such that it always faces the viewer.\r\n * This can be particular useful for planar regions to create a billboarding effect - e.g., to implement [[Marker]]-like WebGL decorations.\r\n * The graphic's [[placement]] transform is not applied to the point.\r\n * @note This has no effect for graphics displayed in a 2d view.\r\n */\r\n viewIndependentOrigin?: Point3d;\r\n}\r\n\r\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] to be displayed in a specific [[Viewport]].\r\n * The level of detail of the graphic will be computed from the position of its geometry within the viewport's [Frustum]($common).\r\n * Default values for [[GraphicBuilderOptions.wantNormals]] and [[GraphicBuilderOptions.generateEdges]] will be determined by the viewport's [ViewFlags]($common).\r\n * The [[GraphicBuilder.iModel]] will be set to the viewport's [[IModelConnection]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ViewportGraphicBuilderOptions extends GraphicBuilderOptions {\r\n /** The viewport in which the resultant [[RenderGraphic]] is to be drawn. */\r\n viewport: Viewport;\r\n\r\n /** If true, [[ViewState.getAspectRatioSkew]] will be taken into account when computing the level of detail for the produced graphics. */\r\n applyAspectRatioSkew?: boolean;\r\n\r\n iModel?: never;\r\n computeChordTolerance?: never;\r\n}\r\n\r\n/** Arguments used to compute the chord tolerance (level of detail) of the [[RenderGraphic]]s produced by a [[GraphicBuilder]].\r\n * Generally, the chord tolerance should be roughly equivalent to the size in meters of one pixel on screen where the graphic is to be displayed.\r\n * For [[GraphicType.ViewOverlay]] and [[GraphicType.ViewBackground]], which already define their geometry in pixels, the chord tolerance should typically be 1.\r\n * @see [[CustomGraphicBuilderOptions.computeChordTolerance]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ComputeChordToleranceArgs {\r\n /** The graphic builder being used to produce the graphics. */\r\n readonly graphic: GraphicBuilder;\r\n /** A function that computes a range enclosing all of the geometry that was added to the builder. */\r\n readonly computeRange: () => Range3d;\r\n}\r\n\r\n/** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] that is not associated with any particular [[Viewport]] and may not be associated with\r\n * any particular [[IModelConnection]].\r\n * This is primarily useful when the same graphic is to be saved and reused for display in multiple viewports and for which a chord tolerance can be computed\r\n * independently of each viewport's [Frustum]($common).\r\n * @public\r\n * @extensions\r\n */\r\nexport interface CustomGraphicBuilderOptions extends GraphicBuilderOptions {\r\n /** Optionally, the IModelConnection with which the graphic is associated. */\r\n iModel?: IModelConnection;\r\n /** A function that can compute the level of detail for the graphics produced by the builder. */\r\n computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\r\n\r\n applyAspectRatioSkew?: never;\r\n viewport?: never;\r\n}\r\n\r\n/** Provides methods for constructing a [[RenderGraphic]] from geometric primitives.\r\n * GraphicBuilder is primarily used for creating [[Decorations]] to be displayed inside a [[Viewport]].\r\n *\r\n * The typical process for constructing a [[RenderGraphic]] proceeds as follows:\r\n * 1. Use [[DecorateContext.createGraphic]] or [[RenderSystem.createGraphic]] to obtain a builder.\r\n * 2. Set up the symbology using [[GraphicBuilder.activateGraphicParams]] or [[GraphicBuilder.setSymbology]].\r\n * 3. Add one or more geometric primitives using methods like [[GraphicBuilder.addShape]] and [[GraphicBuilder.addLineString]], possibly setting new symbology in between.\r\n * 4. Use [[GraphicBuilder.finish]] to produce the finished [[RenderGraphic]].\r\n *\r\n * @note Most of the methods which add geometry to the builder take ownership of their inputs rather than cloning them.\r\n * So, for example, if you pass an array of points to addLineString(), you should not subsequently modify that array.\r\n *\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class GraphicBuilder {\r\n /** The local coordinate system transform applied to this builder's geometry.\r\n * @see [[GraphicBuilderOptions.placement]].\r\n */\r\n public readonly placement: Transform;\r\n\r\n /** The iModel associated with this builder, if any. */\r\n public readonly iModel?: IModelConnection;\r\n\r\n /** The type of graphic to be produced by this builder.\r\n * @see [[GraphicBuilderOptions.type]].\r\n */\r\n public readonly type: GraphicType;\r\n\r\n /** If the graphic is to be pickable, specifies the pickable Id and other options. */\r\n public readonly pickable?: Readonly<PickableGraphicOptions>;\r\n\r\n /** If true, the order in which geometry is added to the builder is preserved.\r\n * @see [[GraphicBuilderOptions.preserveOrder]] for more details.\r\n */\r\n public readonly preserveOrder: boolean;\r\n\r\n /** Controls whether normals are generated for surfaces.\r\n * @note Normals are required for proper edge display, so by default they are always produced if [[wantEdges]] is `true`.\r\n * @see [[GraphicBuilderOptions.wantNormals]] for more details.\r\n */\r\n public readonly wantNormals: boolean;\r\n\r\n /** Controls whether edges are generated for surfaces.\r\n * @see [[GraphicBuilderOptions.generateEdges]] for more details.\r\n */\r\n public readonly wantEdges: boolean;\r\n\r\n /** @alpha */\r\n public readonly analysisStyle?: AnalysisStyle;\r\n\r\n protected readonly _computeChordTolerance: (args: ComputeChordToleranceArgs) => number;\r\n protected readonly _options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions;\r\n\r\n /** @internal */\r\n protected constructor(options: ViewportGraphicBuilderOptions | CustomGraphicBuilderOptions) {\r\n // Stored for potential use later in creating a new GraphicBuilder from this one (see PrimitiveBuilder.finishGraphic).\r\n this._options = options;\r\n\r\n const vp = options.viewport;\r\n this.placement = options.placement ?? Transform.createIdentity();\r\n this.iModel = vp?.iModel ?? options.iModel;\r\n this.type = options.type;\r\n this.pickable = options.pickable;\r\n this.wantEdges = options.generateEdges ?? (this.type === GraphicType.Scene && (!vp || vp.viewFlags.edgesRequired()));\r\n this.wantNormals = options.wantNormals ?? (this.wantEdges || this.type === GraphicType.Scene);\r\n this.preserveOrder = options.preserveOrder ?? (this.isOverlay || this.isViewBackground);\r\n\r\n if (!options.viewport) {\r\n this._computeChordTolerance = options.computeChordTolerance;\r\n return;\r\n }\r\n\r\n this.analysisStyle = options.viewport.displayStyle.settings.analysisStyle;\r\n\r\n this._computeChordTolerance = (args: ComputeChordToleranceArgs) => {\r\n let pixelSize = 1;\r\n if (!this.isViewCoordinates) {\r\n // Compute the horizontal distance in meters between two adjacent pixels at the center of the geometry.\r\n pixelSize = options.viewport.getPixelSizeAtPoint(args.computeRange().center);\r\n pixelSize = options.viewport.target.adjustPixelSizeForLOD(pixelSize);\r\n\r\n // Aspect ratio skew > 1.0 stretches the view in Y. In that case use the smaller vertical pixel distance for our stroke tolerance.\r\n const skew = options.applyAspectRatioSkew ? options.viewport.view.getAspectRatioSkew() : 0;\r\n if (skew > 1)\r\n pixelSize /= skew;\r\n }\r\n\r\n return pixelSize * 0.25;\r\n };\r\n }\r\n\r\n /** The Id to be associated with the graphic for picking.\r\n * @see [[GraphicBuilderOptions.pickable]] for more options.\r\n * @deprecated in 3.x. This provides only the **first** pickable Id for this graphic - you should keep track of the **current** pickable Id yourself.\r\n */\r\n public get pickId(): Id64String | undefined {\r\n return this.pickable?.id;\r\n }\r\n\r\n /** Whether the builder's geometry is defined in [[CoordSystem.View]] coordinates.\r\n * @see [[isWorldCoordinates]].\r\n */\r\n public get isViewCoordinates(): boolean {\r\n return this.type === GraphicType.ViewBackground || this.type === GraphicType.ViewOverlay;\r\n }\r\n\r\n /** Whether the builder's geometry is defined in [[CoordSystem.World]] coordinates.\r\n * @see [[isViewCoordinates]].\r\n */\r\n public get isWorldCoordinates(): boolean {\r\n return !this.isViewCoordinates;\r\n }\r\n\r\n /** True if the builder produces a graphic of [[GraphicType.Scene]]. */\r\n public get isSceneGraphic(): boolean {\r\n return this.type === GraphicType.Scene;\r\n }\r\n\r\n /** True if the builder produces a graphic of [[GraphicType.ViewBackground]]. */\r\n public get isViewBackground(): boolean {\r\n return this.type === GraphicType.ViewBackground;\r\n }\r\n\r\n /** True if the builder produces a graphic of [[GraphicType.WorldOverlay]] or [[GraphicType.ViewOerlay]]. */\r\n public get isOverlay(): boolean {\r\n return this.type === GraphicType.ViewOverlay || this.type === GraphicType.WorldOverlay;\r\n }\r\n\r\n /**\r\n * Processes the accumulated symbology and geometry to produce a renderable graphic.\r\n * This function can only be called once; after the [[RenderGraphic]] has been extracted the [[GraphicBuilder]] should no longer be used.\r\n */\r\n public abstract finish(): RenderGraphic;\r\n\r\n /** Sets the current active symbology for this builder. Any new geometry subsequently added to the builder will be drawn using the specified symbology.\r\n * @param graphicParams The symbology to apply to subsequent geometry.\r\n * @see [[GraphicBuilder.setSymbology]] for a convenient way to set common symbology options.\r\n */\r\n public abstract activateGraphicParams(graphicParams: GraphicParams): void;\r\n\r\n /** Called by [[activateFeature]] after validation to change the [Feature]($common) to be associated with subsequently-added geometry.\r\n * This default implementation does nothing.\r\n */\r\n protected _activateFeature(_feature: Feature): void { }\r\n\r\n /** Change the [Feature]($common) to be associated with subsequently-added geometry. This permits multiple features to be batched together into a single graphic\r\n * for more efficient rendering.\r\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\r\n */\r\n public activateFeature(feature: Feature): void {\r\n assert(undefined !== this._options.pickable, \"GraphicBuilder.activateFeature has no effect if PickableGraphicOptions were not supplied\");\r\n if (this._options.pickable)\r\n this._activateFeature(feature);\r\n }\r\n\r\n /** Change the pickable Id to be associated with subsequently-added geometry. This permits multiple pickable objects to be batched together into a single graphic\r\n * for more efficient rendering. This method calls [[activateFeature]], using the subcategory Id and [GeometryClass]($common) specified in [[GraphicBuilder.pickable]]\r\n * at construction, if any.\r\n * @note This method has no effect if [[GraphicBuilderOptions.pickable]] was not supplied to the GraphicBuilder's constructor.\r\n */\r\n public activatePickableId(id: Id64String): void {\r\n const pick = this._options.pickable;\r\n this.activateFeature(new Feature(id, pick?.subCategoryId, pick?.geometryClass));\r\n }\r\n\r\n /**\r\n * Appends a 3d line string to the builder.\r\n * @param points Array of vertices in the line string.\r\n */\r\n public abstract addLineString(points: Point3d[]): void;\r\n\r\n /**\r\n * Appends a 2d line string to the builder.\r\n * @param points Array of vertices in the line string.\r\n * @param zDepth Z value in local coordinates to use for each point.\r\n */\r\n public abstract addLineString2d(points: Point2d[], zDepth: number): void;\r\n\r\n /**\r\n * Appends a 3d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\r\n * @param points Array of vertices in the point string.\r\n */\r\n public abstract addPointString(points: Point3d[]): void;\r\n\r\n /**\r\n * Appends a 2d point string to the builder. The points are drawn disconnected, with a diameter in pixels defined by the builder's active [[GraphicParams.rasterWidth]].\r\n * @param points Array of vertices in the point string.\r\n * @param zDepth Z value in local coordinates to use for each point.\r\n */\r\n public abstract addPointString2d(points: Point2d[], zDepth: number): void;\r\n\r\n /**\r\n * Appends a closed 3d planar region to the builder.\r\n * @param points Array of vertices of the shape.\r\n */\r\n public abstract addShape(points: Point3d[]): void;\r\n\r\n /**\r\n * Appends a closed 2d region to the builder.\r\n * @param points Array of vertices of the shape.\r\n * @param zDepth Z value in local coordinates to use for each point.\r\n */\r\n public abstract addShape2d(points: Point2d[], zDepth: number): void;\r\n\r\n /**\r\n * Appends a 3d open arc or closed ellipse to the builder.\r\n * @param arc Description of the arc or ellipse.\r\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\r\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\r\n */\r\n public abstract addArc(arc: Arc3d, isEllipse: boolean, filled: boolean): void;\r\n\r\n /**\r\n * Appends a 2d open arc or closed ellipse to the builder.\r\n * @param arc Description of the arc or ellipse.\r\n * @param isEllipse If true, and if the arc defines a full sweep, then draw as a closed ellipse instead of an arc.\r\n * @param filled If true, and isEllipse is also true, then draw ellipse filled.\r\n * @param zDepth Z value in local coordinates to use for each point in the arc or ellipse.\r\n */\r\n public abstract addArc2d(ellipse: Arc3d, isEllipse: boolean, filled: boolean, zDepth: number): void;\r\n\r\n /** Append a 3d open path to the builder. */\r\n public abstract addPath(path: Path): void;\r\n\r\n /** Append a 3d planar region to the builder. */\r\n public abstract addLoop(loop: Loop): void;\r\n\r\n /** Append a [CurvePrimitive]($core-geometry) to the builder. */\r\n public addCurvePrimitive(curve: AnyCurvePrimitive): void {\r\n switch (curve.curvePrimitiveType) {\r\n case \"lineString\":\r\n this.addLineString(curve.points);\r\n break;\r\n case \"lineSegment\":\r\n this.addLineString([curve.startPoint(), curve.endPoint()]);\r\n break;\r\n case \"arc\":\r\n this.addArc(curve, false, false);\r\n break;\r\n default:\r\n const path = new Path();\r\n if (path.tryAddChild(curve))\r\n this.addPath(path);\r\n\r\n break;\r\n }\r\n }\r\n\r\n /** Append a mesh to the builder.\r\n * @param meshData Describes the mesh\r\n * @param filled If the mesh describes a planar region, indicates whether its interior area should be drawn with fill in [[RenderMode.Wireframe]].\r\n */\r\n public abstract addPolyface(meshData: Polyface, filled: boolean): void;\r\n\r\n /** Append a solid primitive to the builder. */\r\n public abstract addSolidPrimitive(solidPrimitive: SolidPrimitive): void;\r\n\r\n /** Append any primitive to the builder.\r\n * @param primitive The graphic primitive to append.\r\n */\r\n public addPrimitive(primitive: GraphicPrimitive): void {\r\n switch (primitive.type) {\r\n case \"linestring\":\r\n this.addLineString(primitive.points);\r\n break;\r\n case \"linestring2d\":\r\n this.addLineString2d(primitive.points, primitive.zDepth);\r\n break;\r\n case \"pointstring\":\r\n this.addPointString(primitive.points);\r\n break;\r\n case \"pointstring2d\":\r\n this.addPointString2d(primitive.points, primitive.zDepth);\r\n break;\r\n case \"shape\":\r\n this.addShape(primitive.points);\r\n break;\r\n case \"shape2d\":\r\n this.addShape2d(primitive.points, primitive.zDepth);\r\n break;\r\n case \"arc\":\r\n this.addArc(primitive.arc, true === primitive.isEllipse, true === primitive.filled);\r\n break;\r\n case \"arc2d\":\r\n this.addArc2d(primitive.arc, true === primitive.isEllipse, true === primitive.filled, primitive.zDepth);\r\n break;\r\n case \"path\":\r\n this.addPath(primitive.path);\r\n break;\r\n case \"loop\":\r\n this.addLoop(primitive.loop);\r\n break;\r\n case \"polyface\":\r\n this.addPolyface(primitive.polyface, true === primitive.filled);\r\n break;\r\n case \"solidPrimitive\":\r\n this.addSolidPrimitive(primitive.solidPrimitive);\r\n break;\r\n }\r\n }\r\n\r\n /** Add Range3d edges. Useful for debugging. */\r\n public addRangeBox(range: Range3d) {\r\n this.addFrustum(Frustum.fromRange(range));\r\n }\r\n\r\n /** Add Frustum edges. Useful for debugging. */\r\n public addFrustum(frustum: Frustum) {\r\n this.addRangeBoxFromCorners(frustum.points);\r\n }\r\n\r\n /** Add range edges from corner points */\r\n public addRangeBoxFromCorners(p: Point3d[]) {\r\n this.addLineString([\r\n p[Npc.LeftBottomFront],\r\n p[Npc.LeftTopFront],\r\n p[Npc.RightTopFront],\r\n p[Npc.RightBottomFront],\r\n p[Npc.RightBottomRear],\r\n p[Npc.RightTopRear],\r\n p[Npc.LeftTopRear],\r\n p[Npc.LeftBottomRear],\r\n p[Npc.LeftBottomFront].clone(),\r\n p[Npc.RightBottomFront].clone(),\r\n ]);\r\n\r\n this.addLineString([p[Npc.LeftTopFront].clone(), p[Npc.LeftTopRear].clone()]);\r\n this.addLineString([p[Npc.RightTopFront].clone(), p[Npc.RightTopRear].clone()]);\r\n this.addLineString([p[Npc.LeftBottomRear].clone(), p[Npc.RightBottomRear].clone()]);\r\n }\r\n\r\n /** Sets the current active symbology for this builder. Any new geometry subsequently added will be drawn using the specified symbology.\r\n * @param lineColor The color in which to draw lines.\r\n * @param fillColor The color in which to draw filled regions.\r\n * @param lineWidth The width in pixels to draw lines. The renderer will clamp this value to an integer in the range [1, 32].\r\n * @param linePixels The pixel pattern in which to draw lines.\r\n * @see [[GraphicBuilder.activateGraphicParams]] for additional symbology options.\r\n */\r\n public setSymbology(lineColor: ColorDef, fillColor: ColorDef, lineWidth: number, linePixels = LinePixels.Solid) {\r\n this.activateGraphicParams(GraphicParams.fromSymbology(lineColor, fillColor, lineWidth, linePixels));\r\n }\r\n\r\n /** Set the current active symbology for this builder to be a blanking fill before adding a planar region.\r\n * A planar region drawn with blanking fill renders behind other geometry in the same graphic.\r\n * Blanking fill is not affected by the fill [[ViewFlags]] being disabled.\r\n * An example would be to add a line to a graphic containing a shape with blanking fill so that the line is always shown in front of the fill.\r\n * @param fillColor The color in which to draw filled regions.\r\n */\r\n public setBlankingFill(fillColor: ColorDef) { this.activateGraphicParams(GraphicParams.fromBlankingFill(fillColor)); }\r\n}\r\n"]}
@@ -84,7 +84,7 @@ export interface CreateRenderMaterialArgs {
84
84
  diffuse?: MaterialDiffuseProps;
85
85
  /** The [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of the material. */
86
86
  specular?: MaterialSpecularProps;
87
- /** Maps a [RenderTexture]($common) image to the surfaces to which the material is applied. */
87
+ /** Maps [RenderTexture]($common) images to the surfaces to which the material is applied to customize their appearance. */
88
88
  textureMapping?: MaterialTextureMappingProps;
89
89
  }
90
90
  //# sourceMappingURL=RenderMaterial.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderMaterial.d.ts","sourceRoot":"","sources":["../../../src/render/RenderMaterial.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,EAAE,EAAE,UAAU,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,+GAA+G;IAC/G,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,oDAAoD;IACpD,OAAO,EAAE,aAAa,CAAC;IAEvB,sGAAsG;IACtG,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;IAE3B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;IAEpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gBAAgB;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,MA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;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;IAEpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gBAAgB;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAE9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kGAAkG;IAClG,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAE/B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAEjC,2HAA2H;IAC3H,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderMaterial.js","sourceRoot":"","sources":["../../../src/render/RenderMaterial.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { ColorDef, NormalMapParams, RenderTexture, RgbColorProps, TextureMapping } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\n\r\n/** Specifies the provenance of a [RenderMaterial]($common) created for a persistent material element.\r\n * @see [[CreateRenderMaterialArgs.source]].\r\n * @internal\r\n */\r\nexport interface RenderMaterialSource {\r\n iModel: IModelConnection;\r\n id: Id64String;\r\n}\r\n\r\n/** Describes the [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of a [RenderMaterial]($common).\r\n * @see [[CreateRenderMaterialArgs.diffuse]].\r\n * @public\r\n */\r\nexport interface MaterialDiffuseProps {\r\n /** The diffuse color. If defined, this overrides the color of any surface to which the material is applied. */\r\n color?: ColorDef | RgbColorProps;\r\n\r\n /** A multiplier in [0..1] specifying how strongly the diffuse color reflects light.\r\n * Default: 0.6\r\n */\r\n weight?: number;\r\n}\r\n\r\n/** Describes the [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of a material.\r\n * @see [[CreateRenderMaterialArgs.specular]].\r\n * @public\r\n */\r\nexport interface MaterialSpecularProps {\r\n /** The color of the specular reflections.\r\n * Default: white.\r\n */\r\n color?: ColorDef | RgbColorProps;\r\n\r\n /** A multiplier in [0..1] specifying the strength of the specular reflections.\r\n * Default: 0.4\r\n */\r\n weight?: number;\r\n\r\n /** An exponent in [0..infinity] describing the shininess of the surface.\r\n * Default: 13.5\r\n */\r\n exponent?: number;\r\n}\r\n\r\n/** Describes how to map a [RenderTexture]($common)'s image to the surfaces to which a [RenderMaterial]($common) is applied.\r\n * @see [[CreateRenderMaterialArgs.textureMapping]].\r\n * @public\r\n */\r\nexport interface MaterialTextureMappingProps {\r\n /** The texture from which the image is obtained. */\r\n texture: RenderTexture;\r\n\r\n /** The parameters describing a normal map to use either in place of or in addition to the texture. */\r\n normalMapParams?: NormalMapParams;\r\n\r\n /** The mode controlling how the image is mapped onto the surface.\r\n * Default: [TextureMapping.Mode.Parametric]($common).\r\n */\r\n mode?: TextureMapping.Mode;\r\n\r\n /** A 2x3 matrix for computing the UV coordinates.\r\n * Default: [TextureMapping.Trans2x3.identity]($common).\r\n */\r\n transform?: TextureMapping.Trans2x3;\r\n\r\n /** The ratio by which the color sampled from the texture image is mixed with the surface's or material's diffuse color.\r\n * A ratio of 1 selects only the texture sample; a ratio of 0 selects only the diffuse color; a ratio of 0.5 mixes them evenly.\r\n * Default: 1.\r\n */\r\n weight?: number;\r\n\r\n /** @internal */\r\n worldMapping?: boolean;\r\n}\r\n\r\n/** Arguments supplied to [[RenderSystem.createRenderMaterial]].\r\n * @public\r\n */\r\nexport interface CreateRenderMaterialArgs {\r\n /** If supplied, the material will be cached on the iModel by its element Id for subsequent reuse.\r\n * @internal\r\n */\r\n source?: RenderMaterialSource;\r\n\r\n /** Specifies the transparency of the material from 0.0 (fully transparent) to 1.0 (fully opaque).\r\n * If defined, this overrides the transparency of any surface to which the material is applied, and is multiplied with the\r\n * transparency of the material's [[textureMapping]] when sampling the texture.\r\n */\r\n alpha?: number;\r\n\r\n /** The [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of the material. */\r\n diffuse?: MaterialDiffuseProps;\r\n\r\n /** The [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of the material. */\r\n specular?: MaterialSpecularProps;\r\n\r\n /** Maps a [RenderTexture]($common) image to the surfaces to which the material is applied. */\r\n textureMapping?: MaterialTextureMappingProps;\r\n}\r\n"]}
1
+ {"version":3,"file":"RenderMaterial.js","sourceRoot":"","sources":["../../../src/render/RenderMaterial.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { ColorDef, NormalMapParams, RenderTexture, RgbColorProps, TextureMapping } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\n\r\n/** Specifies the provenance of a [RenderMaterial]($common) created for a persistent material element.\r\n * @see [[CreateRenderMaterialArgs.source]].\r\n * @internal\r\n */\r\nexport interface RenderMaterialSource {\r\n iModel: IModelConnection;\r\n id: Id64String;\r\n}\r\n\r\n/** Describes the [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of a [RenderMaterial]($common).\r\n * @see [[CreateRenderMaterialArgs.diffuse]].\r\n * @public\r\n */\r\nexport interface MaterialDiffuseProps {\r\n /** The diffuse color. If defined, this overrides the color of any surface to which the material is applied. */\r\n color?: ColorDef | RgbColorProps;\r\n\r\n /** A multiplier in [0..1] specifying how strongly the diffuse color reflects light.\r\n * Default: 0.6\r\n */\r\n weight?: number;\r\n}\r\n\r\n/** Describes the [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of a material.\r\n * @see [[CreateRenderMaterialArgs.specular]].\r\n * @public\r\n */\r\nexport interface MaterialSpecularProps {\r\n /** The color of the specular reflections.\r\n * Default: white.\r\n */\r\n color?: ColorDef | RgbColorProps;\r\n\r\n /** A multiplier in [0..1] specifying the strength of the specular reflections.\r\n * Default: 0.4\r\n */\r\n weight?: number;\r\n\r\n /** An exponent in [0..infinity] describing the shininess of the surface.\r\n * Default: 13.5\r\n */\r\n exponent?: number;\r\n}\r\n\r\n/** Describes how to map a [RenderTexture]($common)'s image to the surfaces to which a [RenderMaterial]($common) is applied.\r\n * @see [[CreateRenderMaterialArgs.textureMapping]].\r\n * @public\r\n */\r\nexport interface MaterialTextureMappingProps {\r\n /** The texture from which the image is obtained. */\r\n texture: RenderTexture;\r\n\r\n /** The parameters describing a normal map to use either in place of or in addition to the texture. */\r\n normalMapParams?: NormalMapParams;\r\n\r\n /** The mode controlling how the image is mapped onto the surface.\r\n * Default: [TextureMapping.Mode.Parametric]($common).\r\n */\r\n mode?: TextureMapping.Mode;\r\n\r\n /** A 2x3 matrix for computing the UV coordinates.\r\n * Default: [TextureMapping.Trans2x3.identity]($common).\r\n */\r\n transform?: TextureMapping.Trans2x3;\r\n\r\n /** The ratio by which the color sampled from the texture image is mixed with the surface's or material's diffuse color.\r\n * A ratio of 1 selects only the texture sample; a ratio of 0 selects only the diffuse color; a ratio of 0.5 mixes them evenly.\r\n * Default: 1.\r\n */\r\n weight?: number;\r\n\r\n /** @internal */\r\n worldMapping?: boolean;\r\n}\r\n\r\n/** Arguments supplied to [[RenderSystem.createRenderMaterial]].\r\n * @public\r\n */\r\nexport interface CreateRenderMaterialArgs {\r\n /** If supplied, the material will be cached on the iModel by its element Id for subsequent reuse.\r\n * @internal\r\n */\r\n source?: RenderMaterialSource;\r\n\r\n /** Specifies the transparency of the material from 0.0 (fully transparent) to 1.0 (fully opaque).\r\n * If defined, this overrides the transparency of any surface to which the material is applied, and is multiplied with the\r\n * transparency of the material's [[textureMapping]] when sampling the texture.\r\n */\r\n alpha?: number;\r\n\r\n /** The [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of the material. */\r\n diffuse?: MaterialDiffuseProps;\r\n\r\n /** The [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of the material. */\r\n specular?: MaterialSpecularProps;\r\n\r\n /** Maps [RenderTexture]($common) images to the surfaces to which the material is applied to customize their appearance. */\r\n textureMapping?: MaterialTextureMappingProps;\r\n}\r\n"]}
@@ -251,7 +251,7 @@ export declare abstract class RenderSystem implements IDisposable {
251
251
  * @param _params A description of the material's properties.
252
252
  * @param _imodel The IModelConnection associated with the material.
253
253
  * @returns the newly-created material, or undefined if the material could not be created or if a material with the same key as that specified in the params already exists.
254
- * @deprecated Use [[createRenderMaterial]].
254
+ * @deprecated in 3.x. Use [[createRenderMaterial]].
255
255
  */
256
256
  createMaterial(_params: RenderMaterial.Params, _imodel: IModelConnection): RenderMaterial | undefined;
257
257
  /** Create a [RenderMaterial]($common).
@@ -401,15 +401,15 @@ export declare abstract class RenderSystem implements IDisposable {
401
401
  */
402
402
  getGradientTexture(_symb: Gradient.Symb, _imodel?: IModelConnection): RenderTexture | undefined;
403
403
  /** Create a new texture from an [[ImageBuffer]].
404
- * @deprecated Use [[createTexture]].
404
+ * @deprecated in 3.x. Use [[createTexture]].
405
405
  */
406
406
  createTextureFromImageBuffer(image: ImageBuffer, iModel: IModelConnection, params: RenderTexture.Params): RenderTexture | undefined;
407
407
  /** Create a new texture from an HTML image. Typically the image was extracted from a binary representation of a jpeg or png via [[imageElementFromImageSource]].
408
- * @deprecated Use [[createTexture]].
408
+ * @deprecated in 3.x. Use [[createTexture]].
409
409
  */
410
410
  createTextureFromImage(image: HTMLImageElement, hasAlpha: boolean, iModel: IModelConnection | undefined, params: RenderTexture.Params): RenderTexture | undefined;
411
411
  /** Create a new texture from an ImageSource.
412
- * @deprecated Use RenderSystem.createTextureFromSource.
412
+ * @deprecated in 3.x. Use RenderSystem.createTextureFromSource.
413
413
  */
414
414
  createTextureFromImageSource(source: ImageSource, iModel: IModelConnection | undefined, params: RenderTexture.Params): Promise<RenderTexture | undefined>;
415
415
  /** Create a texture from an ImageSource. */
@@ -138,7 +138,7 @@ class RenderSystem {
138
138
  * @param _params A description of the material's properties.
139
139
  * @param _imodel The IModelConnection associated with the material.
140
140
  * @returns the newly-created material, or undefined if the material could not be created or if a material with the same key as that specified in the params already exists.
141
- * @deprecated Use [[createRenderMaterial]].
141
+ * @deprecated in 3.x. Use [[createRenderMaterial]].
142
142
  */
143
143
  // eslint-disable-next-line deprecation/deprecation
144
144
  createMaterial(_params, _imodel) { return undefined; }
@@ -383,7 +383,7 @@ class RenderSystem {
383
383
  return undefined;
384
384
  }
385
385
  /** Create a new texture from an [[ImageBuffer]].
386
- * @deprecated Use [[createTexture]].
386
+ * @deprecated in 3.x. Use [[createTexture]].
387
387
  */
388
388
  // eslint-disable-next-line deprecation/deprecation
389
389
  createTextureFromImageBuffer(image, iModel, params) {
@@ -398,7 +398,7 @@ class RenderSystem {
398
398
  });
399
399
  }
400
400
  /** Create a new texture from an HTML image. Typically the image was extracted from a binary representation of a jpeg or png via [[imageElementFromImageSource]].
401
- * @deprecated Use [[createTexture]].
401
+ * @deprecated in 3.x. Use [[createTexture]].
402
402
  */
403
403
  // eslint-disable-next-line deprecation/deprecation
404
404
  createTextureFromImage(image, hasAlpha, iModel, params) {
@@ -413,7 +413,7 @@ class RenderSystem {
413
413
  });
414
414
  }
415
415
  /** Create a new texture from an ImageSource.
416
- * @deprecated Use RenderSystem.createTextureFromSource.
416
+ * @deprecated in 3.x. Use RenderSystem.createTextureFromSource.
417
417
  */
418
418
  // eslint-disable-next-line deprecation/deprecation
419
419
  async createTextureFromImageSource(source, iModel, params) {
@@ -1 +1 @@
1
- {"version":3,"file":"RenderSystem.js","sourceRoot":"","sources":["../../../src/render/RenderSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAwF;AACxF,oDAG4B;AAC5B,wDAA4H;AAE5H,4CAA2D;AAC3D,4CAAyC;AAGzC,kDAA+C;AAI/C,mDAAsE;AAOtE,sEAAmE;AACnE,gEAA6D;AAC7D,0DAAsD;AAEtD,mDAAoE;AAQpE,yCAAyC;AACzC,0EAA0E;AAE1E;;GAEG;AACH,MAAsB,kBAAkB;CAMvC;AAND,gDAMC;AAmBD,gBAAgB;AAChB,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,8BAA8B;IAC9B,yDAAQ,CAAA;IACR,mDAAmD;IACnD,uEAAoB,CAAA;IACpB,2DAA2D;IAC3D,2DAAc,CAAA;IACd,+BAA+B;IAC/B,uDAAyB,CAAA;AAC3B,CAAC,EATW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAS5B;AAiBD,oDAAoD;AACpD,MAAM,YAAa,SAAQ,kCAAkB;IAC3C,YAAoC,QAAuB;QAAI,KAAK,EAAE,CAAC;QAAnC,aAAQ,GAAR,QAAQ,CAAe;IAAa,CAAC;IACzE,IAAW,OAAO,KAAoB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC9D;AAsCD,gBAAgB;AAChB,MAAsB,qBAAqB;CAI1C;AAJD,sDAIC;AAED,gBAAgB;AAChB,MAAa,cAAc;IACzB,YACkB,OAAsB,EAC/B,SAAiB,EACR,KAAe,EACf,SAAmB,EACnB,eAAwB,EACxB,UAAkB,EAC3B,YAAoB,EACX,aAAuB;QAPvB,YAAO,GAAP,OAAO,CAAe;QAC/B,cAAS,GAAT,SAAS,CAAQ;QACR,UAAK,GAAL,KAAK,CAAU;QACf,cAAS,GAAT,SAAS,CAAU;QACnB,oBAAe,GAAf,eAAe,CAAS;QACxB,eAAU,GA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AAuB,EAAE,KAAuB,EAAE,KAAuB,EAAE,OAAyB,EAAE,OAA6B;QAC/O,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,gBAAgB;IACT,aAAa,KAAW,CAAC;IAEhC,gBAAgB;IACT,iBAAiB,CAAC,OAA0B,IAAU,CAAC;IAE9D,gBAAgB;IAChB,IAAW,kBAAkB,KAAc,OAAO,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAElG;;OAEG;IACH,IAAW,YAAY,KAA2C,OAAO,SAAS,CAAC,CAAC,CAAC;IAErF,gBAAgB;IACT,iBAAiB,CAAC,MAA+B,IAAU,CAAC;IAEnE;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,KAAK,CAAC,kBAAkB;QACpC,MAAM,GAAG,GAAG,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC;QAC1F,OAAO,qBAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAlfD,oCAkfC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { base64StringToUint8Array, Id64String, IDisposable } from \"@itwin/core-bentley\";\r\nimport {\r\n ColorDef, ColorIndex, ElementAlignedBox3d, FeatureIndex, FeatureIndexType, FillFlags, Frustum, Gradient, ImageBuffer, ImageBufferFormat, ImageSource, ImageSourceFormat,\r\n isValidImageSourceFormat, PackedFeatureTable, QParams3d, QPoint3dList, RenderMaterial, RenderTexture, SkyGradient, TextureProps, TextureTransparency,\r\n} from \"@itwin/core-common\";\r\nimport { ClipVector, Matrix3d, Point2d, Point3d, Range2d, Range3d, Transform, Vector2d, XAndY } from \"@itwin/core-geometry\";\r\nimport { WebGLExtensionName } from \"@itwin/webgl-compatibility\";\r\nimport { imageElementFromImageSource } from \"../ImageUtil\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { MapTileTreeReference, TileTreeReference } from \"../tile/internal\";\r\nimport { ToolAdmin } from \"../tools/ToolAdmin\";\r\nimport { SceneContext } from \"../ViewContext\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ViewRect } from \"../ViewRect\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./GraphicBranch\";\r\nimport { BatchOptions, CustomGraphicBuilderOptions, GraphicBuilder, GraphicType, ViewportGraphicBuilderOptions } from \"./GraphicBuilder\";\r\nimport { InstancedGraphicParams, PatternGraphicParams } from \"./InstancedGraphicParams\";\r\nimport { MeshArgs, PolylineArgs } from \"./primitives/mesh/MeshPrimitives\";\r\nimport { RealityMeshGraphicParams } from \"./RealityMeshGraphicParams\";\r\nimport { RealityMeshParams } from \"./RealityMeshParams\";\r\nimport { PointCloudArgs } from \"./primitives/PointCloudPrimitive\";\r\nimport { PointStringParams } from \"./primitives/PointStringParams\";\r\nimport { PolylineParams } from \"./primitives/PolylineParams\";\r\nimport { MeshParams } from \"./primitives/VertexTable\";\r\nimport { RenderClipVolume } from \"./RenderClipVolume\";\r\nimport { RenderGraphic, RenderGraphicOwner } from \"./RenderGraphic\";\r\nimport { CreateRenderMaterialArgs } from \"./RenderMaterial\";\r\nimport { RenderMemory } from \"./RenderMemory\";\r\nimport { RenderPlanarClassifier } from \"./RenderPlanarClassifier\";\r\nimport { RenderTarget } from \"./RenderTarget\";\r\nimport { CreateTextureArgs, CreateTextureFromSourceArgs, TextureCacheKey } from \"./RenderTexture\";\r\nimport { ScreenSpaceEffectBuilder, ScreenSpaceEffectBuilderParams } from \"./ScreenSpaceEffectBuilder\";\r\n\r\n/* eslint-disable no-restricted-syntax */\r\n// cSpell:ignore deserializing subcat uninstanced wiremesh qorigin trimesh\r\n\r\n/** An opaque representation of a texture draped on geometry within a [[Viewport]].\r\n * @internal\r\n */\r\nexport abstract class RenderTextureDrape implements IDisposable {\r\n public abstract dispose(): void;\r\n\r\n /** @internal */\r\n public abstract collectStatistics(stats: RenderMemory.Statistics): void;\r\n public abstract collectGraphics(context: SceneContext): void;\r\n}\r\n\r\n/** @internal */\r\nexport type TextureDrapeMap = Map<Id64String, RenderTextureDrape>;\r\n\r\n/** @internal */\r\nexport type MapLayerClassifiers = Map<number, RenderPlanarClassifier>;\r\n\r\n/** Describes a texture loaded from an HTMLImageElement\r\n * ###TODO Replace with TextureImage from RenderTexture.ts after we start returning transparency info from the backend.\r\n * @internal\r\n */\r\nexport interface OldTextureImage {\r\n /** The HTMLImageElement containing the texture's image data */\r\n image: HTMLImageElement;\r\n /** The format of the texture's image data */\r\n format: ImageSourceFormat;\r\n}\r\n\r\n/** @internal */\r\nexport enum RenderDiagnostics {\r\n /** No diagnostics enabled. */\r\n None = 0,\r\n /** Debugging output to browser console enabled. */\r\n DebugOutput = 1 << 1,\r\n /** Potentially expensive checks of WebGL state enabled. */\r\n WebGL = 1 << 2,\r\n /** All diagnostics enabled. */\r\n All = DebugOutput | WebGL,\r\n}\r\n\r\n/** @internal */\r\nexport interface GLTimerResult {\r\n /** Label from GLTimer.beginOperation */\r\n label: string;\r\n /** Time elapsed in nanoseconds, inclusive of child result times.\r\n * @note no-op queries seem to have 32ns of noise.\r\n */\r\n nanoseconds: number;\r\n /** Child results if GLTimer.beginOperation calls were nested */\r\n children?: GLTimerResult[];\r\n}\r\n\r\n/** @internal */\r\nexport type GLTimerResultCallback = (result: GLTimerResult) => void;\r\n\r\n/** Default implementation of RenderGraphicOwner. */\r\nclass GraphicOwner extends RenderGraphicOwner {\r\n public constructor(private readonly _graphic: RenderGraphic) { super(); }\r\n public get graphic(): RenderGraphic { return this._graphic; }\r\n}\r\n\r\n/** An interface optionally exposed by a RenderSystem that allows control of various debugging features.\r\n * @beta\r\n */\r\nexport interface RenderSystemDebugControl {\r\n /** Destroy this system's webgl context. Returns false if this behavior is not supported. */\r\n loseContext(): boolean;\r\n\r\n /** Overrides [[RenderSystem.dpiAwareLOD]].\r\n * @internal\r\n */\r\n dpiAwareLOD: boolean;\r\n\r\n /** Record GPU profiling information for each frame drawn. Check isGLTimerSupported before using.\r\n * @internal\r\n */\r\n resultsCallback?: GLTimerResultCallback;\r\n\r\n /** Returns true if the browser supports GPU profiling queries.\r\n * @internal\r\n */\r\n readonly isGLTimerSupported: boolean;\r\n\r\n /** Attempts to compile all shader programs and returns true if all were successful. May throw exceptions on errors.\r\n * This is useful for debugging shader compilation on specific platforms - especially those which use neither ANGLE nor SwiftShader (e.g., linux, mac, iOS)\r\n * because our unit tests which also compile all shaders run in software mode and therefore may not catch some \"errors\" (especially uniforms that have no effect on\r\n * program output).\r\n * @internal\r\n */\r\n compileAllShaders(): boolean;\r\n\r\n /** Obtain accumulated debug info collected during shader compilation. See `RenderSystem.Options.debugShaders`.\r\n * @internal\r\n */\r\n debugShaderFiles?: DebugShaderFile[];\r\n}\r\n\r\n/** @internal */\r\nexport abstract class RenderTerrainGeometry implements IDisposable, RenderMemory.Consumer {\r\n public abstract dispose(): void;\r\n public abstract get transform(): Transform | undefined;\r\n public abstract collectStatistics(stats: RenderMemory.Statistics): void;\r\n}\r\n\r\n/** @internal */\r\nexport class TerrainTexture {\r\n public constructor(\r\n public readonly texture: RenderTexture,\r\n public featureId: number,\r\n public readonly scale: Vector2d,\r\n public readonly translate: Vector2d,\r\n public readonly targetRectangle: Range2d,\r\n public readonly layerIndex: number,\r\n public transparency: number,\r\n public readonly clipRectangle?: Range2d\r\n ) { }\r\n\r\n public cloneWithClip(clipRectangle: Range2d) {\r\n return new TerrainTexture (this.texture, this.featureId, this.scale, this.translate, this.targetRectangle, this.layerIndex, this.transparency, clipRectangle);\r\n }\r\n}\r\n/** @internal */\r\nexport class DebugShaderFile {\r\n public constructor(\r\n public readonly filename: string,\r\n public readonly src: string,\r\n public isVS: boolean,\r\n public isGL: boolean,\r\n public isUsed: boolean\r\n ) { }\r\n}\r\n/** Transparency settings for planar grid display.\r\n * @alpha\r\n */\r\nexport class PlanarGridTransparency {\r\n /** Transparency for the grid plane. This should generally be fairly high to avoid obscuring other geometry */\r\n public readonly planeTransparency = .9;\r\n /** Transparency of the grid lines. This should be higher than the plane, but less than reference line transparency */\r\n public readonly lineTransparency = .75;\r\n /** Transparency of the reference lines. This should be less than plane or line transparency so that reference lines are more prominent */\r\n public readonly refTransparency = .5;\r\n}\r\n\r\n/** Settings for planar grid display.\r\n * @alpha\r\n */\r\nexport interface PlanarGridProps {\r\n /** The grid origin */\r\n origin: Point3d;\r\n /** The grid orientation. The grid X and Y direction are the first and second matrix rows */\r\n rMatrix: Matrix3d;\r\n /** The spacing between grid liens in the X and Y direction */\r\n spacing: XAndY;\r\n /** Grid lines per reference. If zero no reference lines are displayed. */\r\n gridsPerRef: number;\r\n /** Grid color. [[Use Viewport.getContrastToBackgroundColor]] to get best constrast color based on current background. */\r\n color: ColorDef;\r\n /** Transparency settings. If omitted then the [[PlanarGridTransparency]] defaults are used. */\r\n transparency?: PlanarGridTransparency;\r\n}\r\n\r\n/** An opaque representation of geometry allocated by a [[RenderSystem]] to be supplied to [[RenderSystem.createRenderGraphic]].\r\n * @internal\r\n */\r\nexport type RenderGeometry = IDisposable & RenderMemory.Consumer;\r\n\r\n/** An opaque representation of instructions for repeatedly drawing a [[RenderGeometry]] to pattern a planar region, to be supplied to [[RenderSystem.createRenderGraphic]].\r\n * @internal\r\n */\r\nexport type RenderAreaPattern = IDisposable & RenderMemory.Consumer;\r\n\r\n/** @internal */\r\nexport interface RenderSkyGradientParams {\r\n type: \"gradient\";\r\n gradient: SkyGradient;\r\n zOffset: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface RenderSkySphereParams {\r\n type: \"sphere\";\r\n texture: RenderTexture;\r\n rotation: number;\r\n zOffset: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface RenderSkyCubeParams {\r\n type: \"cube\";\r\n texture: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport type RenderSkyBoxParams = RenderSkyGradientParams | RenderSkySphereParams | RenderSkyCubeParams;\r\n\r\n/** A RenderSystem provides access to resources used by the internal WebGL-based rendering system.\r\n * An application rarely interacts directly with the RenderSystem; instead it interacts with types like [[Viewport]] which\r\n * coordinate with the RenderSystem on the application's behalf.\r\n * @see [Display system overview]($docs/learning/display/index.md)\r\n * @see [[IModelApp.renderSystem]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class RenderSystem implements IDisposable {\r\n /** Options used to initialize the RenderSystem. These are primarily used for feature-gating.\r\n * This object is frozen and cannot be modified after the RenderSystem is created.\r\n * @internal\r\n */\r\n public readonly options: RenderSystem.Options;\r\n\r\n /** Antialias samples to use on all subsequently created render targets.\r\n * Default value: undefined (no antialiasing)\r\n * @beta\r\n */\r\n public antialiasSamples?: number;\r\n\r\n /** Initialize the RenderSystem with the specified options.\r\n * @note The RenderSystem takes ownership of the supplied Options and freezes it.\r\n * @internal\r\n */\r\n protected constructor(options?: RenderSystem.Options) {\r\n this.options = undefined !== options ? options : {};\r\n Object.freeze(this.options);\r\n if (undefined !== this.options.disabledExtensions)\r\n Object.freeze(this.options.disabledExtensions);\r\n }\r\n\r\n /** @internal */\r\n public abstract get isValid(): boolean;\r\n\r\n /** @internal */\r\n public abstract dispose(): void;\r\n\r\n /** @internal */\r\n public get maxTextureSize(): number { return 0; }\r\n\r\n /** @internal */\r\n public get supportsInstancing(): boolean { return true; }\r\n\r\n /** @internal */\r\n public get supportsCreateImageBitmap(): boolean { return false; }\r\n\r\n /** @internal */\r\n public get supportsIndexedEdges(): boolean { return true; }\r\n\r\n /** @internal */\r\n public get supportsNonuniformScaledInstancing(): boolean { return true; }\r\n\r\n /** @internal */\r\n public get dpiAwareLOD(): boolean { return true === this.options.dpiAwareLOD; }\r\n\r\n /** @internal */\r\n public get isMobile(): boolean { return false; }\r\n\r\n /** @internal */\r\n public abstract createTarget(canvas: HTMLCanvasElement): RenderTarget;\r\n /** @internal */\r\n public abstract createOffscreenTarget(rect: ViewRect): RenderTarget;\r\n\r\n /** Perform a small unit of idle work and return true if more idle work remains to be done. This function is invoked on each tick of the javascript event loop as long as no viewports are registered with the ViewManager, until it returns false to indicate all idle work has been completed.\r\n * @internal\r\n */\r\n public abstract doIdleWork(): boolean;\r\n\r\n /** Find a previously-created [RenderMaterial]($common) by its ID.\r\n * @param _key The unique ID of the material within the context of the IModelConnection. Typically an element ID.\r\n * @param _imodel The IModelConnection with which the material is associated.\r\n * @returns A previously-created material matching the specified ID, or undefined if no such material exists.\r\n */\r\n public findMaterial(_key: string, _imodel: IModelConnection): RenderMaterial | undefined { return undefined; }\r\n\r\n /** Create a [RenderMaterial]($common) from parameters\r\n * If the parameters include a non-empty key, and no previously-created material already exists with that key, the newly-created material will be cached on the IModelConnection such\r\n * that it can later be retrieved by the same key using [[RenderSystem.findMaterial]].\r\n * @param _params A description of the material's properties.\r\n * @param _imodel The IModelConnection associated with the material.\r\n * @returns the newly-created material, or undefined if the material could not be created or if a material with the same key as that specified in the params already exists.\r\n * @deprecated Use [[createRenderMaterial]].\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createMaterial(_params: RenderMaterial.Params, _imodel: IModelConnection): RenderMaterial | undefined { return undefined; }\r\n\r\n /** Create a [RenderMaterial]($common).\r\n * @see [[CreateRenderMaterialArgs]] for a description of the material parameters.\r\n */\r\n public createRenderMaterial(_args: CreateRenderMaterialArgs): RenderMaterial | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Creates a [[GraphicBuilder]] for creating a [[RenderGraphic]].\r\n * @param placement The local-to-world transform in which the builder's geometry is to be defined.\r\n * @param type The type of builder to create.\r\n * @param viewport The viewport in which the resultant [[RenderGraphic]] will be rendered.\r\n * @param pickableId If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within the specified viewport.\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[RenderContext.createGraphicBuilder]].\r\n * @see [[Decorator]]\r\n */\r\n public createGraphicBuilder(placement: Transform, type: GraphicType, viewport: Viewport, pickableId?: Id64String): GraphicBuilder {\r\n const pickable = undefined !== pickableId ? { id: pickableId } : undefined;\r\n return this.createGraphic({ type, viewport, placement, pickable });\r\n }\r\n\r\n /** Obtain a [[GraphicBuilder]] from which to produce a [[RenderGraphic]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public abstract createGraphic(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions): GraphicBuilder;\r\n\r\n /** Obtain an object capable of producing a custom screen-space effect to be applied to the image rendered by a [[Viewport]].\r\n * @returns undefined if screen-space effects are not supported by this RenderSystem.\r\n */\r\n public createScreenSpaceEffectBuilder(_params: ScreenSpaceEffectBuilderParams): ScreenSpaceEffectBuilder | undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public createTriMesh(args: MeshArgs, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n const params = MeshParams.create(args);\r\n return this.createMesh(params, instances);\r\n }\r\n\r\n /** @internal */\r\n public createIndexedPolylines(args: PolylineArgs, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n if (args.flags.isDisjoint) {\r\n const pointStringParams = PointStringParams.create(args);\r\n return undefined !== pointStringParams ? this.createPointString(pointStringParams, instances) : undefined;\r\n } else {\r\n const polylineParams = PolylineParams.create(args);\r\n return undefined !== polylineParams ? this.createPolyline(polylineParams, instances) : undefined;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public createMeshGeometry(_params: MeshParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined { return undefined; }\r\n /** @internal */\r\n public createPolylineGeometry(_params: PolylineParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined { return undefined; }\r\n /** @internal */\r\n public createPointStringGeometry(_params: PointStringParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined { return undefined; }\r\n\r\n /** @internal */\r\n public createAreaPattern(_params: PatternGraphicParams): RenderAreaPattern | undefined { return undefined; }\r\n\r\n /** Create a RenderGraphic from a RenderGeometry produced by this RenderSystem.\r\n * @internal\r\n */\r\n public abstract createRenderGraphic(_geometry: RenderGeometry, instances?: InstancedGraphicParams | RenderAreaPattern): RenderGraphic | undefined;\r\n\r\n private createGraphicFromGeometry(\r\n createGeometry: (viewIndependentOrigin?: Point3d) => RenderGeometry | undefined,\r\n instancesOrOrigin?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n let viOrigin;\r\n let instances;\r\n if (instancesOrOrigin instanceof Point3d)\r\n viOrigin = instancesOrOrigin;\r\n else\r\n instances = instancesOrOrigin;\r\n\r\n const geom = createGeometry(viOrigin);\r\n return geom ? this.createRenderGraphic(geom, instances) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public createMesh(params: MeshParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n return this.createGraphicFromGeometry((viOrigin) => this.createMeshGeometry(params, viOrigin), instances);\r\n }\r\n\r\n /** @internal */\r\n public createPolyline(params: PolylineParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n return this.createGraphicFromGeometry((origin) => this.createPolylineGeometry(params, origin), instances);\r\n }\r\n\r\n /** @internal */\r\n public createPointString(params: PointStringParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n return this.createGraphicFromGeometry((origin) => this.createPointStringGeometry(params, origin), instances);\r\n }\r\n\r\n /** @internal */\r\n public createTerrainMesh(_params: RealityMeshParams, _transform?: Transform, _disableTextureDisposal = false): RenderTerrainGeometry | undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public createRealityMeshGraphic(_params: RealityMeshGraphicParams, _disableTextureDisposal = false): RenderGraphic | undefined { return undefined; }\r\n /** @internal */\r\n public createRealityMesh(_realityMesh: RealityMeshParams, _disableTextureDisposal = false): RenderGraphic | undefined { return undefined; }\r\n /** @internal */\r\n public get maxRealityImageryLayers() { return 0; }\r\n /** @internal */\r\n public createPointCloud(_args: PointCloudArgs, _imodel: IModelConnection): RenderGraphic | undefined { return undefined; }\r\n\r\n /** Create a clip volume to clip geometry.\r\n * @note The clip volume takes ownership of the ClipVector, which must not be subsequently mutated.\r\n * @param _clipVector Defines how the volume clips geometry.\r\n * @returns A clip volume, or undefined if, e.g., the clip vector does not clip anything.\r\n */\r\n public createClipVolume(_clipVector: ClipVector): RenderClipVolume | undefined { return undefined; }\r\n\r\n /** @internal */\r\n public createPlanarGrid(_frustum: Frustum, _grid: PlanarGridProps): RenderGraphic | undefined { return undefined; }\r\n /** @internal */\r\n public createBackgroundMapDrape(_drapedTree: TileTreeReference, _mapTree: MapTileTreeReference): RenderTextureDrape | undefined { return undefined; }\r\n /** @internal */\r\n public createTile(tileTexture: RenderTexture, corners: Point3d[], featureIndex?: number): RenderGraphic | undefined {\r\n // corners\r\n // [0] [1]\r\n // [2] [3]\r\n // Quantize the points according to their range\r\n const points = new QPoint3dList(QParams3d.fromRange(Range3d.create(...corners)));\r\n for (let i = 0; i < 4; i++)\r\n points.add(corners[i]);\r\n\r\n // Now remove the translation from the quantized points and put it into a transform instead.\r\n // This prevents graphical artifacts when quantization origin is large relative to quantization scale.\r\n // ###TODO: Would be better not to create a branch for every tile.\r\n const qorigin = points.params.origin;\r\n const transform = Transform.createTranslationXYZ(qorigin.x, qorigin.y, qorigin.z);\r\n qorigin.setZero();\r\n\r\n const features = new FeatureIndex();\r\n if (undefined !== featureIndex) {\r\n features.featureID = featureIndex;\r\n features.type = FeatureIndexType.Uniform;\r\n }\r\n\r\n const rasterTile: MeshArgs = {\r\n points,\r\n vertIndices: [0, 1, 2, 2, 1, 3],\r\n isPlanar: true,\r\n features,\r\n colors: new ColorIndex(),\r\n fillFlags: FillFlags.None,\r\n textureMapping: {\r\n uvParams: [new Point2d(0, 0), new Point2d(1, 0), new Point2d(0, 1), new Point2d(1, 1)],\r\n texture: tileTexture,\r\n },\r\n };\r\n\r\n const trimesh = this.createTriMesh(rasterTile);\r\n if (undefined === trimesh)\r\n return undefined;\r\n\r\n const branch = new GraphicBranch(true);\r\n branch.add(trimesh);\r\n return this.createBranch(branch, transform);\r\n }\r\n\r\n /** Create a Graphic for a [[SkyBox]] which encompasses the entire scene, rotating with the camera.\r\n * @internal\r\n */\r\n public createSkyBox(_params: RenderSkyBoxParams): RenderGraphic | undefined { return undefined; }\r\n\r\n /** Create a RenderGraphic consisting of a list of Graphics to be drawn together. */\r\n public abstract createGraphicList(primitives: RenderGraphic[]): RenderGraphic;\r\n\r\n /** Create a RenderGraphic consisting of a list of Graphics, with optional transform and symbology overrides applied to the list */\r\n public createBranch(branch: GraphicBranch, transform: Transform): RenderGraphic {\r\n return this.createGraphicBranch(branch, transform);\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public abstract createGraphicBranch(branch: GraphicBranch, transform: Transform, options?: GraphicBranchOptions): RenderGraphic;\r\n\r\n /** Create a node in the scene graph corresponding to a transform node in the scene's schedule script.\r\n * Nodes under this branch will only be drawn if they belong to the specified transform node.\r\n * This allows the graphics in a single Tile to be efficiently drawn with different transforms applied by different nodes.\r\n * The node Id is either the Id of a single transform node in the script, of 0xffffffff to indicate all nodes that have no transform applied to them.\r\n * @internal\r\n */\r\n public createAnimationTransformNode(graphic: RenderGraphic, _nodeId: number): RenderGraphic {\r\n return graphic;\r\n }\r\n\r\n /** Create a RenderGraphic consisting of batched [[Feature]]s.\r\n * @internal\r\n */\r\n public abstract createBatch(graphic: RenderGraphic, features: PackedFeatureTable, range: ElementAlignedBox3d, options?: BatchOptions): RenderGraphic;\r\n\r\n /** Return a Promise which when resolved indicates that all pending external textures have finished loading from the backend. */\r\n public async waitForAllExternalTextures(): Promise<void> { return Promise.resolve(); }\r\n /** @internal */\r\n public get hasExternalTextureRequests(): boolean { return false; }\r\n\r\n /** Create a graphic that assumes ownership of another graphic.\r\n * @param ownedGraphic The RenderGraphic to be owned.\r\n * @returns The owning graphic that exposes a `disposeGraphic` method for explicitly disposing of the owned graphic.\r\n * @see [[RenderGraphicOwner]] for details regarding ownership semantics.\r\n * @public\r\n */\r\n public createGraphicOwner(ownedGraphic: RenderGraphic): RenderGraphicOwner { return new GraphicOwner(ownedGraphic); }\r\n\r\n /** Create a \"layer\" containing the graphics belonging to it. A layer has a unique identifier and all of its geometry lies in an XY plane.\r\n * Different layers can be drawn coincident with one another; their draw order can be controlled by a per-layer priority value so that one layer draws\r\n * on top of another. Layers cannot nest inside other layers. Multiple GraphicLayers can exist with the same ID; they are treated as belonging to the same layer.\r\n * A GraphicLayer must be contained (perhaps indirectly) inside a GraphicLayerContainer.\r\n * @see [[createGraphicLayerContainer]]\r\n * @internal\r\n */\r\n public createGraphicLayer(graphic: RenderGraphic, _layerId: string): RenderGraphic { return graphic; }\r\n\r\n /** Create a graphic that can contain [[GraphicLayer]]s.\r\n * @internal\r\n */\r\n public createGraphicLayerContainer(graphic: RenderGraphic, _drawAsOverlay: boolean, _transparency: number, _elevation: number): RenderGraphic { return graphic; }\r\n\r\n /** Find a previously-created [[RenderTexture]] by its key.\r\n * @param _key The unique key of the texture within the context of the IModelConnection. Typically an element Id.\r\n * @param _imodel The IModelConnection with which the texture is associated.\r\n * @returns A previously-created texture matching the specified key, or undefined if no such texture exists.\r\n */\r\n public findTexture(_key: TextureCacheKey, _imodel: IModelConnection): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Find or create a [[RenderTexture]] from a persistent texture element.\r\n * @param id The ID of the texture element.\r\n * @param iModel The IModel containing the texture element.\r\n * @returns A Promise resolving to the created RenderTexture or to undefined if the texture could not be created.\r\n * @note If the texture is successfully created, it will be cached on the IModelConnection such that it can later be retrieved by its ID using [[RenderSystem.findTexture]].\r\n * @see [[RenderSystem.loadTextureImage]].\r\n * @internal\r\n */\r\n public async loadTexture(id: Id64String, iModel: IModelConnection): Promise<RenderTexture | undefined> {\r\n let texture = this.findTexture(id.toString(), iModel);\r\n if (undefined === texture) {\r\n const image = await this.loadTextureImage(id, iModel);\r\n if (undefined !== image) {\r\n // This will return a pre-existing RenderTexture if somebody else loaded it while we were awaiting the image.\r\n texture = this.createTexture({\r\n type: RenderTexture.Type.Normal,\r\n ownership: { key: id, iModel },\r\n image: {\r\n source: image.image,\r\n transparency: ImageSourceFormat.Png === image.format ? TextureTransparency.Mixed : TextureTransparency.Opaque,\r\n },\r\n });\r\n }\r\n }\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Load a texture image given the ID of a texture element.\r\n * @param id The ID of the texture element.\r\n * @param iModel The IModel containing the texture element.\r\n * @returns A Promise resolving to a TextureImage created from the texture element's data, or to undefined if the TextureImage could not be created.\r\n * @see [[RenderSystem.loadTexture]]\r\n * @internal\r\n */\r\n public async loadTextureImage(id: Id64String, iModel: IModelConnection): Promise<OldTextureImage | undefined> {\r\n const elemProps = await iModel.elements.getProps(id);\r\n if (1 !== elemProps.length)\r\n return undefined;\r\n\r\n const textureProps = elemProps[0] as TextureProps;\r\n if (undefined === textureProps.data || \"string\" !== typeof (textureProps.data) || undefined === textureProps.format || \"number\" !== typeof (textureProps.format))\r\n return undefined;\r\n\r\n const format = textureProps.format;\r\n if (!isValidImageSourceFormat(format))\r\n return undefined;\r\n\r\n const imageSource = new ImageSource(base64StringToUint8Array(textureProps.data), format);\r\n const image = await imageElementFromImageSource(imageSource);\r\n return { image, format };\r\n }\r\n\r\n /** Obtain a texture created from a gradient.\r\n * @param _symb The description of the gradient.\r\n * @param _imodel The IModelConnection with which the texture is associated.\r\n * @returns A texture created from the gradient image, or undefined if the texture could not be created.\r\n * @note If a texture matching the specified gradient is already cached on the iModel, it will be returned.\r\n * Otherwise, if an iModel is supplied, the newly-created texture will be cached on the iModel such that subsequent calls with an equivalent gradient and the\r\n * same iModel will return the cached texture instead of creating a new one.\r\n */\r\n public getGradientTexture(_symb: Gradient.Symb, _imodel?: IModelConnection): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Create a new texture from an [[ImageBuffer]].\r\n * @deprecated Use [[createTexture]].\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromImageBuffer(image: ImageBuffer, iModel: IModelConnection, params: RenderTexture.Params): RenderTexture | undefined {\r\n const ownership = params.key ? { key: params.key, iModel } : (params.isOwned ? \"external\" : undefined);\r\n return this.createTexture({\r\n type: params.type,\r\n ownership,\r\n image: {\r\n source: image,\r\n transparency: ImageBufferFormat.Rgba === image.format ? TextureTransparency.Mixed : TextureTransparency.Opaque,\r\n },\r\n });\r\n }\r\n\r\n /** Create a new texture from an HTML image. Typically the image was extracted from a binary representation of a jpeg or png via [[imageElementFromImageSource]].\r\n * @deprecated Use [[createTexture]].\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromImage(image: HTMLImageElement, hasAlpha: boolean, iModel: IModelConnection | undefined, params: RenderTexture.Params): RenderTexture | undefined {\r\n const ownership = params.key && iModel ? { key: params.key, iModel } : (params.isOwned ? \"external\" : undefined);\r\n return this.createTexture({\r\n type: params.type,\r\n ownership,\r\n image: {\r\n source: image,\r\n transparency: hasAlpha ? TextureTransparency.Mixed : TextureTransparency.Opaque,\r\n },\r\n });\r\n }\r\n\r\n /** Create a new texture from an ImageSource.\r\n * @deprecated Use RenderSystem.createTextureFromSource.\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public async createTextureFromImageSource(source: ImageSource, iModel: IModelConnection | undefined, params: RenderTexture.Params): Promise<RenderTexture | undefined> {\r\n const ownership = iModel && params.key ? { iModel, key: params.key } : (params.isOwned ? \"external\" : undefined);\r\n return this.createTextureFromSource({\r\n type: params.type,\r\n source,\r\n ownership,\r\n transparency: source.format === ImageSourceFormat.Jpeg ? TextureTransparency.Opaque : TextureTransparency.Mixed,\r\n });\r\n }\r\n\r\n /** Create a texture from an ImageSource. */\r\n public async createTextureFromSource(args: CreateTextureFromSourceArgs): Promise<RenderTexture | undefined> {\r\n try {\r\n // JPEGs don't support transparency.\r\n const transparency = ImageSourceFormat.Jpeg === args.source.format ? TextureTransparency.Opaque : (args.transparency ?? TextureTransparency.Mixed);\r\n const image = await imageElementFromImageSource(args.source);\r\n if (!IModelApp.hasRenderSystem)\r\n return undefined;\r\n\r\n return this.createTexture({\r\n type: args.type,\r\n ownership: args.ownership,\r\n image: {\r\n source: image,\r\n transparency,\r\n },\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n\r\n /** Create a new texture by its element ID. This texture will be retrieved asynchronously from the backend. A placeholder image will be associated with the texture until the requested image data loads. */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromElement(_id: Id64String, _imodel: IModelConnection, _params: RenderTexture.Params, _format: ImageSourceFormat): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n public createTexture(_args: CreateTextureArgs): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Create a new texture from a cube of HTML images.\r\n * @internal\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromCubeImages(_posX: HTMLImageElement, _negX: HTMLImageElement, _posY: HTMLImageElement, _negY: HTMLImageElement, _posZ: HTMLImageElement, _negZ: HTMLImageElement, _imodel: IModelConnection, _params: RenderTexture.Params): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public onInitialized(): void { }\r\n\r\n /** @internal */\r\n public enableDiagnostics(_enable: RenderDiagnostics): void { }\r\n\r\n /** @internal */\r\n public get supportsLogZBuffer(): boolean { return false !== this.options.logarithmicDepthBuffer; }\r\n\r\n /** Obtain an object that can be used to control various debugging features. Returns `undefined` if debugging features are unavailable for this `RenderSystem`.\r\n * @beta\r\n */\r\n public get debugControl(): RenderSystemDebugControl | undefined { return undefined; }\r\n\r\n /** @internal */\r\n public collectStatistics(_stats: RenderMemory.Statistics): void { }\r\n\r\n /** A function that is invoked after the WebGL context is lost. Context loss is almost always caused by excessive consumption of GPU memory.\r\n * After context loss occurs, the RenderSystem will be unable to interact with WebGL by rendering viewports, creating graphics and textures, etc.\r\n * By default, this function invokes [[ToolAdmin.exceptionHandler]] with a brief message describing what occurred.\r\n * An application can override this behavior as follows:\r\n * ```ts\r\n * RenderSystem.contextLossHandler = (): Promise<any> => {\r\n * // your implementation here.\r\n * }\r\n * ```\r\n * @note Context loss is reported by the browser some short time *after* it has occurred. It is not possible to determine the specific cause.\r\n * @see [[TileAdmin.gpuMemoryLimit]] to limit the amount of GPU memory consumed thereby reducing the likelihood of context loss.\r\n * @see [[TileAdmin.totalTileContentBytes]] for the amount of GPU memory allocated for tile graphics.\r\n */\r\n public static async contextLossHandler(): Promise<any> {\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:Errors.WebGLContextLost\");\r\n return ToolAdmin.exceptionHandler(msg);\r\n }\r\n}\r\n\r\n/** A RenderSystem provides access to resources used by the internal WebGL-based rendering system.\r\n * An application rarely interacts directly with the RenderSystem; instead it interacts with types like [[Viewport]] which\r\n * coordinate with the RenderSystem on the application's behalf.\r\n * @see [[IModelApp.renderSystem]].\r\n * @public\r\n */\r\nexport namespace RenderSystem { // eslint-disable-line no-redeclare\r\n /** Options passed to [[IModelApp.supplyRenderSystem]] to configure the [[RenderSystem]] on startup. Many of these options serve as \"feature flags\" used to enable newer, experimental features. As such they typically begin life tagged as \"alpha\" or \"beta\" and are subsequently deprecated when the feature is declared stable.\r\n *\r\n * @public\r\n */\r\n export interface Options {\r\n /** WebGL extensions to be explicitly disabled, regardless of whether or not the WebGL implementation supports them.\r\n * This is chiefly useful for testing code that only executes in the absence of particular extensions, while running on a system that supports those extensions.\r\n *\r\n * Default value: undefined\r\n *\r\n * @public\r\n */\r\n disabledExtensions?: WebGLExtensionName[];\r\n\r\n /** If true, preserve the shader source code as internal strings, useful for debugging purposes.\r\n *\r\n * Default value: false\r\n *\r\n * @public\r\n */\r\n preserveShaderSourceCode?: boolean;\r\n\r\n /** If true, display solar shadows when enabled by [ViewFlags.shadows]($common).\r\n *\r\n * Default value: true\r\n *\r\n * @beta\r\n */\r\n displaySolarShadows?: boolean;\r\n\r\n /** If the view frustum is sufficiently large, and the EXT_frag_depth WebGL extension is available, use a logarithmic depth buffer to improve depth buffer resolution. Framerate may degrade to an extent while the logarithmic depth buffer is in use. If this option is disabled, or the extension is not supported, the near and far planes of very large view frustums will instead be moved to reduce the draw distance.\r\n *\r\n * Default value: true\r\n *\r\n * @public\r\n */\r\n logarithmicDepthBuffer?: boolean;\r\n\r\n /** ###TODO this appears to do nothing. @internal */\r\n filterMapTextures?: boolean;\r\n /** ###TODO this appears to do nothing. @internal */\r\n filterMapDrapeTextures?: boolean;\r\n\r\n /** If true, [[ScreenViewport]]s will respect the DPI of the display. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].\r\n * @see [[dpiAwareLOD]] to control whether device pixel ratio affects the level of detail for tile graphics and decorations.\r\n * @see [[Viewport.cssPixelsToDevicePixels]] to convert CSS pixels to device pixels.\r\n * @see [[Viewport.devicePixelRatio]].\r\n *\r\n * Default value: true\r\n *\r\n * @public\r\n */\r\n dpiAwareViewports?: boolean;\r\n\r\n /** If defined, this will be used as the device pixel ratio instead of the system's actual device pixel ratio.\r\n * This can be helpful for situations like running in the iOS Simulator where forcing a lower resolution by setting a sub-1 device pixel ratio would increase performance.\r\n * @note If this setting is used to decrease the effective device pixel ratio, the view will appear pixelated.\r\n * @note This setting should only be used to increase performance in situations like the iOS Simulator for testing purposes only. It should not be used in a production situation.\r\n * @note This setting has no effect if [[dpiAwareViewports]] is `false`.\r\n *\r\n * Default value: undefined\r\n *\r\n * @public\r\n */\r\n devicePixelRatioOverride?: number;\r\n\r\n /** If true, [[ScreenViewport]]s will take into account the DPI of the display when computing the level of detail for tile graphics and decorations.\r\n * This can result in sharper-looking images on high-DPI devices like mobile phones, but may reduce performance on such devices.\r\n * @note This setting has no effect if [[dpiAwareViewports]] is `false`.\r\n * @see [[Viewport.devicePixelRatio]].\r\n *\r\n * Default value: false\r\n *\r\n * @public\r\n */\r\n dpiAwareLOD?: boolean;\r\n\r\n /** If true will attempt to create a WebGL2 context, falling back to WebGL1 if WebGL2 is not supported.\r\n *\r\n * Default value: true\r\n *\r\n * @public\r\n */\r\n useWebGL2?: boolean;\r\n\r\n /** If true, plan projection models will be rendered using [PlanProjectionSettings]($common) defined by the [[DisplayStyle3dState]].\r\n * Default value: true\r\n * @public\r\n */\r\n planProjections?: boolean;\r\n\r\n /** To help prevent delays when a user interacts with a [[Viewport]], the WebGL render system can precompile shader programs before any Viewport is opened.\r\n * This particularly helps applications when they do not open a Viewport immediately upon startup - for example, if the user is first expected to select an iModel and a view through the user interface.\r\n * Shader precompilation will cease once all shader programs have been compiled, or when a Viewport is opened (registered with the [[ViewManager]]).\r\n * @note Enabling this feature can slow UI interactions before a [[Viewport]] is opened.\r\n * To enable this feature, set this to `true`.\r\n *\r\n * Default value: false\r\n *\r\n * @beta\r\n */\r\n doIdleWork?: boolean;\r\n\r\n /** WebGL context attributes to explicitly set when initializing [[IModelApp.renderSystem]].\r\n * Exposed chiefly for OpenCities Planner.\r\n * @internal\r\n */\r\n contextAttributes?: WebGLContextAttributes;\r\n\r\n /** If true, will cause exception when a shader uniform is missing (usually optimized out), otherwise will only log these.\r\n * Default value: false\r\n * @public\r\n */\r\n errorOnMissingUniform?: boolean;\r\n\r\n /** If true, and the `WEBGL_debug_shaders` extension is available, accumulate debug information during shader compilation.\r\n * This information can be accessed via `RenderSystemDebugControl.debugShaderFiles`.\r\n * Default value: false\r\n * @internal\r\n */\r\n debugShaders?: boolean;\r\n\r\n /** Initial antialias setting\r\n * If > 1, and a WebGL2 context is being used, will turn on antialiasing using that many samples.\r\n * Default value: 1\r\n * @public\r\n */\r\n antialiasSamples?: number;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RenderSystem.js","sourceRoot":"","sources":["../../../src/render/RenderSystem.ts"],"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AC;IAED,gBAAgB;IACT,aAAa,KAAW,CAAC;IAEhC,gBAAgB;IACT,iBAAiB,CAAC,OAA0B,IAAU,CAAC;IAE9D,gBAAgB;IAChB,IAAW,kBAAkB,KAAc,OAAO,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAElG;;OAEG;IACH,IAAW,YAAY,KAA2C,OAAO,SAAS,CAAC,CAAC,CAAC;IAErF,gBAAgB;IACT,iBAAiB,CAAC,MAA+B,IAAU,CAAC;IAEnE;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,KAAK,CAAC,kBAAkB;QACpC,MAAM,GAAG,GAAG,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAC;QAC1F,OAAO,qBAAS,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAlfD,oCAkfC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { base64StringToUint8Array, Id64String, IDisposable } from \"@itwin/core-bentley\";\r\nimport {\r\n ColorDef, ColorIndex, ElementAlignedBox3d, FeatureIndex, FeatureIndexType, FillFlags, Frustum, Gradient, ImageBuffer, ImageBufferFormat, ImageSource, ImageSourceFormat,\r\n isValidImageSourceFormat, PackedFeatureTable, QParams3d, QPoint3dList, RenderMaterial, RenderTexture, SkyGradient, TextureProps, TextureTransparency,\r\n} from \"@itwin/core-common\";\r\nimport { ClipVector, Matrix3d, Point2d, Point3d, Range2d, Range3d, Transform, Vector2d, XAndY } from \"@itwin/core-geometry\";\r\nimport { WebGLExtensionName } from \"@itwin/webgl-compatibility\";\r\nimport { imageElementFromImageSource } from \"../ImageUtil\";\r\nimport { IModelApp } from \"../IModelApp\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\nimport { MapTileTreeReference, TileTreeReference } from \"../tile/internal\";\r\nimport { ToolAdmin } from \"../tools/ToolAdmin\";\r\nimport { SceneContext } from \"../ViewContext\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ViewRect } from \"../ViewRect\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./GraphicBranch\";\r\nimport { BatchOptions, CustomGraphicBuilderOptions, GraphicBuilder, GraphicType, ViewportGraphicBuilderOptions } from \"./GraphicBuilder\";\r\nimport { InstancedGraphicParams, PatternGraphicParams } from \"./InstancedGraphicParams\";\r\nimport { MeshArgs, PolylineArgs } from \"./primitives/mesh/MeshPrimitives\";\r\nimport { RealityMeshGraphicParams } from \"./RealityMeshGraphicParams\";\r\nimport { RealityMeshParams } from \"./RealityMeshParams\";\r\nimport { PointCloudArgs } from \"./primitives/PointCloudPrimitive\";\r\nimport { PointStringParams } from \"./primitives/PointStringParams\";\r\nimport { PolylineParams } from \"./primitives/PolylineParams\";\r\nimport { MeshParams } from \"./primitives/VertexTable\";\r\nimport { RenderClipVolume } from \"./RenderClipVolume\";\r\nimport { RenderGraphic, RenderGraphicOwner } from \"./RenderGraphic\";\r\nimport { CreateRenderMaterialArgs } from \"./RenderMaterial\";\r\nimport { RenderMemory } from \"./RenderMemory\";\r\nimport { RenderPlanarClassifier } from \"./RenderPlanarClassifier\";\r\nimport { RenderTarget } from \"./RenderTarget\";\r\nimport { CreateTextureArgs, CreateTextureFromSourceArgs, TextureCacheKey } from \"./RenderTexture\";\r\nimport { ScreenSpaceEffectBuilder, ScreenSpaceEffectBuilderParams } from \"./ScreenSpaceEffectBuilder\";\r\n\r\n/* eslint-disable no-restricted-syntax */\r\n// cSpell:ignore deserializing subcat uninstanced wiremesh qorigin trimesh\r\n\r\n/** An opaque representation of a texture draped on geometry within a [[Viewport]].\r\n * @internal\r\n */\r\nexport abstract class RenderTextureDrape implements IDisposable {\r\n public abstract dispose(): void;\r\n\r\n /** @internal */\r\n public abstract collectStatistics(stats: RenderMemory.Statistics): void;\r\n public abstract collectGraphics(context: SceneContext): void;\r\n}\r\n\r\n/** @internal */\r\nexport type TextureDrapeMap = Map<Id64String, RenderTextureDrape>;\r\n\r\n/** @internal */\r\nexport type MapLayerClassifiers = Map<number, RenderPlanarClassifier>;\r\n\r\n/** Describes a texture loaded from an HTMLImageElement\r\n * ###TODO Replace with TextureImage from RenderTexture.ts after we start returning transparency info from the backend.\r\n * @internal\r\n */\r\nexport interface OldTextureImage {\r\n /** The HTMLImageElement containing the texture's image data */\r\n image: HTMLImageElement;\r\n /** The format of the texture's image data */\r\n format: ImageSourceFormat;\r\n}\r\n\r\n/** @internal */\r\nexport enum RenderDiagnostics {\r\n /** No diagnostics enabled. */\r\n None = 0,\r\n /** Debugging output to browser console enabled. */\r\n DebugOutput = 1 << 1,\r\n /** Potentially expensive checks of WebGL state enabled. */\r\n WebGL = 1 << 2,\r\n /** All diagnostics enabled. */\r\n All = DebugOutput | WebGL,\r\n}\r\n\r\n/** @internal */\r\nexport interface GLTimerResult {\r\n /** Label from GLTimer.beginOperation */\r\n label: string;\r\n /** Time elapsed in nanoseconds, inclusive of child result times.\r\n * @note no-op queries seem to have 32ns of noise.\r\n */\r\n nanoseconds: number;\r\n /** Child results if GLTimer.beginOperation calls were nested */\r\n children?: GLTimerResult[];\r\n}\r\n\r\n/** @internal */\r\nexport type GLTimerResultCallback = (result: GLTimerResult) => void;\r\n\r\n/** Default implementation of RenderGraphicOwner. */\r\nclass GraphicOwner extends RenderGraphicOwner {\r\n public constructor(private readonly _graphic: RenderGraphic) { super(); }\r\n public get graphic(): RenderGraphic { return this._graphic; }\r\n}\r\n\r\n/** An interface optionally exposed by a RenderSystem that allows control of various debugging features.\r\n * @beta\r\n */\r\nexport interface RenderSystemDebugControl {\r\n /** Destroy this system's webgl context. Returns false if this behavior is not supported. */\r\n loseContext(): boolean;\r\n\r\n /** Overrides [[RenderSystem.dpiAwareLOD]].\r\n * @internal\r\n */\r\n dpiAwareLOD: boolean;\r\n\r\n /** Record GPU profiling information for each frame drawn. Check isGLTimerSupported before using.\r\n * @internal\r\n */\r\n resultsCallback?: GLTimerResultCallback;\r\n\r\n /** Returns true if the browser supports GPU profiling queries.\r\n * @internal\r\n */\r\n readonly isGLTimerSupported: boolean;\r\n\r\n /** Attempts to compile all shader programs and returns true if all were successful. May throw exceptions on errors.\r\n * This is useful for debugging shader compilation on specific platforms - especially those which use neither ANGLE nor SwiftShader (e.g., linux, mac, iOS)\r\n * because our unit tests which also compile all shaders run in software mode and therefore may not catch some \"errors\" (especially uniforms that have no effect on\r\n * program output).\r\n * @internal\r\n */\r\n compileAllShaders(): boolean;\r\n\r\n /** Obtain accumulated debug info collected during shader compilation. See `RenderSystem.Options.debugShaders`.\r\n * @internal\r\n */\r\n debugShaderFiles?: DebugShaderFile[];\r\n}\r\n\r\n/** @internal */\r\nexport abstract class RenderTerrainGeometry implements IDisposable, RenderMemory.Consumer {\r\n public abstract dispose(): void;\r\n public abstract get transform(): Transform | undefined;\r\n public abstract collectStatistics(stats: RenderMemory.Statistics): void;\r\n}\r\n\r\n/** @internal */\r\nexport class TerrainTexture {\r\n public constructor(\r\n public readonly texture: RenderTexture,\r\n public featureId: number,\r\n public readonly scale: Vector2d,\r\n public readonly translate: Vector2d,\r\n public readonly targetRectangle: Range2d,\r\n public readonly layerIndex: number,\r\n public transparency: number,\r\n public readonly clipRectangle?: Range2d\r\n ) { }\r\n\r\n public cloneWithClip(clipRectangle: Range2d) {\r\n return new TerrainTexture (this.texture, this.featureId, this.scale, this.translate, this.targetRectangle, this.layerIndex, this.transparency, clipRectangle);\r\n }\r\n}\r\n/** @internal */\r\nexport class DebugShaderFile {\r\n public constructor(\r\n public readonly filename: string,\r\n public readonly src: string,\r\n public isVS: boolean,\r\n public isGL: boolean,\r\n public isUsed: boolean\r\n ) { }\r\n}\r\n/** Transparency settings for planar grid display.\r\n * @alpha\r\n */\r\nexport class PlanarGridTransparency {\r\n /** Transparency for the grid plane. This should generally be fairly high to avoid obscuring other geometry */\r\n public readonly planeTransparency = .9;\r\n /** Transparency of the grid lines. This should be higher than the plane, but less than reference line transparency */\r\n public readonly lineTransparency = .75;\r\n /** Transparency of the reference lines. This should be less than plane or line transparency so that reference lines are more prominent */\r\n public readonly refTransparency = .5;\r\n}\r\n\r\n/** Settings for planar grid display.\r\n * @alpha\r\n */\r\nexport interface PlanarGridProps {\r\n /** The grid origin */\r\n origin: Point3d;\r\n /** The grid orientation. The grid X and Y direction are the first and second matrix rows */\r\n rMatrix: Matrix3d;\r\n /** The spacing between grid liens in the X and Y direction */\r\n spacing: XAndY;\r\n /** Grid lines per reference. If zero no reference lines are displayed. */\r\n gridsPerRef: number;\r\n /** Grid color. [[Use Viewport.getContrastToBackgroundColor]] to get best constrast color based on current background. */\r\n color: ColorDef;\r\n /** Transparency settings. If omitted then the [[PlanarGridTransparency]] defaults are used. */\r\n transparency?: PlanarGridTransparency;\r\n}\r\n\r\n/** An opaque representation of geometry allocated by a [[RenderSystem]] to be supplied to [[RenderSystem.createRenderGraphic]].\r\n * @internal\r\n */\r\nexport type RenderGeometry = IDisposable & RenderMemory.Consumer;\r\n\r\n/** An opaque representation of instructions for repeatedly drawing a [[RenderGeometry]] to pattern a planar region, to be supplied to [[RenderSystem.createRenderGraphic]].\r\n * @internal\r\n */\r\nexport type RenderAreaPattern = IDisposable & RenderMemory.Consumer;\r\n\r\n/** @internal */\r\nexport interface RenderSkyGradientParams {\r\n type: \"gradient\";\r\n gradient: SkyGradient;\r\n zOffset: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface RenderSkySphereParams {\r\n type: \"sphere\";\r\n texture: RenderTexture;\r\n rotation: number;\r\n zOffset: number;\r\n}\r\n\r\n/** @internal */\r\nexport interface RenderSkyCubeParams {\r\n type: \"cube\";\r\n texture: RenderTexture;\r\n}\r\n\r\n/** @internal */\r\nexport type RenderSkyBoxParams = RenderSkyGradientParams | RenderSkySphereParams | RenderSkyCubeParams;\r\n\r\n/** A RenderSystem provides access to resources used by the internal WebGL-based rendering system.\r\n * An application rarely interacts directly with the RenderSystem; instead it interacts with types like [[Viewport]] which\r\n * coordinate with the RenderSystem on the application's behalf.\r\n * @see [Display system overview]($docs/learning/display/index.md)\r\n * @see [[IModelApp.renderSystem]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class RenderSystem implements IDisposable {\r\n /** Options used to initialize the RenderSystem. These are primarily used for feature-gating.\r\n * This object is frozen and cannot be modified after the RenderSystem is created.\r\n * @internal\r\n */\r\n public readonly options: RenderSystem.Options;\r\n\r\n /** Antialias samples to use on all subsequently created render targets.\r\n * Default value: undefined (no antialiasing)\r\n * @beta\r\n */\r\n public antialiasSamples?: number;\r\n\r\n /** Initialize the RenderSystem with the specified options.\r\n * @note The RenderSystem takes ownership of the supplied Options and freezes it.\r\n * @internal\r\n */\r\n protected constructor(options?: RenderSystem.Options) {\r\n this.options = undefined !== options ? options : {};\r\n Object.freeze(this.options);\r\n if (undefined !== this.options.disabledExtensions)\r\n Object.freeze(this.options.disabledExtensions);\r\n }\r\n\r\n /** @internal */\r\n public abstract get isValid(): boolean;\r\n\r\n /** @internal */\r\n public abstract dispose(): void;\r\n\r\n /** @internal */\r\n public get maxTextureSize(): number { return 0; }\r\n\r\n /** @internal */\r\n public get supportsInstancing(): boolean { return true; }\r\n\r\n /** @internal */\r\n public get supportsCreateImageBitmap(): boolean { return false; }\r\n\r\n /** @internal */\r\n public get supportsIndexedEdges(): boolean { return true; }\r\n\r\n /** @internal */\r\n public get supportsNonuniformScaledInstancing(): boolean { return true; }\r\n\r\n /** @internal */\r\n public get dpiAwareLOD(): boolean { return true === this.options.dpiAwareLOD; }\r\n\r\n /** @internal */\r\n public get isMobile(): boolean { return false; }\r\n\r\n /** @internal */\r\n public abstract createTarget(canvas: HTMLCanvasElement): RenderTarget;\r\n /** @internal */\r\n public abstract createOffscreenTarget(rect: ViewRect): RenderTarget;\r\n\r\n /** Perform a small unit of idle work and return true if more idle work remains to be done. This function is invoked on each tick of the javascript event loop as long as no viewports are registered with the ViewManager, until it returns false to indicate all idle work has been completed.\r\n * @internal\r\n */\r\n public abstract doIdleWork(): boolean;\r\n\r\n /** Find a previously-created [RenderMaterial]($common) by its ID.\r\n * @param _key The unique ID of the material within the context of the IModelConnection. Typically an element ID.\r\n * @param _imodel The IModelConnection with which the material is associated.\r\n * @returns A previously-created material matching the specified ID, or undefined if no such material exists.\r\n */\r\n public findMaterial(_key: string, _imodel: IModelConnection): RenderMaterial | undefined { return undefined; }\r\n\r\n /** Create a [RenderMaterial]($common) from parameters\r\n * If the parameters include a non-empty key, and no previously-created material already exists with that key, the newly-created material will be cached on the IModelConnection such\r\n * that it can later be retrieved by the same key using [[RenderSystem.findMaterial]].\r\n * @param _params A description of the material's properties.\r\n * @param _imodel The IModelConnection associated with the material.\r\n * @returns the newly-created material, or undefined if the material could not be created or if a material with the same key as that specified in the params already exists.\r\n * @deprecated in 3.x. Use [[createRenderMaterial]].\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createMaterial(_params: RenderMaterial.Params, _imodel: IModelConnection): RenderMaterial | undefined { return undefined; }\r\n\r\n /** Create a [RenderMaterial]($common).\r\n * @see [[CreateRenderMaterialArgs]] for a description of the material parameters.\r\n */\r\n public createRenderMaterial(_args: CreateRenderMaterialArgs): RenderMaterial | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Creates a [[GraphicBuilder]] for creating a [[RenderGraphic]].\r\n * @param placement The local-to-world transform in which the builder's geometry is to be defined.\r\n * @param type The type of builder to create.\r\n * @param viewport The viewport in which the resultant [[RenderGraphic]] will be rendered.\r\n * @param pickableId If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within the specified viewport.\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[RenderContext.createGraphicBuilder]].\r\n * @see [[Decorator]]\r\n */\r\n public createGraphicBuilder(placement: Transform, type: GraphicType, viewport: Viewport, pickableId?: Id64String): GraphicBuilder {\r\n const pickable = undefined !== pickableId ? { id: pickableId } : undefined;\r\n return this.createGraphic({ type, viewport, placement, pickable });\r\n }\r\n\r\n /** Obtain a [[GraphicBuilder]] from which to produce a [[RenderGraphic]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public abstract createGraphic(options: CustomGraphicBuilderOptions | ViewportGraphicBuilderOptions): GraphicBuilder;\r\n\r\n /** Obtain an object capable of producing a custom screen-space effect to be applied to the image rendered by a [[Viewport]].\r\n * @returns undefined if screen-space effects are not supported by this RenderSystem.\r\n */\r\n public createScreenSpaceEffectBuilder(_params: ScreenSpaceEffectBuilderParams): ScreenSpaceEffectBuilder | undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public createTriMesh(args: MeshArgs, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n const params = MeshParams.create(args);\r\n return this.createMesh(params, instances);\r\n }\r\n\r\n /** @internal */\r\n public createIndexedPolylines(args: PolylineArgs, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n if (args.flags.isDisjoint) {\r\n const pointStringParams = PointStringParams.create(args);\r\n return undefined !== pointStringParams ? this.createPointString(pointStringParams, instances) : undefined;\r\n } else {\r\n const polylineParams = PolylineParams.create(args);\r\n return undefined !== polylineParams ? this.createPolyline(polylineParams, instances) : undefined;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public createMeshGeometry(_params: MeshParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined { return undefined; }\r\n /** @internal */\r\n public createPolylineGeometry(_params: PolylineParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined { return undefined; }\r\n /** @internal */\r\n public createPointStringGeometry(_params: PointStringParams, _viewIndependentOrigin?: Point3d): RenderGeometry | undefined { return undefined; }\r\n\r\n /** @internal */\r\n public createAreaPattern(_params: PatternGraphicParams): RenderAreaPattern | undefined { return undefined; }\r\n\r\n /** Create a RenderGraphic from a RenderGeometry produced by this RenderSystem.\r\n * @internal\r\n */\r\n public abstract createRenderGraphic(_geometry: RenderGeometry, instances?: InstancedGraphicParams | RenderAreaPattern): RenderGraphic | undefined;\r\n\r\n private createGraphicFromGeometry(\r\n createGeometry: (viewIndependentOrigin?: Point3d) => RenderGeometry | undefined,\r\n instancesOrOrigin?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n let viOrigin;\r\n let instances;\r\n if (instancesOrOrigin instanceof Point3d)\r\n viOrigin = instancesOrOrigin;\r\n else\r\n instances = instancesOrOrigin;\r\n\r\n const geom = createGeometry(viOrigin);\r\n return geom ? this.createRenderGraphic(geom, instances) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public createMesh(params: MeshParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n return this.createGraphicFromGeometry((viOrigin) => this.createMeshGeometry(params, viOrigin), instances);\r\n }\r\n\r\n /** @internal */\r\n public createPolyline(params: PolylineParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n return this.createGraphicFromGeometry((origin) => this.createPolylineGeometry(params, origin), instances);\r\n }\r\n\r\n /** @internal */\r\n public createPointString(params: PointStringParams, instances?: InstancedGraphicParams | RenderAreaPattern | Point3d): RenderGraphic | undefined {\r\n return this.createGraphicFromGeometry((origin) => this.createPointStringGeometry(params, origin), instances);\r\n }\r\n\r\n /** @internal */\r\n public createTerrainMesh(_params: RealityMeshParams, _transform?: Transform, _disableTextureDisposal = false): RenderTerrainGeometry | undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public createRealityMeshGraphic(_params: RealityMeshGraphicParams, _disableTextureDisposal = false): RenderGraphic | undefined { return undefined; }\r\n /** @internal */\r\n public createRealityMesh(_realityMesh: RealityMeshParams, _disableTextureDisposal = false): RenderGraphic | undefined { return undefined; }\r\n /** @internal */\r\n public get maxRealityImageryLayers() { return 0; }\r\n /** @internal */\r\n public createPointCloud(_args: PointCloudArgs, _imodel: IModelConnection): RenderGraphic | undefined { return undefined; }\r\n\r\n /** Create a clip volume to clip geometry.\r\n * @note The clip volume takes ownership of the ClipVector, which must not be subsequently mutated.\r\n * @param _clipVector Defines how the volume clips geometry.\r\n * @returns A clip volume, or undefined if, e.g., the clip vector does not clip anything.\r\n */\r\n public createClipVolume(_clipVector: ClipVector): RenderClipVolume | undefined { return undefined; }\r\n\r\n /** @internal */\r\n public createPlanarGrid(_frustum: Frustum, _grid: PlanarGridProps): RenderGraphic | undefined { return undefined; }\r\n /** @internal */\r\n public createBackgroundMapDrape(_drapedTree: TileTreeReference, _mapTree: MapTileTreeReference): RenderTextureDrape | undefined { return undefined; }\r\n /** @internal */\r\n public createTile(tileTexture: RenderTexture, corners: Point3d[], featureIndex?: number): RenderGraphic | undefined {\r\n // corners\r\n // [0] [1]\r\n // [2] [3]\r\n // Quantize the points according to their range\r\n const points = new QPoint3dList(QParams3d.fromRange(Range3d.create(...corners)));\r\n for (let i = 0; i < 4; i++)\r\n points.add(corners[i]);\r\n\r\n // Now remove the translation from the quantized points and put it into a transform instead.\r\n // This prevents graphical artifacts when quantization origin is large relative to quantization scale.\r\n // ###TODO: Would be better not to create a branch for every tile.\r\n const qorigin = points.params.origin;\r\n const transform = Transform.createTranslationXYZ(qorigin.x, qorigin.y, qorigin.z);\r\n qorigin.setZero();\r\n\r\n const features = new FeatureIndex();\r\n if (undefined !== featureIndex) {\r\n features.featureID = featureIndex;\r\n features.type = FeatureIndexType.Uniform;\r\n }\r\n\r\n const rasterTile: MeshArgs = {\r\n points,\r\n vertIndices: [0, 1, 2, 2, 1, 3],\r\n isPlanar: true,\r\n features,\r\n colors: new ColorIndex(),\r\n fillFlags: FillFlags.None,\r\n textureMapping: {\r\n uvParams: [new Point2d(0, 0), new Point2d(1, 0), new Point2d(0, 1), new Point2d(1, 1)],\r\n texture: tileTexture,\r\n },\r\n };\r\n\r\n const trimesh = this.createTriMesh(rasterTile);\r\n if (undefined === trimesh)\r\n return undefined;\r\n\r\n const branch = new GraphicBranch(true);\r\n branch.add(trimesh);\r\n return this.createBranch(branch, transform);\r\n }\r\n\r\n /** Create a Graphic for a [[SkyBox]] which encompasses the entire scene, rotating with the camera.\r\n * @internal\r\n */\r\n public createSkyBox(_params: RenderSkyBoxParams): RenderGraphic | undefined { return undefined; }\r\n\r\n /** Create a RenderGraphic consisting of a list of Graphics to be drawn together. */\r\n public abstract createGraphicList(primitives: RenderGraphic[]): RenderGraphic;\r\n\r\n /** Create a RenderGraphic consisting of a list of Graphics, with optional transform and symbology overrides applied to the list */\r\n public createBranch(branch: GraphicBranch, transform: Transform): RenderGraphic {\r\n return this.createGraphicBranch(branch, transform);\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public abstract createGraphicBranch(branch: GraphicBranch, transform: Transform, options?: GraphicBranchOptions): RenderGraphic;\r\n\r\n /** Create a node in the scene graph corresponding to a transform node in the scene's schedule script.\r\n * Nodes under this branch will only be drawn if they belong to the specified transform node.\r\n * This allows the graphics in a single Tile to be efficiently drawn with different transforms applied by different nodes.\r\n * The node Id is either the Id of a single transform node in the script, of 0xffffffff to indicate all nodes that have no transform applied to them.\r\n * @internal\r\n */\r\n public createAnimationTransformNode(graphic: RenderGraphic, _nodeId: number): RenderGraphic {\r\n return graphic;\r\n }\r\n\r\n /** Create a RenderGraphic consisting of batched [[Feature]]s.\r\n * @internal\r\n */\r\n public abstract createBatch(graphic: RenderGraphic, features: PackedFeatureTable, range: ElementAlignedBox3d, options?: BatchOptions): RenderGraphic;\r\n\r\n /** Return a Promise which when resolved indicates that all pending external textures have finished loading from the backend. */\r\n public async waitForAllExternalTextures(): Promise<void> { return Promise.resolve(); }\r\n /** @internal */\r\n public get hasExternalTextureRequests(): boolean { return false; }\r\n\r\n /** Create a graphic that assumes ownership of another graphic.\r\n * @param ownedGraphic The RenderGraphic to be owned.\r\n * @returns The owning graphic that exposes a `disposeGraphic` method for explicitly disposing of the owned graphic.\r\n * @see [[RenderGraphicOwner]] for details regarding ownership semantics.\r\n * @public\r\n */\r\n public createGraphicOwner(ownedGraphic: RenderGraphic): RenderGraphicOwner { return new GraphicOwner(ownedGraphic); }\r\n\r\n /** Create a \"layer\" containing the graphics belonging to it. A layer has a unique identifier and all of its geometry lies in an XY plane.\r\n * Different layers can be drawn coincident with one another; their draw order can be controlled by a per-layer priority value so that one layer draws\r\n * on top of another. Layers cannot nest inside other layers. Multiple GraphicLayers can exist with the same ID; they are treated as belonging to the same layer.\r\n * A GraphicLayer must be contained (perhaps indirectly) inside a GraphicLayerContainer.\r\n * @see [[createGraphicLayerContainer]]\r\n * @internal\r\n */\r\n public createGraphicLayer(graphic: RenderGraphic, _layerId: string): RenderGraphic { return graphic; }\r\n\r\n /** Create a graphic that can contain [[GraphicLayer]]s.\r\n * @internal\r\n */\r\n public createGraphicLayerContainer(graphic: RenderGraphic, _drawAsOverlay: boolean, _transparency: number, _elevation: number): RenderGraphic { return graphic; }\r\n\r\n /** Find a previously-created [[RenderTexture]] by its key.\r\n * @param _key The unique key of the texture within the context of the IModelConnection. Typically an element Id.\r\n * @param _imodel The IModelConnection with which the texture is associated.\r\n * @returns A previously-created texture matching the specified key, or undefined if no such texture exists.\r\n */\r\n public findTexture(_key: TextureCacheKey, _imodel: IModelConnection): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Find or create a [[RenderTexture]] from a persistent texture element.\r\n * @param id The ID of the texture element.\r\n * @param iModel The IModel containing the texture element.\r\n * @returns A Promise resolving to the created RenderTexture or to undefined if the texture could not be created.\r\n * @note If the texture is successfully created, it will be cached on the IModelConnection such that it can later be retrieved by its ID using [[RenderSystem.findTexture]].\r\n * @see [[RenderSystem.loadTextureImage]].\r\n * @internal\r\n */\r\n public async loadTexture(id: Id64String, iModel: IModelConnection): Promise<RenderTexture | undefined> {\r\n let texture = this.findTexture(id.toString(), iModel);\r\n if (undefined === texture) {\r\n const image = await this.loadTextureImage(id, iModel);\r\n if (undefined !== image) {\r\n // This will return a pre-existing RenderTexture if somebody else loaded it while we were awaiting the image.\r\n texture = this.createTexture({\r\n type: RenderTexture.Type.Normal,\r\n ownership: { key: id, iModel },\r\n image: {\r\n source: image.image,\r\n transparency: ImageSourceFormat.Png === image.format ? TextureTransparency.Mixed : TextureTransparency.Opaque,\r\n },\r\n });\r\n }\r\n }\r\n\r\n return texture;\r\n }\r\n\r\n /**\r\n * Load a texture image given the ID of a texture element.\r\n * @param id The ID of the texture element.\r\n * @param iModel The IModel containing the texture element.\r\n * @returns A Promise resolving to a TextureImage created from the texture element's data, or to undefined if the TextureImage could not be created.\r\n * @see [[RenderSystem.loadTexture]]\r\n * @internal\r\n */\r\n public async loadTextureImage(id: Id64String, iModel: IModelConnection): Promise<OldTextureImage | undefined> {\r\n const elemProps = await iModel.elements.getProps(id);\r\n if (1 !== elemProps.length)\r\n return undefined;\r\n\r\n const textureProps = elemProps[0] as TextureProps;\r\n if (undefined === textureProps.data || \"string\" !== typeof (textureProps.data) || undefined === textureProps.format || \"number\" !== typeof (textureProps.format))\r\n return undefined;\r\n\r\n const format = textureProps.format;\r\n if (!isValidImageSourceFormat(format))\r\n return undefined;\r\n\r\n const imageSource = new ImageSource(base64StringToUint8Array(textureProps.data), format);\r\n const image = await imageElementFromImageSource(imageSource);\r\n return { image, format };\r\n }\r\n\r\n /** Obtain a texture created from a gradient.\r\n * @param _symb The description of the gradient.\r\n * @param _imodel The IModelConnection with which the texture is associated.\r\n * @returns A texture created from the gradient image, or undefined if the texture could not be created.\r\n * @note If a texture matching the specified gradient is already cached on the iModel, it will be returned.\r\n * Otherwise, if an iModel is supplied, the newly-created texture will be cached on the iModel such that subsequent calls with an equivalent gradient and the\r\n * same iModel will return the cached texture instead of creating a new one.\r\n */\r\n public getGradientTexture(_symb: Gradient.Symb, _imodel?: IModelConnection): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Create a new texture from an [[ImageBuffer]].\r\n * @deprecated in 3.x. Use [[createTexture]].\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromImageBuffer(image: ImageBuffer, iModel: IModelConnection, params: RenderTexture.Params): RenderTexture | undefined {\r\n const ownership = params.key ? { key: params.key, iModel } : (params.isOwned ? \"external\" : undefined);\r\n return this.createTexture({\r\n type: params.type,\r\n ownership,\r\n image: {\r\n source: image,\r\n transparency: ImageBufferFormat.Rgba === image.format ? TextureTransparency.Mixed : TextureTransparency.Opaque,\r\n },\r\n });\r\n }\r\n\r\n /** Create a new texture from an HTML image. Typically the image was extracted from a binary representation of a jpeg or png via [[imageElementFromImageSource]].\r\n * @deprecated in 3.x. Use [[createTexture]].\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromImage(image: HTMLImageElement, hasAlpha: boolean, iModel: IModelConnection | undefined, params: RenderTexture.Params): RenderTexture | undefined {\r\n const ownership = params.key && iModel ? { key: params.key, iModel } : (params.isOwned ? \"external\" : undefined);\r\n return this.createTexture({\r\n type: params.type,\r\n ownership,\r\n image: {\r\n source: image,\r\n transparency: hasAlpha ? TextureTransparency.Mixed : TextureTransparency.Opaque,\r\n },\r\n });\r\n }\r\n\r\n /** Create a new texture from an ImageSource.\r\n * @deprecated in 3.x. Use RenderSystem.createTextureFromSource.\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public async createTextureFromImageSource(source: ImageSource, iModel: IModelConnection | undefined, params: RenderTexture.Params): Promise<RenderTexture | undefined> {\r\n const ownership = iModel && params.key ? { iModel, key: params.key } : (params.isOwned ? \"external\" : undefined);\r\n return this.createTextureFromSource({\r\n type: params.type,\r\n source,\r\n ownership,\r\n transparency: source.format === ImageSourceFormat.Jpeg ? TextureTransparency.Opaque : TextureTransparency.Mixed,\r\n });\r\n }\r\n\r\n /** Create a texture from an ImageSource. */\r\n public async createTextureFromSource(args: CreateTextureFromSourceArgs): Promise<RenderTexture | undefined> {\r\n try {\r\n // JPEGs don't support transparency.\r\n const transparency = ImageSourceFormat.Jpeg === args.source.format ? TextureTransparency.Opaque : (args.transparency ?? TextureTransparency.Mixed);\r\n const image = await imageElementFromImageSource(args.source);\r\n if (!IModelApp.hasRenderSystem)\r\n return undefined;\r\n\r\n return this.createTexture({\r\n type: args.type,\r\n ownership: args.ownership,\r\n image: {\r\n source: image,\r\n transparency,\r\n },\r\n });\r\n } catch {\r\n return undefined;\r\n }\r\n }\r\n\r\n /** Create a new texture by its element ID. This texture will be retrieved asynchronously from the backend. A placeholder image will be associated with the texture until the requested image data loads. */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromElement(_id: Id64String, _imodel: IModelConnection, _params: RenderTexture.Params, _format: ImageSourceFormat): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n public createTexture(_args: CreateTextureArgs): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** Create a new texture from a cube of HTML images.\r\n * @internal\r\n */\r\n // eslint-disable-next-line deprecation/deprecation\r\n public createTextureFromCubeImages(_posX: HTMLImageElement, _negX: HTMLImageElement, _posY: HTMLImageElement, _negY: HTMLImageElement, _posZ: HTMLImageElement, _negZ: HTMLImageElement, _imodel: IModelConnection, _params: RenderTexture.Params): RenderTexture | undefined {\r\n return undefined;\r\n }\r\n\r\n /** @internal */\r\n public onInitialized(): void { }\r\n\r\n /** @internal */\r\n public enableDiagnostics(_enable: RenderDiagnostics): void { }\r\n\r\n /** @internal */\r\n public get supportsLogZBuffer(): boolean { return false !== this.options.logarithmicDepthBuffer; }\r\n\r\n /** Obtain an object that can be used to control various debugging features. Returns `undefined` if debugging features are unavailable for this `RenderSystem`.\r\n * @beta\r\n */\r\n public get debugControl(): RenderSystemDebugControl | undefined { return undefined; }\r\n\r\n /** @internal */\r\n public collectStatistics(_stats: RenderMemory.Statistics): void { }\r\n\r\n /** A function that is invoked after the WebGL context is lost. Context loss is almost always caused by excessive consumption of GPU memory.\r\n * After context loss occurs, the RenderSystem will be unable to interact with WebGL by rendering viewports, creating graphics and textures, etc.\r\n * By default, this function invokes [[ToolAdmin.exceptionHandler]] with a brief message describing what occurred.\r\n * An application can override this behavior as follows:\r\n * ```ts\r\n * RenderSystem.contextLossHandler = (): Promise<any> => {\r\n * // your implementation here.\r\n * }\r\n * ```\r\n * @note Context loss is reported by the browser some short time *after* it has occurred. It is not possible to determine the specific cause.\r\n * @see [[TileAdmin.gpuMemoryLimit]] to limit the amount of GPU memory consumed thereby reducing the likelihood of context loss.\r\n * @see [[TileAdmin.totalTileContentBytes]] for the amount of GPU memory allocated for tile graphics.\r\n */\r\n public static async contextLossHandler(): Promise<any> {\r\n const msg = IModelApp.localization.getLocalizedString(\"iModelJs:Errors.WebGLContextLost\");\r\n return ToolAdmin.exceptionHandler(msg);\r\n }\r\n}\r\n\r\n/** A RenderSystem provides access to resources used by the internal WebGL-based rendering system.\r\n * An application rarely interacts directly with the RenderSystem; instead it interacts with types like [[Viewport]] which\r\n * coordinate with the RenderSystem on the application's behalf.\r\n * @see [[IModelApp.renderSystem]].\r\n * @public\r\n */\r\nexport namespace RenderSystem { // eslint-disable-line no-redeclare\r\n /** Options passed to [[IModelApp.supplyRenderSystem]] to configure the [[RenderSystem]] on startup. Many of these options serve as \"feature flags\" used to enable newer, experimental features. As such they typically begin life tagged as \"alpha\" or \"beta\" and are subsequently deprecated when the feature is declared stable.\r\n *\r\n * @public\r\n */\r\n export interface Options {\r\n /** WebGL extensions to be explicitly disabled, regardless of whether or not the WebGL implementation supports them.\r\n * This is chiefly useful for testing code that only executes in the absence of particular extensions, while running on a system that supports those extensions.\r\n *\r\n * Default value: undefined\r\n *\r\n * @public\r\n */\r\n disabledExtensions?: WebGLExtensionName[];\r\n\r\n /** If true, preserve the shader source code as internal strings, useful for debugging purposes.\r\n *\r\n * Default value: false\r\n *\r\n * @public\r\n */\r\n preserveShaderSourceCode?: boolean;\r\n\r\n /** If true, display solar shadows when enabled by [ViewFlags.shadows]($common).\r\n *\r\n * Default value: true\r\n *\r\n * @beta\r\n */\r\n displaySolarShadows?: boolean;\r\n\r\n /** If the view frustum is sufficiently large, and the EXT_frag_depth WebGL extension is available, use a logarithmic depth buffer to improve depth buffer resolution. Framerate may degrade to an extent while the logarithmic depth buffer is in use. If this option is disabled, or the extension is not supported, the near and far planes of very large view frustums will instead be moved to reduce the draw distance.\r\n *\r\n * Default value: true\r\n *\r\n * @public\r\n */\r\n logarithmicDepthBuffer?: boolean;\r\n\r\n /** ###TODO this appears to do nothing. @internal */\r\n filterMapTextures?: boolean;\r\n /** ###TODO this appears to do nothing. @internal */\r\n filterMapDrapeTextures?: boolean;\r\n\r\n /** If true, [[ScreenViewport]]s will respect the DPI of the display. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].\r\n * @see [[dpiAwareLOD]] to control whether device pixel ratio affects the level of detail for tile graphics and decorations.\r\n * @see [[Viewport.cssPixelsToDevicePixels]] to convert CSS pixels to device pixels.\r\n * @see [[Viewport.devicePixelRatio]].\r\n *\r\n * Default value: true\r\n *\r\n * @public\r\n */\r\n dpiAwareViewports?: boolean;\r\n\r\n /** If defined, this will be used as the device pixel ratio instead of the system's actual device pixel ratio.\r\n * This can be helpful for situations like running in the iOS Simulator where forcing a lower resolution by setting a sub-1 device pixel ratio would increase performance.\r\n * @note If this setting is used to decrease the effective device pixel ratio, the view will appear pixelated.\r\n * @note This setting should only be used to increase performance in situations like the iOS Simulator for testing purposes only. It should not be used in a production situation.\r\n * @note This setting has no effect if [[dpiAwareViewports]] is `false`.\r\n *\r\n * Default value: undefined\r\n *\r\n * @public\r\n */\r\n devicePixelRatioOverride?: number;\r\n\r\n /** If true, [[ScreenViewport]]s will take into account the DPI of the display when computing the level of detail for tile graphics and decorations.\r\n * This can result in sharper-looking images on high-DPI devices like mobile phones, but may reduce performance on such devices.\r\n * @note This setting has no effect if [[dpiAwareViewports]] is `false`.\r\n * @see [[Viewport.devicePixelRatio]].\r\n *\r\n * Default value: false\r\n *\r\n * @public\r\n */\r\n dpiAwareLOD?: boolean;\r\n\r\n /** If true will attempt to create a WebGL2 context, falling back to WebGL1 if WebGL2 is not supported.\r\n *\r\n * Default value: true\r\n *\r\n * @public\r\n */\r\n useWebGL2?: boolean;\r\n\r\n /** If true, plan projection models will be rendered using [PlanProjectionSettings]($common) defined by the [[DisplayStyle3dState]].\r\n * Default value: true\r\n * @public\r\n */\r\n planProjections?: boolean;\r\n\r\n /** To help prevent delays when a user interacts with a [[Viewport]], the WebGL render system can precompile shader programs before any Viewport is opened.\r\n * This particularly helps applications when they do not open a Viewport immediately upon startup - for example, if the user is first expected to select an iModel and a view through the user interface.\r\n * Shader precompilation will cease once all shader programs have been compiled, or when a Viewport is opened (registered with the [[ViewManager]]).\r\n * @note Enabling this feature can slow UI interactions before a [[Viewport]] is opened.\r\n * To enable this feature, set this to `true`.\r\n *\r\n * Default value: false\r\n *\r\n * @beta\r\n */\r\n doIdleWork?: boolean;\r\n\r\n /** WebGL context attributes to explicitly set when initializing [[IModelApp.renderSystem]].\r\n * Exposed chiefly for OpenCities Planner.\r\n * @internal\r\n */\r\n contextAttributes?: WebGLContextAttributes;\r\n\r\n /** If true, will cause exception when a shader uniform is missing (usually optimized out), otherwise will only log these.\r\n * Default value: false\r\n * @public\r\n */\r\n errorOnMissingUniform?: boolean;\r\n\r\n /** If true, and the `WEBGL_debug_shaders` extension is available, accumulate debug information during shader compilation.\r\n * This information can be accessed via `RenderSystemDebugControl.debugShaderFiles`.\r\n * Default value: false\r\n * @internal\r\n */\r\n debugShaders?: boolean;\r\n\r\n /** Initial antialias setting\r\n * If > 1, and a WebGL2 context is being used, will turn on antialiasing using that many samples.\r\n * Default value: 1\r\n * @public\r\n */\r\n antialiasSamples?: number;\r\n }\r\n}\r\n"]}
@@ -108,7 +108,7 @@ export declare abstract class RenderTarget implements IDisposable, RenderMemory.
108
108
  abstract updateViewRect(): boolean;
109
109
  /** `rect` is specified in *CSS* pixels. */
110
110
  abstract readPixels(rect: ViewRect, selector: Pixel.Selector, receiver: Pixel.Receiver, excludeNonLocatable: boolean): void;
111
- /** @deprecated use readImageBuffer */
111
+ /** @deprecated in 3.x. use readImageBuffer */
112
112
  readImage(_rect: ViewRect, _targetSize: Point2d, _flipVertically: boolean): ImageBuffer | undefined;
113
113
  readImageBuffer(_args?: ReadImageBufferArgs): ImageBuffer | undefined;
114
114
  readImageToCanvas(): HTMLCanvasElement;