@itwin/core-common 5.2.0-dev.5 → 5.2.0-dev.7

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 (153) hide show
  1. package/lib/cjs/AnalysisStyle.d.ts.map +1 -1
  2. package/lib/cjs/AnalysisStyle.js +2 -0
  3. package/lib/cjs/AnalysisStyle.js.map +1 -1
  4. package/lib/cjs/BlobReader.d.ts.map +1 -1
  5. package/lib/cjs/BlobReader.js +10 -2
  6. package/lib/cjs/BlobReader.js.map +1 -1
  7. package/lib/cjs/DisplayStyleSettings.d.ts.map +1 -1
  8. package/lib/cjs/DisplayStyleSettings.js +1 -1
  9. package/lib/cjs/DisplayStyleSettings.js.map +1 -1
  10. package/lib/cjs/ECSqlTypes.js +1 -1
  11. package/lib/cjs/ECSqlTypes.js.map +1 -1
  12. package/lib/cjs/FeatureIndex.d.ts.map +1 -1
  13. package/lib/cjs/FeatureIndex.js +2 -1
  14. package/lib/cjs/FeatureIndex.js.map +1 -1
  15. package/lib/cjs/GeometryParams.d.ts.map +1 -1
  16. package/lib/cjs/GeometryParams.js +6 -0
  17. package/lib/cjs/GeometryParams.js.map +1 -1
  18. package/lib/cjs/Gradient.d.ts.map +1 -1
  19. package/lib/cjs/Gradient.js +5 -0
  20. package/lib/cjs/Gradient.js.map +1 -1
  21. package/lib/cjs/HiddenLine.d.ts.map +1 -1
  22. package/lib/cjs/HiddenLine.js +4 -1
  23. package/lib/cjs/HiddenLine.js.map +1 -1
  24. package/lib/cjs/IModel.d.ts.map +1 -1
  25. package/lib/cjs/IModel.js +7 -7
  26. package/lib/cjs/IModel.js.map +1 -1
  27. package/lib/cjs/Localization.d.ts.map +1 -1
  28. package/lib/cjs/Localization.js +3 -0
  29. package/lib/cjs/Localization.js.map +1 -1
  30. package/lib/cjs/TextureMapping.js +2 -2
  31. package/lib/cjs/TextureMapping.js.map +1 -1
  32. package/lib/cjs/ThematicDisplay.d.ts.map +1 -1
  33. package/lib/cjs/ThematicDisplay.js +3 -1
  34. package/lib/cjs/ThematicDisplay.js.map +1 -1
  35. package/lib/cjs/Tween.d.ts +1 -1
  36. package/lib/cjs/Tween.d.ts.map +1 -1
  37. package/lib/cjs/Tween.js +4 -2
  38. package/lib/cjs/Tween.js.map +1 -1
  39. package/lib/cjs/geometry/AdditionalTransform.d.ts.map +1 -1
  40. package/lib/cjs/geometry/AdditionalTransform.js +1 -0
  41. package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
  42. package/lib/cjs/geometry/AreaPattern.d.ts.map +1 -1
  43. package/lib/cjs/geometry/AreaPattern.js +13 -0
  44. package/lib/cjs/geometry/AreaPattern.js.map +1 -1
  45. package/lib/cjs/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
  46. package/lib/cjs/geometry/CoordinateReferenceSystem.js +7 -0
  47. package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
  48. package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
  49. package/lib/cjs/geometry/ElementGeometry.js +19 -10
  50. package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
  51. package/lib/cjs/geometry/ElementGeometryFB.d.ts.map +1 -1
  52. package/lib/cjs/geometry/ElementGeometryFB.js +1 -0
  53. package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
  54. package/lib/cjs/geometry/GeodeticDatum.d.ts.map +1 -1
  55. package/lib/cjs/geometry/GeodeticDatum.js +7 -0
  56. package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
  57. package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
  58. package/lib/cjs/geometry/GeometryStream.js +2 -2
  59. package/lib/cjs/geometry/GeometryStream.js.map +1 -1
  60. package/lib/cjs/geometry/LineStyle.d.ts.map +1 -1
  61. package/lib/cjs/geometry/LineStyle.js +3 -0
  62. package/lib/cjs/geometry/LineStyle.js.map +1 -1
  63. package/lib/cjs/geometry/Placement.d.ts.map +1 -1
  64. package/lib/cjs/geometry/Placement.js +1 -1
  65. package/lib/cjs/geometry/Placement.js.map +1 -1
  66. package/lib/cjs/internal/PackedFeatureTable.d.ts.map +1 -1
  67. package/lib/cjs/internal/PackedFeatureTable.js +1 -1
  68. package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
  69. package/lib/cjs/rpc/core/RpcConfiguration.d.ts +0 -3
  70. package/lib/cjs/rpc/core/RpcConfiguration.d.ts.map +1 -1
  71. package/lib/cjs/rpc/core/RpcConfiguration.js +10 -2
  72. package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
  73. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js +1 -1
  74. package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  75. package/lib/cjs/rpc/web/WebAppRpcRequest.js +1 -1
  76. package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
  77. package/lib/esm/AnalysisStyle.d.ts.map +1 -1
  78. package/lib/esm/AnalysisStyle.js +2 -0
  79. package/lib/esm/AnalysisStyle.js.map +1 -1
  80. package/lib/esm/BlobReader.d.ts.map +1 -1
  81. package/lib/esm/BlobReader.js +10 -2
  82. package/lib/esm/BlobReader.js.map +1 -1
  83. package/lib/esm/DisplayStyleSettings.d.ts.map +1 -1
  84. package/lib/esm/DisplayStyleSettings.js +2 -2
  85. package/lib/esm/DisplayStyleSettings.js.map +1 -1
  86. package/lib/esm/ECSqlTypes.js +1 -1
  87. package/lib/esm/ECSqlTypes.js.map +1 -1
  88. package/lib/esm/FeatureIndex.d.ts.map +1 -1
  89. package/lib/esm/FeatureIndex.js +2 -1
  90. package/lib/esm/FeatureIndex.js.map +1 -1
  91. package/lib/esm/GeometryParams.d.ts.map +1 -1
  92. package/lib/esm/GeometryParams.js +6 -0
  93. package/lib/esm/GeometryParams.js.map +1 -1
  94. package/lib/esm/Gradient.d.ts.map +1 -1
  95. package/lib/esm/Gradient.js +5 -0
  96. package/lib/esm/Gradient.js.map +1 -1
  97. package/lib/esm/HiddenLine.d.ts.map +1 -1
  98. package/lib/esm/HiddenLine.js +4 -1
  99. package/lib/esm/HiddenLine.js.map +1 -1
  100. package/lib/esm/IModel.d.ts.map +1 -1
  101. package/lib/esm/IModel.js +8 -8
  102. package/lib/esm/IModel.js.map +1 -1
  103. package/lib/esm/Localization.d.ts.map +1 -1
  104. package/lib/esm/Localization.js +3 -0
  105. package/lib/esm/Localization.js.map +1 -1
  106. package/lib/esm/TextureMapping.js +3 -3
  107. package/lib/esm/TextureMapping.js.map +1 -1
  108. package/lib/esm/ThematicDisplay.d.ts.map +1 -1
  109. package/lib/esm/ThematicDisplay.js +3 -1
  110. package/lib/esm/ThematicDisplay.js.map +1 -1
  111. package/lib/esm/Tween.d.ts +1 -1
  112. package/lib/esm/Tween.d.ts.map +1 -1
  113. package/lib/esm/Tween.js +4 -2
  114. package/lib/esm/Tween.js.map +1 -1
  115. package/lib/esm/geometry/AdditionalTransform.d.ts.map +1 -1
  116. package/lib/esm/geometry/AdditionalTransform.js +1 -0
  117. package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
  118. package/lib/esm/geometry/AreaPattern.d.ts.map +1 -1
  119. package/lib/esm/geometry/AreaPattern.js +13 -0
  120. package/lib/esm/geometry/AreaPattern.js.map +1 -1
  121. package/lib/esm/geometry/CoordinateReferenceSystem.d.ts.map +1 -1
  122. package/lib/esm/geometry/CoordinateReferenceSystem.js +7 -0
  123. package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
  124. package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
  125. package/lib/esm/geometry/ElementGeometry.js +20 -11
  126. package/lib/esm/geometry/ElementGeometry.js.map +1 -1
  127. package/lib/esm/geometry/ElementGeometryFB.d.ts.map +1 -1
  128. package/lib/esm/geometry/ElementGeometryFB.js +1 -0
  129. package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
  130. package/lib/esm/geometry/GeodeticDatum.d.ts.map +1 -1
  131. package/lib/esm/geometry/GeodeticDatum.js +7 -0
  132. package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
  133. package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
  134. package/lib/esm/geometry/GeometryStream.js +3 -3
  135. package/lib/esm/geometry/GeometryStream.js.map +1 -1
  136. package/lib/esm/geometry/LineStyle.d.ts.map +1 -1
  137. package/lib/esm/geometry/LineStyle.js +3 -0
  138. package/lib/esm/geometry/LineStyle.js.map +1 -1
  139. package/lib/esm/geometry/Placement.d.ts.map +1 -1
  140. package/lib/esm/geometry/Placement.js +2 -2
  141. package/lib/esm/geometry/Placement.js.map +1 -1
  142. package/lib/esm/internal/PackedFeatureTable.d.ts.map +1 -1
  143. package/lib/esm/internal/PackedFeatureTable.js +2 -2
  144. package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
  145. package/lib/esm/rpc/core/RpcConfiguration.d.ts +0 -3
  146. package/lib/esm/rpc/core/RpcConfiguration.d.ts.map +1 -1
  147. package/lib/esm/rpc/core/RpcConfiguration.js +10 -2
  148. package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
  149. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js +1 -1
  150. package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
  151. package/lib/esm/rpc/web/WebAppRpcRequest.js +2 -2
  152. package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
  153. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"HiddenLine.js","sourceRoot":"","sources":["../../src/HiddenLine.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,KAAW,UAAU,CA8N1B;AA9ND,WAAiB,UAAU;IA2BzB,gEAAgE;IAChE,MAAa,KAAK;QAChB,IAAW,QAAQ,KA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IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;gBAChE,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;gBAC5D,cAAc,EAAE,SAAS,KAAK,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB;aACzG,CAAC,CAAC;QACL,CAAC;QAEM,MAAM,CAAC,KAAe;YAC3B,IAAI,IAAI,KAAK,KAAK;gBAChB,OAAO,IAAI,CAAC;YAEd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;mBACpC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;mBAChC,IAAI,CAAC,qBAAqB,KAAK,KAAK,CAAC,qBAAqB,CAAC;QAClE,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;QAED,YAAoB,IAAmB;YACrC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAChD,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAC5E,CAAC;;IArEU,mBAAQ,WAsEpB,CAAA;AACH,CAAC,EA9NgB,UAAU,KAAV,UAAU,QA8N1B","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\nimport { JsonUtils } from \"@itwin/core-bentley\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { LinePixels } from \"./LinePixels\";\n\n/** Namespace containing types controlling how edges and surfaces should be drawn in \"hidden line\" and \"solid fill\" [[RenderMode]]s.\n * @public\n */\nexport namespace HiddenLine {\n /** Describes the symbology with which edges should be drawn.\n * This JSON representation is awkward, but it must match that used in the db.\n * If the JSON came from the db then all members are present and:\n * - color is overridden only if ovrColor = true.\n * - width is overridden only if width != 0\n * - pattern is overridden only if pattern != LinePixels.Invalid\n * The 'public' JSON representation is more sensible:\n * - Color, width, and pattern are each overridden iff they are not undefined.\n * To make this work for both scenarios, the rules are:\n * - color is overridden if color != undefined and ovrColor != false\n * - width is overridden if width != undefined and width != 0\n * - pattern is overridden if pattern != undefined and pattern != LinePixels.Invalid\n */\n export interface StyleProps {\n /** If true, and [[color]] is defined, then the edge color is overridden. */\n ovrColor?: boolean;\n /** If defined, and [[ovrColor]] is not `false`, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\n color?: ColorDefProps;\n /** If defined and not equal to [[LinePixels.Invalid]], the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\n pattern?: LinePixels;\n /** If defined and non-zero, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\n */\n width?: number;\n }\n\n /** Describes the symbology with which edges should be drawn. */\n export class Style {\n public get ovrColor(): boolean { return undefined !== this.color; }\n /** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\n public readonly color?: ColorDef;\n /** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\n public readonly pattern?: LinePixels;\n /** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\n */\n public readonly width?: number;\n\n private constructor(json?: StyleProps, hidden?: true) {\n if (JsonUtils.isEmptyObjectOrUndefined(json)) {\n if (hidden)\n this.pattern = LinePixels.HiddenLine;\n\n return;\n }\n\n json = json as StyleProps; // per JsonUtils.isEmptyObjectOrUndefined()\n if (undefined !== json.color && false !== json.ovrColor)\n this.color = ColorDef.fromJSON(json.color);\n\n if (undefined !== json.pattern) {\n const pattern = JsonUtils.asInt(json.pattern, hidden ? LinePixels.HiddenLine : LinePixels.Invalid);\n if (LinePixels.Invalid !== pattern)\n this.pattern = pattern;\n } else if (hidden) {\n this.pattern = LinePixels.HiddenLine;\n }\n\n if (undefined !== json.width) {\n let width = JsonUtils.asInt(json.width, 0);\n if (0 !== width) {\n width = Math.max(1, width);\n this.width = Math.min(32, width);\n }\n }\n }\n\n public static readonly defaultVisible = new Style({});\n public static readonly defaultHidden = new Style({}, true);\n\n public static fromJSON(json?: StyleProps, hidden?: true): Style {\n if (undefined !== json)\n return new Style(json, hidden);\n\n return hidden ? this.defaultHidden : this.defaultVisible;\n }\n\n /** Create a Style equivalent to this one but with the specified color override. */\n public overrideColor(color: ColorDef | undefined): Style {\n if (undefined === this.color && undefined === color)\n return this;\n\n if (undefined !== this.color && undefined !== color && this.color.equals(color))\n return this;\n\n return Style.fromJSON({\n color: color?.toJSON(),\n ovrColor: undefined !== color,\n pattern: this.pattern,\n width: this.width,\n });\n }\n\n /** Create a Style equivalent to this one but with the specified pattern override. */\n public overridePattern(pattern: LinePixels | undefined): Style {\n if (pattern === this.pattern)\n return this;\n\n return Style.fromJSON({\n color: this.color?.toJSON(),\n ovrColor: this.ovrColor,\n pattern,\n width: this.width,\n });\n }\n\n /** Create a Style equivalent to this one but with the specified width override. */\n public overrideWidth(width: number | undefined): Style {\n if (width === this.width)\n return this;\n\n return Style.fromJSON({\n color: this.color?.toJSON(),\n ovrColor: this.ovrColor,\n pattern: this.pattern,\n width,\n });\n }\n\n /** Returns true if this Style is equivalent to the supplied Style. */\n public equals(other: Style): boolean {\n if (this === other)\n return true;\n else if (this.ovrColor !== other.ovrColor || this.pattern !== other.pattern || this.width !== other.width)\n return false;\n else\n return undefined === this.color || this.color.equals(other.color!);\n }\n\n public toJSON(): StyleProps {\n return {\n ovrColor: this.ovrColor,\n color: this.color ? this.color.toJSON() : ColorDef.white.toJSON(),\n pattern: undefined !== this.pattern ? this.pattern : LinePixels.Invalid,\n width: undefined !== this.width ? this.width : 0,\n };\n }\n }\n\n /** The JSON representation of a [[HiddenLine.Settings]]. */\n export interface SettingsProps {\n /** See [[HiddenLine.Settings.visible]]. */\n visible?: StyleProps;\n /** See [[HiddenLine.Settings.hidden]]. */\n hidden?: StyleProps;\n /** See [[HiddenLine.Settings.transparencyThreshold. */\n transThreshold?: number;\n }\n\n /** Describes how visible and hidden edges and transparent surfaces should be rendered in \"hidden line\" and \"solid fill\" [[RenderMode]]s. */\n export class Settings {\n /** Describes how visible edges (those unobscured by other geometry) should be displayed. */\n public readonly visible: Style;\n /** Describes how hidden edges (those obscured by other geometry) should be displayed. */\n public readonly hidden: Style;\n /** A value in the range [0.0, 1.0] specifying a threshold below which transparent surfaces should not be drawn.\n * A value of 0.0 indicates any surface that is not 100% opaque should not be drawn.\n * A value of 0.25 indicates any surface that is less than 25% opaque should not be drawn.\n * A value of 1.0 indicates that all surfaces should be drawn regardless of transparency.\n * @note values will be clamped to the range [0.0, 1.0].\n * @note Defaults to 1.0.\n */\n public readonly transparencyThreshold: number;\n\n /** An alias for [[transparencyThreshold]]. */\n public get transThreshold(): number { return this.transparencyThreshold; }\n\n /** The default display settings. */\n public static defaults = new Settings({});\n\n /** Create a DisplaySettings from its JSON representation. */\n public static fromJSON(json?: SettingsProps): Settings {\n if (JsonUtils.isEmptyObjectOrUndefined(json))\n return this.defaults;\n else if (json instanceof Settings)\n return json;\n else\n return new Settings(json!);\n }\n\n public toJSON(): SettingsProps {\n const props: SettingsProps = {\n visible: this.visible.toJSON(),\n hidden: this.hidden.toJSON(),\n transThreshold: this.transThreshold,\n };\n\n return props;\n }\n\n /** Create a Settings equivalent to this one with the exception of those properties defined in the supplied JSON. */\n public override(props: SettingsProps): Settings {\n const visible = props.visible;\n const hidden = props.hidden;\n const transparencyThreshold = props.transThreshold;\n return Settings.fromJSON({\n visible: undefined !== visible ? visible : this.visible.toJSON(),\n hidden: undefined !== hidden ? hidden : this.hidden.toJSON(),\n transThreshold: undefined !== transparencyThreshold ? transparencyThreshold : this.transparencyThreshold,\n });\n }\n\n public equals(other: Settings): boolean {\n if (this === other)\n return true;\n\n return this.visible.equals(other.visible)\n && this.hidden.equals(other.hidden)\n && this.transparencyThreshold === other.transparencyThreshold;\n }\n\n public get matchesDefaults(): boolean {\n return this.equals(Settings.defaults);\n }\n\n private constructor(json: SettingsProps) {\n this.visible = Style.fromJSON(json.visible);\n this.hidden = Style.fromJSON(json.hidden, true);\n this.transparencyThreshold = JsonUtils.asDouble(json.transThreshold, 1.0);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"HiddenLine.js","sourceRoot":"","sources":["../../src/HiddenLine.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,KAAW,UAAU,CAiO1B;AAjOD,WAAiB,UAAU;IA2BzB,gEAAgE;IAChE,MAAa,KAAK;QAChB,IAAW,QAAQ,KAAc,OAAO,SAAS,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACnE,kHAAkH;QAClG,KAAK,CAAY;QACjC,4HAA4H;QAC5G,OAAO,CAAc;QACrC;;WAEG;QACa,KAAK,CAAU;QAE/B,YAAoB,IAAiB,EAAE,MAAa;YAClD,IAAI,SAAS,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC7C,IAAI,MAAM;oBACR,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC;gBAEvC,OAAO;YACT,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C,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB;aACzG,CAAC,CAAC;QACL,CAAC;QAEM,MAAM,CAAC,KAAe;YAC3B,IAAI,IAAI,KAAK,KAAK;gBAChB,OAAO,IAAI,CAAC;YAEd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;mBACpC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;mBAChC,IAAI,CAAC,qBAAqB,KAAK,KAAK,CAAC,qBAAqB,CAAC;QAClE,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;QAED,YAAoB,IAAmB;YACrC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAChD,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;QAC5E,CAAC;;IArEU,mBAAQ,WAsEpB,CAAA;AACH,CAAC,EAjOgB,UAAU,KAAV,UAAU,QAiO1B","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\nimport { JsonUtils } from \"@itwin/core-bentley\";\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\nimport { LinePixels } from \"./LinePixels\";\n\n/** Namespace containing types controlling how edges and surfaces should be drawn in \"hidden line\" and \"solid fill\" [[RenderMode]]s.\n * @public\n */\nexport namespace HiddenLine {\n /** Describes the symbology with which edges should be drawn.\n * This JSON representation is awkward, but it must match that used in the db.\n * If the JSON came from the db then all members are present and:\n * - color is overridden only if ovrColor = true.\n * - width is overridden only if width != 0\n * - pattern is overridden only if pattern != LinePixels.Invalid\n * The 'public' JSON representation is more sensible:\n * - Color, width, and pattern are each overridden iff they are not undefined.\n * To make this work for both scenarios, the rules are:\n * - color is overridden if color != undefined and ovrColor != false\n * - width is overridden if width != undefined and width != 0\n * - pattern is overridden if pattern != undefined and pattern != LinePixels.Invalid\n */\n export interface StyleProps {\n /** If true, and [[color]] is defined, then the edge color is overridden. */\n ovrColor?: boolean;\n /** If defined, and [[ovrColor]] is not `false`, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\n color?: ColorDefProps;\n /** If defined and not equal to [[LinePixels.Invalid]], the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\n pattern?: LinePixels;\n /** If defined and non-zero, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\n */\n width?: number;\n }\n\n /** Describes the symbology with which edges should be drawn. */\n export class Style {\n public get ovrColor(): boolean { return undefined !== this.color; }\n /** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\n public readonly color?: ColorDef;\n /** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\n public readonly pattern?: LinePixels;\n /** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\n */\n public readonly width?: number;\n\n private constructor(json?: StyleProps, hidden?: true) {\n if (JsonUtils.isEmptyObjectOrUndefined(json)) {\n if (hidden)\n this.pattern = LinePixels.HiddenLine;\n\n return;\n }\n\n json = json as StyleProps; // per JsonUtils.isEmptyObjectOrUndefined()\n if (undefined !== json.color && false !== json.ovrColor)\n this.color = ColorDef.fromJSON(json.color);\n\n if (undefined !== json.pattern) {\n const pattern = JsonUtils.asInt(json.pattern, hidden ? LinePixels.HiddenLine : LinePixels.Invalid);\n if (LinePixels.Invalid !== pattern)\n this.pattern = pattern;\n } else if (hidden) {\n this.pattern = LinePixels.HiddenLine;\n }\n\n if (undefined !== json.width) {\n let width = JsonUtils.asInt(json.width, 0);\n if (0 !== width) {\n width = Math.max(1, width);\n this.width = Math.min(32, width);\n }\n }\n }\n\n public static readonly defaultVisible = new Style({});\n public static readonly defaultHidden = new Style({}, true);\n\n public static fromJSON(json?: StyleProps, hidden?: true): Style {\n if (undefined !== json)\n return new Style(json, hidden);\n\n return hidden ? this.defaultHidden : this.defaultVisible;\n }\n\n /** Create a Style equivalent to this one but with the specified color override. */\n public overrideColor(color: ColorDef | undefined): Style {\n if (undefined === this.color && undefined === color)\n return this;\n\n if (undefined !== this.color && undefined !== color && this.color.equals(color))\n return this;\n\n return Style.fromJSON({\n color: color?.toJSON(),\n ovrColor: undefined !== color,\n pattern: this.pattern,\n width: this.width,\n });\n }\n\n /** Create a Style equivalent to this one but with the specified pattern override. */\n public overridePattern(pattern: LinePixels | undefined): Style {\n if (pattern === this.pattern)\n return this;\n\n return Style.fromJSON({\n color: this.color?.toJSON(),\n ovrColor: this.ovrColor,\n pattern,\n width: this.width,\n });\n }\n\n /** Create a Style equivalent to this one but with the specified width override. */\n public overrideWidth(width: number | undefined): Style {\n if (width === this.width)\n return this;\n\n return Style.fromJSON({\n color: this.color?.toJSON(),\n ovrColor: this.ovrColor,\n pattern: this.pattern,\n width,\n });\n }\n\n /** Returns true if this Style is equivalent to the supplied Style. */\n public equals(other: Style): boolean {\n if (this === other)\n return true;\n else if (this.ovrColor !== other.ovrColor || this.pattern !== other.pattern || this.width !== other.width)\n return false;\n else if ((undefined === this.color) !== (undefined === other.color))\n return false;\n else\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return undefined === this.color || this.color.equals(other.color!);\n }\n\n public toJSON(): StyleProps {\n return {\n ovrColor: this.ovrColor,\n color: this.color ? this.color.toJSON() : ColorDef.white.toJSON(),\n pattern: undefined !== this.pattern ? this.pattern : LinePixels.Invalid,\n width: undefined !== this.width ? this.width : 0,\n };\n }\n }\n\n /** The JSON representation of a [[HiddenLine.Settings]]. */\n export interface SettingsProps {\n /** See [[HiddenLine.Settings.visible]]. */\n visible?: StyleProps;\n /** See [[HiddenLine.Settings.hidden]]. */\n hidden?: StyleProps;\n /** See [[HiddenLine.Settings.transparencyThreshold. */\n transThreshold?: number;\n }\n\n /** Describes how visible and hidden edges and transparent surfaces should be rendered in \"hidden line\" and \"solid fill\" [[RenderMode]]s. */\n export class Settings {\n /** Describes how visible edges (those unobscured by other geometry) should be displayed. */\n public readonly visible: Style;\n /** Describes how hidden edges (those obscured by other geometry) should be displayed. */\n public readonly hidden: Style;\n /** A value in the range [0.0, 1.0] specifying a threshold below which transparent surfaces should not be drawn.\n * A value of 0.0 indicates any surface that is not 100% opaque should not be drawn.\n * A value of 0.25 indicates any surface that is less than 25% opaque should not be drawn.\n * A value of 1.0 indicates that all surfaces should be drawn regardless of transparency.\n * @note values will be clamped to the range [0.0, 1.0].\n * @note Defaults to 1.0.\n */\n public readonly transparencyThreshold: number;\n\n /** An alias for [[transparencyThreshold]]. */\n public get transThreshold(): number { return this.transparencyThreshold; }\n\n /** The default display settings. */\n public static defaults = new Settings({});\n\n /** Create a DisplaySettings from its JSON representation. */\n public static fromJSON(json?: SettingsProps): Settings {\n if (!JsonUtils.isNonEmptyObject(json))\n return this.defaults;\n else if (json instanceof Settings)\n return json;\n else\n return new Settings(json);\n }\n\n public toJSON(): SettingsProps {\n const props: SettingsProps = {\n visible: this.visible.toJSON(),\n hidden: this.hidden.toJSON(),\n transThreshold: this.transThreshold,\n };\n\n return props;\n }\n\n /** Create a Settings equivalent to this one with the exception of those properties defined in the supplied JSON. */\n public override(props: SettingsProps): Settings {\n const visible = props.visible;\n const hidden = props.hidden;\n const transparencyThreshold = props.transThreshold;\n return Settings.fromJSON({\n visible: undefined !== visible ? visible : this.visible.toJSON(),\n hidden: undefined !== hidden ? hidden : this.hidden.toJSON(),\n transThreshold: undefined !== transparencyThreshold ? transparencyThreshold : this.transparencyThreshold,\n });\n }\n\n public equals(other: Settings): boolean {\n if (this === other)\n return true;\n\n return this.visible.equals(other.visible)\n && this.hidden.equals(other.hidden)\n && this.transparencyThreshold === other.transparencyThreshold;\n }\n\n public get matchesDefaults(): boolean {\n return this.equals(Settings.defaults);\n }\n\n private constructor(json: SettingsProps) {\n this.visible = Style.fromJSON(json.visible);\n this.hidden = Style.fromJSON(json.hidden, true);\n this.transparencyThreshold = JsonUtils.asDouble(json.transThreshold, 1.0);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IModel.d.ts","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,OAAO,EAAoB,UAAU,EAAQ,UAAU,EAAyB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvI,OAAO,EACL,KAAK,EAAsD,OAAO,EAAW,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAChJ,kBAAkB,EAAE,iBAAiB,EACtC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kHAAkH;IAClH,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS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AE1D;;OAEG;IACI,WAAW,IAAI,cAAc;IAOpC;;;OAGG;IACH,SAAS,CAAC,YAAY,IAAI,cAAc;IASxC,gBAAgB;IAChB,SAAS,aAAa,UAAU,CAAC,EAAE,cAAc;IAUjD,gBAAgB;IAChB,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW;IAYrD,gEAAgE;WAClD,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;IAIzE,uFAAuF;IACvF,IAAW,YAAY,YAA+C;IAEtE;;OAEG;IACI,gBAAgB,IAAI,SAAS;IAMpC;;;;;OAKG;IACI,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAEhE;;;;;;OAMG;IACI,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAE7D;;;;;OAKG;IACI,6BAA6B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY;IAE1F;;;;;;OAMG;IACI,6BAA6B,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO;CAClF"}
