@itwin/core-common 5.0.0-dev.40 → 5.0.0-dev.49

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 (150) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/cjs/AnalysisStyle.d.ts +0 -3
  3. package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
  4. package/lib/cjs/AnalysisStyle.js +0 -3
  5. package/lib/cjs/AnalysisStyle.js.map +1 -1
  6. package/lib/cjs/FeatureSymbology.d.ts +25 -46
  7. package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
  8. package/lib/cjs/FeatureSymbology.js +14 -29
  9. package/lib/cjs/FeatureSymbology.js.map +1 -1
  10. package/lib/cjs/FeatureTable.d.ts +6 -108
  11. package/lib/cjs/FeatureTable.d.ts.map +1 -1
  12. package/lib/cjs/FeatureTable.js +8 -329
  13. package/lib/cjs/FeatureTable.js.map +1 -1
  14. package/lib/cjs/Gradient.d.ts +3 -4
  15. package/lib/cjs/Gradient.d.ts.map +1 -1
  16. package/lib/cjs/Gradient.js +3 -4
  17. package/lib/cjs/Gradient.js.map +1 -1
  18. package/lib/cjs/HiddenLine.d.ts +17 -18
  19. package/lib/cjs/HiddenLine.d.ts.map +1 -1
  20. package/lib/cjs/HiddenLine.js +0 -1
  21. package/lib/cjs/HiddenLine.js.map +1 -1
  22. package/lib/cjs/Image.d.ts +7 -8
  23. package/lib/cjs/Image.d.ts.map +1 -1
  24. package/lib/cjs/Image.js +3 -4
  25. package/lib/cjs/Image.js.map +1 -1
  26. package/lib/cjs/PlanProjectionSettings.d.ts +1 -2
  27. package/lib/cjs/PlanProjectionSettings.d.ts.map +1 -1
  28. package/lib/cjs/PlanProjectionSettings.js +0 -1
  29. package/lib/cjs/PlanProjectionSettings.js.map +1 -1
  30. package/lib/cjs/PlanarClipMask.d.ts +0 -12
  31. package/lib/cjs/PlanarClipMask.d.ts.map +1 -1
  32. package/lib/cjs/PlanarClipMask.js.map +1 -1
  33. package/lib/cjs/QPoint.d.ts +5 -5
  34. package/lib/cjs/QPoint.d.ts.map +1 -1
  35. package/lib/cjs/QPoint.js +5 -5
  36. package/lib/cjs/QPoint.js.map +1 -1
  37. package/lib/cjs/RenderPolyline.d.ts +36 -0
  38. package/lib/cjs/RenderPolyline.d.ts.map +1 -0
  39. package/lib/cjs/RenderPolyline.js +26 -0
  40. package/lib/cjs/RenderPolyline.js.map +1 -0
  41. package/lib/cjs/RenderTexture.d.ts +4 -2
  42. package/lib/cjs/RenderTexture.d.ts.map +1 -1
  43. package/lib/cjs/RenderTexture.js +8 -0
  44. package/lib/cjs/RenderTexture.js.map +1 -1
  45. package/lib/cjs/TextureMapping.d.ts +17 -14
  46. package/lib/cjs/TextureMapping.d.ts.map +1 -1
  47. package/lib/cjs/TextureMapping.js +22 -17
  48. package/lib/cjs/TextureMapping.js.map +1 -1
  49. package/lib/cjs/ViewFlags.d.ts +1 -3
  50. package/lib/cjs/ViewFlags.d.ts.map +1 -1
  51. package/lib/cjs/ViewFlags.js +1 -3
  52. package/lib/cjs/ViewFlags.js.map +1 -1
  53. package/lib/cjs/core-common.d.ts +1 -1
  54. package/lib/cjs/core-common.d.ts.map +1 -1
  55. package/lib/cjs/core-common.js +1 -1
  56. package/lib/cjs/core-common.js.map +1 -1
  57. package/lib/cjs/internal/PackedFeatureTable.d.ts +111 -0
  58. package/lib/cjs/internal/PackedFeatureTable.d.ts.map +1 -0
  59. package/lib/cjs/internal/PackedFeatureTable.js +349 -0
  60. package/lib/cjs/internal/PackedFeatureTable.js.map +1 -0
  61. package/lib/cjs/internal/RenderMesh.d.ts +52 -0
  62. package/lib/cjs/internal/RenderMesh.d.ts.map +1 -0
  63. package/lib/cjs/{Render.js → internal/RenderMesh.js} +3 -25
  64. package/lib/cjs/internal/RenderMesh.js.map +1 -0
  65. package/lib/cjs/internal/cross-package.d.ts +2 -0
  66. package/lib/cjs/internal/cross-package.d.ts.map +1 -1
  67. package/lib/cjs/internal/cross-package.js +12 -0
  68. package/lib/cjs/internal/cross-package.js.map +1 -1
  69. package/lib/cjs/rpc/core/RpcRequest.d.ts +1 -1
  70. package/lib/cjs/rpc/core/RpcRequest.d.ts.map +1 -1
  71. package/lib/cjs/rpc/core/RpcRequest.js +4 -4
  72. package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
  73. package/lib/esm/AnalysisStyle.d.ts +0 -3
  74. package/lib/esm/AnalysisStyle.d.ts.map +1 -1
  75. package/lib/esm/AnalysisStyle.js +0 -3
  76. package/lib/esm/AnalysisStyle.js.map +1 -1
  77. package/lib/esm/FeatureSymbology.d.ts +25 -46
  78. package/lib/esm/FeatureSymbology.d.ts.map +1 -1
  79. package/lib/esm/FeatureSymbology.js +14 -29
  80. package/lib/esm/FeatureSymbology.js.map +1 -1
  81. package/lib/esm/FeatureTable.d.ts +6 -108
  82. package/lib/esm/FeatureTable.d.ts.map +1 -1
  83. package/lib/esm/FeatureTable.js +6 -324
  84. package/lib/esm/FeatureTable.js.map +1 -1
  85. package/lib/esm/Gradient.d.ts +3 -4
  86. package/lib/esm/Gradient.d.ts.map +1 -1
  87. package/lib/esm/Gradient.js +3 -4
  88. package/lib/esm/Gradient.js.map +1 -1
  89. package/lib/esm/HiddenLine.d.ts +17 -18
  90. package/lib/esm/HiddenLine.d.ts.map +1 -1
  91. package/lib/esm/HiddenLine.js +0 -1
  92. package/lib/esm/HiddenLine.js.map +1 -1
  93. package/lib/esm/Image.d.ts +7 -8
  94. package/lib/esm/Image.d.ts.map +1 -1
  95. package/lib/esm/Image.js +3 -4
  96. package/lib/esm/Image.js.map +1 -1
  97. package/lib/esm/PlanProjectionSettings.d.ts +1 -2
  98. package/lib/esm/PlanProjectionSettings.d.ts.map +1 -1
  99. package/lib/esm/PlanProjectionSettings.js +0 -1
  100. package/lib/esm/PlanProjectionSettings.js.map +1 -1
  101. package/lib/esm/PlanarClipMask.d.ts +0 -12
  102. package/lib/esm/PlanarClipMask.d.ts.map +1 -1
  103. package/lib/esm/PlanarClipMask.js.map +1 -1
  104. package/lib/esm/QPoint.d.ts +5 -5
  105. package/lib/esm/QPoint.d.ts.map +1 -1
  106. package/lib/esm/QPoint.js +5 -5
  107. package/lib/esm/QPoint.js.map +1 -1
  108. package/lib/esm/RenderPolyline.d.ts +36 -0
  109. package/lib/esm/RenderPolyline.d.ts.map +1 -0
  110. package/lib/esm/RenderPolyline.js +23 -0
  111. package/lib/esm/RenderPolyline.js.map +1 -0
  112. package/lib/esm/RenderTexture.d.ts +4 -2
  113. package/lib/esm/RenderTexture.d.ts.map +1 -1
  114. package/lib/esm/RenderTexture.js +8 -0
  115. package/lib/esm/RenderTexture.js.map +1 -1
  116. package/lib/esm/TextureMapping.d.ts +17 -14
  117. package/lib/esm/TextureMapping.d.ts.map +1 -1
  118. package/lib/esm/TextureMapping.js +22 -17
  119. package/lib/esm/TextureMapping.js.map +1 -1
  120. package/lib/esm/ViewFlags.d.ts +1 -3
  121. package/lib/esm/ViewFlags.d.ts.map +1 -1
  122. package/lib/esm/ViewFlags.js +1 -3
  123. package/lib/esm/ViewFlags.js.map +1 -1
  124. package/lib/esm/core-common.d.ts +1 -1
  125. package/lib/esm/core-common.d.ts.map +1 -1
  126. package/lib/esm/core-common.js +1 -1
  127. package/lib/esm/core-common.js.map +1 -1
  128. package/lib/esm/internal/PackedFeatureTable.d.ts +111 -0
  129. package/lib/esm/internal/PackedFeatureTable.d.ts.map +1 -0
  130. package/lib/esm/internal/PackedFeatureTable.js +342 -0
  131. package/lib/esm/internal/PackedFeatureTable.js.map +1 -0
  132. package/lib/esm/internal/RenderMesh.d.ts +52 -0
  133. package/lib/esm/internal/RenderMesh.d.ts.map +1 -0
  134. package/lib/esm/{Render.js → internal/RenderMesh.js} +2 -23
  135. package/lib/esm/internal/RenderMesh.js.map +1 -0
  136. package/lib/esm/internal/cross-package.d.ts +2 -0
  137. package/lib/esm/internal/cross-package.d.ts.map +1 -1
  138. package/lib/esm/internal/cross-package.js +2 -1
  139. package/lib/esm/internal/cross-package.js.map +1 -1
  140. package/lib/esm/rpc/core/RpcRequest.d.ts +1 -1
  141. package/lib/esm/rpc/core/RpcRequest.d.ts.map +1 -1
  142. package/lib/esm/rpc/core/RpcRequest.js +4 -4
  143. package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
  144. package/package.json +7 -7
  145. package/lib/cjs/Render.d.ts +0 -85
  146. package/lib/cjs/Render.d.ts.map +0 -1
  147. package/lib/cjs/Render.js.map +0 -1
  148. package/lib/esm/Render.d.ts +0 -85
  149. package/lib/esm/Render.d.ts.map +0 -1
  150. package/lib/esm/Render.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Rendering
3
3
  */
4
- import { Id64String, IDisposable } from "@itwin/core-bentley";
4
+ import { Id64String } from "@itwin/core-bentley";
5
5
  /** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,
6
6
  * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.
7
7
  * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.
@@ -15,7 +15,7 @@ export type TextureImageSpec = Id64String | string;
15
15
  * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.
16
16
  * @public
17
17
  */
