@itwin/core-frontend 4.1.0-dev.6 → 4.1.0-dev.8

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 (123) hide show
  1. package/lib/cjs/BriefcaseTxns.d.ts +2 -2
  2. package/lib/cjs/BriefcaseTxns.d.ts.map +1 -1
  3. package/lib/cjs/BriefcaseTxns.js +3 -3
  4. package/lib/cjs/BriefcaseTxns.js.map +1 -1
  5. package/lib/cjs/GraphicalEditingScope.d.ts +2 -2
  6. package/lib/cjs/GraphicalEditingScope.d.ts.map +1 -1
  7. package/lib/cjs/GraphicalEditingScope.js +1 -1
  8. package/lib/cjs/GraphicalEditingScope.js.map +1 -1
  9. package/lib/cjs/IpcApp.d.ts.map +1 -1
  10. package/lib/cjs/IpcApp.js +3 -3
  11. package/lib/cjs/IpcApp.js.map +1 -1
  12. package/lib/cjs/LocalhostIpcApp.js +1 -1
  13. package/lib/cjs/LocalhostIpcApp.js.map +1 -1
  14. package/lib/cjs/NativeApp.d.ts.map +1 -1
  15. package/lib/cjs/NativeApp.js +3 -3
  16. package/lib/cjs/NativeApp.js.map +1 -1
  17. package/lib/cjs/core-frontend.d.ts +3 -0
  18. package/lib/cjs/core-frontend.d.ts.map +1 -1
  19. package/lib/cjs/core-frontend.js +3 -0
  20. package/lib/cjs/core-frontend.js.map +1 -1
  21. package/lib/cjs/imdl/ImdlGraphicsCreator.d.ts +19 -0
  22. package/lib/cjs/imdl/ImdlGraphicsCreator.d.ts.map +1 -0
  23. package/lib/cjs/imdl/ImdlGraphicsCreator.js +328 -0
  24. package/lib/cjs/imdl/ImdlGraphicsCreator.js.map +1 -0
  25. package/lib/cjs/imdl/ImdlModel.d.ts +181 -0
  26. package/lib/cjs/imdl/ImdlModel.d.ts.map +1 -0
  27. package/lib/cjs/imdl/ImdlModel.js +10 -0
  28. package/lib/cjs/imdl/ImdlModel.js.map +1 -0
  29. package/lib/cjs/imdl/ImdlParser.d.ts +40 -0
  30. package/lib/cjs/imdl/ImdlParser.d.ts.map +1 -0
  31. package/lib/cjs/imdl/ImdlParser.js +996 -0
  32. package/lib/cjs/imdl/ImdlParser.js.map +1 -0
  33. package/lib/cjs/imdl/ImdlSchema.d.ts +380 -0
  34. package/lib/cjs/imdl/ImdlSchema.d.ts.map +1 -0
  35. package/lib/cjs/imdl/ImdlSchema.js +10 -0
  36. package/lib/cjs/imdl/ImdlSchema.js.map +1 -0
  37. package/lib/cjs/render/primitives/AuxChannelTable.d.ts +4 -0
  38. package/lib/cjs/render/primitives/AuxChannelTable.d.ts.map +1 -1
  39. package/lib/cjs/render/primitives/AuxChannelTable.js +33 -0
  40. package/lib/cjs/render/primitives/AuxChannelTable.js.map +1 -1
  41. package/lib/cjs/render/primitives/VertexTable.d.ts +3 -3
  42. package/lib/cjs/render/primitives/VertexTable.d.ts.map +1 -1
  43. package/lib/cjs/render/primitives/VertexTable.js.map +1 -1
  44. package/lib/cjs/render/primitives/VertexTableSplitter.d.ts +5 -1
  45. package/lib/cjs/render/primitives/VertexTableSplitter.d.ts.map +1 -1
  46. package/lib/cjs/render/primitives/VertexTableSplitter.js +13 -12
  47. package/lib/cjs/render/primitives/VertexTableSplitter.js.map +1 -1
  48. package/lib/cjs/tile/IModelTile.d.ts.map +1 -1
  49. package/lib/cjs/tile/IModelTile.js +14 -15
  50. package/lib/cjs/tile/IModelTile.js.map +1 -1
  51. package/lib/cjs/tile/ImdlReader.d.ts +11 -420
  52. package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
  53. package/lib/cjs/tile/ImdlReader.js +64 -902
  54. package/lib/cjs/tile/ImdlReader.js.map +1 -1
  55. package/lib/cjs/tile/map/MapTile.d.ts +6 -1
  56. package/lib/cjs/tile/map/MapTile.d.ts.map +1 -1
  57. package/lib/cjs/tile/map/MapTile.js +8 -7
  58. package/lib/cjs/tile/map/MapTile.js.map +1 -1
  59. package/lib/cjs/tile/map/MapTileTree.d.ts.map +1 -1
  60. package/lib/cjs/tile/map/MapTileTree.js +8 -2
  61. package/lib/cjs/tile/map/MapTileTree.js.map +1 -1
  62. package/lib/esm/BriefcaseTxns.d.ts +2 -2
  63. package/lib/esm/BriefcaseTxns.d.ts.map +1 -1
  64. package/lib/esm/BriefcaseTxns.js +3 -3
  65. package/lib/esm/BriefcaseTxns.js.map +1 -1
  66. package/lib/esm/GraphicalEditingScope.d.ts +2 -2
  67. package/lib/esm/GraphicalEditingScope.d.ts.map +1 -1
  68. package/lib/esm/GraphicalEditingScope.js +2 -2
  69. package/lib/esm/GraphicalEditingScope.js.map +1 -1
  70. package/lib/esm/IpcApp.d.ts.map +1 -1
  71. package/lib/esm/IpcApp.js +4 -4
  72. package/lib/esm/IpcApp.js.map +1 -1
  73. package/lib/esm/LocalhostIpcApp.js +2 -2
  74. package/lib/esm/LocalhostIpcApp.js.map +1 -1
  75. package/lib/esm/NativeApp.d.ts.map +1 -1
  76. package/lib/esm/NativeApp.js +4 -4
  77. package/lib/esm/NativeApp.js.map +1 -1
  78. package/lib/esm/core-frontend.d.ts +3 -0
  79. package/lib/esm/core-frontend.d.ts.map +1 -1
  80. package/lib/esm/core-frontend.js +3 -0
  81. package/lib/esm/core-frontend.js.map +1 -1
  82. package/lib/esm/imdl/ImdlGraphicsCreator.d.ts +19 -0
  83. package/lib/esm/imdl/ImdlGraphicsCreator.d.ts.map +1 -0
  84. package/lib/esm/imdl/ImdlGraphicsCreator.js +324 -0
  85. package/lib/esm/imdl/ImdlGraphicsCreator.js.map +1 -0
  86. package/lib/esm/imdl/ImdlModel.d.ts +181 -0
  87. package/lib/esm/imdl/ImdlModel.d.ts.map +1 -0
  88. package/lib/esm/imdl/ImdlModel.js +9 -0
  89. package/lib/esm/imdl/ImdlModel.js.map +1 -0
  90. package/lib/esm/imdl/ImdlParser.d.ts +40 -0
  91. package/lib/esm/imdl/ImdlParser.d.ts.map +1 -0
  92. package/lib/esm/imdl/ImdlParser.js +988 -0
  93. package/lib/esm/imdl/ImdlParser.js.map +1 -0
  94. package/lib/esm/imdl/ImdlSchema.d.ts +380 -0
  95. package/lib/esm/imdl/ImdlSchema.d.ts.map +1 -0
  96. package/lib/esm/imdl/ImdlSchema.js +9 -0
  97. package/lib/esm/imdl/ImdlSchema.js.map +1 -0
  98. package/lib/esm/render/primitives/AuxChannelTable.d.ts +4 -0
  99. package/lib/esm/render/primitives/AuxChannelTable.d.ts.map +1 -1
  100. package/lib/esm/render/primitives/AuxChannelTable.js +33 -0
  101. package/lib/esm/render/primitives/AuxChannelTable.js.map +1 -1
  102. package/lib/esm/render/primitives/VertexTable.d.ts +3 -3
  103. package/lib/esm/render/primitives/VertexTable.d.ts.map +1 -1
  104. package/lib/esm/render/primitives/VertexTable.js.map +1 -1
  105. package/lib/esm/render/primitives/VertexTableSplitter.d.ts +5 -1
  106. package/lib/esm/render/primitives/VertexTableSplitter.d.ts.map +1 -1
  107. package/lib/esm/render/primitives/VertexTableSplitter.js +13 -12
  108. package/lib/esm/render/primitives/VertexTableSplitter.js.map +1 -1
  109. package/lib/esm/tile/IModelTile.d.ts.map +1 -1
  110. package/lib/esm/tile/IModelTile.js +14 -15
  111. package/lib/esm/tile/IModelTile.js.map +1 -1
  112. package/lib/esm/tile/ImdlReader.d.ts +11 -420
  113. package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
  114. package/lib/esm/tile/ImdlReader.js +67 -903
  115. package/lib/esm/tile/ImdlReader.js.map +1 -1
  116. package/lib/esm/tile/map/MapTile.d.ts +6 -1
  117. package/lib/esm/tile/map/MapTile.d.ts.map +1 -1
  118. package/lib/esm/tile/map/MapTile.js +8 -7
  119. package/lib/esm/tile/map/MapTile.js.map +1 -1
  120. package/lib/esm/tile/map/MapTileTree.d.ts.map +1 -1
  121. package/lib/esm/tile/map/MapTileTree.js +8 -2
  122. package/lib/esm/tile/map/MapTileTree.js.map +1 -1
  123. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[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ourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./gltf/GltfSchema\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewportSync\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./extension/Extension\";\r\nexport * from \"./extension/providers/LocalExtensionProvider\";\r\nexport * from \"./extension/providers/RemoteExtensionProvider\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RealityMeshGraphicParams\";\r\nexport * from \"./render/RealityMeshParams\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMaterial\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\r\nimport \"./extension/ExtensionRuntime\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing Extensions.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n*/\r\n"]}