package/lib/esm/IModel.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module iModels
7
7
  */
8
- import { assert, BeEvent, GeoServiceStatus, Id64, IModelStatus, OpenMode } from "@itwin/core-bentley";
8
+ import { assert, BeEvent, expectDefined, GeoServiceStatus, Id64, IModelStatus, OpenMode } from "@itwin/core-bentley";
9
9
  import { AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Transform, Vector3d, YawPitchRollAngles, } from "@itwin/core-geometry";
10
10
  import { Cartographic } from "./geometry/Cartographic";
11
11
  import { GeographicCRS } from "./geometry/CoordinateReferenceSystem";
@@ -71,9 +71,9 @@ export class EcefLocation {
71
71
  const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });
72
72
  const ecefNorth = northCarto.toEcef();
73
73
  const ecefEast = eastCarto.toEcef();
74
- const xVector = Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize();
75
- const yVector = Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize();
76
- const matrix = Matrix3d.createRigidFromColumns(xVector, yVector, AxisOrder.XYZ);
74
+ const xVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize());
75
+ const yVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize());
76
+ const matrix = expectDefined(Matrix3d.createRigidFromColumns(xVector, yVector, AxisOrder.XYZ));
77
77
  if (angle !== undefined) {
78
78
  const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);
79
79
  matrix.multiplyMatrixMatrix(north, matrix);
