@itwin/core-frontend 3.0.0-dev.180 → 3.0.0-dev.184

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 (230) hide show
  1. package/CHANGELOG.md +89 -1
  2. package/lib/cjs/ApproximateTerrainHeights.d.ts.map +1 -1
  3. package/lib/cjs/ApproximateTerrainHeights.js +6 -2
  4. package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
  5. package/lib/cjs/BackgroundMapGeometry.d.ts +1 -1
  6. package/lib/cjs/BackgroundMapGeometry.d.ts.map +1 -1
  7. package/lib/cjs/BackgroundMapGeometry.js +2 -2
  8. package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
  9. package/lib/cjs/BingLocation.js +2 -2
  10. package/lib/cjs/BingLocation.js.map +1 -1
  11. package/lib/cjs/DisplayStyleState.d.ts +9 -3
  12. package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
  13. package/lib/cjs/DisplayStyleState.js +66 -41
  14. package/lib/cjs/DisplayStyleState.js.map +1 -1
  15. package/lib/cjs/FrontendLoggerCategory.d.ts +2 -8
  16. package/lib/cjs/FrontendLoggerCategory.d.ts.map +1 -1
  17. package/lib/cjs/FrontendLoggerCategory.js +2 -8
  18. package/lib/cjs/FrontendLoggerCategory.js.map +1 -1
  19. package/lib/cjs/NativeApp.d.ts +1 -1
  20. package/lib/cjs/NativeApp.d.ts.map +1 -1
  21. package/lib/cjs/NativeApp.js +3 -3
  22. package/lib/cjs/NativeApp.js.map +1 -1
  23. package/lib/cjs/NotificationManager.d.ts +3 -1
  24. package/lib/cjs/NotificationManager.d.ts.map +1 -1
  25. package/lib/cjs/NotificationManager.js +2 -0
  26. package/lib/cjs/NotificationManager.js.map +1 -1
  27. package/lib/cjs/RealityDataSource.js +11 -6
  28. package/lib/cjs/RealityDataSource.js.map +1 -1
  29. package/lib/cjs/ViewContext.js.map +1 -1
  30. package/lib/cjs/ViewCreator2d.js +1 -1
  31. package/lib/cjs/ViewCreator2d.js.map +1 -1
  32. package/lib/cjs/ViewCreator3d.d.ts +1 -1
  33. package/lib/cjs/ViewCreator3d.d.ts.map +1 -1
  34. package/lib/cjs/ViewCreator3d.js +2 -2
  35. package/lib/cjs/ViewCreator3d.js.map +1 -1
  36. package/lib/cjs/ViewingSpace.js +1 -1
  37. package/lib/cjs/ViewingSpace.js.map +1 -1
  38. package/lib/cjs/core-frontend.d.ts +4 -0
  39. package/lib/cjs/core-frontend.d.ts.map +1 -1
  40. package/lib/cjs/core-frontend.js +4 -0
  41. package/lib/cjs/core-frontend.js.map +1 -1
  42. package/lib/cjs/render/GraphicBuilder.d.ts +6 -0
  43. package/lib/cjs/render/GraphicBuilder.d.ts.map +1 -1
  44. package/lib/cjs/render/GraphicBuilder.js.map +1 -1
  45. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
  46. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
  47. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js +2 -1
  48. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  49. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
  50. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js +1 -0
  51. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  52. package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
  53. package/lib/cjs/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
  54. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js +3 -3
  55. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  56. package/lib/cjs/render/webgl/BranchUniforms.d.ts.map +1 -1
  57. package/lib/cjs/render/webgl/BranchUniforms.js +8 -5
  58. package/lib/cjs/render/webgl/BranchUniforms.js.map +1 -1
  59. package/lib/cjs/render/webgl/SolarShadowMap.js +1 -1
  60. package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
  61. package/lib/cjs/render/webgl/System.d.ts +1 -1
  62. package/lib/cjs/request/Request.d.ts +167 -0
  63. package/lib/cjs/request/Request.d.ts.map +1 -0
  64. package/lib/cjs/request/Request.js +315 -0
  65. package/lib/cjs/request/Request.js.map +1 -0
  66. package/lib/cjs/tile/internal.d.ts +1 -0
  67. package/lib/cjs/tile/internal.d.ts.map +1 -1
  68. package/lib/cjs/tile/internal.js +1 -0
  69. package/lib/cjs/tile/internal.js.map +1 -1
  70. package/lib/cjs/tile/map/ArcGISTileMap.d.ts.map +1 -1
  71. package/lib/cjs/tile/map/ArcGISTileMap.js +6 -2
  72. package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
  73. package/lib/cjs/tile/map/ArcGisTokenGenerator.js +3 -3
  74. package/lib/cjs/tile/map/ArcGisTokenGenerator.js.map +1 -1
  75. package/lib/cjs/tile/map/ArcGisUtilities.d.ts +1 -1
  76. package/lib/cjs/tile/map/ArcGisUtilities.d.ts.map +1 -1
  77. package/lib/cjs/tile/map/ArcGisUtilities.js +18 -10
  78. package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
  79. package/lib/cjs/tile/map/BingElevation.js +4 -4
  80. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  81. package/lib/cjs/tile/map/CesiumTerrainProvider.js +3 -3
  82. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  83. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +4 -4
  84. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  85. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js +2 -2
  86. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  87. package/lib/cjs/tile/map/MapLayerAuthentication.d.ts +20 -0
  88. package/lib/cjs/tile/map/MapLayerAuthentication.d.ts.map +1 -0
  89. package/lib/cjs/tile/map/MapLayerAuthentication.js +18 -0
  90. package/lib/cjs/tile/map/MapLayerAuthentication.js.map +1 -0
  91. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts +6 -3
  92. package/lib/cjs/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  93. package/lib/cjs/tile/map/MapLayerFormatRegistry.js +3 -1
  94. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  95. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts +2 -2
  96. package/lib/cjs/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  97. package/lib/cjs/tile/map/MapLayerImageryFormats.js +4 -2
  98. package/lib/cjs/tile/map/MapLayerImageryFormats.js.map +1 -1
  99. package/lib/cjs/tile/map/MapLayerImageryProvider.d.ts +2 -2
  100. package/lib/cjs/tile/map/MapLayerImageryProvider.js +5 -5
  101. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  102. package/lib/cjs/tile/map/MapLayerSources.d.ts +3 -1
  103. package/lib/cjs/tile/map/MapLayerSources.d.ts.map +1 -1
  104. package/lib/cjs/tile/map/MapLayerSources.js +5 -3
  105. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  106. package/lib/cjs/tile/map/MapTileLoader.js +2 -2
  107. package/lib/cjs/tile/map/MapTileLoader.js.map +1 -1
  108. package/lib/cjs/tile/map/TerrainMeshProvider.d.ts +1 -1
  109. package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
  110. package/lib/cjs/tile/map/WmsCapabilities.d.ts +1 -1
  111. package/lib/cjs/tile/map/WmsCapabilities.js +2 -2
  112. package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
  113. package/lib/cjs/tile/map/WmtsCapabilities.d.ts +1 -1
  114. package/lib/cjs/tile/map/WmtsCapabilities.js +2 -2
  115. package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
  116. package/lib/esm/ApproximateTerrainHeights.d.ts.map +1 -1
  117. package/lib/esm/ApproximateTerrainHeights.js +6 -2
  118. package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
  119. package/lib/esm/BackgroundMapGeometry.d.ts +1 -1
  120. package/lib/esm/BackgroundMapGeometry.d.ts.map +1 -1
  121. package/lib/esm/BackgroundMapGeometry.js +2 -2
  122. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  123. package/lib/esm/BingLocation.js +1 -1
  124. package/lib/esm/BingLocation.js.map +1 -1
  125. package/lib/esm/DisplayStyleState.d.ts +9 -3
  126. package/lib/esm/DisplayStyleState.d.ts.map +1 -1
  127. package/lib/esm/DisplayStyleState.js +66 -41
  128. package/lib/esm/DisplayStyleState.js.map +1 -1
  129. package/lib/esm/FrontendLoggerCategory.d.ts +2 -8
  130. package/lib/esm/FrontendLoggerCategory.d.ts.map +1 -1
  131. package/lib/esm/FrontendLoggerCategory.js +2 -8
  132. package/lib/esm/FrontendLoggerCategory.js.map +1 -1
  133. package/lib/esm/NativeApp.d.ts +1 -1
  134. package/lib/esm/NativeApp.d.ts.map +1 -1
  135. package/lib/esm/NativeApp.js +1 -1
  136. package/lib/esm/NativeApp.js.map +1 -1
  137. package/lib/esm/NotificationManager.d.ts +3 -1
  138. package/lib/esm/NotificationManager.d.ts.map +1 -1
  139. package/lib/esm/NotificationManager.js +2 -0
  140. package/lib/esm/NotificationManager.js.map +1 -1
  141. package/lib/esm/RealityDataSource.js +9 -4
  142. package/lib/esm/RealityDataSource.js.map +1 -1
  143. package/lib/esm/ViewContext.js.map +1 -1
  144. package/lib/esm/ViewCreator2d.js +1 -1
  145. package/lib/esm/ViewCreator2d.js.map +1 -1
  146. package/lib/esm/ViewCreator3d.d.ts +1 -1
  147. package/lib/esm/ViewCreator3d.d.ts.map +1 -1
  148. package/lib/esm/ViewCreator3d.js +2 -2
  149. package/lib/esm/ViewCreator3d.js.map +1 -1
  150. package/lib/esm/ViewingSpace.js +1 -1
  151. package/lib/esm/ViewingSpace.js.map +1 -1
  152. package/lib/esm/core-frontend.d.ts +4 -0
  153. package/lib/esm/core-frontend.d.ts.map +1 -1
  154. package/lib/esm/core-frontend.js +4 -0
  155. package/lib/esm/core-frontend.js.map +1 -1
  156. package/lib/esm/render/GraphicBuilder.d.ts +6 -0
  157. package/lib/esm/render/GraphicBuilder.d.ts.map +1 -1
  158. package/lib/esm/render/GraphicBuilder.js.map +1 -1
  159. package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts +2 -0
  160. package/lib/esm/render/primitives/geometry/GeometryAccumulator.d.ts.map +1 -1
  161. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js +2 -1
  162. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  163. package/lib/esm/render/primitives/geometry/GeometryListBuilder.d.ts.map +1 -1
  164. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js +1 -0
  165. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  166. package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts +2 -2
  167. package/lib/esm/render/primitives/mesh/MeshPrimitives.d.ts.map +1 -1
  168. package/lib/esm/render/primitives/mesh/MeshPrimitives.js +3 -3
  169. package/lib/esm/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  170. package/lib/esm/render/webgl/BranchUniforms.d.ts.map +1 -1
  171. package/lib/esm/render/webgl/BranchUniforms.js +8 -5
  172. package/lib/esm/render/webgl/BranchUniforms.js.map +1 -1
  173. package/lib/esm/render/webgl/SolarShadowMap.js +1 -1
  174. package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
  175. package/lib/esm/render/webgl/System.d.ts +1 -1
  176. package/lib/esm/request/Request.d.ts +167 -0
  177. package/lib/esm/request/Request.d.ts.map +1 -0
  178. package/lib/esm/request/Request.js +289 -0
  179. package/lib/esm/request/Request.js.map +1 -0
  180. package/lib/esm/tile/internal.d.ts +1 -0
  181. package/lib/esm/tile/internal.d.ts.map +1 -1
  182. package/lib/esm/tile/internal.js +1 -0
  183. package/lib/esm/tile/internal.js.map +1 -1
  184. package/lib/esm/tile/map/ArcGISTileMap.d.ts.map +1 -1
  185. package/lib/esm/tile/map/ArcGISTileMap.js +6 -2
  186. package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
  187. package/lib/esm/tile/map/ArcGisTokenGenerator.js +1 -1
  188. package/lib/esm/tile/map/ArcGisTokenGenerator.js.map +1 -1
  189. package/lib/esm/tile/map/ArcGisUtilities.d.ts +1 -1
  190. package/lib/esm/tile/map/ArcGisUtilities.d.ts.map +1 -1
  191. package/lib/esm/tile/map/ArcGisUtilities.js +14 -6
  192. package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
  193. package/lib/esm/tile/map/BingElevation.js +1 -1
  194. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  195. package/lib/esm/tile/map/CesiumTerrainProvider.js +1 -1
  196. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  197. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js +1 -1
  198. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  199. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js +1 -1
  200. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  201. package/lib/esm/tile/map/MapLayerAuthentication.d.ts +20 -0
  202. package/lib/esm/tile/map/MapLayerAuthentication.d.ts.map +1 -0
  203. package/lib/esm/tile/map/MapLayerAuthentication.js +15 -0
  204. package/lib/esm/tile/map/MapLayerAuthentication.js.map +1 -0
  205. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts +6 -3
  206. package/lib/esm/tile/map/MapLayerFormatRegistry.d.ts.map +1 -1
  207. package/lib/esm/tile/map/MapLayerFormatRegistry.js +3 -1
  208. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  209. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts +2 -2
  210. package/lib/esm/tile/map/MapLayerImageryFormats.d.ts.map +1 -1
  211. package/lib/esm/tile/map/MapLayerImageryFormats.js +5 -3
  212. package/lib/esm/tile/map/MapLayerImageryFormats.js.map +1 -1
  213. package/lib/esm/tile/map/MapLayerImageryProvider.d.ts +2 -2
  214. package/lib/esm/tile/map/MapLayerImageryProvider.js +2 -2
  215. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  216. package/lib/esm/tile/map/MapLayerSources.d.ts +3 -1
  217. package/lib/esm/tile/map/MapLayerSources.d.ts.map +1 -1
  218. package/lib/esm/tile/map/MapLayerSources.js +4 -2
  219. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  220. package/lib/esm/tile/map/MapTileLoader.js +1 -1
  221. package/lib/esm/tile/map/MapTileLoader.js.map +1 -1
  222. package/lib/esm/tile/map/TerrainMeshProvider.d.ts +1 -1
  223. package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
  224. package/lib/esm/tile/map/WmsCapabilities.d.ts +1 -1
  225. package/lib/esm/tile/map/WmsCapabilities.js +1 -1
  226. package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
  227. package/lib/esm/tile/map/WmtsCapabilities.d.ts +1 -1
  228. package/lib/esm/tile/map/WmtsCapabilities.js +1 -1
  229. package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
  230. package/package.json +28 -22
