@itwin/core-frontend 3.0.0-dev.179 → 3.0.0-dev.183

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 (133) hide show
  1. package/lib/cjs/BackgroundMapGeometry.d.ts +1 -1
  2. package/lib/cjs/BackgroundMapGeometry.d.ts.map +1 -1
  3. package/lib/cjs/BackgroundMapGeometry.js +2 -2
  4. package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
  5. package/lib/cjs/NotificationManager.d.ts +3 -1
  6. package/lib/cjs/NotificationManager.d.ts.map +1 -1
  7. package/lib/cjs/NotificationManager.js +2 -0
  8. package/lib/cjs/NotificationManager.js.map +1 -1
  9. package/lib/cjs/RealityDataSource.js +3 -1
  10. package/lib/cjs/RealityDataSource.js.map +1 -1
  11. package/lib/cjs/ViewContext.js.map +1 -1
  12. package/lib/cjs/ViewCreator3d.d.ts +1 -1
  13. package/lib/cjs/ViewCreator3d.d.ts.map +1 -1
  14. package/lib/cjs/ViewCreator3d.js +1 -1
  15. package/lib/cjs/ViewCreator3d.js.map +1 -1
  16. package/lib/cjs/ViewingSpace.js +1 -1
  17. package/lib/cjs/ViewingSpace.js.map +1 -1
  18. package/lib/cjs/core-frontend.d.ts +4 -0
  19. package/lib/cjs/core-frontend.d.ts.map +1 -1
  20. package/lib/cjs/core-frontend.js +4 -0
  21. package/lib/cjs/core-frontend.js.map +1 -1
  22. package/lib/cjs/render/GraphicBuilder.d.ts +6 -0
  23. package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
  24. package/lib/cjs/render/GraphicBuilder.js.map +1 -1
  25. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
  26. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
  27. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js +2 -1
  28. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  29. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
  30. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js +1 -0
  31. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  32. package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
  33. package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
  34. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js +3 -3
  35. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  36. package/lib/cjs/render/webgl/BranchUniforms.d.ts.map +1 -1
  37. package/lib/cjs/render/webgl/BranchUniforms.js +8 -5
  38. package/lib/cjs/render/webgl/BranchUniforms.js.map +1 -1
  39. package/lib/cjs/render/webgl/SolarShadowMap.js +1 -1
  40. package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
  41. package/lib/cjs/tile/internal.d.ts +1 -0
  42. package/lib/cjs/tile/internal.d.ts.map +1 -1
  43. package/lib/cjs/tile/internal.js +1 -0
  44. package/lib/cjs/tile/internal.js.map +1 -1
  45. package/lib/cjs/tile/map/ArcGisUtilities.d.ts.map +1 -1
  46. package/lib/cjs/tile/map/ArcGisUtilities.js +7 -2
  47. package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
  48. package/lib/cjs/tile/map/MapLayerAuthentication.d.ts +20 -0
  49. package/lib/cjs/tile/map/MapLayerAuthentication.d.ts.map +1 -0
  50. package/lib/cjs/tile/map/MapLayerAuthentication.js +18 -0
  51. package/lib/cjs/tile/map/MapLayerAuthentication.js.map +1 -0
  52. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +5 -2
  53. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  54. package/lib/cjs/tile/map/MapLayerFormatRegistry.js +3 -1
  55. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  56. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +1 -1
  57. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  58. package/lib/cjs/tile/map/MapLayerImageryFormats.js +4 -2
  59. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  60. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +1 -1
  61. package/lib/cjs/tile/map/MapLayerImageryProvider.js +1 -1
  62. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  63. package/lib/cjs/tile/map/MapLayerSources.d.ts +3 -1
  64. package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
  65. package/lib/cjs/tile/map/MapLayerSources.js +3 -1
  66. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  67. package/lib/esm/BackgroundMapGeometry.d.ts +1 -1
  68. package/lib/esm/BackgroundMapGeometry.d.ts.map +1 -1
  69. package/lib/esm/BackgroundMapGeometry.js +2 -2
  70. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  71. package/lib/esm/NotificationManager.d.ts +3 -1
  72. package/lib/esm/NotificationManager.d.ts.map +1 -1
  73. package/lib/esm/NotificationManager.js +2 -0
  74. package/lib/esm/NotificationManager.js.map +1 -1
  75. package/lib/esm/RealityDataSource.js +3 -1
  76. package/lib/esm/RealityDataSource.js.map +1 -1
  77. package/lib/esm/ViewContext.js.map +1 -1
  78. package/lib/esm/ViewCreator3d.d.ts +1 -1
  79. package/lib/esm/ViewCreator3d.d.ts.map +1 -1
  80. package/lib/esm/ViewCreator3d.js +1 -1
  81. package/lib/esm/ViewCreator3d.js.map +1 -1
  82. package/lib/esm/ViewingSpace.js +1 -1
  83. package/lib/esm/ViewingSpace.js.map +1 -1
  84. package/lib/esm/core-frontend.d.ts +4 -0
  85. package/lib/esm/core-frontend.d.ts.map +1 -1
  86. package/lib/esm/core-frontend.js +4 -0
  87. package/lib/esm/core-frontend.js.map +1 -1
  88. package/lib/esm/render/GraphicBuilder.d.ts +6 -0
  89. package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
  90. package/lib/esm/render/GraphicBuilder.js.map +1 -1
  91. package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
  92. package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
  93. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js +2 -1
  94. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  95. package/lib/esm/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
  96. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js +1 -0
  97. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  98. package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
  99. package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
  100. package/lib/esm/render/primitives/mesh/MeshPrimitives.js +3 -3
  101. package/lib/esm/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  102. package/lib/esm/render/webgl/BranchUniforms.d.ts.map +1 -1
  103. package/lib/esm/render/webgl/BranchUniforms.js +8 -5
  104. package/lib/esm/render/webgl/BranchUniforms.js.map +1 -1
  105. package/lib/esm/render/webgl/SolarShadowMap.js +1 -1
  106. package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
  107. package/lib/esm/tile/internal.d.ts +1 -0
  108. package/lib/esm/tile/internal.d.ts.map +1 -1
  109. package/lib/esm/tile/internal.js +1 -0
  110. package/lib/esm/tile/internal.js.map +1 -1
  111. package/lib/esm/tile/map/ArcGisUtilities.d.ts.map +1 -1
  112. package/lib/esm/tile/map/ArcGisUtilities.js +8 -3
  113. package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
  114. package/lib/esm/tile/map/MapLayerAuthentication.d.ts +20 -0
  115. package/lib/esm/tile/map/MapLayerAuthentication.d.ts.map +1 -0
  116. package/lib/esm/tile/map/MapLayerAuthentication.js +15 -0
  117. package/lib/esm/tile/map/MapLayerAuthentication.js.map +1 -0
  118. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +5 -2
  119. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  120. package/lib/esm/tile/map/MapLayerFormatRegistry.js +3 -1
  121. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  122. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +1 -1
  123. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  124. package/lib/esm/tile/map/MapLayerImageryFormats.js +5 -3
  125. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  126. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +1 -1
  127. package/lib/esm/tile/map/MapLayerImageryProvider.js +1 -1
  128. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  129. package/lib/esm/tile/map/MapLayerSources.d.ts +3 -1
  130. package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
  131. package/lib/esm/tile/map/MapLayerSources.js +3 -1
  132. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  133. package/package.json +22 -22