@@ -82,7 +82,7 @@ export class EcefLocation {
82
82
  const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));
83
83
  ecefOrigin.addInPlace(delta);
84
84
  }
85
- return new EcefLocation({ origin: ecefOrigin, orientation: YawPitchRollAngles.createFromMatrix3d(matrix), cartographicOrigin: origin });
85
+ return new EcefLocation({ origin: ecefOrigin, orientation: expectDefined(YawPitchRollAngles.createFromMatrix3d(matrix)), cartographicOrigin: origin });
86
86
  }
87
87
  /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */
88
88
  static createFromTransform(transform) {
@@ -275,7 +275,7 @@ export class IModel {
275
275
  projectExtents: this.projectExtents.toJSON(),
276
276
  globalOrigin: this.globalOrigin.toJSON(),
277
277
  ecefLocation: this.ecefLocation,
278
- geographicCoordinateSystem: this.geographicCoordinateSystem,
278
+ geographicCoordinateSystem: this.geographicCoordinateSystem?.toJSON(),
279
279
  ...this._getRpcProps(),
280
280
  };
281
281
  }
@@ -377,14 +377,14 @@ export class IModel {
377
377
  * @throws IModelError if [[isGeoLocated]] is false.
378
378
  * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.
379
379
  */
380
- ecefToSpatial(ecef, result) { return this.getEcefTransform().multiplyInversePoint3d(ecef, result); }
380
+ ecefToSpatial(ecef, result) { return expectDefined(this.getEcefTransform().multiplyInversePoint3d(ecef, result)); }
381
381
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].
382
382
  * @param spatial A point in the iModel's spatial coordinates
383
383
  * @param result If defined, use this for output
384
384
  * @returns A Cartographic location
385
385
  * @throws IModelError if [[isGeoLocated]] is false.
386
386
  */
387
- spatialToCartographicFromEcef(spatial, result) { return Cartographic.fromEcef(this.spatialToEcef(spatial), result); }
387
+ spatialToCartographicFromEcef(spatial, result) { return expectDefined(Cartographic.fromEcef(this.spatialToEcef(spatial), result)); }
388
388
  /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].
389
389
  * @param cartographic A cartographic location
390
390
  * @param result If defined, use this for output
