@itwin/core-frontend 4.0.0-dev.80 → 4.0.0-dev.82

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 (811) hide show
  1. package/lib/cjs/AccuDraw.js.map +1 -1
  2. package/lib/cjs/AccuSnap.js.map +1 -1
  3. package/lib/cjs/ApproximateTerrainHeights.js.map +1 -1
  4. package/lib/cjs/ApproximateTerrainHeightsProps.js.map +1 -1
  5. package/lib/cjs/AuxCoordSys.js.map +1 -1
  6. package/lib/cjs/BackgroundMapGeometry.js.map +1 -1
  7. package/lib/cjs/BingLocation.js.map +1 -1
  8. package/lib/cjs/BriefcaseConnection.js.map +1 -1
  9. package/lib/cjs/BriefcaseTxns.js.map +1 -1
  10. package/lib/cjs/CategorySelectorState.js.map +1 -1
  11. package/lib/cjs/ChangeFlags.js.map +1 -1
  12. package/lib/cjs/CheckpointConnection.js.map +1 -1
  13. package/lib/cjs/CoordSystem.js.map +1 -1
  14. package/lib/cjs/DecorationsCache.js.map +1 -1
  15. package/lib/cjs/DevTools.js.map +1 -1
  16. package/lib/cjs/DisplayStyleState.js.map +1 -1
  17. package/lib/cjs/DrawingViewState.js +5 -5
  18. package/lib/cjs/DrawingViewState.js.map +1 -1
  19. package/lib/cjs/ElementLocateManager.js.map +1 -1
  20. package/lib/cjs/EmphasizeElements.js.map +1 -1
  21. package/lib/cjs/EntityState.js.map +1 -1
  22. package/lib/cjs/EnvironmentDecorations.js.map +1 -1
  23. package/lib/cjs/FeatureOverrideProvider.js.map +1 -1
  24. package/lib/cjs/FlashSettings.js.map +1 -1
  25. package/lib/cjs/FrontendHubAccess.js.map +1 -1
  26. package/lib/cjs/FrontendLoggerCategory.js.map +1 -1
  27. package/lib/cjs/Frustum2d.js.map +1 -1
  28. package/lib/cjs/FrustumAnimator.js.map +1 -1
  29. package/lib/cjs/FuzzySearch.js.map +1 -1
  30. package/lib/cjs/GeoServices.js.map +1 -1
  31. package/lib/cjs/GlobeAnimator.js.map +1 -1
  32. package/lib/cjs/GraphicalEditingScope.js.map +1 -1
  33. package/lib/cjs/HitDetail.js.map +1 -1
  34. package/lib/cjs/IModelApp.js.map +1 -1
  35. package/lib/cjs/IModelConnection.js +23 -23
  36. package/lib/cjs/IModelConnection.js.map +1 -1
  37. package/lib/cjs/IModelRoutingContext.js.map +1 -1
  38. package/lib/cjs/IModeljs-css.js +133 -133
  39. package/lib/cjs/IModeljs-css.js.map +1 -1
  40. package/lib/cjs/ImageUtil.js.map +1 -1
  41. package/lib/cjs/IpcApp.js.map +1 -1
  42. package/lib/cjs/LinePlaneIntersect.js.map +1 -1
  43. package/lib/cjs/LocalhostIpcApp.js.map +1 -1
  44. package/lib/cjs/MarginPercent.js.map +1 -1
  45. package/lib/cjs/Marker.js.map +1 -1
  46. package/lib/cjs/ModelSelectorState.js.map +1 -1
  47. package/lib/cjs/NativeApp.js.map +1 -1
  48. package/lib/cjs/NativeAppLogger.js.map +1 -1
  49. package/lib/cjs/NoRenderApp.js.map +1 -1
  50. package/lib/cjs/NotificationManager.js.map +1 -1
  51. package/lib/cjs/PerModelCategoryVisibility.js.map +1 -1
  52. package/lib/cjs/PlanarClipMaskState.js.map +1 -1
  53. package/lib/cjs/RealityDataSource.js.map +1 -1
  54. package/lib/cjs/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  55. package/lib/cjs/RealityDataSourceContextShareImpl.js.map +1 -1
  56. package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  57. package/lib/cjs/SelectionSet.js.map +1 -1
  58. package/lib/cjs/SheetViewState.js.map +1 -1
  59. package/lib/cjs/SpatialViewState.js.map +1 -1
  60. package/lib/cjs/Sprites.js.map +1 -1
  61. package/lib/cjs/StandardView.js.map +1 -1
  62. package/lib/cjs/SubCategoriesCache.js.map +1 -1
  63. package/lib/cjs/TentativePoint.js.map +1 -1
  64. package/lib/cjs/Tiles.js.map +1 -1
  65. package/lib/cjs/UserPreferences.js.map +1 -1
  66. package/lib/cjs/ViewAnimation.js.map +1 -1
  67. package/lib/cjs/ViewContext.js.map +1 -1
  68. package/lib/cjs/ViewCreator2d.js.map +1 -1
  69. package/lib/cjs/ViewCreator3d.js.map +1 -1
  70. package/lib/cjs/ViewGlobalLocation.js.map +1 -1
  71. package/lib/cjs/ViewManager.js.map +1 -1
  72. package/lib/cjs/ViewPose.js.map +1 -1
  73. package/lib/cjs/ViewRect.js.map +1 -1
  74. package/lib/cjs/ViewState.js.map +1 -1
  75. package/lib/cjs/ViewStatus.js.map +1 -1
  76. package/lib/cjs/ViewingSpace.js.map +1 -1
  77. package/lib/cjs/Viewport.js.map +1 -1
  78. package/lib/cjs/ViewportSync.js.map +1 -1
  79. package/lib/cjs/WebWorkerManager.js.map +1 -1
  80. package/lib/cjs/core-frontend.js.map +1 -1
  81. package/lib/cjs/extension/Extension.js.map +1 -1
  82. package/lib/cjs/extension/ExtensionAdmin.js.map +1 -1
  83. package/lib/cjs/extension/ExtensionHost.js.map +1 -1
  84. package/lib/cjs/extension/ExtensionImpl.js.map +1 -1
  85. package/lib/cjs/extension/ExtensionRuntime.js.map +1 -1
  86. package/lib/cjs/extension/providers/ExtensionLoadScript.js.map +1 -1
  87. package/lib/cjs/extension/providers/LocalExtensionProvider.js.map +1 -1
  88. package/lib/cjs/extension/providers/RemoteExtensionProvider.js.map +1 -1
  89. package/lib/cjs/gltf/GltfModel.js.map +1 -1
  90. package/lib/cjs/gltf/GltfParser.js.map +1 -1
  91. package/lib/cjs/gltf/GltfSchema.js.map +1 -1
  92. package/lib/cjs/properties/AngleDescription.js.map +1 -1
  93. package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
  94. package/lib/cjs/properties/LengthDescription.js.map +1 -1
  95. package/lib/cjs/public/scripts/checkbrowser.js +24 -24
  96. package/lib/cjs/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
  97. package/lib/cjs/quantity-formatting/BasicUnitsProvider.js.map +1 -1
  98. package/lib/cjs/quantity-formatting/LocalUnitFormatProvider.js.map +1 -1
  99. package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
  100. package/lib/cjs/quantity-formatting/QuantityTypesEditorSpecs.js.map +1 -1
  101. package/lib/cjs/quantity-formatting/UnitsData.js.map +1 -1
  102. package/lib/cjs/render/CanvasDecoration.js.map +1 -1
  103. package/lib/cjs/render/Decorations.js.map +1 -1
  104. package/lib/cjs/render/FeatureSymbology.js.map +1 -1
  105. package/lib/cjs/render/FrameStats.js.map +1 -1
  106. package/lib/cjs/render/GraphicBranch.js.map +1 -1
  107. package/lib/cjs/render/GraphicBuilder.js.map +1 -1
  108. package/lib/cjs/render/GraphicPrimitive.js.map +1 -1
  109. package/lib/cjs/render/InstancedGraphicParams.js.map +1 -1
  110. package/lib/cjs/render/MockRender.js.map +1 -1
  111. package/lib/cjs/render/ParticleCollectionBuilder.js.map +1 -1
  112. package/lib/cjs/render/Pixel.js.map +1 -1
  113. package/lib/cjs/render/RealityMeshGraphicParams.js.map +1 -1
  114. package/lib/cjs/render/RealityMeshParams.js.map +1 -1
  115. package/lib/cjs/render/RenderClipVolume.js.map +1 -1
  116. package/lib/cjs/render/RenderGraphic.js.map +1 -1
  117. package/lib/cjs/render/RenderMaterial.js.map +1 -1
  118. package/lib/cjs/render/RenderMemory.js.map +1 -1
  119. package/lib/cjs/render/RenderPlan.js.map +1 -1
  120. package/lib/cjs/render/RenderPlanarClassifier.js.map +1 -1
  121. package/lib/cjs/render/RenderSystem.js.map +1 -1
  122. package/lib/cjs/render/RenderTarget.js.map +1 -1
  123. package/lib/cjs/render/RenderTexture.js.map +1 -1
  124. package/lib/cjs/render/Scene.js.map +1 -1
  125. package/lib/cjs/render/ScreenSpaceEffectBuilder.js.map +1 -1
  126. package/lib/cjs/render/UpsampleRealityMeshParams.js.map +1 -1
  127. package/lib/cjs/render/VisibleFeature.js.map +1 -1
  128. package/lib/cjs/render/primitives/AuxChannelTable.js.map +1 -1
  129. package/lib/cjs/render/primitives/ColorMap.js.map +1 -1
  130. package/lib/cjs/render/primitives/DisplayParams.js.map +1 -1
  131. package/lib/cjs/render/primitives/EdgeParams.js.map +1 -1
  132. package/lib/cjs/render/primitives/PointCloudPrimitive.js.map +1 -1
  133. package/lib/cjs/render/primitives/PointStringParams.js.map +1 -1
  134. package/lib/cjs/render/primitives/Polyface.js.map +1 -1
  135. package/lib/cjs/render/primitives/PolylineParams.js.map +1 -1
  136. package/lib/cjs/render/primitives/Primitives.js.map +1 -1
  137. package/lib/cjs/render/primitives/Strokes.js.map +1 -1
  138. package/lib/cjs/render/primitives/SurfaceParams.js.map +1 -1
  139. package/lib/cjs/render/primitives/VertexKey.js.map +1 -1
  140. package/lib/cjs/render/primitives/VertexTable.js.map +1 -1
  141. package/lib/cjs/render/primitives/VertexTableSplitter.js.map +1 -1
  142. package/lib/cjs/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  143. package/lib/cjs/render/primitives/geometry/GeometryList.js.map +1 -1
  144. package/lib/cjs/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  145. package/lib/cjs/render/primitives/geometry/GeometryPrimitives.js.map +1 -1
  146. package/lib/cjs/render/primitives/mesh/MeshBuilder.js.map +1 -1
  147. package/lib/cjs/render/primitives/mesh/MeshBuilderMap.js.map +1 -1
  148. package/lib/cjs/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  149. package/lib/cjs/render/webgl/AtmosphereUniforms.js.map +1 -1
  150. package/lib/cjs/render/webgl/AttributeBuffers.js.map +1 -1
  151. package/lib/cjs/render/webgl/AttributeMap.js.map +1 -1
  152. package/lib/cjs/render/webgl/BackgroundMapDrape.js.map +1 -1
  153. package/lib/cjs/render/webgl/BatchState.js.map +1 -1
  154. package/lib/cjs/render/webgl/BatchUniforms.js.map +1 -1
  155. package/lib/cjs/render/webgl/BranchStack.js.map +1 -1
  156. package/lib/cjs/render/webgl/BranchState.js.map +1 -1
  157. package/lib/cjs/render/webgl/BranchUniforms.js.map +1 -1
  158. package/lib/cjs/render/webgl/CachedGeometry.js.map +1 -1
  159. package/lib/cjs/render/webgl/ClipStack.js.map +1 -1
  160. package/lib/cjs/render/webgl/ClipVolume.js.map +1 -1
  161. package/lib/cjs/render/webgl/ClippingProgram.js.map +1 -1
  162. package/lib/cjs/render/webgl/ColorInfo.js.map +1 -1
  163. package/lib/cjs/render/webgl/Diagnostics.js.map +1 -1
  164. package/lib/cjs/render/webgl/Disposable.js.map +1 -1
  165. package/lib/cjs/render/webgl/DrawCommand.js.map +1 -1
  166. package/lib/cjs/render/webgl/EDL.js.map +1 -1
  167. package/lib/cjs/render/webgl/EdgeGeometry.js.map +1 -1
  168. package/lib/cjs/render/webgl/EdgeSettings.js.map +1 -1
  169. package/lib/cjs/render/webgl/FeatureOverrides.js.map +1 -1
  170. package/lib/cjs/render/webgl/FloatRGBA.js.map +1 -1
  171. package/lib/cjs/render/webgl/FrameBuffer.js.map +1 -1
  172. package/lib/cjs/render/webgl/FrustumUniforms.js.map +1 -1
  173. package/lib/cjs/render/webgl/GL.js.map +1 -1
  174. package/lib/cjs/render/webgl/GLTimer.js.map +1 -1
  175. package/lib/cjs/render/webgl/Graphic.js.map +1 -1
  176. package/lib/cjs/render/webgl/HiliteUniforms.js.map +1 -1
  177. package/lib/cjs/render/webgl/IModelFrameLifecycle.js.map +1 -1
  178. package/lib/cjs/render/webgl/IndexedEdgeGeometry.js.map +1 -1
  179. package/lib/cjs/render/webgl/InstancedGeometry.js.map +1 -1
  180. package/lib/cjs/render/webgl/Layer.js.map +1 -1
  181. package/lib/cjs/render/webgl/LayerCommands.js.map +1 -1
  182. package/lib/cjs/render/webgl/LightingUniforms.js.map +1 -1
  183. package/lib/cjs/render/webgl/LineCode.js.map +1 -1
  184. package/lib/cjs/render/webgl/Material.js.map +1 -1
  185. package/lib/cjs/render/webgl/Matrix.js.map +1 -1
  186. package/lib/cjs/render/webgl/Mesh.js.map +1 -1
  187. package/lib/cjs/render/webgl/MeshData.js.map +1 -1
  188. package/lib/cjs/render/webgl/MeshGeometry.js.map +1 -1
  189. package/lib/cjs/render/webgl/PerformanceMetrics.js.map +1 -1
  190. package/lib/cjs/render/webgl/PlanarClassifier.js.map +1 -1
  191. package/lib/cjs/render/webgl/PlanarGrid.js.map +1 -1
  192. package/lib/cjs/render/webgl/PlanarTextureProjection.js.map +1 -1
  193. package/lib/cjs/render/webgl/PointCloud.js.map +1 -1
  194. package/lib/cjs/render/webgl/PointString.js.map +1 -1
  195. package/lib/cjs/render/webgl/Polyline.js.map +1 -1
  196. package/lib/cjs/render/webgl/Primitive.js.map +1 -1
  197. package/lib/cjs/render/webgl/RealityMesh.js.map +1 -1
  198. package/lib/cjs/render/webgl/RealityModelUniforms.js.map +1 -1
  199. package/lib/cjs/render/webgl/RenderBuffer.js.map +1 -1
  200. package/lib/cjs/render/webgl/RenderCommands.js.map +1 -1
  201. package/lib/cjs/render/webgl/RenderFlags.js.map +1 -1
  202. package/lib/cjs/render/webgl/RenderState.js.map +1 -1
  203. package/lib/cjs/render/webgl/SceneCompositor.js.map +1 -1
  204. package/lib/cjs/render/webgl/ScratchDrawParams.js.map +1 -1
  205. package/lib/cjs/render/webgl/ScreenSpaceEffect.js.map +1 -1
  206. package/lib/cjs/render/webgl/ShaderBuilder.js.map +1 -1
  207. package/lib/cjs/render/webgl/ShaderProgram.js.map +1 -1
  208. package/lib/cjs/render/webgl/ShadowUniforms.js.map +1 -1
  209. package/lib/cjs/render/webgl/SolarShadowMap.js.map +1 -1
  210. package/lib/cjs/render/webgl/StyleUniforms.js.map +1 -1
  211. package/lib/cjs/render/webgl/SurfaceGeometry.js.map +1 -1
  212. package/lib/cjs/render/webgl/Sync.js.map +1 -1
  213. package/lib/cjs/render/webgl/System.js.map +1 -1
  214. package/lib/cjs/render/webgl/Target.js.map +1 -1
  215. package/lib/cjs/render/webgl/TargetGraphics.js.map +1 -1
  216. package/lib/cjs/render/webgl/TargetUniforms.js.map +1 -1
  217. package/lib/cjs/render/webgl/Technique.js.map +1 -1
  218. package/lib/cjs/render/webgl/TechniqueFlags.js.map +1 -1
  219. package/lib/cjs/render/webgl/TechniqueId.js.map +1 -1
  220. package/lib/cjs/render/webgl/Texture.js.map +1 -1
  221. package/lib/cjs/render/webgl/TextureDrape.js.map +1 -1
  222. package/lib/cjs/render/webgl/ThematicSensors.js.map +1 -1
  223. package/lib/cjs/render/webgl/ThematicUniforms.js.map +1 -1
  224. package/lib/cjs/render/webgl/UniformHandle.js.map +1 -1
  225. package/lib/cjs/render/webgl/VertexLUT.js.map +1 -1
  226. package/lib/cjs/render/webgl/ViewRectUniforms.js.map +1 -1
  227. package/lib/cjs/render/webgl/VisibleTileFeatures.js.map +1 -1
  228. package/lib/cjs/render/webgl/glsl/AmbientOcclusion.js +154 -154
  229. package/lib/cjs/render/webgl/glsl/AmbientOcclusion.js.map +1 -1
  230. package/lib/cjs/render/webgl/glsl/Animation.js +83 -83
  231. package/lib/cjs/render/webgl/glsl/Animation.js.map +1 -1
  232. package/lib/cjs/render/webgl/glsl/Atmosphere.js +266 -266
  233. package/lib/cjs/render/webgl/glsl/Atmosphere.js.map +1 -1
  234. package/lib/cjs/render/webgl/glsl/Blur.js +37 -37
  235. package/lib/cjs/render/webgl/glsl/Blur.js.map +1 -1
  236. package/lib/cjs/render/webgl/glsl/ClearPickAndColor.js +4 -4
  237. package/lib/cjs/render/webgl/glsl/ClearPickAndColor.js.map +1 -1
  238. package/lib/cjs/render/webgl/glsl/ClearTranslucent.js +3 -3
  239. package/lib/cjs/render/webgl/glsl/ClearTranslucent.js.map +1 -1
  240. package/lib/cjs/render/webgl/glsl/Clipping.js +60 -60
  241. package/lib/cjs/render/webgl/glsl/Clipping.js.map +1 -1
  242. package/lib/cjs/render/webgl/glsl/Color.js +12 -12
  243. package/lib/cjs/render/webgl/glsl/Color.js.map +1 -1
  244. package/lib/cjs/render/webgl/glsl/Combine3Textures.js +7 -7
  245. package/lib/cjs/render/webgl/glsl/Combine3Textures.js.map +1 -1
  246. package/lib/cjs/render/webgl/glsl/CombineTextures.js +5 -5
  247. package/lib/cjs/render/webgl/glsl/CombineTextures.js.map +1 -1
  248. package/lib/cjs/render/webgl/glsl/Common.js +16 -16
  249. package/lib/cjs/render/webgl/glsl/Common.js.map +1 -1
  250. package/lib/cjs/render/webgl/glsl/Composite.js +71 -71
  251. package/lib/cjs/render/webgl/glsl/Composite.js.map +1 -1
  252. package/lib/cjs/render/webgl/glsl/CopyColor.js +6 -6
  253. package/lib/cjs/render/webgl/glsl/CopyColor.js.map +1 -1
  254. package/lib/cjs/render/webgl/glsl/CopyPickBuffers.js +3 -3
  255. package/lib/cjs/render/webgl/glsl/CopyPickBuffers.js.map +1 -1
  256. package/lib/cjs/render/webgl/glsl/CopyStencil.js +4 -4
  257. package/lib/cjs/render/webgl/glsl/CopyStencil.js.map +1 -1
  258. package/lib/cjs/render/webgl/glsl/Decode.js +65 -65
  259. package/lib/cjs/render/webgl/glsl/Decode.js.map +1 -1
  260. package/lib/cjs/render/webgl/glsl/EDL.js +103 -103
  261. package/lib/cjs/render/webgl/glsl/EDL.js.map +1 -1
  262. package/lib/cjs/render/webgl/glsl/EVSMFromDepth.js +25 -25
  263. package/lib/cjs/render/webgl/glsl/EVSMFromDepth.js.map +1 -1
  264. package/lib/cjs/render/webgl/glsl/Edge.js +146 -146
  265. package/lib/cjs/render/webgl/glsl/Edge.js.map +1 -1
  266. package/lib/cjs/render/webgl/glsl/FeatureSymbology.js +232 -232
  267. package/lib/cjs/render/webgl/glsl/FeatureSymbology.js.map +1 -1
  268. package/lib/cjs/render/webgl/glsl/Fragment.js +41 -41
  269. package/lib/cjs/render/webgl/glsl/Fragment.js.map +1 -1
  270. package/lib/cjs/render/webgl/glsl/Instancing.js +21 -21
  271. package/lib/cjs/render/webgl/glsl/Instancing.js.map +1 -1
  272. package/lib/cjs/render/webgl/glsl/Lighting.js +92 -92
  273. package/lib/cjs/render/webgl/glsl/Lighting.js.map +1 -1
  274. package/lib/cjs/render/webgl/glsl/LogarithmicDepthBuffer.js.map +1 -1
  275. package/lib/cjs/render/webgl/glsl/LookupTable.js +19 -19
  276. package/lib/cjs/render/webgl/glsl/LookupTable.js.map +1 -1
  277. package/lib/cjs/render/webgl/glsl/Monochrome.js +13 -13
  278. package/lib/cjs/render/webgl/glsl/Monochrome.js.map +1 -1
  279. package/lib/cjs/render/webgl/glsl/PlanarClassification.js +188 -188
  280. package/lib/cjs/render/webgl/glsl/PlanarClassification.js.map +1 -1
  281. package/lib/cjs/render/webgl/glsl/PlanarGrid.js +22 -22
  282. package/lib/cjs/render/webgl/glsl/PlanarGrid.js.map +1 -1
  283. package/lib/cjs/render/webgl/glsl/PointCloud.js +28 -28
  284. package/lib/cjs/render/webgl/glsl/PointCloud.js.map +1 -1
  285. package/lib/cjs/render/webgl/glsl/PointString.js +9 -9
  286. package/lib/cjs/render/webgl/glsl/PointString.js.map +1 -1
  287. package/lib/cjs/render/webgl/glsl/Polyline.js +213 -213
  288. package/lib/cjs/render/webgl/glsl/Polyline.js.map +1 -1
  289. package/lib/cjs/render/webgl/glsl/RealityMesh.js +83 -83
  290. package/lib/cjs/render/webgl/glsl/RealityMesh.js.map +1 -1
  291. package/lib/cjs/render/webgl/glsl/RenderPass.js.map +1 -1
  292. package/lib/cjs/render/webgl/glsl/ScreenSpaceEffect.js +9 -9
  293. package/lib/cjs/render/webgl/glsl/ScreenSpaceEffect.js.map +1 -1
  294. package/lib/cjs/render/webgl/glsl/SkyBox.js.map +1 -1
  295. package/lib/cjs/render/webgl/glsl/SkySphere.js +49 -49
  296. package/lib/cjs/render/webgl/glsl/SkySphere.js.map +1 -1
  297. package/lib/cjs/render/webgl/glsl/SolarShadowMapping.js +51 -51
  298. package/lib/cjs/render/webgl/glsl/SolarShadowMapping.js.map +1 -1
  299. package/lib/cjs/render/webgl/glsl/Surface.js +239 -239
  300. package/lib/cjs/render/webgl/glsl/Surface.js.map +1 -1
  301. package/lib/cjs/render/webgl/glsl/Thematic.js +134 -134
  302. package/lib/cjs/render/webgl/glsl/Thematic.js.map +1 -1
  303. package/lib/cjs/render/webgl/glsl/Translucency.js +19 -19
  304. package/lib/cjs/render/webgl/glsl/Translucency.js.map +1 -1
  305. package/lib/cjs/render/webgl/glsl/Vertex.js +73 -73
  306. package/lib/cjs/render/webgl/glsl/Vertex.js.map +1 -1
  307. package/lib/cjs/render/webgl/glsl/Viewport.js +38 -38
  308. package/lib/cjs/render/webgl/glsl/Viewport.js.map +1 -1
  309. package/lib/cjs/render/webgl/glsl/ViewportQuad.js.map +1 -1
  310. package/lib/cjs/render/webgl/glsl/Wiremesh.js +10 -10
  311. package/lib/cjs/render/webgl/glsl/Wiremesh.js.map +1 -1
  312. package/lib/cjs/render-primitives.js.map +1 -1
  313. package/lib/cjs/request/Request.js.map +1 -1
  314. package/lib/cjs/tile/B3dmReader.js.map +1 -1
  315. package/lib/cjs/tile/BatchedTileIdMap.js.map +1 -1
  316. package/lib/cjs/tile/CesiumAssetProvider.js.map +1 -1
  317. package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
  318. package/lib/cjs/tile/ContextShareProvider.js.map +1 -1
  319. package/lib/cjs/tile/DisclosedTileTreeSet.js.map +1 -1
  320. package/lib/cjs/tile/DynamicIModelTile.js.map +1 -1
  321. package/lib/cjs/tile/GltfReader.js.map +1 -1
  322. package/lib/cjs/tile/GraphicsCollector.js.map +1 -1
  323. package/lib/cjs/tile/I3dmReader.js.map +1 -1
  324. package/lib/cjs/tile/IModelTile.js.map +1 -1
  325. package/lib/cjs/tile/IModelTileRequestChannels.js.map +1 -1
  326. package/lib/cjs/tile/IModelTileTree.js.map +1 -1
  327. package/lib/cjs/tile/ImdlReader.js.map +1 -1
  328. package/lib/cjs/tile/LRUTileList.js.map +1 -1
  329. package/lib/cjs/tile/OPCFormatInterpreter.js.map +1 -1
  330. package/lib/cjs/tile/PntsReader.js.map +1 -1
  331. package/lib/cjs/tile/RealityTile.js.map +1 -1
  332. package/lib/cjs/tile/RealityTileDrawArgs.js.map +1 -1
  333. package/lib/cjs/tile/RealityTileLoader.js.map +1 -1
  334. package/lib/cjs/tile/RealityTileTree.js.map +1 -1
  335. package/lib/cjs/tile/ThreeDTileFormatInterpreter.js.map +1 -1
  336. package/lib/cjs/tile/Tile.js.map +1 -1
  337. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  338. package/lib/cjs/tile/TileContent.js.map +1 -1
  339. package/lib/cjs/tile/TileDrawArgs.js.map +1 -1
  340. package/lib/cjs/tile/TileGeometryCollector.js.map +1 -1
  341. package/lib/cjs/tile/TileParams.js.map +1 -1
  342. package/lib/cjs/tile/TileRequest.js.map +1 -1
  343. package/lib/cjs/tile/TileRequestChannel.js.map +1 -1
  344. package/lib/cjs/tile/TileRequestChannels.js.map +1 -1
  345. package/lib/cjs/tile/TileStorage.js.map +1 -1
  346. package/lib/cjs/tile/TileTree.js.map +1 -1
  347. package/lib/cjs/tile/TileTreeOwner.js.map +1 -1
  348. package/lib/cjs/tile/TileTreeParams.js.map +1 -1
  349. package/lib/cjs/tile/TileTreeReference.js.map +1 -1
  350. package/lib/cjs/tile/TileTreeSupplier.js.map +1 -1
  351. package/lib/cjs/tile/TileUsageMarker.js.map +1 -1
  352. package/lib/cjs/tile/TileUser.js.map +1 -1
  353. package/lib/cjs/tile/TileUserSet.js.map +1 -1
  354. package/lib/cjs/tile/TiledGraphicsProvider.js.map +1 -1
  355. package/lib/cjs/tile/ViewFlagOverrides.js.map +1 -1
  356. package/lib/cjs/tile/internal.js.map +1 -1
  357. package/lib/cjs/tile/map/ArcGISTileMap.js.map +1 -1
  358. package/lib/cjs/tile/map/ArcGisUtilities.js.map +1 -1
  359. package/lib/cjs/tile/map/BingElevation.js.map +1 -1
  360. package/lib/cjs/tile/map/CesiumTerrainProvider.js.map +1 -1
  361. package/lib/cjs/tile/map/EllipsoidTerrainProvider.js.map +1 -1
  362. package/lib/cjs/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
  363. package/lib/cjs/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  364. package/lib/cjs/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
  365. package/lib/cjs/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  366. package/lib/cjs/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  367. package/lib/cjs/tile/map/ImageryProviders/TileUrlImageryProvider.js.map +1 -1
  368. package/lib/cjs/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  369. package/lib/cjs/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
  370. package/lib/cjs/tile/map/MapCartoRectangle.js.map +1 -1
  371. package/lib/cjs/tile/map/MapFeatureInfo.js.map +1 -1
  372. package/lib/cjs/tile/map/MapLayerAuthentication.js.map +1 -1
  373. package/lib/cjs/tile/map/MapLayerFormatRegistry.js.map +1 -1
  374. package/lib/cjs/tile/map/MapLayerImageryProvider.js +2 -2
  375. package/lib/cjs/tile/map/MapLayerImageryProvider.js.map +1 -1
  376. package/lib/cjs/tile/map/MapLayerSources.js.map +1 -1
  377. package/lib/cjs/tile/map/MapLayerTileTreeReference.js.map +1 -1
  378. package/lib/cjs/tile/map/MapTile.js.map +1 -1
  379. package/lib/cjs/tile/map/MapTileAvailability.js.map +1 -1
  380. package/lib/cjs/tile/map/MapTileLoader.js.map +1 -1
  381. package/lib/cjs/tile/map/MapTiledGraphicsProvider.js.map +1 -1
  382. package/lib/cjs/tile/map/MapTilingScheme.js.map +1 -1
  383. package/lib/cjs/tile/map/QuadId.js.map +1 -1
  384. package/lib/cjs/tile/map/TerrainMeshProvider.js.map +1 -1
  385. package/lib/cjs/tile/map/TerrainProvider.js.map +1 -1
  386. package/lib/cjs/tile/map/WmsCapabilities.js.map +1 -1
  387. package/lib/cjs/tile/map/WmsUtilities.js.map +1 -1
  388. package/lib/cjs/tile/map/WmtsCapabilities.js.map +1 -1
  389. package/lib/cjs/tools/AccuDrawTool.js.map +1 -1
  390. package/lib/cjs/tools/ClipViewTool.js.map +1 -1
  391. package/lib/cjs/tools/EditManipulator.js.map +1 -1
  392. package/lib/cjs/tools/ElementSetTool.js.map +1 -1
  393. package/lib/cjs/tools/EventController.js.map +1 -1
  394. package/lib/cjs/tools/IdleTool.js.map +1 -1
  395. package/lib/cjs/tools/MeasureTool.js.map +1 -1
  396. package/lib/cjs/tools/PrimitiveTool.js.map +1 -1
  397. package/lib/cjs/tools/SelectTool.js.map +1 -1
  398. package/lib/cjs/tools/ToolAdmin.js.map +1 -1
  399. package/lib/cjs/tools/ToolAssistance.js.map +1 -1
  400. package/lib/cjs/tools/ToolSettings.js.map +1 -1
  401. package/lib/cjs/tools/ViewTool.js.map +1 -1
  402. package/lib/cjs/webgl.js.map +1 -1
  403. package/lib/esm/AccuDraw.js.map +1 -1
  404. package/lib/esm/AccuSnap.js.map +1 -1
  405. package/lib/esm/ApproximateTerrainHeights.js.map +1 -1
  406. package/lib/esm/ApproximateTerrainHeightsProps.js.map +1 -1
  407. package/lib/esm/AuxCoordSys.js.map +1 -1
  408. package/lib/esm/BackgroundMapGeometry.js.map +1 -1
  409. package/lib/esm/BingLocation.js.map +1 -1
  410. package/lib/esm/BriefcaseConnection.js.map +1 -1
  411. package/lib/esm/BriefcaseTxns.js.map +1 -1
  412. package/lib/esm/CategorySelectorState.js.map +1 -1
  413. package/lib/esm/ChangeFlags.js.map +1 -1
  414. package/lib/esm/CheckpointConnection.js.map +1 -1
  415. package/lib/esm/CoordSystem.js.map +1 -1
  416. package/lib/esm/DecorationsCache.js.map +1 -1
  417. package/lib/esm/DevTools.js.map +1 -1
  418. package/lib/esm/DisplayStyleState.js.map +1 -1
  419. package/lib/esm/DrawingViewState.js +5 -5
  420. package/lib/esm/DrawingViewState.js.map +1 -1
  421. package/lib/esm/ElementLocateManager.js.map +1 -1
  422. package/lib/esm/EmphasizeElements.js.map +1 -1
  423. package/lib/esm/EntityState.js.map +1 -1
  424. package/lib/esm/EnvironmentDecorations.js.map +1 -1
  425. package/lib/esm/FeatureOverrideProvider.js.map +1 -1
  426. package/lib/esm/FlashSettings.js.map +1 -1
  427. package/lib/esm/FrontendHubAccess.js.map +1 -1
  428. package/lib/esm/FrontendLoggerCategory.js.map +1 -1
  429. package/lib/esm/Frustum2d.js.map +1 -1
  430. package/lib/esm/FrustumAnimator.js.map +1 -1
  431. package/lib/esm/FuzzySearch.js.map +1 -1
  432. package/lib/esm/GeoServices.js.map +1 -1
  433. package/lib/esm/GlobeAnimator.js.map +1 -1
  434. package/lib/esm/GraphicalEditingScope.js.map +1 -1
  435. package/lib/esm/HitDetail.js.map +1 -1
  436. package/lib/esm/IModelApp.js.map +1 -1
  437. package/lib/esm/IModelConnection.js +23 -23
  438. package/lib/esm/IModelConnection.js.map +1 -1
  439. package/lib/esm/IModelRoutingContext.js.map +1 -1
  440. package/lib/esm/IModeljs-css.js +133 -133
  441. package/lib/esm/IModeljs-css.js.map +1 -1
  442. package/lib/esm/ImageUtil.js.map +1 -1
  443. package/lib/esm/IpcApp.js.map +1 -1
  444. package/lib/esm/LinePlaneIntersect.js.map +1 -1
  445. package/lib/esm/LocalhostIpcApp.js.map +1 -1
  446. package/lib/esm/MarginPercent.js.map +1 -1
  447. package/lib/esm/Marker.js.map +1 -1
  448. package/lib/esm/ModelSelectorState.js.map +1 -1
  449. package/lib/esm/NativeApp.js.map +1 -1
  450. package/lib/esm/NativeAppLogger.js.map +1 -1
  451. package/lib/esm/NoRenderApp.js.map +1 -1
  452. package/lib/esm/NotificationManager.js.map +1 -1
  453. package/lib/esm/PerModelCategoryVisibility.js.map +1 -1
  454. package/lib/esm/PlanarClipMaskState.js.map +1 -1
  455. package/lib/esm/RealityDataSource.js.map +1 -1
  456. package/lib/esm/RealityDataSourceCesiumIonAssetImpl.js.map +1 -1
  457. package/lib/esm/RealityDataSourceContextShareImpl.js.map +1 -1
  458. package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -1
  459. package/lib/esm/SelectionSet.js.map +1 -1
  460. package/lib/esm/SheetViewState.js.map +1 -1
  461. package/lib/esm/SpatialViewState.js.map +1 -1
  462. package/lib/esm/Sprites.js.map +1 -1
  463. package/lib/esm/StandardView.js.map +1 -1
  464. package/lib/esm/SubCategoriesCache.js.map +1 -1
  465. package/lib/esm/TentativePoint.js.map +1 -1
  466. package/lib/esm/Tiles.js.map +1 -1
  467. package/lib/esm/UserPreferences.js.map +1 -1
  468. package/lib/esm/ViewAnimation.js.map +1 -1
  469. package/lib/esm/ViewContext.js.map +1 -1
  470. package/lib/esm/ViewCreator2d.js.map +1 -1
  471. package/lib/esm/ViewCreator3d.js.map +1 -1
  472. package/lib/esm/ViewGlobalLocation.js.map +1 -1
  473. package/lib/esm/ViewManager.js.map +1 -1
  474. package/lib/esm/ViewPose.js.map +1 -1
  475. package/lib/esm/ViewRect.js.map +1 -1
  476. package/lib/esm/ViewState.js.map +1 -1
  477. package/lib/esm/ViewStatus.js.map +1 -1
  478. package/lib/esm/ViewingSpace.js.map +1 -1
  479. package/lib/esm/Viewport.js.map +1 -1
  480. package/lib/esm/ViewportSync.js.map +1 -1
  481. package/lib/esm/WebWorkerManager.js.map +1 -1
  482. package/lib/esm/core-frontend.js.map +1 -1
  483. package/lib/esm/extension/Extension.js.map +1 -1
  484. package/lib/esm/extension/ExtensionAdmin.js.map +1 -1
  485. package/lib/esm/extension/ExtensionHost.js.map +1 -1
  486. package/lib/esm/extension/ExtensionImpl.js.map +1 -1
  487. package/lib/esm/extension/ExtensionRuntime.js.map +1 -1
  488. package/lib/esm/extension/providers/ExtensionLoadScript.js.map +1 -1
  489. package/lib/esm/extension/providers/LocalExtensionProvider.js.map +1 -1
  490. package/lib/esm/extension/providers/RemoteExtensionProvider.js.map +1 -1
  491. package/lib/esm/gltf/GltfModel.js.map +1 -1
  492. package/lib/esm/gltf/GltfParser.js.map +1 -1
  493. package/lib/esm/gltf/GltfSchema.js.map +1 -1
  494. package/lib/esm/properties/AngleDescription.js.map +1 -1
  495. package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
  496. package/lib/esm/properties/LengthDescription.js.map +1 -1
  497. package/lib/esm/public/scripts/checkbrowser.js +24 -24
  498. package/lib/esm/quantity-formatting/BaseUnitFormattingSettingsProvider.js.map +1 -1
  499. package/lib/esm/quantity-formatting/BasicUnitsProvider.js.map +1 -1
  500. package/lib/esm/quantity-formatting/LocalUnitFormatProvider.js.map +1 -1
  501. package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
  502. package/lib/esm/quantity-formatting/QuantityTypesEditorSpecs.js.map +1 -1
  503. package/lib/esm/quantity-formatting/UnitsData.js.map +1 -1
  504. package/lib/esm/render/CanvasDecoration.js.map +1 -1
  505. package/lib/esm/render/Decorations.js.map +1 -1
  506. package/lib/esm/render/FeatureSymbology.js.map +1 -1
  507. package/lib/esm/render/FrameStats.js.map +1 -1
  508. package/lib/esm/render/GraphicBranch.js.map +1 -1
  509. package/lib/esm/render/GraphicBuilder.js.map +1 -1
  510. package/lib/esm/render/GraphicPrimitive.js.map +1 -1
  511. package/lib/esm/render/InstancedGraphicParams.js.map +1 -1
  512. package/lib/esm/render/MockRender.js.map +1 -1
  513. package/lib/esm/render/ParticleCollectionBuilder.js.map +1 -1
  514. package/lib/esm/render/Pixel.js.map +1 -1
  515. package/lib/esm/render/RealityMeshGraphicParams.js.map +1 -1
  516. package/lib/esm/render/RealityMeshParams.js.map +1 -1
  517. package/lib/esm/render/RenderClipVolume.js.map +1 -1
  518. package/lib/esm/render/RenderGraphic.js.map +1 -1
  519. package/lib/esm/render/RenderMaterial.js.map +1 -1
  520. package/lib/esm/render/RenderMemory.js.map +1 -1
  521. package/lib/esm/render/RenderPlan.js.map +1 -1
  522. package/lib/esm/render/RenderPlanarClassifier.js.map +1 -1
  523. package/lib/esm/render/RenderSystem.js.map +1 -1
  524. package/lib/esm/render/RenderTarget.js.map +1 -1
  525. package/lib/esm/render/RenderTexture.js.map +1 -1
  526. package/lib/esm/render/Scene.js.map +1 -1
  527. package/lib/esm/render/ScreenSpaceEffectBuilder.js.map +1 -1
  528. package/lib/esm/render/UpsampleRealityMeshParams.js.map +1 -1
  529. package/lib/esm/render/VisibleFeature.js.map +1 -1
  530. package/lib/esm/render/primitives/AuxChannelTable.js.map +1 -1
  531. package/lib/esm/render/primitives/ColorMap.js.map +1 -1
  532. package/lib/esm/render/primitives/DisplayParams.js.map +1 -1
  533. package/lib/esm/render/primitives/EdgeParams.js.map +1 -1
  534. package/lib/esm/render/primitives/PointCloudPrimitive.js.map +1 -1
  535. package/lib/esm/render/primitives/PointStringParams.js.map +1 -1
  536. package/lib/esm/render/primitives/Polyface.js.map +1 -1
  537. package/lib/esm/render/primitives/PolylineParams.js.map +1 -1
  538. package/lib/esm/render/primitives/Primitives.js.map +1 -1
  539. package/lib/esm/render/primitives/Strokes.js.map +1 -1
  540. package/lib/esm/render/primitives/SurfaceParams.js.map +1 -1
  541. package/lib/esm/render/primitives/VertexKey.js.map +1 -1
  542. package/lib/esm/render/primitives/VertexTable.js.map +1 -1
  543. package/lib/esm/render/primitives/VertexTableSplitter.js.map +1 -1
  544. package/lib/esm/render/primitives/geometry/GeometryAccumulator.js.map +1 -1
  545. package/lib/esm/render/primitives/geometry/GeometryList.js.map +1 -1
  546. package/lib/esm/render/primitives/geometry/GeometryListBuilder.js.map +1 -1
  547. package/lib/esm/render/primitives/geometry/GeometryPrimitives.js.map +1 -1
  548. package/lib/esm/render/primitives/mesh/MeshBuilder.js.map +1 -1
  549. package/lib/esm/render/primitives/mesh/MeshBuilderMap.js.map +1 -1
  550. package/lib/esm/render/primitives/mesh/MeshPrimitives.js.map +1 -1
  551. package/lib/esm/render/webgl/AtmosphereUniforms.js.map +1 -1
  552. package/lib/esm/render/webgl/AttributeBuffers.js.map +1 -1
  553. package/lib/esm/render/webgl/AttributeMap.js.map +1 -1
  554. package/lib/esm/render/webgl/BackgroundMapDrape.js.map +1 -1
  555. package/lib/esm/render/webgl/BatchState.js.map +1 -1
  556. package/lib/esm/render/webgl/BatchUniforms.js.map +1 -1
  557. package/lib/esm/render/webgl/BranchStack.js.map +1 -1
  558. package/lib/esm/render/webgl/BranchState.js.map +1 -1
  559. package/lib/esm/render/webgl/BranchUniforms.js.map +1 -1
  560. package/lib/esm/render/webgl/CachedGeometry.js.map +1 -1
  561. package/lib/esm/render/webgl/ClipStack.js.map +1 -1
  562. package/lib/esm/render/webgl/ClipVolume.js.map +1 -1
  563. package/lib/esm/render/webgl/ClippingProgram.js.map +1 -1
  564. package/lib/esm/render/webgl/ColorInfo.js.map +1 -1
  565. package/lib/esm/render/webgl/Diagnostics.js.map +1 -1
  566. package/lib/esm/render/webgl/Disposable.js.map +1 -1
  567. package/lib/esm/render/webgl/DrawCommand.js.map +1 -1
  568. package/lib/esm/render/webgl/EDL.js.map +1 -1
  569. package/lib/esm/render/webgl/EdgeGeometry.js.map +1 -1
  570. package/lib/esm/render/webgl/EdgeSettings.js.map +1 -1
  571. package/lib/esm/render/webgl/FeatureOverrides.js.map +1 -1
  572. package/lib/esm/render/webgl/FloatRGBA.js.map +1 -1
  573. package/lib/esm/render/webgl/FrameBuffer.js.map +1 -1
  574. package/lib/esm/render/webgl/FrustumUniforms.js.map +1 -1
  575. package/lib/esm/render/webgl/GL.js.map +1 -1
  576. package/lib/esm/render/webgl/GLTimer.js.map +1 -1
  577. package/lib/esm/render/webgl/Graphic.js.map +1 -1
  578. package/lib/esm/render/webgl/HiliteUniforms.js.map +1 -1
  579. package/lib/esm/render/webgl/IModelFrameLifecycle.js.map +1 -1
  580. package/lib/esm/render/webgl/IndexedEdgeGeometry.js.map +1 -1
  581. package/lib/esm/render/webgl/InstancedGeometry.js.map +1 -1
  582. package/lib/esm/render/webgl/Layer.js.map +1 -1
  583. package/lib/esm/render/webgl/LayerCommands.js.map +1 -1
  584. package/lib/esm/render/webgl/LightingUniforms.js.map +1 -1
  585. package/lib/esm/render/webgl/LineCode.js.map +1 -1
  586. package/lib/esm/render/webgl/Material.js.map +1 -1
  587. package/lib/esm/render/webgl/Matrix.js.map +1 -1
  588. package/lib/esm/render/webgl/Mesh.js.map +1 -1
  589. package/lib/esm/render/webgl/MeshData.js.map +1 -1
  590. package/lib/esm/render/webgl/MeshGeometry.js.map +1 -1
  591. package/lib/esm/render/webgl/PerformanceMetrics.js.map +1 -1
  592. package/lib/esm/render/webgl/PlanarClassifier.js.map +1 -1
  593. package/lib/esm/render/webgl/PlanarGrid.js.map +1 -1
  594. package/lib/esm/render/webgl/PlanarTextureProjection.js.map +1 -1
  595. package/lib/esm/render/webgl/PointCloud.js.map +1 -1
  596. package/lib/esm/render/webgl/PointString.js.map +1 -1
  597. package/lib/esm/render/webgl/Polyline.js.map +1 -1
  598. package/lib/esm/render/webgl/Primitive.js.map +1 -1
  599. package/lib/esm/render/webgl/RealityMesh.js.map +1 -1
  600. package/lib/esm/render/webgl/RealityModelUniforms.js.map +1 -1
  601. package/lib/esm/render/webgl/RenderBuffer.js.map +1 -1
  602. package/lib/esm/render/webgl/RenderCommands.js.map +1 -1
  603. package/lib/esm/render/webgl/RenderFlags.js.map +1 -1
  604. package/lib/esm/render/webgl/RenderState.js.map +1 -1
  605. package/lib/esm/render/webgl/SceneCompositor.js.map +1 -1
  606. package/lib/esm/render/webgl/ScratchDrawParams.js.map +1 -1
  607. package/lib/esm/render/webgl/ScreenSpaceEffect.js.map +1 -1
  608. package/lib/esm/render/webgl/ShaderBuilder.js.map +1 -1
  609. package/lib/esm/render/webgl/ShaderProgram.js.map +1 -1
  610. package/lib/esm/render/webgl/ShadowUniforms.js.map +1 -1
  611. package/lib/esm/render/webgl/SolarShadowMap.js.map +1 -1
  612. package/lib/esm/render/webgl/StyleUniforms.js.map +1 -1
  613. package/lib/esm/render/webgl/SurfaceGeometry.js.map +1 -1
  614. package/lib/esm/render/webgl/Sync.js.map +1 -1
  615. package/lib/esm/render/webgl/System.js.map +1 -1
  616. package/lib/esm/render/webgl/Target.js.map +1 -1
  617. package/lib/esm/render/webgl/TargetGraphics.js.map +1 -1
  618. package/lib/esm/render/webgl/TargetUniforms.js.map +1 -1
  619. package/lib/esm/render/webgl/Technique.js.map +1 -1
  620. package/lib/esm/render/webgl/TechniqueFlags.js.map +1 -1
  621. package/lib/esm/render/webgl/TechniqueId.js.map +1 -1
  622. package/lib/esm/render/webgl/Texture.js.map +1 -1
  623. package/lib/esm/render/webgl/TextureDrape.js.map +1 -1
  624. package/lib/esm/render/webgl/ThematicSensors.js.map +1 -1
  625. package/lib/esm/render/webgl/ThematicUniforms.js.map +1 -1
  626. package/lib/esm/render/webgl/UniformHandle.js.map +1 -1
  627. package/lib/esm/render/webgl/VertexLUT.js.map +1 -1
  628. package/lib/esm/render/webgl/ViewRectUniforms.js.map +1 -1
  629. package/lib/esm/render/webgl/VisibleTileFeatures.js.map +1 -1
  630. package/lib/esm/render/webgl/glsl/AmbientOcclusion.js +154 -154
  631. package/lib/esm/render/webgl/glsl/AmbientOcclusion.js.map +1 -1
  632. package/lib/esm/render/webgl/glsl/Animation.js +83 -83
  633. package/lib/esm/render/webgl/glsl/Animation.js.map +1 -1
  634. package/lib/esm/render/webgl/glsl/Atmosphere.js +266 -266
  635. package/lib/esm/render/webgl/glsl/Atmosphere.js.map +1 -1
  636. package/lib/esm/render/webgl/glsl/Blur.js +37 -37
  637. package/lib/esm/render/webgl/glsl/Blur.js.map +1 -1
  638. package/lib/esm/render/webgl/glsl/ClearPickAndColor.js +4 -4
  639. package/lib/esm/render/webgl/glsl/ClearPickAndColor.js.map +1 -1
  640. package/lib/esm/render/webgl/glsl/ClearTranslucent.js +3 -3
  641. package/lib/esm/render/webgl/glsl/ClearTranslucent.js.map +1 -1
  642. package/lib/esm/render/webgl/glsl/Clipping.js +60 -60
  643. package/lib/esm/render/webgl/glsl/Clipping.js.map +1 -1
  644. package/lib/esm/render/webgl/glsl/Color.js +12 -12
  645. package/lib/esm/render/webgl/glsl/Color.js.map +1 -1
  646. package/lib/esm/render/webgl/glsl/Combine3Textures.js +7 -7
  647. package/lib/esm/render/webgl/glsl/Combine3Textures.js.map +1 -1
  648. package/lib/esm/render/webgl/glsl/CombineTextures.js +5 -5
  649. package/lib/esm/render/webgl/glsl/CombineTextures.js.map +1 -1
  650. package/lib/esm/render/webgl/glsl/Common.js +16 -16
  651. package/lib/esm/render/webgl/glsl/Common.js.map +1 -1
  652. package/lib/esm/render/webgl/glsl/Composite.js +71 -71
  653. package/lib/esm/render/webgl/glsl/Composite.js.map +1 -1
  654. package/lib/esm/render/webgl/glsl/CopyColor.js +6 -6
  655. package/lib/esm/render/webgl/glsl/CopyColor.js.map +1 -1
  656. package/lib/esm/render/webgl/glsl/CopyPickBuffers.js +3 -3
  657. package/lib/esm/render/webgl/glsl/CopyPickBuffers.js.map +1 -1
  658. package/lib/esm/render/webgl/glsl/CopyStencil.js +4 -4
  659. package/lib/esm/render/webgl/glsl/CopyStencil.js.map +1 -1
  660. package/lib/esm/render/webgl/glsl/Decode.js +65 -65
  661. package/lib/esm/render/webgl/glsl/Decode.js.map +1 -1
  662. package/lib/esm/render/webgl/glsl/EDL.js +103 -103
  663. package/lib/esm/render/webgl/glsl/EDL.js.map +1 -1
  664. package/lib/esm/render/webgl/glsl/EVSMFromDepth.js +25 -25
  665. package/lib/esm/render/webgl/glsl/EVSMFromDepth.js.map +1 -1
  666. package/lib/esm/render/webgl/glsl/Edge.js +146 -146
  667. package/lib/esm/render/webgl/glsl/Edge.js.map +1 -1
  668. package/lib/esm/render/webgl/glsl/FeatureSymbology.js +232 -232
  669. package/lib/esm/render/webgl/glsl/FeatureSymbology.js.map +1 -1
  670. package/lib/esm/render/webgl/glsl/Fragment.js +41 -41
  671. package/lib/esm/render/webgl/glsl/Fragment.js.map +1 -1
  672. package/lib/esm/render/webgl/glsl/Instancing.js +21 -21
  673. package/lib/esm/render/webgl/glsl/Instancing.js.map +1 -1
  674. package/lib/esm/render/webgl/glsl/Lighting.js +92 -92
  675. package/lib/esm/render/webgl/glsl/Lighting.js.map +1 -1
  676. package/lib/esm/render/webgl/glsl/LogarithmicDepthBuffer.js.map +1 -1
  677. package/lib/esm/render/webgl/glsl/LookupTable.js +19 -19
  678. package/lib/esm/render/webgl/glsl/LookupTable.js.map +1 -1
  679. package/lib/esm/render/webgl/glsl/Monochrome.js +13 -13
  680. package/lib/esm/render/webgl/glsl/Monochrome.js.map +1 -1
  681. package/lib/esm/render/webgl/glsl/PlanarClassification.js +188 -188
  682. package/lib/esm/render/webgl/glsl/PlanarClassification.js.map +1 -1
  683. package/lib/esm/render/webgl/glsl/PlanarGrid.js +22 -22
  684. package/lib/esm/render/webgl/glsl/PlanarGrid.js.map +1 -1
  685. package/lib/esm/render/webgl/glsl/PointCloud.js +28 -28
  686. package/lib/esm/render/webgl/glsl/PointCloud.js.map +1 -1
  687. package/lib/esm/render/webgl/glsl/PointString.js +9 -9
  688. package/lib/esm/render/webgl/glsl/PointString.js.map +1 -1
  689. package/lib/esm/render/webgl/glsl/Polyline.js +213 -213
  690. package/lib/esm/render/webgl/glsl/Polyline.js.map +1 -1
  691. package/lib/esm/render/webgl/glsl/RealityMesh.js +83 -83
  692. package/lib/esm/render/webgl/glsl/RealityMesh.js.map +1 -1
  693. package/lib/esm/render/webgl/glsl/RenderPass.js.map +1 -1
  694. package/lib/esm/render/webgl/glsl/ScreenSpaceEffect.js +9 -9
  695. package/lib/esm/render/webgl/glsl/ScreenSpaceEffect.js.map +1 -1
  696. package/lib/esm/render/webgl/glsl/SkyBox.js.map +1 -1
  697. package/lib/esm/render/webgl/glsl/SkySphere.js +49 -49
  698. package/lib/esm/render/webgl/glsl/SkySphere.js.map +1 -1
  699. package/lib/esm/render/webgl/glsl/SolarShadowMapping.js +51 -51
  700. package/lib/esm/render/webgl/glsl/SolarShadowMapping.js.map +1 -1
  701. package/lib/esm/render/webgl/glsl/Surface.js +239 -239
  702. package/lib/esm/render/webgl/glsl/Surface.js.map +1 -1
  703. package/lib/esm/render/webgl/glsl/Thematic.js +134 -134
  704. package/lib/esm/render/webgl/glsl/Thematic.js.map +1 -1
  705. package/lib/esm/render/webgl/glsl/Translucency.js +19 -19
  706. package/lib/esm/render/webgl/glsl/Translucency.js.map +1 -1
  707. package/lib/esm/render/webgl/glsl/Vertex.js +73 -73
  708. package/lib/esm/render/webgl/glsl/Vertex.js.map +1 -1
  709. package/lib/esm/render/webgl/glsl/Viewport.js +38 -38
  710. package/lib/esm/render/webgl/glsl/Viewport.js.map +1 -1
  711. package/lib/esm/render/webgl/glsl/ViewportQuad.js.map +1 -1
  712. package/lib/esm/render/webgl/glsl/Wiremesh.js +10 -10
  713. package/lib/esm/render/webgl/glsl/Wiremesh.js.map +1 -1
  714. package/lib/esm/render-primitives.js.map +1 -1
  715. package/lib/esm/request/Request.js.map +1 -1
  716. package/lib/esm/tile/B3dmReader.js.map +1 -1
  717. package/lib/esm/tile/BatchedTileIdMap.js.map +1 -1
  718. package/lib/esm/tile/CesiumAssetProvider.js.map +1 -1
  719. package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
  720. package/lib/esm/tile/ContextShareProvider.js.map +1 -1
  721. package/lib/esm/tile/DisclosedTileTreeSet.js.map +1 -1
  722. package/lib/esm/tile/DynamicIModelTile.js.map +1 -1
  723. package/lib/esm/tile/GltfReader.js.map +1 -1
  724. package/lib/esm/tile/GraphicsCollector.js.map +1 -1
  725. package/lib/esm/tile/I3dmReader.js.map +1 -1
  726. package/lib/esm/tile/IModelTile.js.map +1 -1
  727. package/lib/esm/tile/IModelTileRequestChannels.js.map +1 -1
  728. package/lib/esm/tile/IModelTileTree.js.map +1 -1
  729. package/lib/esm/tile/ImdlReader.js.map +1 -1
  730. package/lib/esm/tile/LRUTileList.js.map +1 -1
  731. package/lib/esm/tile/OPCFormatInterpreter.js.map +1 -1
  732. package/lib/esm/tile/PntsReader.js.map +1 -1
  733. package/lib/esm/tile/RealityTile.js.map +1 -1
  734. package/lib/esm/tile/RealityTileDrawArgs.js.map +1 -1
  735. package/lib/esm/tile/RealityTileLoader.js.map +1 -1
  736. package/lib/esm/tile/RealityTileTree.js.map +1 -1
  737. package/lib/esm/tile/ThreeDTileFormatInterpreter.js.map +1 -1
  738. package/lib/esm/tile/Tile.js.map +1 -1
  739. package/lib/esm/tile/TileAdmin.js.map +1 -1
  740. package/lib/esm/tile/TileContent.js.map +1 -1
  741. package/lib/esm/tile/TileDrawArgs.js.map +1 -1
  742. package/lib/esm/tile/TileGeometryCollector.js.map +1 -1
  743. package/lib/esm/tile/TileParams.js.map +1 -1
  744. package/lib/esm/tile/TileRequest.js.map +1 -1
  745. package/lib/esm/tile/TileRequestChannel.js.map +1 -1
  746. package/lib/esm/tile/TileRequestChannels.js.map +1 -1
  747. package/lib/esm/tile/TileStorage.js.map +1 -1
  748. package/lib/esm/tile/TileTree.js.map +1 -1
  749. package/lib/esm/tile/TileTreeOwner.js.map +1 -1
  750. package/lib/esm/tile/TileTreeParams.js.map +1 -1
  751. package/lib/esm/tile/TileTreeReference.js.map +1 -1
  752. package/lib/esm/tile/TileTreeSupplier.js.map +1 -1
  753. package/lib/esm/tile/TileUsageMarker.js.map +1 -1
  754. package/lib/esm/tile/TileUser.js.map +1 -1
  755. package/lib/esm/tile/TileUserSet.js.map +1 -1
  756. package/lib/esm/tile/TiledGraphicsProvider.js.map +1 -1
  757. package/lib/esm/tile/ViewFlagOverrides.js.map +1 -1
  758. package/lib/esm/tile/internal.js.map +1 -1
  759. package/lib/esm/tile/map/ArcGISTileMap.js.map +1 -1
  760. package/lib/esm/tile/map/ArcGisUtilities.js.map +1 -1
  761. package/lib/esm/tile/map/BingElevation.js.map +1 -1
  762. package/lib/esm/tile/map/CesiumTerrainProvider.js.map +1 -1
  763. package/lib/esm/tile/map/EllipsoidTerrainProvider.js.map +1 -1
  764. package/lib/esm/tile/map/ImageryProviders/ArcGISImageryProvider.js.map +1 -1
  765. package/lib/esm/tile/map/ImageryProviders/ArcGISMapLayerImageryProvider.js.map +1 -1
  766. package/lib/esm/tile/map/ImageryProviders/AzureMapsLayerImageryProvider.js.map +1 -1
  767. package/lib/esm/tile/map/ImageryProviders/BingImageryProvider.js.map +1 -1
  768. package/lib/esm/tile/map/ImageryProviders/MapBoxLayerImageryProvider.js.map +1 -1
  769. package/lib/esm/tile/map/ImageryProviders/TileUrlImageryProvider.js.map +1 -1
  770. package/lib/esm/tile/map/ImageryProviders/WmsMapLayerImageryProvider.js.map +1 -1
  771. package/lib/esm/tile/map/ImageryProviders/WmtsMapLayerImageryProvider.js.map +1 -1
  772. package/lib/esm/tile/map/MapCartoRectangle.js.map +1 -1
  773. package/lib/esm/tile/map/MapFeatureInfo.js.map +1 -1
  774. package/lib/esm/tile/map/MapLayerAuthentication.js.map +1 -1
  775. package/lib/esm/tile/map/MapLayerFormatRegistry.js.map +1 -1
  776. package/lib/esm/tile/map/MapLayerImageryProvider.js +2 -2
  777. package/lib/esm/tile/map/MapLayerImageryProvider.js.map +1 -1
  778. package/lib/esm/tile/map/MapLayerSources.js.map +1 -1
  779. package/lib/esm/tile/map/MapLayerTileTreeReference.js.map +1 -1
  780. package/lib/esm/tile/map/MapTile.js.map +1 -1
  781. package/lib/esm/tile/map/MapTileAvailability.js.map +1 -1
  782. package/lib/esm/tile/map/MapTileLoader.js.map +1 -1
  783. package/lib/esm/tile/map/MapTiledGraphicsProvider.js.map +1 -1
  784. package/lib/esm/tile/map/MapTilingScheme.js.map +1 -1
  785. package/lib/esm/tile/map/QuadId.js.map +1 -1
  786. package/lib/esm/tile/map/TerrainMeshProvider.js.map +1 -1
  787. package/lib/esm/tile/map/TerrainProvider.js.map +1 -1
  788. package/lib/esm/tile/map/WmsCapabilities.js.map +1 -1
  789. package/lib/esm/tile/map/WmsUtilities.js.map +1 -1
  790. package/lib/esm/tile/map/WmtsCapabilities.js.map +1 -1
  791. package/lib/esm/tools/AccuDrawTool.js.map +1 -1
  792. package/lib/esm/tools/ClipViewTool.js.map +1 -1
  793. package/lib/esm/tools/EditManipulator.js.map +1 -1
  794. package/lib/esm/tools/ElementSetTool.js.map +1 -1
  795. package/lib/esm/tools/EventController.js.map +1 -1
  796. package/lib/esm/tools/IdleTool.js.map +1 -1
  797. package/lib/esm/tools/MeasureTool.js.map +1 -1
  798. package/lib/esm/tools/PrimitiveTool.js.map +1 -1
  799. package/lib/esm/tools/SelectTool.js.map +1 -1
  800. package/lib/esm/tools/ToolAdmin.js.map +1 -1
  801. package/lib/esm/tools/ToolAssistance.js.map +1 -1
  802. package/lib/esm/tools/ToolSettings.js.map +1 -1
  803. package/lib/esm/tools/ViewTool.js.map +1 -1
  804. package/lib/esm/webgl.js.map +1 -1
  805. package/lib/public/assets/MapLayerSources.json +25 -25
  806. package/lib/public/images/cesium-ion.svg +92 -92
  807. package/lib/public/images/imodeljs-icon.svg +2 -2
  808. package/lib/public/locales/en/CoreTools.json +477 -477
  809. package/lib/public/locales/en/iModelJs.json +170 -170
  810. package/lib/public/scripts/checkbrowser.js +24 -24
  811. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"ParticleCollectionBuilder.js","sourceRoot":"","sources":["../../../src/render/ParticleCollectionBuilder.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,sBAAsB,CAAC;AAC/G,OAAO,EACL,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,GAClH,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AA6F3D,cAAc;AACd,MAAM,KAAW,yBAAyB,CAOzC;AAPD,WAAiB,yBAAyB;IACxC;;OAEG;IACH,SAAgB,MAAM,CAAC,MAAuC;QAC5D,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAFe,gCAAM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C,IAAI,QAAQ,CAAC;IAC1B,OAAO,MAAM,CAAC;AAChB,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/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Matrix3d, Point2d, Point3d, Range3d, Transform, Vector2d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\r\nimport {\r\n ColorDef, ColorIndex, Feature, FeatureIndex, FeatureTable, FillFlags, PackedFeatureTable, QParams3d, QPoint3dList, RenderTexture,\r\n} from \"@itwin/core-common\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { RenderGraphic } from \"./RenderGraphic\";\r\nimport { GraphicBranch } from \"./GraphicBranch\";\r\nimport { MeshParams } from \"./primitives/VertexTable\";\r\nimport { MeshArgs } from \"./primitives/mesh/MeshPrimitives\";\r\nimport { DisplayParams } from \"./primitives/DisplayParams\";\r\n\r\n/** Parameters used to construct a [[ParticleCollectionBuilder]].\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ParticleCollectionBuilderParams {\r\n /** The image mapped to each particle quad.\r\n * @note The texture should be disposed of when no longer needed to free up WebGL resources. For example, if a [[Decorator]] creates the texture, the\r\n * texture should probably be disposed of when the decorator is removed from the [[ViewManager]].\r\n */\r\n texture: RenderTexture;\r\n\r\n /** The default extents of the particle quad. Individual particles may apply a scale to these extents to produce particles of varying dimensions.\r\n * Must be positive.\r\n */\r\n size: XAndY | number;\r\n\r\n /** The initial transparency of the particles as an integer in [0,255]. Defaults to zero if omitted. */\r\n transparency?: number;\r\n\r\n /** The origin of the particle collection in world coordinates. Defaults to (0, 0, 0). */\r\n origin?: XYAndZ;\r\n\r\n /** If the particles are to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\r\n * @see [[IModelConnection.transientIdSequence]] to obtain an Id that is unique within an iModel.\r\n */\r\n pickableId?: Id64String;\r\n\r\n /** The viewport in which the particles will be drawn. */\r\n viewport: Viewport;\r\n\r\n /** If true, the finished graphic will be defined in view coordinates, for use as a decoration of type [[GraphicType.ViewBackground]] or [[GraphicType.ViewOverlay]].\r\n * Defaults to false, indicating the graphic will be defined in world coordinates.\r\n * @see [[CoordSystem.View]] and [[CoordSystem.World]].\r\n */\r\n isViewCoords?: boolean;\r\n}\r\n\r\n/** Describes a particle to to add to a particle collection via [[ParticleCollectionBuilder.addParticle]].\r\n * The x, y, and z coordinates represent the centroid of the particle quad in the collection's coordinate space.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ParticleProps extends XYAndZ {\r\n /** The size of the particle, in the collection's coordinate space. If omitted, it defaults to the size supplied to the collection by [[ParticleCollectionBuilderParams.size]].\r\n * Supplying a `number` produces a square; supplying a non-uniform `XAndY` produces a rectangle. Must be positive.\r\n */\r\n size?: XAndY | number;\r\n\r\n /** The transparency with which to draw the particle as an integer in [0,255]. If omitted, it defaults to the current value of [[ParticleCollectionBuilder.transparency]]. */\r\n transparency?: number;\r\n\r\n /** A rotation matrix to orient the particle. If supplied then the particle will not be automatically oriented towards the camera. */\r\n rotationMatrix?: Matrix3d;\r\n}\r\n\r\n/** Interface for producing a collection of particles suitable for use in particle effects.\r\n * Particle effects involve animating hundreds or thousands of small particles to simulate phenomena like smoke, fire, snow, etc.\r\n * A particle collection represents each particle as a quad (rectangle) displaying an image. The position of each particle corresponds to the\r\n * centroid of its quad. The transparency and size of each particle can be specified individually. By default, the quads will always rotate to face the camera\r\n * such that the image is fully visible.\r\n *\r\n * Creating a particle collection using a ParticleCollectionBuilder is far more efficient (in both CPU and GPU usage) than doing so using a [[GraphicBuilder]].\r\n * @see interactive demonstrations of [Snow and Rain](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=snow-rain-sample&imodel=Villa) and\r\n * [Fire and Smoke](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=fire-sample&imodel=Villa) particle effects.\r\n * @see [SnowEffect]($frontend-devtools) for an example of a particle effect.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface ParticleCollectionBuilder {\r\n /** The default transparency for newly-added particles as an integer in [0,255], used by [[ParticleCollectionBuilder.addParticle]] if [[ParticleProps.transparency]] is omitted.\r\n * Changing this value has no effect on the transparency of previously-added particles.\r\n */\r\n transparency: number;\r\n\r\n /** The default size of each particle, used by [[ParticleCollectionBuilder.addParticle]] if [[ParticleProps.size]] is omitted. */\r\n size: XAndY;\r\n\r\n /** Add a particle to the collection.\r\n * If `size` is omitted, `this.size` is used.\r\n * If `transparency` is omitted, `this.transparency` is used.\r\n * @throws Error if particle size is defined and not greater than zero.\r\n */\r\n addParticle: (particle: ParticleProps) => void;\r\n\r\n /** Produces a finished graphic from the accumulated particles.\r\n * It returns the finished graphic, or `undefined` if the collection contains no particles or the [[RenderSystem]] failed to produce the graphic.\r\n * @note After this method returns, the particle collection is empty.\r\n */\r\n finish: () => RenderGraphic | undefined;\r\n}\r\n\r\n/** @public */\r\nexport namespace ParticleCollectionBuilder {\r\n /** Creates a new ParticleCollectionBuilder.\r\n * @throws Error if size is not greater than zero.\r\n */\r\n export function create(params: ParticleCollectionBuilderParams): ParticleCollectionBuilder {\r\n return new Builder(params);\r\n }\r\n}\r\n\r\nclass Particle {\r\n public readonly centroid: Point3d;\r\n public readonly transparency: number;\r\n public readonly width: number;\r\n public readonly height: number;\r\n public readonly rotationMatrix?: Matrix3d;\r\n\r\n public constructor(centroid: XYAndZ, width: number, height: number, transparency: number, rotationMatrix?: Matrix3d) {\r\n this.centroid = Point3d.fromJSON(centroid);\r\n this.transparency = transparency;\r\n this.width = width;\r\n this.height = height;\r\n this.rotationMatrix = rotationMatrix;\r\n }\r\n}\r\n\r\nclass Builder implements ParticleCollectionBuilder {\r\n private readonly _viewport: Viewport;\r\n private readonly _isViewCoords: boolean;\r\n private readonly _pickableId?: Id64String;\r\n private readonly _texture: RenderTexture;\r\n private readonly _size: Vector2d;\r\n private _transparency: number;\r\n private _hasVaryingTransparency = false;\r\n private readonly _localToWorldTransform: Transform;\r\n private readonly _range = Range3d.createNull();\r\n private _particlesOpaque: Particle[] = [];\r\n private _particlesTranslucent: Particle[] = [];\r\n\r\n public constructor(params: ParticleCollectionBuilderParams) {\r\n this._viewport = params.viewport;\r\n this._isViewCoords = true === params.isViewCoords;\r\n this._pickableId = params.pickableId;\r\n this._texture = params.texture;\r\n this._transparency = undefined !== params.transparency ? clampTransparency(params.transparency) : 0;\r\n this._localToWorldTransform = params.origin ? Transform.createTranslationXYZ(params.origin.x, params.origin.y, params.origin.z) : Transform.createIdentity();\r\n\r\n if (\"number\" === typeof params.size)\r\n this._size = new Vector2d(params.size, params.size);\r\n else\r\n this._size = Vector2d.fromJSON(params.size);\r\n\r\n if (this._size.x <= 0 || this._size.y <= 0)\r\n throw new Error(\"Particle size must be greater than zero\");\r\n }\r\n\r\n public get size(): XAndY {\r\n return this._size;\r\n }\r\n\r\n public get transparency() {\r\n return this._transparency;\r\n }\r\n\r\n public set transparency(transparency: number) {\r\n transparency = clampTransparency(transparency);\r\n if (transparency !== this._transparency) {\r\n this._transparency = transparency;\r\n this._hasVaryingTransparency = this._particlesTranslucent.length > 0;\r\n }\r\n }\r\n\r\n public addParticle(props: ParticleProps): void {\r\n const size = props.size ?? this._size;\r\n let width, height;\r\n if (\"number\" === typeof size) {\r\n width = height = size;\r\n } else {\r\n width = size.x;\r\n height = size.y;\r\n }\r\n\r\n if (width <= 0 || height <= 0)\r\n throw new Error(\"A particle must have a size greater than zero\");\r\n\r\n const transparency = undefined !== props.transparency ? clampTransparency(props.transparency) : this.transparency;\r\n if (transparency !== this.transparency && this._particlesTranslucent.length > 0)\r\n this._hasVaryingTransparency = true;\r\n\r\n const particle = new Particle(props, width, height, transparency, props.rotationMatrix);\r\n if (transparency > 0)\r\n this._particlesTranslucent.push(particle);\r\n else\r\n this._particlesOpaque.push(particle);\r\n this._range.extendPoint(particle.centroid);\r\n }\r\n\r\n public finish(): RenderGraphic | undefined {\r\n if (0 === this._particlesTranslucent.length + this._particlesOpaque.length)\r\n return undefined;\r\n\r\n // Order-independent transparency doesn't work well with opaque geometry - it will look semi-transparent.\r\n // If we have a mix of opaque and transparent particles, put them in separate graphics to be rendered in separate passes.\r\n const opaque = this.createGraphic(this._particlesOpaque, 0);\r\n const transparent = this.createGraphic(this._particlesTranslucent, this._hasVaryingTransparency ? undefined : this._transparency);\r\n\r\n // Empty the collection before any return statements.\r\n const range = this._range.clone();\r\n this._range.setNull();\r\n this._particlesOpaque.length = 0;\r\n this._particlesTranslucent.length = 0;\r\n this._hasVaryingTransparency = false;\r\n\r\n if (!transparent && !opaque)\r\n return undefined;\r\n\r\n // Transform from origin to collection, then to world.\r\n const toCollection = Transform.createTranslation(range.center);\r\n const toWorld = toCollection.multiplyTransformTransform(this._localToWorldTransform);\r\n const branch = new GraphicBranch(true);\r\n if (opaque)\r\n branch.add(opaque);\r\n\r\n if (transparent)\r\n branch.add(transparent);\r\n\r\n let graphic = this._viewport.target.renderSystem.createGraphicBranch(branch, toWorld);\r\n\r\n // If we have a pickable Id, produce a batch.\r\n // NB: We pass this._pickableId as the FeatureTable's modelId so that it will be treated like a reality model or a map -\r\n // specifically, it can be located and display a tooltip, but can't be selected.\r\n const featureTable = this._pickableId ? new FeatureTable(1, this._pickableId) : undefined;\r\n if (featureTable) {\r\n this._localToWorldTransform.multiplyRange(range, range);\r\n featureTable.insert(new Feature(this._pickableId));\r\n graphic = this._viewport.target.renderSystem.createBatch(graphic, PackedFeatureTable.pack(featureTable), range);\r\n }\r\n\r\n return graphic;\r\n }\r\n\r\n private createGraphic(particles: Particle[], uniformTransparency: number | undefined): RenderGraphic | undefined {\r\n const numParticles = particles.length;\r\n if (numParticles <= 0)\r\n return undefined;\r\n\r\n // To keep scale values close to 1, compute mean size to use as size of quad.\r\n const meanSize = new Vector2d();\r\n let maxSize = 0;\r\n for (const particle of particles) {\r\n meanSize.x += particle.width;\r\n meanSize.y += particle.height;\r\n if (particle.width > maxSize)\r\n maxSize = particle.width;\r\n if (particle.height > maxSize)\r\n maxSize = particle.height;\r\n }\r\n meanSize.x /= numParticles;\r\n meanSize.y /= numParticles;\r\n\r\n // Define InstancedGraphicParams for particles.\r\n const rangeCenter = this._range.center;\r\n const floatsPerTransform = 12;\r\n const transforms = new Float32Array(floatsPerTransform * numParticles);\r\n const bytesPerOverride = 8;\r\n const symbologyOverrides = undefined === uniformTransparency ? new Uint8Array(bytesPerOverride * numParticles) : undefined;\r\n\r\n const viewToWorld = this._viewport.view.getRotation().transpose();\r\n let tfIndex = 0;\r\n let ovrIndex = 0;\r\n for (const particle of particles) {\r\n const scaleX = particle.width / meanSize.x;\r\n const scaleY = particle.height / meanSize.y;\r\n if (this._isViewCoords) {\r\n // Particles already face the camera in view coords - just apply the scale.\r\n transforms[tfIndex + 0] = scaleX;\r\n transforms[tfIndex + 5] = scaleY;\r\n transforms[tfIndex + 10] = 1;\r\n } else if (undefined !== particle.rotationMatrix) {\r\n // Scale rotation matrix relative to size of quad.\r\n transforms[tfIndex + 0] = particle.rotationMatrix.coffs[0] * scaleX;\r\n transforms[tfIndex + 1] = particle.rotationMatrix.coffs[1] * scaleY;\r\n transforms[tfIndex + 2] = particle.rotationMatrix.coffs[2];\r\n transforms[tfIndex + 4] = particle.rotationMatrix.coffs[3] * scaleX;\r\n transforms[tfIndex + 5] = particle.rotationMatrix.coffs[4] * scaleY;\r\n transforms[tfIndex + 6] = particle.rotationMatrix.coffs[5];\r\n transforms[tfIndex + 8] = particle.rotationMatrix.coffs[6] * scaleX;\r\n transforms[tfIndex + 9] = particle.rotationMatrix.coffs[7] * scaleY;\r\n transforms[tfIndex + 10] = particle.rotationMatrix.coffs[8];\r\n } else {\r\n // Rotate about origin by inverse view matrix so quads always face the camera and scale relative to size of quad.\r\n transforms[tfIndex + 0] = viewToWorld.coffs[0] * scaleX;\r\n transforms[tfIndex + 1] = viewToWorld.coffs[1] * scaleY;\r\n transforms[tfIndex + 2] = viewToWorld.coffs[2];\r\n transforms[tfIndex + 4] = viewToWorld.coffs[3] * scaleX;\r\n transforms[tfIndex + 5] = viewToWorld.coffs[4] * scaleY;\r\n transforms[tfIndex + 6] = viewToWorld.coffs[5];\r\n transforms[tfIndex + 8] = viewToWorld.coffs[6] * scaleX;\r\n transforms[tfIndex + 9] = viewToWorld.coffs[7] * scaleY;\r\n transforms[tfIndex + 10] = viewToWorld.coffs[8];\r\n }\r\n\r\n // Translate relative to center of particles range.\r\n transforms[tfIndex + 3] = particle.centroid.x - rangeCenter.x;\r\n transforms[tfIndex + 7] = particle.centroid.y - rangeCenter.y;\r\n transforms[tfIndex + 11] = particle.centroid.z - rangeCenter.z;\r\n\r\n tfIndex += floatsPerTransform;\r\n\r\n if (symbologyOverrides) {\r\n // See FeatureOverrides.buildLookupTable() for layout.\r\n symbologyOverrides[ovrIndex + 0] = 1 << 2; // OvrFlags.Alpha\r\n symbologyOverrides[ovrIndex + 7] = 0xff - particle.transparency;\r\n\r\n ovrIndex += bytesPerOverride;\r\n }\r\n }\r\n\r\n // Produce instanced quads.\r\n // Note: We do not need to allocate an array of featureIds. If we have a pickableId, all particles refer to the same Feature, with index 0.\r\n // So we leave the vertex attribute disabled causing the shader to receive the default (0, 0, 0) which happens to correspond to our feature index.\r\n const quad = createQuad(meanSize, this._texture, uniformTransparency ?? 0x7f);\r\n const transformCenter = new Point3d(0, 0, 0);\r\n const range = computeRange(this._range, rangeCenter, maxSize);\r\n const instances = { count: numParticles, transforms, transformCenter, symbologyOverrides, range };\r\n return this._viewport.target.renderSystem.createMesh(quad, instances);\r\n }\r\n}\r\n\r\nfunction createQuad(size: XAndY, texture: RenderTexture, transparency: number): MeshParams {\r\n const halfWidth = size.x / 2;\r\n const halfHeight = size.y / 2;\r\n const corners = [\r\n new Point3d(-halfWidth, -halfHeight, 0), new Point3d(halfWidth, -halfHeight, 0),\r\n new Point3d(-halfWidth, halfHeight, 0), new Point3d(halfWidth, halfHeight, 0),\r\n ];\r\n\r\n const range = new Range3d();\r\n range.low = corners[0];\r\n range.high = corners[3];\r\n\r\n const points = new QPoint3dList(QParams3d.fromRange(range));\r\n for (const corner of corners)\r\n points.add(corner);\r\n\r\n const colors = new ColorIndex();\r\n colors.initUniform(ColorDef.white.withTransparency(transparency));\r\n\r\n const quadArgs: MeshArgs = {\r\n points,\r\n vertIndices: [0, 1, 2, 2, 1, 3],\r\n fillFlags: FillFlags.None,\r\n isPlanar: true,\r\n colors,\r\n features: new FeatureIndex(),\r\n textureMapping: {\r\n texture,\r\n uvParams: [new Point2d(0, 1), new Point2d(1, 1), new Point2d(0, 0), new Point2d(1, 0)],\r\n },\r\n };\r\n\r\n return MeshParams.create(quadArgs);\r\n}\r\n\r\nfunction clampTransparency(transparency: number): number {\r\n transparency = Math.min(255, transparency, Math.max(0, transparency));\r\n transparency = Math.floor(transparency);\r\n if (transparency < DisplayParams.minTransparency)\r\n transparency = 0;\r\n\r\n return transparency;\r\n}\r\n\r\nfunction computeRange(centroidRange: Range3d, center: Point3d, maxSize: number): Range3d {\r\n const range2 = centroidRange.clone();\r\n range2.low.subtractInPlace(center);\r\n range2.high.subtractInPlace(center);\r\n const halfSize = maxSize * 0.5;\r\n range2.low.x -= halfSize;\r\n range2.low.y -= halfSize;\r\n range2.low.z -= halfSize;\r\n range2.high.x += halfSize;\r\n range2.high.y += halfSize;\r\n range2.high.z += halfSize;\r\n return range2;\r\n}\r\n"]}