@@ -1 +1 @@
1
- {"version":3,"file":"ViewCreator2d.js","sourceRoot":"","sources":["../../src/ViewCreator2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH;;;EAGE;AAEF,OAAO,EAAyB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EACkB,IAAI,EAAE,QAAQ,EAAqB,MAAM,EAAE,WAAW,EAAsB,WAAW,EAAE,cAAc,GAE/H,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAA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,CAAC;QACjE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAEnD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,oBAAoB,CAAC,OAAe;QAEhD,MAAM,KAAK,GAAG,gEAAgE,OAAO,EAAE,CAAC;QACxF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAEpD,OAAO,WAAW,CAAC;IACrB,CAAC;;AA3QD,sCAAsC;AACvB,kCAAoB,GAAG,CAAC,iBAAiB,CAAC,aAAa,EAAE,wBAAwB,CAAC,aAAa,CAAC,CAAC;AACjG,gCAAkB,GAAG,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC","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 2D view from a given modelId and modelType (classFullName).\r\nAdditional options (such as background color) can be passed during view creation.\r\n*/\r\n\r\nimport { Id64Array, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n CategorySelectorProps, Code, ColorDef, DisplayStyleProps, IModel, IModelError, ModelSelectorProps, QueryBinder, QueryRowFormat, SheetProps,\r\n ViewDefinition2dProps, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { DrawingViewState } from \"./DrawingViewState\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { DrawingModelState, SectionDrawingModelState, SheetModelState } from \"./ModelState\";\r\nimport { SheetViewState } from \"./SheetViewState\";\r\nimport { ViewState, ViewState2d } from \"./ViewState\";\r\n\r\n/** Options for creating a [[ViewState2d]] via [[ViewCreator2d]].\r\n * @public\r\n*/\r\nexport interface ViewCreator2dOptions {\r\n /** Aspect ratio of [[Viewport]]. Required to fit contents of the model in the initial state of the view. */\r\n vpAspect?: number;\r\n /** Background color of the view (default is white). */\r\n bgColor?: ColorDef;\r\n /** Checks to see if there already is a [[ViewDefinition2d]] for the given modelId. If so, use it as the seed view, and merge its props into the final view created. */\r\n useSeedView?: boolean;\r\n}\r\n\r\n/**\r\n * API for creating a [[ViewState2d]] for a 2D model ([[GeometricModel2dState]]). @see [[ViewCreator3d]] to create a view for a 3d model.\r\n * Example usage:\r\n * ```ts\r\n * const viewCreator = new ViewCreator2d(imodel);\r\n * const models = await imodel.models.queryProps({ from: \"BisCore.GeometricModel2d\" });\r\n * if (models.length > 0)\r\n * const view = await viewCreator.createViewForModel(models[0].id!);\r\n * ```\r\n * @public\r\n */\r\nexport class ViewCreator2d {\r\n\r\n // Types of 2D models the API supports\r\n private static _drawingModelClasses = [DrawingModelState.classFullName, SectionDrawingModelState.classFullName];\r\n private static _sheetModelClasses = [SheetModelState.classFullName];\r\n\r\n /**\r\n * Constructs a ViewCreator2d 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 and returns view for the 2D model id passed in.\r\n * @param modelId Id of the 2D model for the view.\r\n * @param [options] Options for creating the view.\r\n * @throws [IModelError]($common) If modelType is not supported.\r\n */\r\n public async createViewForModel(modelId: Id64String, options?: ViewCreator2dOptions): Promise<ViewState> {\r\n\r\n const baseClassName = await this._getModelBaseClassName(modelId);\r\n\r\n const viewState = await this._createViewState2d(modelId, baseClassName.classFullName, options);\r\n try {\r\n await viewState.load();\r\n } catch { }\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Gets model base class name from id.\r\n * @param modelId of target model.\r\n * @throws [IModelError]($common) if modelId is invalid.\r\n */\r\n private async _getModelBaseClassName(modelId: Id64String): Promise<typeof EntityState> {\r\n\r\n let baseClassName;\r\n\r\n const modelProps = await this._imodel.models.getProps(modelId);\r\n if (modelProps.length > 0) {\r\n const modelType = modelProps[0].classFullName;\r\n baseClassName = await this._imodel.findClassFor(modelType, undefined);\r\n } else\r\n throw new IModelError(IModelStatus.BadModel, \"ViewCreator2d._getModelBaseClassName: modelId is invalid\");\r\n\r\n if (baseClassName === undefined)\r\n throw new IModelError(IModelStatus.WrongClass, \"ViewCreator2d.getViewForModel: modelType is invalid\");\r\n\r\n return baseClassName;\r\n }\r\n\r\n /**\r\n * Creates view from any 2D model type (Drawing/SectionDrawing/Sheet)\r\n * @param modelId of target model.\r\n * @param modelType classFullName of target 2D model.\r\n * @param options for view creation.\r\n * @throws [IModelError]($common) if modelType is not supported.\r\n */\r\n private async _createViewState2d(modelId: Id64String, modelType: string, options?: ViewCreator2dOptions): Promise<ViewState2d> {\r\n let viewState: ViewState2d;\r\n if (this._isDrawingModelClass(modelType)) {\r\n const props = await this._createViewStateProps(modelId, options);\r\n viewState = DrawingViewState.createFromProps(props, this._imodel);\r\n } else if (this._isSheetModelClass(modelType)) {\r\n let props = await this._createViewStateProps(modelId, options);\r\n props = await this._addSheetViewProps(modelId, props);\r\n viewState = SheetViewState.createFromProps(props, this._imodel);\r\n } else\r\n throw new IModelError(IModelStatus.WrongClass, \"ViewCreator2d._createViewState2d: modelType not supported\");\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Checks to see if given model is of [[DrawingModelState]].\r\n * @param modelType classFullName of model.\r\n */\r\n private _isDrawingModelClass(modelType: string) {\r\n if (ViewCreator2d._drawingModelClasses.includes(modelType)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Checks to see if given model is of [[SheetModelState]].\r\n * @param modelType classFullName of model.\r\n */\r\n private _isSheetModelClass(modelType: string) {\r\n if (ViewCreator2d._sheetModelClasses.includes(modelType)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Creates ViewStateProps for the model. ViewStateProps are composed of the 4 sets of Props below.\r\n * @param modelId of target model.\r\n * @param options for view creation.\r\n */\r\n private _createViewStateProps = async (modelId: Id64String, options?: ViewCreator2dOptions): Promise<ViewStateProps> => {\r\n // Use dictionary model in all props\r\n const dictionaryId = IModel.dictionaryId;\r\n const categories = await this._getAllCategories();\r\n\r\n // Get bg color from options or default to white\r\n const bgColor: ColorDef = options?.bgColor ? options.bgColor : ColorDef.white;\r\n\r\n // model extents\r\n const modelProps = await this._imodel.models.queryModelRanges(modelId);\r\n const modelExtents = Range3d.fromJSON(modelProps[0]);\r\n let originX = modelExtents.low.x;\r\n let originY = modelExtents.low.y;\r\n let deltaX = modelExtents.xLength();\r\n let deltaY = modelExtents.yLength();\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 modelSelectorProps: ModelSelectorProps = {\r\n models: [modelId],\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ModelSelector\",\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 viewDefinitionProps: ViewDefinition2dProps = {\r\n baseModelId: modelId,\r\n categorySelectorId: \"\",\r\n displayStyleId: \"\",\r\n origin: { x: originX, y: originY },\r\n delta: { x: deltaX, y: deltaY },\r\n angle: { radians: 0 },\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ViewDefinition2d\",\r\n };\r\n\r\n const displayStyleProps: DisplayStyleProps = {\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:DisplayStyle\",\r\n jsonProperties: {\r\n styles: {\r\n backgroundColor: bgColor.tbgr,\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 modelExtents,\r\n };\r\n\r\n // merge seed view props if needed\r\n return options?.useSeedView ? this._mergeSeedView(modelId, viewStateProps) : viewStateProps;\r\n };\r\n\r\n /**\r\n * Adds Sheet view props to given view props.\r\n * @param modelId of target model.\r\n * @param props input ViewStateProps.\r\n */\r\n private async _addSheetViewProps(modelId: Id64String, props: ViewStateProps) {\r\n let width = 0;\r\n let height = 0;\r\n for await (const row of this._imodel.query(`SELECT Width, Height FROM bis.Sheet WHERE ECInstanceId = ?`, QueryBinder.from([modelId]), { rowFormat: QueryRowFormat.UseJsPropertyNames })) {\r\n width = row.width as number;\r\n height = row.height as number;\r\n break;\r\n }\r\n const sheetProps: SheetProps = {\r\n model: modelId,\r\n code: { spec: \"\", scope: \"\" },\r\n classFullName: \"DrawingSheetModel\",\r\n height,\r\n width,\r\n };\r\n\r\n props.sheetAttachments = await this._getSheetAttachments(modelId);\r\n props.sheetProps = sheetProps;\r\n\r\n return props;\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 2D views for target model.\r\n * @param modelId of target model.\r\n * @param props Input view props to be merged\r\n */\r\n private async _mergeSeedView(modelId: Id64String, props: ViewStateProps): Promise<ViewStateProps> {\r\n const viewDefinitionId = await this._getViewDefinitionsIdForModel(modelId);\r\n // Return incase no viewDefinition found.\r\n if (viewDefinitionId === undefined)\r\n return props;\r\n\r\n const seedViewState = (await this._imodel.views.load(viewDefinitionId));\r\n const seedViewStateProps: ViewStateProps = {\r\n categorySelectorProps: seedViewState.categorySelector.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 ...props.displayStyleProps.jsonProperties!.styles,\r\n };\r\n }\r\n\r\n return { ...seedViewStateProps, ...props, displayStyleProps: mergedDisplayProps };\r\n }\r\n\r\n /**\r\n * Get all view definitions for a given model.\r\n * @param modelId of target model.\r\n */\r\n private async _getViewDefinitionsIdForModel(modelId: Id64String): Promise<Id64String | undefined> {\r\n\r\n const query = `SELECT ECInstanceId from Bis.ViewDefinition2D WHERE BaseModel.Id = ${modelId} AND isPrivate = false LIMIT 1`;\r\n const viewDefinitionsId = await this._executeQuery(query);\r\n\r\n return (viewDefinitionsId.length) > 0 ? viewDefinitionsId[0] : undefined;\r\n }\r\n\r\n /**\r\n * Get all drawing categories\r\n */\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n\r\n const query = \"SELECT ECInstanceId from BisCore.DrawingCategory\";\r\n const categories = await this._executeQuery(query);\r\n\r\n return categories;\r\n }\r\n\r\n /**\r\n * Get all sheet attachments\r\n * @param modelId of target model.\r\n */\r\n private async _getSheetAttachments(modelId: string): Promise<Id64Array> {\r\n\r\n const query = `SELECT ECInstanceId FROM Bis.ViewAttachment WHERE Model.Id = ${modelId}`;\r\n const attachments = await this._executeQuery(query);\r\n\r\n return attachments;\r\n }\r\n\r\n /**\r\n * Helper function to execute ECSql queries.\r\n * @param query statement to execute.\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":"ViewCreator2d.js","sourceRoot":"","sources":["../../src/ViewCreator2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH;;;EAGE;AAEF,O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,OAAO,gCAAgC,CAAC;QAC5H,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE1D,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,iBAAiB;QAE7B,MAAM,KAAK,GAAG,kDAAkD,CAAC;QACjE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAEnD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,oBAAoB,CAAC,OAAe;QAEhD,MAAM,KAAK,GAAG,gEAAgE,OAAO,EAAE,CAAC;QACxF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAEpD,OAAO,WAAW,CAAC;IACrB,CAAC;;AA3QD,sCAAsC;AACvB,kCAAoB,GAAG,CAAC,iBAAiB,CAAC,aAAa,EAAE,wBAAwB,CAAC,aAAa,CAAC,CAAC;AACjG,gCAAkB,GAAG,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC","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 2D view from a given modelId and modelType (classFullName).\r\nAdditional options (such as background color) can be passed during view creation.\r\n*/\r\n\r\nimport { Id64Array, Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n CategorySelectorProps, Code, ColorDef, DisplayStyleProps, IModel, IModelError, ModelSelectorProps, QueryBinder, QueryRowFormat, SheetProps,\r\n ViewDefinition2dProps, ViewStateProps,\r\n} from \"@itwin/core-common\";\r\nimport { Range3d } from \"@itwin/core-geometry\";\r\nimport { DrawingViewState } from \"./DrawingViewState\";\r\nimport { EntityState } from \"./EntityState\";\r\nimport { IModelConnection } from \"./IModelConnection\";\r\nimport { DrawingModelState, SectionDrawingModelState, SheetModelState } from \"./ModelState\";\r\nimport { SheetViewState } from \"./SheetViewState\";\r\nimport { ViewState, ViewState2d } from \"./ViewState\";\r\n\r\n/** Options for creating a [[ViewState2d]] via [[ViewCreator2d]].\r\n * @public\r\n*/\r\nexport interface ViewCreator2dOptions {\r\n /** Aspect ratio of [[Viewport]]. Required to fit contents of the model in the initial state of the view. */\r\n vpAspect?: number;\r\n /** Background color of the view (default is white). */\r\n bgColor?: ColorDef;\r\n /** Checks to see if there already is a [[ViewDefinition2d]] for the given modelId. If so, use it as the seed view, and merge its props into the final view created. */\r\n useSeedView?: boolean;\r\n}\r\n\r\n/**\r\n * API for creating a [[ViewState2d]] for a 2D model ([[GeometricModel2dState]]). @see [[ViewCreator3d]] to create a view for a 3d model.\r\n * Example usage:\r\n * ```ts\r\n * const viewCreator = new ViewCreator2d(imodel);\r\n * const models = await imodel.models.queryProps({ from: \"BisCore.GeometricModel2d\" });\r\n * if (models.length > 0)\r\n * const view = await viewCreator.createViewForModel(models[0].id!);\r\n * ```\r\n * @public\r\n */\r\nexport class ViewCreator2d {\r\n\r\n // Types of 2D models the API supports\r\n private static _drawingModelClasses = [DrawingModelState.classFullName, SectionDrawingModelState.classFullName];\r\n private static _sheetModelClasses = [SheetModelState.classFullName];\r\n\r\n /**\r\n * Constructs a ViewCreator2d 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 and returns view for the 2D model id passed in.\r\n * @param modelId Id of the 2D model for the view.\r\n * @param [options] Options for creating the view.\r\n * @throws [IModelError]($common) If modelType is not supported.\r\n */\r\n public async createViewForModel(modelId: Id64String, options?: ViewCreator2dOptions): Promise<ViewState> {\r\n\r\n const baseClassName = await this._getModelBaseClassName(modelId);\r\n\r\n const viewState = await this._createViewState2d(modelId, baseClassName.classFullName, options);\r\n try {\r\n await viewState.load();\r\n } catch { }\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Gets model base class name from id.\r\n * @param modelId of target model.\r\n * @throws [IModelError]($common) if modelId is invalid.\r\n */\r\n private async _getModelBaseClassName(modelId: Id64String): Promise<typeof EntityState> {\r\n\r\n let baseClassName;\r\n\r\n const modelProps = await this._imodel.models.getProps(modelId);\r\n if (modelProps.length > 0) {\r\n const modelType = modelProps[0].classFullName;\r\n baseClassName = await this._imodel.findClassFor(modelType, undefined);\r\n } else\r\n throw new IModelError(IModelStatus.BadModel, \"ViewCreator2d._getModelBaseClassName: modelId is invalid\");\r\n\r\n if (baseClassName === undefined)\r\n throw new IModelError(IModelStatus.WrongClass, \"ViewCreator2d.getViewForModel: modelType is invalid\");\r\n\r\n return baseClassName;\r\n }\r\n\r\n /**\r\n * Creates view from any 2D model type (Drawing/SectionDrawing/Sheet)\r\n * @param modelId of target model.\r\n * @param modelType classFullName of target 2D model.\r\n * @param options for view creation.\r\n * @throws [IModelError]($common) if modelType is not supported.\r\n */\r\n private async _createViewState2d(modelId: Id64String, modelType: string, options?: ViewCreator2dOptions): Promise<ViewState2d> {\r\n let viewState: ViewState2d;\r\n if (this._isDrawingModelClass(modelType)) {\r\n const props = await this._createViewStateProps(modelId, options);\r\n viewState = DrawingViewState.createFromProps(props, this._imodel);\r\n } else if (this._isSheetModelClass(modelType)) {\r\n let props = await this._createViewStateProps(modelId, options);\r\n props = await this._addSheetViewProps(modelId, props);\r\n viewState = SheetViewState.createFromProps(props, this._imodel);\r\n } else\r\n throw new IModelError(IModelStatus.WrongClass, \"ViewCreator2d._createViewState2d: modelType not supported\");\r\n\r\n return viewState;\r\n }\r\n\r\n /**\r\n * Checks to see if given model is of [[DrawingModelState]].\r\n * @param modelType classFullName of model.\r\n */\r\n private _isDrawingModelClass(modelType: string) {\r\n if (ViewCreator2d._drawingModelClasses.includes(modelType)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Checks to see if given model is of [[SheetModelState]].\r\n * @param modelType classFullName of model.\r\n */\r\n private _isSheetModelClass(modelType: string) {\r\n if (ViewCreator2d._sheetModelClasses.includes(modelType)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Creates ViewStateProps for the model. ViewStateProps are composed of the 4 sets of Props below.\r\n * @param modelId of target model.\r\n * @param options for view creation.\r\n */\r\n private _createViewStateProps = async (modelId: Id64String, options?: ViewCreator2dOptions): Promise<ViewStateProps> => {\r\n // Use dictionary model in all props\r\n const dictionaryId = IModel.dictionaryId;\r\n const categories = await this._getAllCategories();\r\n\r\n // Get bg color from options or default to white\r\n const bgColor: ColorDef = options?.bgColor ? options.bgColor : ColorDef.white;\r\n\r\n // model extents\r\n const modelProps = await this._imodel.models.queryModelRanges(modelId);\r\n const modelExtents = Range3d.fromJSON(modelProps[0]);\r\n let originX = modelExtents.low.x;\r\n let originY = modelExtents.low.y;\r\n let deltaX = modelExtents.xLength();\r\n let deltaY = modelExtents.yLength();\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 modelSelectorProps: ModelSelectorProps = {\r\n models: [modelId],\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ModelSelector\",\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 viewDefinitionProps: ViewDefinition2dProps = {\r\n baseModelId: modelId,\r\n categorySelectorId: \"\",\r\n displayStyleId: \"\",\r\n origin: { x: originX, y: originY },\r\n delta: { x: deltaX, y: deltaY },\r\n angle: { radians: 0 },\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:ViewDefinition2d\",\r\n };\r\n\r\n const displayStyleProps: DisplayStyleProps = {\r\n code: Code.createEmpty(),\r\n model: dictionaryId,\r\n classFullName: \"BisCore:DisplayStyle2d\",\r\n jsonProperties: {\r\n styles: {\r\n backgroundColor: bgColor.tbgr,\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 modelExtents,\r\n };\r\n\r\n // merge seed view props if needed\r\n return options?.useSeedView ? this._mergeSeedView(modelId, viewStateProps) : viewStateProps;\r\n };\r\n\r\n /**\r\n * Adds Sheet view props to given view props.\r\n * @param modelId of target model.\r\n * @param props input ViewStateProps.\r\n */\r\n private async _addSheetViewProps(modelId: Id64String, props: ViewStateProps) {\r\n let width = 0;\r\n let height = 0;\r\n for await (const row of this._imodel.query(`SELECT Width, Height FROM bis.Sheet WHERE ECInstanceId = ?`, QueryBinder.from([modelId]), { rowFormat: QueryRowFormat.UseJsPropertyNames })) {\r\n width = row.width as number;\r\n height = row.height as number;\r\n break;\r\n }\r\n const sheetProps: SheetProps = {\r\n model: modelId,\r\n code: { spec: \"\", scope: \"\" },\r\n classFullName: \"DrawingSheetModel\",\r\n height,\r\n width,\r\n };\r\n\r\n props.sheetAttachments = await this._getSheetAttachments(modelId);\r\n props.sheetProps = sheetProps;\r\n\r\n return props;\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 2D views for target model.\r\n * @param modelId of target model.\r\n * @param props Input view props to be merged\r\n */\r\n private async _mergeSeedView(modelId: Id64String, props: ViewStateProps): Promise<ViewStateProps> {\r\n const viewDefinitionId = await this._getViewDefinitionsIdForModel(modelId);\r\n // Return incase no viewDefinition found.\r\n if (viewDefinitionId === undefined)\r\n return props;\r\n\r\n const seedViewState = (await this._imodel.views.load(viewDefinitionId));\r\n const seedViewStateProps: ViewStateProps = {\r\n categorySelectorProps: seedViewState.categorySelector.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 ...props.displayStyleProps.jsonProperties!.styles,\r\n };\r\n }\r\n\r\n return { ...seedViewStateProps, ...props, displayStyleProps: mergedDisplayProps };\r\n }\r\n\r\n /**\r\n * Get all view definitions for a given model.\r\n * @param modelId of target model.\r\n */\r\n private async _getViewDefinitionsIdForModel(modelId: Id64String): Promise<Id64String | undefined> {\r\n\r\n const query = `SELECT ECInstanceId from Bis.ViewDefinition2D WHERE BaseModel.Id = ${modelId} AND isPrivate = false LIMIT 1`;\r\n const viewDefinitionsId = await this._executeQuery(query);\r\n\r\n return (viewDefinitionsId.length) > 0 ? viewDefinitionsId[0] : undefined;\r\n }\r\n\r\n /**\r\n * Get all drawing categories\r\n */\r\n private async _getAllCategories(): Promise<Id64Array> {\r\n\r\n const query = \"SELECT ECInstanceId from BisCore.DrawingCategory\";\r\n const categories = await this._executeQuery(query);\r\n\r\n return categories;\r\n }\r\n\r\n /**\r\n * Get all sheet attachments\r\n * @param modelId of target model.\r\n */\r\n private async _getSheetAttachments(modelId: string): Promise<Id64Array> {\r\n\r\n const query = `SELECT ECInstanceId FROM Bis.ViewAttachment WHERE Model.Id = ${modelId}`;\r\n const attachments = await this._executeQuery(query);\r\n\r\n return attachments;\r\n }\r\n\r\n /**\r\n * Helper function to execute ECSql queries.\r\n * @param query statement to execute.\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"]}
@@ -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,qBAAa,aAAa;IAMZ,OAAO,CAAC,OAAO;IAJ3B;;;OAGG;gBACiB,OAAO,EAAE,gBAAgB;IAE7C;;;;;OAKG;IACU,iBAAiB,CAAC,OAAO,CAAC,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,UAAU,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G;IACH,OAAO,CAAC,aAAa,CAMnB;CACH"}
@@ -103,7 +103,7 @@ export class ViewCreator3d {
103
103
  classFullName: "BisCore:ModelSelector",
104
104
  };
105
105
  const cameraData = new Camera();
106
- const cameraOn = (options === null || options === void 0 ? void 0 : options.cameraOn) ? options.cameraOn : false;
106
+ const cameraOn = (options === null || options === void 0 ? void 0 : options.cameraOn) !== false;
107
107
  const viewDefinitionProps = {
108
108
  categorySelectorId: "",
109
109
  displayStyleId: "",
@@ -122,7 +122,7 @@ export class ViewCreator3d {
122
122
  const displayStyleProps = {
123
123
  code: Code.createEmpty(),
124
124
  model: dictionaryId,
125
- classFullName: "BisCore:DisplayStyle",
125
+ classFullName: "BisCore:DisplayStyle3d",
126
126
  jsonProperties: {
127
127
  styles: {
128
128
  viewflags: {
@@ -1 +1 @@
1
- {"version":3,"file":"ViewCreator3d.js","sourceRoot":"","sources":["../../src/ViewCreator3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAY/F,OAAO,EACL,MAAM,EAAyB,IAAI,EAAuB,WAAW,EAAE,MAAM,EAAE,sBAAsB,EAAsB,cAAc,EACzI,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAkBtD;;;;;;;;GAQG;AACH,MAAM,OAAO,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,cAAc,CAAC,kBAAkB,EAAE,CAAC;gBAC5G,IAAI,CAAC,IAAI,CA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,CAAC;gBAC9B,OAAO,SAAS,CAAC;YAEnB,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9B;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,iBAAiB;QAC7B,4CAA4C;QAC5C,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","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,OAAO,EACL,MAAM,EAAyB,IAAI,EAAuB,WAAW,EAAE,MAAM,EAAE,sBAAsB,EAAsB,cAAc,EACzI,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAkBtD;;;;;;;;GAQG;AACH,MAAM,OAAO,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,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,CAAC,MAAM,KAAK,CAAC;gBAC9B,OAAO,SAAS,CAAC;YAEnB,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9B;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,iBAAiB;QAC7B,4CAA4C;QAC5C,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","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:DisplayStyle3d\",\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"]}
@@ -204,7 +204,7 @@ export class ViewingSpace {
204
204
  if (undefined !== globalGeometry) {
205
205
  const viewZ = this.rotation.getRow(2);
206
206
  const eyeDepth = this.eyePoint ? viewZ.dotProduct(this.eyePoint) : undefined;
207
- depthRange = globalGeometry.geometry.getFrustumIntersectionDepthRange(frustum, globalGeometry.heightRange, gridPlane, this.view.maxGlobalScopeFactor > 1);
207
+ depthRange = globalGeometry.geometry.getFrustumIntersectionDepthRange(frustum, extents, globalGeometry.heightRange, gridPlane, this.view.maxGlobalScopeFactor > 1);
208
208
  if (eyeDepth !== undefined) {
209
209
  const maxBackgroundFrontBackRatio = 1.0E6;
210
210
  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,OAAO,EACL,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,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W,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;;AA5cD;;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,OAAO,EACL,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,4BAA4B,EAAE,OAAO,EAAW,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,GAC3J,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,yBAAyB,EAA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C,CAAC;YAClD,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC1C,OAAO,eAAe,CAAC;SACxB;IACH,CAAC;;AA5cD;;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,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,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,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,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AAC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iB,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"}
@@ -215,4 +215,8 @@ export * from "./RealityDataSource";
215
215
  * APIs for working with user preferences in an iModelApp.
216
216
  * See [the learning articles]($docs/learning/frontend/preferences.md).
217
217
  */
218
+ /**
219
+ * @docs-group-description MapLayers
220
+ * Classes supporting map layers display.
221
+ */
218
222
  //# 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,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,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,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Ac,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","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,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,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAA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AIG;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","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).
@@ -1 +1 @@
1
- {"version":3,"file":"GraphicBuilder.d.ts","sourceRoot":"","sources":["../../../src/render/GraphicBuilder.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EACrG,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAO,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE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