@@ -1 +1 @@
1
- {"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAKzD,oDAA0F;AAE1F,2CAAwC;AAKxC,4DAAqG;AAKrG,0CAAuC;AACvC,8CAA+H;AAE/H,yCAAqG;AAErG;;GAEG;AACH,MAAa,aAAa;IASxB,YAAY,EAAY,EAAE,OAAiB;QACzC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;QACnD,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,yIAAyI;IA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B,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;QAEtH,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,uBAAuB,CAAC,OAAmB;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,eAAe,CAAC,IAAqB,EAAE,IAAgB;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,EAAE,CAAC;QAEP,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,+DAA+D;IAC/D,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,2EAA2E;IAC3E,IAAW,kBAAkB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,gFAAgF;IAChF,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,gBAAgB;IAChB,IAAW,iBAAiB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,gBAAgB;IAChB,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAA6B,EAAE,OAAmB;QAC3E,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF;AAxID,oCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\r\n Matrix3d, Point2d,\r\n Point3d, Range1d, Transform, XAndY,\r\n} from \"@itwin/core-geometry\";\nimport { Frustum, FrustumPlanes, SpatialClassifier, ViewFlags } from \"@itwin/core-common\";\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\r\nimport { GraphicBuilder, GraphicType, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"./render/RenderPlanarClassifier\";\r\nimport { RenderSystem, RenderTextureDrape } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewingSpace } from \"./ViewingSpace\";\r\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\r\n\r\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\r\n * @public\r\n */\r\nexport class RenderContext {\r\n /** ViewFlags extracted from the context's [[Viewport]]. */\r\n public readonly viewFlags: ViewFlags;\r\n private readonly _viewport: Viewport;\r\n /** Frustum extracted from the context's [[Viewport]]. */\r\n public readonly frustum: Frustum;\r\n /** Frustum planes extracted from the context's [[Viewport]]. */\r\n public readonly frustumPlanes: FrustumPlanes;\r\n\r\n constructor(vp: Viewport, frustum?: Frustum) {\r\n this._viewport = vp;\r\n this.viewFlags = vp.viewFlags;\n this.frustum = frustum ? frustum : vp.getFrustum();\r\n this.frustumPlanes = new FrustumPlanes(this.frustum);\r\n }\r\n\r\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\r\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\r\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\r\n }\r\n\r\n /** The [[Viewport]] associated with this context. */\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n /** The [[RenderSystem]] being used to produce graphics for this context. */\r\n public get renderSystem(): RenderSystem {\r\n return this.target.renderSystem;\r\n }\r\n\r\n /** @internal */\r\n public get target(): RenderTarget { return this.viewport.target; }\r\n\r\n /** @internal */\r\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\r\n }\r\n\r\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n */\r\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\r\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\r\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\r\n }\r\n\r\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\r\n * @param branch Contains the group of graphics and the symbology overrides.\r\n * @param location the local-to-world transform applied to the grouped graphics.\r\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\r\n * @see [[RenderSystem.createBranch]]\r\n */\r\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\r\n\r\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\r\n * Used when computing LOD for graphics.\r\n * @internal\r\n */\r\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\r\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\r\n }\r\n}\r\n\r\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\r\n * @see [[InteractiveTool.onDynamicFrame]]\r\n * @public\r\n */\r\nexport class DynamicsContext extends RenderContext {\r\n private _dynamics?: GraphicList;\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\r\n public addGraphic(graphic: RenderGraphic) {\r\n if (undefined === this._dynamics)\r\n this._dynamics = [];\r\n this._dynamics.push(graphic);\r\n }\r\n\r\n /** @internal */\r\n public changeDynamics(): void {\r\n this.viewport.changeDynamics(this._dynamics);\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\r\n }\r\n}\r\n\r\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\r\n * @public\r\n */\r\nexport class DecorateContext extends RenderContext {\r\n private readonly _decorations: Decorations;\r\n private readonly _cache: DecorationsCache;\r\n private _curCacheableDecorator?: ViewportDecorator;\r\n\r\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\r\n public override get viewport(): ScreenViewport {\r\n return super.viewport as ScreenViewport;\r\n }\r\n\r\n /** @internal */\r\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\r\n super(vp);\r\n this._decorations = decorations;\r\n this._cache = cache;\r\n }\r\n\r\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @param type The type of builder to create.\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[createGraphic]] for more options.\r\n */\r\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\r\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\n return this._createGraphicBuilder(options);\r\n }\r\n\r\n /** @internal */\r\n public addFromDecorator(decorator: ViewportDecorator): void {\r\n assert(undefined === this._curCacheableDecorator);\r\n try {\r\n if (decorator.useCachedDecorations) {\r\n const cached = this._cache.get(decorator);\r\n if (cached) {\r\n this.restoreCache(cached);\r\n return;\r\n }\r\n\r\n this._curCacheableDecorator = decorator;\r\n }\r\n\r\n decorator.decorate(this);\r\n } finally {\r\n this._curCacheableDecorator = undefined;\r\n }\r\n }\r\n\r\n /** Restores decorations onto this context from the specified array of cached decorations. */\r\n private restoreCache(cachedDecorations: CachedDecoration[]) {\r\n cachedDecorations.forEach((cachedDecoration) => {\r\n switch (cachedDecoration.type) {\r\n case \"graphic\":\r\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\r\n break;\r\n case \"canvas\":\r\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\r\n break;\r\n case \"html\":\r\n this.addHtmlDecoration(cachedDecoration.htmlElement);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _appendToCache(decoration: CachedDecoration) {\r\n assert(undefined !== this._curCacheableDecorator);\r\n this._cache.add(this._curCacheableDecorator, decoration);\r\n }\r\n\r\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\r\n * [[Decorations]].\r\n * @param builder The builder from which to extract the graphic.\r\n * @note The builder should not be used after calling this method.\r\n */\r\n public addDecorationFromBuilder(builder: GraphicBuilder) {\r\n this.addDecoration(builder.type, builder.finish());\r\n }\r\n\r\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\r\n * @param The type of the graphic, which determines to which list of decorations it is added.\r\n * @param decoration The decoration graphic to add.\r\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\r\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\r\n */\r\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\r\n if (this._curCacheableDecorator) {\r\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\r\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\r\n decoration = graphicOwner;\r\n }\r\n\r\n switch (type) {\r\n case GraphicType.Scene:\r\n if (undefined === this._decorations.normal)\r\n this._decorations.normal = [];\r\n this._decorations.normal.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldDecoration:\r\n if (!this._decorations.world)\r\n this._decorations.world = [];\r\n this._decorations.world.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldOverlay:\r\n if (!this._decorations.worldOverlay)\r\n this._decorations.worldOverlay = [];\r\n this._decorations.worldOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewOverlay:\r\n if (!this._decorations.viewOverlay)\r\n this._decorations.viewOverlay = [];\r\n this._decorations.viewOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewBackground:\r\n this.setViewBackground(decoration);\r\n break;\r\n }\r\n }\r\n\r\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\r\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\r\n\r\n if (undefined === this._decorations.canvasDecorations)\r\n this._decorations.canvasDecorations = [];\r\n\r\n const list = this._decorations.canvasDecorations;\r\n if (0 === list.length || true === atFront)\r\n list.push(decoration);\r\n else\r\n list.unshift(decoration);\r\n }\r\n\r\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\r\n public addHtmlDecoration(decoration: HTMLElement) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"html\", htmlElement: decoration });\r\n\r\n // an element decoration being added might already be on the decorationDiv, just marked for removal\r\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\r\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\r\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\n this.viewport.decorationDiv.appendChild(decoration);\n }\r\n }\r\n\r\n /** @internal */\r\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\r\n const vp = this.viewport;\r\n\r\n if (vp.viewingGlobe)\r\n return;\r\n\r\n const color = vp.getContrastToBackgroundColor();\r\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\r\n if (planarGrid) {\r\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\r\n }\r\n }\r\n\r\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\r\n * @see [[RenderSystem.createSkyBox]].\r\n */\r\n public setSkyBox(graphic: RenderGraphic) {\r\n this._decorations.skyBox = graphic;\r\n }\r\n\r\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\r\n public setViewBackground(graphic: RenderGraphic) {\r\n this._decorations.viewBackground = graphic;\r\n }\r\n}\r\n\r\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\r\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\r\n * should be displayed in the viewport but are not yet loaded.\r\n * @public\r\n */\r\nexport class SceneContext extends RenderContext {\r\n private _missingChildTiles = false;\r\n /** The graphics comprising the scene. */\r\n public readonly scene = new Scene();\r\n\r\n /** @internal */\r\n public readonly missingTiles = new Set<Tile>();\r\n\r\n /** @internal */\r\n public markChildrenLoading(): void {\r\n this._missingChildTiles = true;\r\n }\r\n\r\n /** @internal */\r\n public get hasMissingTiles(): boolean {\r\n return this._missingChildTiles || this.missingTiles.size > 0;\r\n }\r\n\r\n private _viewingSpace?: ViewingSpace;\r\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\r\n\r\n public constructor(vp: Viewport, frustum?: Frustum) {\r\n super(vp, frustum);\r\n }\r\n\r\n /** The viewed volume containing the scene. */\r\n public get viewingSpace(): ViewingSpace {\r\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\r\n }\r\n\r\n /** @internal */\r\n public get graphicType() { return this._graphicType; }\r\n\r\n /** Add the specified graphic to the scene. */\r\n public outputGraphic(graphic: RenderGraphic): void {\r\n switch (this._graphicType) {\r\n case TileGraphicType.BackgroundMap:\r\n this.backgroundGraphics.push(graphic);\r\n break;\r\n case TileGraphicType.Overlay:\r\n this.overlayGraphics.push(graphic);\r\n break;\r\n default:\r\n this.graphics.push(graphic);\r\n break;\r\n }\r\n }\r\n\r\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\r\n public insertMissingTile(tile: Tile): void {\r\n switch (tile.loadStatus) {\r\n case TileLoadStatus.NotLoaded:\r\n case TileLoadStatus.Queued:\r\n case TileLoadStatus.Loading:\r\n this.missingTiles.add(tile);\r\n break;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\r\n }\r\n\r\n /** @internal */\r\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\r\n // Target may have the classifier from a previous frame; if not we must create one.\r\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\r\n if (undefined === classifier)\r\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\r\n\r\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\r\n if (undefined !== classifier) {\r\n this.planarClassifiers.set(classifiedModelId, classifier);\r\n classifier.setSource(classifierTree, planarClipMask);\r\n }\r\n\r\n return classifier;\r\n }\r\n\r\n /** @internal */\r\n public getPlanarClassifierForModel(modelId: Id64String) {\r\n return this.planarClassifiers.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\r\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\r\n if (undefined === drapedTree)\r\n return undefined;\r\n\r\n const id = drapedTree.modelId;\r\n let drape = this.getTextureDrapeForModel(id);\r\n if (undefined !== drape)\r\n return drape;\r\n\r\n drape = this.viewport.target.getTextureDrape(id);\r\n if (undefined === drape && this.viewport.backgroundDrapeMap)\r\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\r\n\r\n if (undefined !== drape)\r\n this.textureDrapes.set(id, drape);\r\n\r\n return drape;\r\n }\r\n\r\n /** @internal */\r\n public getTextureDrapeForModel(modelId: Id64String) {\r\n return this.textureDrapes.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public withGraphicType(type: TileGraphicType, func: () => void): void {\r\n const prevType = this._graphicType;\r\n this._graphicType = type;\r\n\r\n func();\r\n\r\n this._graphicType = prevType;\r\n }\r\n\r\n /** The graphics in the scene that will be drawn with depth. */\r\n public get graphics() { return this.scene.foreground; }\r\n /** The graphics that will be drawn behind everything else in the scene. */\r\n public get backgroundGraphics() { return this.scene.background; }\r\n /** The graphics that will be drawn in front of everything else in the scene. */\r\n public get overlayGraphics() { return this.scene.overlay; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.scene.planarClassifiers; }\r\n /** @internal */\r\n public get textureDrapes() { return this.scene.textureDrapes; }\r\n\r\n /** @internal */\r\n public setVolumeClassifier(classifier: SpatialClassifier, modelId: Id64String): void {\r\n this.scene.volumeClassifier = { classifier, modelId };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewContext.js","sourceRoot":"","sources":["../../src/ViewContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AAKzD,oDAA0F;AAE1F,2CAAwC;AAKxC,4DAAqG;AAKrG,0CAAuC;AACvC,8CAA+H;AAE/H,yCAAqG;AAErG;;GAEG;AACH,MAAa,aAAa;IASxB,YAAY,EAAY,EAAE,OAAiB;QACzC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;QACnD,IAAI,CAAC,aAAa,GAAG,IAAI,2BAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,yIAAyI;IAClI,mBAAmB,CAAC,OAAiB;QAC1C,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;IAED,qDAAqD;IACrD,IAAW,QAAQ;Q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AK,CAAC,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,uBAAuB,CAAC,OAAmB;QAChD,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;IACT,eAAe,CAAC,IAAqB,EAAE,IAAgB;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAEzB,IAAI,EAAE,CAAC;QAEP,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,+DAA+D;IAC/D,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACvD,2EAA2E;IAC3E,IAAW,kBAAkB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,gFAAgF;IAChF,IAAW,eAAe,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,gBAAgB;IAChB,IAAW,iBAAiB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACvE,gBAAgB;IAChB,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAE/D,gBAAgB;IACT,mBAAmB,CAAC,UAA6B,EAAE,OAAmB;QAC3E,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACxD,CAAC;CACF;AAxID,oCAwIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Matrix3d, Point2d,\r\n Point3d, Range1d, Transform, XAndY,\r\n} from \"@itwin/core-geometry\";\r\nimport { Frustum, FrustumPlanes, SpatialClassifier, ViewFlags } from \"@itwin/core-common\";\r\nimport { CachedDecoration, DecorationsCache } from \"./DecorationsCache\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { PlanarClipMaskState } from \"./PlanarClipMaskState\";\r\nimport { CanvasDecoration } from \"./render/CanvasDecoration\";\r\nimport { Decorations } from \"./render/Decorations\";\r\nimport { GraphicBranch, GraphicBranchOptions } from \"./render/GraphicBranch\";\r\nimport { GraphicBuilder, GraphicType, ViewportGraphicBuilderOptions } from \"./render/GraphicBuilder\";\r\nimport { GraphicList, RenderGraphic } from \"./render/RenderGraphic\";\r\nimport { RenderPlanarClassifier } from \"./render/RenderPlanarClassifier\";\r\nimport { RenderSystem, RenderTextureDrape } from \"./render/RenderSystem\";\r\nimport { RenderTarget } from \"./render/RenderTarget\";\r\nimport { Scene } from \"./render/Scene\";\r\nimport { SpatialClassifierTileTreeReference, Tile, TileGraphicType, TileLoadStatus, TileTreeReference } from \"./tile/internal\";\r\nimport { ViewingSpace } from \"./ViewingSpace\";\r\nimport { ELEMENT_MARKED_FOR_REMOVAL, ScreenViewport, Viewport, ViewportDecorator } from \"./Viewport\";\r\n\r\n/** Provides context for producing [[RenderGraphic]]s for drawing within a [[Viewport]].\r\n * @public\r\n */\r\nexport class RenderContext {\r\n /** ViewFlags extracted from the context's [[Viewport]]. */\r\n public readonly viewFlags: ViewFlags;\r\n private readonly _viewport: Viewport;\r\n /** Frustum extracted from the context's [[Viewport]]. */\r\n public readonly frustum: Frustum;\r\n /** Frustum planes extracted from the context's [[Viewport]]. */\r\n public readonly frustumPlanes: FrustumPlanes;\r\n\r\n constructor(vp: Viewport, frustum?: Frustum) {\r\n this._viewport = vp;\r\n this.viewFlags = vp.viewFlags;\r\n this.frustum = frustum ? frustum : vp.getFrustum();\r\n this.frustumPlanes = new FrustumPlanes(this.frustum);\r\n }\r\n\r\n /** Given a point in world coordinates, determine approximately how many pixels it occupies on screen based on this context's frustum. */\r\n public getPixelSizeAtPoint(inPoint?: Point3d): number {\r\n return this.viewport.viewingSpace.getPixelSizeAtPoint(inPoint);\r\n }\r\n\r\n /** The [[Viewport]] associated with this context. */\r\n public get viewport(): Viewport {\r\n return this._viewport;\r\n }\r\n\r\n /** The [[RenderSystem]] being used to produce graphics for this context. */\r\n public get renderSystem(): RenderSystem {\r\n return this.target.renderSystem;\r\n }\r\n\r\n /** @internal */\r\n public get target(): RenderTarget { return this.viewport.target; }\r\n\r\n /** @internal */\r\n protected _createGraphicBuilder(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this.target.createGraphicBuilder({ ...options, viewport: this.viewport });\r\n }\r\n\r\n /** Create a builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @returns A builder for creating a [[GraphicType.Scene]] [[RenderGraphic]] for rendering within this context's [[Viewport]].\r\n */\r\n public createSceneGraphicBuilder(transform?: Transform): GraphicBuilder {\r\n return this._createGraphicBuilder({ type: GraphicType.Scene, placement: transform });\r\n }\r\n\r\n /** Create a graphic from a [[GraphicBranch]]. */\r\n public createGraphicBranch(branch: GraphicBranch, location: Transform, opts?: GraphicBranchOptions): RenderGraphic {\r\n return this.target.renderSystem.createGraphicBranch(branch, location, opts);\r\n }\r\n\r\n /** Create a [[RenderGraphic]] which groups a set of graphics into a node in a scene graph, applying to each a transform and optional clip volume and symbology overrides.\r\n * @param branch Contains the group of graphics and the symbology overrides.\r\n * @param location the local-to-world transform applied to the grouped graphics.\r\n * @returns A RenderGraphic suitable for drawing the scene graph node within this context's [[Viewport]].\r\n * @see [[RenderSystem.createBranch]]\r\n */\r\n public createBranch(branch: GraphicBranch, location: Transform): RenderGraphic { return this.createGraphicBranch(branch, location); }\r\n\r\n /** Given the size of a logical pixel in meters, convert it to the size of a physical pixel in meters, if [[RenderSystem.dpiAwareLOD]] is `true`.\r\n * Used when computing LOD for graphics.\r\n * @internal\r\n */\r\n public adjustPixelSizeForLOD(cssPixelSize: number): number {\r\n return this.viewport.target.adjustPixelSizeForLOD(cssPixelSize);\r\n }\r\n}\r\n\r\n/** Provides context for an [[InteractiveTool]] to display decorations representing its current state.\r\n * @see [[InteractiveTool.onDynamicFrame]]\r\n * @public\r\n */\r\nexport class DynamicsContext extends RenderContext {\r\n private _dynamics?: GraphicList;\r\n\r\n /** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */\r\n public addGraphic(graphic: RenderGraphic) {\r\n if (undefined === this._dynamics)\r\n this._dynamics = [];\r\n this._dynamics.push(graphic);\r\n }\r\n\r\n /** @internal */\r\n public changeDynamics(): void {\r\n this.viewport.changeDynamics(this._dynamics);\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n}\r\n\r\n/** Provides context for a [[ViewportDecorator]] to add [[Decorations]] to be rendered within a [[Viewport]].\r\n * @public\r\n */\r\nexport class DecorateContext extends RenderContext {\r\n private readonly _decorations: Decorations;\r\n private readonly _cache: DecorationsCache;\r\n private _curCacheableDecorator?: ViewportDecorator;\r\n\r\n /** The [[ScreenViewport]] in which this context's [[Decorations]] will be drawn. */\r\n public override get viewport(): ScreenViewport {\r\n return super.viewport as ScreenViewport;\r\n }\r\n\r\n /** @internal */\r\n constructor(vp: ScreenViewport, decorations: Decorations, cache: DecorationsCache) {\r\n super(vp);\r\n this._decorations = decorations;\r\n this._cache = cache;\r\n }\r\n\r\n /** Create a builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @param type The type of builder to create.\r\n * @param transform the local-to-world transform in which the builder's geometry is to be defined.\r\n * @param id If the decoration is to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @returns A builder for creating a [[RenderGraphic]] of the specified type appropriate for rendering within this context's [[Viewport]].\r\n * @see [[IModelConnection.transientIds]] for obtaining an ID for a pickable decoration.\r\n * @see [[createGraphic]] for more options.\r\n */\r\n public createGraphicBuilder(type: GraphicType, transform?: Transform, id?: Id64String): GraphicBuilder {\r\n return this.createGraphic({ type, placement: transform, pickable: undefined !== id ? { id } : undefined });\r\n }\r\n\r\n /** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].\r\n * @param options Options describing how to create the builder.\r\n * @returns A builder that produces a [[RenderGraphic]].\r\n */\r\n public createGraphic(options: Omit<ViewportGraphicBuilderOptions, \"viewport\">): GraphicBuilder {\r\n return this._createGraphicBuilder(options);\r\n }\r\n\r\n /** @internal */\r\n public addFromDecorator(decorator: ViewportDecorator): void {\r\n assert(undefined === this._curCacheableDecorator);\r\n try {\r\n if (decorator.useCachedDecorations) {\r\n const cached = this._cache.get(decorator);\r\n if (cached) {\r\n this.restoreCache(cached);\r\n return;\r\n }\r\n\r\n this._curCacheableDecorator = decorator;\r\n }\r\n\r\n decorator.decorate(this);\r\n } finally {\r\n this._curCacheableDecorator = undefined;\r\n }\r\n }\r\n\r\n /** Restores decorations onto this context from the specified array of cached decorations. */\r\n private restoreCache(cachedDecorations: CachedDecoration[]) {\r\n cachedDecorations.forEach((cachedDecoration) => {\r\n switch (cachedDecoration.type) {\r\n case \"graphic\":\r\n this.addDecoration(cachedDecoration.graphicType, cachedDecoration.graphicOwner);\r\n break;\r\n case \"canvas\":\r\n this.addCanvasDecoration(cachedDecoration.canvasDecoration, cachedDecoration.atFront);\r\n break;\r\n case \"html\":\r\n this.addHtmlDecoration(cachedDecoration.htmlElement);\r\n break;\r\n }\r\n });\r\n }\r\n\r\n private _appendToCache(decoration: CachedDecoration) {\r\n assert(undefined !== this._curCacheableDecorator);\r\n this._cache.add(this._curCacheableDecorator, decoration);\r\n }\r\n\r\n /** Calls [[GraphicBuilder.finish]] on the supplied builder to obtain a [[RenderGraphic]], then adds the graphic to the appropriate list of\r\n * [[Decorations]].\r\n * @param builder The builder from which to extract the graphic.\r\n * @note The builder should not be used after calling this method.\r\n */\r\n public addDecorationFromBuilder(builder: GraphicBuilder) {\r\n this.addDecoration(builder.type, builder.finish());\r\n }\r\n\r\n /** Adds a graphic to the set of [[Decorations]] to be drawn in this context's [[ScreenViewport]].\r\n * @param The type of the graphic, which determines to which list of decorations it is added.\r\n * @param decoration The decoration graphic to add.\r\n * @note The type must match the type with which the [[RenderGraphic]]'s [[GraphicBuilder]] was constructed.\r\n * @see [[DecorateContext.addDecorationFromBuilder]] for a more convenient API.\r\n */\r\n public addDecoration(type: GraphicType, decoration: RenderGraphic) {\r\n if (this._curCacheableDecorator) {\r\n const graphicOwner = this.target.renderSystem.createGraphicOwner(decoration);\r\n this._appendToCache({ type: \"graphic\", graphicOwner, graphicType: type });\r\n decoration = graphicOwner;\r\n }\r\n\r\n switch (type) {\r\n case GraphicType.Scene:\r\n if (undefined === this._decorations.normal)\r\n this._decorations.normal = [];\r\n this._decorations.normal.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldDecoration:\r\n if (!this._decorations.world)\r\n this._decorations.world = [];\r\n this._decorations.world.push(decoration);\r\n break;\r\n\r\n case GraphicType.WorldOverlay:\r\n if (!this._decorations.worldOverlay)\r\n this._decorations.worldOverlay = [];\r\n this._decorations.worldOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewOverlay:\r\n if (!this._decorations.viewOverlay)\r\n this._decorations.viewOverlay = [];\r\n this._decorations.viewOverlay.push(decoration);\r\n break;\r\n\r\n case GraphicType.ViewBackground:\r\n this.setViewBackground(decoration);\r\n break;\r\n }\r\n }\r\n\r\n /** Add a [[CanvasDecoration]] to be drawn in this context's [[ScreenViewport]]. */\r\n public addCanvasDecoration(decoration: CanvasDecoration, atFront = false) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"canvas\", canvasDecoration: decoration, atFront });\r\n\r\n if (undefined === this._decorations.canvasDecorations)\r\n this._decorations.canvasDecorations = [];\r\n\r\n const list = this._decorations.canvasDecorations;\r\n if (0 === list.length || true === atFront)\r\n list.push(decoration);\r\n else\r\n list.unshift(decoration);\r\n }\r\n\r\n /** Add an HTMLElement to be drawn as a decoration in this context's [[ScreenViewport]]. */\r\n public addHtmlDecoration(decoration: HTMLElement) {\r\n if (this._curCacheableDecorator)\r\n this._appendToCache({ type: \"html\", htmlElement: decoration });\r\n\r\n // an element decoration being added might already be on the decorationDiv, just marked for removal\r\n if (decoration[ELEMENT_MARKED_FOR_REMOVAL]) {\r\n decoration[ELEMENT_MARKED_FOR_REMOVAL] = false;\r\n } else if (decoration.parentElement !== this.viewport.decorationDiv) {\r\n this.viewport.decorationDiv.appendChild(decoration);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public drawStandardGrid(gridOrigin: Point3d, rMatrix: Matrix3d, spacing: XAndY, gridsPerRef: number, _isoGrid: boolean = false, _fixedRepetitions?: Point2d): void {\r\n const vp = this.viewport;\r\n\r\n if (vp.viewingGlobe)\r\n return;\r\n\r\n const color = vp.getContrastToBackgroundColor();\r\n const planarGrid = this.viewport.target.renderSystem.createPlanarGrid(vp.getFrustum(), { origin: gridOrigin, rMatrix, spacing, gridsPerRef, color });\r\n if (planarGrid) {\r\n this.addDecoration(GraphicType.WorldDecoration, planarGrid);\r\n }\r\n }\r\n\r\n /** Display skyBox graphic that encompasses entire scene and rotates with camera.\r\n * @see [[RenderSystem.createSkyBox]].\r\n */\r\n public setSkyBox(graphic: RenderGraphic) {\r\n this._decorations.skyBox = graphic;\r\n }\r\n\r\n /** Set the graphic to be displayed behind all other geometry as the background of this context's [[ScreenViewport]]. */\r\n public setViewBackground(graphic: RenderGraphic) {\r\n this._decorations.viewBackground = graphic;\r\n }\r\n}\r\n\r\n/** Context used to create the scene to be drawn in a [[Viewport]]. The scene consists of a set of [[RenderGraphic]]s produced by the\r\n * [[TileTree]]s visible within the viewport. Creating the scene may result in the enqueueing of requests for [[Tile]] content which\r\n * should be displayed in the viewport but are not yet loaded.\r\n * @public\r\n */\r\nexport class SceneContext extends RenderContext {\r\n private _missingChildTiles = false;\r\n /** The graphics comprising the scene. */\r\n public readonly scene = new Scene();\r\n\r\n /** @internal */\r\n public readonly missingTiles = new Set<Tile>();\r\n\r\n /** @internal */\r\n public markChildrenLoading(): void {\r\n this._missingChildTiles = true;\r\n }\r\n\r\n /** @internal */\r\n public get hasMissingTiles(): boolean {\r\n return this._missingChildTiles || this.missingTiles.size > 0;\r\n }\r\n\r\n private _viewingSpace?: ViewingSpace;\r\n private _graphicType: TileGraphicType = TileGraphicType.Scene;\r\n\r\n public constructor(vp: Viewport, frustum?: Frustum) {\r\n super(vp, frustum);\r\n }\r\n\r\n /** The viewed volume containing the scene. */\r\n public get viewingSpace(): ViewingSpace {\r\n return undefined !== this._viewingSpace ? this._viewingSpace : this.viewport.viewingSpace;\r\n }\r\n\r\n /** @internal */\r\n public get graphicType() { return this._graphicType; }\r\n\r\n /** Add the specified graphic to the scene. */\r\n public outputGraphic(graphic: RenderGraphic): void {\r\n switch (this._graphicType) {\r\n case TileGraphicType.BackgroundMap:\r\n this.backgroundGraphics.push(graphic);\r\n break;\r\n case TileGraphicType.Overlay:\r\n this.overlayGraphics.push(graphic);\r\n break;\r\n default:\r\n this.graphics.push(graphic);\r\n break;\r\n }\r\n }\r\n\r\n /** Indicate that the specified tile is desired for the scene but is not yet ready. A request to load its contents will later be enqueued. */\r\n public insertMissingTile(tile: Tile): void {\r\n switch (tile.loadStatus) {\r\n case TileLoadStatus.NotLoaded:\r\n case TileLoadStatus.Queued:\r\n case TileLoadStatus.Loading:\r\n this.missingTiles.add(tile);\r\n break;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public requestMissingTiles(): void {\r\n IModelApp.tileAdmin.requestTiles(this.viewport, this.missingTiles);\r\n }\r\n\r\n /** @internal */\r\n public addPlanarClassifier(classifiedModelId: Id64String, classifierTree?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): RenderPlanarClassifier | undefined {\r\n // Target may have the classifier from a previous frame; if not we must create one.\r\n let classifier = this.viewport.target.getPlanarClassifier(classifiedModelId);\r\n if (undefined === classifier)\r\n classifier = this.viewport.target.createPlanarClassifier(classifierTree?.activeClassifier);\r\n\r\n // Either way, we need to collect the graphics to draw for this frame, and record that we did so.\r\n if (undefined !== classifier) {\r\n this.planarClassifiers.set(classifiedModelId, classifier);\r\n classifier.setSource(classifierTree, planarClipMask);\r\n }\r\n\r\n return classifier;\r\n }\r\n\r\n /** @internal */\r\n public getPlanarClassifierForModel(modelId: Id64String) {\r\n return this.planarClassifiers.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public addBackgroundDrapedModel(drapedTreeRef: TileTreeReference, _heightRange: Range1d | undefined): RenderTextureDrape | undefined {\r\n const drapedTree = drapedTreeRef.treeOwner.tileTree;\r\n if (undefined === drapedTree)\r\n return undefined;\r\n\r\n const id = drapedTree.modelId;\r\n let drape = this.getTextureDrapeForModel(id);\r\n if (undefined !== drape)\r\n return drape;\r\n\r\n drape = this.viewport.target.getTextureDrape(id);\r\n if (undefined === drape && this.viewport.backgroundDrapeMap)\r\n drape = this.viewport.target.renderSystem.createBackgroundMapDrape(drapedTreeRef, this.viewport.backgroundDrapeMap);\r\n\r\n if (undefined !== drape)\r\n this.textureDrapes.set(id, drape);\r\n\r\n return drape;\r\n }\r\n\r\n /** @internal */\r\n public getTextureDrapeForModel(modelId: Id64String) {\r\n return this.textureDrapes.get(modelId);\r\n }\r\n\r\n /** @internal */\r\n public withGraphicType(type: TileGraphicType, func: () => void): void {\r\n const prevType = this._graphicType;\r\n this._graphicType = type;\r\n\r\n func();\r\n\r\n this._graphicType = prevType;\r\n }\r\n\r\n /** The graphics in the scene that will be drawn with depth. */\r\n public get graphics() { return this.scene.foreground; }\r\n /** The graphics that will be drawn behind everything else in the scene. */\r\n public get backgroundGraphics() { return this.scene.background; }\r\n /** The graphics that will be drawn in front of everything else in the scene. */\r\n public get overlayGraphics() { return this.scene.overlay; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.scene.planarClassifiers; }\r\n /** @internal */\r\n public get textureDrapes() { return this.scene.textureDrapes; }\r\n\r\n /** @internal */\r\n public setVolumeClassifier(classifier: SpatialClassifier, modelId: Id64String): void {\r\n this.scene.volumeClassifier = { classifier, modelId };\r\n }\r\n}\r\n"]}
@@ -9,7 +9,7 @@ import { ViewState } from "./ViewState";
9
9
  * @public