1
+ {"version":3,"file":"ParticleCollectionBuilder.js","sourceRoot":"","sources":["../../../src/render/ParticleCollectionBuilder.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAiB,MAAM,sBAAsB,CAAC;AAC/G,OAAO,EACL,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EA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e,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,OAAO,GAAG,GAAG,CAAC;IAC/B,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC;IACzB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC;IACzB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAC;IACzB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,QAAQ,CAAC;IAC1B,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Matrix3d, Point2d, Point3d, Range3d, Transform, Vector2d, XAndY, XYAndZ } from \"@itwin/core-geometry\";\nimport {\n ColorDef, ColorIndex, Feature, FeatureIndex, FeatureTable, FillFlags, PackedFeatureTable, QParams3d, QPoint3dList, RenderTexture,\n} from \"@itwin/core-common\";\nimport { Viewport } from \"../Viewport\";\nimport { RenderGraphic } from \"./RenderGraphic\";\nimport { GraphicBranch } from \"./GraphicBranch\";\nimport { MeshParams } from \"./primitives/VertexTable\";\nimport { MeshArgs } from \"./primitives/mesh/MeshPrimitives\";\nimport { DisplayParams } from \"./primitives/DisplayParams\";\n\n/** Parameters used to construct a [[ParticleCollectionBuilder]].\n * @public\n * @extensions\n */\nexport interface ParticleCollectionBuilderParams {\n /** The image mapped to each particle quad.\n * @note The texture should be disposed of when no longer needed to free up WebGL resources. For example, if a [[Decorator]] creates the texture, the\n * texture should probably be disposed of when the decorator is removed from the [[ViewManager]].\n */\n texture: RenderTexture;\n\n /** The default extents of the particle quad. Individual particles may apply a scale to these extents to produce particles of varying dimensions.\n * Must be positive.\n */\n size: XAndY | number;\n\n /** The initial transparency of the particles as an integer in [0,255]. Defaults to zero if omitted. */\n transparency?: number;\n\n /** The origin of the particle collection in world coordinates. Defaults to (0, 0, 0). */\n origin?: XYAndZ;\n\n /** If the particles are to be pickable, a unique identifier to associate with the resultant [[RenderGraphic]].\n * @see [[IModelConnection.transientIdSequence]] to obtain an Id that is unique within an iModel.\n */\n pickableId?: Id64String;\n\n /** The viewport in which the particles will be drawn. */\n viewport: Viewport;\n\n /** If true, the finished graphic will be defined in view coordinates, for use as a decoration of type [[GraphicType.ViewBackground]] or [[GraphicType.ViewOverlay]].\n * Defaults to false, indicating the graphic will be defined in world coordinates.\n * @see [[CoordSystem.View]] and [[CoordSystem.World]].\n */\n isViewCoords?: boolean;\n}\n\n/** Describes a particle to to add to a particle collection via [[ParticleCollectionBuilder.addParticle]].\n * The x, y, and z coordinates represent the centroid of the particle quad in the collection's coordinate space.\n * @public\n * @extensions\n */\nexport interface ParticleProps extends XYAndZ {\n /** The size of the particle, in the collection's coordinate space. If omitted, it defaults to the size supplied to the collection by [[ParticleCollectionBuilderParams.size]].\n * Supplying a `number` produces a square; supplying a non-uniform `XAndY` produces a rectangle. Must be positive.\n */\n size?: XAndY | number;\n\n /** The transparency with which to draw the particle as an integer in [0,255]. If omitted, it defaults to the current value of [[ParticleCollectionBuilder.transparency]]. */\n transparency?: number;\n\n /** A rotation matrix to orient the particle. If supplied then the particle will not be automatically oriented towards the camera. */\n rotationMatrix?: Matrix3d;\n}\n\n/** Interface for producing a collection of particles suitable for use in particle effects.\n * Particle effects involve animating hundreds or thousands of small particles to simulate phenomena like smoke, fire, snow, etc.\n * A particle collection represents each particle as a quad (rectangle) displaying an image. The position of each particle corresponds to the\n * centroid of its quad. The transparency and size of each particle can be specified individually. By default, the quads will always rotate to face the camera\n * such that the image is fully visible.\n *\n * Creating a particle collection using a ParticleCollectionBuilder is far more efficient (in both CPU and GPU usage) than doing so using a [[GraphicBuilder]].\n * @see interactive demonstrations of [Snow and Rain](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=snow-rain-sample&imodel=Villa) and\n * [Fire and Smoke](https://www.itwinjs.org/sample-showcase/?group=Viewer+Features&sample=fire-sample&imodel=Villa) particle effects.\n * @see [SnowEffect]($frontend-devtools) for an example of a particle effect.\n * @public\n * @extensions\n */\nexport interface ParticleCollectionBuilder {\n /** The default transparency for newly-added particles as an integer in [0,255], used by [[ParticleCollectionBuilder.addParticle]] if [[ParticleProps.transparency]] is omitted.\n * Changing this value has no effect on the transparency of previously-added particles.\n */\n transparency: number;\n\n /** The default size of each particle, used by [[ParticleCollectionBuilder.addParticle]] if [[ParticleProps.size]] is omitted. */\n size: XAndY;\n\n /** Add a particle to the collection.\n * If `size` is omitted, `this.size` is used.\n * If `transparency` is omitted, `this.transparency` is used.\n * @throws Error if particle size is defined and not greater than zero.\n */\n addParticle: (particle: ParticleProps) => void;\n\n /** Produces a finished graphic from the accumulated particles.\n * It returns the finished graphic, or `undefined` if the collection contains no particles or the [[RenderSystem]] failed to produce the graphic.\n * @note After this method returns, the particle collection is empty.\n */\n finish: () => RenderGraphic | undefined;\n}\n\n/** @public */\nexport namespace ParticleCollectionBuilder {\n /** Creates a new ParticleCollectionBuilder.\n * @throws Error if size is not greater than zero.\n */\n export function create(params: ParticleCollectionBuilderParams): ParticleCollectionBuilder {\n return new Builder(params);\n }\n}\n\nclass Particle {\n public readonly centroid: Point3d;\n public readonly transparency: number;\n public readonly width: number;\n public readonly height: number;\n public readonly rotationMatrix?: Matrix3d;\n\n public constructor(centroid: XYAndZ, width: number, height: number, transparency: number, rotationMatrix?: Matrix3d) {\n this.centroid = Point3d.fromJSON(centroid);\n this.transparency = transparency;\n this.width = width;\n this.height = height;\n this.rotationMatrix = rotationMatrix;\n }\n}\n\nclass Builder implements ParticleCollectionBuilder {\n private readonly _viewport: Viewport;\n private readonly _isViewCoords: boolean;\n private readonly _pickableId?: Id64String;\n private readonly _texture: RenderTexture;\n private readonly _size: Vector2d;\n private _transparency: number;\n private _hasVaryingTransparency = false;\n private readonly _localToWorldTransform: Transform;\n private readonly _range = Range3d.createNull();\n private _particlesOpaque: Particle[] = [];\n private _particlesTranslucent: Particle[] = [];\n\n public constructor(params: ParticleCollectionBuilderParams) {\n this._viewport = params.viewport;\n this._isViewCoords = true === params.isViewCoords;\n this._pickableId = params.pickableId;\n this._texture = params.texture;\n this._transparency = undefined !== params.transparency ? clampTransparency(params.transparency) : 0;\n this._localToWorldTransform = params.origin ? Transform.createTranslationXYZ(params.origin.x, params.origin.y, params.origin.z) : Transform.createIdentity();\n\n if (\"number\" === typeof params.size)\n this._size = new Vector2d(params.size, params.size);\n else\n this._size = Vector2d.fromJSON(params.size);\n\n if (this._size.x <= 0 || this._size.y <= 0)\n throw new Error(\"Particle size must be greater than zero\");\n }\n\n public get size(): XAndY {\n return this._size;\n }\n\n public get transparency() {\n return this._transparency;\n }\n\n public set transparency(transparency: number) {\n transparency = clampTransparency(transparency);\n if (transparency !== this._transparency) {\n this._transparency = transparency;\n this._hasVaryingTransparency = this._particlesTranslucent.length > 0;\n }\n }\n\n public addParticle(props: ParticleProps): void {\n const size = props.size ?? this._size;\n let width, height;\n if (\"number\" === typeof size) {\n width = height = size;\n } else {\n width = size.x;\n height = size.y;\n }\n\n if (width <= 0 || height <= 0)\n throw new Error(\"A particle must have a size greater than zero\");\n\n const transparency = undefined !== props.transparency ? clampTransparency(props.transparency) : this.transparency;\n if (transparency !== this.transparency && this._particlesTranslucent.length > 0)\n this._hasVaryingTransparency = true;\n\n const particle = new Particle(props, width, height, transparency, props.rotationMatrix);\n if (transparency > 0)\n this._particlesTranslucent.push(particle);\n else\n this._particlesOpaque.push(particle);\n this._range.extendPoint(particle.centroid);\n }\n\n public finish(): RenderGraphic | undefined {\n if (0 === this._particlesTranslucent.length + this._particlesOpaque.length)\n return undefined;\n\n // Order-independent transparency doesn't work well with opaque geometry - it will look semi-transparent.\n // If we have a mix of opaque and transparent particles, put them in separate graphics to be rendered in separate passes.\n const opaque = this.createGraphic(this._particlesOpaque, 0);\n const transparent = this.createGraphic(this._particlesTranslucent, this._hasVaryingTransparency ? undefined : this._transparency);\n\n // Empty the collection before any return statements.\n const range = this._range.clone();\n this._range.setNull();\n this._particlesOpaque.length = 0;\n this._particlesTranslucent.length = 0;\n this._hasVaryingTransparency = false;\n\n if (!transparent && !opaque)\n return undefined;\n\n // Transform from origin to collection, then to world.\n const toCollection = Transform.createTranslation(range.center);\n const toWorld = toCollection.multiplyTransformTransform(this._localToWorldTransform);\n const branch = new GraphicBranch(true);\n if (opaque)\n branch.add(opaque);\n\n if (transparent)\n branch.add(transparent);\n\n let graphic = this._viewport.target.renderSystem.createGraphicBranch(branch, toWorld);\n\n // If we have a pickable Id, produce a batch.\n // NB: We pass this._pickableId as the FeatureTable's modelId so that it will be treated like a reality model or a map -\n // specifically, it can be located and display a tooltip, but can't be selected.\n const featureTable = this._pickableId ? new FeatureTable(1, this._pickableId) : undefined;\n if (featureTable) {\n this._localToWorldTransform.multiplyRange(range, range);\n featureTable.insert(new Feature(this._pickableId));\n graphic = this._viewport.target.renderSystem.createBatch(graphic, PackedFeatureTable.pack(featureTable), range);\n }\n\n return graphic;\n }\n\n private createGraphic(particles: Particle[], uniformTransparency: number | undefined): RenderGraphic | undefined {\n const numParticles = particles.length;\n if (numParticles <= 0)\n return undefined;\n\n // To keep scale values close to 1, compute mean size to use as size of quad.\n const meanSize = new Vector2d();\n let maxSize = 0;\n for (const particle of particles) {\n meanSize.x += particle.width;\n meanSize.y += particle.height;\n if (particle.width > maxSize)\n maxSize = particle.width;\n if (particle.height > maxSize)\n maxSize = particle.height;\n }\n meanSize.x /= numParticles;\n meanSize.y /= numParticles;\n\n // Define InstancedGraphicParams for particles.\n const rangeCenter = this._range.center;\n const floatsPerTransform = 12;\n const transforms = new Float32Array(floatsPerTransform * numParticles);\n const bytesPerOverride = 8;\n const symbologyOverrides = undefined === uniformTransparency ? new Uint8Array(bytesPerOverride * numParticles) : undefined;\n\n const viewToWorld = this._viewport.view.getRotation().transpose();\n let tfIndex = 0;\n let ovrIndex = 0;\n for (const particle of particles) {\n const scaleX = particle.width / meanSize.x;\n const scaleY = particle.height / meanSize.y;\n if (this._isViewCoords) {\n // Particles already face the camera in view coords - just apply the scale.\n transforms[tfIndex + 0] = scaleX;\n transforms[tfIndex + 5] = scaleY;\n transforms[tfIndex + 10] = 1;\n } else if (undefined !== particle.rotationMatrix) {\n // Scale rotation matrix relative to size of quad.\n transforms[tfIndex + 0] = particle.rotationMatrix.coffs[0] * scaleX;\n transforms[tfIndex + 1] = particle.rotationMatrix.coffs[1] * scaleY;\n transforms[tfIndex + 2] = particle.rotationMatrix.coffs[2];\n transforms[tfIndex + 4] = particle.rotationMatrix.coffs[3] * scaleX;\n transforms[tfIndex + 5] = particle.rotationMatrix.coffs[4] * scaleY;\n transforms[tfIndex + 6] = particle.rotationMatrix.coffs[5];\n transforms[tfIndex + 8] = particle.rotationMatrix.coffs[6] * scaleX;\n transforms[tfIndex + 9] = particle.rotationMatrix.coffs[7] * scaleY;\n transforms[tfIndex + 10] = particle.rotationMatrix.coffs[8];\n } else {\n // Rotate about origin by inverse view matrix so quads always face the camera and scale relative to size of quad.\n transforms[tfIndex + 0] = viewToWorld.coffs[0] * scaleX;\n transforms[tfIndex + 1] = viewToWorld.coffs[1] * scaleY;\n transforms[tfIndex + 2] = viewToWorld.coffs[2];\n transforms[tfIndex + 4] = viewToWorld.coffs[3] * scaleX;\n transforms[tfIndex + 5] = viewToWorld.coffs[4] * scaleY;\n transforms[tfIndex + 6] = viewToWorld.coffs[5];\n transforms[tfIndex + 8] = viewToWorld.coffs[6] * scaleX;\n transforms[tfIndex + 9] = viewToWorld.coffs[7] * scaleY;\n transforms[tfIndex + 10] = viewToWorld.coffs[8];\n }\n\n // Translate relative to center of particles range.\n transforms[tfIndex + 3] = particle.centroid.x - rangeCenter.x;\n transforms[tfIndex + 7] = particle.centroid.y - rangeCenter.y;\n transforms[tfIndex + 11] = particle.centroid.z - rangeCenter.z;\n\n tfIndex += floatsPerTransform;\n\n if (symbologyOverrides) {\n // See FeatureOverrides.buildLookupTable() for layout.\n symbologyOverrides[ovrIndex + 0] = 1 << 2; // OvrFlags.Alpha\n symbologyOverrides[ovrIndex + 7] = 0xff - particle.transparency;\n\n ovrIndex += bytesPerOverride;\n }\n }\n\n // Produce instanced quads.\n // Note: We do not need to allocate an array of featureIds. If we have a pickableId, all particles refer to the same Feature, with index 0.\n // So we leave the vertex attribute disabled causing the shader to receive the default (0, 0, 0) which happens to correspond to our feature index.\n const quad = createQuad(meanSize, this._texture, uniformTransparency ?? 0x7f);\n const transformCenter = new Point3d(0, 0, 0);\n const range = computeRange(this._range, rangeCenter, maxSize);\n const instances = { count: numParticles, transforms, transformCenter, symbologyOverrides, range };\n return this._viewport.target.renderSystem.createMesh(quad, instances);\n }\n}\n\nfunction createQuad(size: XAndY, texture: RenderTexture, transparency: number): MeshParams {\n const halfWidth = size.x / 2;\n const halfHeight = size.y / 2;\n const corners = [\n new Point3d(-halfWidth, -halfHeight, 0), new Point3d(halfWidth, -halfHeight, 0),\n new Point3d(-halfWidth, halfHeight, 0), new Point3d(halfWidth, halfHeight, 0),\n ];\n\n const range = new Range3d();\n range.low = corners[0];\n range.high = corners[3];\n\n const points = new QPoint3dList(QParams3d.fromRange(range));\n for (const corner of corners)\n points.add(corner);\n\n const colors = new ColorIndex();\n colors.initUniform(ColorDef.white.withTransparency(transparency));\n\n const quadArgs: MeshArgs = {\n points,\n vertIndices: [0, 1, 2, 2, 1, 3],\n fillFlags: FillFlags.None,\n isPlanar: true,\n colors,\n features: new FeatureIndex(),\n textureMapping: {\n texture,\n uvParams: [new Point2d(0, 1), new Point2d(1, 1), new Point2d(0, 0), new Point2d(1, 0)],\n },\n };\n\n return MeshParams.create(quadArgs);\n}\n\nfunction clampTransparency(transparency: number): number {\n transparency = Math.min(255, transparency, Math.max(0, transparency));\n transparency = Math.floor(transparency);\n if (transparency < DisplayParams.minTransparency)\n transparency = 0;\n\n return transparency;\n}\n\nfunction computeRange(centroidRange: Range3d, center: Point3d, maxSize: number): Range3d {\n const range2 = centroidRange.clone();\n range2.low.subtractInPlace(center);\n range2.high.subtractInPlace(center);\n const halfSize = maxSize * 0.5;\n range2.low.x -= halfSize;\n range2.low.y -= halfSize;\n range2.low.z -= halfSize;\n range2.high.x += halfSize;\n range2.high.y += halfSize;\n range2.high.z += halfSize;\n return range2;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Pixel.js","sourceRoot":"","sources":["../../../src/render/Pixel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,OAAO,EAA+B,MAAM,oBAAoB,CAAC;AAGrF;;;;GAIG;AACH,MAAM,KAAW,KAAK,CAmHrB;AAnHD,WAAiB,KAAK;IACpB,0DAA0D;IAC1D,MAAa,IAAI;QAgBf,gBAAgB;QAChB,IAAW,YAAY;YACrB,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,KAAK,IAAI,CAAC,SAAS,CAAC;QAC9E,CAAC;QAED,gBAAgB;QAChB,YAAmB,IAQlB;YACC,IAAI,IAAI,EAAE,OAAO;gBACf,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAE7G,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;YACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI,EAAE,gBAAgB,IAAI,CAAC,CAAC,CAAC;YACrD,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,YAAY,CAAC,OAAO,CAAC;YAC/C,IAAI,CAAC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,GAAR,cAAQ,KAAR,cAAQ,QAQnB;AAeH,CAAC,EAnHgB,KAAK,KAAL,KAAK,QAmHrB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { BatchType, Feature, GeometryClass, ModelFeature } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\n\r\n/** Describes aspects of a pixel as read from a [[Viewport]].\r\n * @see [[Viewport.readPixels]].\r\n * @public\r\n * @extensions\r\n */\r\nexport namespace Pixel {\r\n /** Describes a single pixel within a [[Pixel.Buffer]]. */\r\n export class Data {\r\n /** The feature that produced the pixel. */\r\n public readonly feature?: Feature;\r\n public readonly modelId?: Id64String;\r\n /** The pixel's depth in [[CoordSystem.Npc]] coordinates (0 to 1), or -1 if depth was not written or not requested. */\r\n public readonly distanceFraction: number;\r\n /** The type of geometry that produced the pixel. */\r\n public readonly type: GeometryType;\r\n /** The planarity of the geometry that produced the pixel. */\r\n public readonly planarity: Planarity;\r\n /** @internal */\r\n public readonly batchType?: BatchType;\r\n /** The iModel from which the geometry producing the pixel originated. */\r\n public readonly iModel?: IModelConnection;\r\n /** @internal */\r\n public readonly tileId?: string;\r\n /** @internal */\r\n public get isClassifier(): boolean {\r\n return undefined !== this.batchType && BatchType.Primary !== this.batchType;\r\n }\r\n\r\n /** @internal */\r\n public constructor(args?: {\r\n feature?: ModelFeature;\r\n distanceFraction?: number;\r\n type?: GeometryType;\r\n planarity?: Planarity;\r\n batchType?: BatchType;\r\n iModel?: IModelConnection;\r\n tileId?: string;\r\n }) {\r\n if (args?.feature)\r\n this.feature = new Feature(args.feature.elementId, args.feature.subCategoryId, args.feature.geometryClass);\r\n\r\n this.modelId = args?.feature?.modelId;\r\n this.distanceFraction = args?.distanceFraction ?? -1;\r\n this.type = args?.type ?? GeometryType.Unknown;\r\n this.planarity = args?.planarity ?? Planarity.Unknown;\r\n this.iModel = args?.iModel;\r\n this.tileId = args?.tileId;\r\n }\r\n\r\n /** The Id of the element that produced the pixel. */\r\n public get elementId(): Id64String | undefined {\r\n return this.feature?.elementId;\r\n }\r\n\r\n /** The Id of the [SubCategory]($backend) that produced the pixel. */\r\n public get subCategoryId(): Id64String | undefined {\r\n return this.feature?.subCategoryId;\r\n }\r\n\r\n /** The class of geometry that produced the pixel. */\r\n public get geometryClass(): GeometryClass | undefined {\r\n return this.feature?.geometryClass;\r\n }\r\n }\r\n\r\n /** Describes the type of geometry that produced the [[Pixel.Data]]. */\r\n export enum GeometryType {\r\n /** [[Pixel.Selector.GeometryAndDistance]] was not specified, or the type could not be determined. */\r\n Unknown, // Geometry was not selected, or type could not be determined\r\n /** No geometry was rendered to this pixel. */\r\n None,\r\n /** A surface produced this pixel. */\r\n Surface,\r\n /** A point primitive or polyline produced this pixel. */\r\n Linear,\r\n /** This pixel was produced by an edge of a surface. */\r\n Edge,\r\n /** This pixel was produced by a silhouette edge of a curved surface. */\r\n Silhouette,\r\n }\r\n\r\n /** Describes the planarity of the foremost geometry which produced the pixel. */\r\n export enum Planarity {\r\n /** [[Pixel.Selector.GeometryAndDistance]] was not specified, or the planarity could not be determined. */\r\n Unknown,\r\n /** No geometry was rendered to this pixel. */\r\n None,\r\n /** Planar geometry produced this pixel. */\r\n Planar,\r\n /** Non-planar geometry produced this pixel. */\r\n NonPlanar,\r\n }\r\n\r\n /**\r\n * Bit-mask by which callers of [[Viewport.readPixels]] specify which aspects are of interest.\r\n * Aspects not specified will be omitted from the returned data.\r\n */\r\n export enum Selector {\r\n None = 0,\r\n /** Select the [[Feature]] which produced each pixel. */\r\n Feature = 1 << 0, // eslint-disable-line @typescript-eslint/no-shadow\r\n /** Select the type and planarity of geometry which produced each pixel as well as the fraction of its distance between the near and far planes. */\r\n GeometryAndDistance = 1 << 2,\r\n /** Select all aspects of each pixel. */\r\n All = GeometryAndDistance | Feature,\r\n }\r\n\r\n /** A rectangular array of pixels as read from a [[Viewport]]'s frame buffer. Each pixel is represented as a [[Pixel.Data]] object.\r\n * The contents of the pixel buffer will be specified using device pixels, not CSS pixels. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].\r\n * @see [[Viewport.readPixels]].\r\n */\r\n export interface Buffer {\r\n /** Retrieve the data associated with the pixel at (x,y) in view coordinates. */\r\n getPixel(x: number, y: number): Data;\r\n }\r\n\r\n /** A function which receives the results of a call to [[Viewport.readPixels]].\r\n * @note The contents of the buffer become invalid once the Receiver function returns. Do not store a reference to it.\r\n */\r\n export type Receiver = (pixels: Buffer | undefined) => void;\r\n}\r\n"]}
1
+ {"version":3,"file":"Pixel.js","sourceRoot":"","sources":["../../../src/render/Pixel.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,OAAO,EAA+B,MAAM,oBAAoB,CAAC;AAGrF;;;;GAIG;AACH,MAAM,KAAW,KAAK,CAmHrB;AAnHD,WAAiB,KAAK;IACpB,0DAA0D;IAC1D,MAAa,IAAI;QAgBf,gBAAgB;QAChB,IAAW,YAAY;YACrB,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,KAAK,IAAI,CAAC,SAAS,CAAC;QAC9E,CAAC;QAED,gBAAgB;QAChB,YAAmB,IAQlB;YACC,IAAI,IAAI,EAAE,OAAO;gBACf,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAE7G,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;YACtC,IAAI,CAAC,gBAAgB,GAAG,IAAI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,CAAA;QACR,wDAAwD;QACxD,6CAAgB,CAAA;QAChB,mJAAmJ;QACnJ,qEAA4B,CAAA;QAC5B,wCAAwC;QACxC,qCAAmC,CAAA;IACrC,CAAC,EARW,QAAQ,GAAR,cAAQ,KAAR,cAAQ,QAQnB;AAeH,CAAC,EAnHgB,KAAK,KAAL,KAAK,QAmHrB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { BatchType, Feature, GeometryClass, ModelFeature } from \"@itwin/core-common\";\nimport { IModelConnection } from \"../IModelConnection\";\n\n/** Describes aspects of a pixel as read from a [[Viewport]].\n * @see [[Viewport.readPixels]].\n * @public\n * @extensions\n */\nexport namespace Pixel {\n /** Describes a single pixel within a [[Pixel.Buffer]]. */\n export class Data {\n /** The feature that produced the pixel. */\n public readonly feature?: Feature;\n public readonly modelId?: Id64String;\n /** The pixel's depth in [[CoordSystem.Npc]] coordinates (0 to 1), or -1 if depth was not written or not requested. */\n public readonly distanceFraction: number;\n /** The type of geometry that produced the pixel. */\n public readonly type: GeometryType;\n /** The planarity of the geometry that produced the pixel. */\n public readonly planarity: Planarity;\n /** @internal */\n public readonly batchType?: BatchType;\n /** The iModel from which the geometry producing the pixel originated. */\n public readonly iModel?: IModelConnection;\n /** @internal */\n public readonly tileId?: string;\n /** @internal */\n public get isClassifier(): boolean {\n return undefined !== this.batchType && BatchType.Primary !== this.batchType;\n }\n\n /** @internal */\n public constructor(args?: {\n feature?: ModelFeature;\n distanceFraction?: number;\n type?: GeometryType;\n planarity?: Planarity;\n batchType?: BatchType;\n iModel?: IModelConnection;\n tileId?: string;\n }) {\n if (args?.feature)\n this.feature = new Feature(args.feature.elementId, args.feature.subCategoryId, args.feature.geometryClass);\n\n this.modelId = args?.feature?.modelId;\n this.distanceFraction = args?.distanceFraction ?? -1;\n this.type = args?.type ?? GeometryType.Unknown;\n this.planarity = args?.planarity ?? Planarity.Unknown;\n this.iModel = args?.iModel;\n this.tileId = args?.tileId;\n }\n\n /** The Id of the element that produced the pixel. */\n public get elementId(): Id64String | undefined {\n return this.feature?.elementId;\n }\n\n /** The Id of the [SubCategory]($backend) that produced the pixel. */\n public get subCategoryId(): Id64String | undefined {\n return this.feature?.subCategoryId;\n }\n\n /** The class of geometry that produced the pixel. */\n public get geometryClass(): GeometryClass | undefined {\n return this.feature?.geometryClass;\n }\n }\n\n /** Describes the type of geometry that produced the [[Pixel.Data]]. */\n export enum GeometryType {\n /** [[Pixel.Selector.GeometryAndDistance]] was not specified, or the type could not be determined. */\n Unknown, // Geometry was not selected, or type could not be determined\n /** No geometry was rendered to this pixel. */\n None,\n /** A surface produced this pixel. */\n Surface,\n /** A point primitive or polyline produced this pixel. */\n Linear,\n /** This pixel was produced by an edge of a surface. */\n Edge,\n /** This pixel was produced by a silhouette edge of a curved surface. */\n Silhouette,\n }\n\n /** Describes the planarity of the foremost geometry which produced the pixel. */\n export enum Planarity {\n /** [[Pixel.Selector.GeometryAndDistance]] was not specified, or the planarity could not be determined. */\n Unknown,\n /** No geometry was rendered to this pixel. */\n None,\n /** Planar geometry produced this pixel. */\n Planar,\n /** Non-planar geometry produced this pixel. */\n NonPlanar,\n }\n\n /**\n * Bit-mask by which callers of [[Viewport.readPixels]] specify which aspects are of interest.\n * Aspects not specified will be omitted from the returned data.\n */\n export enum Selector {\n None = 0,\n /** Select the [[Feature]] which produced each pixel. */\n Feature = 1 << 0, // eslint-disable-line @typescript-eslint/no-shadow\n /** Select the type and planarity of geometry which produced each pixel as well as the fraction of its distance between the near and far planes. */\n GeometryAndDistance = 1 << 2,\n /** Select all aspects of each pixel. */\n All = GeometryAndDistance | Feature,\n }\n\n /** A rectangular array of pixels as read from a [[Viewport]]'s frame buffer. Each pixel is represented as a [[Pixel.Data]] object.\n * The contents of the pixel buffer will be specified using device pixels, not CSS pixels. See [[Viewport.devicePixelRatio]] and [[Viewport.cssPixelsToDevicePixels]].\n * @see [[Viewport.readPixels]].\n */\n export interface Buffer {\n /** Retrieve the data associated with the pixel at (x,y) in view coordinates. */\n getPixel(x: number, y: number): Data;\n }\n\n /** A function which receives the results of a call to [[Viewport.readPixels]].\n * @note The contents of the buffer become invalid once the Receiver function returns. Do not store a reference to it.\n */\n export type Receiver = (pixels: Buffer | undefined) => void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RealityMeshGraphicParams.js","sourceRoot":"","sources":["../../../src/render/RealityMeshGraphicParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { ColorDef, PackedFeatureTable } from \"@itwin/core-common\";\r\nimport { MapCartoRectangle, MapTileProjection } from \"../tile/internal\";\r\nimport { MapLayerClassifiers, RenderTerrainGeometry, TerrainTexture } from \"./RenderSystem\";\r\n\r\n/** @internal */\r\nexport interface RealityMeshGraphicParams {\r\n readonly realityMesh: RenderTerrainGeometry;\r\n readonly projection: MapTileProjection;\r\n readonly tileRectangle: MapCartoRectangle;\r\n readonly featureTable: PackedFeatureTable;\r\n readonly tileId: string | undefined;\r\n readonly baseColor: ColorDef | undefined;\r\n readonly baseTransparent: boolean;\r\n readonly textures?: TerrainTexture[];\r\n readonly layerClassifiers?: MapLayerClassifiers;\r\n}\r\n"]}
1
+ {"version":3,"file":"RealityMeshGraphicParams.js","sourceRoot":"","sources":["../../../src/render/RealityMeshGraphicParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { ColorDef, PackedFeatureTable } from \"@itwin/core-common\";\nimport { MapCartoRectangle, MapTileProjection } from \"../tile/internal\";\nimport { MapLayerClassifiers, RenderTerrainGeometry, TerrainTexture } from \"./RenderSystem\";\n\n/** @internal */\nexport interface RealityMeshGraphicParams {\n readonly realityMesh: RenderTerrainGeometry;\n readonly projection: MapTileProjection;\n readonly tileRectangle: MapCartoRectangle;\n readonly featureTable: PackedFeatureTable;\n readonly tileId: string | undefined;\n readonly baseColor: ColorDef | undefined;\n readonly baseTransparent: boolean;\n readonly textures?: TerrainTexture[];\n readonly layerClassifiers?: MapLayerClassifiers;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RealityMeshParams.js","sourceRoot":"","sources":["../../../src/render/RealityMeshParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAa,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EACL,eAAe,EAAE,OAAO,EAAE,OAAO,EAAY,OAAO,EAAsB,QAAQ,GACnF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAAE,QAAQ,EAAkB,qBAAqB,EAAE,QAAQ,EAAkB,qBAAqB,GACnH,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAExD,SAAS,YAAY,CAAC,SAAkB,EAAE,OAAgC;IACxE,IAAI,SAAS;QACX,OAAO;IAET,IAAI,QAAQ,KAAK,OAAO,OAAO;QAC7B,OAAO,GAAG,OAAO,EAAE,CAAC;IAEtB,MAAM,IAAI,KAAK,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;AAC7C,CAAC;AAwBD,cAAc;AACd,MAAM,KAAW,iBAAiB,C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AAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;SACrC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Uint16ArrayBuilder, UintArray, UintArrayBuilder } from \"@itwin/core-bentley\";\r\nimport {\r\n IndexedPolyface, Point2d, Point3d, Polyface, Range2d, Range3d, Transform, Vector3d, XAndY, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n OctEncodedNormal, QPoint2d, QPoint2dBuffer, QPoint2dBufferBuilder, QPoint3d, QPoint3dBuffer, QPoint3dBufferBuilder, RenderTexture,\r\n} from \"@itwin/core-common\";\r\nimport { GltfMeshData } from \"../tile/internal\";\r\nimport { Mesh } from \"./primitives/mesh/MeshPrimitives\";\r\n\r\nfunction precondition(condition: boolean, message: string | (() => string)): asserts condition {\r\n if (condition)\r\n return;\r\n\r\n if (\"string\" !== typeof message)\r\n message = message();\r\n\r\n throw new Error(`Logic Error: ${message}`);\r\n}\r\n\r\n/** Geometry for a reality mesh to be submitted to the [[RenderSystem]] for conversion to a [[RenderGraphic]].\r\n * A reality mesh is a simple triangle mesh to which a [RenderTexture]($common) image can be mapped. Sources of reality meshes\r\n * include [[TerrainMeshProvider]]s to which background map imagery is applied, and [ContextRealityModel]($common)s captured using\r\n * [photogrammetry](https://en.wikipedia.org/wiki/Photogrammetry).\r\n * @see [[RealityMeshParamsBuilder]] to incrementally construct a `RealityMeshParams`.\r\n * @public\r\n */\r\nexport interface RealityMeshParams {\r\n /** The 3d position of each vertex in the mesh, indexed by [[indices]]. */\r\n positions: QPoint3dBuffer;\r\n /** The 2d texture coordinates of each vertex in the mesh, indexed by [[indices]]. */\r\n uvs: QPoint2dBuffer;\r\n /** The optional normal vector for each vertex in the mesh, indexed by [[indices]], stored as [OctEncodedNormal]($common)s. */\r\n normals?: Uint16Array;\r\n /** The integer indices of each triangle in the mesh. The array's length must be a multiple of 3. */\r\n indices: UintArray;\r\n /** @alpha unused by terrain meshes */\r\n featureID?: number; // default 0\r\n /** @alpha unused by terrain meshes */\r\n texture?: RenderTexture;\r\n}\r\n\r\n/** @public */\r\nexport namespace RealityMeshParams {\r\n /** @internal */\r\n export function fromGltfMesh(mesh: GltfMeshData): RealityMeshParams | undefined {\r\n // The specialized reality mesh shaders expect a mesh with uvs and no edges.\r\n if (mesh.primitive.type !== Mesh.PrimitiveType.Mesh || mesh.primitive.edges || !mesh.pointQParams || !mesh.uvQParams || !mesh.points || !mesh.uvs || !mesh.indices)\r\n return undefined;\r\n\r\n return {\r\n indices: mesh.indices,\r\n positions: {\r\n params: mesh.pointQParams,\r\n points: mesh.points,\r\n },\r\n uvs: {\r\n params: mesh.uvQParams,\r\n points: mesh.uvs,\r\n },\r\n normals: mesh.normals,\r\n // featureID: 0,\r\n texture: mesh.primitive.displayParams.textureMapping?.texture,\r\n };\r\n }\r\n\r\n /** @alpha */\r\n export function toPolyface(params: RealityMeshParams, options?: { transform?: Transform, wantNormals?: boolean, wantParams?: boolean }): Polyface | undefined {\r\n const { positions, normals, uvs, indices } = params;\r\n const includeNormals = options?.wantNormals && undefined !== normals;\r\n const includeParams = options?.wantParams;\r\n\r\n const polyface = IndexedPolyface.create(includeNormals, includeParams);\r\n const points = positions.points;\r\n const point = new Point3d();\r\n const transform = options?.transform;\r\n for (let i = 0; i < positions.points.length; i += 3) {\r\n positions.params.unquantize(points[i], points[i + 1], points[i + 2], point);\r\n transform?.multiplyPoint3d(point, point);\r\n polyface.addPoint(point);\r\n }\r\n\r\n if (includeNormals) {\r\n const normal = new Vector3d();\r\n for (const oen of normals)\r\n polyface.addNormal(OctEncodedNormal.decodeValue(oen, normal));\r\n }\r\n\r\n if (includeParams) {\r\n const uv = new Point2d();\r\n for (let i = 0; i < uvs.points.length; i += 2)\r\n polyface.addParam(uvs.params.unquantize(uvs.points[i], uvs.points[i + 1], uv));\r\n }\r\n\r\n let j = 0;\r\n indices.forEach((index: number) => {\r\n polyface.addPointIndex(index);\r\n if (includeNormals)\r\n polyface.addNormalIndex(index);\r\n\r\n if (includeParams)\r\n polyface.addParamIndex(index);\r\n\r\n if (0 === (++j % 3))\r\n polyface.terminateFacet();\r\n });\r\n\r\n return polyface;\r\n }\r\n}\r\n\r\n/** Options used to construct a [[RealityMeshParamsBuilder]].\r\n * @beta\r\n */\r\nexport interface RealityMeshParamsBuilderOptions {\r\n /** A bounding box fully containing the positions of all vertices to be included in the mesh.\r\n * This range is used to quantize [[RealityMeshParams.positions]].\r\n */\r\n positionRange: Range3d;\r\n /** A range fully containing the texture coordinates of all vertices to be included in the mesh.\r\n * This range is used to quantize [[RealityMeshParams.uvs]].\r\n * Default: [0.0, 1.0].\r\n */\r\n uvRange?: Range2d;\r\n /** If true, [[RealityMeshParams.normals]] will be populated.\r\n * If you set this to true, you must supply a normal for every vertex when calling [[RealityMeshParamsBuilder.addQuantizedVertex]] or [[RealityMeshParamsBuilder.addUnquantizedVertex]].\r\n */\r\n wantNormals?: boolean;\r\n /** If defined, memory for this number of vertices will be allocated up-front. Set this if you know the minimum number of vertices in the mesh, to\r\n * avoid unnecessary reallocations when adding vertices.\r\n */\r\n initialVertexCapacity?: number;\r\n /** If defined, memory for this number of indices will be allocated up-front. Set this if you know the minimum number of triangles in the mesh, to avoid\r\n * unnecessary reallocations when adding triangles. The number of indices is equal to three times the number of triangles.\r\n */\r\n initialIndexCapacity?: number;\r\n}\r\n\r\n/** Incrementally constructs a [[RealityMeshParams]].\r\n * The following simple example produces a rectangular mesh containing two triangles.\r\n * ```ts\r\n * [[include:Build_Reality_Mesh_Params]]\r\n * ```\r\n * @beta\r\n */\r\nexport class RealityMeshParamsBuilder {\r\n /** The indices of the vertices in each triangle of the mesh.\r\n * @see [[addTriangle]] to add 3 indices describing a single triangle.\r\n * @see [[addQuad]] to add 4 indices describing two triangles sharing an edge.\r\n * @see [[addIndices]] to add any number of indices.\r\n */\r\n public readonly indices: UintArrayBuilder;\r\n /** The 3d position of each vertex in the mesh.\r\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\r\n */\r\n public readonly positions: QPoint3dBufferBuilder;\r\n /** The 2d texture coordinates of each vertex in the mesh.\r\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\r\n */\r\n public readonly uvs: QPoint2dBufferBuilder;\r\n /** The normal vector of each vertex in the mesh, or `undefined` if [[RealityMeshParamsBuilderOptions.wantNormals]] was not `true` when constructing the builder.\r\n * A normal vector must be supplied to [[addQuantizedVertex]] and [[addUnquantizedVertex]] if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was\r\n * specified as `true`.\r\n * The vectors are stored as [OctEncodedNormal]($common)s.\r\n */\r\n public normals?: Uint16ArrayBuilder;\r\n\r\n // Scratch variables\r\n private readonly _q3d = new QPoint3d();\r\n private readonly _q2d = new QPoint2d();\r\n\r\n /** Construct a builder from the specified options. */\r\n public constructor(options: RealityMeshParamsBuilderOptions) {\r\n let initialType;\r\n if (undefined !== options.initialVertexCapacity && options.initialVertexCapacity > 0xff)\r\n initialType = options.initialVertexCapacity > 0xffff ? Uint32Array : Uint16Array;\r\n\r\n this.indices = new UintArrayBuilder({\r\n initialCapacity: options.initialIndexCapacity,\r\n initialType,\r\n });\r\n\r\n if (options.wantNormals)\r\n this.normals = new Uint16ArrayBuilder({ initialCapacity: options.initialVertexCapacity });\r\n\r\n this.positions = new QPoint3dBufferBuilder({\r\n range: options.positionRange,\r\n initialCapacity: options.initialVertexCapacity,\r\n });\r\n\r\n this.uvs = new QPoint2dBufferBuilder({\r\n range: options.uvRange ?? new Range2d(0, 0, 1, 1),\r\n initialCapacity: options.initialVertexCapacity,\r\n });\r\n }\r\n\r\n /** Add a vertex to the mesh and return its index in [[positions]].\r\n * @param position The 3d position, which will be quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\r\n * @param uv The texture coordinates, which will be quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\r\n * @param the normal vector, to be supplied if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\r\n * @see [[addQuantizedVertex]] if your vertex data is already quantized.\r\n * @returns the index of the new vertex in [[positions]].\r\n */\r\n public addUnquantizedVertex(position: XYAndZ, uv: XAndY, normal?: XYAndZ): number {\r\n this._q3d.init(position, this.positions.params);\r\n this._q2d.init(uv, this.uvs.params);\r\n const oen = normal ? OctEncodedNormal.encode(normal) : undefined;\r\n return this.addQuantizedVertex(this._q3d, this._q2d, oen);\r\n }\r\n\r\n /** Original API had weird mix of quantized and unquantized, used by CesiumTerrainProvider.\r\n * @internal\r\n */\r\n public addVertex(position: XYAndZ, uv: XAndY, normal?: number): void {\r\n this._q3d.init(position, this.positions.params);\r\n this.addQuantizedVertex(this._q3d, uv, normal);\r\n }\r\n\r\n /** Add a vertex to the mesh and return its index in [[positions]].\r\n * @param position The 3d position, quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\r\n * @param uv The texture coordinates, quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\r\n * @param normal The unsigned 16-bit [OctEncodedNormal]($common) integer representation of the normal vector, to be supplied if and only if\r\n * [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\r\n * @see [[addUnquantizedVertex]] if your vertex data is not already quantized.\r\n * @returns the index of the new vertex in [[positions]].\r\n * @throws Error if `normal` is `undefined` but `wantNormals` was specified at construction of the builder, or vice-versa.\r\n */\r\n public addQuantizedVertex(position: XYAndZ, uv: XAndY, normal?: number): number {\r\n precondition((undefined === normal) === (undefined === this.normals), \"RealityMeshParams requires all vertices to have normals, or none.\");\r\n\r\n this.positions.push(position);\r\n this.uvs.push(uv);\r\n if (undefined !== normal) {\r\n assert(undefined !== this.normals);\r\n this.normals.push(normal);\r\n }\r\n\r\n return this.positions.length - 1;\r\n }\r\n\r\n /** Add a triangle corresponding to the three specified vertices. */\r\n public addTriangle(i0: number, i1: number, i2: number): void {\r\n this.addIndex(i0);\r\n this.addIndex(i1);\r\n this.addIndex(i2);\r\n }\r\n\r\n /** Add two triangles sharing an edge. This is equivalent to calling `addTriangle(i0, i1, i2); addTriangle(i1, i3, i2);`. */\r\n public addQuad(i0: number, i1: number, i2: number, i3: number): void {\r\n this.addTriangle(i0, i1, i2);\r\n this.addTriangle(i1, i3, i2);\r\n }\r\n\r\n /** Add all of the indices in `indices` to the index buffer. */\r\n public addIndices(indices: Iterable<number>): void {\r\n for (const index of indices)\r\n this.addIndex(index);\r\n }\r\n\r\n private addIndex(index: number): void {\r\n this.indices.push(index);\r\n }\r\n\r\n /** Extract the finished [[RealityMeshParams]].\r\n * @throws Error if the mesh contains no triangles.\r\n */\r\n public finish(): RealityMeshParams {\r\n precondition(this.positions.length >= 3 && this.indices.length >= 3, \"RealityMeshParams requires at least one triangle\");\r\n return {\r\n positions: this.positions.finish(),\r\n uvs: this.uvs.finish(),\r\n normals: this.normals?.toTypedArray(),\r\n indices: this.indices.toTypedArray(),\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RealityMeshParams.js","sourceRoot":"","sources":["../../../src/render/RealityMeshParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAa,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EACL,eAAe,EAAE,OAAO,EAAE,OAAO,EAAY,OAAO,EAAsB,QAAQ,GACnF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAAE,QAAQ,EAAkB,qBAAqB,EAAE,QAAQ,EAAkB,qBAAqB,GACnH,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,C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,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,kDAAkD,CAAC,CAAC;QACzH,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YAClC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACtB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE;YACrC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;SACrC,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { assert, Uint16ArrayBuilder, UintArray, UintArrayBuilder } from \"@itwin/core-bentley\";\nimport {\n IndexedPolyface, Point2d, Point3d, Polyface, Range2d, Range3d, Transform, Vector3d, XAndY, XYAndZ,\n} from \"@itwin/core-geometry\";\nimport {\n OctEncodedNormal, QPoint2d, QPoint2dBuffer, QPoint2dBufferBuilder, QPoint3d, QPoint3dBuffer, QPoint3dBufferBuilder, RenderTexture,\n} from \"@itwin/core-common\";\nimport { GltfMeshData } from \"../tile/internal\";\nimport { Mesh } from \"./primitives/mesh/MeshPrimitives\";\n\nfunction precondition(condition: boolean, message: string | (() => string)): asserts condition {\n if (condition)\n return;\n\n if (\"string\" !== typeof message)\n message = message();\n\n throw new Error(`Logic Error: ${message}`);\n}\n\n/** Geometry for a reality mesh to be submitted to the [[RenderSystem]] for conversion to a [[RenderGraphic]].\n * A reality mesh is a simple triangle mesh to which a [RenderTexture]($common) image can be mapped. Sources of reality meshes\n * include [[TerrainMeshProvider]]s to which background map imagery is applied, and [ContextRealityModel]($common)s captured using\n * [photogrammetry](https://en.wikipedia.org/wiki/Photogrammetry).\n * @see [[RealityMeshParamsBuilder]] to incrementally construct a `RealityMeshParams`.\n * @public\n */\nexport interface RealityMeshParams {\n /** The 3d position of each vertex in the mesh, indexed by [[indices]]. */\n positions: QPoint3dBuffer;\n /** The 2d texture coordinates of each vertex in the mesh, indexed by [[indices]]. */\n uvs: QPoint2dBuffer;\n /** The optional normal vector for each vertex in the mesh, indexed by [[indices]], stored as [OctEncodedNormal]($common)s. */\n normals?: Uint16Array;\n /** The integer indices of each triangle in the mesh. The array's length must be a multiple of 3. */\n indices: UintArray;\n /** @alpha unused by terrain meshes */\n featureID?: number; // default 0\n /** @alpha unused by terrain meshes */\n texture?: RenderTexture;\n}\n\n/** @public */\nexport namespace RealityMeshParams {\n /** @internal */\n export function fromGltfMesh(mesh: GltfMeshData): RealityMeshParams | undefined {\n // The specialized reality mesh shaders expect a mesh with uvs and no edges.\n if (mesh.primitive.type !== Mesh.PrimitiveType.Mesh || mesh.primitive.edges || !mesh.pointQParams || !mesh.uvQParams || !mesh.points || !mesh.uvs || !mesh.indices)\n return undefined;\n\n return {\n indices: mesh.indices,\n positions: {\n params: mesh.pointQParams,\n points: mesh.points,\n },\n uvs: {\n params: mesh.uvQParams,\n points: mesh.uvs,\n },\n normals: mesh.normals,\n // featureID: 0,\n texture: mesh.primitive.displayParams.textureMapping?.texture,\n };\n }\n\n /** @alpha */\n export function toPolyface(params: RealityMeshParams, options?: { transform?: Transform, wantNormals?: boolean, wantParams?: boolean }): Polyface | undefined {\n const { positions, normals, uvs, indices } = params;\n const includeNormals = options?.wantNormals && undefined !== normals;\n const includeParams = options?.wantParams;\n\n const polyface = IndexedPolyface.create(includeNormals, includeParams);\n const points = positions.points;\n const point = new Point3d();\n const transform = options?.transform;\n for (let i = 0; i < positions.points.length; i += 3) {\n positions.params.unquantize(points[i], points[i + 1], points[i + 2], point);\n transform?.multiplyPoint3d(point, point);\n polyface.addPoint(point);\n }\n\n if (includeNormals) {\n const normal = new Vector3d();\n for (const oen of normals)\n polyface.addNormal(OctEncodedNormal.decodeValue(oen, normal));\n }\n\n if (includeParams) {\n const uv = new Point2d();\n for (let i = 0; i < uvs.points.length; i += 2)\n polyface.addParam(uvs.params.unquantize(uvs.points[i], uvs.points[i + 1], uv));\n }\n\n let j = 0;\n indices.forEach((index: number) => {\n polyface.addPointIndex(index);\n if (includeNormals)\n polyface.addNormalIndex(index);\n\n if (includeParams)\n polyface.addParamIndex(index);\n\n if (0 === (++j % 3))\n polyface.terminateFacet();\n });\n\n return polyface;\n }\n}\n\n/** Options used to construct a [[RealityMeshParamsBuilder]].\n * @beta\n */\nexport interface RealityMeshParamsBuilderOptions {\n /** A bounding box fully containing the positions of all vertices to be included in the mesh.\n * This range is used to quantize [[RealityMeshParams.positions]].\n */\n positionRange: Range3d;\n /** A range fully containing the texture coordinates of all vertices to be included in the mesh.\n * This range is used to quantize [[RealityMeshParams.uvs]].\n * Default: [0.0, 1.0].\n */\n uvRange?: Range2d;\n /** If true, [[RealityMeshParams.normals]] will be populated.\n * If you set this to true, you must supply a normal for every vertex when calling [[RealityMeshParamsBuilder.addQuantizedVertex]] or [[RealityMeshParamsBuilder.addUnquantizedVertex]].\n */\n wantNormals?: boolean;\n /** If defined, memory for this number of vertices will be allocated up-front. Set this if you know the minimum number of vertices in the mesh, to\n * avoid unnecessary reallocations when adding vertices.\n */\n initialVertexCapacity?: number;\n /** If defined, memory for this number of indices will be allocated up-front. Set this if you know the minimum number of triangles in the mesh, to avoid\n * unnecessary reallocations when adding triangles. The number of indices is equal to three times the number of triangles.\n */\n initialIndexCapacity?: number;\n}\n\n/** Incrementally constructs a [[RealityMeshParams]].\n * The following simple example produces a rectangular mesh containing two triangles.\n * ```ts\n * [[include:Build_Reality_Mesh_Params]]\n * ```\n * @beta\n */\nexport class RealityMeshParamsBuilder {\n /** The indices of the vertices in each triangle of the mesh.\n * @see [[addTriangle]] to add 3 indices describing a single triangle.\n * @see [[addQuad]] to add 4 indices describing two triangles sharing an edge.\n * @see [[addIndices]] to add any number of indices.\n */\n public readonly indices: UintArrayBuilder;\n /** The 3d position of each vertex in the mesh.\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\n */\n public readonly positions: QPoint3dBufferBuilder;\n /** The 2d texture coordinates of each vertex in the mesh.\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\n */\n public readonly uvs: QPoint2dBufferBuilder;\n /** The normal vector of each vertex in the mesh, or `undefined` if [[RealityMeshParamsBuilderOptions.wantNormals]] was not `true` when constructing the builder.\n * A normal vector must be supplied to [[addQuantizedVertex]] and [[addUnquantizedVertex]] if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was\n * specified as `true`.\n * The vectors are stored as [OctEncodedNormal]($common)s.\n */\n public normals?: Uint16ArrayBuilder;\n\n // Scratch variables\n private readonly _q3d = new QPoint3d();\n private readonly _q2d = new QPoint2d();\n\n /** Construct a builder from the specified options. */\n public constructor(options: RealityMeshParamsBuilderOptions) {\n let initialType;\n if (undefined !== options.initialVertexCapacity && options.initialVertexCapacity > 0xff)\n initialType = options.initialVertexCapacity > 0xffff ? Uint32Array : Uint16Array;\n\n this.indices = new UintArrayBuilder({\n initialCapacity: options.initialIndexCapacity,\n initialType,\n });\n\n if (options.wantNormals)\n this.normals = new Uint16ArrayBuilder({ initialCapacity: options.initialVertexCapacity });\n\n this.positions = new QPoint3dBufferBuilder({\n range: options.positionRange,\n initialCapacity: options.initialVertexCapacity,\n });\n\n this.uvs = new QPoint2dBufferBuilder({\n range: options.uvRange ?? new Range2d(0, 0, 1, 1),\n initialCapacity: options.initialVertexCapacity,\n });\n }\n\n /** Add a vertex to the mesh and return its index in [[positions]].\n * @param position The 3d position, which will be quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\n * @param uv The texture coordinates, which will be quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\n * @param the normal vector, to be supplied if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\n * @see [[addQuantizedVertex]] if your vertex data is already quantized.\n * @returns the index of the new vertex in [[positions]].\n */\n public addUnquantizedVertex(position: XYAndZ, uv: XAndY, normal?: XYAndZ): number {\n this._q3d.init(position, this.positions.params);\n this._q2d.init(uv, this.uvs.params);\n const oen = normal ? OctEncodedNormal.encode(normal) : undefined;\n return this.addQuantizedVertex(this._q3d, this._q2d, oen);\n }\n\n /** Original API had weird mix of quantized and unquantized, used by CesiumTerrainProvider.\n * @internal\n */\n public addVertex(position: XYAndZ, uv: XAndY, normal?: number): void {\n this._q3d.init(position, this.positions.params);\n this.addQuantizedVertex(this._q3d, uv, normal);\n }\n\n /** Add a vertex to the mesh and return its index in [[positions]].\n * @param position The 3d position, quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\n * @param uv The texture coordinates, quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\n * @param normal The unsigned 16-bit [OctEncodedNormal]($common) integer representation of the normal vector, to be supplied if and only if\n * [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\n * @see [[addUnquantizedVertex]] if your vertex data is not already quantized.\n * @returns the index of the new vertex in [[positions]].\n * @throws Error if `normal` is `undefined` but `wantNormals` was specified at construction of the builder, or vice-versa.\n */\n public addQuantizedVertex(position: XYAndZ, uv: XAndY, normal?: number): number {\n precondition((undefined === normal) === (undefined === this.normals), \"RealityMeshParams requires all vertices to have normals, or none.\");\n\n this.positions.push(position);\n this.uvs.push(uv);\n if (undefined !== normal) {\n assert(undefined !== this.normals);\n this.normals.push(normal);\n }\n\n return this.positions.length - 1;\n }\n\n /** Add a triangle corresponding to the three specified vertices. */\n public addTriangle(i0: number, i1: number, i2: number): void {\n this.addIndex(i0);\n this.addIndex(i1);\n this.addIndex(i2);\n }\n\n /** Add two triangles sharing an edge. This is equivalent to calling `addTriangle(i0, i1, i2); addTriangle(i1, i3, i2);`. */\n public addQuad(i0: number, i1: number, i2: number, i3: number): void {\n this.addTriangle(i0, i1, i2);\n this.addTriangle(i1, i3, i2);\n }\n\n /** Add all of the indices in `indices` to the index buffer. */\n public addIndices(indices: Iterable<number>): void {\n for (const index of indices)\n this.addIndex(index);\n }\n\n private addIndex(index: number): void {\n this.indices.push(index);\n }\n\n /** Extract the finished [[RealityMeshParams]].\n * @throws Error if the mesh contains no triangles.\n */\n public finish(): RealityMeshParams {\n precondition(this.positions.length >= 3 && this.indices.length >= 3, \"RealityMeshParams requires at least one triangle\");\n return {\n positions: this.positions.finish(),\n uvs: this.uvs.finish(),\n normals: this.normals?.toTypedArray(),\n indices: this.indices.toTypedArray(),\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderClipVolume.js","sourceRoot":"","sources":["../../../src/render/RenderClipVolume.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;;;;GAKG;AACH,MAAM,OAAgB,gBAAgB;IAIpC,YAAsB,UAAsB;QAC1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { ClipVector } from \"@itwin/core-geometry\";\r\n\r\n/** An opaque representation of a clip volume applied to geometry within a [[Viewport]].\r\n * A RenderClipVolume is created from a [[ClipVector]] and takes ownership of that ClipVector, expecting that it will not be modified while the RenderClipVolume still references it.\r\n * @see [[RenderSystem.createClipVolume]] to create a clip volume.\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class RenderClipVolume {\r\n /** The ClipVector from which this volume was created. It must not be modified. */\r\n public readonly clipVector: ClipVector;\r\n\r\n protected constructor(clipVector: ClipVector) {\r\n this.clipVector = clipVector;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RenderClipVolume.js","sourceRoot":"","sources":["../../../src/render/RenderClipVolume.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH;;;;;GAKG;AACH,MAAM,OAAgB,gBAAgB;IAIpC,YAAsB,UAAsB;QAC1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { ClipVector } from \"@itwin/core-geometry\";\n\n/** An opaque representation of a clip volume applied to geometry within a [[Viewport]].\n * A RenderClipVolume is created from a [[ClipVector]] and takes ownership of that ClipVector, expecting that it will not be modified while the RenderClipVolume still references it.\n * @see [[RenderSystem.createClipVolume]] to create a clip volume.\n * @public\n * @extensions\n */\nexport abstract class RenderClipVolume {\n /** The ClipVector from which this volume was created. It must not be modified. */\n public readonly clipVector: ClipVector;\n\n protected constructor(clipVector: ClipVector) {\n this.clipVector = clipVector;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderGraphic.js","sourceRoot":"","sources":["../../../src/render/RenderGraphic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAa;CAKlC;AAED;;;;;;GAMG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,aAAa;IAG5D,6EAA6E;IACtE,OAAO,KAAW,CAAC;IAC1B,qCAAqC;IAC9B,cAAc,KAAW,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACzD,gBAAgB;IACT,iBAAiB,CAAC,KAA8B,IAAU,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAC1G","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { IDisposable } from \"@itwin/core-bentley\";\r\nimport { RenderMemory } from \"./RenderMemory\";\r\n\r\n/** Abstract representation of an object which can be rendered by a [[RenderSystem]].\r\n * Two broad classes of graphics exist:\r\n * - \"Scene\" graphics generated on the back-end to represent the contents of the models displayed in a [[Viewport]]; and\r\n * - [[Decorations]] created on the front-end to be rendered along with the scene.\r\n * The latter are produced using a [[GraphicBuilder]].\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class RenderGraphic implements IDisposable /* , RenderMemory.Consumer */ {\r\n public abstract dispose(): void;\r\n\r\n /** @internal */\r\n public abstract collectStatistics(stats: RenderMemory.Statistics): void;\r\n}\r\n\r\n/** A graphic that owns another graphic. By default, every time a [[Viewport]]'s decorations or dynamics graphics change, the previous graphics are disposed of.\r\n * Use a GraphicOwner to prevent disposal of a graphic that you want to reuse. The graphic owner can be added to decorations and list of dynamics just like any other graphic, but the graphic it owns\r\n * will never be automatically disposed of. Instead, you assume responsibility for disposing of the owned graphic by calling [[disposeGraphic]] when the owned graphic is no longer in use. Failure\r\n * to do so will result in leaks of graphics memory or other webgl resources.\r\n * @public\r\n * @extensions\r\n */\r\nexport abstract class RenderGraphicOwner extends RenderGraphic {\r\n /** The owned graphic. */\r\n public abstract get graphic(): RenderGraphic;\r\n /** Does nothing. To dispose of the owned graphic, use [[disposeGraphic]]. */\r\n public dispose(): void { }\r\n /** Disposes of the owned graphic. */\r\n public disposeGraphic(): void { this.graphic.dispose(); }\r\n /** @internal */\r\n public collectStatistics(stats: RenderMemory.Statistics): void { this.graphic.collectStatistics(stats); }\r\n}\r\n\r\n/** An array of [[RenderGraphic]]s.\r\n * @public\r\n * @extensions\r\n */\r\nexport type GraphicList = RenderGraphic[];\r\n"]}
1
+ {"version":3,"file":"RenderGraphic.js","sourceRoot":"","sources":["../../../src/render/RenderGraphic.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAa;CAKlC;AAED;;;;;;GAMG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,aAAa;IAG5D,6EAA6E;IACtE,OAAO,KAAW,CAAC;IAC1B,qCAAqC;IAC9B,cAAc,KAAW,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACzD,gBAAgB;IACT,iBAAiB,CAAC,KAA8B,IAAU,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAC1G","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { IDisposable } from \"@itwin/core-bentley\";\nimport { RenderMemory } from \"./RenderMemory\";\n\n/** Abstract representation of an object which can be rendered by a [[RenderSystem]].\n * Two broad classes of graphics exist:\n * - \"Scene\" graphics generated on the back-end to represent the contents of the models displayed in a [[Viewport]]; and\n * - [[Decorations]] created on the front-end to be rendered along with the scene.\n * The latter are produced using a [[GraphicBuilder]].\n * @public\n * @extensions\n */\nexport abstract class RenderGraphic implements IDisposable /* , RenderMemory.Consumer */ {\n public abstract dispose(): void;\n\n /** @internal */\n public abstract collectStatistics(stats: RenderMemory.Statistics): void;\n}\n\n/** A graphic that owns another graphic. By default, every time a [[Viewport]]'s decorations or dynamics graphics change, the previous graphics are disposed of.\n * Use a GraphicOwner to prevent disposal of a graphic that you want to reuse. The graphic owner can be added to decorations and list of dynamics just like any other graphic, but the graphic it owns\n * will never be automatically disposed of. Instead, you assume responsibility for disposing of the owned graphic by calling [[disposeGraphic]] when the owned graphic is no longer in use. Failure\n * to do so will result in leaks of graphics memory or other webgl resources.\n * @public\n * @extensions\n */\nexport abstract class RenderGraphicOwner extends RenderGraphic {\n /** The owned graphic. */\n public abstract get graphic(): RenderGraphic;\n /** Does nothing. To dispose of the owned graphic, use [[disposeGraphic]]. */\n public dispose(): void { }\n /** Disposes of the owned graphic. */\n public disposeGraphic(): void { this.graphic.dispose(); }\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void { this.graphic.collectStatistics(stats); }\n}\n\n/** An array of [[RenderGraphic]]s.\n * @public\n * @extensions\n */\nexport type GraphicList = RenderGraphic[];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderMaterial.js","sourceRoot":"","sources":["../../../src/render/RenderMaterial.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { ColorDef, NormalMapParams, RenderTexture, RgbColorProps, TextureMapping } from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../IModelConnection\";\r\n\r\n/** Specifies the provenance of a [RenderMaterial]($common) created for a persistent material element.\r\n * @see [[CreateRenderMaterialArgs.source]].\r\n * @internal\r\n */\r\nexport interface RenderMaterialSource {\r\n iModel: IModelConnection;\r\n id: Id64String;\r\n}\r\n\r\n/** Describes the [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of a [RenderMaterial]($common).\r\n * @see [[CreateRenderMaterialArgs.diffuse]].\r\n * @public\r\n */\r\nexport interface MaterialDiffuseProps {\r\n /** The diffuse color. If defined, this overrides the color of any surface to which the material is applied. */\r\n color?: ColorDef | RgbColorProps;\r\n\r\n /** A multiplier in [0..1] specifying how strongly the diffuse color reflects light.\r\n * Default: 0.6\r\n */\r\n weight?: number;\r\n}\r\n\r\n/** Describes the [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of a material.\r\n * @see [[CreateRenderMaterialArgs.specular]].\r\n * @public\r\n */\r\nexport interface MaterialSpecularProps {\r\n /** The color of the specular reflections.\r\n * Default: white.\r\n */\r\n color?: ColorDef | RgbColorProps;\r\n\r\n /** A multiplier in [0..1] specifying the strength of the specular reflections.\r\n * Default: 0.4\r\n */\r\n weight?: number;\r\n\r\n /** An exponent in [0..infinity] describing the shininess of the surface.\r\n * Default: 13.5\r\n */\r\n exponent?: number;\r\n}\r\n\r\n/** Describes how to map a [RenderTexture]($common)'s image to the surfaces to which a [RenderMaterial]($common) is applied.\r\n * @see [[CreateRenderMaterialArgs.textureMapping]].\r\n * @public\r\n */\r\nexport interface MaterialTextureMappingProps {\r\n /** The texture from which the image is obtained. */\r\n texture: RenderTexture;\r\n\r\n /** The parameters describing a normal map to use either in place of or in addition to the texture. */\r\n normalMapParams?: NormalMapParams;\r\n\r\n /** The mode controlling how the image is mapped onto the surface.\r\n * Default: [TextureMapping.Mode.Parametric]($common).\r\n */\r\n mode?: TextureMapping.Mode;\r\n\r\n /** A 2x3 matrix for computing the UV coordinates.\r\n * Default: [TextureMapping.Trans2x3.identity]($common).\r\n */\r\n transform?: TextureMapping.Trans2x3;\r\n\r\n /** The ratio by which the color sampled from the texture image is mixed with the surface's or material's diffuse color.\r\n * A ratio of 1 selects only the texture sample; a ratio of 0 selects only the diffuse color; a ratio of 0.5 mixes them evenly.\r\n * Default: 1.\r\n */\r\n weight?: number;\r\n\r\n /** @internal */\r\n worldMapping?: boolean;\r\n}\r\n\r\n/** Arguments supplied to [[RenderSystem.createRenderMaterial]].\r\n * @public\r\n */\r\nexport interface CreateRenderMaterialArgs {\r\n /** If supplied, the material will be cached on the iModel by its element Id for subsequent reuse.\r\n * @internal\r\n */\r\n source?: RenderMaterialSource;\r\n\r\n /** Specifies the transparency of the material from 0.0 (fully transparent) to 1.0 (fully opaque).\r\n * If defined, this overrides the transparency of any surface to which the material is applied, and is multiplied with the\r\n * transparency of the material's [[textureMapping]] when sampling the texture.\r\n */\r\n alpha?: number;\r\n\r\n /** The [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of the material. */\r\n diffuse?: MaterialDiffuseProps;\r\n\r\n /** The [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of the material. */\r\n specular?: MaterialSpecularProps;\r\n\r\n /** Maps [RenderTexture]($common) images to the surfaces to which the material is applied to customize their appearance. */\r\n textureMapping?: MaterialTextureMappingProps;\r\n}\r\n"]}
1
+ {"version":3,"file":"RenderMaterial.js","sourceRoot":"","sources":["../../../src/render/RenderMaterial.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { ColorDef, NormalMapParams, RenderTexture, RgbColorProps, TextureMapping } from \"@itwin/core-common\";\nimport { IModelConnection } from \"../IModelConnection\";\n\n/** Specifies the provenance of a [RenderMaterial]($common) created for a persistent material element.\n * @see [[CreateRenderMaterialArgs.source]].\n * @internal\n */\nexport interface RenderMaterialSource {\n iModel: IModelConnection;\n id: Id64String;\n}\n\n/** Describes the [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of a [RenderMaterial]($common).\n * @see [[CreateRenderMaterialArgs.diffuse]].\n * @public\n */\nexport interface MaterialDiffuseProps {\n /** The diffuse color. If defined, this overrides the color of any surface to which the material is applied. */\n color?: ColorDef | RgbColorProps;\n\n /** A multiplier in [0..1] specifying how strongly the diffuse color reflects light.\n * Default: 0.6\n */\n weight?: number;\n}\n\n/** Describes the [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of a material.\n * @see [[CreateRenderMaterialArgs.specular]].\n * @public\n */\nexport interface MaterialSpecularProps {\n /** The color of the specular reflections.\n * Default: white.\n */\n color?: ColorDef | RgbColorProps;\n\n /** A multiplier in [0..1] specifying the strength of the specular reflections.\n * Default: 0.4\n */\n weight?: number;\n\n /** An exponent in [0..infinity] describing the shininess of the surface.\n * Default: 13.5\n */\n exponent?: number;\n}\n\n/** Describes how to map a [RenderTexture]($common)'s image to the surfaces to which a [RenderMaterial]($common) is applied.\n * @see [[CreateRenderMaterialArgs.textureMapping]].\n * @public\n */\nexport interface MaterialTextureMappingProps {\n /** The texture from which the image is obtained. */\n texture: RenderTexture;\n\n /** The parameters describing a normal map to use either in place of or in addition to the texture. */\n normalMapParams?: NormalMapParams;\n\n /** The mode controlling how the image is mapped onto the surface.\n * Default: [TextureMapping.Mode.Parametric]($common).\n */\n mode?: TextureMapping.Mode;\n\n /** A 2x3 matrix for computing the UV coordinates.\n * Default: [TextureMapping.Trans2x3.identity]($common).\n */\n transform?: TextureMapping.Trans2x3;\n\n /** The ratio by which the color sampled from the texture image is mixed with the surface's or material's diffuse color.\n * A ratio of 1 selects only the texture sample; a ratio of 0 selects only the diffuse color; a ratio of 0.5 mixes them evenly.\n * Default: 1.\n */\n weight?: number;\n\n /** @internal */\n worldMapping?: boolean;\n}\n\n/** Arguments supplied to [[RenderSystem.createRenderMaterial]].\n * @public\n */\nexport interface CreateRenderMaterialArgs {\n /** If supplied, the material will be cached on the iModel by its element Id for subsequent reuse.\n * @internal\n */\n source?: RenderMaterialSource;\n\n /** Specifies the transparency of the material from 0.0 (fully transparent) to 1.0 (fully opaque).\n * If defined, this overrides the transparency of any surface to which the material is applied, and is multiplied with the\n * transparency of the material's [[textureMapping]] when sampling the texture.\n */\n alpha?: number;\n\n /** The [diffuse](https://en.wikipedia.org/wiki/Diffuse_reflection) properties of the material. */\n diffuse?: MaterialDiffuseProps;\n\n /** The [specular](https://en.wikipedia.org/wiki/Specular_highlight) properties of the material. */\n specular?: MaterialSpecularProps;\n\n /** Maps [RenderTexture]($common) images to the surfaces to which the material is applied to customize their appearance. */\n textureMapping?: Ma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;QACxF,gBAAgB;QACT,cAAc,CAAC,QAAgB,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC9F,gBAAgB;QACT,aAAa,CAAC,QAAgB,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5F,gBAAgB;QACT,UAAU,CAAC,QAAgB;YAChC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;QACD,gBAAgB;QACT,cAAc,CAAC,QAAgB;YACpC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,gBAAgB;QACT,YAAY,CAAC,QAAgB,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;KAC1F;IAlHY,uBAAU,aAkHtB,CAAA;AAMH,CAAC,EAvNgB,YAAY,KAAZ,YAAY,QAuN5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\n/** APIs for querying memory consumed by the [[RenderSystem]].\r\n * Use methods like [[Viewport.collectStatistics]] and [[TileTreeReference.collectStatistics]] to query this memory usage.\r\n * @public\r\n */\r\nexport namespace RenderMemory {\r\n /** Describes memory consumed by a particular type of resource.\r\n * @internal\r\n */\r\n export class Consumers {\r\n public totalBytes = 0; // total number of bytes consumed by all consumers\r\n public maxBytes = 0; // largest number of bytes consumed by a single consumer\r\n public count = 0; // total number of consumers of this type\r\n\r\n public addConsumer(numBytes: number): void {\r\n this.totalBytes += numBytes;\r\n this.maxBytes = Math.max(this.maxBytes, numBytes);\r\n ++this.count;\r\n }\r\n\r\n public clear(): void {\r\n this.totalBytes = this.maxBytes = this.count = 0;\r\n }\r\n }\r\n\r\n /** @internal */\r\n export enum BufferType {\r\n Surfaces = 0,\r\n VisibleEdges,\r\n SilhouetteEdges,\r\n PolylineEdges,\r\n IndexedEdges,\r\n Polylines,\r\n PointStrings,\r\n PointClouds,\r\n Instances,\r\n Terrain,\r\n RealityMesh,\r\n\r\n COUNT,\r\n }\r\n\r\n /** Describes memory consumed by GPU-allocated buffers.\r\n * @internal\r\n */\r\n export class Buffers extends Consumers {\r\n public readonly consumers: Consumers[];\r\n\r\n public constructor() {\r\n super();\r\n this.consumers = [];\r\n for (let i = 0; i < BufferType.COUNT; i++)\r\n this.consumers[i] = new Consumers();\r\n }\r\n\r\n public get surfaces() { return this.consumers[BufferType.Surfaces]; }\r\n public get visibleEdges() { return this.consumers[BufferType.VisibleEdges]; }\r\n public get indexedEdges() { return this.consumers[BufferType.IndexedEdges]; }\r\n public get silhouetteEdges() { return this.consumers[BufferType.SilhouetteEdges]; }\r\n public get polylineEdges() { return this.consumers[BufferType.PolylineEdges]; }\r\n public get polylines() { return this.consumers[BufferType.Polylines]; }\r\n public get pointStrings() { return this.consumers[BufferType.PointStrings]; }\r\n public get pointClouds() { return this.consumers[BufferType.PointClouds]; }\r\n public get instances() { return this.consumers[BufferType.Instances]; }\r\n public get terrain() { return this.consumers[BufferType.Terrain]; }\r\n public get reality() { return this.consumers[BufferType.RealityMesh]; }\r\n\r\n public override clear(): void {\r\n for (const consumer of this.consumers)\r\n consumer.clear();\r\n\r\n super.clear();\r\n }\r\n\r\n public addBuffer(type: BufferType, numBytes: number): void {\r\n this.addConsumer(numBytes);\r\n this.consumers[type].addConsumer(numBytes);\r\n }\r\n }\r\n\r\n /** @internal */\r\n export enum ConsumerType {\r\n Textures = 0,\r\n VertexTables,\r\n EdgeTables,\r\n FeatureTables,\r\n FeatureOverrides,\r\n ClipVolumes,\r\n PlanarClassifiers,\r\n ShadowMaps,\r\n TextureAttachments,\r\n ThematicTextures,\r\n COUNT,\r\n }\r\n\r\n /** Contains statistics about the amount and type of memory consumed by the [[RenderSystem]].\r\n * Use methods like [[Viewport.collectStatistics]] and [[TileTreeReference.collectStatistics]] to query this memory usage.\r\n * @see [[Statistics.create]] to instantiate an instance of this class.\r\n * @public\r\n */\r\n export class Statistics {\r\n private _totalBytes = 0;\r\n\r\n /** @internal */\r\n public readonly consumers: Consumers[];\r\n /** @internal */\r\n public readonly buffers = new Buffers();\r\n\r\n /** Create a new, empty statistics object. */\r\n public static create(): Statistics {\r\n return new Statistics();\r\n }\r\n\r\n /** @internal */\r\n public constructor() {\r\n this.consumers = [];\r\n for (let i = 0; i < ConsumerType.COUNT; i++)\r\n this.consumers[i] = new Consumers();\r\n }\r\n\r\n /** The total reported memory consumption, in bytes.\r\n * @note A web browser provides no direct access to actual memory used by the host device or its graphics hardware. The reported memory usage\r\n * is an estimate based on the number of bytes of data requested via WebGL APIs. It is always an *under-estimate* as each WebGL implementation imposes\r\n * its own additional overhead.\r\n */\r\n public get totalBytes(): number { return this._totalBytes; }\r\n /** @internal */\r\n public get textures() { return this.consumers[ConsumerType.Textures]; }\r\n /** @internal */\r\n public get vertexTables() { return this.consumers[ConsumerType.VertexTables]; }\r\n /** @internal */\r\n public get edgeTables() { return this.consumers[ConsumerType.EdgeTables]; }\r\n /** @internal */\r\n public get featureTables() { return this.consumers[ConsumerType.FeatureTables]; }\r\n /** @internal */\r\n public get thematicTextures() { return this.consumers[ConsumerType.ThematicTextures]; }\r\n /** @internal */\r\n public get featureOverrides() { return this.consumers[ConsumerType.FeatureOverrides]; }\r\n /** @internal */\r\n public get clipVolumes() { return this.consumers[ConsumerType.ClipVolumes]; }\r\n /** @internal */\r\n public get planarClassifiers() { return this.consumers[ConsumerType.PlanarClassifiers]; }\r\n /** @internal */\r\n public get shadowMaps() { return this.consumers[ConsumerType.ShadowMaps]; }\r\n /** @internal */\r\n public get textureAttachments() { return this.consumers[ConsumerType.TextureAttachments]; }\r\n\r\n /** @internal */\r\n public addBuffer(type: BufferType, numBytes: number): void {\r\n this._totalBytes += numBytes;\r\n this.buffers.addBuffer(type, numBytes);\r\n }\r\n\r\n /** @internal */\r\n public addConsumer(type: ConsumerType, numBytes: number): void {\r\n this._totalBytes += numBytes;\r\n this.consumers[type].addConsumer(numBytes);\r\n }\r\n\r\n /** @internal */\r\n public clear(): void {\r\n this._totalBytes = 0;\r\n this.buffers.clear();\r\n for (const consumer of this.consumers)\r\n consumer.clear();\r\n }\r\n\r\n /** @internal */\r\n public addTexture(numBytes: number) { this.addConsumer(ConsumerType.Textures, numBytes); }\r\n /** @internal */\r\n public addVertexTable(numBytes: number) { this.addConsumer(ConsumerType.VertexTables, numBytes); }\r\n /** @internal */\r\n public addEdgeTable(numBytes: number) { this.addConsumer(ConsumerType.EdgeTables, numBytes); }\r\n /** @internal */\r\n public addFeatureTable(numBytes: number) { this.addConsumer(ConsumerType.FeatureTables, numBytes); }\r\n /** @internal */\r\n public addThematicTexture(numBytes: number) { this.addConsumer(ConsumerType.ThematicTextures, numBytes); }\r\n /** @internal */\r\n public addFeatureOverrides(numBytes: number) { this.addConsumer(ConsumerType.FeatureOverrides, numBytes); }\r\n /** @internal */\r\n public addClipVolume(numBytes: number) { this.addConsumer(ConsumerType.ClipVolumes, numBytes); }\r\n /** @internal */\r\n public addPlanarClassifier(numBytes: number) { this.addConsumer(ConsumerType.PlanarClassifiers, numBytes); }\r\n /** @internal */\r\n public addShadowMap(numBytes: number) { this.addConsumer(ConsumerType.ShadowMaps, numBytes); }\r\n /** @internal */\r\n public addTextureAttachment(numBytes: number) { this.addConsumer(ConsumerType.TextureAttachments, numBytes); }\r\n\r\n /** @internal */\r\n public addSurface(numBytes: number) { this.addBuffer(BufferType.Surfaces, numBytes); }\r\n /** @internal */\r\n public addVisibleEdges(numBytes: number) { this.addBuffer(BufferType.VisibleEdges, numBytes); }\r\n /** @internal */\r\n public addIndexedEdges(numBytes: number) { this.addBuffer(BufferType.IndexedEdges, numBytes); }\r\n /** @internal */\r\n public addSilhouetteEdges(numBytes: number) { this.addBuffer(BufferType.SilhouetteEdges, numBytes); }\r\n /** @internal */\r\n public addPolylineEdges(numBytes: number) { this.addBuffer(BufferType.PolylineEdges, numBytes); }\r\n /** @internal */\r\n public addPolyline(numBytes: number) { this.addBuffer(BufferType.Polylines, numBytes); }\r\n /** @internal */\r\n public addPointString(numBytes: number) { this.addBuffer(BufferType.PointStrings, numBytes); }\r\n /** @internal */\r\n public addPointCloud(numBytes: number) { this.addBuffer(BufferType.PointClouds, numBytes); }\r\n /** @internal */\r\n public addTerrain(numBytes: number) {\r\n this.addBuffer(BufferType.Terrain, numBytes);\r\n }\r\n /** @internal */\r\n public addRealityMesh(numBytes: number) {\r\n this.addBuffer(BufferType.RealityMesh, numBytes);\r\n }\r\n /** @internal */\r\n public addInstances(numBytes: number) { this.addBuffer(BufferType.Instances, numBytes); }\r\n }\r\n\r\n /** @internal */\r\n export interface Consumer {\r\n collectStatistics(stats: Statistics): void;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"RenderMemory.js","sourceRoot":"","sources":["../../../src/render/RenderMemory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,KAAW,YAAY,CAuN5B;AAvND,WAAiB,YAAY;IAC3B;;OAEG;IACH,MAAa,SAAS;QAAtB;YACS,eAAU,GAAG,CAAC,CAAC,CAAC,kDAAkD;YAClE,aAAQ,GAAG,CAAC,CAAC,CAAC,wDAAwD;YACtE,UAAK,GAAG,CAAC,CAAC,CAAC,yCAAyC;QAW7D,CAAC;QATQ,WAAW,CAAC,QAAgB;YACjC,IAAI,CAAC,UAAU,IAAI,QAAQ,CAAC;YAC5B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAClD,EAAE,IAAI,CAAC,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QAAQ,CAAC,CAAC,CAAC,CAAC;KAC1F;IAlHY,uBAAU,aAkHtB,CAAA;AAMH,CAAC,EAvNgB,YAAY,KAAZ,YAAY,QAuN5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\n/** APIs for querying memory consumed by the [[RenderSystem]].\n * Use methods like [[Viewport.collectStatistics]] and [[TileTreeReference.collectStatistics]] to query this memory usage.\n * @public\n */\nexport namespace RenderMemory {\n /** Describes memory consumed by a particular type of resource.\n * @internal\n */\n export class Consumers {\n public totalBytes = 0; // total number of bytes consumed by all consumers\n public maxBytes = 0; // largest number of bytes consumed by a single consumer\n public count = 0; // total number of consumers of this type\n\n public addConsumer(numBytes: number): void {\n this.totalBytes += numBytes;\n this.maxBytes = Math.max(this.maxBytes, numBytes);\n ++this.count;\n }\n\n public clear(): void {\n this.totalBytes = this.maxBytes = this.count = 0;\n }\n }\n\n /** @internal */\n export enum BufferType {\n Surfaces = 0,\n VisibleEdges,\n SilhouetteEdges,\n PolylineEdges,\n IndexedEdges,\n Polylines,\n PointStrings,\n PointClouds,\n Instances,\n Terrain,\n RealityMesh,\n\n COUNT,\n }\n\n /** Describes memory consumed by GPU-allocated buffers.\n * @internal\n */\n export class Buffers extends Consumers {\n public readonly consumers: Consumers[];\n\n public constructor() {\n super();\n this.consumers = [];\n for (let i = 0; i < BufferType.COUNT; i++)\n this.consumers[i] = new Consumers();\n }\n\n public get surfaces() { return this.consumers[BufferType.Surfaces]; }\n public get visibleEdges() { return this.consumers[BufferType.VisibleEdges]; }\n public get indexedEdges() { return this.consumers[BufferType.IndexedEdges]; }\n public get silhouetteEdges() { return this.consumers[BufferType.SilhouetteEdges]; }\n public get polylineEdges() { return this.consumers[BufferType.PolylineEdges]; }\n public get polylines() { return this.consumers[BufferType.Polylines]; }\n public get pointStrings() { return this.consumers[BufferType.PointStrings]; }\n public get pointClouds() { return this.consumers[BufferType.PointClouds]; }\n public get instances() { return this.consumers[BufferType.Instances]; }\n public get terrain() { return this.consumers[BufferType.Terrain]; }\n public get reality() { return this.consumers[BufferType.RealityMesh]; }\n\n public override clear(): void {\n for (const consumer of this.consumers)\n consumer.clear();\n\n super.clear();\n }\n\n public addBuffer(type: BufferType, numBytes: number): void {\n this.addConsumer(numBytes);\n this.consumers[type].addConsumer(numBytes);\n }\n }\n\n /** @internal */\n export enum ConsumerType {\n Textures = 0,\n VertexTables,\n EdgeTables,\n FeatureTables,\n FeatureOverrides,\n ClipVolumes,\n PlanarClassifiers,\n ShadowMaps,\n TextureAttachments,\n ThematicTextures,\n COUNT,\n }\n\n /** Contains statistics about the amount and type of memory consumed by the [[RenderSystem]].\n * Use methods like [[Viewport.collectStatistics]] and [[TileTreeReference.collectStatistics]] to query this memory usage.\n * @see [[Statistics.create]] to instantiate an instance of this class.\n * @public\n */\n export class Statistics {\n private _totalBytes = 0;\n\n /** @internal */\n public readonly consumers: Consumers[];\n /** @internal */\n public readonly buffers = new Buffers();\n\n /** Create a new, empty statistics object. */\n public static create(): Statistics {\n return new Statistics();\n }\n\n /** @internal */\n public constructor() {\n this.consumers = [];\n for (let i = 0; i < ConsumerType.COUNT; i++)\n this.consumers[i] = new Consumers();\n }\n\n /** The total reported memory consumption, in bytes.\n * @note A web browser provides no direct access to actual memory used by the host device or its graphics hardware. The reported memory usage\n * is an estimate based on the number of bytes of data requested via WebGL APIs. It is always an *under-estimate* as each WebGL implementation imposes\n * its own additional overhead.\n */\n public get totalBytes(): number { return this._totalBytes; }\n /** @internal */\n public get textures() { return this.consumers[ConsumerType.Textures]; }\n /** @internal */\n public get vertexTables() { return this.consumers[ConsumerType.VertexTables]; }\n /** @internal */\n public get edgeTables() { return this.consumers[ConsumerType.EdgeTables]; }\n /** @internal */\n public get featureTables() { return this.consumers[ConsumerType.FeatureTables]; }\n /** @internal */\n public get thematicTextures() { return this.consumers[ConsumerType.ThematicTextures]; }\n /** @internal */\n public get featureOverrides() { return this.consumers[ConsumerType.FeatureOverrides]; }\n /** @internal */\n public get clipVolumes() { return this.consumers[ConsumerType.ClipVolumes]; }\n /** @internal */\n public get planarClassifiers() { return this.consumers[ConsumerType.PlanarClassifiers]; }\n /** @internal */\n public get shadowMaps() { return this.consumers[ConsumerType.ShadowMaps]; }\n /** @internal */\n public get textureAttachments() { return this.consumers[ConsumerType.TextureAttachments]; }\n\n /** @internal */\n public addBuffer(type: BufferType, numBytes: number): void {\n this._totalBytes += numBytes;\n this.buffers.addBuffer(type, numBytes);\n }\n\n /** @internal */\n public addConsumer(type: ConsumerType, numBytes: number): void {\n this._totalBytes += numBytes;\n this.consumers[type].addConsumer(numBytes);\n }\n\n /** @internal */\n public clear(): void {\n this._totalBytes = 0;\n this.buffers.clear();\n for (const consumer of this.consumers)\n consumer.clear();\n }\n\n /** @internal */\n public addTexture(numBytes: number) { this.addConsumer(ConsumerType.Textures, numBytes); }\n /** @internal */\n public addVertexTable(numBytes: number) { this.addConsumer(ConsumerType.VertexTables, numBytes); }\n /** @internal */\n public addEdgeTable(numBytes: number) { this.addConsumer(ConsumerType.EdgeTables, numBytes); }\n /** @internal */\n public addFeatureTable(numBytes: number) { this.addConsumer(ConsumerType.FeatureTables, numBytes); }\n /** @internal */\n public addThematicTexture(numBytes: number) { this.addConsumer(ConsumerType.ThematicTextures, numBytes); }\n /** @internal */\n public addFeatureOverrides(numBytes: number) { this.addConsumer(ConsumerType.FeatureOverrides, numBytes); }\n /** @internal */\n public addClipVolume(numBytes: number) { this.addConsumer(ConsumerType.ClipVolumes, numBytes); }\n /** @internal */\n public addPlanarClassifier(numBytes: number) { this.addConsumer(ConsumerType.PlanarClassifiers, numBytes); }\n /** @internal */\n public addShadowMap(numBytes: number) { this.addConsumer(ConsumerType.ShadowMaps, numBytes); }\n /** @internal */\n public addTextureAttachment(numBytes: number) { this.addConsumer(ConsumerType.TextureAttachments, numBytes); }\n\n /** @internal */\n public addSurface(numBytes: number) { this.addBuffer(BufferType.Surfaces, numBytes); }\n /** @internal */\n public addVisibleEdges(numBytes: number) { this.addBuffer(BufferType.VisibleEdges, numBytes); }\n /** @internal */\n public addIndexedEdges(numBytes: number) { this.addBuffer(BufferType.IndexedEdges, numBytes); }\n /** @internal */\n public addSilhouetteEdges(numBytes: number) { this.addBuffer(BufferType.SilhouetteEdges, numBytes); }\n /** @internal */\n public addPolylineEdges(numBytes: number) { this.addBuffer(BufferType.PolylineEdges, numBytes); }\n /** @internal */\n public addPolyline(numBytes: number) { this.addBuffer(BufferType.Polylines, numBytes); }\n /** @internal */\n public addPointString(numBytes: number) { this.addBuffer(BufferType.PointStrings, numBytes); }\n /** @internal */\n public addPointCloud(numBytes: number) { this.addBuffer(BufferType.PointClouds, numBytes); }\n /** @internal */\n public addTerrain(numBytes: number) {\n this.addBuffer(BufferType.Terrain, numBytes);\n }\n /** @internal */\n public addRealityMesh(numBytes: number) {\n this.addBuffer(BufferType.RealityMesh, numBytes);\n }\n /** @internal */\n public addInstances(numBytes: number) { this.addBuffer(BufferType.Instances, numBytes); }\n }\n\n /** @internal */\n export interface Consumer {\n collectStatistics(stats: Statistics): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderPlan.js","sourceRoot":"","sources":["../../../src/render/RenderPlan.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACwC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAc,MAAM,EAAiB,cAAc,EAAE,GAAG,EAC5G,SAAS,EAAE,4BAA4B,GACxE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAc,QAAQ,EAAY,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AACrC,M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gB;QAChB,aAAa;QACb,IAAI;QACJ,SAAS;QACT,KAAK;QACL,aAAa;QACb,EAAE;QACF,QAAQ;QACR,UAAU;QACV,eAAe;QACf,eAAe;QACf,OAAO;QACP,QAAQ;QACR,oBAAoB;QACpB,aAAa;QACb,eAAe;QACf,QAAQ;QACR,MAAM;QACN,oBAAoB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,oBAAoB;QACnE,SAAS;KACV,CAAC;AACJ,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/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport {\r\n AmbientOcclusion, AnalysisStyle, Atmosphere, ClipStyle, ColorDef, Frustum, GlobeMode, HiddenLine, Hilite, LightSettings, MonochromeMode, Npc,\r\n RenderTexture, ThematicDisplay, ViewFlags, WhiteOnWhiteReversalSettings,\r\n} from \"@itwin/core-common\";\r\nimport { ClipVector, Constant, Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { FlashSettings } from \"../FlashSettings\";\r\nimport { Viewport } from \"../Viewport\";\r\nimport { ViewState3d } from \"../ViewState\";\r\n\r\nconst scratchPoint3a = new Point3d();\r\nconst scratchPoint3b = new Point3d();\r\nconst scratchPoint3c = new Point3d();\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class RenderPlanEllipsoid {\r\n public readonly ellipsoidCenter: Point3d;\r\n public readonly ellipsoidRotation: Matrix3d;\r\n public readonly ellipsoidRadii: Point3d;\r\n\r\n constructor(ellipsoidCenter: Point3d, ellipsoidRotation: Matrix3d, ellipsoidRadii: Point3d) {\r\n this.ellipsoidCenter = ellipsoidCenter;\r\n this.ellipsoidRotation = ellipsoidRotation;\r\n this.ellipsoidRadii = ellipsoidRadii;\r\n }\r\n\r\n public equals(other: RenderPlanEllipsoid): boolean {\r\n if (this.ellipsoidCenter.isAlmostEqual(other.ellipsoidCenter))\r\n return false;\r\n if (this.ellipsoidRotation.isAlmostEqual(other.ellipsoidRotation))\r\n return false;\r\n if (this.ellipsoidRadii.isAlmostEqual(other.ellipsoidRadii))\r\n return false;\r\n return true;\r\n }\r\n}\r\n\r\n/** A RenderPlan holds a Frustum and the render settings for displaying a RenderScene into a RenderTarget.\r\n * @internal\r\n */\r\nexport interface RenderPlan {\r\n readonly is3d: boolean;\r\n readonly viewFlags: ViewFlags;\r\n readonly bgColor: ColorDef;\r\n readonly monoColor: ColorDef;\r\n readonly monochromeMode: MonochromeMode;\r\n readonly hiliteSettings: Hilite.Settings;\r\n readonly emphasisSettings: Hilite.Settings;\r\n readonly flashSettings: FlashSettings;\r\n readonly clip?: ClipVector;\r\n readonly clipStyle: ClipStyle;\r\n readonly hline?: HiddenLine.Settings;\r\n readonly analysisStyle?: AnalysisStyle;\r\n readonly ao?: AmbientOcclusion.Settings;\r\n readonly thematic?: ThematicDisplay;\r\n readonly atmosphere?: Atmosphere.Settings;\r\n readonly isFadeOutActive: boolean;\r\n readonly analysisTexture?: RenderTexture;\r\n readonly frustum: Frustum;\r\n readonly fraction: number;\r\n readonly globalViewTransition: number;\r\n readonly isGlobeMode3D: boolean;\r\n readonly backgroundMapOn: boolean;\r\n readonly upVector: Vector3d;\r\n readonly lights?: LightSettings;\r\n readonly whiteOnWhiteReversal: WhiteOnWhiteReversalSettings;\r\n readonly ellipsoid?: RenderPlanEllipsoid;\r\n}\r\n\r\n/** @internal */\r\nexport function createEmptyRenderPlan(): RenderPlan {\r\n return {\r\n is3d: true,\r\n viewFlags: new ViewFlags(),\r\n bgColor: ColorDef.white,\r\n monoColor: ColorDef.white,\r\n monochromeMode: MonochromeMode.Scaled,\r\n hiliteSettings: new Hilite.Settings(),\r\n emphasisSettings: new Hilite.Settings(),\r\n flashSettings: new FlashSettings(),\r\n clipStyle: ClipStyle.defaults,\r\n frustum: new Frustum(),\r\n fraction: 0,\r\n isFadeOutActive: false,\r\n globalViewTransition: 0,\r\n isGlobeMode3D: false,\r\n backgroundMapOn: false,\r\n upVector: Vector3d.unitZ(),\r\n whiteOnWhiteReversal: WhiteOnWhiteReversalSettings.fromJSON(),\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport function createRenderPlanFromViewport(vp: Viewport): RenderPlan {\r\n const view = vp.view;\r\n const style = view.displayStyle;\r\n\r\n const is3d = view.is3d();\r\n\r\n const globalViewTransition = view.is3d() ? view.globalViewTransition() : 0.0;\r\n const isGlobeMode3D = GlobeMode.Ellipsoid === view.globeMode;\r\n const backgroundMapOn = view.displayStyle.viewFlags.backgroundMap;\r\n const frustum = vp.viewingSpace.getFrustum();\r\n const fraction = vp.viewingSpace.frustFraction;\r\n const viewFlags = style.viewFlags;\r\n\r\n const bgColor = view.backgroundColor;\r\n const monoColor = style.monochromeColor;\r\n const monochromeMode = style.settings.monochromeMode;\r\n\r\n const hiliteSettings = vp.hilite;\r\n const emphasisSettings = vp.emphasisSettings;\r\n const flashSettings = vp.flashSettings;\r\n const lights = vp.lightSettings;\r\n\r\n const isFadeOutActive = vp.isFadeOutActive;\r\n const clip = view.getViewClip();\r\n const clipStyle = view.displayStyle.settings.clipStyle;\r\n const hline = style.is3d() ? style.settings.hiddenLineSettings : undefined;\r\n const ao = style.is3d() ? style.settings.ambientOcclusionSettings : undefined;\r\n const analysisStyle = style.settings.analysisStyle;\r\n const thematic = (style.is3d() && view.displayStyle.viewFlags.thematicDisplay) ? style.settings.thematic : undefined;\r\n const shouldDisplayAtmosphere = (style.is3d() && GlobeMode.Ellipsoid === view.globeMode && vp.iModel.isGeoLocated && style.viewFlags.backgroundMap) ? (vp.view as ViewState3d).getDisplayStyle3d().environment.displayAtmosphere : false;\r\n const atmosphere = shouldDisplayAtmosphere ? (vp.view as ViewState3d).getDisplayStyle3d().environment.atmosphere : undefined;\r\n\r\n let upVector;\r\n if (GlobeMode.Ellipsoid === view.globeMode) {\r\n const lb = frustum.getCorner(Npc.LeftBottomRear).interpolate(0.5, frustum.getCorner(Npc.LeftBottomFront), scratchPoint3a);\r\n const rt = frustum.getCorner(Npc.RightTopRear).interpolate(0.5, frustum.getCorner(Npc.RightTopFront), scratchPoint3b);\r\n const cntr = lb.interpolate(0.5, rt, scratchPoint3c);\r\n upVector = view.getUpVector(cntr);\r\n } else {\r\n upVector = Vector3d.unitZ();\r\n }\r\n\r\n let analysisTexture;\r\n if (analysisStyle?.thematic)\r\n analysisTexture = vp.target.renderSystem.getGradientTexture(analysisStyle.thematic.gradient, vp.iModel);\r\n\r\n let ellipsoid: RenderPlanEllipsoid | undefined;\r\n if (GlobeMode.Ellipsoid === view.globeMode) {\r\n const mapEcefToDb = view.iModel.getMapEcefToDb(0);\r\n ellipsoid = new RenderPlanEllipsoid(\r\n Point3d.fromJSON(mapEcefToDb.origin),\r\n mapEcefToDb.matrix,\r\n Point3d.fromJSON({ x: Constant.earthRadiusWGS84.equator, y: Constant.earthRadiusWGS84.equator, z: Constant.earthRadiusWGS84.polar }),\r\n );\r\n }\r\n\r\n return {\r\n is3d,\r\n viewFlags,\r\n bgColor,\r\n monoColor,\r\n monochromeMode,\r\n hiliteSettings,\r\n emphasisSettings,\r\n flashSettings,\r\n clip,\r\n clipStyle,\r\n hline,\r\n analysisStyle,\r\n ao,\r\n thematic,\r\n atmosphere,\r\n isFadeOutActive,\r\n analysisTexture,\r\n frustum,\r\n fraction,\r\n globalViewTransition,\r\n isGlobeMode3D,\r\n backgroundMapOn,\r\n upVector,\r\n lights,\r\n whiteOnWhiteReversal: vp.displayStyle.settings.whiteOnWhiteReversal,\r\n ellipsoid,\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"RenderPlan.js","sourceRoot":"","sources":["../../../src/render/RenderPlan.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACwC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAc,MAAM,EAAiB,cAAc,EAAE,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CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC,CACrI,CAAC;KACH;IAED,OAAO;QACL,IAAI;QACJ,SAAS;QACT,OAAO;QACP,SAAS;QACT,cAAc;QACd,cAAc;QACd,gBAAgB;QAChB,aAAa;QACb,IAAI;QACJ,SAAS;QACT,KAAK;QACL,aAAa;QACb,EAAE;QACF,QAAQ;QACR,UAAU;QACV,eAAe;QACf,eAAe;QACf,OAAO;QACP,QAAQ;QACR,oBAAoB;QACpB,aAAa;QACb,eAAe;QACf,QAAQ;QACR,MAAM;QACN,oBAAoB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,oBAAoB;QACnE,SAAS;KACV,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport {\n AmbientOcclusion, AnalysisStyle, Atmosphere, ClipStyle, ColorDef, Frustum, GlobeMode, HiddenLine, Hilite, LightSettings, MonochromeMode, Npc,\n RenderTexture, ThematicDisplay, ViewFlags, WhiteOnWhiteReversalSettings,\n} from \"@itwin/core-common\";\nimport { ClipVector, Constant, Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport { FlashSettings } from \"../FlashSettings\";\nimport { Viewport } from \"../Viewport\";\nimport { ViewState3d } from \"../ViewState\";\n\nconst scratchPoint3a = new Point3d();\nconst scratchPoint3b = new Point3d();\nconst scratchPoint3c = new Point3d();\n\n/**\n * @internal\n */\nexport class RenderPlanEllipsoid {\n public readonly ellipsoidCenter: Point3d;\n public readonly ellipsoidRotation: Matrix3d;\n public readonly ellipsoidRadii: Point3d;\n\n constructor(ellipsoidCenter: Point3d, ellipsoidRotation: Matrix3d, ellipsoidRadii: Point3d) {\n this.ellipsoidCenter = ellipsoidCenter;\n this.ellipsoidRotation = ellipsoidRotation;\n this.ellipsoidRadii = ellipsoidRadii;\n }\n\n public equals(other: RenderPlanEllipsoid): boolean {\n if (this.ellipsoidCenter.isAlmostEqual(other.ellipsoidCenter))\n return false;\n if (this.ellipsoidRotation.isAlmostEqual(other.ellipsoidRotation))\n return false;\n if (this.ellipsoidRadii.isAlmostEqual(other.ellipsoidRadii))\n return false;\n return true;\n }\n}\n\n/** A RenderPlan holds a Frustum and the render settings for displaying a RenderScene into a RenderTarget.\n * @internal\n */\nexport interface RenderPlan {\n readonly is3d: boolean;\n readonly viewFlags: ViewFlags;\n readonly bgColor: ColorDef;\n readonly monoColor: ColorDef;\n readonly monochromeMode: MonochromeMode;\n readonly hiliteSettings: Hilite.Settings;\n readonly emphasisSettings: Hilite.Settings;\n readonly flashSettings: FlashSettings;\n readonly clip?: ClipVector;\n readonly clipStyle: ClipStyle;\n readonly hline?: HiddenLine.Settings;\n readonly analysisStyle?: AnalysisStyle;\n readonly ao?: AmbientOcclusion.Settings;\n readonly thematic?: ThematicDisplay;\n readonly atmosphere?: Atmosphere.Settings;\n readonly isFadeOutActive: boolean;\n readonly analysisTexture?: RenderTexture;\n readonly frustum: Frustum;\n readonly fraction: number;\n readonly globalViewTransition: number;\n readonly isGlobeMode3D: boolean;\n readonly backgroundMapOn: boolean;\n readonly upVector: Vector3d;\n readonly lights?: LightSettings;\n readonly whiteOnWhiteReversal: WhiteOnWhiteReversalSettings;\n readonly ellipsoid?: RenderPlanEllipsoid;\n}\n\n/** @internal */\nexport function createEmptyRenderPlan(): RenderPlan {\n return {\n is3d: true,\n viewFlags: new ViewFlags(),\n bgColor: ColorDef.white,\n monoColor: ColorDef.white,\n monochromeMode: MonochromeMode.Scaled,\n hiliteSettings: new Hilite.Settings(),\n emphasisSettings: new Hilite.Settings(),\n flashSettings: new FlashSettings(),\n clipStyle: ClipStyle.defaults,\n frustum: new Frustum(),\n fraction: 0,\n isFadeOutActive: false,\n globalViewTransition: 0,\n isGlobeMode3D: false,\n backgroundMapOn: false,\n upVector: Vector3d.unitZ(),\n whiteOnWhiteReversal: WhiteOnWhiteReversalSettings.fromJSON(),\n };\n}\n\n/** @internal */\nexport function createRenderPlanFromViewport(vp: Viewport): RenderPlan {\n const view = vp.view;\n const style = view.displayStyle;\n\n const is3d = view.is3d();\n\n const globalViewTransition = view.is3d() ? view.globalViewTransition() : 0.0;\n const isGlobeMode3D = GlobeMode.Ellipsoid === view.globeMode;\n const backgroundMapOn = view.displayStyle.viewFlags.backgroundMap;\n const frustum = vp.viewingSpace.getFrustum();\n const fraction = vp.viewingSpace.frustFraction;\n const viewFlags = style.viewFlags;\n\n const bgColor = view.backgroundColor;\n const monoColor = style.monochromeColor;\n const monochromeMode = style.settings.monochromeMode;\n\n const hiliteSettings = vp.hilite;\n const emphasisSettings = vp.emphasisSettings;\n const flashSettings = vp.flashSettings;\n const lights = vp.lightSettings;\n\n const isFadeOutActive = vp.isFadeOutActive;\n const clip = view.getViewClip();\n const clipStyle = view.displayStyle.settings.clipStyle;\n const hline = style.is3d() ? style.settings.hiddenLineSettings : undefined;\n const ao = style.is3d() ? style.settings.ambientOcclusionSettings : undefined;\n const analysisStyle = style.settings.analysisStyle;\n const thematic = (style.is3d() && view.displayStyle.viewFlags.thematicDisplay) ? style.settings.thematic : undefined;\n const shouldDisplayAtmosphere = (style.is3d() && GlobeMode.Ellipsoid === view.globeMode && vp.iModel.isGeoLocated && style.viewFlags.backgroundMap) ? (vp.view as ViewState3d).getDisplayStyle3d().environment.displayAtmosphere : false;\n const atmosphere = shouldDisplayAtmosphere ? (vp.view as ViewState3d).getDisplayStyle3d().environment.atmosphere : undefined;\n\n let upVector;\n if (GlobeMode.Ellipsoid === view.globeMode) {\n const lb = frustum.getCorner(Npc.LeftBottomRear).interpolate(0.5, frustum.getCorner(Npc.LeftBottomFront), scratchPoint3a);\n const rt = frustum.getCorner(Npc.RightTopRear).interpolate(0.5, frustum.getCorner(Npc.RightTopFront), scratchPoint3b);\n const cntr = lb.interpolate(0.5, rt, scratchPoint3c);\n upVector = view.getUpVector(cntr);\n } else {\n upVector = Vector3d.unitZ();\n }\n\n let analysisTexture;\n if (analysisStyle?.thematic)\n analysisTexture = vp.target.renderSystem.getGradientTexture(analysisStyle.thematic.gradient, vp.iModel);\n\n let ellipsoid: RenderPlanEllipsoid | undefined;\n if (GlobeMode.Ellipsoid === view.globeMode) {\n const mapEcefToDb = view.iModel.getMapEcefToDb(0);\n ellipsoid = new RenderPlanEllipsoid(\n Point3d.fromJSON(mapEcefToDb.origin),\n mapEcefToDb.matrix,\n Point3d.fromJSON({ x: Constant.earthRadiusWGS84.equator, y: Constant.earthRadiusWGS84.equator, z: Constant.earthRadiusWGS84.polar }),\n );\n }\n\n return {\n is3d,\n viewFlags,\n bgColor,\n monoColor,\n monochromeMode,\n hiliteSettings,\n emphasisSettings,\n flashSettings,\n clip,\n clipStyle,\n hline,\n analysisStyle,\n ao,\n thematic,\n atmosphere,\n isFadeOutActive,\n analysisTexture,\n frustum,\n fraction,\n globalViewTransition,\n isGlobeMode3D,\n backgroundMapOn,\n upVector,\n lights,\n whiteOnWhiteReversal: vp.displayStyle.settings.whiteOnWhiteReversal,\n ellipsoid,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderPlanarClassifier.js","sourceRoot":"","sources":["../../../src/render/RenderPlanarClassifier.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH;;GAEG;AACH,MAAM,OAAgB,sBAAsB;CAI3C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { Id64String, IDisposable } from \"@itwin/core-bentley\";\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport { PlanarClipMaskState } from \"../PlanarClipMaskState\";\r\nimport { SpatialClassifierTileTreeReference, Tile } from \"../tile/internal\";\r\nimport { SceneContext } from \"../ViewContext\";\r\n\r\n/** @internal */\r\nexport interface PlanarClassifierTarget { modelId: Id64String, tiles: Tile[], location: Transform, isPointCloud: boolean }\r\n/** An opaque representation of a planar classifier applied to geometry within a [[Viewport]].\r\n * @internal\r\n */\r\nexport abstract class RenderPlanarClassifier implements IDisposable {\r\n public abstract dispose(): void;\r\n public abstract collectGraphics(context: SceneContext, target: PlanarClassifierTarget): void;\r\n public abstract setSource(classifierTreeRef?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): void;\r\n}\r\n\r\n/** @internal */\r\nexport type PlanarClassifierMap = Map<string, RenderPlanarClassifier>;\r\n"]}
1
+ {"version":3,"file":"RenderPlanarClassifier.js","sourceRoot":"","sources":["../../../src/render/RenderPlanarClassifier.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAUH;;GAEG;AACH,MAAM,OAAgB,sBAAsB;CAI3C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String, IDisposable } from \"@itwin/core-bentley\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { PlanarClipMaskState } from \"../PlanarClipMaskState\";\nimport { SpatialClassifierTileTreeReference, Tile } from \"../tile/internal\";\nimport { SceneContext } from \"../ViewContext\";\n\n/** @internal */\nexport interface PlanarClassifierTarget { modelId: Id64String, tiles: Tile[], location: Transform, isPointCloud: boolean }\n/** An opaque representation of a planar classifier applied to geometry within a [[Viewport]].\n * @internal\n */\nexport abstract class RenderPlanarClassifier implements IDisposable {\n public abstract dispose(): void;\n public abstract collectGraphics(context: SceneContext, target: PlanarClassifierTarget): void;\n public abstract setSource(classifierTreeRef?: SpatialClassifierTileTreeReference, planarClipMask?: PlanarClipMaskState): void;\n}\n\n/** @internal */\nexport type PlanarClassifierMap = Map<string, RenderPlanarClassifier>;\n"]}