@@ -1 +1 @@
1
- {"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAc,IAAI,EAAc,YAAY,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvI,OAAO,EACE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAkB,QAAQ,EAC9H,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAyM5C;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACvB,wCAAwC;IACxB,MAAM,CAAU;IAChC,4CA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QACrB,IAAI,SAAS,KAAK,IAAI,CAAC,aAAa;YAClC,MAAM,IAAI,WAAW,CAAC,gBAAgB,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,OAAe,EAAE,MAAgB,IAAa,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAErI;;;;;;OAMG;IACI,aAAa,CAAC,IAAY,EAAE,MAAgB,IAAa,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC;IAEvI;;;;;OAKG;IACI,6BAA6B,CAAC,OAAe,EAAE,MAAqB,IAAkB,OAAO,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAE,CAAC,CAAC,CAAC;IAElK;;;;;;OAMG;IACI,6BAA6B,CAAC,YAA0B,EAAE,MAAgB,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,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 iModels\n */\n\nimport { assert, BeEvent, GeoServiceStatus, GuidString, Id64, Id64String, IModelStatus, Mutable, OpenMode } from \"@itwin/core-bentley\";\nimport {\n Angle, AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Range3dProps, Transform, TransformProps, Vector3d, XYAndZ, XYZProps,\n YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ChangesetIdWithIndex } from \"./ChangesetProps\";\nimport { Cartographic, CartographicProps } from \"./geometry/Cartographic\";\nimport { GeographicCRS, GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\nimport { AxisAlignedBox3d } from \"./geometry/Placement\";\nimport { IModelError } from \"./IModelError\";\nimport { ThumbnailProps } from \"./Thumbnail\";\n\n/** The properties to open a connection to an iModel for RPC operations.\n * @public\n */\nexport interface IModelRpcOpenProps {\n /** The iTwin in which the iModel exists - must be defined for briefcases that are synchronized with iModelHub. */\n readonly iTwinId?: GuidString;\n /** Guid of the iModel. */\n readonly iModelId?: GuidString;\n\n /** Id of the last Changeset that was applied to the iModel - must be defined for briefcases that are synchronized with iModelHub.\n * @note Changeset Ids are string hash values based on the content and parent.\n */\n readonly changeset?: ChangesetIdWithIndex;\n}\n\n/** The properties that identify an opened iModel for RPC operations.\n * @public\n */\nexport interface IModelRpcProps extends IModelRpcOpenProps {\n /** Unique key used for identifying the iModel between the frontend and the backend */\n readonly key: string;\n}\n\n/** Properties that position an iModel on the earth via [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\n * The origin is specified as an ECEF coordinate. The cartographicOrigin property contains the latitude, longitude and elevation above the WGS84 ellipsoid\n * of the origin property. This cartographicOrigin is offered as a convenient pre-calculated value representing the location of the ECEF origin.\n * The 3D coordinate system this class represents is positioned at specified origin and the axis positioned according to\n * the other properties.\n * If transform property is defined then it will not be computed from other properties.\n * If the xVector and yVector properties are defined (and transform is not defined) then they take precedence over the YawPitchRoll orientation property. The xVector and yVector\n * represent the direction and scale of the X and Y axes. The Z axis is always perpendicular (according to the right hand rule) to these X-Y axes.\n * The scaling in the Z direction is always unity. The scale of the X and Y axes is represented by the size of the vector length.\n * If the xVector and yVector are not present then the YawPitchRoll properties indicates the angles for all tree axes. Scaling in that case\n * is unity in all three directions.\n * Note that the present class is intended to represent geolocated 3D coordinate systems that are normally tangent to the WGS84 ellipsoid\n * possibly offset in altitude by the terrain elevation above the ellipsoid but other general 3D coordinate systems\n * can be defined.\n * @public\n * @extensions\n */\nexport interface EcefLocationProps {\n /** The Origin of an iModel on the earth in ECEF coordinates */\n readonly origin: XYZProps;\n /** The [orientation](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion) of an iModel on the earth. */\n readonly orientation: YawPitchRollProps;\n /** Optional position on the earth used to establish the ECEF coordinates. */\n readonly cartographicOrigin?: CartographicProps;\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\n readonly xVector?: XYZProps;\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\n readonly yVector?: XYZProps;\n /** Optional potentially non-rigid transform defining the ECEF location.\n * @note If this property is supplied, the other properties are ignored.\n */\n readonly transform?: TransformProps;\n}\n\n/** Properties of the [Root Subject]($docs/bis/guide/references/glossary#subject-root).\n * @public\n * @extensions\n */\nexport interface RootSubjectProps {\n /** The name of the root subject. */\n readonly name: string;\n /** Description of the root subject (optional). */\n readonly description?: string;\n}\n\n/** Properties of an iModel that are always held in memory whenever one is opened, both on the frontend and on the backend .\n * @public\n */\nexport interface IModelProps {\n /** The name and description of the root subject of this iModel */\n readonly rootSubject: RootSubjectProps;\n /** The volume of the entire project, in spatial coordinates */\n readonly projectExtents?: Range3dProps;\n /** An offset to be applied to all spatial coordinates. This is normally used to transform spatial coordinates into the Cartesian coordinate system of a Geographic Coordinate System. */\n readonly globalOrigin?: XYZProps;\n /** The location of the iModel in Earth Centered Earth Fixed coordinates. iModel units are always meters */\n readonly ecefLocation?: EcefLocationProps;\n /** The Geographic Coordinate Reference System indicating the projection and datum used. */\n readonly geographicCoordinateSystem?: GeographicCRSProps;\n /** The name of the iModel. */\n readonly name?: string;\n}\n\n/** The properties returned by the backend when creating a new [[IModelConnection]] from the frontend, either with Rpc or with Ipc.\n * These properties describe the iModel held on the backend for thew newly formed connection and are used to construct a new\n * [[IModelConnection]] instance on the frontend to access it.\n * @public\n */\nexport type IModelConnectionProps = IModelProps & IModelRpcProps;\n\n/** The properties that can be supplied when creating a *new* iModel.\n * @public\n */\nexport interface CreateIModelProps extends IModelProps {\n /** The GUID of new iModel. If not present, a GUID will be generated. */\n readonly guid?: GuidString;\n /** Client name for new iModel */\n readonly client?: string;\n /** Thumbnail for new iModel\n * @alpha\n */\n readonly thumbnail?: ThumbnailProps;\n}\n\n/**\n * Sqlite options.\n * @public\n */\nexport interface OpenSqliteArgs {\n /**\n * Specify timeout after which SQLite stop retrying to acquire lock to database file and throw SQLITE_BUSY error.\n * Timeout is specified in milliseconds.\n * For more information https://www.sqlite.org/c3ref/busy_timeout.html.\n * */\n readonly busyTimeout?: number;\n}\n\n/**\n * A key used to identify an opened [IModelDb]($backend) between the frontend and backend for Rpc and Ipc communications.\n * Keys must be unique - that is there can never be two IModelDbs opened with the same key at any given time.\n * If no key is supplied in a call to open an IModelDb, one is generated and returned.\n * It is only necessary to supply a key if you have some reason to assign a specific value to identify an IModelDb.\n * If you don't supply the key, you must use the returned value for Rpc and Ipc communications.\n * @public\n */\nexport interface OpenDbKey {\n readonly key?: string;\n}\n\n/** @beta TODO documentation */\nexport interface CloudContainerUri {\n readonly uriParams: string;\n}\n\n/** Options to open a [SnapshotDb]($backend).\n * @public\n */\nexport interface SnapshotOpenOptions extends OpenDbKey {\n /**\n * The \"base\" name that can be used for creating temporary files related to this Db.\n * The string should be a name related to the current Db filename using some known pattern so that all files named \"baseName*\" can be deleted externally during cleanup.\n * It must be the name of a file (that may or may not exist) in a writable directory.\n * If not present, the baseName will default to the database's file name (including the path).\n * @internal\n */\n readonly tempFileBase?: string;\n}\n\n/** Options to open a [StandaloneDb]($backend) via [StandaloneDb.openFile]($backend) from the backend,\n * or [BriefcaseConnection.openStandalone]($frontend) from the frontend.\n * @public\n */\nexport type StandaloneOpenOptions = OpenDbKey;\n\n/** Options that can be supplied when creating snapshot iModels.\n * @public\n */\nexport interface CreateSnapshotIModelProps {\n /** If true, then create SQLite views for Model, Element, ElementAspect, and Relationship classes.\n * These database views can often be useful for interoperability workflows.\n */\n readonly createClassViews?: boolean;\n}\n\n/** The options that can be specified when creating an *empty* snapshot iModel.\n * @see [SnapshotDb.createEmpty]($backend)\n * @public\n */\nexport type CreateEmptySnapshotIModelProps = CreateIModelProps & CreateSnapshotIModelProps;\n\n/** Options that can be supplied when creating standalone iModels.\n * @public\n */\nexport interface CreateStandaloneIModelProps {\n /** If present, file will allow local editing, but cannot be used to create changesets */\n readonly allowEdit?: string;\n}\n\n/** The options that can be specified when creating an *empty* standalone iModel.\n * @see [StandaloneDb.createEmpty]($backend)\n * @public\n */\nexport type CreateEmptyStandaloneIModelProps = CreateIModelProps & CreateStandaloneIModelProps;\n\n/**\n * @public\n * @extensions\n */\nexport interface FilePropertyProps {\n readonly namespace: string;\n readonly name: string;\n id?: number | string;\n subId?: number | string;\n}\n\n/** The position and orientation of an iModel on the earth in [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\n * @note This is an immutable type - all of its properties are frozen.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n * @public\n */\nexport class EcefLocation implements EcefLocationProps {\n /** The origin of the ECEF transform. */\n public readonly origin: Point3d;\n /** The orientation of the ECEF transform */\n public readonly orientation: YawPitchRollAngles;\n /** Optional position on the earth used to establish the ECEF origin and orientation. */\n public readonly cartographicOrigin?: Cartographic;\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\n public readonly xVector?: Vector3d;\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\n public readonly yVector?: Vector3d;\n /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */\n private readonly _transform: Transform = Transform.createIdentity();\n\n /** Get the transform from iModel Spatial coordinates to ECEF from this EcefLocation */\n public getTransform(): Transform { return this._transform; }\n\n /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */\n constructor(props: EcefLocationProps) {\n this.origin = Point3d.fromJSON(props.origin).freeze();\n this.orientation = YawPitchRollAngles.fromJSON(props.orientation).freeze();\n if (props.cartographicOrigin)\n this.cartographicOrigin = Cartographic.fromRadians({ longitude: props.cartographicOrigin.longitude, latitude: props.cartographicOrigin.latitude, height: props.cartographicOrigin.height }).freeze();\n if (props.xVector && props.yVector) {\n this.xVector = Vector3d.fromJSON(props.xVector).freeze();\n this.yVector = Vector3d.fromJSON(props.yVector).freeze();\n }\n if (props.transform) {\n this._transform.setFromJSON(props.transform);\n this._transform.freeze();\n } else {\n let matrix;\n if (this.xVector && this.yVector) {\n const zVector = this.xVector.crossProduct(this.yVector);\n if (zVector.normalizeInPlace())\n matrix = Matrix3d.createColumns(this.xVector, this.yVector, zVector);\n }\n if (!matrix)\n matrix = this.orientation.toMatrix3d();\n\n this._transform = Transform.createOriginAndMatrix(this.origin, matrix);\n this._transform.freeze();\n }\n }\n\n /** Returns true if this EcefLocation is not located at the center of the Earth.\n * @alpha are locations very close to the center considered valid? What are the specific criteria?\n */\n public get isValid(): boolean {\n return !this.origin.isZero;\n }\n\n /** Construct ECEF Location from cartographic origin with optional known point and angle. */\n public static createFromCartographicOrigin(origin: Cartographic, point?: Point3d, angle?: Angle) {\n const ecefOrigin = origin.toEcef();\n const deltaRadians = 10 / Constant.earthRadiusWGS84.polar;\n const northCarto = Cartographic.fromRadians({ longitude: origin.longitude, latitude: origin.latitude + deltaRadians, height: origin.height });\n const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });\n const ecefNorth = northCarto.toEcef();\n const ecefEast = eastCarto.toEcef();\n const xVector = Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize();\n const yVector = Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize();\n const matrix = Matrix3d.createRigidFromColumns(xVector!, yVector!, AxisOrder.XYZ)!;\n if (angle !== undefined) {\n const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);\n matrix.multiplyMatrixMatrix(north, matrix);\n }\n if (point !== undefined) {\n const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));\n ecefOrigin.addInPlace(delta);\n }\n\n return new EcefLocation({ origin: ecefOrigin, orientation: YawPitchRollAngles.createFromMatrix3d(matrix)!, cartographicOrigin: origin });\n }\n\n /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */\n public static createFromTransform(transform: Transform): EcefLocation {\n const ecefOrigin = transform.getOrigin();\n const angleFromInput = YawPitchRollAngles.createDegrees(0, 0, 0);\n const locationOrientationFromInputT = YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);\n const transformProps = transform.toJSON();\n\n return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });\n }\n\n /** Get the location center of the earth in the iModel coordinate system. */\n public get earthCenter(): Point3d {\n const matrix = this.orientation.toMatrix3d();\n return Point3d.createFrom(matrix.multiplyTransposeXYZ(-this.origin.x, -this.origin.y, -this.origin.z));\n }\n\n /** Return true if this location is equivalent to another location within a small tolerance. */\n public isAlmostEqual(other: EcefLocation): boolean {\n if (!this.origin.isAlmostEqual(other.origin) || !this.orientation.isAlmostEqual(other.orientation))\n return false;\n\n if ((this.xVector === undefined) !== (other.xVector === undefined) || (this.yVector === undefined) !== (other.yVector === undefined))\n return false;\n\n if (this.xVector !== undefined && other.xVector !== undefined && !this.xVector.isAlmostEqual(other.xVector))\n return false;\n\n if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))\n return false;\n\n if (!this.getTransform().isAlmostEqual(other.getTransform()))\n return false;\n\n const thisCarto = this.cartographicOrigin;\n const otherCarto = other.cartographicOrigin;\n if (undefined === thisCarto || undefined === otherCarto)\n return undefined === thisCarto && undefined === otherCarto;\n\n return thisCarto.equalsEpsilon(otherCarto, Geometry.smallMetricDistance);\n }\n\n public toJSON(): EcefLocationProps {\n const props: Mutable<EcefLocationProps> = {\n origin: this.origin.toJSON(),\n orientation: this.orientation.toJSON(),\n transform: this.getTransform().toJSON(),\n };\n\n if (this.cartographicOrigin)\n props.cartographicOrigin = this.cartographicOrigin.toJSON();\n\n if (this.xVector)\n props.xVector = this.xVector.toJSON();\n\n if (this.yVector)\n props.yVector = this.yVector.toJSON();\n\n return props;\n }\n}\n\n/** Represents an iModel in JavaScript.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n * @public\n */\nexport abstract class IModel implements IModelProps {\n private _projectExtents?: AxisAlignedBox3d;\n private _name?: string;\n private _rootSubject?: RootSubjectProps;\n private _globalOrigin?: Point3d;\n private _ecefLocation?: EcefLocation;\n private _geographicCoordinateSystem?: GeographicCRS;\n private _iModelId?: GuidString;\n private _changeset: ChangesetIdWithIndex;\n\n /** The Id of the repository model. */\n public static readonly repositoryModelId: Id64String = \"0x1\";\n /** The Id of the root subject element. */\n public static readonly rootSubjectId: Id64String = \"0x1\";\n /** The Id of the dictionary model. */\n public static readonly dictionaryId: Id64String = \"0x10\";\n\n /** Event raised after [[name]] changes. */\n public readonly onNameChanged = new BeEvent<(previousName: string) => void>();\n /** Event raised after [[rootSubject]] changes. */\n public readonly onRootSubjectChanged = new BeEvent<(previousSubject: RootSubjectProps) => void>();\n /** Event raised after [[projectExtents]] changes. */\n public readonly onProjectExtentsChanged = new BeEvent<(previousExtents: AxisAlignedBox3d) => void>();\n /** Event raised after [[globalOrigin]] changes. */\n public readonly onGlobalOriginChanged = new BeEvent<(previousOrigin: Point3d) => void>();\n /** Event raised after [[ecefLocation]] changes. */\n public readonly onEcefLocationChanged = new BeEvent<(previousLocation: EcefLocation | undefined) => void>();\n /** Event raised after [[geographicCoordinateSystem]] changes. */\n public readonly onGeographicCoordinateSystemChanged = new BeEvent<(previousGCS: GeographicCRS | undefined) => void>();\n /** Event raised after [[changeset]] changes. */\n public readonly onChangesetChanged = new BeEvent<(previousChangeset: ChangesetIdWithIndex) => void>();\n\n /** Name of the iModel */\n public get name(): string {\n assert(this._name !== undefined);\n return this._name;\n }\n public set name(name: string) {\n if (name !== this._name) {\n const old = this._name;\n this._name = name;\n if (undefined !== old)\n this.onNameChanged.raiseEvent(old);\n }\n }\n\n /** The name and description of the root subject of this iModel */\n public get rootSubject(): RootSubjectProps {\n assert(this._rootSubject !== undefined);\n return this._rootSubject;\n }\n public set rootSubject(subject: RootSubjectProps) {\n if (undefined === this._rootSubject || this._rootSubject.name !== subject.name || this._rootSubject.description !== subject.description) {\n const old = this._rootSubject;\n this._rootSubject = subject;\n if (old)\n this.onRootSubjectChanged.raiseEvent(old);\n }\n }\n\n /** Returns `true` if this is a snapshot iModel. */\n public abstract get isSnapshot(): boolean;\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\n public abstract get isBriefcase(): boolean;\n\n public abstract get isOpen(): boolean;\n\n /**\n * The volume, in spatial coordinates, inside which the entire project is contained.\n * @note The object returned from this method is frozen. You *must* make a copy before you do anything that might attempt to modify it.\n */\n public get projectExtents() {\n assert(undefined !== this._projectExtents);\n return this._projectExtents;\n }\n public set projectExtents(extents: AxisAlignedBox3d) {\n // Don't allow any axis of the project extents to be less than 1 meter.\n const projectExtents = extents.clone();\n projectExtents.ensureMinLengths(1.0);\n if (!this._projectExtents || !this._projectExtents.isAlmostEqual(projectExtents)) {\n const old = this._projectExtents;\n projectExtents.freeze();\n this._projectExtents = projectExtents;\n if (old)\n this.onProjectExtentsChanged.raiseEvent(old);\n }\n }\n\n /** An offset to be applied to all spatial coordinates. */\n public get globalOrigin(): Point3d {\n assert(this._globalOrigin !== undefined);\n return this._globalOrigin;\n }\n public set globalOrigin(org: Point3d) {\n if (!this._globalOrigin || !this._globalOrigin.isAlmostEqual(org)) {\n const old = this._globalOrigin;\n org.freeze();\n this._globalOrigin = org;\n if (old)\n this.onGlobalOriginChanged.raiseEvent(old);\n }\n }\n\n /** The [EcefLocation]($docs/learning/glossary#ecefLocation) of the iModel in Earth Centered Earth Fixed coordinates.\n * If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a\n * 3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem\n * property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the\n * iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that\n * results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.\n * If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective\n * cartographic projection used and a linear transformation should then be calculated at the exact origin of the data\n * it must position.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n */\n public get ecefLocation(): EcefLocation | undefined {\n return this._ecefLocation;\n }\n public set ecefLocation(ecefLocation: EcefLocation | undefined) {\n const old = this._ecefLocation;\n if (!old && !ecefLocation)\n return;\n else if (old && ecefLocation && old.isAlmostEqual(ecefLocation))\n return;\n\n this._ecefLocation = ecefLocation;\n this.onEcefLocationChanged.raiseEvent(old);\n }\n\n /** Set the [EcefLocation]($docs/learning/glossary#ecefLocation) for this iModel. */\n public setEcefLocation(ecef: EcefLocationProps): void {\n this.ecefLocation = new EcefLocation(ecef);\n }\n\n /** The geographic coordinate reference system of the iModel. */\n public get geographicCoordinateSystem(): GeographicCRS | undefined {\n return this._geographicCoordinateSystem;\n }\n public set geographicCoordinateSystem(geoCRS: GeographicCRS | undefined) {\n const old = this._geographicCoordinateSystem;\n if (!old && !geoCRS)\n return;\n else if (old && geoCRS && old.equals(geoCRS))\n return;\n\n this._geographicCoordinateSystem = geoCRS;\n this.onGeographicCoordinateSystemChanged.raiseEvent(old);\n }\n\n /** Sets the geographic coordinate reference system from GeographicCRSProps. */\n public setGeographicCoordinateSystem(geoCRS: GeographicCRSProps) {\n this.geographicCoordinateSystem = new GeographicCRS(geoCRS);\n }\n\n /** @internal */\n public getConnectionProps(): IModelConnectionProps {\n return {\n name: this.name,\n rootSubject: this.rootSubject,\n projectExtents: this.projectExtents.toJSON(),\n globalOrigin: this.globalOrigin.toJSON(),\n ecefLocation: this.ecefLocation,\n geographicCoordinateSystem: this.geographicCoordinateSystem,\n ... this._getRpcProps(),\n };\n }\n\n /** Convert this iModel to a JSON representation. */\n public toJSON(): IModelConnectionProps {\n return this.getConnectionProps();\n }\n\n /** A key used to identify this iModel in RPC calls from frontend to backend.\n * @internal\n */\n protected _fileKey: string;\n /** Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications. */\n public get key(): string { return this._fileKey; }\n\n /** @internal */\n protected _iTwinId?: GuidString;\n /** The Guid that identifies the iTwin that owns this iModel. */\n public get iTwinId(): GuidString | undefined { return this._iTwinId; }\n\n /** The Guid that identifies this iModel. */\n public get iModelId(): GuidString | undefined { return this._iModelId; }\n\n /** @public */\n public get changeset(): ChangesetIdWithIndex {\n return { ...this._changeset };\n }\n public set changeset(changeset: ChangesetIdWithIndex) {\n const prev = this._changeset;\n if (prev.id !== changeset.id || prev.index !== changeset.index) {\n this._changeset = { id: changeset.id, index: changeset.index };\n this.onChangesetChanged.raiseEvent(prev);\n }\n }\n\n protected _openMode = OpenMode.Readonly;\n /** The [[OpenMode]] used for this IModel. */\n public get openMode(): OpenMode { return this._openMode; }\n\n /** Return a token for RPC operations.\n * @throws IModelError if the iModel is not open.\n */\n public getRpcProps(): IModelRpcProps {\n if (!this.isOpen)\n throw new IModelError(IModelStatus.BadRequest, \"IModel is not open for rpc\");\n\n return this._getRpcProps();\n }\n\n /** Returns the iModel's RPC properties.\n * @note It is an error to attempt to use these properties as a token for RPC operations if the iModel is not open.\n * @internal\n */\n protected _getRpcProps(): IModelRpcProps {\n return {\n key: this._fileKey,\n iTwinId: this.iTwinId,\n iModelId: this.iModelId,\n changeset: this.changeset,\n };\n }\n\n /** @internal */\n protected constructor(tokenProps?: IModelRpcProps) {\n this._changeset = tokenProps?.changeset ?? { id: \"\", index: 0 };\n this._fileKey = \"\";\n if (tokenProps) {\n this._fileKey = tokenProps.key;\n this._iTwinId = tokenProps.iTwinId;\n this._iModelId = tokenProps.iModelId;\n }\n }\n\n /** @internal */\n protected initialize(name: string, props: IModelProps) {\n this.name = name;\n this.rootSubject = props.rootSubject;\n this.projectExtents = Range3d.fromJSON(props.projectExtents);\n this.globalOrigin = Point3d.fromJSON(props.globalOrigin);\n\n const ecefLocation = props.ecefLocation ? new EcefLocation(props.ecefLocation) : undefined;\n this.ecefLocation = ecefLocation?.isValid ? ecefLocation : undefined;\n\n this.geographicCoordinateSystem = props.geographicCoordinateSystem ? new GeographicCRS(props.geographicCoordinateSystem) : undefined;\n }\n\n /** Get the default subCategoryId for the supplied categoryId */\n public static getDefaultSubCategoryId(categoryId: Id64String): Id64String {\n return Id64.isValid(categoryId) ? Id64.fromLocalAndBriefcaseIds(Id64.getLocalId(categoryId) + 1, Id64.getBriefcaseId(categoryId)) : Id64.invalid;\n }\n\n /** True if this iModel has an [EcefLocation]($docs/learning/glossary#ecefLocation). */\n public get isGeoLocated() { return undefined !== this._ecefLocation; }\n\n /** Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its [[IModel.ecefLocation]].\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public getEcefTransform(): Transform {\n if (undefined === this._ecefLocation)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n return this._ecefLocation.getTransform();\n }\n\n /** Convert a point in this iModel's Spatial coordinates to an ECEF point using its [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Point3d in ECEF coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyPoint3d(spatial, result); }\n\n /** Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its [[ecefLocation]].\n * @param ecef A point in ECEF coordinates\n * @param result If defined, use this for output\n * @returns A Point3d in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\n */\n public ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyInversePoint3d(ecef, result)!; }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic { return Cartographic.fromEcef(this.spatialToEcef(spatial), result)!; }\n\n /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\n */\n public cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d) { return this.ecefToSpatial(cartographic.toEcef(result), result); }\n}\n"]}
1
+ {"version":3,"file":"IModel.js","sourceRoot":"","sources":["../../src/IModel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAc,IAAI,EAAc,YAAY,EAAW,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtJ,OAAO,EACE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAkB,QAAQ,EAC9H,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAsB,MAAM,sCAAsC,CAAC;AAEzF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAyM5C;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACvB,wCAAwC;IACxB,MAAM,CAAU;IAChC,4CAA4C;IAC5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,SAAS,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAEtE;;OAEG;IACI,gBAAgB;QACrB,IAAI,SAAS,KAAK,IAAI,CAAC,aAAa;YAClC,MAAM,IAAI,WAAW,CAAC,gBAAgB,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,OAAe,EAAE,MAAgB,IAAa,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAErI;;;;;;OAMG;IACI,aAAa,CAAC,IAAY,EAAE,MAAgB,IAAa,OAAO,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAErJ;;;;;OAKG;IACI,6BAA6B,CAAC,OAAe,EAAE,MAAqB,IAAkB,OAAO,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhL;;;;;;OAMG;IACI,6BAA6B,CAAC,YAA0B,EAAE,MAAgB,IAAI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,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 iModels\n */\n\nimport { assert, BeEvent, expectDefined, GeoServiceStatus, GuidString, Id64, Id64String, IModelStatus, Mutable, OpenMode } from \"@itwin/core-bentley\";\nimport {\n Angle, AxisIndex, AxisOrder, Constant, Geometry, Matrix3d, Point3d, Range3d, Range3dProps, Transform, TransformProps, Vector3d, XYAndZ, XYZProps,\n YawPitchRollAngles, YawPitchRollProps,\n} from \"@itwin/core-geometry\";\nimport { ChangesetIdWithIndex } from \"./ChangesetProps\";\nimport { Cartographic, CartographicProps } from \"./geometry/Cartographic\";\nimport { GeographicCRS, GeographicCRSProps } from \"./geometry/CoordinateReferenceSystem\";\nimport { AxisAlignedBox3d } from \"./geometry/Placement\";\nimport { IModelError } from \"./IModelError\";\nimport { ThumbnailProps } from \"./Thumbnail\";\n\n/** The properties to open a connection to an iModel for RPC operations.\n * @public\n */\nexport interface IModelRpcOpenProps {\n /** The iTwin in which the iModel exists - must be defined for briefcases that are synchronized with iModelHub. */\n readonly iTwinId?: GuidString;\n /** Guid of the iModel. */\n readonly iModelId?: GuidString;\n\n /** Id of the last Changeset that was applied to the iModel - must be defined for briefcases that are synchronized with iModelHub.\n * @note Changeset Ids are string hash values based on the content and parent.\n */\n readonly changeset?: ChangesetIdWithIndex;\n}\n\n/** The properties that identify an opened iModel for RPC operations.\n * @public\n */\nexport interface IModelRpcProps extends IModelRpcOpenProps {\n /** Unique key used for identifying the iModel between the frontend and the backend */\n readonly key: string;\n}\n\n/** Properties that position an iModel on the earth via [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\n * The origin is specified as an ECEF coordinate. The cartographicOrigin property contains the latitude, longitude and elevation above the WGS84 ellipsoid\n * of the origin property. This cartographicOrigin is offered as a convenient pre-calculated value representing the location of the ECEF origin.\n * The 3D coordinate system this class represents is positioned at specified origin and the axis positioned according to\n * the other properties.\n * If transform property is defined then it will not be computed from other properties.\n * If the xVector and yVector properties are defined (and transform is not defined) then they take precedence over the YawPitchRoll orientation property. The xVector and yVector\n * represent the direction and scale of the X and Y axes. The Z axis is always perpendicular (according to the right hand rule) to these X-Y axes.\n * The scaling in the Z direction is always unity. The scale of the X and Y axes is represented by the size of the vector length.\n * If the xVector and yVector are not present then the YawPitchRoll properties indicates the angles for all tree axes. Scaling in that case\n * is unity in all three directions.\n * Note that the present class is intended to represent geolocated 3D coordinate systems that are normally tangent to the WGS84 ellipsoid\n * possibly offset in altitude by the terrain elevation above the ellipsoid but other general 3D coordinate systems\n * can be defined.\n * @public\n * @extensions\n */\nexport interface EcefLocationProps {\n /** The Origin of an iModel on the earth in ECEF coordinates */\n readonly origin: XYZProps;\n /** The [orientation](https://en.wikipedia.org/wiki/Geographic_coordinate_conversion) of an iModel on the earth. */\n readonly orientation: YawPitchRollProps;\n /** Optional position on the earth used to establish the ECEF coordinates. */\n readonly cartographicOrigin?: CartographicProps;\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\n readonly xVector?: XYZProps;\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\n readonly yVector?: XYZProps;\n /** Optional potentially non-rigid transform defining the ECEF location.\n * @note If this property is supplied, the other properties are ignored.\n */\n readonly transform?: TransformProps;\n}\n\n/** Properties of the [Root Subject]($docs/bis/guide/references/glossary#subject-root).\n * @public\n * @extensions\n */\nexport interface RootSubjectProps {\n /** The name of the root subject. */\n readonly name: string;\n /** Description of the root subject (optional). */\n readonly description?: string;\n}\n\n/** Properties of an iModel that are always held in memory whenever one is opened, both on the frontend and on the backend .\n * @public\n */\nexport interface IModelProps {\n /** The name and description of the root subject of this iModel */\n readonly rootSubject: RootSubjectProps;\n /** The volume of the entire project, in spatial coordinates */\n readonly projectExtents?: Range3dProps;\n /** An offset to be applied to all spatial coordinates. This is normally used to transform spatial coordinates into the Cartesian coordinate system of a Geographic Coordinate System. */\n readonly globalOrigin?: XYZProps;\n /** The location of the iModel in Earth Centered Earth Fixed coordinates. iModel units are always meters */\n readonly ecefLocation?: EcefLocationProps;\n /** The Geographic Coordinate Reference System indicating the projection and datum used. */\n readonly geographicCoordinateSystem?: GeographicCRSProps;\n /** The name of the iModel. */\n readonly name?: string;\n}\n\n/** The properties returned by the backend when creating a new [[IModelConnection]] from the frontend, either with Rpc or with Ipc.\n * These properties describe the iModel held on the backend for thew newly formed connection and are used to construct a new\n * [[IModelConnection]] instance on the frontend to access it.\n * @public\n */\nexport type IModelConnectionProps = IModelProps & IModelRpcProps;\n\n/** The properties that can be supplied when creating a *new* iModel.\n * @public\n */\nexport interface CreateIModelProps extends IModelProps {\n /** The GUID of new iModel. If not present, a GUID will be generated. */\n readonly guid?: GuidString;\n /** Client name for new iModel */\n readonly client?: string;\n /** Thumbnail for new iModel\n * @alpha\n */\n readonly thumbnail?: ThumbnailProps;\n}\n\n/**\n * Sqlite options.\n * @public\n */\nexport interface OpenSqliteArgs {\n /**\n * Specify timeout after which SQLite stop retrying to acquire lock to database file and throw SQLITE_BUSY error.\n * Timeout is specified in milliseconds.\n * For more information https://www.sqlite.org/c3ref/busy_timeout.html.\n * */\n readonly busyTimeout?: number;\n}\n\n/**\n * A key used to identify an opened [IModelDb]($backend) between the frontend and backend for Rpc and Ipc communications.\n * Keys must be unique - that is there can never be two IModelDbs opened with the same key at any given time.\n * If no key is supplied in a call to open an IModelDb, one is generated and returned.\n * It is only necessary to supply a key if you have some reason to assign a specific value to identify an IModelDb.\n * If you don't supply the key, you must use the returned value for Rpc and Ipc communications.\n * @public\n */\nexport interface OpenDbKey {\n readonly key?: string;\n}\n\n/** @beta TODO documentation */\nexport interface CloudContainerUri {\n readonly uriParams: string;\n}\n\n/** Options to open a [SnapshotDb]($backend).\n * @public\n */\nexport interface SnapshotOpenOptions extends OpenDbKey {\n /**\n * The \"base\" name that can be used for creating temporary files related to this Db.\n * The string should be a name related to the current Db filename using some known pattern so that all files named \"baseName*\" can be deleted externally during cleanup.\n * It must be the name of a file (that may or may not exist) in a writable directory.\n * If not present, the baseName will default to the database's file name (including the path).\n * @internal\n */\n readonly tempFileBase?: string;\n}\n\n/** Options to open a [StandaloneDb]($backend) via [StandaloneDb.openFile]($backend) from the backend,\n * or [BriefcaseConnection.openStandalone]($frontend) from the frontend.\n * @public\n */\nexport type StandaloneOpenOptions = OpenDbKey;\n\n/** Options that can be supplied when creating snapshot iModels.\n * @public\n */\nexport interface CreateSnapshotIModelProps {\n /** If true, then create SQLite views for Model, Element, ElementAspect, and Relationship classes.\n * These database views can often be useful for interoperability workflows.\n */\n readonly createClassViews?: boolean;\n}\n\n/** The options that can be specified when creating an *empty* snapshot iModel.\n * @see [SnapshotDb.createEmpty]($backend)\n * @public\n */\nexport type CreateEmptySnapshotIModelProps = CreateIModelProps & CreateSnapshotIModelProps;\n\n/** Options that can be supplied when creating standalone iModels.\n * @public\n */\nexport interface CreateStandaloneIModelProps {\n /** If present, file will allow local editing, but cannot be used to create changesets */\n readonly allowEdit?: string;\n}\n\n/** The options that can be specified when creating an *empty* standalone iModel.\n * @see [StandaloneDb.createEmpty]($backend)\n * @public\n */\nexport type CreateEmptyStandaloneIModelProps = CreateIModelProps & CreateStandaloneIModelProps;\n\n/**\n * @public\n * @extensions\n */\nexport interface FilePropertyProps {\n readonly namespace: string;\n readonly name: string;\n id?: number | string;\n subId?: number | string;\n}\n\n/** The position and orientation of an iModel on the earth in [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates\n * @note This is an immutable type - all of its properties are frozen.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n * @public\n */\nexport class EcefLocation implements EcefLocationProps {\n /** The origin of the ECEF transform. */\n public readonly origin: Point3d;\n /** The orientation of the ECEF transform */\n public readonly orientation: YawPitchRollAngles;\n /** Optional position on the earth used to establish the ECEF origin and orientation. */\n public readonly cartographicOrigin?: Cartographic;\n /** Optional X column vector used with [[yVector]] to calculate potentially non-rigid transform if a projection is present. */\n public readonly xVector?: Vector3d;\n /** Optional Y column vector used with [[xVector]] to calculate potentially non-rigid transform if a projection is present. */\n public readonly yVector?: Vector3d;\n /** The transform from iModel Spatial coordinates to ECEF from this EcefLocation */\n private readonly _transform: Transform = Transform.createIdentity();\n\n /** Get the transform from iModel Spatial coordinates to ECEF from this EcefLocation */\n public getTransform(): Transform { return this._transform; }\n\n /** Construct a new EcefLocation. Once constructed, it is frozen and cannot be modified. */\n constructor(props: EcefLocationProps) {\n this.origin = Point3d.fromJSON(props.origin).freeze();\n this.orientation = YawPitchRollAngles.fromJSON(props.orientation).freeze();\n if (props.cartographicOrigin)\n this.cartographicOrigin = Cartographic.fromRadians({ longitude: props.cartographicOrigin.longitude, latitude: props.cartographicOrigin.latitude, height: props.cartographicOrigin.height }).freeze();\n if (props.xVector && props.yVector) {\n this.xVector = Vector3d.fromJSON(props.xVector).freeze();\n this.yVector = Vector3d.fromJSON(props.yVector).freeze();\n }\n if (props.transform) {\n this._transform.setFromJSON(props.transform);\n this._transform.freeze();\n } else {\n let matrix;\n if (this.xVector && this.yVector) {\n const zVector = this.xVector.crossProduct(this.yVector);\n if (zVector.normalizeInPlace())\n matrix = Matrix3d.createColumns(this.xVector, this.yVector, zVector);\n }\n if (!matrix)\n matrix = this.orientation.toMatrix3d();\n\n this._transform = Transform.createOriginAndMatrix(this.origin, matrix);\n this._transform.freeze();\n }\n }\n\n /** Returns true if this EcefLocation is not located at the center of the Earth.\n * @alpha are locations very close to the center considered valid? What are the specific criteria?\n */\n public get isValid(): boolean {\n return !this.origin.isZero;\n }\n\n /** Construct ECEF Location from cartographic origin with optional known point and angle. */\n public static createFromCartographicOrigin(origin: Cartographic, point?: Point3d, angle?: Angle) {\n const ecefOrigin = origin.toEcef();\n const deltaRadians = 10 / Constant.earthRadiusWGS84.polar;\n const northCarto = Cartographic.fromRadians({ longitude: origin.longitude, latitude: origin.latitude + deltaRadians, height: origin.height });\n const eastCarto = Cartographic.fromRadians({ longitude: origin.longitude + deltaRadians, latitude: origin.latitude, height: origin.height });\n const ecefNorth = northCarto.toEcef();\n const ecefEast = eastCarto.toEcef();\n const xVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefEast).normalize());\n const yVector = expectDefined(Vector3d.createStartEnd(ecefOrigin, ecefNorth).normalize());\n const matrix = expectDefined(Matrix3d.createRigidFromColumns(xVector, yVector, AxisOrder.XYZ));\n if (angle !== undefined) {\n const north = Matrix3d.createRotationAroundAxisIndex(AxisIndex.Z, angle);\n matrix.multiplyMatrixMatrix(north, matrix);\n }\n if (point !== undefined) {\n const delta = matrix.multiplyVector(Vector3d.create(-point.x, -point.y, -point.z));\n ecefOrigin.addInPlace(delta);\n }\n\n return new EcefLocation({ origin: ecefOrigin, orientation: expectDefined(YawPitchRollAngles.createFromMatrix3d(matrix)), cartographicOrigin: origin });\n }\n\n /** Construct ECEF Location from transform with optional position on the earth used to establish the ECEF origin and orientation. */\n public static createFromTransform(transform: Transform): EcefLocation {\n const ecefOrigin = transform.getOrigin();\n const angleFromInput = YawPitchRollAngles.createDegrees(0, 0, 0);\n const locationOrientationFromInputT = YawPitchRollAngles.createFromMatrix3d(transform.getMatrix(), angleFromInput);\n const transformProps = transform.toJSON();\n\n return new EcefLocation({ origin: ecefOrigin, orientation: locationOrientationFromInputT ?? angleFromInput, transform: transformProps });\n }\n\n /** Get the location center of the earth in the iModel coordinate system. */\n public get earthCenter(): Point3d {\n const matrix = this.orientation.toMatrix3d();\n return Point3d.createFrom(matrix.multiplyTransposeXYZ(-this.origin.x, -this.origin.y, -this.origin.z));\n }\n\n /** Return true if this location is equivalent to another location within a small tolerance. */\n public isAlmostEqual(other: EcefLocation): boolean {\n if (!this.origin.isAlmostEqual(other.origin) || !this.orientation.isAlmostEqual(other.orientation))\n return false;\n\n if ((this.xVector === undefined) !== (other.xVector === undefined) || (this.yVector === undefined) !== (other.yVector === undefined))\n return false;\n\n if (this.xVector !== undefined && other.xVector !== undefined && !this.xVector.isAlmostEqual(other.xVector))\n return false;\n\n if (this.yVector !== undefined && other.yVector !== undefined && !this.yVector.isAlmostEqual(other.yVector))\n return false;\n\n if (!this.getTransform().isAlmostEqual(other.getTransform()))\n return false;\n\n const thisCarto = this.cartographicOrigin;\n const otherCarto = other.cartographicOrigin;\n if (undefined === thisCarto || undefined === otherCarto)\n return undefined === thisCarto && undefined === otherCarto;\n\n return thisCarto.equalsEpsilon(otherCarto, Geometry.smallMetricDistance);\n }\n\n public toJSON(): EcefLocationProps {\n const props: Mutable<EcefLocationProps> = {\n origin: this.origin.toJSON(),\n orientation: this.orientation.toJSON(),\n transform: this.getTransform().toJSON(),\n };\n\n if (this.cartographicOrigin)\n props.cartographicOrigin = this.cartographicOrigin.toJSON();\n\n if (this.xVector)\n props.xVector = this.xVector.toJSON();\n\n if (this.yVector)\n props.yVector = this.yVector.toJSON();\n\n return props;\n }\n}\n\n/** Represents an iModel in JavaScript.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n * @public\n */\nexport abstract class IModel implements IModelProps {\n private _projectExtents?: AxisAlignedBox3d;\n private _name?: string;\n private _rootSubject?: RootSubjectProps;\n private _globalOrigin?: Point3d;\n private _ecefLocation?: EcefLocation;\n private _geographicCoordinateSystem?: GeographicCRS;\n private _iModelId?: GuidString;\n private _changeset: ChangesetIdWithIndex;\n\n /** The Id of the repository model. */\n public static readonly repositoryModelId: Id64String = \"0x1\";\n /** The Id of the root subject element. */\n public static readonly rootSubjectId: Id64String = \"0x1\";\n /** The Id of the dictionary model. */\n public static readonly dictionaryId: Id64String = \"0x10\";\n\n /** Event raised after [[name]] changes. */\n public readonly onNameChanged = new BeEvent<(previousName: string) => void>();\n /** Event raised after [[rootSubject]] changes. */\n public readonly onRootSubjectChanged = new BeEvent<(previousSubject: RootSubjectProps) => void>();\n /** Event raised after [[projectExtents]] changes. */\n public readonly onProjectExtentsChanged = new BeEvent<(previousExtents: AxisAlignedBox3d) => void>();\n /** Event raised after [[globalOrigin]] changes. */\n public readonly onGlobalOriginChanged = new BeEvent<(previousOrigin: Point3d) => void>();\n /** Event raised after [[ecefLocation]] changes. */\n public readonly onEcefLocationChanged = new BeEvent<(previousLocation: EcefLocation | undefined) => void>();\n /** Event raised after [[geographicCoordinateSystem]] changes. */\n public readonly onGeographicCoordinateSystemChanged = new BeEvent<(previousGCS: GeographicCRS | undefined) => void>();\n /** Event raised after [[changeset]] changes. */\n public readonly onChangesetChanged = new BeEvent<(previousChangeset: ChangesetIdWithIndex) => void>();\n\n /** Name of the iModel */\n public get name(): string {\n assert(this._name !== undefined);\n return this._name;\n }\n public set name(name: string) {\n if (name !== this._name) {\n const old = this._name;\n this._name = name;\n if (undefined !== old)\n this.onNameChanged.raiseEvent(old);\n }\n }\n\n /** The name and description of the root subject of this iModel */\n public get rootSubject(): RootSubjectProps {\n assert(this._rootSubject !== undefined);\n return this._rootSubject;\n }\n public set rootSubject(subject: RootSubjectProps) {\n if (undefined === this._rootSubject || this._rootSubject.name !== subject.name || this._rootSubject.description !== subject.description) {\n const old = this._rootSubject;\n this._rootSubject = subject;\n if (old)\n this.onRootSubjectChanged.raiseEvent(old);\n }\n }\n\n /** Returns `true` if this is a snapshot iModel. */\n public abstract get isSnapshot(): boolean;\n /** Returns `true` if this is a briefcase copy of an iModel that is synchronized with iModelHub. */\n public abstract get isBriefcase(): boolean;\n\n public abstract get isOpen(): boolean;\n\n /**\n * The volume, in spatial coordinates, inside which the entire project is contained.\n * @note The object returned from this method is frozen. You *must* make a copy before you do anything that might attempt to modify it.\n */\n public get projectExtents() {\n assert(undefined !== this._projectExtents);\n return this._projectExtents;\n }\n public set projectExtents(extents: AxisAlignedBox3d) {\n // Don't allow any axis of the project extents to be less than 1 meter.\n const projectExtents = extents.clone();\n projectExtents.ensureMinLengths(1.0);\n if (!this._projectExtents || !this._projectExtents.isAlmostEqual(projectExtents)) {\n const old = this._projectExtents;\n projectExtents.freeze();\n this._projectExtents = projectExtents;\n if (old)\n this.onProjectExtentsChanged.raiseEvent(old);\n }\n }\n\n /** An offset to be applied to all spatial coordinates. */\n public get globalOrigin(): Point3d {\n assert(this._globalOrigin !== undefined);\n return this._globalOrigin;\n }\n public set globalOrigin(org: Point3d) {\n if (!this._globalOrigin || !this._globalOrigin.isAlmostEqual(org)) {\n const old = this._globalOrigin;\n org.freeze();\n this._globalOrigin = org;\n if (old)\n this.onGlobalOriginChanged.raiseEvent(old);\n }\n }\n\n /** The [EcefLocation]($docs/learning/glossary#ecefLocation) of the iModel in Earth Centered Earth Fixed coordinates.\n * If the iModel property geographicCoordinateSystem is not defined then the ecefLocation provides a geolocation by defining a\n * 3D coordinate system relative to the Earth model WGS84. Refer to additional documentation for details. If the geographicCoordinateSystem\n * property is defined then the ecefLocation must be used with care. When the geographicCoordinateSystem is defined it indicates the\n * iModel cartesian space is the result of a cartographic projection. This implies a flattening of the Earth surface process that\n * results in scale, angular or area distortion. The ecefLocation is then an approximation calculated at the center of the project extent.\n * If the project is more than 2 kilometer in size, the ecefLocation may represent a poor approximation of the effective\n * cartographic projection used and a linear transformation should then be calculated at the exact origin of the data\n * it must position.\n * @see [GeoLocation of iModels]($docs/learning/GeoLocation.md)\n */\n public get ecefLocation(): EcefLocation | undefined {\n return this._ecefLocation;\n }\n public set ecefLocation(ecefLocation: EcefLocation | undefined) {\n const old = this._ecefLocation;\n if (!old && !ecefLocation)\n return;\n else if (old && ecefLocation && old.isAlmostEqual(ecefLocation))\n return;\n\n this._ecefLocation = ecefLocation;\n this.onEcefLocationChanged.raiseEvent(old);\n }\n\n /** Set the [EcefLocation]($docs/learning/glossary#ecefLocation) for this iModel. */\n public setEcefLocation(ecef: EcefLocationProps): void {\n this.ecefLocation = new EcefLocation(ecef);\n }\n\n /** The geographic coordinate reference system of the iModel. */\n public get geographicCoordinateSystem(): GeographicCRS | undefined {\n return this._geographicCoordinateSystem;\n }\n public set geographicCoordinateSystem(geoCRS: GeographicCRS | undefined) {\n const old = this._geographicCoordinateSystem;\n if (!old && !geoCRS)\n return;\n else if (old && geoCRS && old.equals(geoCRS))\n return;\n\n this._geographicCoordinateSystem = geoCRS;\n this.onGeographicCoordinateSystemChanged.raiseEvent(old);\n }\n\n /** Sets the geographic coordinate reference system from GeographicCRSProps. */\n public setGeographicCoordinateSystem(geoCRS: GeographicCRSProps) {\n this.geographicCoordinateSystem = new GeographicCRS(geoCRS);\n }\n\n /** @internal */\n public getConnectionProps(): IModelConnectionProps {\n return {\n name: this.name,\n rootSubject: this.rootSubject,\n projectExtents: this.projectExtents.toJSON(),\n globalOrigin: this.globalOrigin.toJSON(),\n ecefLocation: this.ecefLocation,\n geographicCoordinateSystem: this.geographicCoordinateSystem?.toJSON(),\n ...this._getRpcProps(),\n };\n }\n\n /** Convert this iModel to a JSON representation. */\n public toJSON(): IModelConnectionProps {\n return this.getConnectionProps();\n }\n\n /** A key used to identify this iModel in RPC calls from frontend to backend.\n * @internal\n */\n protected _fileKey: string;\n /** Get the key that was used to open this iModel. This is the value used for Rpc and Ipc communications. */\n public get key(): string { return this._fileKey; }\n\n /** @internal */\n protected _iTwinId?: GuidString;\n /** The Guid that identifies the iTwin that owns this iModel. */\n public get iTwinId(): GuidString | undefined { return this._iTwinId; }\n\n /** The Guid that identifies this iModel. */\n public get iModelId(): GuidString | undefined { return this._iModelId; }\n\n /** @public */\n public get changeset(): ChangesetIdWithIndex {\n return { ...this._changeset };\n }\n public set changeset(changeset: ChangesetIdWithIndex) {\n const prev = this._changeset;\n if (prev.id !== changeset.id || prev.index !== changeset.index) {\n this._changeset = { id: changeset.id, index: changeset.index };\n this.onChangesetChanged.raiseEvent(prev);\n }\n }\n\n protected _openMode = OpenMode.Readonly;\n /** The [[OpenMode]] used for this IModel. */\n public get openMode(): OpenMode { return this._openMode; }\n\n /** Return a token for RPC operations.\n * @throws IModelError if the iModel is not open.\n */\n public getRpcProps(): IModelRpcProps {\n if (!this.isOpen)\n throw new IModelError(IModelStatus.BadRequest, \"IModel is not open for rpc\");\n\n return this._getRpcProps();\n }\n\n /** Returns the iModel's RPC properties.\n * @note It is an error to attempt to use these properties as a token for RPC operations if the iModel is not open.\n * @internal\n */\n protected _getRpcProps(): IModelRpcProps {\n return {\n key: this._fileKey,\n iTwinId: this.iTwinId,\n iModelId: this.iModelId,\n changeset: this.changeset,\n };\n }\n\n /** @internal */\n protected constructor(tokenProps?: IModelRpcProps) {\n this._changeset = tokenProps?.changeset ?? { id: \"\", index: 0 };\n this._fileKey = \"\";\n if (tokenProps) {\n this._fileKey = tokenProps.key;\n this._iTwinId = tokenProps.iTwinId;\n this._iModelId = tokenProps.iModelId;\n }\n }\n\n /** @internal */\n protected initialize(name: string, props: IModelProps) {\n this.name = name;\n this.rootSubject = props.rootSubject;\n this.projectExtents = Range3d.fromJSON(props.projectExtents);\n this.globalOrigin = Point3d.fromJSON(props.globalOrigin);\n\n const ecefLocation = props.ecefLocation ? new EcefLocation(props.ecefLocation) : undefined;\n this.ecefLocation = ecefLocation?.isValid ? ecefLocation : undefined;\n\n this.geographicCoordinateSystem = props.geographicCoordinateSystem ? new GeographicCRS(props.geographicCoordinateSystem) : undefined;\n }\n\n /** Get the default subCategoryId for the supplied categoryId */\n public static getDefaultSubCategoryId(categoryId: Id64String): Id64String {\n return Id64.isValid(categoryId) ? Id64.fromLocalAndBriefcaseIds(Id64.getLocalId(categoryId) + 1, Id64.getBriefcaseId(categoryId)) : Id64.invalid;\n }\n\n /** True if this iModel has an [EcefLocation]($docs/learning/glossary#ecefLocation). */\n public get isGeoLocated() { return undefined !== this._ecefLocation; }\n\n /** Get the Transform from this iModel's Spatial coordinates to ECEF coordinates using its [[IModel.ecefLocation]].\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public getEcefTransform(): Transform {\n if (undefined === this._ecefLocation)\n throw new IModelError(GeoServiceStatus.NoGeoLocation, \"iModel is not GeoLocated\");\n return this._ecefLocation.getTransform();\n }\n\n /** Convert a point in this iModel's Spatial coordinates to an ECEF point using its [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Point3d in ECEF coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public spatialToEcef(spatial: XYAndZ, result?: Point3d): Point3d { return this.getEcefTransform().multiplyPoint3d(spatial, result); }\n\n /** Convert a point in ECEF coordinates to a point in this iModel's Spatial coordinates using its [[ecefLocation]].\n * @param ecef A point in ECEF coordinates\n * @param result If defined, use this for output\n * @returns A Point3d in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\n */\n public ecefToSpatial(ecef: XYAndZ, result?: Point3d): Point3d { return expectDefined(this.getEcefTransform().multiplyInversePoint3d(ecef, result)); }\n\n /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using its [[IModel.ecefLocation]].\n * @param spatial A point in the iModel's spatial coordinates\n * @param result If defined, use this for output\n * @returns A Cartographic location\n * @throws IModelError if [[isGeoLocated]] is false.\n */\n public spatialToCartographicFromEcef(spatial: XYAndZ, result?: Cartographic): Cartographic { return expectDefined(Cartographic.fromEcef(this.spatialToEcef(spatial), result)); }\n\n /** Convert a [[Cartographic]] to a point in this iModel's Spatial coordinates using its [[IModel.ecefLocation]].\n * @param cartographic A cartographic location\n * @param result If defined, use this for output\n * @returns A point in this iModel's spatial coordinates\n * @throws IModelError if [[isGeoLocated]] is false.\n * @note The resultant point will only be meaningful if the ECEF coordinate is close on the earth to the iModel.\n */\n public cartographicToSpatialFromEcef(cartographic: Cartographic, result?: Point3d) { return this.ecefToSpatial(cartographic.toEcef(result), result); }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Localization.d.ts","sourceRoot":"","sources":["../../src/Localization.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAA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AgB;IAChB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAE7D,2DAA2D;IAC3D,eAAe,IAAI,SAAS,MAAM,EAAE,CAAC;IAErC;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED;;GAEG;AACH,qBAAa,iBAAkB,YAAW,YAAY;IACvC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IACjC,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IAWlD,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM;IACpE,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IACvC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IACxC,mBAAmB,IAAI,IAAI;IAC3B,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS;IAChD,eAAe,IAAI,SAAS,MAAM,EAAE;IAC9B,cAAc;CAC5B"}
@@ -16,6 +16,9 @@ export class EmptyLocalization {
16
16
  }
17
17
  // Simulate correct and simple usage of i18next's translation function
18
18
  // Namely, remove the leading namespace substring if there is one
19
+ // Note: if there are no colons, split will return an array with a single element, which is the
20
+ // key itself. So pop()! is safe.
21
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
19
22
  return key.split(":", 2).pop();
20
23
  }
21
24
  getEnglishString(_namespace, key) { return this.getLocalizedString(key); }
@@ -1 +1 @@
1
- {"version":3,"file":"Localization.js","sourceRoot":"","sources":["../../src/Localization.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAoGH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IACrB,KAAK,CAAC,UAAU,KAAoB,CAAC;IACrC,kBAAkB,CAAC,GAAsB;QAC9C,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC9B,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACf,CAAC;QACD,sEAAsE;QACtE,iEAAiE;QACjE,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAG,CAAC;IAClC,CAAC;IACM,gBAAgB,CAAC,UAAkB,EAAE,GAAsB,IAAY,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7G,gBAAgB,CAAC,WAAmB,IAAY,OAAO,WAAW,CAAC,CAAC,CAAC;IACrE,KAAK,CAAC,iBAAiB,KAAoB,CAAC;IAC5C,mBAAmB,KAAW,CAAC;IAC/B,mBAAmB,KAAgC,OAAO,SAAS,CAAC,CAAC,CAAC;IACtE,eAAe,KAAwB,OAAO,EAAE,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,cAAc,KAAK,CAAC;CAClC","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 Localization\n */\n\n/** Options for Localization\n * @public\n */\nexport interface TranslationOptions {\n /** for interpolation values */\n [key: string]: any;\n /**\n * defaultValue to return if a translation was not found\n */\n defaultValue?: any;\n /**\n * count value used for plurals\n */\n count?: number;\n /**\n * used for contexts (eg. male\\female)\n */\n context?: any;\n /**\n * override languages to use\n */\n lngs?: string[];\n /**\n * override language to lookup key if not found see fallbacks for details\n */\n fallbackLng?: string;\n}\n\n/** The interface defining the localization requirements of [IModelApp]($frontend).\n * @public\n * @extensions\n */\nexport interface Localization {\n /** This method must be called and awaited before using an instance of Localization.\n * @param namespaces an array of namespaces to load. There must be at least one namespace, and it\n * becomes the default namespace.\n * @note IModelApp.startup calls this internally, so you should not call this method directly\n * except for Localization instances outside of IModelApp (e.g., for tests.)\n */\n initialize(namespaces: string[]): Promise<void>;\n\n /** Return the translated value of a key.\n * @param key - the key that matches a property in the JSON localization file.\n * @note The key includes the namespace, which identifies the particular localization file that contains the property,\n * followed by a colon, followed by the property in the JSON file.\n * For example:\n * ``` ts\n * const dataString: string = IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.BingDataAttribution\");\n * ```\n * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n */\n getLocalizedString(key: string | string[], options?: TranslationOptions): string;\n /** get the English string for a key. */\n getEnglishString(namespace: string, key: string | string[], options?: TranslationOptions): string;\n /** Replace all instances of `%{key}` within a string with the translations of those keys.\n * For example:\n * ``` ts\n * \"MyKeys\": {\n * \"Key1\": \"First value\",\n * \"Key2\": \"Second value\"\n * }\n * ```\n *\n * ``` ts\n * getLocalizedKeys(\"string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!\"\") // returns \"string with First Value followed by Second Value!\"\n * ```\n */\n getLocalizedKeys(inputString: string): string;\n\n /** Register a new Namespace and return a Promise that is fulfilled when the content is loaded.\n * If the namespace is already registered, its Promise will be returned.\n * @param namespace - the name of the namespace.\n * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,\n * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await\n * fulfillment of returned Promise.\n * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)\n */\n registerNamespace(namespace: string): Promise<void>;\n\n /** Unregister a namespace.\n * @param namespace - the name of the namespace.\n */\n unregisterNamespace(namespace: string): void;\n\n /** @internal */\n getNamespacePromise(name: string): Promise<void> | undefined;\n\n /** Get the list of available languages for translations */\n getLanguageList(): readonly string[];\n\n /** Change the language for translations. This overrides the language from the browser, for tests.\n * @param language - the language to change to.\n */\n changeLanguage(language: string): Promise<void>;\n}\n\n/** An empty [[Localization]] used if one is not provided to [IModelApp]($frontend). Does not perform localizations (merely returns the key.)\n * @public\n */\nexport class EmptyLocalization implements Localization {\n public async initialize(): Promise<void> { }\n public getLocalizedString(key: string | string[]): string {\n if (typeof (key) !== \"string\") {\n key = key[0];\n }\n // Simulate correct and simple usage of i18next's translation function\n // Namely, remove the leading namespace substring if there is one\n return key.split(\":\", 2).pop()!;\n }\n public getEnglishString(_namespace: string, key: string | string[]): string { return this.getLocalizedString(key); }\n public getLocalizedKeys(inputString: string): string { return inputString; }\n public async registerNamespace(): Promise<void> { }\n public unregisterNamespace(): void { }\n public getNamespacePromise(): Promise<void> | undefined { return undefined; }\n public getLanguageList(): readonly string[] { return []; }\n public async changeLanguage() { }\n}\n"]}
1
+ {"version":3,"file":"Localization.js","sourceRoot":"","sources":["../../src/Localization.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAoGH;;GAEG;AACH,MAAM,OAAO,iBAAiB;IACrB,KAAK,CAAC,UAAU,KAAoB,CAAC;IACrC,kBAAkB,CAAC,GAAsB;QAC9C,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC9B,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACf,CAAC;QACD,sEAAsE;QACtE,iEAAiE;QACjE,+FAA+F;QAC/F,iCAAiC;QACjC,oEAAoE;QACpE,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAG,CAAC;IAClC,CAAC;IACM,gBAAgB,CAAC,UAAkB,EAAE,GAAsB,IAAY,OAAO,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7G,gBAAgB,CAAC,WAAmB,IAAY,OAAO,WAAW,CAAC,CAAC,CAAC;IACrE,KAAK,CAAC,iBAAiB,KAAoB,CAAC;IAC5C,mBAAmB,KAAW,CAAC;IAC/B,mBAAmB,KAAgC,OAAO,SAAS,CAAC,CAAC,CAAC;IACtE,eAAe,KAAwB,OAAO,EAAE,CAAC,CAAC,CAAC;IACnD,KAAK,CAAC,cAAc,KAAK,CAAC;CAClC","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 Localization\n */\n\n/** Options for Localization\n * @public\n */\nexport interface TranslationOptions {\n /** for interpolation values */\n [key: string]: any;\n /**\n * defaultValue to return if a translation was not found\n */\n defaultValue?: any;\n /**\n * count value used for plurals\n */\n count?: number;\n /**\n * used for contexts (eg. male\\female)\n */\n context?: any;\n /**\n * override languages to use\n */\n lngs?: string[];\n /**\n * override language to lookup key if not found see fallbacks for details\n */\n fallbackLng?: string;\n}\n\n/** The interface defining the localization requirements of [IModelApp]($frontend).\n * @public\n * @extensions\n */\nexport interface Localization {\n /** This method must be called and awaited before using an instance of Localization.\n * @param namespaces an array of namespaces to load. There must be at least one namespace, and it\n * becomes the default namespace.\n * @note IModelApp.startup calls this internally, so you should not call this method directly\n * except for Localization instances outside of IModelApp (e.g., for tests.)\n */\n initialize(namespaces: string[]): Promise<void>;\n\n /** Return the translated value of a key.\n * @param key - the key that matches a property in the JSON localization file.\n * @note The key includes the namespace, which identifies the particular localization file that contains the property,\n * followed by a colon, followed by the property in the JSON file.\n * For example:\n * ``` ts\n * const dataString: string = IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.BingDataAttribution\");\n * ```\n * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n */\n getLocalizedString(key: string | string[], options?: TranslationOptions): string;\n /** get the English string for a key. */\n getEnglishString(namespace: string, key: string | string[], options?: TranslationOptions): string;\n /** Replace all instances of `%{key}` within a string with the translations of those keys.\n * For example:\n * ``` ts\n * \"MyKeys\": {\n * \"Key1\": \"First value\",\n * \"Key2\": \"Second value\"\n * }\n * ```\n *\n * ``` ts\n * getLocalizedKeys(\"string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!\"\") // returns \"string with First Value followed by Second Value!\"\n * ```\n */\n getLocalizedKeys(inputString: string): string;\n\n /** Register a new Namespace and return a Promise that is fulfilled when the content is loaded.\n * If the namespace is already registered, its Promise will be returned.\n * @param namespace - the name of the namespace.\n * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,\n * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await\n * fulfillment of returned Promise.\n * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)\n */\n registerNamespace(namespace: string): Promise<void>;\n\n /** Unregister a namespace.\n * @param namespace - the name of the namespace.\n */\n unregisterNamespace(namespace: string): void;\n\n /** @internal */\n getNamespacePromise(name: string): Promise<void> | undefined;\n\n /** Get the list of available languages for translations */\n getLanguageList(): readonly string[];\n\n /** Change the language for translations. This overrides the language from the browser, for tests.\n * @param language - the language to change to.\n */\n changeLanguage(language: string): Promise<void>;\n}\n\n/** An empty [[Localization]] used if one is not provided to [IModelApp]($frontend). Does not perform localizations (merely returns the key.)\n * @public\n */\nexport class EmptyLocalization implements Localization {\n public async initialize(): Promise<void> { }\n public getLocalizedString(key: string | string[]): string {\n if (typeof (key) !== \"string\") {\n key = key[0];\n }\n // Simulate correct and simple usage of i18next's translation function\n // Namely, remove the leading namespace substring if there is one\n // Note: if there are no colons, split will return an array with a single element, which is the\n // key itself. So pop()! is safe.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return key.split(\":\", 2).pop()!;\n }\n public getEnglishString(_namespace: string, key: string | string[]): string { return this.getLocalizedString(key); }\n public getLocalizedKeys(inputString: string): string { return inputString; }\n public async registerNamespace(): Promise<void> { }\n public unregisterNamespace(): void { }\n public getNamespacePromise(): Promise<void> | undefined { return undefined; }\n public getLanguageList(): readonly string[] { return []; }\n public async changeLanguage() { }\n}\n"]}
@@ -6,7 +6,7 @@
6
6
  * @module Rendering
7
7
  */
8
8
  import { Matrix3d, Point2d, Point3d, Transform, Vector3d } from "@itwin/core-geometry";
9
- import { compareBooleans, compareBooleansOrUndefined, compareNumbers, compareNumbersOrUndefined, comparePossiblyUndefined } from "@itwin/core-bentley";
9
+ import { compareBooleans, compareBooleansOrUndefined, compareNumbers, compareNumbersOrUndefined, comparePossiblyUndefined, expectDefined } from "@itwin/core-bentley";
10
10
  function compareNormalMapParams(lhs, rhs) {
11
11
  return comparePossiblyUndefined((lh, rh) => lh.compare(rh), lhs.normalMap, rhs.normalMap)
12
12
  || compareBooleansOrUndefined(lhs.greenUp, rhs.greenUp) || compareNumbersOrUndefined(lhs.scale, rhs.scale)
@@ -186,7 +186,7 @@ export class TextureMapping {
186
186
  if (isRelativeUnits || !visitor.tryGetDistanceParameter(i, param)) {
187
187
  if (!visitor.tryGetNormalizedParameter(i, param)) {
188
188
  // If mesh does not have facetFaceData, we still want to use the texture coordinates if they are present
189
- param = visitor.getParam(i);
189
+ param = expectDefined(visitor.getParam(i));
190
190
  }
191
191
  }
192
192
  params.push(uvTransform.multiplyPoint2d(param));
@@ -201,7 +201,7 @@ export class TextureMapping {
201
201
  if (visitor.normal === undefined)
202
202
  normal = points.getPoint3dAtUncheckedPointIndex(0).crossProductToPoints(points.getPoint3dAtUncheckedPointIndex(1), points.getPoint3dAtUncheckedPointIndex(2));
203
203
  else
204
- normal = visitor.normal.getVector3dAtCheckedVectorIndex(0);
204
+ normal = expectDefined(visitor.normal.getVector3dAtCheckedVectorIndex(0));
205
205
  if (!normal.normalize(normal))
206
206
  return undefined;
207
207
  // adjust U texture coordinate to be a continuous length starting at the
@@ -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,OAAO,EAAE,OAAO,EAAmB,SAAS,EAAE,QAAQ,EAAS,MAAM,sBAAsB,CAAC;AAEvI,OAAO,EAAE,eAAe,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AQ,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"]}
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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAkBtK,SAAS,sBAAsB,CAAC,GAAoB,EAAE,GAAoB;IACxE,OAAO,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC;WACpF,0BAA0B,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,yBAAyB,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC;WACvG,0BAA0B,CAAC,GAAG,CAAC,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;AAC1E,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAc;IACzB,gLAAgL;IAChK,OAAO,CAAgB;IACvC;;OAEG;IACI,eAAe,CAAmB;IACzC,4EAA4E;IAC5D,MAAM,CAAwB;IAE9C,YAAmB,EAAiB,EAAE,MAA6B;QACjE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,GAA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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, expectDefined } 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 = expectDefined(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 = expectDefined(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"]}