10
10
  */
11
11
  export interface ViewCreator3dOptions {
12
- /** Turn [[Camera]] on when generating the view. */
12
+ /** Turn [[Camera]] on when generating the view. Defaults to true (on) */
13
13
  cameraOn?: boolean;
14
14
  /** Turn [[SkyBox]] on when generating the view. */
15
15
  skyboxOn?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ViewCreator3d.d.ts","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":"AAKA;;GAEG;AAOH,OAAO,EAAa,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAM5D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;EAEE;AACF,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,+EAA+E;IAC/E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+GAA+G;IAC/G,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,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AO,CAAC,SAAS,CAAC;IAkB3G;;;;OAIG;YACW,qBAAqB;IA2GnC;;;OAGG;YACW,cAAc;IAwB5B;;OAEG;YACW,iBAAiB;IAwB/B;;OAEG;YACW,iBAAiB;IAQ/B;;OAEG;YACW,aAAa;IAgB3B;;OAEG;IACH,OAAO,CAAC,aAAa,CAMnB;CACH"}
@@ -106,7 +106,7 @@ class ViewCreator3d {
106
106
  classFullName: "BisCore:ModelSelector",
107
107
  };
108
108
  const cameraData = new core_common_1.Camera();
109
- const cameraOn = (options === null || options === void 0 ? void 0 : options.cameraOn) ? options.cameraOn : false;
109
+ const cameraOn = (options === null || options === void 0 ? void 0 : options.cameraOn) !== false;
110
110
  const viewDefinitionProps = {
111
111
  categorySelectorId: "",
112
112
  displayStyleId: "",
@@ -1 +1 @@
1
- {"version":3,"file":"ViewCreator3d.js","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAY/F,oDAG4B;AAC5B,wDAA+C;AAI/C,yDAAsD;AAkBtD;;;;;;;;GAQG;AACH,MAAa,aAAa;IAExB;;;OAGG;IACH,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QA+N7C;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,4BAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IAxO+C,CAAC;IAElD;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB,CAAC,OAA8B,EAAE,QAAuB;QACpF,MAAM,MAAM,GAAG,QAAQ,aAAR,QAA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5C,MAAM,KAAK,GAAG,2IAA2I,CAAC;QAC1J,MAAM,UAAU,GAAc,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE9D,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CAYF;AA/OD,sCA+OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\n/*\r\nAPI for creating a 3D default view for an iModel.\r\nEither takes in a list of modelIds, or displays all 3D models by default.\r\n*/\r\n\r\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Camera, CategorySelectorProps, Code, DisplayStyle3dProps, Environment, IModel, IModelReadRpcInterface, ModelSelectorProps, QueryRowFormat,\r\n RenderMode, ViewDefinition3dProps, ViewQueryParams, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { StandardViewId } from \"./StandardView\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialViewState } from \"./SpatialViewState\";\r\n\r\n/** Options for creating a [[ViewState3d]] via [[ViewCreator3d]].\r\n * @public\r\n*/\r\nexport interface ViewCreator3dOptions {\r\n /** Turn [[Camera]] on when generating the view. */\r\n cameraOn?: boolean;\r\n /** Turn [[SkyBox]] on when generating the view. */\r\n skyboxOn?: boolean;\r\n /** [[StandardViewId]] for the view state. */\r\n standardViewId?: StandardViewId;\r\n /** Merge in props from the seed view (default spatial view) of the iModel. */\r\n useSeedView?: boolean;\r\n /** Aspect ratio of [[Viewport]]. Required to fit contents of the model(s) in the initial state of the view. */\r\n vpAspect?: number;\r\n}\r\n\r\n/**\r\n * API for creating a 3D default [[ViewState3d]] for an iModel. @see [[ViewCreator2d]] to create a view for a 2d model.\r\n * Example usage:\r\n * ```ts\r\n * const viewCreator = new ViewCreator3d(imodel);\r\n * const defaultView = await viewCreator.createDefaultView({skyboxOn: true});\r\n * ```\r\n * @public\r\n */\r\nexport class ViewCreator3d {\r\n\r\n /**\r\n * Constructs a ViewCreator3d using an [[IModelConnection]].\r\n * @param _imodel [[IModelConnection]] to query for categories and/or models.\r\n */\r\n constructor(private _imodel: IModelConnection) { }\r\n\r\n /**\r\n * Creates a default [[ViewState3d]] based on the model ids passed in. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [options] Options for creating the view.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async createDefaultView(options?: ViewCreator3dOptions, modelIds?: Id64String[]): Promise<ViewState> {\r\n const models = modelIds ?? await this._getAllModels();\r\n const props = await this._createViewStateProps(models, options);\r\n const viewState = SpatialViewState.createFromProps(props, this._imodel);\r\n try {\r\n await viewState.load();\r\n } catch {\r\n }\r\n\r\n if (options?.standardViewId)\r\n viewState.setStandardRotation(options.standardViewId);\r\n\r\n const range = viewState.computeFitRange();\r\n viewState.lookAtVolume(range, options?.vpAspect);\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Generates a view state props object for creating a view. Merges display styles with a seed view if the options.useSeedView is true\r\n * @param models Models to put in view props\r\n * @param options view creation options like camera On and skybox On\r\n */\r\n private async _createViewStateProps(models: Id64String[], options?: ViewCreator3dOptions): Promise<ViewStateProps> {\r\n // Use dictionary model in all props\r\n const dictionaryId = IModel.dictionaryId;\r\n const categories: Id64Array = await this._getAllCategories();\r\n\r\n // model extents\r\n const modelExtents = new Range3d();\r\n if (models.length > 0) {\r\n const modelProps = await this._imodel.models.queryModelRanges(models);\r\n for (const props of modelProps)\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n }\r\n\r\n if (modelExtents.isNull)\r\n modelExtents.setFrom(this._imodel.projectExtents);\r\n\r\n let originX = modelExtents.low.x;\r\n let originY = modelExtents.low.y;\r\n const originZ = modelExtents.low.z;\r\n let deltaX = modelExtents.xLength();\r\n let deltaY = modelExtents.yLength();\r\n const deltaZ = modelExtents.zLength();\r\n\r\n // if vp aspect given, update model extents to fit view\r\n if (options?.vpAspect) {\r\n const modelAspect = deltaY / deltaX;\r\n\r\n if (modelAspect > options.vpAspect) {\r\n const xFix = deltaY / options.vpAspect;\r\n originX = originX - xFix / 2;\r\n deltaX = deltaX + xFix;\r\n } else if (modelAspect < options.vpAspect) {\r\n const yFix = deltaX * options.vpAspect;\r\n originY = originY - yFix / 2;\r\n deltaY = deltaY + yFix;\r\n }\r\n }\r\n\r\n const categorySelectorProps: CategorySelectorProps = {\r\n categories,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:CategorySelector\",\r\n };\r\n\r\n const modelSelectorProps: ModelSelectorProps = {\r\n models,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ModelSelector\",\r\n };\r\n\r\n const cameraData = new Camera();\r\n const cameraOn = options?.cameraOn ? options.cameraOn : false;\r\n const viewDefinitionProps: ViewDefinition3dProps = {\r\n categorySelectorId: \"\",\r\n displayStyleId: \"\",\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n origin: { x: originX, y: originY, z: originZ },\r\n extents: { x: deltaX, y: deltaY, z: deltaZ },\r\n classFullName: \"BisCore:SpatialViewDefinition\",\r\n cameraOn,\r\n camera: {\r\n lens: cameraData.lens.toJSON(),\r\n focusDist: cameraData.focusDist,\r\n eye: cameraData.eye.toJSON(),\r\n },\r\n };\r\n\r\n const displayStyleProps: DisplayStyle3dProps = {\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:DisplayStyle\",\r\n jsonProperties: {\r\n styles: {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n noSourceLights: false,\r\n noCameraLights: false,\r\n noSolarLight: false,\r\n noConstruct: true,\r\n noTransp: false,\r\n visEdges: false,\r\n backgroundMap: this._imodel.isGeoLocated,\r\n },\r\n environment:\r\n options !== undefined &&\r\n options.skyboxOn !== undefined &&\r\n options.skyboxOn\r\n ? Environment.defaults.withDisplay({ sky: true }).toJSON()\r\n : undefined,\r\n },\r\n },\r\n };\r\n\r\n const viewStateProps: ViewStateProps = {\r\n displayStyleProps,\r\n categorySelectorProps,\r\n modelSelectorProps,\r\n viewDefinitionProps,\r\n };\r\n\r\n // merge seed view props if needed\r\n return options?.useSeedView ? this._mergeSeedView(viewStateProps) : viewStateProps;\r\n }\r\n\r\n /**\r\n * Merges a seed view in the iModel with the passed view state props. It will be a no-op if there are no default 3D views in the iModel\r\n * @param viewStateProps Input view props to be merged\r\n */\r\n private async _mergeSeedView(viewStateProps: ViewStateProps): Promise<ViewStateProps> {\r\n const viewId = await this._getDefaultViewId();\r\n // Handle iModels without any default view id\r\n if (viewId === undefined)\r\n return viewStateProps;\r\n\r\n const seedViewState = (await this._imodel.views.load(viewId) as SpatialViewState);\r\n const seedViewStateProps = {\r\n categorySelectorProps: seedViewState.categorySelector.toJSON(),\r\n modelSelectorProps: seedViewState.modelSelector.toJSON(),\r\n viewDefinitionProps: seedViewState.toJSON(),\r\n displayStyleProps: seedViewState.displayStyle.toJSON(),\r\n };\r\n const mergedDisplayProps = seedViewStateProps.displayStyleProps;\r\n if (mergedDisplayProps.jsonProperties !== undefined) {\r\n mergedDisplayProps.jsonProperties.styles = {\r\n ...mergedDisplayProps.jsonProperties.styles,\r\n ...viewStateProps.displayStyleProps.jsonProperties!.styles,\r\n };\r\n }\r\n\r\n return { ...seedViewStateProps, ...viewStateProps, displayStyleProps: mergedDisplayProps };\r\n }\r\n\r\n /**\r\n * Get ID of default view.\r\n */\r\n private async _getDefaultViewId(): Promise<Id64String | undefined> {\r\n const viewId = await this._imodel.views.queryDefaultViewId();\r\n const params: ViewQueryParams = {};\r\n params.from = SpatialViewState.classFullName;\r\n params.where = `ECInstanceId=${viewId}`;\r\n\r\n // Check validity of default view\r\n const viewProps = await IModelReadRpcInterface.getClient().queryElementProps(this._imodel.getRpcProps(), params);\r\n if (viewProps.length === 0) {\r\n // Return the first view we can find\r\n const viewList = await this._imodel.views.getViewList({ wantPrivate: false });\r\n if (viewList.length === 0)\r\n return undefined;\r\n\r\n const spatialViewList = viewList.filter((value: IModelConnection.ViewSpec) => value.class.indexOf(\"Spatial\") !== -1);\r\n if (spatialViewList.length === 0)\r\n return undefined;\r\n\r\n return spatialViewList[0].id;\r\n }\r\n\r\n return viewId;\r\n }\r\n\r\n /**\r\n * Get all categories containing elements\r\n */\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n\r\n return categories;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the connection\r\n */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n let models = [];\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n return models;\r\n }\r\n\r\n /**\r\n * Helper function to execute ECSql queries.\r\n */\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewCreator3d.js","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAY/F,oDAG4B;AAC5B,wDAA+C;AAI/C,yDAAsD;AAkBtD;;;;;;;;GAQG;AACH,MAAa,aAAa;IAExB;;;OAGG;IACH,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;QA+N7C;;WAEG;QACK,kBAAa,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,4BAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEpB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IAxO+C,CAAC;IAElD;;;;;OAKG;IACI,KAAK,CAAC,iBAAiB,CAAC,OAA8B,EAAE,QAAuB;QACpF,MAAM,MAAM,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QACtD,MAAM,KAAK,GAAG,MAAM,IAAI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AC;IAED;;OAEG;IACK,KAAK,CAAC,aAAa;QACzB,yFAAyF;QACzF,sGAAsG;QACtG,6JAA6J;QAC7J,MAAM,MAAM,GAAG,8FAA8F,CAAC;QAC9G,MAAM,gBAAgB,GAAG,sEAAsE,CAAC;QAChG,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI;YACF,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,MAAM,IAAI,gBAAgB,EAAE,CAAC,CAAC;SACpE;QAAC,MAAM;YACN,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAC3C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CAYF;AA/OD,sCA+OC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\n/*\r\nAPI for creating a 3D default view for an iModel.\r\nEither takes in a list of modelIds, or displays all 3D models by default.\r\n*/\r\n\r\nimport { Id64Array, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Camera, CategorySelectorProps, Code, DisplayStyle3dProps, Environment, IModel, IModelReadRpcInterface, ModelSelectorProps, QueryRowFormat,\r\n RenderMode, ViewDefinition3dProps, ViewQueryParams, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { StandardViewId } from \"./StandardView\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { SpatialViewState } from \"./SpatialViewState\";\r\n\r\n/** Options for creating a [[ViewState3d]] via [[ViewCreator3d]].\r\n * @public\r\n*/\r\nexport interface ViewCreator3dOptions {\r\n /** Turn [[Camera]] on when generating the view. Defaults to true (on) */\r\n cameraOn?: boolean;\r\n /** Turn [[SkyBox]] on when generating the view. */\r\n skyboxOn?: boolean;\r\n /** [[StandardViewId]] for the view state. */\r\n standardViewId?: StandardViewId;\r\n /** Merge in props from the seed view (default spatial view) of the iModel. */\r\n useSeedView?: boolean;\r\n /** Aspect ratio of [[Viewport]]. Required to fit contents of the model(s) in the initial state of the view. */\r\n vpAspect?: number;\r\n}\r\n\r\n/**\r\n * API for creating a 3D default [[ViewState3d]] for an iModel. @see [[ViewCreator2d]] to create a view for a 2d model.\r\n * Example usage:\r\n * ```ts\r\n * const viewCreator = new ViewCreator3d(imodel);\r\n * const defaultView = await viewCreator.createDefaultView({skyboxOn: true});\r\n * ```\r\n * @public\r\n */\r\nexport class ViewCreator3d {\r\n\r\n /**\r\n * Constructs a ViewCreator3d using an [[IModelConnection]].\r\n * @param _imodel [[IModelConnection]] to query for categories and/or models.\r\n */\r\n constructor(private _imodel: IModelConnection) { }\r\n\r\n /**\r\n * Creates a default [[ViewState3d]] based on the model ids passed in. If no model ids are passed in, all 3D models in the iModel are used.\r\n * @param [options] Options for creating the view.\r\n * @param [modelIds] Ids of models to display in the view.\r\n * @throws [IModelError]($common) If no 3d models are found in the iModel.\r\n */\r\n public async createDefaultView(options?: ViewCreator3dOptions, modelIds?: Id64String[]): Promise<ViewState> {\r\n const models = modelIds ?? await this._getAllModels();\r\n const props = await this._createViewStateProps(models, options);\r\n const viewState = SpatialViewState.createFromProps(props, this._imodel);\r\n try {\r\n await viewState.load();\r\n } catch {\r\n }\r\n\r\n if (options?.standardViewId)\r\n viewState.setStandardRotation(options.standardViewId);\r\n\r\n const range = viewState.computeFitRange();\r\n viewState.lookAtVolume(range, options?.vpAspect);\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Generates a view state props object for creating a view. Merges display styles with a seed view if the options.useSeedView is true\r\n * @param models Models to put in view props\r\n * @param options view creation options like camera On and skybox On\r\n */\r\n private async _createViewStateProps(models: Id64String[], options?: ViewCreator3dOptions): Promise<ViewStateProps> {\r\n // Use dictionary model in all props\r\n const dictionaryId = IModel.dictionaryId;\r\n const categories: Id64Array = await this._getAllCategories();\r\n\r\n // model extents\r\n const modelExtents = new Range3d();\r\n if (models.length > 0) {\r\n const modelProps = await this._imodel.models.queryModelRanges(models);\r\n for (const props of modelProps)\r\n modelExtents.union(Range3d.fromJSON(props), modelExtents);\r\n }\r\n\r\n if (modelExtents.isNull)\r\n modelExtents.setFrom(this._imodel.projectExtents);\r\n\r\n let originX = modelExtents.low.x;\r\n let originY = modelExtents.low.y;\r\n const originZ = modelExtents.low.z;\r\n let deltaX = modelExtents.xLength();\r\n let deltaY = modelExtents.yLength();\r\n const deltaZ = modelExtents.zLength();\r\n\r\n // if vp aspect given, update model extents to fit view\r\n if (options?.vpAspect) {\r\n const modelAspect = deltaY / deltaX;\r\n\r\n if (modelAspect > options.vpAspect) {\r\n const xFix = deltaY / options.vpAspect;\r\n originX = originX - xFix / 2;\r\n deltaX = deltaX + xFix;\r\n } else if (modelAspect < options.vpAspect) {\r\n const yFix = deltaX * options.vpAspect;\r\n originY = originY - yFix / 2;\r\n deltaY = deltaY + yFix;\r\n }\r\n }\r\n\r\n const categorySelectorProps: CategorySelectorProps = {\r\n categories,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:CategorySelector\",\r\n };\r\n\r\n const modelSelectorProps: ModelSelectorProps = {\r\n models,\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ModelSelector\",\r\n };\r\n\r\n const cameraData = new Camera();\r\n const cameraOn = options?.cameraOn !== false;\r\n const viewDefinitionProps: ViewDefinition3dProps = {\r\n categorySelectorId: \"\",\r\n displayStyleId: \"\",\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n origin: { x: originX, y: originY, z: originZ },\r\n extents: { x: deltaX, y: deltaY, z: deltaZ },\r\n classFullName: \"BisCore:SpatialViewDefinition\",\r\n cameraOn,\r\n camera: {\r\n lens: cameraData.lens.toJSON(),\r\n focusDist: cameraData.focusDist,\r\n eye: cameraData.eye.toJSON(),\r\n },\r\n };\r\n\r\n const displayStyleProps: DisplayStyle3dProps = {\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:DisplayStyle\",\r\n jsonProperties: {\r\n styles: {\r\n viewflags: {\r\n renderMode: RenderMode.SmoothShade,\r\n noSourceLights: false,\r\n noCameraLights: false,\r\n noSolarLight: false,\r\n noConstruct: true,\r\n noTransp: false,\r\n visEdges: false,\r\n backgroundMap: this._imodel.isGeoLocated,\r\n },\r\n environment:\r\n options !== undefined &&\r\n options.skyboxOn !== undefined &&\r\n options.skyboxOn\r\n ? Environment.defaults.withDisplay({ sky: true }).toJSON()\r\n : undefined,\r\n },\r\n },\r\n };\r\n\r\n const viewStateProps: ViewStateProps = {\r\n displayStyleProps,\r\n categorySelectorProps,\r\n modelSelectorProps,\r\n viewDefinitionProps,\r\n };\r\n\r\n // merge seed view props if needed\r\n return options?.useSeedView ? this._mergeSeedView(viewStateProps) : viewStateProps;\r\n }\r\n\r\n /**\r\n * Merges a seed view in the iModel with the passed view state props. It will be a no-op if there are no default 3D views in the iModel\r\n * @param viewStateProps Input view props to be merged\r\n */\r\n private async _mergeSeedView(viewStateProps: ViewStateProps): Promise<ViewStateProps> {\r\n const viewId = await this._getDefaultViewId();\r\n // Handle iModels without any default view id\r\n if (viewId === undefined)\r\n return viewStateProps;\r\n\r\n const seedViewState = (await this._imodel.views.load(viewId) as SpatialViewState);\r\n const seedViewStateProps = {\r\n categorySelectorProps: seedViewState.categorySelector.toJSON(),\r\n modelSelectorProps: seedViewState.modelSelector.toJSON(),\r\n viewDefinitionProps: seedViewState.toJSON(),\r\n displayStyleProps: seedViewState.displayStyle.toJSON(),\r\n };\r\n const mergedDisplayProps = seedViewStateProps.displayStyleProps;\r\n if (mergedDisplayProps.jsonProperties !== undefined) {\r\n mergedDisplayProps.jsonProperties.styles = {\r\n ...mergedDisplayProps.jsonProperties.styles,\r\n ...viewStateProps.displayStyleProps.jsonProperties!.styles,\r\n };\r\n }\r\n\r\n return { ...seedViewStateProps, ...viewStateProps, displayStyleProps: mergedDisplayProps };\r\n }\r\n\r\n /**\r\n * Get ID of default view.\r\n */\r\n private async _getDefaultViewId(): Promise<Id64String | undefined> {\r\n const viewId = await this._imodel.views.queryDefaultViewId();\r\n const params: ViewQueryParams = {};\r\n params.from = SpatialViewState.classFullName;\r\n params.where = `ECInstanceId=${viewId}`;\r\n\r\n // Check validity of default view\r\n const viewProps = await IModelReadRpcInterface.getClient().queryElementProps(this._imodel.getRpcProps(), params);\r\n if (viewProps.length === 0) {\r\n // Return the first view we can find\r\n const viewList = await this._imodel.views.getViewList({ wantPrivate: false });\r\n if (viewList.length === 0)\r\n return undefined;\r\n\r\n const spatialViewList = viewList.filter((value: IModelConnection.ViewSpec) => value.class.indexOf(\"Spatial\") !== -1);\r\n if (spatialViewList.length === 0)\r\n return undefined;\r\n\r\n return spatialViewList[0].id;\r\n }\r\n\r\n return viewId;\r\n }\r\n\r\n /**\r\n * Get all categories containing elements\r\n */\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n // Only use categories with elements in them\r\n const query = `SELECT DISTINCT Category.Id AS id FROM BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId FROM BisCore.SpatialCategory)`;\r\n const categories: Id64Array = await this._executeQuery(query);\r\n\r\n return categories;\r\n }\r\n\r\n /**\r\n * Get all PhysicalModel ids in the connection\r\n */\r\n private async _getAllModels(): Promise<Id64Array> {\r\n // Note: IsNotSpatiallyLocated was introduced in a later version of the BisCore ECSchema.\r\n // If the iModel has an earlier version, the statement will throw because the property does not exist.\r\n // If the iModel was created from an earlier version and later upgraded to a newer version, the property may be NULL for models created prior to the upgrade.\r\n const select = \"SELECT ECInstanceId FROM Bis.GeometricModel3D WHERE IsPrivate = false AND IsTemplate = false\";\r\n const spatialCriterion = \"AND (IsNotSpatiallyLocated IS NULL OR IsNotSpatiallyLocated = false)\";\r\n let models = [];\r\n try {\r\n models = await this._executeQuery(`${select} ${spatialCriterion}`);\r\n } catch {\r\n models = await this._executeQuery(select);\r\n }\r\n\r\n return models;\r\n }\r\n\r\n /**\r\n * Helper function to execute ECSql queries.\r\n */\r\n private _executeQuery = async (query: string) => {\r\n const rows = [];\r\n for await (const row of this._imodel.query(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames }))\r\n rows.push(row.id);\r\n\r\n return rows;\r\n };\r\n}\r\n"]}
@@ -207,7 +207,7 @@ class ViewingSpace {
207
207
  if (undefined !== globalGeometry) {
208
208
  const viewZ = this.rotation.getRow(2);
209
209
  const eyeDepth = this.eyePoint ? viewZ.dotProduct(this.eyePoint) : undefined;
210
- depthRange = globalGeometry.geometry.getFrustumIntersectionDepthRange(frustum, globalGeometry.heightRange, gridPlane, this.view.maxGlobalScopeFactor > 1);
210
+ depthRange = globalGeometry.geometry.getFrustumIntersectionDepthRange(frustum, extents, globalGeometry.heightRange, gridPlane, this.view.maxGlobalScopeFactor > 1);
211
211
  if (eyeDepth !== undefined) {
212
212
  const maxBackgroundFrontBackRatio = 1.0E6;
213
213
  const frontDist = Math.max(.1, eyeDepth - depthRange.high);
@@ -1 +1 @@
1
- {"version":3,"file":"ViewingSpace.js","sourceRoot":"","sources":["../../src/ViewingSpace.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAE8B;AAC9B,oDAAmF;AACnF,2EAAwE;AACxE,+CAA4C;AAE5C,yCAAsC;AAEtC,2CAAwC;AACxC,mEAAgF;AAEhF;;;;GAIG;AACH,MAAa,YAAY;IAmOvB,YAAoB,EAAY;QAlOf,eAAU,GAAG,IAAI,mBAAQ,EAAE,CAAC,CAAC,mBAAmB;QAChD,iBAAY,GAAG,IAAI,uBAAO,EAAE,CAAC,CAAC,mBAAmB;QAElE,gBAAgB;QACT,kBAAa,GAAG,GAAG,CAAC;QAS3B,wCAAwC;QACxB,eAAU,GAAG,IAAI,uBAAO,EAAE,CAAC;QAC3C,uCAAuC;QACvB,cAAS,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,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAClG,MAAM,OAAO,GAAG,IAAI,uBAAO,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,gBAAgB;IACT,iBAAiB,CAAC,gBAAqC,EAAE,MAAgB;QAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAE7D,IAAI,gBAAgB,IAAI,gBAAgB,YAAY,yBAAS,EAAE;YAC7D,OAAO,WAAW,CAAC,WAAW,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;SAC1D;aAAM;YACL,MAAM,KAAK,GAAG,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;YACpE,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAClD,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC1C,OAAO,eAAe,CAAC;SACxB;IACH,CAAC;;AAldH,oCAmdC;AA7cC;;GAEG;AACW,8BAAiB,GAAG,MAAM,CAAC;AACzC;;GAEG;AACW,2BAAc,GAAG,MAAM,CAAC;AAyFvB,sBAAS,GAAG,CAAC,CAAC,CAAC,qEAAqE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport {\r\n AxisOrder, ClipPlaneContainment, Constant, Map4d, Matrix3d, Plane3dByOriginAndUnitNormal, Point3d, Point4d, Range1d, Range2d, Range3d, Transform, Vector3d, XYAndZ, XYZ,\r\n} from \"@itwin/core-geometry\";\r\nimport { Frustum, GridOrientationType, Npc, NpcCorners } from \"@itwin/core-common\";\r\nimport { ApproximateTerrainHeights } from \"./ApproximateTerrainHeights\";\r\nimport { CoordSystem } from \"./CoordSystem\";\r\nimport { Viewport } from \"./Viewport\";\r\nimport { ViewRect } from \"./ViewRect\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { Frustum2d } from \"./Frustum2d\";\r\nimport { getFrustumPlaneIntersectionDepthRange } from \"./BackgroundMapGeometry\";\r\n\r\n/** Describes a [[Viewport]]'s viewing volume, plus its size on the screen. A new\r\n * instance of ViewingSpace is created every time the Viewport's frustum changes.\r\n * @see [[Viewport.viewingSpace]].\r\n * @public\r\n */\r\nexport class ViewingSpace {\r\n private readonly _viewRange = new ViewRect(); // scratch variable\r\n private readonly _viewCorners = new Range3d(); // scratch variable\r\n\r\n /** @internal */\r\n public frustFraction = 1.0;\r\n /** Maximum ratio of frontplane to backplane distance for 24 bit non-logarithmic zbuffer\r\n * @internal\r\n */\r\n public static nearScaleNonLog24 = 0.0003;\r\n /** Maximum fraction of frontplane to backplane distance for 24 bit logarithmic zbuffer\r\n * @internal\r\n */\r\n public static nearScaleLog24 = 1.0E-8;\r\n /** View origin, potentially expanded */\r\n public readonly viewOrigin = new Point3d();\r\n /** View delta, potentially expanded */\r\n public readonly viewDelta = new Vector3d();\r\n /** View origin (from ViewState, unexpanded) */\r\n public readonly viewOriginUnexpanded = new Point3d();\r\n /** View delta (from ViewState, unexpanded) */\r\n public readonly viewDeltaUnexpanded = new Vector3d();\r\n /** View rotation matrix (copied from ViewState) */\r\n public readonly rotation = new Matrix3d();\r\n /** Provides conversions between world and view coordinates. */\r\n public readonly worldToViewMap = Map4d.createIdentity();\r\n /** Providers conversions between world and Npc (non-dimensional perspective) coordinates. */\r\n public readonly worldToNpcMap = Map4d.createIdentity();\r\n /** @internal */\r\n public readonly zClipAdjusted: boolean = false; // were the view z clip planes adjusted due to front/back clipping off?\r\n /** Eye point - undefined if not a perspective projection. */\r\n public readonly eyePoint: Point3d | undefined;\r\n\r\n private _view: ViewState;\r\n\r\n /** The ViewState for this Viewport */\r\n public get view(): ViewState { return this._view; }\r\n public set view(view: ViewState) { this._view = view; }\r\n\r\n private readonly _clientWidth: number;\r\n private readonly _clientHeight: number;\r\n\r\n /** Get the rectangle of this Viewport in ViewCoordinates. */\r\n private get _viewRect(): ViewRect { this._viewRange.init(0, 0, this._clientWidth, this._clientHeight); return this._viewRange; }\r\n\r\n private static _copyOutput(from: XYZ, to?: XYZ) { let pt = from; if (to) { to.setFrom(from); pt = to; } return pt; }\r\n\r\n /** @internal */\r\n public toViewOrientation(from: XYZ, to?: XYZ) { this.rotation.multiplyVectorInPlace(ViewingSpace._copyOutput(from, to)); }\r\n /** @internal */\r\n public fromViewOrientation(from: XYZ, to?: XYZ) { this.rotation.multiplyTransposeVectorInPlace(ViewingSpace._copyOutput(from, to)); }\r\n\r\n /** Ensure the rotation matrix for this view is aligns the root z with the view out (i.e. a \"2d view\"). */\r\n private alignWithRootZ() {\r\n const zUp = Vector3d.unitZ();\r\n if (zUp.isAlmostEqual(this.rotation.rowZ()))\r\n return;\r\n const r = this.rotation.transpose();\r\n r.setColumn(2, zUp);\r\n Matrix3d.createRigidFromMatrix3d(r, AxisOrder.ZXY, r);\r\n r.transpose(this.rotation);\r\n this.view.setRotation(this.rotation); // Don't let viewState and viewport rotation be different.\r\n }\r\n\r\n private validateCamera() {\r\n const view = this.view;\r\n if (!view.is3d())\r\n return;\r\n\r\n const camera = view.camera;\r\n camera.validateLens();\r\n if (camera.isFocusValid)\r\n return;\r\n\r\n const vDelta = view.getExtents();\r\n const maxDelta = vDelta.x > vDelta.y ? vDelta.x : vDelta.y;\r\n let focusDistance = maxDelta / (2.0 * Math.tan(camera.getLensAngle().radians / 2.0));\r\n\r\n if (focusDistance < vDelta.z / 2.0)\r\n focusDistance = vDelta.z / 2.0;\r\n\r\n const eyePoint = new Point3d(vDelta.x / 2.0, vDelta.y / 2.0, (vDelta.z / 2.0) + focusDistance);\r\n\r\n this.fromViewOrientation(eyePoint);\r\n eyePoint.plus(view.getOrigin(), eyePoint);\r\n camera.setEyePoint(eyePoint);\r\n camera.setFocusDistance(focusDistance);\r\n }\r\n\r\n /** @internal */\r\n public getTerrainHeightRange(): Range1d | undefined {\r\n const frustum = this.getFrustum()!;\r\n const cartoRange = Range2d.createNull();\r\n for (let i = 0; i < 8; i++) {\r\n const corner = frustum.getCorner(i);\r\n const carto = this.view.iModel.spatialToCartographicFromEcef(corner);\r\n cartoRange.extendXY(carto.longitude, carto.latitude);\r\n }\r\n\r\n return ApproximateTerrainHeights.instance.getMinimumMaximumHeights(cartoRange);\r\n }\r\n\r\n private static _minDepth = 1; // Allowing very small depth will cause frustum calculations to fail.\r\n\r\n /** Adjust the front and back planes to encompass the entire viewed volume */\r\n private adjustZPlanes(origin: Point3d, delta: Vector3d): void {\r\n const view = this.view;\r\n if (!view.is3d()) // only necessary for 3d views\r\n return;\r\n\r\n delta.z = Math.max(delta.z, ViewingSpace._minDepth);\r\n\r\n const extents = view.getViewedExtents();\r\n const frustum = new Frustum();\r\n const worldToNpc = this.view.computeWorldToNpc(this.rotation, this.viewOrigin, this.viewDelta, false).map as Map4d;\r\n\r\n if (worldToNpc === undefined)\r\n return;\r\n\r\n worldToNpc.transform1.multiplyPoint3dArrayQuietNormalize(frustum.points);\r\n const clipPlanes = frustum.getRangePlanes(false, false, 0);\r\n const viewedExtentCorners = extents.corners();\r\n\r\n // Only extend depth to include viewed geometry if it is within the frustum. (if viewing global locations).\r\n if (clipPlanes.classifyPointContainment(viewedExtentCorners, false) === ClipPlaneContainment.StronglyOutside)\r\n extents.setNull();\r\n\r\n let depthRange;\r\n let gridPlane;\r\n if (this.view.viewFlags.grid) {\r\n const gridOrigin = this.view.isSpatialView() ? this.view.iModel.globalOrigin : Point3d.create();\r\n switch(this.view.getGridOrientation()) {\r\n case GridOrientationType.WorldXY:\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, Vector3d.create(0, 0, 1));\r\n break;\r\n case GridOrientationType.WorldYZ:\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, Vector3d.create(1, 0, 0));\r\n break;\r\n case GridOrientationType.WorldXZ:\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, Vector3d.create(0, 1, 0));\r\n break;\r\n\r\n case GridOrientationType.AuxCoord:\r\n if (this.view.auxiliaryCoordinateSystem)\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, this.view.auxiliaryCoordinateSystem.getRotation().rowZ());\r\n\r\n break;\r\n }\r\n }\r\n const globalGeometry = this.view.displayStyle.getGlobalGeometryAndHeightRange();\r\n if (undefined !== globalGeometry) {\r\n const viewZ = this.rotation.getRow(2);\r\n const eyeDepth = this.eyePoint ? viewZ.dotProduct(this.eyePoint) : undefined;\r\n\r\n depthRange = globalGeometry.geometry.getFrustumIntersectionDepthRange(frustum, globalGeometry.heightRange, gridPlane, this.view.maxGlobalScopeFactor > 1);\r\n\r\n if (eyeDepth !== undefined) {\r\n const maxBackgroundFrontBackRatio = 1.0E6;\r\n const frontDist = Math.max(.1, eyeDepth - depthRange.high);\r\n const backDist = eyeDepth - depthRange.low;\r\n if (backDist / frontDist > maxBackgroundFrontBackRatio)\r\n depthRange.high = eyeDepth - backDist / maxBackgroundFrontBackRatio;\r\n }\r\n } else\r\n depthRange = gridPlane ? getFrustumPlaneIntersectionDepthRange(frustum, gridPlane) : Range1d.createNull();\r\n\r\n if (!extents.isNull) {\r\n const viewZ = this.rotation.getRow(2);\r\n const corners = extents.corners();\r\n for (const corner of corners)\r\n depthRange.extendX(viewZ.dotProduct(corner));\r\n }\r\n\r\n if (depthRange.isNull)\r\n return;\r\n\r\n this.rotation.multiplyVectorInPlace(origin); // put origin in view coordinates\r\n origin.z = depthRange.low; // set origin to back of viewed extents\r\n delta.z = Math.max(depthRange.high - depthRange.low, ViewingSpace._minDepth); // and delta to front of viewed extents\r\n this.rotation.multiplyTransposeVectorInPlace(origin);\r\n\r\n if (!view.isCameraOn)\r\n return;\r\n\r\n // if the camera is on, we need to make sure that the viewed volume is not behind the eye\r\n const eyeOrg = this.eyePoint!.minus(origin);\r\n this.rotation.multiplyVectorInPlace(eyeOrg);\r\n\r\n // if the distance from the eye to origin in less than 1 meter, move the origin away from the eye. Usually, this means\r\n // that the camera is outside the viewed extents and pointed away from it. There's nothing to see anyway.\r\n if (eyeOrg.z < 1.0) {\r\n this.rotation.multiplyVectorInPlace(origin);\r\n origin.z -= (2.0 - eyeOrg.z);\r\n this.rotation.multiplyTransposeVectorInPlace(origin);\r\n delta.z = 1.0;\r\n return;\r\n }\r\n\r\n // if part of the viewed extents are behind the eye, don't include that.\r\n if (delta.z > eyeOrg.z)\r\n delta.z = eyeOrg.z;\r\n }\r\n\r\n /* get the mapping from NPC to view\r\n * @internal\r\n */\r\n public calcNpcToView(): Map4d {\r\n const corners = this.getViewCorners();\r\n const map = Map4d.createBoxMap(NpcCorners[Npc._000], NpcCorners[Npc._111], corners.low, corners.high);\r\n\r\n // The map may be undefined if the view rect's width or height is zero.\r\n return undefined === map ? Map4d.createIdentity() : map;\r\n }\r\n\r\n /* Get the extents of this view, in ViewCoordinates, as a Range3d */\r\n public getViewCorners(): Range3d {\r\n const corners = this._viewCorners;\r\n const viewRect = this._viewRect;\r\n corners.high.x = viewRect.right;\r\n corners.low.y = viewRect.bottom; // y's are swapped on the screen!\r\n corners.low.x = 0;\r\n corners.high.y = 0;\r\n corners.low.z = -32767;\r\n corners.high.z = 32767;\r\n return corners;\r\n }\r\n\r\n private constructor(vp: Viewport) {\r\n const view = this._view = vp.view;\r\n const viewRect = vp.viewRect;\r\n this._clientWidth = viewRect.width;\r\n this._clientHeight = viewRect.height;\r\n const origin = view.getOrigin().clone();\r\n const delta = view.getExtents().clone();\r\n this.rotation.setFrom(view.getRotation());\r\n\r\n // first, make sure none of the deltas are negative\r\n delta.x = Math.abs(delta.x);\r\n delta.y = Math.abs(delta.y);\r\n delta.z = Math.abs(delta.z);\r\n\r\n this.viewOriginUnexpanded.setFrom(origin);\r\n this.viewDeltaUnexpanded.setFrom(delta);\r\n this.viewOrigin.setFrom(origin);\r\n this.viewDelta.setFrom(delta);\r\n this.zClipAdjusted = false;\r\n this.eyePoint = undefined;\r\n\r\n if (view.is3d()) {\r\n if (!view.allow3dManipulations()) {\r\n // we're in a \"2d\" view of a physical model. That means that we must have our orientation with z out of the screen with z=0 at the center.\r\n this.alignWithRootZ(); // make sure we're in a z Up view\r\n\r\n const extents = view.getViewedExtents();\r\n if (extents.isNull) {\r\n extents.low.z = Frustum2d.minimumZExtents.low;\r\n extents.high.z = Frustum2d.minimumZExtents.high;\r\n }\r\n\r\n let zMax = Math.max(Math.abs(extents.low.z), Math.abs(extents.high.z));\r\n zMax = Math.max(zMax, 1.0); // make sure we have at least +-1m. Data may be purely planar\r\n delta.z = 2.0 * zMax;\r\n origin.z = -zMax;\r\n } else {\r\n if (view.isCameraOn)\r\n this.validateCamera();\r\n\r\n if (view.isCameraOn)\r\n this.eyePoint = view.camera.getEyePoint().clone();\r\n\r\n this.adjustZPlanes(origin, delta); // make sure view volume includes entire volume of view\r\n\r\n // if the camera is on, don't allow front plane behind camera\r\n if (this.eyePoint) {\r\n const eyeOrg = this.eyePoint.minus(origin); // vector from eye to origin\r\n this.toViewOrientation(eyeOrg);\r\n\r\n const frontDist = eyeOrg.z - delta.z; // front distance is backDist - delta.z\r\n\r\n // allow ViewState to specify a minimum front dist, but in no case less than 6 inches\r\n const minFrontDist = Math.max(15.2 * Constant.oneCentimeter, view.forceMinFrontDist);\r\n if (frontDist < minFrontDist) {\r\n // camera is too close to front plane, move origin away from eye to maintain a minimum front distance.\r\n this.toViewOrientation(origin);\r\n origin.z -= (minFrontDist - frontDist);\r\n this.fromViewOrientation(origin);\r\n }\r\n }\r\n\r\n // if we moved the z planes, set the \"zClipAdjusted\" flag.\r\n if (!origin.isExactEqual(this.viewOriginUnexpanded) || !delta.isExactEqual(this.viewDeltaUnexpanded))\r\n this.zClipAdjusted = true;\r\n }\r\n } else { // 2d viewport\r\n this.alignWithRootZ();\r\n }\r\n\r\n this.viewOrigin.setFrom(origin);\r\n this.viewDelta.setFrom(delta);\r\n\r\n const newRootToNpc = this.view.computeWorldToNpc(this.rotation, origin, delta, !this.view.displayStyle.getIsBackgroundMapVisible() /* if displaying background map, don't enforce front/back ratio as no Z-Buffer */);\r\n if (newRootToNpc.map === undefined) {\r\n this.frustFraction = 0; // invalid frustum\r\n return;\r\n }\r\n\r\n this.worldToNpcMap.setFrom(newRootToNpc.map);\r\n this.frustFraction = newRootToNpc.frustFraction;\r\n this.worldToViewMap.setFrom(this.calcNpcToView().multiplyMapMap(this.worldToNpcMap));\r\n }\r\n\r\n /** Create from a Viewport. */\r\n public static createFromViewport(vp: Viewport): ViewingSpace | undefined {\r\n return new ViewingSpace(vp);\r\n }\r\n\r\n /** Convert an array of points from CoordSystem.View to CoordSystem.Npc */\r\n public viewToNpcArray(pts: Point3d[]): void {\r\n const corners = this.getViewCorners();\r\n const scrToNpcTran = Transform.createIdentity();\r\n Transform.initFromRange(corners.low, corners.high, undefined, scrToNpcTran);\r\n scrToNpcTran.multiplyPoint3dArrayInPlace(pts);\r\n }\r\n\r\n /** Convert an array of points from CoordSystem.Npc to CoordSystem.View */\r\n public npcToViewArray(pts: Point3d[]): void {\r\n const corners = this.getViewCorners();\r\n for (const p of pts)\r\n corners.fractionToPoint(p.x, p.y, p.z, p);\r\n }\r\n\r\n /** Convert a point from CoordSystem.View to CoordSystem.Npc\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public viewToNpc(pt: Point3d, out?: Point3d): Point3d {\r\n const corners = this.getViewCorners();\r\n const scrToNpcTran = Transform.createIdentity();\r\n Transform.initFromRange(corners.low, corners.high, undefined, scrToNpcTran);\r\n return scrToNpcTran.multiplyPoint3d(pt, out);\r\n }\r\n\r\n /** Convert a point from CoordSystem.Npc to CoordSystem.View\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public npcToView(pt: Point3d, out?: Point3d): Point3d {\r\n const corners = this.getViewCorners();\r\n return corners.fractionToPoint(pt.x, pt.y, pt.z, out);\r\n }\r\n\r\n /** Convert an array of points from CoordSystem.World to CoordSystem.Npc */\r\n public worldToNpcArray(pts: Point3d[]): void { this.worldToNpcMap.transform0.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.Npc to CoordSystem.World */\r\n public npcToWorldArray(pts: Point3d[]): void { this.worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.World to CoordSystem.View */\r\n public worldToViewArray(pts: Point3d[]): void { this.worldToViewMap.transform0.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.World to CoordSystem.View, as Point4ds */\r\n public worldToView4dArray(worldPts: Point3d[], viewPts: Point4d[]): void { this.worldToViewMap.transform0.multiplyPoint3dArray(worldPts, viewPts); }\r\n /** Convert an array of points from CoordSystem.View to CoordSystem.World */\r\n public viewToWorldArray(pts: Point3d[]) { this.worldToViewMap.transform1.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.View as Point4ds to CoordSystem.World */\r\n public view4dToWorldArray(viewPts: Point4d[], worldPts: Point3d[]): void { this.worldToViewMap.transform1.multiplyPoint4dArrayQuietRenormalize(viewPts, worldPts); }\r\n\r\n /**\r\n * Convert a point from CoordSystem.World to CoordSystem.Npc\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public worldToNpc(pt: XYAndZ, out?: Point3d): Point3d { return this.worldToNpcMap.transform0.multiplyPoint3dQuietNormalize(pt, out); }\r\n /**\r\n * Convert a point from CoordSystem.Npc to CoordSystem.World\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public npcToWorld(pt: XYAndZ, out?: Point3d): Point3d { return this.worldToNpcMap.transform1.multiplyPoint3dQuietNormalize(pt, out); }\r\n /**\r\n * Convert a point from CoordSystem.World to CoordSystem.View\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public worldToView(input: XYAndZ, out?: Point3d): Point3d { return this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(input, out); }\r\n /**\r\n * Convert a point from CoordSystem.World to CoordSystem.View as Point4d\r\n * @param input the point to convert\r\n * @param out optional location for result. If undefined, a new Point4d is created.\r\n */\r\n public worldToView4d(input: XYAndZ, out?: Point4d): Point4d { return this.worldToViewMap.transform0.multiplyPoint3d(input, 1.0, out); }\r\n /**\r\n * Convert a point from CoordSystem.View to CoordSystem.World\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public viewToWorld(input: XYAndZ, out?: Point3d): Point3d { return this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(input, out); }\r\n /**\r\n * Convert a point from CoordSystem.View as a Point4d to CoordSystem.View\r\n * @param input the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public view4dToWorld(input: Point4d, out?: Point3d): Point3d { return this.worldToViewMap.transform1.multiplyXYZWQuietRenormalize(input.x, input.y, input.z, input.w, out); }\r\n\r\n /** Get an 8-point Frustum corresponding to the 8 corners of the Viewport in the specified coordinate system.\r\n *\r\n * There are two sets of corners that may be of interest.\r\n * The \"adjusted\" box is the one that is computed by examining the \"viewed extents\" and moving\r\n * the front and back planes to enclose everything in the view.\r\n * The \"unadjusted\" box is the one that is stored in the ViewState.\r\n * @param sys Coordinate system for points\r\n * @param adjustedBox If true, retrieve the adjusted box. Otherwise retrieve the box that came from the view definition.\r\n * @param box optional Frustum for return value\r\n * @return the view frustum\r\n * @note The \"adjusted\" box may be either larger or smaller than the \"unadjusted\" box.\r\n */\r\n public getFrustum(sys: CoordSystem = CoordSystem.World, adjustedBox: boolean = true, box?: Frustum): Frustum {\r\n box = box ? box.initNpc() : new Frustum();\r\n\r\n // if they are looking for the \"unexpanded\" (that is before f/b clipping expansion) box, we need to get the npc\r\n // coordinates that correspond to the unexpanded box in the npc space of the Expanded view (that's the basis for all\r\n // of the root-based maps.)\r\n if (!adjustedBox && this.zClipAdjusted) {\r\n // to get unexpanded box, we have to go recompute rootToNpc from original View.\r\n const ueRootToNpc = this.view.computeWorldToNpc(this.rotation, this.viewOriginUnexpanded, this.viewDeltaUnexpanded);\r\n if (undefined === ueRootToNpc.map)\r\n return box; // invalid frustum\r\n\r\n // get the root corners of the unexpanded box\r\n const ueRootBox = new Frustum();\r\n ueRootToNpc.map.transform1.multiplyPoint3dArrayQuietNormalize(ueRootBox.points);\r\n\r\n // and convert them to npc coordinates of the expanded view\r\n this.worldToNpcArray(ueRootBox.points);\r\n box.setFrom(ueRootBox);\r\n }\r\n\r\n // now convert from NPC space to the specified coordinate system.\r\n switch (sys) {\r\n case CoordSystem.View:\r\n this.npcToViewArray(box.points);\r\n break;\r\n\r\n case CoordSystem.World:\r\n this.npcToWorldArray(box.points);\r\n break;\r\n }\r\n return box;\r\n }\r\n\r\n /** @internal */\r\n public getPixelSizeAtPoint(inPoint?: Point3d) {\r\n const viewPt = !!inPoint ? this.worldToView(inPoint) : this.npcToView(new Point3d(0.5, 0.5, 0.5));\r\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\r\n return this.viewToWorld(viewPt).distance(this.viewToWorld(viewPt2));\r\n }\r\n\r\n /** @internal */\r\n public getPreloadFrustum(transformOrScale?: Transform | number, result?: Frustum) {\r\n const viewFrustum = this.getFrustum(CoordSystem.World, true);\r\n\r\n if (transformOrScale && transformOrScale instanceof Transform) {\r\n return viewFrustum.transformBy(transformOrScale, result);\r\n } else {\r\n const scale = transformOrScale === undefined ? 2 : transformOrScale;\r\n const expandedFrustum = viewFrustum.clone(result);\r\n expandedFrustum.scaleXYAboutCenter(scale);\r\n return expandedFrustum;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ViewingSpace.js","sourceRoot":"","sources":["../../src/ViewingSpace.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAE8B;AAC9B,oDAAmF;AACnF,2EAAwE;AACxE,+CAA4C;AAE5C,yCAAsC;AAEtC,2CAAwC;AACxC,mEAAgF;AAEhF;;;;GAIG;AACH,MAAa,YAAY;IAmOvB,YAAoB,EAAY;QAlOf,eAAU,GAAG,IAAI,mBAAQ,EAAE,CAAC,CAAC,mBAAmB;QAChD,iBAAY,GAAG,IAAI,uBAAO,EAAE,CAAC,CAAC,mBAAmB;QAElE,gBAAgB;QACT,kBAAa,GAAG,GAAG,CAAC;QAS3B,wCAAwC;QACxB,eAAU,GAAG,IAAI,uBAAO,EAAE,CAAC;QAC3C,uCAAuC;QACvB,cAAS,GAAG,IAAI,wBAAQ,EAAE,CAAC;QAC3C,+CAA+C;QAC/B,yBAAoB,GAAG,IAAI,uBAAO,EAAE,CAAC;QACrD,8CAA8C;QAC9B,wBAAmB,GAAG,IAAI,wBAAQ,EAAE,CAAC;QACrD,mDAAmD;QACnC,aAAQ,GAAG,IAAI,wBAAQ,EAAE,CAAC;QAC1C,+DAA+D;QAC/C,mBAAc,GAAG,qBAAK,CAAC,cAAc,EAAE,CAAC;QACxD,6FAA6F;QAC7E,kBAAa,GAAG,qBAAK,CAAC,cAAc,EAAE,CAAC;QACvD,gBAAgB;QACA,kBAAa,GAAY,KAAK,CAAC,CAAI,uEAAuE;QAuMxH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QACnC,I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,MAAM,KAAK,GAAG,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;YACpE,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAClD,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC1C,OAAO,eAAe,CAAC;SACxB;IACH,CAAC;;AAldH,oCAmdC;AA7cC;;GAEG;AACW,8BAAiB,GAAG,MAAM,CAAC;AACzC;;GAEG;AACW,2BAAc,GAAG,MAAM,CAAC;AAyFvB,sBAAS,GAAG,CAAC,CAAC,CAAC,qEAAqE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport {\r\n AxisOrder, ClipPlaneContainment, Constant, Map4d, Matrix3d, Plane3dByOriginAndUnitNormal, Point3d, Point4d, Range1d, Range2d, Range3d, Transform, Vector3d, XYAndZ, XYZ,\r\n} from \"@itwin/core-geometry\";\r\nimport { Frustum, GridOrientationType, Npc, NpcCorners } from \"@itwin/core-common\";\r\nimport { ApproximateTerrainHeights } from \"./ApproximateTerrainHeights\";\r\nimport { CoordSystem } from \"./CoordSystem\";\r\nimport { Viewport } from \"./Viewport\";\r\nimport { ViewRect } from \"./ViewRect\";\r\nimport { ViewState } from \"./ViewState\";\r\nimport { Frustum2d } from \"./Frustum2d\";\r\nimport { getFrustumPlaneIntersectionDepthRange } from \"./BackgroundMapGeometry\";\r\n\r\n/** Describes a [[Viewport]]'s viewing volume, plus its size on the screen. A new\r\n * instance of ViewingSpace is created every time the Viewport's frustum changes.\r\n * @see [[Viewport.viewingSpace]].\r\n * @public\r\n */\r\nexport class ViewingSpace {\r\n private readonly _viewRange = new ViewRect(); // scratch variable\r\n private readonly _viewCorners = new Range3d(); // scratch variable\r\n\r\n /** @internal */\r\n public frustFraction = 1.0;\r\n /** Maximum ratio of frontplane to backplane distance for 24 bit non-logarithmic zbuffer\r\n * @internal\r\n */\r\n public static nearScaleNonLog24 = 0.0003;\r\n /** Maximum fraction of frontplane to backplane distance for 24 bit logarithmic zbuffer\r\n * @internal\r\n */\r\n public static nearScaleLog24 = 1.0E-8;\r\n /** View origin, potentially expanded */\r\n public readonly viewOrigin = new Point3d();\r\n /** View delta, potentially expanded */\r\n public readonly viewDelta = new Vector3d();\r\n /** View origin (from ViewState, unexpanded) */\r\n public readonly viewOriginUnexpanded = new Point3d();\r\n /** View delta (from ViewState, unexpanded) */\r\n public readonly viewDeltaUnexpanded = new Vector3d();\r\n /** View rotation matrix (copied from ViewState) */\r\n public readonly rotation = new Matrix3d();\r\n /** Provides conversions between world and view coordinates. */\r\n public readonly worldToViewMap = Map4d.createIdentity();\r\n /** Providers conversions between world and Npc (non-dimensional perspective) coordinates. */\r\n public readonly worldToNpcMap = Map4d.createIdentity();\r\n /** @internal */\r\n public readonly zClipAdjusted: boolean = false; // were the view z clip planes adjusted due to front/back clipping off?\r\n /** Eye point - undefined if not a perspective projection. */\r\n public readonly eyePoint: Point3d | undefined;\r\n\r\n private _view: ViewState;\r\n\r\n /** The ViewState for this Viewport */\r\n public get view(): ViewState { return this._view; }\r\n public set view(view: ViewState) { this._view = view; }\r\n\r\n private readonly _clientWidth: number;\r\n private readonly _clientHeight: number;\r\n\r\n /** Get the rectangle of this Viewport in ViewCoordinates. */\r\n private get _viewRect(): ViewRect { this._viewRange.init(0, 0, this._clientWidth, this._clientHeight); return this._viewRange; }\r\n\r\n private static _copyOutput(from: XYZ, to?: XYZ) { let pt = from; if (to) { to.setFrom(from); pt = to; } return pt; }\r\n\r\n /** @internal */\r\n public toViewOrientation(from: XYZ, to?: XYZ) { this.rotation.multiplyVectorInPlace(ViewingSpace._copyOutput(from, to)); }\r\n /** @internal */\r\n public fromViewOrientation(from: XYZ, to?: XYZ) { this.rotation.multiplyTransposeVectorInPlace(ViewingSpace._copyOutput(from, to)); }\r\n\r\n /** Ensure the rotation matrix for this view is aligns the root z with the view out (i.e. a \"2d view\"). */\r\n private alignWithRootZ() {\r\n const zUp = Vector3d.unitZ();\r\n if (zUp.isAlmostEqual(this.rotation.rowZ()))\r\n return;\r\n const r = this.rotation.transpose();\r\n r.setColumn(2, zUp);\r\n Matrix3d.createRigidFromMatrix3d(r, AxisOrder.ZXY, r);\r\n r.transpose(this.rotation);\r\n this.view.setRotation(this.rotation); // Don't let viewState and viewport rotation be different.\r\n }\r\n\r\n private validateCamera() {\r\n const view = this.view;\r\n if (!view.is3d())\r\n return;\r\n\r\n const camera = view.camera;\r\n camera.validateLens();\r\n if (camera.isFocusValid)\r\n return;\r\n\r\n const vDelta = view.getExtents();\r\n const maxDelta = vDelta.x > vDelta.y ? vDelta.x : vDelta.y;\r\n let focusDistance = maxDelta / (2.0 * Math.tan(camera.getLensAngle().radians / 2.0));\r\n\r\n if (focusDistance < vDelta.z / 2.0)\r\n focusDistance = vDelta.z / 2.0;\r\n\r\n const eyePoint = new Point3d(vDelta.x / 2.0, vDelta.y / 2.0, (vDelta.z / 2.0) + focusDistance);\r\n\r\n this.fromViewOrientation(eyePoint);\r\n eyePoint.plus(view.getOrigin(), eyePoint);\r\n camera.setEyePoint(eyePoint);\r\n camera.setFocusDistance(focusDistance);\r\n }\r\n\r\n /** @internal */\r\n public getTerrainHeightRange(): Range1d | undefined {\r\n const frustum = this.getFrustum()!;\r\n const cartoRange = Range2d.createNull();\r\n for (let i = 0; i < 8; i++) {\r\n const corner = frustum.getCorner(i);\r\n const carto = this.view.iModel.spatialToCartographicFromEcef(corner);\r\n cartoRange.extendXY(carto.longitude, carto.latitude);\r\n }\r\n\r\n return ApproximateTerrainHeights.instance.getMinimumMaximumHeights(cartoRange);\r\n }\r\n\r\n private static _minDepth = 1; // Allowing very small depth will cause frustum calculations to fail.\r\n\r\n /** Adjust the front and back planes to encompass the entire viewed volume */\r\n private adjustZPlanes(origin: Point3d, delta: Vector3d): void {\r\n const view = this.view;\r\n if (!view.is3d()) // only necessary for 3d views\r\n return;\r\n\r\n delta.z = Math.max(delta.z, ViewingSpace._minDepth);\r\n\r\n const extents = view.getViewedExtents();\r\n const frustum = new Frustum();\r\n const worldToNpc = this.view.computeWorldToNpc(this.rotation, this.viewOrigin, this.viewDelta, false).map as Map4d;\r\n\r\n if (worldToNpc === undefined)\r\n return;\r\n\r\n worldToNpc.transform1.multiplyPoint3dArrayQuietNormalize(frustum.points);\r\n const clipPlanes = frustum.getRangePlanes(false, false, 0);\r\n const viewedExtentCorners = extents.corners();\r\n\r\n // Only extend depth to include viewed geometry if it is within the frustum. (if viewing global locations).\r\n if (clipPlanes.classifyPointContainment(viewedExtentCorners, false) === ClipPlaneContainment.StronglyOutside)\r\n extents.setNull();\r\n\r\n let depthRange;\r\n let gridPlane;\r\n if (this.view.viewFlags.grid) {\r\n const gridOrigin = this.view.isSpatialView() ? this.view.iModel.globalOrigin : Point3d.create();\r\n switch(this.view.getGridOrientation()) {\r\n case GridOrientationType.WorldXY:\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, Vector3d.create(0, 0, 1));\r\n break;\r\n case GridOrientationType.WorldYZ:\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, Vector3d.create(1, 0, 0));\r\n break;\r\n case GridOrientationType.WorldXZ:\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, Vector3d.create(0, 1, 0));\r\n break;\r\n\r\n case GridOrientationType.AuxCoord:\r\n if (this.view.auxiliaryCoordinateSystem)\r\n gridPlane = Plane3dByOriginAndUnitNormal.create(gridOrigin, this.view.auxiliaryCoordinateSystem.getRotation().rowZ());\r\n\r\n break;\r\n }\r\n }\r\n const globalGeometry = this.view.displayStyle.getGlobalGeometryAndHeightRange();\r\n if (undefined !== globalGeometry) {\r\n const viewZ = this.rotation.getRow(2);\r\n const eyeDepth = this.eyePoint ? viewZ.dotProduct(this.eyePoint) : undefined;\r\n\r\n depthRange = globalGeometry.geometry.getFrustumIntersectionDepthRange(frustum, extents, globalGeometry.heightRange, gridPlane, this.view.maxGlobalScopeFactor > 1);\r\n\r\n if (eyeDepth !== undefined) {\r\n const maxBackgroundFrontBackRatio = 1.0E6;\r\n const frontDist = Math.max(.1, eyeDepth - depthRange.high);\r\n const backDist = eyeDepth - depthRange.low;\r\n if (backDist / frontDist > maxBackgroundFrontBackRatio)\r\n depthRange.high = eyeDepth - backDist / maxBackgroundFrontBackRatio;\r\n }\r\n } else\r\n depthRange = gridPlane ? getFrustumPlaneIntersectionDepthRange(frustum, gridPlane) : Range1d.createNull();\r\n\r\n if (!extents.isNull) {\r\n const viewZ = this.rotation.getRow(2);\r\n const corners = extents.corners();\r\n for (const corner of corners)\r\n depthRange.extendX(viewZ.dotProduct(corner));\r\n }\r\n\r\n if (depthRange.isNull)\r\n return;\r\n\r\n this.rotation.multiplyVectorInPlace(origin); // put origin in view coordinates\r\n origin.z = depthRange.low; // set origin to back of viewed extents\r\n delta.z = Math.max(depthRange.high - depthRange.low, ViewingSpace._minDepth); // and delta to front of viewed extents\r\n this.rotation.multiplyTransposeVectorInPlace(origin);\r\n\r\n if (!view.isCameraOn)\r\n return;\r\n\r\n // if the camera is on, we need to make sure that the viewed volume is not behind the eye\r\n const eyeOrg = this.eyePoint!.minus(origin);\r\n this.rotation.multiplyVectorInPlace(eyeOrg);\r\n\r\n // if the distance from the eye to origin in less than 1 meter, move the origin away from the eye. Usually, this means\r\n // that the camera is outside the viewed extents and pointed away from it. There's nothing to see anyway.\r\n if (eyeOrg.z < 1.0) {\r\n this.rotation.multiplyVectorInPlace(origin);\r\n origin.z -= (2.0 - eyeOrg.z);\r\n this.rotation.multiplyTransposeVectorInPlace(origin);\r\n delta.z = 1.0;\r\n return;\r\n }\r\n\r\n // if part of the viewed extents are behind the eye, don't include that.\r\n if (delta.z > eyeOrg.z)\r\n delta.z = eyeOrg.z;\r\n }\r\n\r\n /* get the mapping from NPC to view\r\n * @internal\r\n */\r\n public calcNpcToView(): Map4d {\r\n const corners = this.getViewCorners();\r\n const map = Map4d.createBoxMap(NpcCorners[Npc._000], NpcCorners[Npc._111], corners.low, corners.high);\r\n\r\n // The map may be undefined if the view rect's width or height is zero.\r\n return undefined === map ? Map4d.createIdentity() : map;\r\n }\r\n\r\n /* Get the extents of this view, in ViewCoordinates, as a Range3d */\r\n public getViewCorners(): Range3d {\r\n const corners = this._viewCorners;\r\n const viewRect = this._viewRect;\r\n corners.high.x = viewRect.right;\r\n corners.low.y = viewRect.bottom; // y's are swapped on the screen!\r\n corners.low.x = 0;\r\n corners.high.y = 0;\r\n corners.low.z = -32767;\r\n corners.high.z = 32767;\r\n return corners;\r\n }\r\n\r\n private constructor(vp: Viewport) {\r\n const view = this._view = vp.view;\r\n const viewRect = vp.viewRect;\r\n this._clientWidth = viewRect.width;\r\n this._clientHeight = viewRect.height;\r\n const origin = view.getOrigin().clone();\r\n const delta = view.getExtents().clone();\r\n this.rotation.setFrom(view.getRotation());\r\n\r\n // first, make sure none of the deltas are negative\r\n delta.x = Math.abs(delta.x);\r\n delta.y = Math.abs(delta.y);\r\n delta.z = Math.abs(delta.z);\r\n\r\n this.viewOriginUnexpanded.setFrom(origin);\r\n this.viewDeltaUnexpanded.setFrom(delta);\r\n this.viewOrigin.setFrom(origin);\r\n this.viewDelta.setFrom(delta);\r\n this.zClipAdjusted = false;\r\n this.eyePoint = undefined;\r\n\r\n if (view.is3d()) {\r\n if (!view.allow3dManipulations()) {\r\n // we're in a \"2d\" view of a physical model. That means that we must have our orientation with z out of the screen with z=0 at the center.\r\n this.alignWithRootZ(); // make sure we're in a z Up view\r\n\r\n const extents = view.getViewedExtents();\r\n if (extents.isNull) {\r\n extents.low.z = Frustum2d.minimumZExtents.low;\r\n extents.high.z = Frustum2d.minimumZExtents.high;\r\n }\r\n\r\n let zMax = Math.max(Math.abs(extents.low.z), Math.abs(extents.high.z));\r\n zMax = Math.max(zMax, 1.0); // make sure we have at least +-1m. Data may be purely planar\r\n delta.z = 2.0 * zMax;\r\n origin.z = -zMax;\r\n } else {\r\n if (view.isCameraOn)\r\n this.validateCamera();\r\n\r\n if (view.isCameraOn)\r\n this.eyePoint = view.camera.getEyePoint().clone();\r\n\r\n this.adjustZPlanes(origin, delta); // make sure view volume includes entire volume of view\r\n\r\n // if the camera is on, don't allow front plane behind camera\r\n if (this.eyePoint) {\r\n const eyeOrg = this.eyePoint.minus(origin); // vector from eye to origin\r\n this.toViewOrientation(eyeOrg);\r\n\r\n const frontDist = eyeOrg.z - delta.z; // front distance is backDist - delta.z\r\n\r\n // allow ViewState to specify a minimum front dist, but in no case less than 6 inches\r\n const minFrontDist = Math.max(15.2 * Constant.oneCentimeter, view.forceMinFrontDist);\r\n if (frontDist < minFrontDist) {\r\n // camera is too close to front plane, move origin away from eye to maintain a minimum front distance.\r\n this.toViewOrientation(origin);\r\n origin.z -= (minFrontDist - frontDist);\r\n this.fromViewOrientation(origin);\r\n }\r\n }\r\n\r\n // if we moved the z planes, set the \"zClipAdjusted\" flag.\r\n if (!origin.isExactEqual(this.viewOriginUnexpanded) || !delta.isExactEqual(this.viewDeltaUnexpanded))\r\n this.zClipAdjusted = true;\r\n }\r\n } else { // 2d viewport\r\n this.alignWithRootZ();\r\n }\r\n\r\n this.viewOrigin.setFrom(origin);\r\n this.viewDelta.setFrom(delta);\r\n\r\n const newRootToNpc = this.view.computeWorldToNpc(this.rotation, origin, delta, !this.view.displayStyle.getIsBackgroundMapVisible() /* if displaying background map, don't enforce front/back ratio as no Z-Buffer */);\r\n if (newRootToNpc.map === undefined) {\r\n this.frustFraction = 0; // invalid frustum\r\n return;\r\n }\r\n\r\n this.worldToNpcMap.setFrom(newRootToNpc.map);\r\n this.frustFraction = newRootToNpc.frustFraction;\r\n this.worldToViewMap.setFrom(this.calcNpcToView().multiplyMapMap(this.worldToNpcMap));\r\n }\r\n\r\n /** Create from a Viewport. */\r\n public static createFromViewport(vp: Viewport): ViewingSpace | undefined {\r\n return new ViewingSpace(vp);\r\n }\r\n\r\n /** Convert an array of points from CoordSystem.View to CoordSystem.Npc */\r\n public viewToNpcArray(pts: Point3d[]): void {\r\n const corners = this.getViewCorners();\r\n const scrToNpcTran = Transform.createIdentity();\r\n Transform.initFromRange(corners.low, corners.high, undefined, scrToNpcTran);\r\n scrToNpcTran.multiplyPoint3dArrayInPlace(pts);\r\n }\r\n\r\n /** Convert an array of points from CoordSystem.Npc to CoordSystem.View */\r\n public npcToViewArray(pts: Point3d[]): void {\r\n const corners = this.getViewCorners();\r\n for (const p of pts)\r\n corners.fractionToPoint(p.x, p.y, p.z, p);\r\n }\r\n\r\n /** Convert a point from CoordSystem.View to CoordSystem.Npc\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public viewToNpc(pt: Point3d, out?: Point3d): Point3d {\r\n const corners = this.getViewCorners();\r\n const scrToNpcTran = Transform.createIdentity();\r\n Transform.initFromRange(corners.low, corners.high, undefined, scrToNpcTran);\r\n return scrToNpcTran.multiplyPoint3d(pt, out);\r\n }\r\n\r\n /** Convert a point from CoordSystem.Npc to CoordSystem.View\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public npcToView(pt: Point3d, out?: Point3d): Point3d {\r\n const corners = this.getViewCorners();\r\n return corners.fractionToPoint(pt.x, pt.y, pt.z, out);\r\n }\r\n\r\n /** Convert an array of points from CoordSystem.World to CoordSystem.Npc */\r\n public worldToNpcArray(pts: Point3d[]): void { this.worldToNpcMap.transform0.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.Npc to CoordSystem.World */\r\n public npcToWorldArray(pts: Point3d[]): void { this.worldToNpcMap.transform1.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.World to CoordSystem.View */\r\n public worldToViewArray(pts: Point3d[]): void { this.worldToViewMap.transform0.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.World to CoordSystem.View, as Point4ds */\r\n public worldToView4dArray(worldPts: Point3d[], viewPts: Point4d[]): void { this.worldToViewMap.transform0.multiplyPoint3dArray(worldPts, viewPts); }\r\n /** Convert an array of points from CoordSystem.View to CoordSystem.World */\r\n public viewToWorldArray(pts: Point3d[]) { this.worldToViewMap.transform1.multiplyPoint3dArrayQuietNormalize(pts); }\r\n /** Convert an array of points from CoordSystem.View as Point4ds to CoordSystem.World */\r\n public view4dToWorldArray(viewPts: Point4d[], worldPts: Point3d[]): void { this.worldToViewMap.transform1.multiplyPoint4dArrayQuietRenormalize(viewPts, worldPts); }\r\n\r\n /**\r\n * Convert a point from CoordSystem.World to CoordSystem.Npc\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public worldToNpc(pt: XYAndZ, out?: Point3d): Point3d { return this.worldToNpcMap.transform0.multiplyPoint3dQuietNormalize(pt, out); }\r\n /**\r\n * Convert a point from CoordSystem.Npc to CoordSystem.World\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public npcToWorld(pt: XYAndZ, out?: Point3d): Point3d { return this.worldToNpcMap.transform1.multiplyPoint3dQuietNormalize(pt, out); }\r\n /**\r\n * Convert a point from CoordSystem.World to CoordSystem.View\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public worldToView(input: XYAndZ, out?: Point3d): Point3d { return this.worldToViewMap.transform0.multiplyPoint3dQuietNormalize(input, out); }\r\n /**\r\n * Convert a point from CoordSystem.World to CoordSystem.View as Point4d\r\n * @param input the point to convert\r\n * @param out optional location for result. If undefined, a new Point4d is created.\r\n */\r\n public worldToView4d(input: XYAndZ, out?: Point4d): Point4d { return this.worldToViewMap.transform0.multiplyPoint3d(input, 1.0, out); }\r\n /**\r\n * Convert a point from CoordSystem.View to CoordSystem.World\r\n * @param pt the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public viewToWorld(input: XYAndZ, out?: Point3d): Point3d { return this.worldToViewMap.transform1.multiplyPoint3dQuietNormalize(input, out); }\r\n /**\r\n * Convert a point from CoordSystem.View as a Point4d to CoordSystem.View\r\n * @param input the point to convert\r\n * @param out optional location for result. If undefined, a new Point3d is created.\r\n */\r\n public view4dToWorld(input: Point4d, out?: Point3d): Point3d { return this.worldToViewMap.transform1.multiplyXYZWQuietRenormalize(input.x, input.y, input.z, input.w, out); }\r\n\r\n /** Get an 8-point Frustum corresponding to the 8 corners of the Viewport in the specified coordinate system.\r\n *\r\n * There are two sets of corners that may be of interest.\r\n * The \"adjusted\" box is the one that is computed by examining the \"viewed extents\" and moving\r\n * the front and back planes to enclose everything in the view.\r\n * The \"unadjusted\" box is the one that is stored in the ViewState.\r\n * @param sys Coordinate system for points\r\n * @param adjustedBox If true, retrieve the adjusted box. Otherwise retrieve the box that came from the view definition.\r\n * @param box optional Frustum for return value\r\n * @return the view frustum\r\n * @note The \"adjusted\" box may be either larger or smaller than the \"unadjusted\" box.\r\n */\r\n public getFrustum(sys: CoordSystem = CoordSystem.World, adjustedBox: boolean = true, box?: Frustum): Frustum {\r\n box = box ? box.initNpc() : new Frustum();\r\n\r\n // if they are looking for the \"unexpanded\" (that is before f/b clipping expansion) box, we need to get the npc\r\n // coordinates that correspond to the unexpanded box in the npc space of the Expanded view (that's the basis for all\r\n // of the root-based maps.)\r\n if (!adjustedBox && this.zClipAdjusted) {\r\n // to get unexpanded box, we have to go recompute rootToNpc from original View.\r\n const ueRootToNpc = this.view.computeWorldToNpc(this.rotation, this.viewOriginUnexpanded, this.viewDeltaUnexpanded);\r\n if (undefined === ueRootToNpc.map)\r\n return box; // invalid frustum\r\n\r\n // get the root corners of the unexpanded box\r\n const ueRootBox = new Frustum();\r\n ueRootToNpc.map.transform1.multiplyPoint3dArrayQuietNormalize(ueRootBox.points);\r\n\r\n // and convert them to npc coordinates of the expanded view\r\n this.worldToNpcArray(ueRootBox.points);\r\n box.setFrom(ueRootBox);\r\n }\r\n\r\n // now convert from NPC space to the specified coordinate system.\r\n switch (sys) {\r\n case CoordSystem.View:\r\n this.npcToViewArray(box.points);\r\n break;\r\n\r\n case CoordSystem.World:\r\n this.npcToWorldArray(box.points);\r\n break;\r\n }\r\n return box;\r\n }\r\n\r\n /** @internal */\r\n public getPixelSizeAtPoint(inPoint?: Point3d) {\r\n const viewPt = !!inPoint ? this.worldToView(inPoint) : this.npcToView(new Point3d(0.5, 0.5, 0.5));\r\n const viewPt2 = new Point3d(viewPt.x + 1.0, viewPt.y, viewPt.z);\r\n return this.viewToWorld(viewPt).distance(this.viewToWorld(viewPt2));\r\n }\r\n\r\n /** @internal */\r\n public getPreloadFrustum(transformOrScale?: Transform | number, result?: Frustum) {\r\n const viewFrustum = this.getFrustum(CoordSystem.World, true);\r\n\r\n if (transformOrScale && transformOrScale instanceof Transform) {\r\n return viewFrustum.transformBy(transformOrScale, result);\r\n } else {\r\n const scale = transformOrScale === undefined ? 2 : transformOrScale;\r\n const expandedFrustum = viewFrustum.clone(result);\r\n expandedFrustum.scaleXYAboutCenter(scale);\r\n return expandedFrustum;\r\n }\r\n }\r\n}\r\n"]}
@@ -211,4 +211,8 @@ export * from "./RealityDataSource";
211
211
  * APIs for working with user preferences in an iModelApp.
212
212
  * See [the learning articles]($docs/learning/frontend/preferences.md).
213
213
  */
214
+ /**
215
+ * @docs-group-description MapLayers
216
+ * Classes supporting map layers display.
217
+ */
214
218
  //# sourceMappingURL=core-frontend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-frontend.d.ts","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,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c,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG"}
1
+ {"version":3,"file":"core-frontend.d.ts","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAKA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB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cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAEpC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG"}
@@ -227,4 +227,8 @@ __exportStar(require("./RealityDataSource"), exports);
227
227
  * APIs for working with user preferences in an iModelApp.
228
228
  * See [the learning articles]($docs/learning/frontend/preferences.md).
229
229
  */
230
+ /**
231
+ * @docs-group-description MapLayers
232
+ * Classes supporting map layers display.
233
+ */
230
234
  //# sourceMappingURL=core-frontend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,6DAA2C;AAC3C,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,sDAAoC;AACpC,gDAA8B;AAC9B,2DAAyC;AACzC,4DAA0C;AAC1C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAo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AAiC;AACjC,sDAAoC;AACpC,wDAAsC;AACtC,qDAAmC;AACnC,+CAA6B;AAC7B,uDAAqC;AACrC,oDAAkC;AAClC,yDAAuC;AACvC,mDAAiC;AACjC,0DAAwC;AACxC,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,sDAAoC;AAEpC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./RenderScheduleState\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./TwoWayViewportSync\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing runtime [Extensions]($docs/learning/frontend/Extensions.md)\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n\r\n"]}
1
+ {"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,6CAA2B;AAC3B,6CAA2B;AAC3B,gDAA8B;AAC9B,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,0DAAwC;AACxC,gDAA8B;AAC9B,6DAA2C;AAC3C,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,sDAAoC;AACpC,qDAAmC;AACnC,yDAAuC;AACvC,sDAAoC;AACpC,gDAA8B;AAC9B,2DAAyC;AACzC,4DAA0C;AAC1C,kDAAgC;AAChC,2DAAyC;AACzC,sDAAoC;AACpC,8CAA4B;AAC5B,oDAAkC;AAClC,gDAA8B;AAC9B,gDAA8B;AAC9B,kDAAgC;AAChC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,qDAAmC;AACnC,yDAAuC;AACvC,0DAAwC;AACxC,2CAAyB;AACzB,uDAAqC;AACrC,kDAAgC;AAChC,2CAAyB;AACzB,uDAAqC;AACrC,+CAA6B;AAC7B,8CAA4B;AAC5B,oDAAkC;AAClC,gDAA8B;AAC9B,wDAAsC;AACtC,+DAA6C;AAC7C,wDAAsC;AACtC,0EAAwD;AACxD,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;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./RenderScheduleState\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./TwoWayViewportSync\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing runtime [Extensions]($docs/learning/frontend/Extensions.md)\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n\r\n"]}
@@ -131,6 +131,12 @@ export interface GraphicBuilderOptions {
131
131
  * @note Edges will tend to z-fight with their surfaces unless the graphic is [[pickable]].
132
132
  */
133
133
  generateEdges?: boolean;
134
+ /** If defined, specifies a point about which the graphic will rotate such that it always faces the viewer.
135
+ * This can be particular useful for planar regions to create a billboarding effect - e.g., to implement [[Marker]]-like WebGL decorations.
136
+ * The graphic's [[placement]] transform is not applied to the point.
137
+ * @note This has no effect for graphics displayed in a 2d view.
138
+ */
139
+ viewIndependentOrigin?: Point3d;
134
140
  }
135
141
  /** Options for creating a [[GraphicBuilder]] to produce a [[RenderGraphic]] to be displayed in a specific [[Viewport]].
136
142
  * The level of detail of the graphic will be computed from the position of its geometry within the viewport's [Frustum]($common).