18
- export declare abstract class RenderTexture implements IDisposable {
18
+ export declare abstract class RenderTexture implements Disposable {
19
19
  /** Indicates the type of texture. */
20
20
  readonly type: RenderTexture.Type;
21
21
  /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */
@@ -30,6 +30,8 @@ export declare abstract class RenderTexture implements IDisposable {
30
30
  * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle
31
31
  * its disposal.
32
32
  */
33
+ [Symbol.dispose](): void;
34
+ /** @deprecated in 5.0 Will be made protected in a future release. Use [Symbol.dispose] instead. */
33
35
  abstract dispose(): void;
34
36
  /** An [OrderedComparator]($bentley) that compares this texture against `other`. */
35
37
  compare(other: RenderTexture): number;
@@ -1 +1 @@
1
- {"version":3,"file":"RenderTexture.d.ts","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAoC,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEhG;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,MAAM,CAAC;AAEnD;;;;;GAKG;AACH,8BAAsB,aAAc,YAAW,WAAW;IACxD,qCAAqC;IACrC,SAAgB,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;IACzC,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IAEnC,IAAW,aAAa,IAAI,OAAO,CAAyD;IAC5F,IAAW,OAAO,IAAI,OAAO,CAAmD;IAChF,IAAW,QAAQ,IAAI,OAAO,CAAoD;IAClF,aAAoB,SAAS,IAAI,MAAM,CAAC;IAExC,SAAS,aAAa,IAAI,EAAE,aAAa,CAAC,IAAI;IAK9C;;;;OAIG;aACa,OAAO,IAAI,IAAI;IAE/B,mFAAmF;IAC5E,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM;CAG7C;AAED,cAAc;AACd,yBAAiB,aAAa,CAAC;IAC7B,0FAA0F;IAC1F,KAAY,IAAI;QACd,kFAAkF;QAClF,MAAM,IAAA;QACN,yGAAyG;QACzG,KAAK,IAAA;QACL,mFAAmF;QACnF,WAAW,IAAA;QACX,+DAA+D;QAC/D,MAAM,IAAA;QACN,oHAAoH;QACpH,mBAAmB,IAAA;QACnB,kDAAkD;QAClD,gBAAgB,IAAA;KACjB;IAED;;;OAGG;IACH,MAAa,MAAM;QACjB;;WAEG;QACH,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;QAC7B,qCAAqC;QACrC,SAAgB,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;QACzC;;WAEG;QACH,SAAgB,OAAO,EAAE,OAAO,CAAC;oBAEd,GAAG,CAA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ED;;;OAGG;IACH,MAAa,MAAM;QACjB;;WAEG;QACH,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;QAC7B,qCAAqC;QACrC,SAAgB,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC;QACzC;;WAEG;QACH,SAAgB,OAAO,EAAE,OAAO,CAAC;oBAEd,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,aAAa,CAAC,IAAgC,EAAE,OAAO,GAAE,OAAe;QAM/G,IAAW,aAAa,IAAI,OAAO,CAAyD;QAC5F,IAAW,OAAO,IAAI,OAAO,CAAmD;QAChF,IAAW,QAAQ,IAAI,OAAO,CAAoD;KACnF;CACF"}
@@ -20,6 +20,14 @@ export class RenderTexture {
20
20
  this.type = type;
21
21
  this._guid = Guid.createValue();
22
22
  }
23
+ /** Releases any WebGL resources owned by this texture.
24
+ * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as "external",
25
+ * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle
26
+ * its disposal.
27
+ */
28
+ [Symbol.dispose]() {
29
+ this.dispose(); // eslint-disable-line @typescript-eslint/no-deprecated
30
+ }
23
31
  /** An [OrderedComparator]($bentley) that compares this texture against `other`. */
24
32
  compare(other) {
25
33
  return compareStrings(this._guid, other._guid);
@@ -1 +1 @@
1
- {"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,IAAI,EAAuC,MAAM,qBAAqB,CAAC;AAUhG;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IAMjC,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CA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AAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACnF;IArBY,oBAAM,SAqBlB,CAAA;AACH,CAAC,EA3CgB,aAAa,KAAb,aAAa,QA2C7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { compareStrings, Guid, GuidString, Id64String, IDisposable } from \"@itwin/core-bentley\";\n\n/** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,\n * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.\n * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.\n * @see [[SkySphereImageProps.texture]] and [[SkyCubeImageProps]].\n * @public\n */\nexport type TextureImageSpec = Id64String | string;\n\n/** Represents a texture image applied to a surface during rendering.\n * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].\n * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.\n * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.\n * @public\n */\nexport abstract class RenderTexture implements IDisposable {\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */\n private readonly _guid: GuidString;\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n public abstract get bytesUsed(): number;\n\n protected constructor(type: RenderTexture.Type) {\n this.type = type;\n this._guid = Guid.createValue();\n }\n\n /** Releases any WebGL resources owned by this texture.\n * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as \"external\",\n * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle\n * its disposal.\n */\n public abstract dispose(): void;\n\n /** An [OrderedComparator]($bentley) that compares this texture against `other`. */\n public compare(other: RenderTexture): number {\n return compareStrings(this._guid, other._guid);\n }\n}\n\n/** @public */\nexport namespace RenderTexture {\n /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */\n export enum Type {\n /** An image applied to a surface, with support for mip-mapping and repetition. */\n Normal,\n /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */\n Glyph,\n /** A non-repeating image with no mip-maps, used for example for reality models. */\n TileSection,\n /** A three-dimensional texture used for rendering a skybox. */\n SkyBox,\n /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */\n FilteredTileSection,\n /** A gradient image used for thematic display. */\n ThematicGradient,\n }\n\n /** Parameters used to construct a [[RenderTexture]].\n * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.\n * @public\n */\n export class Params {\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\n * Textures created on the front-end generally have no key.\n */\n public readonly key?: string;\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\n */\n public readonly isOwned: boolean;\n\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\n this.key = key;\n this.type = type;\n this.isOwned = isOwned;\n }\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n }\n}\n"]}
1
+ {"version":3,"file":"RenderTexture.js","sourceRoot":"","sources":["../../src/RenderTexture.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AA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,EAAE,UAAmB,KAAK;YAC7G,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;YACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACzB,CAAC;QAED,IAAW,aAAa,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5F,IAAW,OAAO,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChF,IAAW,QAAQ,KAAc,OAAO,aAAa,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;KACnF;IArBY,oBAAM,SAqBlB,CAAA;AACH,CAAC,EA3CgB,aAAa,KAAb,aAAa,QA2C7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { compareStrings, Guid, GuidString, Id64String } from \"@itwin/core-bentley\";\n\n/** Identifies an image to be used to produce a [[RenderTexture]] for a given purpose - for example,\n * as part of a [[SkyBox]]. If the string is a valid `Id64String`, it refers to a persistent [Texture]($backend) element stored in an iModel.\n * Otherwise, it is interpreted as a Url resolving to an HTMLImageElement.\n * @see [[SkySphereImageProps.texture]] and [[SkyCubeImageProps]].\n * @public\n */\nexport type TextureImageSpec = Id64String | string;\n\n/** Represents a texture image applied to a surface during rendering.\n * A RenderTexture is typically - but not always - associated with a [[RenderMaterial]].\n * @see [RenderSystem.createTextureFromImage]($frontend) to obtain a texture from an HTML image.\n * @see [RenderSystem.createTextureFromElement]($frontend) to obtain a texture from a [Texture]($backend) element.\n * @public\n */\nexport abstract class RenderTexture implements Disposable {\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Used for ordered comparisons, e.g. in DisplayParams.compareForMerge */\n private readonly _guid: GuidString;\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n public abstract get bytesUsed(): number;\n\n protected constructor(type: RenderTexture.Type) {\n this.type = type;\n this._guid = Guid.createValue();\n }\n\n /** Releases any WebGL resources owned by this texture.\n * For a texture created by a [RenderSystem]($frontend) for which [CreateTextureArgs.ownership]($frontend) was specified as \"external\",\n * the caller is responsible for invoking this method when it is finished using the texture; otherwise, the [RenderSystem]($frontend) will handle\n * its disposal.\n */\n public [Symbol.dispose]() {\n this.dispose(); // eslint-disable-line @typescript-eslint/no-deprecated\n }\n\n /** @deprecated in 5.0 Will be made protected in a future release. Use [Symbol.dispose] instead. */\n public abstract dispose(): void; // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** An [OrderedComparator]($bentley) that compares this texture against `other`. */\n public compare(other: RenderTexture): number {\n return compareStrings(this._guid, other._guid);\n }\n}\n\n/** @public */\nexport namespace RenderTexture {\n /** The types of [[RenderTexture]]s that can be created by a [RenderSystem]($frontend). */\n export enum Type {\n /** An image applied to a surface, with support for mip-mapping and repetition. */\n Normal,\n /** An image containing any number of text glyphs, used for efficiently rendering readable small text. */\n Glyph,\n /** A non-repeating image with no mip-maps, used for example for reality models. */\n TileSection,\n /** A three-dimensional texture used for rendering a skybox. */\n SkyBox,\n /** A non-repeating image with mip-maps and and anisotropic filtering, used for map tiles when draped on terrain. */\n FilteredTileSection,\n /** A gradient image used for thematic display. */\n ThematicGradient,\n }\n\n /** Parameters used to construct a [[RenderTexture]].\n * @deprecated in 3.x. use RenderSystem.createTexture and CreateTextureArgs.\n * @public\n */\n export class Params {\n /** A string uniquely identifying this texture within the context of an [[IModel]]. Typically this is the element Id of the corresponding [Texture]($backend) element.\n * Textures created on the front-end generally have no key.\n */\n public readonly key?: string;\n /** Indicates the type of texture. */\n public readonly type: RenderTexture.Type;\n /** Indicates that some object is managing the lifetime of this texture and will take care of calling its dispose function appropriately.\n * An unowned texture associated with a [RenderGraphic]($frontend) will be disposed when the RenderGraphic is disposed.\n */\n public readonly isOwned: boolean;\n\n public constructor(key?: string, type: RenderTexture.Type = RenderTexture.Type.Normal, isOwned: boolean = false) {\n this.key = key;\n this.type = type;\n this.isOwned = isOwned;\n }\n\n public get isTileSection(): boolean { return RenderTexture.Type.TileSection === this.type; }\n public get isGlyph(): boolean { return RenderTexture.Type.Glyph === this.type; }\n public get isSkyBox(): boolean { return RenderTexture.Type.SkyBox === this.type; }\n }\n}\n"]}
@@ -31,8 +31,12 @@ export declare class TextureMapping {
31
31
  /** The parameters describing how the textures are mapped to the surface. */
32
32
  readonly params: TextureMapping.Params;
33
33
  constructor(tx: RenderTexture, params: TextureMapping.Params);
34
- /** @internal */
35
- computeUVParams(visitor: PolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined;
34
+ /** Compute texture coordinates for a polyface.
35
+ * @param visitor The polyface for which to compute UV coordinates based on this texture mapping.
36
+ * @param localToWorld The polyface's local-to-world transform, used for [[TextureMapping.Mode.ElevationDrape]].
37
+ * @returns the texture coordinates, or undefined if computation failed.
38
+ */
39
+ computeUVParams(visitor: PolyfaceVisitor, localToWorld?: Transform): Point2d[] | undefined;
36
40
  /** An [OrderedComparator]($bentley) that compares this mapping against `other`. */
37
41
  compare(other: TextureMapping): number;
38
42
  }
@@ -44,17 +48,17 @@ export declare namespace TextureMapping {
44
48
  Parametric = 0,
45
49
  ElevationDrape = 1,
46
50
  Planar = 2,
47
- /** @internal */
51
+ /** Currently unsupported. */
48
52
  DirectionalDrape = 3,
49
- /** @internal */
53
+ /** Currently unsupported. */
50
54
  Cubic = 4,
51
- /** @internal */
55
+ /** Currently unsupported. */
52
56
  Spherical = 5,
53
- /** @internal */
57
+ /** Currently unsupported. */
54
58
  Cylindrical = 6,
55
- /** @internal */
59
+ /** Currently unsupported. */
56
60
  Solid = 7,
57
- /** @internal Only valid for lights */
61
+ /** Currently unsupported. */
58
62
  FrontProject = 8
59
63
  }
60
64
  /** A 2x3 matrix for mapping a texture image to a surface. */
@@ -116,7 +120,6 @@ export declare namespace TextureMapping {
116
120
  * @note Defaults to [[TextureMapping.Mode.Parametric]].
117
121
  */
118
122
  mapMode?: TextureMapping.Mode;
119
- /** @internal */
120
123
  worldMapping?: boolean;
121
124
  /** True if want to use constant LOD texture mapping for the surface texture. */
122
125
  useConstantLod?: boolean;
@@ -133,7 +136,6 @@ export declare namespace TextureMapping {
133
136
  weight: number;
134
137
  /** The mode by which to map the image to a surface. */
135
138
  mode: TextureMapping.Mode;
136
- /** @internal */
137
139
  worldMapping: boolean;
138
140
  /** True if want to use constant LOD texture mapping for the surface texture. */
139
141
  useConstantLod: boolean;
@@ -142,11 +144,12 @@ export declare namespace TextureMapping {
142
144
  constructor(props?: TextureMapping.ParamProps);
143
145
  /** An [OrderedComparator]($bentley) that compares these Params against `other`. */
144
146
  compare(other: Params): number;
145
- /**
146
- * Generates UV parameters for textured surfaces. Returns undefined on failure.
147
- * @internal
147
+ /** Compute texture coordinates for a polyface.
148
+ * @param visitor The polyface for which to compute UV coordinates based on this texture mapping.
149
+ * @param localToWorld The polyface's local-to-world transform, used for [[TextureMapping.Mode.ElevationDrape]].
150
+ * @returns the texture coordinates, or undefined if computation failed.
148
151
  */
149
- computeUVParams(visitor: IndexedPolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined;
152
+ computeUVParams(visitor: IndexedPolyfaceVisitor, localToWorld?: Transform): Point2d[] | undefined;
150
153
  /** Computes UV parameters given a texture mapping mode of parametric. */
151
154
  private computeParametricUVParams;
152
155
  /** Computes UV parameters given a texture mapping mode of planar. The result is stored in the Point2d array given. */
@@ -1 +1 @@
1
- {"version":3,"file":"TextureMapping.d.ts","sourceRoot":"","sources":["../../src/TextureMapping.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,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@ export class TextureMapping {
20
20
  this.texture = tx;
21
21
  this.params = params;
22
22
  }
23
- /** @internal */
24
- computeUVParams(visitor, transformToImodel) {
25
- return this.params.computeUVParams(visitor, transformToImodel);
23
+ /** Compute texture coordinates for a polyface.
24
+ * @param visitor The polyface for which to compute UV coordinates based on this texture mapping.
25
+ * @param localToWorld The polyface's local-to-world transform, used for [[TextureMapping.Mode.ElevationDrape]].
26
+ * @returns the texture coordinates, or undefined if computation failed.
27
+ */
28
+ computeUVParams(visitor, localToWorld = Transform.createIdentity()) {
29
+ return this.params.computeUVParams(visitor, localToWorld);
26
30
  }
27
31
  /** An [OrderedComparator]($bentley) that compares this mapping against `other`. */
28
32
  compare(other) {
@@ -42,17 +46,17 @@ export class TextureMapping {
42
46
  Mode[Mode["Parametric"] = 0] = "Parametric";
43
47
  Mode[Mode["ElevationDrape"] = 1] = "ElevationDrape";
44
48
  Mode[Mode["Planar"] = 2] = "Planar";
45
- /** @internal */
49
+ /** Currently unsupported. */
46
50
  Mode[Mode["DirectionalDrape"] = 3] = "DirectionalDrape";
47
- /** @internal */
51
+ /** Currently unsupported. */
48
52
  Mode[Mode["Cubic"] = 4] = "Cubic";
49
- /** @internal */
53
+ /** Currently unsupported. */
50
54
  Mode[Mode["Spherical"] = 5] = "Spherical";
51
- /** @internal */
55
+ /** Currently unsupported. */
52
56
  Mode[Mode["Cylindrical"] = 6] = "Cylindrical";
53
- /** @internal */
57
+ /** Currently unsupported. */
54
58
  Mode[Mode["Solid"] = 7] = "Solid";
55
- /** @internal Only valid for lights */
59
+ /** Currently unsupported. */
56
60
  Mode[Mode["FrontProject"] = 8] = "FrontProject";
57
61
  })(Mode = TextureMapping.Mode || (TextureMapping.Mode = {}));
58
62
  /** A 2x3 matrix for mapping a texture image to a surface. */
@@ -123,11 +127,12 @@ export class TextureMapping {
123
127
  || compareBooleans(this.useConstantLod, other.useConstantLod) || this.textureMatrix.compare(other.textureMatrix)
124
128
  || compareConstantLodParams(this.constantLodParams, other.constantLodParams);
125
129
  }
126
- /**
127
- * Generates UV parameters for textured surfaces. Returns undefined on failure.
128
- * @internal
130
+ /** Compute texture coordinates for a polyface.
131
+ * @param visitor The polyface for which to compute UV coordinates based on this texture mapping.
132
+ * @param localToWorld The polyface's local-to-world transform, used for [[TextureMapping.Mode.ElevationDrape]].
133
+ * @returns the texture coordinates, or undefined if computation failed.
129
134
  */
130
- computeUVParams(visitor, transformToImodel) {
135
+ computeUVParams(visitor, localToWorld = Transform.createIdentity()) {
131
136
  switch (this.mode) {
132
137
  default: // Fall through to parametric in default case
133
138
  case TextureMapping.Mode.Parametric: {
@@ -146,7 +151,7 @@ export class TextureMapping {
146
151
  }
147
152
  }
148
153
  case TextureMapping.Mode.ElevationDrape: {
149
- return this.computeElevationDrapeUVParams(visitor, this.textureMatrix.transform, transformToImodel);
154
+ return this.computeElevationDrapeUVParams(visitor, this.textureMatrix.transform, localToWorld);
150
155
  }
151
156
  }
152
157
  }
@@ -202,13 +207,13 @@ export class TextureMapping {
202
207
  return params;
203
208
  }
204
209
  /** Computes UV parameters given a texture mapping mode of elevation drape. The result is stored in the Point2d array given. */
205
- computeElevationDrapeUVParams(visitor, uvTransform, transformToIModel) {
210
+ computeElevationDrapeUVParams(visitor, uvTransform, localToWorld) {
206
211
  const params = [];
207
212
  const numEdges = visitor.numEdgesThisFacet;
208
213
  for (let i = 0; i < numEdges; i++) {
209
214
  const point = visitor.point.getPoint3dAtUncheckedPointIndex(i);
210
- if (transformToIModel !== undefined)
211
- transformToIModel.multiplyPoint3d(point, point);
215
+ if (localToWorld !== undefined)
216
+ localToWorld.multiplyPoint3d(point, point);
212
217
  params.push(Point2d.createFrom(point));
213
218
  uvTransform.multiplyPoint2d(params[i], params[i]);
214
219
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextureMapping.js","sourceRoot":"","sources":["../../src/TextureMapping.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAA0B,QAAQ,EAAE,OA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CAAC,CAAC;gBACxF,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,+HAA+H;QACvH,6BAA6B,CAAC,OAA+B,EAAE,WAAsB,EAAE,iBAA6B;YAC1H,MAAM,MAAM,GAAc,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC;gBAE/D,IAAI,iBAAiB,KAAK,SAAS;oBACjC,iBAAiB,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAElD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KACF;IAtJY,qBAAM,SAsJlB,CAAA;AACH,CAAC,EAjRgB,cAAc,KAAd,cAAc,QAiR9B;AAED,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { IndexedPolyfaceVisitor, Matrix3d, Point2d, Point3d, PolyfaceVisitor, Transform, Vector3d, XAndY } from \"@itwin/core-geometry\";\nimport { RenderTexture } from \"./RenderTexture\";\nimport { compareBooleans, compareBooleansOrUndefined, compareNumbers, compareNumbersOrUndefined, comparePossiblyUndefined } from \"@itwin/core-bentley\";\n\n/** Defines normal map parameters.\n * @beta\n */\nexport interface NormalMapParams {\n /** The texture to use as a normal map. If not present then the pattern map texture will be used as a normal map. */\n normalMap?: RenderTexture;\n /** True if the Y component stored in the green channel should be negated. By default, positive Y points downward, but some\n * normal maps are created with positive Y pointing upward.\n */\n greenUp?: boolean;\n /** Scale factor by which to multiply the components of the normal extracted from [[normalMap]]. */\n scale?: number;\n /** True if want to use constant LOD texture mapping for the normal map texture. */\n useConstantLod?: boolean;\n}\n\nfunction compareNormalMapParams(lhs: NormalMapParams, rhs: NormalMapParams): number {\n return comparePossiblyUndefined((lh, rh) => lh.compare(rh), lhs.normalMap, rhs.normalMap)\n || compareBooleansOrUndefined(lhs.greenUp, rhs.greenUp) || compareNumbersOrUndefined(lhs.scale, rhs.scale)\n || compareBooleansOrUndefined(lhs.useConstantLod, rhs.useConstantLod);\n}\n\n/** Describes how to map a [[RenderTexture]]'s image onto a surface as part of a [[RenderMaterial]].\n * @public\n */\nexport class TextureMapping {\n /** The texture to be mapped to the surface. If normalMapParams is present but does not contain a normal map, then texture is used as a normal map rather than a pattern map. */\n public readonly texture: RenderTexture;\n /** The parameters for normal mapping.\n * @beta\n */\n public normalMapParams?: NormalMapParams;\n /** The parameters describing how the textures are mapped to the surface. */\n public readonly params: TextureMapping.Params;\n\n public constructor(tx: RenderTexture, params: TextureMapping.Params) {\n this.texture = tx;\n this.params = params;\n }\n\n /** @internal */\n public computeUVParams(visitor: PolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined {\n return this.params.computeUVParams(visitor as IndexedPolyfaceVisitor, transformToImodel);\n }\n\n /** An [OrderedComparator]($bentley) that compares this mapping against `other`. */\n public compare(other: TextureMapping): number {\n if (this === other) {\n return 0;\n }\n\n return this.texture.compare(other.texture) || this.params.compare(other.params)\n || comparePossiblyUndefined((lh, rh) => compareNormalMapParams(lh, rh), this.normalMapParams, other.normalMapParams);\n }\n}\n\n/** @public */\nexport namespace TextureMapping {\n /** Enumerates the possible texture mapping modes. */\n export enum Mode {\n None = -1,\n Parametric = 0,\n ElevationDrape = 1,\n Planar = 2,\n /** @internal */\n DirectionalDrape = 3,\n /** @internal */\n Cubic = 4,\n /** @internal */\n Spherical = 5,\n /** @internal */\n Cylindrical = 6,\n /** @internal */\n Solid = 7,\n /** @internal Only valid for lights */\n FrontProject = 8,\n }\n\n /** A 2x3 matrix for mapping a texture image to a surface. */\n export class Trans2x3 {\n /** The 3x4 transform produced from the 2x3 matrix. */\n public readonly transform: Transform;\n\n /** Construct from the two rows of the matrix:\n * ```\n * | m00 m01 originX |\n * | m10 m11 originY |\n * ```\n * Producing the [Transform]($core-geometry):\n * ```\n * | m00 m01 0 originX |\n * | m10 m11 0 originY |\n * | 0 0 1 0 |\n * ```\n */\n public constructor(m00 = 1, m01 = 0, originX = 0, m10 = 0, m11 = 1, originY = 0) {\n const origin = new Point3d(originX, originY, 0);\n const matrix = Matrix3d.createRowValues(m00, m01, 0, m10, m11, 0, 0, 0, 1);\n this.transform = Transform.createRefs(origin, matrix);\n }\n\n /** An immutable 2x3 identity matrix. */\n public static readonly identity = new Trans2x3();\n\n /** An [OrderedComparator]($bentley) that compares this Trans2x3 against `other`. */\n public compare(other: Trans2x3): number {\n if (this === other) {\n return 0;\n }\n\n const originDiff = compareNumbers(this.transform.origin.x, other.transform.origin.x) || compareNumbers(this.transform.origin.y, other.transform.origin.y);\n if (originDiff !== 0) {\n return originDiff;\n }\n\n for (const i of [0, 1, 3, 4]) {\n const matDiff = compareNumbers(this.transform.matrix.coffs[i], other.transform.matrix.coffs[i]);\n if (matDiff !== 0) {\n return matDiff;\n }\n }\n\n return 0;\n }\n }\n\n /** Properties used to construct a [[TextureMapping.ConstantLodParams]]. */\n export interface ConstantLodParamProps {\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1. */\n repetitions?: number;\n /** An offset in world units used to shift the texture. Defaults to (0, 0). */\n offset?: XAndY;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. Defaults to 1.*/\n minDistClamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. Defaults to 2^32. */\n maxDistClamp?: number;\n }\n\n /** Parameters to define constant level of detail mapping mode, a mode of texture coordinate generation which dynamically creates\n * texture cooprdinates so that the level of detail of the texture in the rendered image remains somewhat constant. */\n export interface ConstantLodParams {\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. */\n repetitions: number;\n /** An offset in world units used to shift the texture. */\n offset: XAndY;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. */\n minDistClamp: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. */\n maxDistClamp: number;\n }\n\n function compareConstantLodParams(lhs: ConstantLodParams, rhs: ConstantLodParams): number {\n return compareNumbers(lhs.repetitions, rhs.repetitions) || compareNumbers(lhs.offset.x, rhs.offset.x) || compareNumbers(lhs.offset.y, rhs.offset.y)\n || compareNumbers(lhs.minDistClamp, rhs.minDistClamp) || compareNumbers(lhs.maxDistClamp, rhs.maxDistClamp);\n }\n\n /** Properties used to construct a [[TextureMapping.Params]]. */\n export interface ParamProps {\n /** The matrix used to map the image to a surface. */\n textureMat2x3?: TextureMapping.Trans2x3;\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the surface's color.\n * A value of 0.0 uses only the surface color. A value of 1.0 uses only the texture color. A value of 0.5 uses an even mix of both.\n * @note This affects only the red, green, and blue components of the color. The alpha sampled from the texture is always multiplied by the surface color's alpha.\n * @note Defaults to 1.0\n */\n textureWeight?: number;\n /** The mode by which to map the image to a surface.\n * @note Defaults to [[TextureMapping.Mode.Parametric]].\n */\n mapMode?: TextureMapping.Mode;\n /** @internal */\n worldMapping?: boolean;\n /** True if want to use constant LOD texture mapping for the surface texture. */\n useConstantLod?: boolean;\n /** Parameters for constantLod mapping mode. */\n constantLodProps?: ConstantLodParamProps;\n }\n\n /** Parameters describing how a [[RenderTexture]]'s image is mapped to a surface. */\n export class Params {\n /** The matrix used to map the image to a surface. */\n public textureMatrix: TextureMapping.Trans2x3;\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the element's color.\n * A value of 0.0 uses only the element color. A value of 1.0 uses only the texture color.\n */\n public weight: number;\n /** The mode by which to map the image to a surface. */\n public mode: TextureMapping.Mode;\n /** @internal */\n public worldMapping: boolean;\n /** True if want to use constant LOD texture mapping for the surface texture. */\n public useConstantLod: boolean;\n /** Parameters for constantLod mapping mode. */\n public constantLodParams: ConstantLodParams;\n\n public constructor(props?: TextureMapping.ParamProps) {\n this.textureMatrix = props?.textureMat2x3 ?? Trans2x3.identity;\n this.weight = props?.textureWeight ?? 1;\n this.mode = props?.mapMode ?? Mode.Parametric;\n this.worldMapping = props?.worldMapping ?? false;\n this.useConstantLod = props?.useConstantLod ?? false;\n this.constantLodParams = {\n repetitions: props?.constantLodProps?.repetitions ?? 1,\n offset: props?.constantLodProps?.offset ?? { x: 0, y: 0 },\n minDistClamp: props?.constantLodProps?.minDistClamp ?? 1,\n maxDistClamp: props?.constantLodProps?.maxDistClamp ?? 4096 * 1024 * 1024,\n };\n }\n\n /** An [OrderedComparator]($bentley) that compares these Params against `other`. */\n public compare(other: Params): number {\n if (this === other) {\n return 0;\n }\n\n return compareNumbers(this.weight, other.weight) || compareNumbers(this.mode, other.mode) || compareBooleans(this.worldMapping, other.worldMapping)\n || compareBooleans(this.useConstantLod, other.useConstantLod) || this.textureMatrix.compare(other.textureMatrix)\n || compareConstantLodParams(this.constantLodParams, other.constantLodParams);\n }\n\n /**\n * Generates UV parameters for textured surfaces. Returns undefined on failure.\n * @internal\n */\n public computeUVParams(visitor: IndexedPolyfaceVisitor, transformToImodel: Transform): Point2d[] | undefined {\n switch (this.mode) {\n default: // Fall through to parametric in default case\n case TextureMapping.Mode.Parametric: {\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\n }\n case TextureMapping.Mode.Planar: {\n const normalIndices = visitor.normalIndex;\n if (!normalIndices)\n return undefined;\n\n // Ignore planar mode unless master or sub units for scaleMode and facet is planar\n if (!this.worldMapping || (visitor.normalIndex !== undefined && (normalIndices[0] !== normalIndices[1] || normalIndices[0] !== normalIndices[2]))) {\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\n } else {\n return this.computePlanarUVParams(visitor, this.textureMatrix.transform);\n }\n }\n case TextureMapping.Mode.ElevationDrape: {\n return this.computeElevationDrapeUVParams(visitor, this.textureMatrix.transform, transformToImodel);\n }\n }\n }\n\n /** Computes UV parameters given a texture mapping mode of parametric. */\n private computeParametricUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, isRelativeUnits: boolean): Point2d[] {\n const params: Point2d[] = [];\n for (let i = 0; i < visitor.numEdgesThisFacet; i++) {\n let param = Point2d.create();\n\n if (isRelativeUnits || !visitor.tryGetDistanceParameter(i, param)) {\n if (!visitor.tryGetNormalizedParameter(i, param)) {\n // If mesh does not have facetFaceData, we still want to use the texture coordinates if they are present\n param = visitor.getParam(i)!;\n }\n }\n\n params.push(uvTransform.multiplyPoint2d(param));\n }\n return params;\n }\n\n /** Computes UV parameters given a texture mapping mode of planar. The result is stored in the Point2d array given. */\n private computePlanarUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform): Point2d[] | undefined {\n const params: Point2d[] = [];\n const points = visitor.point;\n let normal: Vector3d;\n\n if (visitor.normal === undefined)\n normal = points.getPoint3dAtUncheckedPointIndex(0).crossProductToPoints(points.getPoint3dAtUncheckedPointIndex(1), points.getPoint3dAtUncheckedPointIndex(2));\n else\n normal = visitor.normal.getVector3dAtCheckedVectorIndex(0)!;\n\n if (!normal.normalize(normal))\n return undefined;\n\n // adjust U texture coordinate to be a continuous length starting at the\n // origin. V coordinate stays the same. This mode assumes Z is up vector\n\n // Flipping normal puts us in a planar coordinate system consistent with MicroStation's display system\n normal.scale(-1.0, normal);\n\n // pick the first vertex normal\n const sideVector = Vector3d.create(normal.y, -normal.x, 0.0);\n\n // if the magnitude of the normal is near zero, the real normal points\n // almost straighten up.. In this case, use Y as the up vector to match QV\n\n const magnitude = sideVector.magnitude();\n sideVector.normalize(sideVector); // won't remain undefined if failed due to following check..\n\n if (magnitude < 1e-3) {\n normal.set(0, 0, -1);\n sideVector.set(1, 0, 0);\n }\n\n const upVector = sideVector.crossProduct(normal).normalize();\n if (!upVector)\n return undefined;\n\n const numEdges = visitor.numEdgesThisFacet;\n for (let i = 0; i < numEdges; i++) {\n const vector = Vector3d.createFrom(points.getPoint3dAtUncheckedPointIndex(i));\n\n params.push(Point2d.create(vector.dotProduct(sideVector), vector.dotProduct(upVector)));\n uvTransform.multiplyPoint2d(params[i], params[i]);\n }\n return params;\n }\n\n /** Computes UV parameters given a texture mapping mode of elevation drape. The result is stored in the Point2d array given. */\n private computeElevationDrapeUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, transformToIModel?: Transform): Point2d[] {\n const params: Point2d[] = [];\n const numEdges = visitor.numEdgesThisFacet;\n for (let i = 0; i < numEdges; i++) {\n const point = visitor.point.getPoint3dAtUncheckedPointIndex(i);\n\n if (transformToIModel !== undefined)\n transformToIModel.multiplyPoint3d(point, point);\n\n params.push(Point2d.createFrom(point));\n uvTransform.multiplyPoint2d(params[i], params[i]);\n }\n return params;\n }\n }\n}\n\nObject.freeze(TextureMapping.Trans2x3.identity);\n"]}
1
+ {"version":3,"file":"TextureMapping.js","sourceRoot":"","sources":["../../src/TextureMapping.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAA0B,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAmB,SAAS,EAAE,QAAQ,EAAS,MAAM,sBAAsB,CAAC;AAEvI,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,cAAc,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAk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,MAAM,CAAC;QAChB,CAAC;QAED,+HAA+H;QACvH,6BAA6B,CAAC,OAA+B,EAAE,WAAsB,EAAE,YAAwB;YACrH,MAAM,MAAM,GAAc,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAC3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC;gBAE/D,IAAI,YAAY,KAAK,SAAS;oBAC5B,YAAY,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBAE7C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KACF;IAtJY,qBAAM,SAsJlB,CAAA;AACH,CAAC,EAhRgB,cAAc,KAAd,cAAc,QAgR9B;AAED,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { IndexedPolyfaceVisitor, Matrix3d, Point2d, Point3d, PolyfaceVisitor, Transform, Vector3d, XAndY } from \"@itwin/core-geometry\";\nimport { RenderTexture } from \"./RenderTexture\";\nimport { compareBooleans, compareBooleansOrUndefined, compareNumbers, compareNumbersOrUndefined, comparePossiblyUndefined } from \"@itwin/core-bentley\";\n\n/** Defines normal map parameters.\n * @beta\n */\nexport interface NormalMapParams {\n /** The texture to use as a normal map. If not present then the pattern map texture will be used as a normal map. */\n normalMap?: RenderTexture;\n /** True if the Y component stored in the green channel should be negated. By default, positive Y points downward, but some\n * normal maps are created with positive Y pointing upward.\n */\n greenUp?: boolean;\n /** Scale factor by which to multiply the components of the normal extracted from [[normalMap]]. */\n scale?: number;\n /** True if want to use constant LOD texture mapping for the normal map texture. */\n useConstantLod?: boolean;\n}\n\nfunction compareNormalMapParams(lhs: NormalMapParams, rhs: NormalMapParams): number {\n return comparePossiblyUndefined((lh, rh) => lh.compare(rh), lhs.normalMap, rhs.normalMap)\n || compareBooleansOrUndefined(lhs.greenUp, rhs.greenUp) || compareNumbersOrUndefined(lhs.scale, rhs.scale)\n || compareBooleansOrUndefined(lhs.useConstantLod, rhs.useConstantLod);\n}\n\n/** Describes how to map a [[RenderTexture]]'s image onto a surface as part of a [[RenderMaterial]].\n * @public\n */\nexport class TextureMapping {\n /** The texture to be mapped to the surface. If normalMapParams is present but does not contain a normal map, then texture is used as a normal map rather than a pattern map. */\n public readonly texture: RenderTexture;\n /** The parameters for normal mapping.\n * @beta\n */\n public normalMapParams?: NormalMapParams;\n /** The parameters describing how the textures are mapped to the surface. */\n public readonly params: TextureMapping.Params;\n\n public constructor(tx: RenderTexture, params: TextureMapping.Params) {\n this.texture = tx;\n this.params = params;\n }\n\n /** Compute texture coordinates for a polyface.\n * @param visitor The polyface for which to compute UV coordinates based on this texture mapping.\n * @param localToWorld The polyface's local-to-world transform, used for [[TextureMapping.Mode.ElevationDrape]].\n * @returns the texture coordinates, or undefined if computation failed.\n */\n public computeUVParams(visitor: PolyfaceVisitor, localToWorld: Transform = Transform.createIdentity()): Point2d[] | undefined {\n return this.params.computeUVParams(visitor as IndexedPolyfaceVisitor, localToWorld);\n }\n\n /** An [OrderedComparator]($bentley) that compares this mapping against `other`. */\n public compare(other: TextureMapping): number {\n if (this === other) {\n return 0;\n }\n\n return this.texture.compare(other.texture) || this.params.compare(other.params)\n || comparePossiblyUndefined((lh, rh) => compareNormalMapParams(lh, rh), this.normalMapParams, other.normalMapParams);\n }\n}\n\n/** @public */\nexport namespace TextureMapping {\n /** Enumerates the possible texture mapping modes. */\n export enum Mode {\n None = -1,\n Parametric = 0,\n ElevationDrape = 1,\n Planar = 2,\n /** Currently unsupported. */\n DirectionalDrape = 3,\n /** Currently unsupported. */\n Cubic = 4,\n /** Currently unsupported. */\n Spherical = 5,\n /** Currently unsupported. */\n Cylindrical = 6,\n /** Currently unsupported. */\n Solid = 7,\n /** Currently unsupported. */\n FrontProject = 8,\n }\n\n /** A 2x3 matrix for mapping a texture image to a surface. */\n export class Trans2x3 {\n /** The 3x4 transform produced from the 2x3 matrix. */\n public readonly transform: Transform;\n\n /** Construct from the two rows of the matrix:\n * ```\n * | m00 m01 originX |\n * | m10 m11 originY |\n * ```\n * Producing the [Transform]($core-geometry):\n * ```\n * | m00 m01 0 originX |\n * | m10 m11 0 originY |\n * | 0 0 1 0 |\n * ```\n */\n public constructor(m00 = 1, m01 = 0, originX = 0, m10 = 0, m11 = 1, originY = 0) {\n const origin = new Point3d(originX, originY, 0);\n const matrix = Matrix3d.createRowValues(m00, m01, 0, m10, m11, 0, 0, 0, 1);\n this.transform = Transform.createRefs(origin, matrix);\n }\n\n /** An immutable 2x3 identity matrix. */\n public static readonly identity = new Trans2x3();\n\n /** An [OrderedComparator]($bentley) that compares this Trans2x3 against `other`. */\n public compare(other: Trans2x3): number {\n if (this === other) {\n return 0;\n }\n\n const originDiff = compareNumbers(this.transform.origin.x, other.transform.origin.x) || compareNumbers(this.transform.origin.y, other.transform.origin.y);\n if (originDiff !== 0) {\n return originDiff;\n }\n\n for (const i of [0, 1, 3, 4]) {\n const matDiff = compareNumbers(this.transform.matrix.coffs[i], other.transform.matrix.coffs[i]);\n if (matDiff !== 0) {\n return matDiff;\n }\n }\n\n return 0;\n }\n }\n\n /** Properties used to construct a [[TextureMapping.ConstantLodParams]]. */\n export interface ConstantLodParamProps {\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1. */\n repetitions?: number;\n /** An offset in world units used to shift the texture. Defaults to (0, 0). */\n offset?: XAndY;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. Defaults to 1.*/\n minDistClamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. Defaults to 2^32. */\n maxDistClamp?: number;\n }\n\n /** Parameters to define constant level of detail mapping mode, a mode of texture coordinate generation which dynamically creates\n * texture cooprdinates so that the level of detail of the texture in the rendered image remains somewhat constant. */\n export interface ConstantLodParams {\n /** The number of times the texture is repeated. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. */\n repetitions: number;\n /** An offset in world units used to shift the texture. */\n offset: XAndY;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture. */\n minDistClamp: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture. */\n maxDistClamp: number;\n }\n\n function compareConstantLodParams(lhs: ConstantLodParams, rhs: ConstantLodParams): number {\n return compareNumbers(lhs.repetitions, rhs.repetitions) || compareNumbers(lhs.offset.x, rhs.offset.x) || compareNumbers(lhs.offset.y, rhs.offset.y)\n || compareNumbers(lhs.minDistClamp, rhs.minDistClamp) || compareNumbers(lhs.maxDistClamp, rhs.maxDistClamp);\n }\n\n /** Properties used to construct a [[TextureMapping.Params]]. */\n export interface ParamProps {\n /** The matrix used to map the image to a surface. */\n textureMat2x3?: TextureMapping.Trans2x3;\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the surface's color.\n * A value of 0.0 uses only the surface color. A value of 1.0 uses only the texture color. A value of 0.5 uses an even mix of both.\n * @note This affects only the red, green, and blue components of the color. The alpha sampled from the texture is always multiplied by the surface color's alpha.\n * @note Defaults to 1.0\n */\n textureWeight?: number;\n /** The mode by which to map the image to a surface.\n * @note Defaults to [[TextureMapping.Mode.Parametric]].\n */\n mapMode?: TextureMapping.Mode;\n worldMapping?: boolean;\n /** True if want to use constant LOD texture mapping for the surface texture. */\n useConstantLod?: boolean;\n /** Parameters for constantLod mapping mode. */\n constantLodProps?: ConstantLodParamProps;\n }\n\n /** Parameters describing how a [[RenderTexture]]'s image is mapped to a surface. */\n export class Params {\n /** The matrix used to map the image to a surface. */\n public textureMatrix: TextureMapping.Trans2x3;\n /** The ratio in [0, 1] with which to mix the color sampled from the texture with the element's color.\n * A value of 0.0 uses only the element color. A value of 1.0 uses only the texture color.\n */\n public weight: number;\n /** The mode by which to map the image to a surface. */\n public mode: TextureMapping.Mode;\n public worldMapping: boolean;\n /** True if want to use constant LOD texture mapping for the surface texture. */\n public useConstantLod: boolean;\n /** Parameters for constantLod mapping mode. */\n public constantLodParams: ConstantLodParams;\n\n public constructor(props?: TextureMapping.ParamProps) {\n this.textureMatrix = props?.textureMat2x3 ?? Trans2x3.identity;\n this.weight = props?.textureWeight ?? 1;\n this.mode = props?.mapMode ?? Mode.Parametric;\n this.worldMapping = props?.worldMapping ?? false;\n this.useConstantLod = props?.useConstantLod ?? false;\n this.constantLodParams = {\n repetitions: props?.constantLodProps?.repetitions ?? 1,\n offset: props?.constantLodProps?.offset ?? { x: 0, y: 0 },\n minDistClamp: props?.constantLodProps?.minDistClamp ?? 1,\n maxDistClamp: props?.constantLodProps?.maxDistClamp ?? 4096 * 1024 * 1024,\n };\n }\n\n /** An [OrderedComparator]($bentley) that compares these Params against `other`. */\n public compare(other: Params): number {\n if (this === other) {\n return 0;\n }\n\n return compareNumbers(this.weight, other.weight) || compareNumbers(this.mode, other.mode) || compareBooleans(this.worldMapping, other.worldMapping)\n || compareBooleans(this.useConstantLod, other.useConstantLod) || this.textureMatrix.compare(other.textureMatrix)\n || compareConstantLodParams(this.constantLodParams, other.constantLodParams);\n }\n\n /** Compute texture coordinates for a polyface.\n * @param visitor The polyface for which to compute UV coordinates based on this texture mapping.\n * @param localToWorld The polyface's local-to-world transform, used for [[TextureMapping.Mode.ElevationDrape]].\n * @returns the texture coordinates, or undefined if computation failed.\n */\n public computeUVParams(visitor: IndexedPolyfaceVisitor, localToWorld: Transform = Transform.createIdentity()): Point2d[] | undefined {\n switch (this.mode) {\n default: // Fall through to parametric in default case\n case TextureMapping.Mode.Parametric: {\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\n }\n case TextureMapping.Mode.Planar: {\n const normalIndices = visitor.normalIndex;\n if (!normalIndices)\n return undefined;\n\n // Ignore planar mode unless master or sub units for scaleMode and facet is planar\n if (!this.worldMapping || (visitor.normalIndex !== undefined && (normalIndices[0] !== normalIndices[1] || normalIndices[0] !== normalIndices[2]))) {\n return this.computeParametricUVParams(visitor, this.textureMatrix.transform, !this.worldMapping);\n } else {\n return this.computePlanarUVParams(visitor, this.textureMatrix.transform);\n }\n }\n case TextureMapping.Mode.ElevationDrape: {\n return this.computeElevationDrapeUVParams(visitor, this.textureMatrix.transform, localToWorld);\n }\n }\n }\n\n /** Computes UV parameters given a texture mapping mode of parametric. */\n private computeParametricUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, isRelativeUnits: boolean): Point2d[] {\n const params: Point2d[] = [];\n for (let i = 0; i < visitor.numEdgesThisFacet; i++) {\n let param = Point2d.create();\n\n if (isRelativeUnits || !visitor.tryGetDistanceParameter(i, param)) {\n if (!visitor.tryGetNormalizedParameter(i, param)) {\n // If mesh does not have facetFaceData, we still want to use the texture coordinates if they are present\n param = visitor.getParam(i)!;\n }\n }\n\n params.push(uvTransform.multiplyPoint2d(param));\n }\n return params;\n }\n\n /** Computes UV parameters given a texture mapping mode of planar. The result is stored in the Point2d array given. */\n private computePlanarUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform): Point2d[] | undefined {\n const params: Point2d[] = [];\n const points = visitor.point;\n let normal: Vector3d;\n\n if (visitor.normal === undefined)\n normal = points.getPoint3dAtUncheckedPointIndex(0).crossProductToPoints(points.getPoint3dAtUncheckedPointIndex(1), points.getPoint3dAtUncheckedPointIndex(2));\n else\n normal = visitor.normal.getVector3dAtCheckedVectorIndex(0)!;\n\n if (!normal.normalize(normal))\n return undefined;\n\n // adjust U texture coordinate to be a continuous length starting at the\n // origin. V coordinate stays the same. This mode assumes Z is up vector\n\n // Flipping normal puts us in a planar coordinate system consistent with MicroStation's display system\n normal.scale(-1.0, normal);\n\n // pick the first vertex normal\n const sideVector = Vector3d.create(normal.y, -normal.x, 0.0);\n\n // if the magnitude of the normal is near zero, the real normal points\n // almost straighten up.. In this case, use Y as the up vector to match QV\n\n const magnitude = sideVector.magnitude();\n sideVector.normalize(sideVector); // won't remain undefined if failed due to following check..\n\n if (magnitude < 1e-3) {\n normal.set(0, 0, -1);\n sideVector.set(1, 0, 0);\n }\n\n const upVector = sideVector.crossProduct(normal).normalize();\n if (!upVector)\n return undefined;\n\n const numEdges = visitor.numEdgesThisFacet;\n for (let i = 0; i < numEdges; i++) {\n const vector = Vector3d.createFrom(points.getPoint3dAtUncheckedPointIndex(i));\n\n params.push(Point2d.create(vector.dotProduct(sideVector), vector.dotProduct(upVector)));\n uvTransform.multiplyPoint2d(params[i], params[i]);\n }\n return params;\n }\n\n /** Computes UV parameters given a texture mapping mode of elevation drape. The result is stored in the Point2d array given. */\n private computeElevationDrapeUVParams(visitor: IndexedPolyfaceVisitor, uvTransform: Transform, localToWorld?: Transform): Point2d[] {\n const params: Point2d[] = [];\n const numEdges = visitor.numEdgesThisFacet;\n for (let i = 0; i < numEdges; i++) {\n const point = visitor.point.getPoint3dAtUncheckedPointIndex(i);\n\n if (localToWorld !== undefined)\n localToWorld.multiplyPoint3d(point, point);\n\n params.push(Point2d.createFrom(point));\n uvTransform.multiplyPoint2d(params[i], params[i]);\n }\n return params;\n }\n }\n}\n\nObject.freeze(TextureMapping.Trans2x3.identity);\n"]}
@@ -241,9 +241,7 @@ export declare class ViewFlags {
241
241
  * @see [[copy]] and [[override]] to change multiple properties.
242
242
  */
243
243
  withRenderMode(renderMode: RenderMode): ViewFlags;
244
- /** Adjust view flags for renderer.
245
- * @internal
246
- */
244
+ /** Adjust some view flags based on [[renderMode]]. For example, [[transparency]] is always treated as `false` in [[RenderMode.SolidFill]]. */
247
245
  normalize(): ViewFlags;
248
246
  /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */
249
247
  hiddenEdgesVisible(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewFlags.d.ts","sourceRoot":"","sources":["../../src/ViewFlags.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAa,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAElF;;;;GAIG;AACH,oBAAY,UAAU;IACpB;;;;OAIG;IACH,SAAS,IAAI;IACb;;;;OAIG;IACH,WAAW,IAAI;IACf;;;;;OAKG;IACH,SAAS,IAAI;IACb;;;OAGG;IACH,UAAU,IAAI;CACf;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC5B,+EAA+E;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uFAAuF;IACvF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,6EAA6E;IAC7E,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,YAAY,CAAC,EAAE,OAAO,CAAC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;IA2BvD;;;;;OAKG;IACI,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;IAIlE;;;;OAIG;IACI,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;IA4BnE;;;;;;OAMG;IACI,IAAI,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS;IAS3F;;;;OAIG;IACI,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS;IAIxD,8IAA8I;IACvI,SAAS,IAAI,SAAS;IAoB7B,iHAAiH;IAC1G,kBAAkB,IAAI,OAAO;IAWpC,wHAAwH;IACjH,aAAa,IAAI,OAAO;IAI/B;;OAEG;IACI,MAAM,IAAI,aAAa;IAqD9B,sDAAsD;IAC/C,kBAAkB,IAAI,QAAQ,CAAC,aAAa,CAAC;IA+BpD,kFAAkF;IAClF,gBAAuB,QAAQ,YAAmB;IAElD;;OAEG;WACW,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;IAIrE;;;;;;;OAOG;WACW,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,SAAS;IA0CvD,yDAAyD;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GAAG,OAAO;CA6B7D;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC"}
@@ -155,9 +155,7 @@ export class ViewFlags {
155
155
  withRenderMode(renderMode) {
156
156
  return renderMode === this.renderMode ? this : this.copy({ renderMode });
157
157
  }
158
- /** Adjust view flags for renderer.
159
- * @internal
160
- */
158
+ /** Adjust some view flags based on [[renderMode]]. For example, [[transparency]] is always treated as `false` in [[RenderMode.SolidFill]]. */
161
159
  normalize() {
162
160
  switch (this.renderMode) {
163
161
  case RenderMode.Wireframe:
@@ -1 +1 @@
1
- {"version":3,"file":"ViewFlags.js","sourceRoot":"","sources":["../../src/ViewFlags.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qBAAqB;AAErB,OAAO,EAAE,SAAS,EAAoC,MAAM,qBAAqB,CAAC;AAElF;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB;;;;OAIG;IACH,qDAAa,CAAA;IACb;;;;OAIG;IACH,yDAAe,CAAA;IACf;;;;;OAKG;IACH,qDAAa,CAAA;IACb;;;OAGG;IACH,uDAAc,CAAA;AAChB,CAAC,EAzBW,UAAU,KAAV,UAAU,QAyBrB;AA0ED,SAAS,aAAa,CAAC,UAAsB,EAAE,YAAqB;IAClE,OAAO,YAAY,IAAI,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,SAAS;IAsFpB;;OAEG;IACH,YAAmB,KAAoC;QACrD,IAAI,CAAC,UAAU,GAAG,KAAK,EAAE,UAAU,IAAI,UAAU,CAAC,SAAS,CAAC;QAC5D,IAAI,CAAC,UAAU,GAAG,KAAK,EAAE,UAAU,IAAI,IAAI,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,IAAI,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,IAAI,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,KAAK,EAAE,YAAY,IAAI,IAAI,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,IAAI,CAAC;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xC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;eACxB,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS;eAClC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;eACxB,IAAI,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY;eACxC,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;eACtC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO;eAC9B,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;eACpC,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU;eACpC,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,gBAAgB,KAAK,KAAK,CAAC,gBAAgB;eAChD,IAAI,CAAC,eAAe,KAAK,KAAK,CAAC,eAAe;eAC9C,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;eAChC,IAAI,CAAC,mBAAmB,KAAK,KAAK,CAAC,mBAAmB;eACtD,IAAI,CAAC,oBAAoB,KAAK,KAAK,CAAC,oBAAoB,CAAC;IAChE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\n// cspell:ignore ovrs\n\nimport { JsonUtils, Mutable, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\n\n/** Enumerates the available basic rendering modes, as part of a [DisplayStyle]($backend)'s [[ViewFlags]].\n * The rendering mode broadly affects various aspects of the display style - in particular, whether and how surfaces and their edges are drawn.\n * @public\n * @extensions\n */\nexport enum RenderMode {\n /** Renders only the edges of surfaces, with exceptions for planar regions based on their [[FillFlags]].\n * Lighting (and by extension, shadows) is not applied.\n * [[HiddenLine.Settings]] are not applied - edges use the elements' width, style, and color.\n * [[ViewFlags.hiddenEdges]] is ignored - hidden edges are never displayed in wireframe mode.\n */\n Wireframe = 0,\n /** By default, renders surfaces without their edges.\n * Lighting and shadows can be applied using [[ViewFlags.lighting]] and [[ViewFlags.shadows]].\n * Edges can be enabled using [[ViewFlags.visibleEdges]] and [[ViewFlags.hiddenEdges]], and their appearance customized using [[HiddenLine.Settings]].\n * Surfaces can be drawn with transparency, based on [[ViewFlags.transparency]].\n */\n SmoothShade = 6,\n /** Renders surfaces and their edges. By default, edges are drawn in white; this can be overridden using [[HiddenLine.Settings]].\n * All surfaces are rendered opaque. If a surface's transparency is below that specified by [[HiddenLine.Settings.transparencyThreshold]], it is not rendered.\n * Materials and textures are not applied - surfaces are drawn in their actual colors.\n * [[ViewFlags.visibleEdges]] is ignored - visible edges are always drawn. Hidden edges can be enabled using [[ViewFlags.hiddenEdges]].\n * Lighting (and by extension, shadows) is not applied.\n */\n SolidFill = 4,\n /** Identical to [[RenderMode.SolidFill]], except:\n * - Surfaces are drawn using the [DisplayStyle]($backend)'s background color.\n * - Edges are drawn using their surface's colors; this can be overridden using [[HiddenLine.Settings]].\n */\n HiddenLine = 3,\n}\n\n/** JSON representation of [[ViewFlags]].\n * This is a persistence format with some unfortunate quirks that have been retained for backwards compatibility.\n * In particular, it supplies three separate flags intended to control lighting - [[noCameraLights]], [[noSourceLights]], and [[noSolarLight]] -\n * but there exists only a single [[ViewFlags.lighting]] flag. [[ViewFlags.lighting]] is set to true unless all three of the \"no lighting\" flags are true.\n * It also uses awkward negative ([[noConstruct]], [[noTransp]]) and/or abbreviated ([[clipVol]], [[visEdges]]) property names that differ from\n * those of the corresponding [[ViewFlags]] properties, making usage of this type in code error-prone.\n * Prefer to use [[ViewFlagsProperties]] unless you need to work directly with the persistence format.\n * @public\n * @extensions\n */\nexport interface ViewFlagProps {\n /** If true, don't display geometry of class [[GeometryClass.Construction]]. */\n noConstruct?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Dimension]]. */\n noDim?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Pattern]]. */\n noPattern?: boolean;\n /** If true, all lines are drawn with a width of 1 pixel. */\n noWeight?: boolean;\n /** If true, don't apply [[LinePixels]] styles. */\n noStyle?: boolean;\n /** If true, display transparency geometry as opaque. */\n noTransp?: boolean;\n /** If true, don't show filled planar regions, unless they use [[FillFlags.Always]]. */\n noFill?: boolean;\n /** If true, display a grid in the view. */\n grid?: boolean;\n /** If true, display graphics representing the [AuxCoordSystem]($backend). */\n acs?: boolean;\n /** If true, don't apply [[RenderTexture]]s to surfaces. */\n noTexture?: boolean;\n /** If true, don't apply [[RenderMaterial]]s to surfaces. */\n noMaterial?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noCameraLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSourceLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSolarLight?: boolean;\n /** If true, display the edges of surfaces. */\n visEdges?: boolean;\n /** If true, display the edges of surfaces, even if they are behind other geometry. */\n hidEdges?: boolean;\n /** If true, display shadows. */\n shadows?: boolean;\n /** If true, apply the view's clipping volume. Has no effect on other types of clips like [[ModelClipGroups]]. */\n clipVol?: boolean;\n /** If true, apply the view's [[DisplayStyleSettings.monochromeColor]] and [[DisplayStyleSettings.monochromeMode]] to produce a monochrome image. */\n monochrome?: boolean;\n /** The basic rendering mode, which affects the behavior of other flags. */\n renderMode?: RenderMode;\n /** Display a background map. */\n backgroundMap?: boolean;\n /** If true, apply [[AmbientOcclusion]]. */\n ambientOcclusion?: boolean;\n /** If true, apply [[ThematicDisplay]]. */\n thematicDisplay?: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n wiremesh?: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n forceSurfaceDiscard?: boolean;\n /** Disables the \"white-on-white reversal\" employed by some CAD applications.\n * @see [[ViewFlags.whiteOnWhiteReversal]].\n */\n noWhiteOnWhiteReversal?: boolean;\n}\n\nfunction edgesRequired(renderMode: RenderMode, visibleEdges: boolean): boolean {\n return visibleEdges || RenderMode.SmoothShade !== renderMode;\n}\n\n/** Flags controlling how graphics appear within a view.\n * A [[ViewFlags]] object is immutable. There are several ways to produce a modified copy of a ViewFlags object:\n * ```ts\n * // Start with the default values for all properties.\n * let vf = ViewFlags.defaults;\n * // Change a single boolean property:\n * vf = vf.with(\"visibleEdges\", true);\n * // Change only the render mode:\n * vf = vf.withRenderMode(RenderMode.HiddenLine);\n * // Change multiple properties:\n * vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });\n * // Reset multiple properties to their default values:\n * vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });\n *\n * ```\n * [[with]] and [[withRenderMode]] should be preferred if you only need to change a single property, as they will not create a new object unless\n * the new value differs from the current value.\n * [[copy]] and [[override]] should be preferred if you need to change multiple properties, as they will create no more than one new object, vs\n * each call to [[with]] or [[withRenderMode]] potentially creating a new object.\n * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).\n * @public\n */\nexport class ViewFlags {\n /** The basic rendering mode applied to the view. This modulates the behavior of some of the other flags.\n * Default: [[RenderMode.Wireframe]].\n * @see [[RenderMode]] for details.\n */\n public readonly renderMode: RenderMode;\n /** Whether to display geometry of class [[GeometryClass.Dimension]]. Default: true. */\n public readonly dimensions: boolean;\n /** Whether to display geometry of class [[GeometryClass.Pattern]]. Default: true. */\n public readonly patterns: boolean;\n /** Whether to allow lines and edges to draw with width greater than one pixel. Default: true. */\n public readonly weights: boolean;\n /** Whether [[LinePixels]] are allowed to apply patterns to lines and edges. If false, they all draw as solid lines. Default: true. */\n public readonly styles: boolean;\n /** Whether element transparency is applied. If false, transparent geometry is drawn opaque. Default: true.\n * @see [[RenderMode]] for render mode-specific behavior.\n */\n public readonly transparency: boolean;\n /** In [[RenderMode.Wireframe]] only, whether to display the interiors of planar regions with [[FillFlags.ByView]]. Default: true. */\n public readonly fill: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderTexture]]s to surfaces. Default: true. */\n public readonly textures: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderMaterial]]s to surfaces. Default: true. */\n public readonly materials: boolean;\n /** Whether to display a graphical representation of the view's [AuxCoordSystem]($backend). Default: false. */\n public readonly acsTriad: boolean;\n /** Whether to display a grid. Default: false. */\n public readonly grid: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display the edges of surfaces. Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly visibleEdges: boolean;\n /** In any mode except [[RenderMode.Wireframe]], whether to display the edges of surfaces occluded by other geometry.\n * This has no effect unless [[visibleEdges]] is also true.\n * Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly hiddenEdges: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display solar shadows. This has no effect unless [[lighting]] is also true. Default: false.\n * @note Rendering shadows can reduce framerate, particularly on less capable graphics hardware or in complex scenes.\n */\n public readonly shadows: boolean;\n /** Whether to apply the view's clip volume to the geometry in the scene.\n * Default: true, except when using [[fromJSON]].\n * @see [[ViewDetails.clipVector]] to define the view's clip volume.\n */\n public readonly clipVolume: boolean;\n /** Whether to display geometry of class [[GeometryClass.Construction]].\n * Default: false, except when using [[fromJSON]].\n */\n public readonly constructions: boolean;\n /** Whether to produce a monochrome image. Default: false.\n * @see [DisplayStyleSettings.monochromeColor]($common) to define the monochrome color.\n * @see [DisplayStyleSettings.monochromeMode]($common) to define how the monochrome image is produced.\n */\n public readonly monochrome: boolean;\n /** Whether to display background map imagery. Default: false.\n * @see [[DisplayStyleSettings.backgroundMap]] to customize the map settings.\n */\n public readonly backgroundMap: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[AmbientOcclusion]]. Default: false. */\n public readonly ambientOcclusion: boolean;\n /** Whether to apply [[ThematicDisplay]]. Default: false. */\n public readonly thematicDisplay: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n public readonly wiremesh: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n public readonly forceSurfaceDiscard: boolean;\n /** Whether to apply white-on-white reversal.\n * Some CAD applications use this to cause white geometry to be drawn as black if the view's background color is white.\n * When enabled, the [[DisplayStyleSettings]]' [[WhiteOnWhiteReversalSettings]] control how white-on-white reversal is applied.\n * Default: true.\n */\n public readonly whiteOnWhiteReversal: boolean;\n\n /** In [[RenderMode.SmoothShade]], whether to apply lighting to surfaces.\n * Default: false, except when using [[fromJSON]].\n * @see [[DisplayStyleSettings.lights]] to customize the light settings.\n */\n public readonly lighting: boolean;\n\n /** Create a new ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public constructor(flags?: Partial<ViewFlagsProperties>) {\n this.renderMode = flags?.renderMode ?? RenderMode.Wireframe;\n this.dimensions = flags?.dimensions ?? true;\n this.patterns = flags?.patterns ?? true;\n this.weights = flags?.weights ?? true;\n this.styles = flags?.styles ?? true;\n this.transparency = flags?.transparency ?? true;\n this.fill = flags?.fill ?? true;\n this.textures = flags?.textures ?? true;\n this.materials = flags?.materials ?? true;\n this.acsTriad = flags?.acsTriad ?? false;\n this.grid = flags?.grid ?? false;\n this.visibleEdges = flags?.visibleEdges ?? false;\n this.hiddenEdges = flags?.hiddenEdges ?? false;\n this.shadows = flags?.shadows ?? false;\n this.clipVolume = flags?.clipVolume ?? true;\n this.constructions = flags?.constructions ?? false;\n this.monochrome = flags?.monochrome ?? false;\n this.backgroundMap = flags?.backgroundMap ?? false;\n this.ambientOcclusion = flags?.ambientOcclusion ?? false;\n this.thematicDisplay = flags?.thematicDisplay ?? false;\n this.wiremesh = flags?.wiremesh ?? false;\n this.forceSurfaceDiscard = flags?.forceSurfaceDiscard ?? false;\n this.whiteOnWhiteReversal = flags?.whiteOnWhiteReversal ?? true;\n this.lighting = flags?.lighting ?? false;\n }\n\n /** Produce a copy of these ViewFlags with some modified properties. Any properties not explicitly specified by `changedFlags` will retain their current values.\n * @param changedFlags Properties to modify.\n * @returns A copy of these ViewFlags modified according to the supplied properties.\n * @note Any explicitly `undefined` property of `changedFlags` will be set to its default value in the returned ViewFlags.\n * @see [[override]] to have `undefined` properties retain their current values.\n */\n public copy(changedFlags: Partial<ViewFlagsProperties>): ViewFlags {\n return JsonUtils.isNonEmptyObject(changedFlags) ? new ViewFlags({ ...this, ...changedFlags }) : this;\n }\n\n /** Produce a copy of these ViewFlags, overriding some of its properties. Any properties not explicitly specified by `overrides` will retain their current values,\n * as will any property explicitly set to `undefined`.\n * @param overrides The properties to override.\n * @see [[copy]] to have `undefined` properties reset to their default values.\n */\n public override(overrides: Partial<ViewFlagsProperties>): ViewFlags {\n // This method can get called very frequently when a RenderTimeline script is applied to the view. Often `overrides` will be an empty object.\n // To optimize:\n // - Bail as quickly as possible if nothing is actually overridden, without allocating a new ViewFlags.\n // - Only make a copy of the input if at least one property is explicitly `undefined`.\n let copied = false;\n let anyOverridden = false;\n\n for (const propName of Object.keys(overrides)) {\n const key = propName as keyof Partial<ViewFlagsProperties>;\n const overrideValue = overrides[key];\n if (undefined === overrideValue) {\n if (!copied) {\n // Don't modify input...\n overrides = { ...overrides };\n copied = true;\n }\n\n // `undefined` means \"retain existing value\".\n delete overrides[key];\n } else if (overrideValue !== this[key]) {\n anyOverridden = true;\n }\n }\n\n return anyOverridden ? this.copy(overrides) : this;\n }\n\n /** Produce a copy of these ViewFlags with a single boolean property changed.\n * @param flag The name of the property.\n * @param value The value to change the property to.\n * @returns A new ViewFlags with the property changed as specified, or `this` if the property already has the specified value.\n * @see [[withRenderMode]] to change the [[renderMode]] property.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public with(flag: keyof Omit<ViewFlagsProperties, \"renderMode\">, value: boolean): ViewFlags {\n if (this[flag] === value)\n return this;\n\n const props: ViewFlagsProperties = { ...this };\n props[flag] = value;\n return new ViewFlags(props);\n }\n\n /** Produce a copy of these ViewFlags with a different [[renderMode]].\n * @param renderMode The new render mode.\n * @returns A new ViewFlags with the render mode changed as specified, or `this` if the render mode is already set to the requested value.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public withRenderMode(renderMode: RenderMode): ViewFlags {\n return renderMode === this.renderMode ? this : this.copy({ renderMode });\n }\n\n /** Adjust view flags for renderer.\n * @internal\n */\n public normalize(): ViewFlags {\n switch (this.renderMode) {\n case RenderMode.Wireframe:\n if (this.visibleEdges || this.hiddenEdges)\n return this.copy({ visibleEdges: false, hiddenEdges: false });\n break;\n case RenderMode.SmoothShade:\n if (!this.visibleEdges)\n return this.copy({ hiddenEdges: false });\n break;\n case RenderMode.HiddenLine:\n case RenderMode.SolidFill:\n if (!this.visibleEdges || this.transparency)\n return this.copy({ visibleEdges: true, transparency: false });\n break;\n }\n\n return this;\n }\n\n /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */\n public hiddenEdgesVisible(): boolean {\n switch (this.renderMode) {\n case RenderMode.SolidFill:\n case RenderMode.HiddenLine:\n return this.hiddenEdges;\n case RenderMode.SmoothShade:\n return this.visibleEdges && this.hiddenEdges;\n }\n return true;\n }\n\n /** Returns true if the edges of surfaces should be displayed, based on [[RenderMode]] and the [[visibleEdges]] flag. */\n public edgesRequired(): boolean {\n return edgesRequired(this.renderMode, this.visibleEdges);\n }\n\n /** Convert to JSON representation.\n * Properties are omitted if they match the default values.\n */\n public toJSON(): ViewFlagProps {\n const out: ViewFlagProps = {};\n if (!this.constructions)\n out.noConstruct = true;\n if (!this.dimensions)\n out.noDim = true;\n if (!this.patterns)\n out.noPattern = true;\n if (!this.weights)\n out.noWeight = true;\n if (!this.styles)\n out.noStyle = true;\n if (!this.transparency)\n out.noTransp = true;\n if (!this.fill)\n out.noFill = true;\n if (this.grid)\n out.grid = true;\n if (this.acsTriad)\n out.acs = true;\n if (!this.textures)\n out.noTexture = true;\n if (!this.materials)\n out.noMaterial = true;\n if (!this.lighting)\n out.noCameraLights = out.noSourceLights = out.noSolarLight = true;\n if (this.visibleEdges)\n out.visEdges = true;\n if (this.hiddenEdges)\n out.hidEdges = true;\n if (this.shadows)\n out.shadows = true;\n if (this.clipVolume)\n out.clipVol = true;\n if (this.monochrome)\n out.monochrome = true;\n if (this.backgroundMap)\n out.backgroundMap = true;\n if (this.ambientOcclusion)\n out.ambientOcclusion = true;\n if (this.thematicDisplay)\n out.thematicDisplay = true;\n if (this.wiremesh)\n out.wiremesh = true;\n if (this.forceSurfaceDiscard)\n out.forceSurfaceDiscard = true;\n if (!this.whiteOnWhiteReversal)\n out.noWhiteOnWhiteReversal = true;\n\n out.renderMode = this.renderMode;\n return out;\n }\n\n /** Like [[toJSON]], but no properties are omitted. */\n public toFullyDefinedJSON(): Required<ViewFlagProps> {\n return {\n renderMode: this.renderMode,\n noConstruct: !this.constructions,\n noDim: !this.dimensions,\n noPattern: !this.patterns,\n noWeight: !this.weights,\n noStyle: !this.styles,\n noTransp: !this.transparency,\n noFill: !this.fill,\n grid: this.grid,\n acs: this.acsTriad,\n noTexture: !this.textures,\n noMaterial: !this.materials,\n noCameraLights: !this.lighting,\n noSourceLights: !this.lighting,\n noSolarLight: !this.lighting,\n visEdges: this.visibleEdges,\n hidEdges: this.hiddenEdges,\n shadows: this.shadows,\n clipVol: this.clipVolume,\n monochrome: this.monochrome,\n backgroundMap: this.backgroundMap,\n ambientOcclusion: this.ambientOcclusion,\n thematicDisplay: this.thematicDisplay,\n wiremesh: this.wiremesh,\n forceSurfaceDiscard: this.forceSurfaceDiscard,\n noWhiteOnWhiteReversal: !this.whiteOnWhiteReversal,\n };\n }\n\n /** A ViewFlags object with all properties initialized to their default values. */\n public static readonly defaults = new ViewFlags();\n\n /** Create a ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public static create(flags?: Partial<ViewFlagsProperties>): ViewFlags {\n return flags && !JsonUtils.isEmptyObject(flags) ? new ViewFlags(flags) : this.defaults;\n }\n\n /** Create a ViewFlags from its JSON representation.\n * @note As described in [[ViewFlagProps]], the JSON representation is awkward and error-prone. Prefer to use [[create]] unless you\n * need to deal with the persistence format directly.\n * @note The default values differ slightly from those used by the constructor and [[create]]:\n * - [[clipVolume]] defaults to false.\n * - [[constructions]] defaults to true.\n * - [[lighting]] defaults to true unless all of [[ViewFlagProps.noSolarLight]], [[ViewFlagProps.noCameraLights]], and [[ViewFlagProps.noSourceLights]] are true.\n */\n public static fromJSON(json?: ViewFlagProps): ViewFlags {\n if (!json)\n return this.defaults;\n\n let renderMode: RenderMode;\n const renderModeValue = JsonUtils.asInt(json.renderMode);\n if (renderModeValue < RenderMode.HiddenLine)\n renderMode = RenderMode.Wireframe;\n else if (renderModeValue > RenderMode.SolidFill)\n renderMode = RenderMode.SmoothShade;\n else\n renderMode = renderModeValue;\n\n const lighting = !JsonUtils.asBool(json.noCameraLights) || !JsonUtils.asBool(json.noSourceLights) || !JsonUtils.asBool(json.noSolarLight);\n return new ViewFlags({\n renderMode,\n lighting,\n constructions: !JsonUtils.asBool(json.noConstruct),\n dimensions: !JsonUtils.asBool(json.noDim),\n patterns: !JsonUtils.asBool(json.noPattern),\n weights: !JsonUtils.asBool(json.noWeight),\n styles: !JsonUtils.asBool(json.noStyle),\n transparency: !JsonUtils.asBool(json.noTransp),\n fill: !JsonUtils.asBool(json.noFill),\n grid: JsonUtils.asBool(json.grid),\n acsTriad: JsonUtils.asBool(json.acs),\n textures: !JsonUtils.asBool(json.noTexture),\n materials: !JsonUtils.asBool(json.noMaterial),\n visibleEdges: JsonUtils.asBool(json.visEdges),\n hiddenEdges: JsonUtils.asBool(json.hidEdges),\n shadows: JsonUtils.asBool(json.shadows),\n clipVolume: JsonUtils.asBool(json.clipVol),\n monochrome: JsonUtils.asBool(json.monochrome),\n backgroundMap: JsonUtils.asBool(json.backgroundMap),\n ambientOcclusion: JsonUtils.asBool(json.ambientOcclusion),\n thematicDisplay: JsonUtils.asBool(json.thematicDisplay),\n wiremesh: JsonUtils.asBool(json.wiremesh),\n forceSurfaceDiscard: JsonUtils.asBool(json.forceSurfaceDiscard),\n whiteOnWhiteReversal: !JsonUtils.asBool(json.noWhiteOnWhiteReversal),\n });\n }\n\n /** Returns true if `this` and `other` are equivalent. */\n public equals(other: Readonly<ViewFlagsProperties>): boolean {\n if (this === other)\n return true;\n\n return this.renderMode === other.renderMode\n && this.dimensions === other.dimensions\n && this.patterns === other.patterns\n && this.weights === other.weights\n && this.styles === other.styles\n && this.transparency === other.transparency\n && this.fill === other.fill\n && this.textures === other.textures\n && this.materials === other.materials\n && this.acsTriad === other.acsTriad\n && this.grid === other.grid\n && this.visibleEdges === other.visibleEdges\n && this.hiddenEdges === other.hiddenEdges\n && this.lighting === other.lighting\n && this.shadows === other.shadows\n && this.clipVolume === other.clipVolume\n && this.constructions === other.constructions\n && this.monochrome === other.monochrome\n && this.backgroundMap === other.backgroundMap\n && this.ambientOcclusion === other.ambientOcclusion\n && this.thematicDisplay === other.thematicDisplay\n && this.wiremesh === other.wiremesh\n && this.forceSurfaceDiscard === other.forceSurfaceDiscard\n && this.whiteOnWhiteReversal === other.whiteOnWhiteReversal;\n }\n}\n\n/** A type containing all of the properties of [[ViewFlags]] with none of the methods and with the `readonly` modifiers removed.\n * @see [[ViewFlags.create]], [[ViewFlags.copy]], and [[ViewFlags.override]] for methods accepting an object of this type.\n * @public\n * @extensions\n */\nexport type ViewFlagsProperties = Mutable<NonFunctionPropertiesOf<ViewFlags>>;\n\n/** A type that describes how to override selected properties of a [[ViewFlags]].\n * @see [[ViewFlags.override]] to apply the overrides to a ViewFlags object.\n * @public\n * @extensions\n */\nexport type ViewFlagOverrides = Partial<ViewFlagsProperties>;\n"]}
1
+ {"version":3,"file":"ViewFlags.js","sourceRoot":"","sources":["../../src/ViewFlags.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qBAAqB;AAErB,OAAO,EAAE,SAAS,EAAoC,MAAM,qBAAqB,CAAC;AAElF;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAyBX;AAzBD,WAAY,UAAU;IACpB;;;;OAIG;IACH,qDAAa,CAAA;IACb;;;;OAIG;IACH,yDAAe,CAAA;IACf;;;;;OAKG;IACH,qDAAa,CAAA;IACb;;;OAGG;IACH,uDAAc,CAAA;AAChB,CAAC,EAzBW,UAAU,KAAV,UAAU,QAyBrB;AA0ED,SAAS,aAAa,CAAC,UAAsB,EAAE,YAAqB;IAClE,OAAO,YAAY,IAAI,UAAU,CAAC,WAAW,KAAK,UAAU,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,SAAS;IAsFpB;;OAEG;IACH,YAAmB,KAAoC;QACrD,IAAI,CAAC,UAAU,GAAG,KA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AQ;eAChC,IAAI,CAAC,mBAAmB,KAAK,KAAK,CAAC,mBAAmB;eACtD,IAAI,CAAC,oBAAoB,KAAK,KAAK,CAAC,oBAAoB,CAAC;IAChE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\n// cspell:ignore ovrs\n\nimport { JsonUtils, Mutable, NonFunctionPropertiesOf } from \"@itwin/core-bentley\";\n\n/** Enumerates the available basic rendering modes, as part of a [DisplayStyle]($backend)'s [[ViewFlags]].\n * The rendering mode broadly affects various aspects of the display style - in particular, whether and how surfaces and their edges are drawn.\n * @public\n * @extensions\n */\nexport enum RenderMode {\n /** Renders only the edges of surfaces, with exceptions for planar regions based on their [[FillFlags]].\n * Lighting (and by extension, shadows) is not applied.\n * [[HiddenLine.Settings]] are not applied - edges use the elements' width, style, and color.\n * [[ViewFlags.hiddenEdges]] is ignored - hidden edges are never displayed in wireframe mode.\n */\n Wireframe = 0,\n /** By default, renders surfaces without their edges.\n * Lighting and shadows can be applied using [[ViewFlags.lighting]] and [[ViewFlags.shadows]].\n * Edges can be enabled using [[ViewFlags.visibleEdges]] and [[ViewFlags.hiddenEdges]], and their appearance customized using [[HiddenLine.Settings]].\n * Surfaces can be drawn with transparency, based on [[ViewFlags.transparency]].\n */\n SmoothShade = 6,\n /** Renders surfaces and their edges. By default, edges are drawn in white; this can be overridden using [[HiddenLine.Settings]].\n * All surfaces are rendered opaque. If a surface's transparency is below that specified by [[HiddenLine.Settings.transparencyThreshold]], it is not rendered.\n * Materials and textures are not applied - surfaces are drawn in their actual colors.\n * [[ViewFlags.visibleEdges]] is ignored - visible edges are always drawn. Hidden edges can be enabled using [[ViewFlags.hiddenEdges]].\n * Lighting (and by extension, shadows) is not applied.\n */\n SolidFill = 4,\n /** Identical to [[RenderMode.SolidFill]], except:\n * - Surfaces are drawn using the [DisplayStyle]($backend)'s background color.\n * - Edges are drawn using their surface's colors; this can be overridden using [[HiddenLine.Settings]].\n */\n HiddenLine = 3,\n}\n\n/** JSON representation of [[ViewFlags]].\n * This is a persistence format with some unfortunate quirks that have been retained for backwards compatibility.\n * In particular, it supplies three separate flags intended to control lighting - [[noCameraLights]], [[noSourceLights]], and [[noSolarLight]] -\n * but there exists only a single [[ViewFlags.lighting]] flag. [[ViewFlags.lighting]] is set to true unless all three of the \"no lighting\" flags are true.\n * It also uses awkward negative ([[noConstruct]], [[noTransp]]) and/or abbreviated ([[clipVol]], [[visEdges]]) property names that differ from\n * those of the corresponding [[ViewFlags]] properties, making usage of this type in code error-prone.\n * Prefer to use [[ViewFlagsProperties]] unless you need to work directly with the persistence format.\n * @public\n * @extensions\n */\nexport interface ViewFlagProps {\n /** If true, don't display geometry of class [[GeometryClass.Construction]]. */\n noConstruct?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Dimension]]. */\n noDim?: boolean;\n /** If true, don't display geometry of class [[GeometryClass.Pattern]]. */\n noPattern?: boolean;\n /** If true, all lines are drawn with a width of 1 pixel. */\n noWeight?: boolean;\n /** If true, don't apply [[LinePixels]] styles. */\n noStyle?: boolean;\n /** If true, display transparency geometry as opaque. */\n noTransp?: boolean;\n /** If true, don't show filled planar regions, unless they use [[FillFlags.Always]]. */\n noFill?: boolean;\n /** If true, display a grid in the view. */\n grid?: boolean;\n /** If true, display graphics representing the [AuxCoordSystem]($backend). */\n acs?: boolean;\n /** If true, don't apply [[RenderTexture]]s to surfaces. */\n noTexture?: boolean;\n /** If true, don't apply [[RenderMaterial]]s to surfaces. */\n noMaterial?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noCameraLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSourceLights?: boolean;\n /** See [[ViewFlagProps]] for how this affects [[ViewFlags.lighting]]. */\n noSolarLight?: boolean;\n /** If true, display the edges of surfaces. */\n visEdges?: boolean;\n /** If true, display the edges of surfaces, even if they are behind other geometry. */\n hidEdges?: boolean;\n /** If true, display shadows. */\n shadows?: boolean;\n /** If true, apply the view's clipping volume. Has no effect on other types of clips like [[ModelClipGroups]]. */\n clipVol?: boolean;\n /** If true, apply the view's [[DisplayStyleSettings.monochromeColor]] and [[DisplayStyleSettings.monochromeMode]] to produce a monochrome image. */\n monochrome?: boolean;\n /** The basic rendering mode, which affects the behavior of other flags. */\n renderMode?: RenderMode;\n /** Display a background map. */\n backgroundMap?: boolean;\n /** If true, apply [[AmbientOcclusion]]. */\n ambientOcclusion?: boolean;\n /** If true, apply [[ThematicDisplay]]. */\n thematicDisplay?: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n wiremesh?: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n forceSurfaceDiscard?: boolean;\n /** Disables the \"white-on-white reversal\" employed by some CAD applications.\n * @see [[ViewFlags.whiteOnWhiteReversal]].\n */\n noWhiteOnWhiteReversal?: boolean;\n}\n\nfunction edgesRequired(renderMode: RenderMode, visibleEdges: boolean): boolean {\n return visibleEdges || RenderMode.SmoothShade !== renderMode;\n}\n\n/** Flags controlling how graphics appear within a view.\n * A [[ViewFlags]] object is immutable. There are several ways to produce a modified copy of a ViewFlags object:\n * ```ts\n * // Start with the default values for all properties.\n * let vf = ViewFlags.defaults;\n * // Change a single boolean property:\n * vf = vf.with(\"visibleEdges\", true);\n * // Change only the render mode:\n * vf = vf.withRenderMode(RenderMode.HiddenLine);\n * // Change multiple properties:\n * vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });\n * // Reset multiple properties to their default values:\n * vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });\n *\n * ```\n * [[with]] and [[withRenderMode]] should be preferred if you only need to change a single property, as they will not create a new object unless\n * the new value differs from the current value.\n * [[copy]] and [[override]] should be preferred if you need to change multiple properties, as they will create no more than one new object, vs\n * each call to [[with]] or [[withRenderMode]] potentially creating a new object.\n * @see [[DisplayStyleSettings.viewFlags]] to define the view flags for a [DisplayStyle]($backend).\n * @public\n */\nexport class ViewFlags {\n /** The basic rendering mode applied to the view. This modulates the behavior of some of the other flags.\n * Default: [[RenderMode.Wireframe]].\n * @see [[RenderMode]] for details.\n */\n public readonly renderMode: RenderMode;\n /** Whether to display geometry of class [[GeometryClass.Dimension]]. Default: true. */\n public readonly dimensions: boolean;\n /** Whether to display geometry of class [[GeometryClass.Pattern]]. Default: true. */\n public readonly patterns: boolean;\n /** Whether to allow lines and edges to draw with width greater than one pixel. Default: true. */\n public readonly weights: boolean;\n /** Whether [[LinePixels]] are allowed to apply patterns to lines and edges. If false, they all draw as solid lines. Default: true. */\n public readonly styles: boolean;\n /** Whether element transparency is applied. If false, transparent geometry is drawn opaque. Default: true.\n * @see [[RenderMode]] for render mode-specific behavior.\n */\n public readonly transparency: boolean;\n /** In [[RenderMode.Wireframe]] only, whether to display the interiors of planar regions with [[FillFlags.ByView]]. Default: true. */\n public readonly fill: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderTexture]]s to surfaces. Default: true. */\n public readonly textures: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[RenderMaterial]]s to surfaces. Default: true. */\n public readonly materials: boolean;\n /** Whether to display a graphical representation of the view's [AuxCoordSystem]($backend). Default: false. */\n public readonly acsTriad: boolean;\n /** Whether to display a grid. Default: false. */\n public readonly grid: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display the edges of surfaces. Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly visibleEdges: boolean;\n /** In any mode except [[RenderMode.Wireframe]], whether to display the edges of surfaces occluded by other geometry.\n * This has no effect unless [[visibleEdges]] is also true.\n * Default: false.\n * @see [[HiddenLine.Settings]] to customize the appearance of the edges.\n */\n public readonly hiddenEdges: boolean;\n /** In [[RenderMode.SmoothShade]], whether to display solar shadows. This has no effect unless [[lighting]] is also true. Default: false.\n * @note Rendering shadows can reduce framerate, particularly on less capable graphics hardware or in complex scenes.\n */\n public readonly shadows: boolean;\n /** Whether to apply the view's clip volume to the geometry in the scene.\n * Default: true, except when using [[fromJSON]].\n * @see [[ViewDetails.clipVector]] to define the view's clip volume.\n */\n public readonly clipVolume: boolean;\n /** Whether to display geometry of class [[GeometryClass.Construction]].\n * Default: false, except when using [[fromJSON]].\n */\n public readonly constructions: boolean;\n /** Whether to produce a monochrome image. Default: false.\n * @see [DisplayStyleSettings.monochromeColor]($common) to define the monochrome color.\n * @see [DisplayStyleSettings.monochromeMode]($common) to define how the monochrome image is produced.\n */\n public readonly monochrome: boolean;\n /** Whether to display background map imagery. Default: false.\n * @see [[DisplayStyleSettings.backgroundMap]] to customize the map settings.\n */\n public readonly backgroundMap: boolean;\n /** In [[RenderMode.SmoothShade]], whether to apply [[AmbientOcclusion]]. Default: false. */\n public readonly ambientOcclusion: boolean;\n /** Whether to apply [[ThematicDisplay]]. Default: false. */\n public readonly thematicDisplay: boolean;\n /** If true, overlay surfaces with wiremesh to reveal their triangulation. */\n public readonly wiremesh: boolean;\n /** Controls whether surface discard is always applied regardless of other ViewFlags.\n * Surface shaders contain complicated logic to ensure that the edges of a surface always draw in front of the surface, and that planar surfaces sketched coincident with\n * non-planar surfaces always draw in front of those non-planar surfaces.\n * When this view flag is set to false (the default), then for 3d views if the render mode is wireframe (only edges are displayed) or smooth shader with visible edges turned off (only surfaces are displayed),\n * that logic does not execute, potentially improving performance for no degradation in visual quality. In some scenarios - such as wireframe views containing many planar regions with interior fill, or smooth views containing many coincident planar and non-planar surfaces - enabling this view flag improves display quality by forcing that logic to execute.\n */\n public readonly forceSurfaceDiscard: boolean;\n /** Whether to apply white-on-white reversal.\n * Some CAD applications use this to cause white geometry to be drawn as black if the view's background color is white.\n * When enabled, the [[DisplayStyleSettings]]' [[WhiteOnWhiteReversalSettings]] control how white-on-white reversal is applied.\n * Default: true.\n */\n public readonly whiteOnWhiteReversal: boolean;\n\n /** In [[RenderMode.SmoothShade]], whether to apply lighting to surfaces.\n * Default: false, except when using [[fromJSON]].\n * @see [[DisplayStyleSettings.lights]] to customize the light settings.\n */\n public readonly lighting: boolean;\n\n /** Create a new ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public constructor(flags?: Partial<ViewFlagsProperties>) {\n this.renderMode = flags?.renderMode ?? RenderMode.Wireframe;\n this.dimensions = flags?.dimensions ?? true;\n this.patterns = flags?.patterns ?? true;\n this.weights = flags?.weights ?? true;\n this.styles = flags?.styles ?? true;\n this.transparency = flags?.transparency ?? true;\n this.fill = flags?.fill ?? true;\n this.textures = flags?.textures ?? true;\n this.materials = flags?.materials ?? true;\n this.acsTriad = flags?.acsTriad ?? false;\n this.grid = flags?.grid ?? false;\n this.visibleEdges = flags?.visibleEdges ?? false;\n this.hiddenEdges = flags?.hiddenEdges ?? false;\n this.shadows = flags?.shadows ?? false;\n this.clipVolume = flags?.clipVolume ?? true;\n this.constructions = flags?.constructions ?? false;\n this.monochrome = flags?.monochrome ?? false;\n this.backgroundMap = flags?.backgroundMap ?? false;\n this.ambientOcclusion = flags?.ambientOcclusion ?? false;\n this.thematicDisplay = flags?.thematicDisplay ?? false;\n this.wiremesh = flags?.wiremesh ?? false;\n this.forceSurfaceDiscard = flags?.forceSurfaceDiscard ?? false;\n this.whiteOnWhiteReversal = flags?.whiteOnWhiteReversal ?? true;\n this.lighting = flags?.lighting ?? false;\n }\n\n /** Produce a copy of these ViewFlags with some modified properties. Any properties not explicitly specified by `changedFlags` will retain their current values.\n * @param changedFlags Properties to modify.\n * @returns A copy of these ViewFlags modified according to the supplied properties.\n * @note Any explicitly `undefined` property of `changedFlags` will be set to its default value in the returned ViewFlags.\n * @see [[override]] to have `undefined` properties retain their current values.\n */\n public copy(changedFlags: Partial<ViewFlagsProperties>): ViewFlags {\n return JsonUtils.isNonEmptyObject(changedFlags) ? new ViewFlags({ ...this, ...changedFlags }) : this;\n }\n\n /** Produce a copy of these ViewFlags, overriding some of its properties. Any properties not explicitly specified by `overrides` will retain their current values,\n * as will any property explicitly set to `undefined`.\n * @param overrides The properties to override.\n * @see [[copy]] to have `undefined` properties reset to their default values.\n */\n public override(overrides: Partial<ViewFlagsProperties>): ViewFlags {\n // This method can get called very frequently when a RenderTimeline script is applied to the view. Often `overrides` will be an empty object.\n // To optimize:\n // - Bail as quickly as possible if nothing is actually overridden, without allocating a new ViewFlags.\n // - Only make a copy of the input if at least one property is explicitly `undefined`.\n let copied = false;\n let anyOverridden = false;\n\n for (const propName of Object.keys(overrides)) {\n const key = propName as keyof Partial<ViewFlagsProperties>;\n const overrideValue = overrides[key];\n if (undefined === overrideValue) {\n if (!copied) {\n // Don't modify input...\n overrides = { ...overrides };\n copied = true;\n }\n\n // `undefined` means \"retain existing value\".\n delete overrides[key];\n } else if (overrideValue !== this[key]) {\n anyOverridden = true;\n }\n }\n\n return anyOverridden ? this.copy(overrides) : this;\n }\n\n /** Produce a copy of these ViewFlags with a single boolean property changed.\n * @param flag The name of the property.\n * @param value The value to change the property to.\n * @returns A new ViewFlags with the property changed as specified, or `this` if the property already has the specified value.\n * @see [[withRenderMode]] to change the [[renderMode]] property.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public with(flag: keyof Omit<ViewFlagsProperties, \"renderMode\">, value: boolean): ViewFlags {\n if (this[flag] === value)\n return this;\n\n const props: ViewFlagsProperties = { ...this };\n props[flag] = value;\n return new ViewFlags(props);\n }\n\n /** Produce a copy of these ViewFlags with a different [[renderMode]].\n * @param renderMode The new render mode.\n * @returns A new ViewFlags with the render mode changed as specified, or `this` if the render mode is already set to the requested value.\n * @see [[copy]] and [[override]] to change multiple properties.\n */\n public withRenderMode(renderMode: RenderMode): ViewFlags {\n return renderMode === this.renderMode ? this : this.copy({ renderMode });\n }\n\n /** Adjust some view flags based on [[renderMode]]. For example, [[transparency]] is always treated as `false` in [[RenderMode.SolidFill]]. */\n public normalize(): ViewFlags {\n switch (this.renderMode) {\n case RenderMode.Wireframe:\n if (this.visibleEdges || this.hiddenEdges)\n return this.copy({ visibleEdges: false, hiddenEdges: false });\n break;\n case RenderMode.SmoothShade:\n if (!this.visibleEdges)\n return this.copy({ hiddenEdges: false });\n break;\n case RenderMode.HiddenLine:\n case RenderMode.SolidFill:\n if (!this.visibleEdges || this.transparency)\n return this.copy({ visibleEdges: true, transparency: false });\n break;\n }\n\n return this;\n }\n\n /** Returns true if edges that could be occluded by other geometry are visible for the current [[RenderMode]]. */\n public hiddenEdgesVisible(): boolean {\n switch (this.renderMode) {\n case RenderMode.SolidFill:\n case RenderMode.HiddenLine:\n return this.hiddenEdges;\n case RenderMode.SmoothShade:\n return this.visibleEdges && this.hiddenEdges;\n }\n return true;\n }\n\n /** Returns true if the edges of surfaces should be displayed, based on [[RenderMode]] and the [[visibleEdges]] flag. */\n public edgesRequired(): boolean {\n return edgesRequired(this.renderMode, this.visibleEdges);\n }\n\n /** Convert to JSON representation.\n * Properties are omitted if they match the default values.\n */\n public toJSON(): ViewFlagProps {\n const out: ViewFlagProps = {};\n if (!this.constructions)\n out.noConstruct = true;\n if (!this.dimensions)\n out.noDim = true;\n if (!this.patterns)\n out.noPattern = true;\n if (!this.weights)\n out.noWeight = true;\n if (!this.styles)\n out.noStyle = true;\n if (!this.transparency)\n out.noTransp = true;\n if (!this.fill)\n out.noFill = true;\n if (this.grid)\n out.grid = true;\n if (this.acsTriad)\n out.acs = true;\n if (!this.textures)\n out.noTexture = true;\n if (!this.materials)\n out.noMaterial = true;\n if (!this.lighting)\n out.noCameraLights = out.noSourceLights = out.noSolarLight = true;\n if (this.visibleEdges)\n out.visEdges = true;\n if (this.hiddenEdges)\n out.hidEdges = true;\n if (this.shadows)\n out.shadows = true;\n if (this.clipVolume)\n out.clipVol = true;\n if (this.monochrome)\n out.monochrome = true;\n if (this.backgroundMap)\n out.backgroundMap = true;\n if (this.ambientOcclusion)\n out.ambientOcclusion = true;\n if (this.thematicDisplay)\n out.thematicDisplay = true;\n if (this.wiremesh)\n out.wiremesh = true;\n if (this.forceSurfaceDiscard)\n out.forceSurfaceDiscard = true;\n if (!this.whiteOnWhiteReversal)\n out.noWhiteOnWhiteReversal = true;\n\n out.renderMode = this.renderMode;\n return out;\n }\n\n /** Like [[toJSON]], but no properties are omitted. */\n public toFullyDefinedJSON(): Required<ViewFlagProps> {\n return {\n renderMode: this.renderMode,\n noConstruct: !this.constructions,\n noDim: !this.dimensions,\n noPattern: !this.patterns,\n noWeight: !this.weights,\n noStyle: !this.styles,\n noTransp: !this.transparency,\n noFill: !this.fill,\n grid: this.grid,\n acs: this.acsTriad,\n noTexture: !this.textures,\n noMaterial: !this.materials,\n noCameraLights: !this.lighting,\n noSourceLights: !this.lighting,\n noSolarLight: !this.lighting,\n visEdges: this.visibleEdges,\n hidEdges: this.hiddenEdges,\n shadows: this.shadows,\n clipVol: this.clipVolume,\n monochrome: this.monochrome,\n backgroundMap: this.backgroundMap,\n ambientOcclusion: this.ambientOcclusion,\n thematicDisplay: this.thematicDisplay,\n wiremesh: this.wiremesh,\n forceSurfaceDiscard: this.forceSurfaceDiscard,\n noWhiteOnWhiteReversal: !this.whiteOnWhiteReversal,\n };\n }\n\n /** A ViewFlags object with all properties initialized to their default values. */\n public static readonly defaults = new ViewFlags();\n\n /** Create a ViewFlags.\n * @param flags The properties to initialize. Any properties not specified are initialized to their default values.\n */\n public static create(flags?: Partial<ViewFlagsProperties>): ViewFlags {\n return flags && !JsonUtils.isEmptyObject(flags) ? new ViewFlags(flags) : this.defaults;\n }\n\n /** Create a ViewFlags from its JSON representation.\n * @note As described in [[ViewFlagProps]], the JSON representation is awkward and error-prone. Prefer to use [[create]] unless you\n * need to deal with the persistence format directly.\n * @note The default values differ slightly from those used by the constructor and [[create]]:\n * - [[clipVolume]] defaults to false.\n * - [[constructions]] defaults to true.\n * - [[lighting]] defaults to true unless all of [[ViewFlagProps.noSolarLight]], [[ViewFlagProps.noCameraLights]], and [[ViewFlagProps.noSourceLights]] are true.\n */\n public static fromJSON(json?: ViewFlagProps): ViewFlags {\n if (!json)\n return this.defaults;\n\n let renderMode: RenderMode;\n const renderModeValue = JsonUtils.asInt(json.renderMode);\n if (renderModeValue < RenderMode.HiddenLine)\n renderMode = RenderMode.Wireframe;\n else if (renderModeValue > RenderMode.SolidFill)\n renderMode = RenderMode.SmoothShade;\n else\n renderMode = renderModeValue;\n\n const lighting = !JsonUtils.asBool(json.noCameraLights) || !JsonUtils.asBool(json.noSourceLights) || !JsonUtils.asBool(json.noSolarLight);\n return new ViewFlags({\n renderMode,\n lighting,\n constructions: !JsonUtils.asBool(json.noConstruct),\n dimensions: !JsonUtils.asBool(json.noDim),\n patterns: !JsonUtils.asBool(json.noPattern),\n weights: !JsonUtils.asBool(json.noWeight),\n styles: !JsonUtils.asBool(json.noStyle),\n transparency: !JsonUtils.asBool(json.noTransp),\n fill: !JsonUtils.asBool(json.noFill),\n grid: JsonUtils.asBool(json.grid),\n acsTriad: JsonUtils.asBool(json.acs),\n textures: !JsonUtils.asBool(json.noTexture),\n materials: !JsonUtils.asBool(json.noMaterial),\n visibleEdges: JsonUtils.asBool(json.visEdges),\n hiddenEdges: JsonUtils.asBool(json.hidEdges),\n shadows: JsonUtils.asBool(json.shadows),\n clipVolume: JsonUtils.asBool(json.clipVol),\n monochrome: JsonUtils.asBool(json.monochrome),\n backgroundMap: JsonUtils.asBool(json.backgroundMap),\n ambientOcclusion: JsonUtils.asBool(json.ambientOcclusion),\n thematicDisplay: JsonUtils.asBool(json.thematicDisplay),\n wiremesh: JsonUtils.asBool(json.wiremesh),\n forceSurfaceDiscard: JsonUtils.asBool(json.forceSurfaceDiscard),\n whiteOnWhiteReversal: !JsonUtils.asBool(json.noWhiteOnWhiteReversal),\n });\n }\n\n /** Returns true if `this` and `other` are equivalent. */\n public equals(other: Readonly<ViewFlagsProperties>): boolean {\n if (this === other)\n return true;\n\n return this.renderMode === other.renderMode\n && this.dimensions === other.dimensions\n && this.patterns === other.patterns\n && this.weights === other.weights\n && this.styles === other.styles\n && this.transparency === other.transparency\n && this.fill === other.fill\n && this.textures === other.textures\n && this.materials === other.materials\n && this.acsTriad === other.acsTriad\n && this.grid === other.grid\n && this.visibleEdges === other.visibleEdges\n && this.hiddenEdges === other.hiddenEdges\n && this.lighting === other.lighting\n && this.shadows === other.shadows\n && this.clipVolume === other.clipVolume\n && this.constructions === other.constructions\n && this.monochrome === other.monochrome\n && this.backgroundMap === other.backgroundMap\n && this.ambientOcclusion === other.ambientOcclusion\n && this.thematicDisplay === other.thematicDisplay\n && this.wiremesh === other.wiremesh\n && this.forceSurfaceDiscard === other.forceSurfaceDiscard\n && this.whiteOnWhiteReversal === other.whiteOnWhiteReversal;\n }\n}\n\n/** A type containing all of the properties of [[ViewFlags]] with none of the methods and with the `readonly` modifiers removed.\n * @see [[ViewFlags.create]], [[ViewFlags.copy]], and [[ViewFlags.override]] for methods accepting an object of this type.\n * @public\n * @extensions\n */\nexport type ViewFlagsProperties = Mutable<NonFunctionPropertiesOf<ViewFlags>>;\n\n/** A type that describes how to override selected properties of a [[ViewFlags]].\n * @see [[ViewFlags.override]] to apply the overrides to a ViewFlags object.\n * @public\n * @extensions\n */\nexport type ViewFlagOverrides = Partial<ViewFlagsProperties>;\n"]}