1
+ {"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;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xC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,sGAAsG;AACtG,OAAO,8BAA8B,CAAC;AAEtC;;GAEG;AAEH;;;;GAIG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;;GAIG;AACH;;;GAGG;AACH;;;EAGE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./AccuDraw\";\r\nexport * from \"./AccuSnap\";\r\nexport * from \"./AuxCoordSys\";\r\nexport * from \"./BingLocation\";\r\nexport * from \"./BriefcaseConnection\";\r\nexport * from \"./BriefcaseTxns\";\r\nexport * from \"./CategorySelectorState\";\r\nexport * from \"./ChangeFlags\";\r\nexport * from \"./CheckpointConnection\";\r\nexport * from \"./ContextRealityModelState\";\r\nexport * from \"./CoordSystem\";\r\nexport * from \"./DecorationsCache\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyleState\";\r\nexport * from \"./DrawingViewState\";\r\nexport * from \"./ElementLocateManager\";\r\nexport * from \"./EmphasizeElements\";\r\nexport * from \"./EntityState\";\r\nexport * from \"./EnvironmentDecorations\";\r\nexport * from \"./FeatureOverrideProvider\";\r\nexport * from \"./FlashSettings\";\r\nexport * from \"./FrontendLoggerCategory\";\r\nexport * from \"./FrontendHubAccess\";\r\nexport * from \"./Frustum2d\";\r\nexport * from \"./FrustumAnimator\";\r\nexport * from \"./FuzzySearch\";\r\nexport * from \"./GeoServices\";\r\nexport * from \"./GlobeAnimator\";\r\nexport * from \"./gltf/GltfSchema\";\r\nexport * from \"./GraphicalEditingScope\";\r\nexport * from \"./HitDetail\";\r\nexport * from \"./ImageUtil\";\r\nexport * from \"./imdl/ImdlSchema\";\r\nexport * from \"./imdl/ImdlModel\";\r\nexport * from \"./imdl/ImdlParser\";\r\nexport * from \"./IModelApp\";\r\nexport * from \"./IModelConnection\";\r\nexport * from \"./IModelRoutingContext\";\r\nexport * from \"./IpcApp\";\r\nexport * from \"./LinePlaneIntersect\";\r\nexport * from \"./MarginPercent\";\r\nexport * from \"./Marker\";\r\nexport * from \"./ModelSelectorState\";\r\nexport * from \"./ModelState\";\r\nexport * from \"./NativeApp\";\r\nexport * from \"./NativeAppLogger\";\r\nexport * from \"./NoRenderApp\";\r\nexport * from \"./NotificationManager\";\r\nexport * from \"./PerModelCategoryVisibility\";\r\nexport * from \"./PlanarClipMaskState\";\r\nexport * from \"./SelectionSet\";\r\nexport * from \"./SheetViewState\";\r\nexport * from \"./SpatialViewState\";\r\nexport * from \"./Sprites\";\r\nexport * from \"./StandardView\";\r\nexport * from \"./SubCategoriesCache\";\r\nexport * from \"./TentativePoint\";\r\nexport * from \"./Tiles\";\r\nexport * from \"./UserPreferences\";\r\nexport * from \"./ViewAnimation\";\r\nexport * from \"./ViewContext\";\r\nexport * from \"./ViewGlobalLocation\";\r\nexport * from \"./ViewingSpace\";\r\nexport * from \"./ViewManager\";\r\nexport * from \"./Viewport\";\r\nexport * from \"./ViewportSync\";\r\nexport * from \"./ViewPose\";\r\nexport * from \"./ViewRect\";\r\nexport * from \"./ViewState\";\r\nexport * from \"./ViewStatus\";\r\nexport * from \"./extension/Extension\";\r\nexport * from \"./extension/providers/LocalExtensionProvider\";\r\nexport * from \"./extension/providers/RemoteExtensionProvider\";\r\nexport * from \"./properties/AngleDescription\";\r\nexport * from \"./properties/FormattedQuantityDescription\";\r\nexport * from \"./properties/LengthDescription\";\r\nexport * from \"./quantity-formatting/QuantityFormatter\";\r\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\r\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\r\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\r\nexport * from \"./render/CanvasDecoration\";\r\nexport * from \"./render/Decorations\";\r\nexport * from \"./render/FeatureSymbology\";\r\nexport * from \"./render/FrameStats\";\r\nexport * from \"./render/GraphicBranch\";\r\nexport * from \"./render/GraphicBuilder\";\r\nexport * from \"./render/GraphicPrimitive\";\r\nexport * from \"./render/InstancedGraphicParams\";\r\nexport * from \"./render/MockRender\";\r\nexport * from \"./render/ParticleCollectionBuilder\";\r\nexport * from \"./render/Pixel\";\r\nexport * from \"./render/RealityMeshGraphicParams\";\r\nexport * from \"./render/RealityMeshParams\";\r\nexport * from \"./render/RenderClipVolume\";\r\nexport * from \"./render/RenderGraphic\";\r\nexport * from \"./render/RenderMaterial\";\r\nexport * from \"./render/RenderMemory\";\r\nexport * from \"./render/RenderPlan\";\r\nexport * from \"./render/RenderPlanarClassifier\";\r\nexport * from \"./render/RenderTarget\";\r\nexport * from \"./render/RenderSystem\";\r\nexport * from \"./render/RenderTexture\";\r\nexport * from \"./render/Scene\";\r\nexport * from \"./render/ScreenSpaceEffectBuilder\";\r\nexport * from \"./render/VisibleFeature\";\r\nexport * from \"./render/webgl/PerformanceMetrics\";\r\nexport * from \"./render/webgl/Target\";\r\nexport * from \"./render/webgl/IModelFrameLifecycle\";\r\nexport * from \"./tile/internal\";\r\nexport * from \"./tools/AccuDrawTool\";\r\nexport * from \"./tools/ClipViewTool\";\r\nexport * from \"./tools/EditManipulator\";\r\nexport * from \"./tools/ElementSetTool\";\r\nexport * from \"./tools/EventController\";\r\nexport * from \"./tools/IdleTool\";\r\nexport * from \"./tools/MeasureTool\";\r\nexport * from \"./tools/PrimitiveTool\";\r\nexport * from \"./tools/SelectTool\";\r\nexport * from \"./tools/Tool\";\r\nexport * from \"./tools/ToolSettings\";\r\nexport * from \"./tools/ToolAdmin\";\r\nexport * from \"./tools/ToolAssistance\";\r\nexport * from \"./tools/ViewTool\";\r\nexport * from \"./BackgroundMapGeometry\";\r\nexport * from \"./ViewCreator2d\";\r\nexport * from \"./ViewCreator3d\";\r\nexport * from \"./LocalhostIpcApp\";\r\nexport * from \"./RealityDataSource\";\r\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\r\nimport \"./extension/ExtensionRuntime\";\r\n\r\n/** @docs-package-description\r\n * The core-frontend package always runs in a web browser. It contains classes for [querying iModels and showing views]($docs/learning/frontend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelApp\r\n * Classes for configuring and administering an iTwin.js application.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description IModelConnection\r\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\r\n */\r\n/**\r\n * @docs-group-description ElementState\r\n * Classes for working with the *state* of Elements in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description ModelState\r\n * Classes for working with the *state* of Models in the frontend.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\r\n */\r\n/**\r\n * @docs-group-description Measure\r\n * Classes for reporting point to point distances and mass properties of elements.\r\n */\r\n/**\r\n * @docs-group-description Views\r\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\r\n */\r\n/**\r\n * @docs-group-description LocatingElements\r\n * Classes for locating and snapping to elements in views.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Notifications\r\n * Notifications provide feedback to the user of something of interest.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Extensions\r\n * Classes for creating and managing Extensions.\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Classes for working with property records and descriptions.\r\n */\r\n/**\r\n * @docs-group-description Rendering\r\n * Classes for rendering the contents of views.\r\n */\r\n/**\r\n * @docs-group-description SelectionSet\r\n * Classes for working with the set of selected elements.\r\n * See [the learning articles]($docs/learning/frontend/index.md).\r\n */\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Native Applications\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * Miscellaneous utility classes.\r\n */\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package\r\n */\r\n/**\r\n * @docs-group-description QuantityFormatting\r\n * Classes for formatting and parsing quantity values.\r\n */\r\n/**\r\n * @docs-group-description Tiles\r\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\r\n */\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n/**\r\n * @docs-group-description UserPreferences\r\n * APIs for working with user preferences in an iModelApp.\r\n * See [the learning articles]($docs/learning/frontend/preferences.md).\r\n */\r\n/**\r\n * @docs-group-description MapLayers\r\n * Classes supporting map layers display.\r\n */\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n*/\r\n"]}
@@ -0,0 +1,19 @@
1
+ /** @packageDocumentation
2
+ * @module Tiles
3
+ */
4
+ import type { ImdlModel as Imdl } from "../imdl/ImdlModel";
5
+ import type { RenderGraphic } from "../render/RenderGraphic";
6
+ import type { RenderSystem } from "../render/RenderSystem";
7
+ import type { IModelConnection } from "../IModelConnection";
8
+ /** Options provided to [[decodeImdlContent]].
9
+ * @internal
10
+ */
11
+ export interface ImdlDecodeOptions {
12
+ document: Imdl.Document;
13
+ system: RenderSystem;
14
+ iModel: IModelConnection;
15
+ isCanceled?: () => boolean;
16
+ }
17
+ /** @internal */
18
+ export declare function decodeImdlGraphics(options: ImdlDecodeOptions): Promise<RenderGraphic | undefined>;
19
+ //# sourceMappingURL=ImdlGraphicsCreator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImdlGraphicsCreator.d.ts","sourceRoot":"","sources":["../../../src/imdl/ImdlGraphicsCreator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAQH,OAAO,KAAK,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAK5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC;IACxB,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;CAC5B;AAoUD,gBAAgB;AAChB,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAqCvG"}
@@ -0,0 +1,324 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Tiles
7
+ */
8
+ import { JsonUtils } from "@itwin/core-bentley";
9
+ import { ClipVector, Point2d, Point3d, Range3d, Transform } from "@itwin/core-geometry";
10
+ import { ColorDef, Gradient, ImageSource, RenderMaterial, RenderTexture, TextureMapping, } from "@itwin/core-common";
11
+ import { edgeParamsFromImdl, toMaterialArgs, toVertexTable } from "../imdl/ImdlParser";
12
+ import { GraphicBranch } from "../render/GraphicBranch";
13
+ import { createSurfaceMaterial } from "../render/primitives/SurfaceParams";
14
+ import { VertexIndices } from "../render/primitives/VertexTable";
15
+ import { AuxChannelTable } from "../render/primitives/AuxChannelTable";
16
+ async function loadNamedTexture(name, namedTex, options) {
17
+ // Reasons a texture could be embedded in the tile content instead of requested separately from the backend:
18
+ // - external textures are disabled
19
+ // - the texture name is not a valid Id64 string
20
+ // - the texture is below a certain backend-hardcoded size threshold
21
+ // The bufferViewJson being defined signifies any of the above conditions. In that case, the image content
22
+ // has been embedded in the tile contents. Otherwise, we will attempt to request the image content separately
23
+ // from the backend.
24
+ try {
25
+ let textureType = RenderTexture.Type.Normal;
26
+ const isGlyph = JsonUtils.asBool(namedTex.isGlyph);
27
+ const isTileSection = !isGlyph && JsonUtils.asBool(namedTex.isTileSection);
28
+ if (isGlyph)
29
+ textureType = RenderTexture.Type.Glyph;
30
+ else if (isTileSection)
31
+ textureType = RenderTexture.Type.TileSection;
32
+ // We produce unique tile sections for very large (> 8 megapixel) textures, and unique glyph atlases for raster text.
33
+ // Neither should be cached.
34
+ const cacheable = !isGlyph && !isTileSection;
35
+ const ownership = cacheable ? { iModel: options.iModel, key: name } : undefined;
36
+ const bufferViewId = JsonUtils.asString(namedTex.bufferView);
37
+ const bufferViewJson = 0 !== bufferViewId.length ? options.document.json.bufferViews[bufferViewId] : undefined;
38
+ if (undefined !== bufferViewJson) { // presence of bufferViewJson signifies we should read the texture from the tile content
39
+ const byteOffset = JsonUtils.asInt(bufferViewJson.byteOffset);
40
+ const byteLength = JsonUtils.asInt(bufferViewJson.byteLength);
41
+ if (0 === byteLength)
42
+ return undefined;
43
+ const texBytes = options.document.binaryData.subarray(byteOffset, byteOffset + byteLength);
44
+ const format = namedTex.format;
45
+ const source = new ImageSource(texBytes, format);
46
+ return await options.system.createTextureFromSource({ source, ownership, type: textureType, transparency: namedTex.transparency });
47
+ }
48
+ // bufferViewJson was undefined, so attempt to request the texture directly from the backend
49
+ // eslint-disable-next-line deprecation/deprecation
50
+ const params = new RenderTexture.Params(cacheable ? name : undefined, textureType);
51
+ return options.system.createTextureFromElement(name, options.iModel, params, namedTex.format);
52
+ }
53
+ catch (_) {
54
+ return undefined;
55
+ }
56
+ }
57
+ async function loadNamedTextures(options) {
58
+ const result = new Map();
59
+ const namedTextures = options.document.json.namedTextures;
60
+ if (!namedTextures)
61
+ return result;
62
+ const promises = new Array();
63
+ for (const [name, namedTexture] of Object.entries(namedTextures)) {
64
+ const texture = options.system.findTexture(name, options.iModel);
65
+ if (texture) {
66
+ result.set(name, texture);
67
+ continue;
68
+ }
69
+ else if (namedTexture) {
70
+ promises.push(loadNamedTexture(name, namedTexture, options).then((tx) => {
71
+ if (tx)
72
+ result.set(name, tx);
73
+ }));
74
+ }
75
+ }
76
+ if (promises.length > 0)
77
+ await Promise.all(promises);
78
+ return result;
79
+ }
80
+ function constantLodParamPropsFromJson(propsJson) {
81
+ if (undefined === propsJson)
82
+ return undefined;
83
+ const constantLodPops = {
84
+ repetitions: JsonUtils.asDouble(propsJson.repetitions, 1.0),
85
+ offset: { x: propsJson.offset ? JsonUtils.asDouble(propsJson.offset[0]) : 0.0, y: propsJson.offset ? JsonUtils.asDouble(propsJson.offset[1]) : 0.0 },
86
+ minDistClamp: JsonUtils.asDouble(propsJson.minDistClamp, 1.0),
87
+ maxDistClamp: JsonUtils.asDouble(propsJson.maxDistClamp, 4096.0 * 1024.0 * 1024.0),
88
+ };
89
+ return constantLodPops;
90
+ }
91
+ function textureMappingFromJson(json, options) {
92
+ if (!json)
93
+ return undefined;
94
+ const texture = options.textures.get(JsonUtils.asString(json.name));
95
+ if (!texture)
96
+ return undefined;
97
+ const paramsJson = json.params;
98
+ const tf = paramsJson.transform;
99
+ const paramProps = {
100
+ textureMat2x3: new TextureMapping.Trans2x3(tf[0][0], tf[0][1], tf[0][2], tf[1][0], tf[1][1], tf[1][2]),
101
+ textureWeight: JsonUtils.asDouble(paramsJson.weight, 1.0),
102
+ mapMode: JsonUtils.asInt(paramsJson.mode),
103
+ worldMapping: JsonUtils.asBool(paramsJson.worldMapping),
104
+ useConstantLod: JsonUtils.asBool(paramsJson.useConstantLod),
105
+ constantLodProps: constantLodParamPropsFromJson(paramsJson.constantLodParams),
106
+ };
107
+ const textureMapping = new TextureMapping(texture, new TextureMapping.Params(paramProps));
108
+ const normalMapJson = json.normalMapParams;
109
+ if (normalMapJson) {
110
+ let normalMap;
111
+ const normalTexName = JsonUtils.asString(normalMapJson.textureName);
112
+ if (normalTexName.length === 0 || undefined !== (normalMap = options.textures.get(normalTexName))) {
113
+ textureMapping.normalMapParams = {
114
+ normalMap,
115
+ greenUp: JsonUtils.asBool(normalMapJson.greenUp),
116
+ scale: JsonUtils.asDouble(normalMapJson.scale, 1),
117
+ useConstantLod: JsonUtils.asBool(normalMapJson.useConstantLod),
118
+ };
119
+ }
120
+ }
121
+ return textureMapping;
122
+ }
123
+ function getMaterial(mat, options) {
124
+ if (typeof mat !== "string") {
125
+ const args = toMaterialArgs(mat);
126
+ return options.system.createRenderMaterial(args);
127
+ }
128
+ const material = options.system.findMaterial(mat, options.iModel);
129
+ if (material || !options.document.json.renderMaterials)
130
+ return material;
131
+ const json = options.document.json.renderMaterials[mat];
132
+ if (!json)
133
+ return undefined;
134
+ function colorDefFromJson(col) {
135
+ return col ? ColorDef.from(col[0] * 255 + 0.5, col[1] * 255 + 0.5, col[2] * 255 + 0.5) : undefined;
136
+ }
137
+ // eslint-disable-next-line deprecation/deprecation
138
+ const params = new RenderMaterial.Params(mat);
139
+ params.diffuseColor = colorDefFromJson(json.diffuseColor);
140
+ if (json.diffuse !== undefined)
141
+ params.diffuse = JsonUtils.asDouble(json.diffuse);
142
+ params.specularColor = colorDefFromJson(json.specularColor);
143
+ if (json.specular !== undefined)
144
+ params.specular = JsonUtils.asDouble(json.specular);
145
+ params.reflectColor = colorDefFromJson(json.reflectColor);
146
+ if (json.reflect !== undefined)
147
+ params.reflect = JsonUtils.asDouble(json.reflect);
148
+ if (json.specularExponent !== undefined)
149
+ params.specularExponent = json.specularExponent;
150
+ if (undefined !== json.transparency)
151
+ params.alpha = 1.0 - json.transparency;
152
+ params.refract = JsonUtils.asDouble(json.refract);
153
+ params.shadows = JsonUtils.asBool(json.shadows);
154
+ params.ambient = JsonUtils.asDouble(json.ambient);
155
+ if (undefined !== json.textureMapping)
156
+ params.textureMapping = textureMappingFromJson(json.textureMapping.texture, options);
157
+ // eslint-disable-next-line deprecation/deprecation
158
+ return options.system.createMaterial(params, options.iModel);
159
+ }
160
+ function getModifiers(primitive) {
161
+ const mod = primitive.modifier;
162
+ switch (mod?.type) {
163
+ case "instances":
164
+ return {
165
+ instances: {
166
+ ...mod,
167
+ transformCenter: Point3d.fromJSON(mod.transformCenter),
168
+ range: mod.range ? Range3d.fromJSON(mod.range) : undefined,
169
+ },
170
+ };
171
+ case "viewIndependentOrigin":
172
+ return {
173
+ viOrigin: Point3d.fromJSON(mod.origin),
174
+ };
175
+ default:
176
+ return {};
177
+ }
178
+ }
179
+ function createPrimitiveGeometry(primitive, options, viOrigin) {
180
+ switch (primitive.type) {
181
+ case "point":
182
+ return options.system.createPointStringGeometry({
183
+ ...primitive.params,
184
+ vertices: toVertexTable(primitive.params.vertices),
185
+ indices: new VertexIndices(primitive.params.indices),
186
+ }, viOrigin);
187
+ case "polyline":
188
+ return options.system.createPolylineGeometry({
189
+ ...primitive.params,
190
+ vertices: toVertexTable(primitive.params.vertices),
191
+ polyline: {
192
+ ...primitive.params.polyline,
193
+ indices: new VertexIndices(primitive.params.polyline.indices),
194
+ prevIndices: new VertexIndices(primitive.params.polyline.prevIndices),
195
+ },
196
+ }, viOrigin);
197
+ case "mesh": {
198
+ const surf = primitive.params.surface;
199
+ let material;
200
+ if (surf.material) {
201
+ if (!surf.material.isAtlas)
202
+ material = createSurfaceMaterial(getMaterial(surf.material.material, options));
203
+ else
204
+ material = surf.material;
205
+ }
206
+ let textureMapping;
207
+ if (surf.textureMapping) {
208
+ let texture;
209
+ if (typeof surf.textureMapping.texture === "string") {
210
+ texture = options.textures.get(surf.textureMapping.texture);
211
+ }
212
+ else {
213
+ const gradient = Gradient.Symb.fromJSON(surf.textureMapping.texture);
214
+ texture = options.system.getGradientTexture(gradient, options.iModel);
215
+ }
216
+ if (texture)
217
+ textureMapping = { texture, alwaysDisplayed: surf.textureMapping.alwaysDisplayed };
218
+ }
219
+ return options.system.createMeshGeometry({
220
+ ...primitive.params,
221
+ edges: primitive.params.edges ? edgeParamsFromImdl(primitive.params.edges) : undefined,
222
+ vertices: toVertexTable(primitive.params.vertices),
223
+ auxChannels: primitive.params.auxChannels ? AuxChannelTable.fromJSON(primitive.params.auxChannels) : undefined,
224
+ surface: {
225
+ ...primitive.params.surface,
226
+ material,
227
+ textureMapping,
228
+ indices: new VertexIndices(primitive.params.surface.indices),
229
+ },
230
+ }, viOrigin);
231
+ }
232
+ }
233
+ }
234
+ function createPrimitiveGraphic(primitive, options) {
235
+ const mods = getModifiers(primitive);
236
+ const geometry = createPrimitiveGeometry(primitive, options, mods.viOrigin);
237
+ return geometry ? options.system.createRenderGraphic(geometry, mods.instances) : undefined;
238
+ }
239
+ function createPatternGeometries(primitives, options) {
240
+ const geometries = [];
241
+ for (const primitive of primitives) {
242
+ const geometry = createPrimitiveGeometry(primitive, options, undefined);
243
+ if (geometry)
244
+ geometries.push(geometry);
245
+ }
246
+ return geometries;
247
+ }
248
+ function createPatternGraphic(params, options) {
249
+ const geometries = options.patterns.get(params.symbolName);
250
+ if (!geometries || geometries.length === 0)
251
+ return undefined;
252
+ const clip = ClipVector.fromJSON(params.clip);
253
+ const clipVolume = clip?.isValid ? options.system.createClipVolume(clip) : undefined;
254
+ if (!clipVolume)
255
+ return undefined;
256
+ const viewIndependentOrigin = params.viewIndependentOrigin ? Point3d.fromJSON(params.viewIndependentOrigin) : undefined;
257
+ const pattern = options.system.createAreaPattern({
258
+ xyOffsets: params.xyOffsets,
259
+ featureId: params.featureId,
260
+ orgTransform: Transform.fromJSON(params.orgTransform),
261
+ origin: Point2d.fromJSON(params.origin),
262
+ scale: params.scale,
263
+ spacing: Point2d.fromJSON(params.spacing),
264
+ patternToModel: Transform.fromJSON(params.modelTransform),
265
+ range: Range3d.fromJSON(params.range),
266
+ symbolTranslation: Point3d.fromJSON(params.symbolTranslation),
267
+ viewIndependentOrigin,
268
+ });
269
+ if (!pattern)
270
+ return undefined;
271
+ const branch = new GraphicBranch(true);
272
+ for (const geometry of geometries) {
273
+ const graphic = options.system.createRenderGraphic(geometry, pattern);
274
+ if (graphic)
275
+ branch.add(graphic);
276
+ }
277
+ return branch.isEmpty ? undefined : options.system.createGraphicBranch(branch, Transform.createIdentity(), { clipVolume });
278
+ }
279
+ function createNodeGraphics(node, options) {
280
+ const graphics = [];
281
+ for (const primitive of node.primitives) {
282
+ const graphic = primitive.type === "pattern" ? createPatternGraphic(primitive.params, options) : createPrimitiveGraphic(primitive, options);
283
+ if (graphic)
284
+ graphics.push(graphic);
285
+ }
286
+ return graphics;
287
+ }
288
+ /** @internal */
289
+ export async function decodeImdlGraphics(options) {
290
+ const textures = await loadNamedTextures(options);
291
+ if (options.isCanceled && options.isCanceled())
292
+ return undefined;
293
+ const patterns = new Map();
294
+ const graphicsOptions = { ...options, textures, patterns };
295
+ for (const [name, primitives] of options.document.patterns)
296
+ patterns.set(name, createPatternGeometries(primitives, graphicsOptions));
297
+ const system = options.system;
298
+ const graphics = [];
299
+ for (const node of options.document.nodes) {
300
+ const nodeGraphics = createNodeGraphics(node, graphicsOptions);
301
+ if (nodeGraphics.length === 0)
302
+ continue;
303
+ if (undefined !== node.layerId) {
304
+ const layerGraphic = 1 === nodeGraphics.length ? nodeGraphics[0] : system.createGraphicList(nodeGraphics);
305
+ graphics.push(system.createGraphicLayer(layerGraphic, node.layerId));
306
+ }
307
+ else if (undefined !== node.animationNodeId) {
308
+ const branch = new GraphicBranch(true);
309
+ branch.animationId = node.animationId;
310
+ branch.animationNodeId = node.animationNodeId;
311
+ branch.entries.push(...nodeGraphics);
312
+ graphics.push(system.createBranch(branch, Transform.createIdentity()));
313
+ }
314
+ else {
315
+ graphics.push(...nodeGraphics);
316
+ }
317
+ }
318
+ switch (graphics.length) {
319
+ case 0: return undefined;
320
+ case 1: return graphics[0];
321
+ default: return system.createGraphicList(graphics);
322
+ }
323
+ }
324
+ //# sourceMappingURL=ImdlGraphicsCreator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImdlGraphicsCreator.js","sourceRoot":"","sources":["../../../src/imdl/ImdlGraphicsCreator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EACL,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,GAC/E,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEvF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAYvE,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,QAA0B,EAAE,OAA0B;IAClG,4GAA4G;IAC5G,mCAAmC;IACnC,gDAAgD;IAChD,oEAAoE;IACpE,0GAA0G;IAC1G,6GAA6G;IAC7G,oBAAoB;IAEpB,IAAI;QACF,IAAI,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAC5C,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO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tC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YAC9C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;YACrC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;SACxE;aAAM;YACL,QAAQ,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;SAChC;KACF;IAED,QAAQ,QAAQ,CAAC,MAAM,EAAE;QACvB,KAAK,CAAC,CAAC,CAAC,OAAO,SAAS,CAAC;QACzB,KAAK,CAAC,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,CAAC,CAAC,OAAO,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;KACpD;AACH,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 Tiles\r\n */\r\n\r\nimport { JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ClipVector, Point2d, Point3d, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport {\r\n ColorDef, Gradient, ImageSource, RenderMaterial, RenderTexture, TextureMapping,\r\n} from \"@itwin/core-common\";\r\nimport type { ImdlColorDef, ImdlNamedTexture, ImdlTextureMapping } from \"../imdl/ImdlSchema\";\r\nimport type { ImdlModel as Imdl } from \"../imdl/ImdlModel\";\r\nimport { edgeParamsFromImdl, toMaterialArgs, toVertexTable } from \"../imdl/ImdlParser\";\r\nimport type { RenderGraphic } from \"../render/RenderGraphic\";\r\nimport { GraphicBranch } from \"../render/GraphicBranch\";\r\nimport type { RenderGeometry, RenderSystem } from \"../render/RenderSystem\";\r\nimport type { InstancedGraphicParams } from \"../render/InstancedGraphicParams\";\r\nimport type { IModelConnection } from \"../IModelConnection\";\r\nimport { createSurfaceMaterial } from \"../render/primitives/SurfaceParams\";\r\nimport { VertexIndices } from \"../render/primitives/VertexTable\";\r\nimport { AuxChannelTable } from \"../render/primitives/AuxChannelTable\";\r\n\r\n/** Options provided to [[decodeImdlContent]].\r\n * @internal\r\n */\r\nexport interface ImdlDecodeOptions {\r\n document: Imdl.Document;\r\n system: RenderSystem;\r\n iModel: IModelConnection;\r\n isCanceled?: () => boolean;\r\n}\r\n\r\nasync function loadNamedTexture(name: string, namedTex: ImdlNamedTexture, options: ImdlDecodeOptions): Promise<RenderTexture | undefined> {\r\n // Reasons a texture could be embedded in the tile content instead of requested separately from the backend:\r\n // - external textures are disabled\r\n // - the texture name is not a valid Id64 string\r\n // - the texture is below a certain backend-hardcoded size threshold\r\n // The bufferViewJson being defined signifies any of the above conditions. In that case, the image content\r\n // has been embedded in the tile contents. Otherwise, we will attempt to request the image content separately\r\n // from the backend.\r\n\r\n try {\r\n let textureType = RenderTexture.Type.Normal;\r\n const isGlyph = JsonUtils.asBool(namedTex.isGlyph);\r\n const isTileSection = !isGlyph && JsonUtils.asBool(namedTex.isTileSection);\r\n if (isGlyph)\r\n textureType = RenderTexture.Type.Glyph;\r\n else if (isTileSection)\r\n textureType = RenderTexture.Type.TileSection;\r\n\r\n // We produce unique tile sections for very large (> 8 megapixel) textures, and unique glyph atlases for raster text.\r\n // Neither should be cached.\r\n const cacheable = !isGlyph && !isTileSection;\r\n const ownership = cacheable ? { iModel: options.iModel, key: name } : undefined;\r\n\r\n const bufferViewId = JsonUtils.asString(namedTex.bufferView);\r\n const bufferViewJson = 0 !== bufferViewId.length ? options.document.json.bufferViews[bufferViewId] : undefined;\r\n\r\n if (undefined !== bufferViewJson) { // presence of bufferViewJson signifies we should read the texture from the tile content\r\n const byteOffset = JsonUtils.asInt(bufferViewJson.byteOffset);\r\n const byteLength = JsonUtils.asInt(bufferViewJson.byteLength);\r\n if (0 === byteLength)\r\n return undefined;\r\n\r\n const texBytes = options.document.binaryData.subarray(byteOffset, byteOffset + byteLength);\r\n const format = namedTex.format;\r\n const source = new ImageSource(texBytes, format);\r\n return await options.system.createTextureFromSource({ source, ownership, type: textureType, transparency: namedTex.transparency });\r\n }\r\n\r\n // bufferViewJson was undefined, so attempt to request the texture directly from the backend\r\n // eslint-disable-next-line deprecation/deprecation\r\n const params = new RenderTexture.Params(cacheable ? name : undefined, textureType);\r\n return options.system.createTextureFromElement(name, options.iModel, params, namedTex.format);\r\n } catch (_) {\r\n return undefined;\r\n }\r\n}\r\n\r\nasync function loadNamedTextures(options: ImdlDecodeOptions): Promise<Map<string, RenderTexture>> {\r\n const result = new Map<string, RenderTexture>();\r\n const namedTextures = options.document.json.namedTextures;\r\n if (!namedTextures)\r\n return result;\r\n\r\n const promises = new Array<Promise<void>>();\r\n for (const [name, namedTexture] of Object.entries(namedTextures)) {\r\n const texture = options.system.findTexture(name, options.iModel);\r\n if (texture) {\r\n result.set(name, texture);\r\n continue;\r\n } else if (namedTexture) {\r\n promises.push(loadNamedTexture(name, namedTexture, options).then((tx) => {\r\n if (tx)\r\n result.set(name, tx);\r\n }));\r\n }\r\n }\r\n\r\n if (promises.length > 0)\r\n await Promise.all(promises);\r\n\r\n return result;\r\n}\r\n\r\ninterface GraphicsOptions extends ImdlDecodeOptions {\r\n textures: Map<string, RenderTexture>;\r\n patterns: Map<string, RenderGeometry[]>;\r\n}\r\n\r\nfunction constantLodParamPropsFromJson(propsJson: { repetitions?: number, offset?: number[], minDistClamp?: number, maxDistClamp?: number } | undefined): TextureMapping.ConstantLodParamProps | undefined {\r\n if (undefined === propsJson)\r\n return undefined;\r\n\r\n const constantLodPops: TextureMapping.ConstantLodParamProps = {\r\n repetitions: JsonUtils.asDouble(propsJson.repetitions, 1.0),\r\n offset: { x: propsJson.offset ? JsonUtils.asDouble(propsJson.offset[0]) : 0.0, y: propsJson.offset ? JsonUtils.asDouble(propsJson.offset[1]) : 0.0 },\r\n minDistClamp: JsonUtils.asDouble(propsJson.minDistClamp, 1.0),\r\n maxDistClamp: JsonUtils.asDouble(propsJson.maxDistClamp, 4096.0 * 1024.0 * 1024.0),\r\n };\r\n return constantLodPops;\r\n}\r\n\r\nfunction textureMappingFromJson(json: ImdlTextureMapping | undefined, options: GraphicsOptions): TextureMapping | undefined {\r\n if (!json)\r\n return undefined;\r\n\r\n const texture = options.textures.get(JsonUtils.asString(json.name));\r\n if (!texture)\r\n return undefined;\r\n\r\n const paramsJson = json.params;\r\n const tf = paramsJson.transform;\r\n\r\n const paramProps: TextureMapping.ParamProps = {\r\n textureMat2x3: new TextureMapping.Trans2x3(tf[0][0], tf[0][1], tf[0][2], tf[1][0], tf[1][1], tf[1][2]),\r\n textureWeight: JsonUtils.asDouble(paramsJson.weight, 1.0),\r\n mapMode: JsonUtils.asInt(paramsJson.mode),\r\n worldMapping: JsonUtils.asBool(paramsJson.worldMapping),\r\n useConstantLod: JsonUtils.asBool(paramsJson.useConstantLod),\r\n constantLodProps: constantLodParamPropsFromJson(paramsJson.constantLodParams),\r\n };\r\n\r\n const textureMapping = new TextureMapping(texture, new TextureMapping.Params(paramProps));\r\n\r\n const normalMapJson = json.normalMapParams;\r\n if (normalMapJson) {\r\n let normalMap;\r\n const normalTexName = JsonUtils.asString(normalMapJson.textureName);\r\n if (normalTexName.length === 0 || undefined !== (normalMap = options.textures.get(normalTexName))) {\r\n textureMapping.normalMapParams = {\r\n normalMap,\r\n greenUp: JsonUtils.asBool(normalMapJson.greenUp),\r\n scale: JsonUtils.asDouble(normalMapJson.scale, 1),\r\n useConstantLod: JsonUtils.asBool(normalMapJson.useConstantLod),\r\n };\r\n }\r\n }\r\n\r\n return textureMapping;\r\n}\r\n\r\nfunction getMaterial(mat: string | Imdl.SurfaceMaterialParams, options: GraphicsOptions): RenderMaterial | undefined {\r\n if (typeof mat !== \"string\") {\r\n const args = toMaterialArgs(mat);\r\n return options.system.createRenderMaterial(args);\r\n }\r\n\r\n const material = options.system.findMaterial(mat, options.iModel);\r\n if (material || !options.document.json.renderMaterials)\r\n return material;\r\n\r\n const json = options.document.json.renderMaterials[mat];\r\n if (!json)\r\n return undefined;\r\n\r\n function colorDefFromJson(col: ImdlColorDef | undefined): ColorDef | undefined {\r\n return col ? ColorDef.from(col[0] * 255 + 0.5, col[1] * 255 + 0.5, col[2] * 255 + 0.5) : undefined;\r\n }\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n const params = new RenderMaterial.Params(mat);\r\n params.diffuseColor = colorDefFromJson(json.diffuseColor);\r\n if (json.diffuse !== undefined)\r\n params.diffuse = JsonUtils.asDouble(json.diffuse);\r\n\r\n params.specularColor = colorDefFromJson(json.specularColor);\r\n if (json.specular !== undefined)\r\n params.specular = JsonUtils.asDouble(json.specular);\r\n\r\n params.reflectColor = colorDefFromJson(json.reflectColor);\r\n if (json.reflect !== undefined)\r\n params.reflect = JsonUtils.asDouble(json.reflect);\r\n\r\n if (json.specularExponent !== undefined)\r\n params.specularExponent = json.specularExponent;\r\n\r\n if (undefined !== json.transparency)\r\n params.alpha = 1.0 - json.transparency;\r\n\r\n params.refract = JsonUtils.asDouble(json.refract);\r\n params.shadows = JsonUtils.asBool(json.shadows);\r\n params.ambient = JsonUtils.asDouble(json.ambient);\r\n\r\n if (undefined !== json.textureMapping)\r\n params.textureMapping = textureMappingFromJson(json.textureMapping.texture, options);\r\n\r\n // eslint-disable-next-line deprecation/deprecation\r\n return options.system.createMaterial(params, options.iModel);\r\n}\r\n\r\nfunction getModifiers(primitive: Imdl.Primitive): { viOrigin?: Point3d, instances?: InstancedGraphicParams } {\r\n const mod = primitive.modifier;\r\n switch (mod?.type) {\r\n case \"instances\":\r\n return {\r\n instances: {\r\n ...mod,\r\n transformCenter: Point3d.fromJSON(mod.transformCenter),\r\n range: mod.range ? Range3d.fromJSON(mod.range) : undefined,\r\n },\r\n };\r\n case \"viewIndependentOrigin\":\r\n return {\r\n viOrigin: Point3d.fromJSON(mod.origin),\r\n };\r\n default:\r\n return { };\r\n }\r\n}\r\n\r\nfunction createPrimitiveGeometry(primitive: Imdl.Primitive, options: GraphicsOptions, viOrigin: Point3d | undefined): RenderGeometry | undefined {\r\n switch (primitive.type) {\r\n case \"point\":\r\n return options.system.createPointStringGeometry({\r\n ...primitive.params,\r\n vertices: toVertexTable(primitive.params.vertices),\r\n indices: new VertexIndices(primitive.params.indices),\r\n }, viOrigin);\r\n case \"polyline\":\r\n return options.system.createPolylineGeometry({\r\n ...primitive.params,\r\n vertices: toVertexTable(primitive.params.vertices),\r\n polyline: {\r\n ...primitive.params.polyline,\r\n indices: new VertexIndices(primitive.params.polyline.indices),\r\n prevIndices: new VertexIndices(primitive.params.polyline.prevIndices),\r\n },\r\n }, viOrigin);\r\n case \"mesh\": {\r\n const surf = primitive.params.surface;\r\n let material;\r\n if (surf.material) {\r\n if (!surf.material.isAtlas)\r\n material = createSurfaceMaterial(getMaterial(surf.material.material, options));\r\n else\r\n material = surf.material;\r\n }\r\n\r\n let textureMapping;\r\n if (surf.textureMapping) {\r\n let texture;\r\n if (typeof surf.textureMapping.texture === \"string\") {\r\n texture = options.textures.get(surf.textureMapping.texture);\r\n } else {\r\n const gradient = Gradient.Symb.fromJSON(surf.textureMapping.texture);\r\n texture = options.system.getGradientTexture(gradient, options.iModel);\r\n }\r\n\r\n if (texture)\r\n textureMapping = { texture, alwaysDisplayed: surf.textureMapping.alwaysDisplayed };\r\n }\r\n\r\n return options.system.createMeshGeometry({\r\n ...primitive.params,\r\n edges: primitive.params.edges ? edgeParamsFromImdl(primitive.params.edges) : undefined,\r\n vertices: toVertexTable(primitive.params.vertices),\r\n auxChannels: primitive.params.auxChannels ? AuxChannelTable.fromJSON(primitive.params.auxChannels) : undefined,\r\n surface: {\r\n ...primitive.params.surface,\r\n material,\r\n textureMapping,\r\n indices: new VertexIndices(primitive.params.surface.indices),\r\n },\r\n }, viOrigin);\r\n }\r\n }\r\n}\r\n\r\nfunction createPrimitiveGraphic(primitive: Imdl.Primitive, options: GraphicsOptions): RenderGraphic | undefined {\r\n const mods = getModifiers(primitive);\r\n const geometry = createPrimitiveGeometry(primitive, options, mods.viOrigin);\r\n return geometry ? options.system.createRenderGraphic(geometry, mods.instances) : undefined;\r\n}\r\n\r\nfunction createPatternGeometries(primitives: Imdl.Primitive[], options: GraphicsOptions): RenderGeometry[] {\r\n const geometries = [];\r\n for (const primitive of primitives) {\r\n const geometry = createPrimitiveGeometry(primitive, options, undefined);\r\n if (geometry)\r\n geometries.push(geometry);\r\n }\r\n\r\n return geometries;\r\n}\r\n\r\nfunction createPatternGraphic(params: Imdl.AreaPatternParams, options: GraphicsOptions): RenderGraphic | undefined {\r\n const geometries = options.patterns.get(params.symbolName);\r\n if (!geometries || geometries.length === 0)\r\n return undefined;\r\n\r\n const clip = ClipVector.fromJSON(params.clip);\r\n const clipVolume = clip?.isValid ? options.system.createClipVolume(clip) : undefined;\r\n if (!clipVolume)\r\n return undefined;\r\n\r\n const viewIndependentOrigin = params.viewIndependentOrigin ? Point3d.fromJSON(params.viewIndependentOrigin) : undefined;\r\n const pattern = options.system.createAreaPattern({\r\n xyOffsets: params.xyOffsets,\r\n featureId: params.featureId,\r\n orgTransform: Transform.fromJSON(params.orgTransform),\r\n origin: Point2d.fromJSON(params.origin),\r\n scale: params.scale,\r\n spacing: Point2d.fromJSON(params.spacing),\r\n patternToModel: Transform.fromJSON(params.modelTransform),\r\n range: Range3d.fromJSON(params.range),\r\n symbolTranslation: Point3d.fromJSON(params.symbolTranslation),\r\n viewIndependentOrigin,\r\n });\r\n\r\n if (!pattern)\r\n return undefined;\r\n\r\n const branch = new GraphicBranch(true);\r\n for (const geometry of geometries) {\r\n const graphic = options.system.createRenderGraphic(geometry, pattern);\r\n if (graphic)\r\n branch.add(graphic);\r\n }\r\n\r\n return branch.isEmpty ? undefined : options.system.createGraphicBranch(branch, Transform.createIdentity(), { clipVolume });\r\n}\r\n\r\nfunction createNodeGraphics(node: Imdl.Node, options: GraphicsOptions): RenderGraphic[] {\r\n const graphics = [];\r\n for (const primitive of node.primitives) {\r\n const graphic = primitive.type === \"pattern\" ? createPatternGraphic(primitive.params, options) : createPrimitiveGraphic(primitive, options);\r\n if (graphic)\r\n graphics.push(graphic);\r\n }\r\n\r\n return graphics;\r\n}\r\n\r\n/** @internal */\r\nexport async function decodeImdlGraphics(options: ImdlDecodeOptions): Promise<RenderGraphic | undefined> {\r\n const textures = await loadNamedTextures(options);\r\n if (options.isCanceled && options.isCanceled())\r\n return undefined;\r\n\r\n const patterns = new Map<string, RenderGeometry[]>();\r\n const graphicsOptions = { ...options, textures, patterns };\r\n\r\n for (const [name, primitives] of options.document.patterns)\r\n patterns.set(name, createPatternGeometries(primitives, graphicsOptions));\r\n\r\n const system = options.system;\r\n const graphics: RenderGraphic[] = [];\r\n for (const node of options.document.nodes) {\r\n const nodeGraphics = createNodeGraphics(node, graphicsOptions);\r\n if (nodeGraphics.length === 0)\r\n continue;\r\n\r\n if (undefined !== node.layerId) {\r\n const layerGraphic = 1 === nodeGraphics.length ? nodeGraphics[0] : system.createGraphicList(nodeGraphics);\r\n graphics.push(system.createGraphicLayer(layerGraphic, node.layerId));\r\n } else if (undefined !== node.animationNodeId) {\r\n const branch = new GraphicBranch(true);\r\n branch.animationId = node.animationId;\r\n branch.animationNodeId = node.animationNodeId;\r\n branch.entries.push(...nodeGraphics);\r\n graphics.push(system.createBranch(branch, Transform.createIdentity()));\r\n } else {\r\n graphics.push(...nodeGraphics);\r\n }\r\n }\r\n\r\n switch (graphics.length) {\r\n case 0: return undefined;\r\n case 1: return graphics[0];\r\n default: return system.createGraphicList(graphics);\r\n }\r\n}\r\n"]}