@itwin/core-frontend 5.1.0-dev.55 → 5.1.0-dev.56
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.
- package/lib/cjs/DisplayStyleState.d.ts +37 -0
- package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
- package/lib/cjs/DisplayStyleState.js +65 -0
- package/lib/cjs/DisplayStyleState.js.map +1 -1
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +16 -0
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/core-frontend.d.ts +1 -1
- package/lib/cjs/core-frontend.js +1 -1
- package/lib/cjs/core-frontend.js.map +1 -1
- package/lib/cjs/internal/ScriptUtils.d.ts +5 -0
- package/lib/cjs/internal/ScriptUtils.d.ts.map +1 -0
- package/lib/cjs/internal/ScriptUtils.js +120 -0
- package/lib/cjs/internal/ScriptUtils.js.map +1 -0
- package/lib/cjs/internal/tile/IModelTile.js.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.d.ts +4 -2
- package/lib/cjs/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/cjs/internal/tile/IModelTileTree.js +58 -0
- package/lib/cjs/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/cjs/internal/tile/PrimaryTileTree.js +1 -1
- package/lib/cjs/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/cjs/tile/ImdlReader.js.map +1 -1
- package/lib/cjs/tile/TileTree.d.ts +14 -1
- package/lib/cjs/tile/TileTree.d.ts.map +1 -1
- package/lib/cjs/tile/TileTree.js +13 -0
- package/lib/cjs/tile/TileTree.js.map +1 -1
- package/lib/esm/DisplayStyleState.d.ts +37 -0
- package/lib/esm/DisplayStyleState.d.ts.map +1 -1
- package/lib/esm/DisplayStyleState.js +65 -0
- package/lib/esm/DisplayStyleState.js.map +1 -1
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +16 -0
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/core-frontend.d.ts +1 -1
- package/lib/esm/core-frontend.js +1 -1
- package/lib/esm/core-frontend.js.map +1 -1
- package/lib/esm/internal/ScriptUtils.d.ts +5 -0
- package/lib/esm/internal/ScriptUtils.d.ts.map +1 -0
- package/lib/esm/internal/ScriptUtils.js +117 -0
- package/lib/esm/internal/ScriptUtils.js.map +1 -0
- package/lib/esm/internal/tile/IModelTile.js.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.d.ts +4 -2
- package/lib/esm/internal/tile/IModelTileTree.d.ts.map +1 -1
- package/lib/esm/internal/tile/IModelTileTree.js +60 -2
- package/lib/esm/internal/tile/IModelTileTree.js.map +1 -1
- package/lib/esm/internal/tile/PrimaryTileTree.js +1 -1
- package/lib/esm/internal/tile/PrimaryTileTree.js.map +1 -1
- package/lib/esm/tile/ImdlReader.js.map +1 -1
- package/lib/esm/tile/TileTree.d.ts +14 -1
- package/lib/esm/tile/TileTree.d.ts.map +1 -1
- package/lib/esm/tile/TileTree.js +13 -0
- package/lib/esm/tile/TileTree.js.map +1 -1
- package/lib/public/scripts/parse-imdl-worker.js +1 -1
- package/lib/workers/webpack/parse-imdl-worker.js +1 -1
- package/package.json +20 -20
package/lib/esm/core-frontend.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-frontend.js","sourceRoot":"","sources":["../../src/core-frontend.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,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C;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":["/*---------------------------------------------------------------------------------------------\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\nexport * from \"./AccuDraw\";\nexport * from \"./AccuSnap\";\nexport * from \"./AuxCoordSys\";\nexport * from \"./BingLocation\";\nexport * from \"./BriefcaseConnection\";\nexport * from \"./BriefcaseTxns\";\nexport * from \"./CatalogConnection\";\nexport * from \"./CategorySelectorState\";\nexport * from \"./ChangeFlags\";\nexport * from \"./CheckpointConnection\";\nexport * from \"./common\";\nexport * from \"./ContextRealityModelState\";\nexport * from \"./CoordSystem\";\nexport * from \"./DecorationsCache\";\nexport * from \"./DevTools\";\nexport * from \"./DisplayStyleState\";\nexport * from \"./DrawingViewState\";\nexport * from \"./ElementLocateManager\";\nexport * from \"./EmphasizeElements\";\nexport * from \"./EntityState\";\nexport * from \"./EnvironmentDecorations\";\nexport * from \"./FeatureOverrideProvider\";\nexport * from \"./FlashSettings\";\nexport * from \"./FrontendHubAccess\";\nexport * from \"./Frustum2d\";\nexport * from \"./FrustumAnimator\";\nexport * from \"./FuzzySearch\";\nexport * from \"./GeoServices\";\nexport * from \"./GlobeAnimator\";\nexport * from \"./GraphicalEditingScope\";\nexport * from \"./HitDetail\";\nexport * from \"./IModelApp\";\nexport * from \"./IModelConnection\";\nexport * from \"./IModelRoutingContext\";\nexport * from \"./IpcApp\";\nexport * from \"./LinePlaneIntersect\";\nexport * from \"./MarginPercent\";\nexport * from \"./Marker\";\nexport * from \"./ModelSelectorState\";\nexport * from \"./ModelState\";\nexport * from \"./NativeApp\";\nexport * from \"./NativeAppLogger\";\nexport * from \"./NoRenderApp\";\nexport * from \"./NotificationManager\";\nexport * from \"./PerModelCategoryVisibility\";\nexport * from \"./PlanarClipMaskState\";\nexport * from \"./SelectionSet\";\nexport * from \"./SheetViewState\";\nexport * from \"./SpatialClassifiersState\";\nexport * from \"./SpatialViewState\";\nexport * from \"./Sprites\";\nexport * from \"./StandardView\";\nexport * from \"./SubCategoriesCache\";\nexport * from \"./TentativePoint\";\nexport * from \"./Tiles\";\nexport * from \"./UserPreferences\";\nexport * from \"./ViewAnimation\";\nexport * from \"./ViewContext\";\nexport * from \"./ViewGlobalLocation\";\nexport * from \"./ViewingSpace\";\nexport * from \"./ViewManager\";\nexport * from \"./Viewport\";\nexport * from \"./ViewportSync\";\nexport * from \"./ViewPose\";\nexport * from \"./ViewState\";\nexport * from \"./ViewStatus\";\nexport * from \"./extension/Extension\";\nexport * from \"./extension/providers/LocalExtensionProvider\";\nexport * from \"./extension/providers/RemoteExtensionProvider\";\nexport * from \"./properties/AngleDescription\";\nexport * from \"./properties/FormattedQuantityDescription\";\nexport * from \"./properties/LengthDescription\";\nexport * from \"./quantity-formatting/QuantityFormatter\";\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\nexport * from \"./render/CanvasDecoration\";\nexport * from \"./render/CreateRenderMaterialArgs\";\nexport * from \"./render/CreateTextureArgs\";\nexport * from \"./render/Decorations\";\nexport * from \"./render/FeatureSymbology\";\nexport * from \"./render/FrameStats\";\nexport * from \"./render/GraphicBranch\";\nexport * from \"./render/GraphicBuilder\";\nexport * from \"./render/GraphicTemplate\";\nexport * from \"./render/MeshArgs\";\nexport * from \"./render/ParticleCollectionBuilder\";\nexport * from \"./render/Pixel\";\nexport * from \"./render/PolylineArgs\";\nexport * from \"./render/RealityMeshParams\";\nexport * from \"./render/RenderClipVolume\";\nexport * from \"./render/RenderGraphic\";\nexport * from \"./render/RenderMemory\";\nexport * from \"./render/RenderSystem\";\nexport * from \"./render/RenderTarget\";\nexport * from \"./render/Scene\";\nexport * from \"./render/ScreenSpaceEffectBuilder\";\nexport * from \"./render/VisibleFeature\";\nexport * from \"./internal/render/webgl/IModelFrameLifecycle\";\nexport type {\n TxnEntityChange,\n TxnEntityChangeIterable,\n TxnEntityChangeType,\n TxnEntityChanges,\n TxnEntityChangesFilterOptions,\n TxnEntityMetadata,\n TxnEntityMetadataCriterion,\n} from \"./TxnEntityChanges\";\nexport {\n type TileTreeDiscloser, DisclosedTileTreeSet,\n type ReadGltfGraphicsArgs, type GltfGraphic, type GltfTemplate, readGltfGraphics, readGltfTemplate, readGltf,\n readElementGraphics,\n type BatchTableProperties, RealityTileTree,\n type RealityTileGeometry, RealityTile,\n type RenderGraphicTileTreeArgs,\n type GpuMemoryLimit, type GpuMemoryLimits, TileAdmin,\n type TileContent,\n type TiledGraphicsProvider,\n type TileDrawArgParams, TileDrawArgs,\n type CollectTileStatus, type TileGeometryCollectorOptions, TileGeometryCollector, type GeometryTileTreeReference,\n type TileParams,\n TileRequestChannels,\n type TileContentDecodingStatistics, TileRequestChannelStatistics, TileRequestChannel,\n TileRequest,\n type TileTreeOwner,\n type TileTreeParams,\n TileGraphicType, TileTreeReference,\n type TileTreeSupplier,\n TileTreeLoadStatus, TileTree,\n Tile, TileLoadStatus, TileVisibility, TileLoadPriority, TileBoundingBoxes,\n TileUsageMarker,\n TileUser,\n BingElevationProvider,\n QuadId, type QuadIdProps,\n MapTilingScheme, GeographicTilingScheme, WebMercatorProjection, WebMercatorTilingScheme,\n type MapLayerIndex,\n MapTileProjection, MapTile,\n MapLayerTileTreeReference,\n MapLayerSourceStatus, type MapLayerSourceProps, MapLayerSource, MapLayerSources,\n MapLayerImageryProviderStatus, MapLayerImageryProvider,\n ImageryMapLayerFormat,\n MapLayerFormat, type ValidateSourceArgs, type MapLayerFormatType, type MapLayerSourceValidation, type MapLayerOptions, MapLayerFormatRegistry,\n type MapLayerTokenEndpoint, type MapLayerAuthenticationInfo, type MapLayerAccessToken, type MapLayerAccessTokenParams, type MapLayerAccessClient,\n type MapFeatureInfoOptions, MapFeatureInfoRecord, type MapFeatureInfo, type MapLayerFeatureInfo, type MapSubLayerFeatureInfo, type MapLayerFeature, type MapLayerFeatureGeometry, type MapLayerFeatureAttribute, MapLayerFeatureRecord,\n MapCartoRectangle,\n ImageryMapLayerTreeReference,\n EllipsoidTerrainProvider,\n getCesiumAssetUrl,\n MapTileTreeScaleRangeVisibility, MapTileTree,\n type TerrainMeshProviderOptions, type RequestMeshDataArgs, type ReadMeshArgs, TerrainMeshProvider,\n type TerrainProvider, TerrainProviderRegistry,\n} from \"./tile/internal\";\nexport * from \"./tools/AccuDrawTool\";\nexport * from \"./tools/AccuDrawViewportUI\";\nexport * from \"./tools/ClipViewTool\";\nexport * from \"./tools/EditManipulator\";\nexport * from \"./tools/ElementSetTool\";\nexport * from \"./tools/EventController\";\nexport * from \"./tools/IdleTool\";\nexport * from \"./tools/MeasureTool\";\nexport * from \"./tools/PrimitiveTool\";\nexport * from \"./tools/SelectTool\";\nexport * from \"./tools/Tool\";\nexport * from \"./tools/ToolSettings\";\nexport * from \"./tools/ToolAdmin\";\nexport * from \"./tools/ToolAssistance\";\nexport * from \"./tools/ViewTool\";\nexport * from \"./workers/RegisterWorker\";\nexport * from \"./BackgroundMapGeometry\";\nexport * from \"./ViewCreator2d\";\nexport * from \"./ViewCreator3d\";\nexport * from \"./LocalhostIpcApp\";\nexport * from \"./request/utils\";\nexport * from \"./RealityDataSource\";\n\nexport * from \"./internal/cross-package\";\n\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\nimport \"./extension/ExtensionRuntime\";\n\n/** @docs-package-description\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).\n */\n\n/**\n * @docs-group-description IModelApp\n * Classes for configuring and administering an iTwin.js application.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description IModelConnection\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\n */\n/**\n * @docs-group-description ElementState\n * Classes for working with the *state* of Elements in the frontend.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description ModelState\n * Classes for working with the *state* of Models in the frontend.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description Tools\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\n */\n/**\n * @docs-group-description Measure\n * Classes for reporting point to point distances and mass properties of elements.\n */\n/**\n * @docs-group-description Views\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\n */\n/**\n * @docs-group-description LocatingElements\n * Classes for locating and snapping to elements in views.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description AccuDraw\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description Notifications\n * Notifications provide feedback to the user of something of interest.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description Extensions\n * Classes for creating and managing Extensions.\n */\n/**\n * @docs-group-description Properties\n * Classes for working with property records and descriptions.\n */\n/**\n * @docs-group-description Rendering\n * Classes for rendering the contents of views.\n */\n/**\n * @docs-group-description SelectionSet\n * Classes for working with the set of selected elements.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description NativeApp\n * Classes for working with Native Applications\n */\n/**\n * @docs-group-description Utils\n * Miscellaneous utility classes.\n */\n/**\n * @docs-group-description Logging\n * Logger categories used by this package\n */\n/**\n * @docs-group-description QuantityFormatting\n * Classes for formatting and parsing quantity values.\n */\n/**\n * @docs-group-description Tiles\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\n */\n/**\n * @docs-group-description HubAccess\n * APIs for working with IModelHub\n */\n/**\n * @docs-group-description UserPreferences\n * APIs for working with user preferences in an iModelApp.\n * See [the learning articles]($docs/learning/frontend/preferences.md).\n */\n/**\n * @docs-group-description MapLayers\n * Classes supporting map layers display.\n */\n/**\n * @docs-group-description TileStorage\n * Class for working with cloud storage using iTwin/object-storage cloud providers\n*/\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,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,wBAAwB,CAAC;AACvC,cAAc,UAAU,CAAC;AACzB,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,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAA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WAAW,EACkC,mBAAmB,EAC3E,uBAAuB,GAC9C,MAAM,iBAAiB,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,0BAA0B,CAAC;AAEzC,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":["/*---------------------------------------------------------------------------------------------\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\nexport * from \"./AccuDraw\";\nexport * from \"./AccuSnap\";\nexport * from \"./AuxCoordSys\";\nexport * from \"./BingLocation\";\nexport * from \"./BriefcaseConnection\";\nexport * from \"./BriefcaseTxns\";\nexport * from \"./CatalogConnection\";\nexport * from \"./CategorySelectorState\";\nexport * from \"./ChangeFlags\";\nexport * from \"./CheckpointConnection\";\nexport * from \"./common\";\nexport * from \"./ContextRealityModelState\";\nexport * from \"./CoordSystem\";\nexport * from \"./DecorationsCache\";\nexport * from \"./DevTools\";\nexport * from \"./DisplayStyleState\";\nexport * from \"./DrawingViewState\";\nexport * from \"./ElementLocateManager\";\nexport * from \"./EmphasizeElements\";\nexport * from \"./EntityState\";\nexport * from \"./EnvironmentDecorations\";\nexport * from \"./FeatureOverrideProvider\";\nexport * from \"./FlashSettings\";\nexport * from \"./FrontendHubAccess\";\nexport * from \"./Frustum2d\";\nexport * from \"./FrustumAnimator\";\nexport * from \"./FuzzySearch\";\nexport * from \"./GeoServices\";\nexport * from \"./GlobeAnimator\";\nexport * from \"./GraphicalEditingScope\";\nexport * from \"./HitDetail\";\nexport * from \"./IModelApp\";\nexport * from \"./IModelConnection\";\nexport * from \"./IModelRoutingContext\";\nexport * from \"./IpcApp\";\nexport * from \"./LinePlaneIntersect\";\nexport * from \"./MarginPercent\";\nexport * from \"./Marker\";\nexport * from \"./ModelSelectorState\";\nexport * from \"./ModelState\";\nexport * from \"./NativeApp\";\nexport * from \"./NativeAppLogger\";\nexport * from \"./NoRenderApp\";\nexport * from \"./NotificationManager\";\nexport * from \"./PerModelCategoryVisibility\";\nexport * from \"./PlanarClipMaskState\";\nexport * from \"./SelectionSet\";\nexport * from \"./SheetViewState\";\nexport * from \"./SpatialClassifiersState\";\nexport * from \"./SpatialViewState\";\nexport * from \"./Sprites\";\nexport * from \"./StandardView\";\nexport * from \"./SubCategoriesCache\";\nexport * from \"./TentativePoint\";\nexport * from \"./Tiles\";\nexport * from \"./UserPreferences\";\nexport * from \"./ViewAnimation\";\nexport * from \"./ViewContext\";\nexport * from \"./ViewGlobalLocation\";\nexport * from \"./ViewingSpace\";\nexport * from \"./ViewManager\";\nexport * from \"./Viewport\";\nexport * from \"./ViewportSync\";\nexport * from \"./ViewPose\";\nexport * from \"./ViewState\";\nexport * from \"./ViewStatus\";\nexport * from \"./extension/Extension\";\nexport * from \"./extension/providers/LocalExtensionProvider\";\nexport * from \"./extension/providers/RemoteExtensionProvider\";\nexport * from \"./properties/AngleDescription\";\nexport * from \"./properties/FormattedQuantityDescription\";\nexport * from \"./properties/LengthDescription\";\nexport * from \"./quantity-formatting/QuantityFormatter\";\nexport * from \"./quantity-formatting/BaseUnitFormattingSettingsProvider\";\nexport * from \"./quantity-formatting/LocalUnitFormatProvider\";\nexport * from \"./quantity-formatting/QuantityTypesEditorSpecs\";\nexport * from \"./render/CanvasDecoration\";\nexport * from \"./render/CreateRenderMaterialArgs\";\nexport * from \"./render/CreateTextureArgs\";\nexport * from \"./render/Decorations\";\nexport * from \"./render/FeatureSymbology\";\nexport * from \"./render/FrameStats\";\nexport * from \"./render/GraphicBranch\";\nexport * from \"./render/GraphicBuilder\";\nexport * from \"./render/GraphicTemplate\";\nexport * from \"./render/MeshArgs\";\nexport * from \"./render/ParticleCollectionBuilder\";\nexport * from \"./render/Pixel\";\nexport * from \"./render/PolylineArgs\";\nexport * from \"./render/RealityMeshParams\";\nexport * from \"./render/RenderClipVolume\";\nexport * from \"./render/RenderGraphic\";\nexport * from \"./render/RenderMemory\";\nexport * from \"./render/RenderSystem\";\nexport * from \"./render/RenderTarget\";\nexport * from \"./render/Scene\";\nexport * from \"./render/ScreenSpaceEffectBuilder\";\nexport * from \"./render/VisibleFeature\";\nexport * from \"./internal/render/webgl/IModelFrameLifecycle\";\nexport type {\n TxnEntityChange,\n TxnEntityChangeIterable,\n TxnEntityChangeType,\n TxnEntityChanges,\n TxnEntityChangesFilterOptions,\n TxnEntityMetadata,\n TxnEntityMetadataCriterion,\n} from \"./TxnEntityChanges\";\nexport {\n type TileTreeDiscloser, DisclosedTileTreeSet,\n type ReadGltfGraphicsArgs, type GltfGraphic, type GltfTemplate, readGltfGraphics, readGltfTemplate, readGltf,\n readElementGraphics,\n type BatchTableProperties, RealityTileTree,\n type RealityTileGeometry, RealityTile,\n type RenderGraphicTileTreeArgs,\n type GpuMemoryLimit, type GpuMemoryLimits, TileAdmin,\n type TileContent,\n type TiledGraphicsProvider,\n type TileDrawArgParams, TileDrawArgs,\n type CollectTileStatus, type TileGeometryCollectorOptions, TileGeometryCollector, type GeometryTileTreeReference,\n type TileParams,\n TileRequestChannels,\n type TileContentDecodingStatistics, TileRequestChannelStatistics, TileRequestChannel,\n TileRequest,\n type TileTreeOwner,\n type TileTreeParams,\n TileGraphicType, TileTreeReference,\n type TileTreeSupplier,\n TileTreeLoadStatus, TileTree,\n Tile, TileLoadStatus, TileVisibility, TileLoadPriority, TileBoundingBoxes,\n TileUsageMarker,\n TileUser,\n BingElevationProvider,\n QuadId, type QuadIdProps,\n MapTilingScheme, GeographicTilingScheme, WebMercatorProjection, WebMercatorTilingScheme,\n type MapLayerIndex,\n MapTileProjection, MapTile,\n MapLayerTileTreeReference,\n MapLayerSourceStatus, type MapLayerSourceProps, MapLayerSource, MapLayerSources,\n MapLayerImageryProviderStatus, MapLayerImageryProvider,\n ImageryMapLayerFormat,\n MapLayerFormat, type ValidateSourceArgs, type MapLayerFormatType, type MapLayerSourceValidation, type MapLayerOptions, MapLayerFormatRegistry,\n type MapLayerTokenEndpoint, type MapLayerAuthenticationInfo, type MapLayerAccessToken, type MapLayerAccessTokenParams, type MapLayerAccessClient,\n type MapFeatureInfoOptions, MapFeatureInfoRecord, type MapFeatureInfo, type MapLayerFeatureInfo, type MapSubLayerFeatureInfo, type MapLayerFeature, type MapLayerFeatureGeometry, type MapLayerFeatureAttribute, MapLayerFeatureRecord,\n MapCartoRectangle,\n ImageryMapLayerTreeReference,\n EllipsoidTerrainProvider,\n getCesiumAssetUrl,\n MapTileTreeScaleRangeVisibility, MapTileTree,\n type TerrainMeshProviderOptions, type RequestMeshDataArgs, type ReadMeshArgs, TerrainMeshProvider,\n type TerrainProvider, TerrainProviderRegistry,\n} from \"./tile/internal\";\nexport * from \"./tools/AccuDrawTool\";\nexport * from \"./tools/AccuDrawViewportUI\";\nexport * from \"./tools/ClipViewTool\";\nexport * from \"./tools/EditManipulator\";\nexport * from \"./tools/ElementSetTool\";\nexport * from \"./tools/EventController\";\nexport * from \"./tools/IdleTool\";\nexport * from \"./tools/MeasureTool\";\nexport * from \"./tools/PrimitiveTool\";\nexport * from \"./tools/SelectTool\";\nexport * from \"./tools/Tool\";\nexport * from \"./tools/ToolSettings\";\nexport * from \"./tools/ToolAdmin\";\nexport * from \"./tools/ToolAssistance\";\nexport * from \"./tools/ViewTool\";\nexport * from \"./workers/RegisterWorker\";\nexport * from \"./BackgroundMapGeometry\";\nexport * from \"./ViewCreator2d\";\nexport * from \"./ViewCreator3d\";\nexport * from \"./LocalhostIpcApp\";\nexport * from \"./request/utils\";\nexport * from \"./RealityDataSource\";\n\nexport * from \"./internal/cross-package\";\n\n// TODO/FIX: \"./extension/ExtensionRuntime\" import has to be last to avoid circular dependency errors.\nimport \"./extension/ExtensionRuntime\";\n\n/** @docs-package-description\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).\n */\n\n/**\n * @docs-group-description IModelApp\n * Classes for configuring and administering an iTwin.js application.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description IModelConnection\n * Classes for working with a connection to an [iModel briefcase]($docs/learning/IModels.md)\n */\n/**\n * @docs-group-description ElementState\n * Classes for working with the *state* of Elements in the frontend.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description ModelState\n * Classes for working with the *state* of Models in the frontend.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description Tools\n * Classes for [working with Tools]($docs/learning/frontend/Tools.md)\n */\n/**\n * @docs-group-description Measure\n * Classes for reporting point to point distances and mass properties of elements.\n */\n/**\n * @docs-group-description Views\n * Classes for [working with Views]($docs/learning/frontend/Views.md)\n */\n/**\n * @docs-group-description LocatingElements\n * Classes for locating and snapping to elements in views.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description AccuDraw\n * AccuDraw provides helpful assistance for creating and modifying elements in a view.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description Notifications\n * Notifications provide feedback to the user of something of interest.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description Extensions\n * Classes for creating and managing Extensions.\n */\n/**\n * @docs-group-description Properties\n * Classes for working with property records and descriptions.\n */\n/**\n * @docs-group-description Rendering\n * Classes for rendering the contents of views.\n */\n/**\n * @docs-group-description SelectionSet\n * Classes for working with the set of selected elements.\n * See [the learning articles]($docs/learning/frontend/index.md).\n */\n/**\n * @docs-group-description NativeApp\n * Classes for working with Native Applications\n */\n/**\n * @docs-group-description Utils\n * Miscellaneous utility classes.\n */\n/**\n * @docs-group-description Logging\n * Logger categories used by this package\n */\n/**\n * @docs-group-description QuantityFormatting\n * Classes for formatting and parsing quantity values.\n */\n/**\n * @docs-group-description Tiles\n * Classes representing graphics as [hierarchical 3d tiles](https://github.com/CesiumGS/3d-tiles).\n */\n/**\n * @docs-group-description HubAccess\n * APIs for working with IModelHub\n */\n/**\n * @docs-group-description UserPreferences\n * APIs for working with user preferences in an iModelApp.\n * See [the learning articles]($docs/learning/frontend/preferences.md).\n */\n/**\n * @docs-group-description MapLayers\n * Classes supporting map layers display.\n */\n/**\n * @docs-group-description TileStorage\n * Class for working with cloud storage using iTwin/object-storage cloud providers\n*/"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Id64String } from "@itwin/core-bentley";
|
|
2
|
+
import { RenderSchedule } from "@itwin/core-common";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare function getScriptDelta(prev: RenderSchedule.Script | undefined | null, next: RenderSchedule.Script): Set<Id64String>;
|
|
5
|
+
//# sourceMappingURL=ScriptUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScriptUtils.d.ts","sourceRoot":"","sources":["../../../src/internal/ScriptUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,gBAAgB;AAChB,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,CA4C3H"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/** @internal */
|
|
2
|
+
export function getScriptDelta(prev, next) {
|
|
3
|
+
if (!prev || !prev.modelTimelines || prev.modelTimelines.length === 0) {
|
|
4
|
+
return getAllElementIdsFromScript(next);
|
|
5
|
+
}
|
|
6
|
+
const changed = new Set();
|
|
7
|
+
const prevModels = new Map(prev.modelTimelines.map(m => [m.modelId, m]));
|
|
8
|
+
const nextModels = new Map(next.modelTimelines.map(m => [m.modelId, m]));
|
|
9
|
+
for (const modelId of new Set([...prevModels.keys(), ...nextModels.keys()])) {
|
|
10
|
+
const prevModel = prevModels.get(modelId);
|
|
11
|
+
const nextModel = nextModels.get(modelId);
|
|
12
|
+
if (!prevModel || !nextModel) {
|
|
13
|
+
const timelines = (prevModel ?? nextModel)?.elementTimelines ?? [];
|
|
14
|
+
for (const timeline of timelines)
|
|
15
|
+
for (const id of timeline.elementIds)
|
|
16
|
+
changed.add(id);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const prevTimelineMap = new Map(prevModel.elementTimelines.map(et => [et.batchId, et]));
|
|
20
|
+
const nextTimelineMap = new Map(nextModel.elementTimelines.map(et => [et.batchId, et]));
|
|
21
|
+
const allBatchIds = new Set([...prevTimelineMap.keys(), ...nextTimelineMap.keys()]);
|
|
22
|
+
for (const batchId of allBatchIds) {
|
|
23
|
+
const prevTimeline = prevTimelineMap.get(batchId);
|
|
24
|
+
const nextTimeline = nextTimelineMap.get(batchId);
|
|
25
|
+
if (!prevTimeline || !nextTimeline) {
|
|
26
|
+
const ids = (prevTimeline ?? nextTimeline)?.elementIds ?? [];
|
|
27
|
+
for (const id of ids)
|
|
28
|
+
changed.add(id);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (!isTimelineEntryEqual(prevTimeline, nextTimeline)) {
|
|
32
|
+
for (const id of nextTimeline.elementIds)
|
|
33
|
+
changed.add(id);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return changed;
|
|
38
|
+
}
|
|
39
|
+
function collectTimelineEntryTimes(timeline) {
|
|
40
|
+
const result = new Set();
|
|
41
|
+
if (timeline.cuttingPlane) {
|
|
42
|
+
for (const entry of timeline.cuttingPlane) {
|
|
43
|
+
result.add(entry.time);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (timeline.visibility) {
|
|
47
|
+
for (const entry of timeline.visibility) {
|
|
48
|
+
result.add(entry.time);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (timeline.transform) {
|
|
52
|
+
for (const entry of timeline.transform) {
|
|
53
|
+
result.add(entry.time);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (timeline.color) {
|
|
57
|
+
for (const entry of timeline.color) {
|
|
58
|
+
result.add(entry.time);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return Array.from(result);
|
|
62
|
+
}
|
|
63
|
+
function isTimelineEntryEqual(a, b) {
|
|
64
|
+
const timesSet = new Set([
|
|
65
|
+
...collectTimelineEntryTimes(a),
|
|
66
|
+
...collectTimelineEntryTimes(b),
|
|
67
|
+
]);
|
|
68
|
+
let times = Array.from(timesSet).sort((x, y) => x - y);
|
|
69
|
+
if (times.length === 0) {
|
|
70
|
+
times = [0, 0.25, 0.5, 0.75, 1];
|
|
71
|
+
}
|
|
72
|
+
for (const [] of a.elementIds) {
|
|
73
|
+
for (const t of times) {
|
|
74
|
+
// Check visibility
|
|
75
|
+
const v1 = a.getVisibility(t);
|
|
76
|
+
const v2 = b.getVisibility(t);
|
|
77
|
+
if (Math.abs(v1 - v2) > 0.01)
|
|
78
|
+
return false;
|
|
79
|
+
// Check Transform
|
|
80
|
+
const tf1 = a.getAnimationTransform(t);
|
|
81
|
+
const tf2 = b.getAnimationTransform(t);
|
|
82
|
+
if (!tf1.isAlmostEqual(tf2))
|
|
83
|
+
return false;
|
|
84
|
+
// Check Color
|
|
85
|
+
const c1 = a.getColor(t);
|
|
86
|
+
const c2 = b.getColor(t);
|
|
87
|
+
if ((c1 === undefined) !== (c2 === undefined))
|
|
88
|
+
return false;
|
|
89
|
+
if (c1 !== undefined && !c1.equals(c2))
|
|
90
|
+
return false;
|
|
91
|
+
// Cutting Plane (CLIPPING)
|
|
92
|
+
const clip1 = a.getCuttingPlane?.(t);
|
|
93
|
+
const clip2 = b.getCuttingPlane?.(t);
|
|
94
|
+
const oneUndefined = (clip1 === undefined) !== (clip2 === undefined);
|
|
95
|
+
if (oneUndefined)
|
|
96
|
+
return false;
|
|
97
|
+
if (clip1 && clip2) {
|
|
98
|
+
if (!clip1.getOriginRef().isAlmostEqual(clip2.getOriginRef(), 1e-6) ||
|
|
99
|
+
!clip1.getNormalRef().isAlmostEqual(clip2.getNormalRef(), 1e-6)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
function getAllElementIdsFromScript(script) {
|
|
108
|
+
const ids = new Set();
|
|
109
|
+
for (const modelTimeline of script.modelTimelines) {
|
|
110
|
+
for (const elementTimeline of modelTimeline.elementTimelines) {
|
|
111
|
+
for (const id of elementTimeline.elementIds)
|
|
112
|
+
ids.add(id);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
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M,KAAK,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;YAErC,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;YAErE,IAAI,YAAY;gBAAE,OAAO,KAAK,CAAC;YAC/B,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;gBACnB,IACE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC;oBAC/D,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,EAC/D,CAAC;oBACD,OAAO,KAAK,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,0BAA0B,CAAC,MAA6B;IAC/D,MAAM,GAAG,GAAG,IAAI,GAAG,EAAc,CAAC;IAClC,KAAK,MAAM,aAAa,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAClD,KAAK,MAAM,eAAe,IAAI,aAAa,CAAC,gBAAgB,EAAE,CAAC;YAC7D,KAAK,MAAM,EAAE,IAAI,eAAe,CAAC,UAAU;gBACzC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { Id64String } from \"@itwin/core-bentley\";\nimport { RenderSchedule } from \"@itwin/core-common\";\n\n/** @internal */\nexport function getScriptDelta(prev: RenderSchedule.Script | undefined | null, next: RenderSchedule.Script): Set<Id64String> {\n if (!prev || !prev.modelTimelines || prev.modelTimelines.length === 0) {\n return getAllElementIdsFromScript(next);\n }\n\n const changed = new Set<Id64String>();\n\n const prevModels = new Map(prev.modelTimelines.map(m => [m.modelId, m]));\n const nextModels = new Map(next.modelTimelines.map(m => [m.modelId, m]));\n\n for (const modelId of new Set([...prevModels.keys(), ...nextModels.keys()])) {\n const prevModel = prevModels.get(modelId);\n const nextModel = nextModels.get(modelId);\n\n if (!prevModel || !nextModel) {\n const timelines = (prevModel ?? nextModel)?.elementTimelines ?? [];\n for (const timeline of timelines)\n for (const id of timeline.elementIds)\n changed.add(id);\n continue;\n }\n\n const prevTimelineMap = new Map(prevModel.elementTimelines.map(et => [et.batchId, et]));\n const nextTimelineMap = new Map(nextModel.elementTimelines.map(et => [et.batchId, et]));\n\n const allBatchIds = new Set([...prevTimelineMap.keys(), ...nextTimelineMap.keys()]);\n for (const batchId of allBatchIds) {\n const prevTimeline = prevTimelineMap.get(batchId);\n const nextTimeline = nextTimelineMap.get(batchId);\n\n if (!prevTimeline || !nextTimeline) {\n const ids = (prevTimeline ?? nextTimeline)?.elementIds ?? [];\n for (const id of ids)\n changed.add(id);\n continue;\n }\n\n if (!isTimelineEntryEqual(prevTimeline, nextTimeline)) {\n for (const id of nextTimeline.elementIds)\n changed.add(id);\n }\n }\n }\n return changed;\n}\n\nfunction collectTimelineEntryTimes(timeline: RenderSchedule.ElementTimeline): number[] {\n const result = new Set<number>();\n\n if (timeline.cuttingPlane) {\n for (const entry of timeline.cuttingPlane) {\n result.add(entry.time);\n }\n }\n if (timeline.visibility) {\n for (const entry of timeline.visibility) {\n result.add(entry.time);\n }\n }\n if (timeline.transform) {\n for (const entry of timeline.transform) {\n result.add(entry.time);\n }\n }\n if (timeline.color) {\n for (const entry of timeline.color) {\n result.add(entry.time);\n }\n }\n return Array.from(result);\n}\n\nfunction isTimelineEntryEqual(a: RenderSchedule.ElementTimeline, b: RenderSchedule.ElementTimeline): boolean {\n const timesSet = new Set<number>([\n ...collectTimelineEntryTimes(a),\n ...collectTimelineEntryTimes(b),\n ]);\n let times = Array.from(timesSet).sort((x, y) => x - y);\n if (times.length === 0) {\n times = [0, 0.25, 0.5, 0.75, 1];\n }\n\n for (const [] of a.elementIds) {\n for (const t of times) {\n // Check visibility\n const v1 = a.getVisibility(t);\n const v2 = b.getVisibility(t);\n if (Math.abs(v1 - v2) > 0.01) return false;\n\n // Check Transform\n const tf1 = a.getAnimationTransform(t);\n const tf2 = b.getAnimationTransform(t);\n if (!tf1.isAlmostEqual(tf2)) return false;\n\n // Check Color\n const c1 = a.getColor(t);\n const c2 = b.getColor(t);\n if ((c1 === undefined) !== (c2 === undefined))\n return false;\n\n if (c1 !== undefined && !c1.equals(c2!))\n return false;\n\n // Cutting Plane (CLIPPING)\n const clip1 = a.getCuttingPlane?.(t);\n const clip2 = b.getCuttingPlane?.(t);\n\n const oneUndefined = (clip1 === undefined) !== (clip2 === undefined);\n\n if (oneUndefined) return false;\n if (clip1 && clip2) {\n if (\n !clip1.getOriginRef().isAlmostEqual(clip2.getOriginRef(), 1e-6) ||\n !clip1.getNormalRef().isAlmostEqual(clip2.getNormalRef(), 1e-6)\n ) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\nfunction getAllElementIdsFromScript(script: RenderSchedule.Script): Set<Id64String> {\n const ids = new Set<Id64String>();\n for (const modelTimeline of script.modelTimelines) {\n for (const elementTimeline of modelTimeline.elementTimelines) {\n for (const id of elementTimeline.elementIds)\n ids.add(id);\n }\n }\n return ids;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTile.js","sourceRoot":"","sources":["../../../../src/internal/tile/IModelTile.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAe,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,QAAQ,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,yBAAyB,EAAuB,UAAU,EAAE,UAAU,GAChI,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG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Y,CAAC,GAAG,KAAK,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;oBACvE,IAAI,KAAK,CAAC,UAAU,KAAK,cAAc,CAAC,QAAQ,EAAE,CAAC;wBACjD,uHAAuH;wBACvH,YAAY,GAAG,eAAe,GAAG,KAAK,CAAC;oBACzC,CAAC;yBAAM,CAAC;wBACN,+JAA+J;wBAC/J,YAAY,GAAG,uBAAuB,CAAC;oBACzC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,YAAY;gBACd,OAAO,YAAY,CAAC,EAAE,CAAC;YAEzB,qIAAqI;YACrI,IAAI,IAAI,CAAC,2BAA2B;gBAClC,QAAQ,CAAC,MAAM,GAAG,WAAW,CAAC;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpB,IAAI,CAAC,eAAe,EAAE,CAAC;oBACrB,sGAAsG;oBACtG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;YAED,OAAO,YAAY,CAAC,EAAE,CAAC;QACzB,CAAC;QAED,8EAA8E;QAC9E,IAAI,CAAC,eAAe;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE3B,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;IACvE,CAAC;IAEe,WAAW;QACzB,KAAK,CAAC,WAAW,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,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 Tiles\n */\n\nimport { assert, BentleyError, BeTimePoint, ByteStream } from \"@itwin/core-bentley\";\nimport { Range3d, Transform } from \"@itwin/core-geometry\";\nimport {\n ColorDef, computeChildTileProps, computeChildTileRanges, computeTileChordTolerance, ElementAlignedBox3d, LinePixels, TileFormat, TileProps,\n} from \"@itwin/core-common\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { GraphicBuilder } from \"../../render/GraphicBuilder\";\nimport { RenderSystem } from \"../../render/RenderSystem\";\nimport {\n addRangeGraphic, IModelTileTree, Tile, TileBoundingBoxes, TileContent, TileDrawArgs, TileLoadStatus, TileParams, TileRequest,\n TileRequestChannel, TileTreeLoadStatus, TileVisibility,\n} from \"./../../tile/internal\";\n\n/** Parameters used to construct an [[IModelTile]].\n */\nexport interface IModelTileParams extends TileParams {\n sizeMultiplier?: number;\n}\n\nexport function iModelTileParamsFromJSON(props: TileProps, parent: IModelTile | undefined): IModelTileParams {\n const { contentId, maximumSize, isLeaf, sizeMultiplier } = props;\n const range = Range3d.fromJSON(props.range);\n\n let contentRange;\n if (undefined !== props.contentRange)\n contentRange = Range3d.fromJSON<ElementAlignedBox3d>(props.contentRange);\n\n return { contentId, range, maximumSize, isLeaf, parent, contentRange, sizeMultiplier };\n}\n\n/**\n * Indicates whether a parent tile should be drawn in place of a child tile.\n */\nexport enum SelectParent {\n No,\n Yes,\n}\n\nexport interface IModelTileContent extends TileContent {\n /** If this tile was produced by refinement, the multiplier applied to its screen size. */\n sizeMultiplier?: number;\n /** A bitfield describing empty sub-volumes of this tile's volume. */\n emptySubRangeMask?: number;\n}\n\n/** A tile belonging to an [[IModelTileTree].\n */\nexport class IModelTile extends Tile {\n private _sizeMultiplier?: number;\n private _emptySubRangeMask?: number;\n /** If an initial attempt to obtain this tile's content (e.g., from cloud storage cache) failed,\n * the next channel to try.\n */\n public requestChannel?: TileRequestChannel;\n\n public constructor(params: IModelTileParams, tree: IModelTileTree) {\n super(params, tree);\n this._sizeMultiplier = params.sizeMultiplier;\n\n if (!this.isLeaf && this.tree.is3d && !this.isReady) { // ###TODO: Want to know specifically if tree is *spatial*.\n // Do not sub-divide such that chord tolerance would be below specified minimum, if minimum defined.\n const minTolerance = IModelApp.tileAdmin.minimumSpatialTolerance;\n if (minTolerance > 0 && computeTileChordTolerance(this, this.tree.is3d, this.iModelTree.tileScreenSize) <= minTolerance)\n this.setLeaf();\n }\n }\n\n public get iModelTree(): IModelTileTree { return this.tree as IModelTileTree; }\n public get iModelChildren(): IModelTile[] | undefined { return this.children as IModelTile[] | undefined; }\n public get emptySubRangeMask(): number { return this._emptySubRangeMask ?? 0; }\n\n public get sizeMultiplier(): number | undefined { return this._sizeMultiplier; }\n public get hasSizeMultiplier() { return undefined !== this.sizeMultiplier; }\n public override get maximumSize(): number {\n return super.maximumSize * (this.sizeMultiplier ?? 1.0);\n }\n\n public get channel(): TileRequestChannel {\n return IModelApp.tileAdmin.channels.getIModelTileChannel(this);\n }\n\n public async requestContent(): Promise<TileRequest.Response> {\n return IModelApp.tileAdmin.generateTileContent(this);\n }\n\n public async readContent(data: TileRequest.ResponseData, system: RenderSystem, isCanceled?: () => boolean): Promise<IModelTileContent> {\n if (undefined === isCanceled)\n isCanceled = () => !this.isLoading;\n\n assert(data instanceof Uint8Array);\n const streamBuffer = ByteStream.fromUint8Array(data);\n\n const position = streamBuffer.curPos;\n const format = streamBuffer.readUint32();\n streamBuffer.curPos = position;\n\n let content: IModelTileContent = { isLeaf: true };\n assert(TileFormat.IModel === format);\n if (format !== TileFormat.IModel)\n return content;\n\n const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;\n\n const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : Transform.createIdentity();\n try {\n content = await this.iModelTree.decoder.decode({\n stream: streamBuffer,\n options: { tileId: this.contentId },\n system,\n isCanceled,\n sizeMultiplier,\n tileData: {\n ecefTransform,\n range: this.range,\n layerClassifiers: this.tree.layerHandler?.layerClassifiers,\n },\n });\n } catch {\n //\n }\n\n return content;\n }\n\n public override setContent(content: IModelTileContent): void {\n super.setContent(content);\n\n this._emptySubRangeMask = content.emptySubRangeMask;\n\n // NB: If this tile has no graphics, it may or may not have children - but we don't want to load the children until\n // this tile is too coarse for view based on its size in pixels.\n // That is different than an \"undisplayable\" tile (maximumSize=0) whose children should be loaded immediately.\n if (undefined !== content.graphic && 0 === this.maximumSize)\n this._maximumSize = this.iModelTree.tileScreenSize;\n\n const sizeMult = content.sizeMultiplier;\n if (undefined !== sizeMult && (undefined === this._sizeMultiplier || sizeMult > this._sizeMultiplier)) {\n this._sizeMultiplier = sizeMult;\n this._contentId = this.iModelTree.contentIdProvider.idFromParentAndMultiplier(this.contentId, sizeMult);\n if (undefined !== this.children && this.children.length > 1)\n this.disposeChildren();\n }\n }\n\n protected _loadChildren(resolve: (children: Tile[]) => void, reject: (error: Error) => void): void {\n try {\n const tree = this.iModelTree;\n const kids = computeChildTileProps(this, tree.contentIdProvider, tree);\n IModelApp.tileAdmin.onTilesElided(kids.numEmpty);\n\n const children: IModelTile[] = [];\n for (const props of kids.children) {\n const child = new IModelTile(iModelTileParamsFromJSON(props, this), tree);\n children.push(child);\n }\n\n resolve(children);\n } catch (err) {\n reject(err instanceof Error ? err : new Error(BentleyError.getErrorMessage(err)));\n }\n }\n\n protected override get rangeGraphicColor(): ColorDef {\n return this.hasSizeMultiplier ? ColorDef.red : super.rangeGraphicColor;\n }\n\n protected override addRangeGraphic(builder: GraphicBuilder, type: TileBoundingBoxes): void {\n if (TileBoundingBoxes.ChildVolumes !== type) {\n super.addRangeGraphic(builder, type);\n return;\n }\n\n const ranges = computeChildTileRanges(this, this.iModelTree);\n for (const range of ranges) {\n const color = range.isEmpty ? ColorDef.blue : ColorDef.green;\n const pixels = !range.isEmpty ? LinePixels.HiddenLine : LinePixels.Solid;\n const width = !range.isEmpty ? 2 : 1;\n builder.setSymbology(color, color, width, pixels);\n addRangeGraphic(builder, range.range, this.tree.is2d);\n }\n }\n\n public pruneChildren(olderThan: BeTimePoint): void {\n // A tile's usage marker indicates its the most recent time its *children* were used.\n if (this.usageMarker.isExpired(olderThan)) {\n this.disposeChildren();\n return;\n }\n\n // this node has been used recently. Keep it, but potentially unload its grandchildren.\n const children = this.iModelChildren;\n if (undefined !== children)\n for (const child of children)\n child.pruneChildren(olderThan);\n }\n\n public selectTiles(selected: Tile[], args: TileDrawArgs, numSkipped: number): SelectParent {\n let vis = this.computeVisibility(args);\n if (TileVisibility.OutsideFrustum === vis)\n return SelectParent.No;\n\n const maxDepth = this.iModelTree.debugMaxDepth;\n if (undefined !== maxDepth && this.depth >= maxDepth)\n vis = TileVisibility.Visible;\n\n if (TileVisibility.Visible === vis) {\n // This tile is of appropriate resolution to draw. If need loading or refinement, enqueue.\n if (!this.isReady)\n args.insertMissing(this);\n\n if (this.hasGraphics) {\n // It can be drawn - select it\n args.markReady(this);\n selected.push(this);\n } else if (!this.isReady) {\n // It can't be drawn. Try to draw children in its place; otherwise draw the parent.\n // Do not load/request the children for this purpose.\n const initialSize = selected.length;\n const kids = this.iModelChildren;\n if (undefined === kids)\n return SelectParent.Yes;\n\n // Find any descendant to draw, until we exceed max initial tiles to skip.\n if (this.depth < this.iModelTree.maxInitialTilesToSkip) {\n for (const kid of kids) {\n if (SelectParent.Yes === kid.selectTiles(selected, args, numSkipped)) {\n selected.length = initialSize;\n return SelectParent.Yes;\n }\n\n return SelectParent.No;\n }\n }\n\n // If all visible direct children can be drawn, draw them.\n for (const kid of kids) {\n if (TileVisibility.OutsideFrustum !== kid.computeVisibility(args)) {\n if (!kid.hasGraphics) {\n selected.length = initialSize;\n return SelectParent.Yes;\n } else {\n selected.push(kid);\n }\n }\n }\n\n args.markUsed(this);\n }\n\n // We're drawing either this tile, or its direct children.\n return SelectParent.No;\n }\n\n // This tile is too coarse to draw. Try to draw something more appropriate.\n // If it is not ready to draw, we may want to skip loading in favor of loading its descendants.\n // If we previously loaded and later unloaded content for this tile to free memory, don't force it to reload its content - proceed to children.\n let canSkipThisTile = (this._hadGraphics && !this.hasGraphics) || this.depth < this.iModelTree.maxInitialTilesToSkip;\n if (canSkipThisTile) {\n numSkipped = 1;\n } else {\n canSkipThisTile = this.isReady || this.isParentDisplayable || this.depth < this.iModelTree.maxInitialTilesToSkip;\n if (canSkipThisTile && this.isDisplayable) { // skipping an undisplayable tile doesn't count toward the maximum\n // Some tiles do not sub-divide - they only facet the same geometry to a higher resolution. We can skip directly to the correct resolution.\n const isNotReady = !this.isReady && !this.hasGraphics && !this.hasSizeMultiplier;\n if (isNotReady) {\n if (numSkipped >= this.iModelTree.maxTilesToSkip)\n canSkipThisTile = false;\n else\n numSkipped += 1;\n }\n }\n }\n\n const childrenLoadStatus = this.loadChildren(); // NB: asynchronous\n const children = canSkipThisTile ? this.iModelChildren : undefined;\n if (canSkipThisTile && TileTreeLoadStatus.Loading === childrenLoadStatus) {\n args.markChildrenLoading();\n args.markUsed(this);\n }\n\n if (undefined !== children) {\n // If we are the root tile and we are not displayable, then we want to draw *any* currently available children in our place, or else we would draw nothing.\n // Otherwise, if we want to draw children in our place, we should wait for *all* of them to load, or else we would show missing chunks where not-yet-loaded children belong.\n const isUndisplayableRootTile = this.isUndisplayableRootTile;\n args.markUsed(this);\n let drawChildren = true;\n const initialSize = selected.length;\n for (const child of children) {\n // NB: We must continue iterating children so that they can be requested if missing.\n if (SelectParent.Yes === child.selectTiles(selected, args, numSkipped)) {\n if (child.loadStatus === TileLoadStatus.NotFound) {\n // At least one child we want to draw failed to load. e.g., we reached max depth of map tile tree. Draw parent instead.\n drawChildren = canSkipThisTile = false;\n } else {\n // At least one child we want to draw is not yet loaded. Wait for it to load before drawing it and its siblings, unless we have nothing to draw in their place.\n drawChildren = isUndisplayableRootTile;\n }\n }\n }\n\n if (drawChildren)\n return SelectParent.No;\n\n // Some types of tiles (like maps) allow the ready children to be drawn on top of the parent while other children are not yet loaded.\n if (args.parentsAndChildrenExclusive)\n selected.length = initialSize;\n }\n\n if (this.isReady) {\n if (this.hasGraphics) {\n selected.push(this);\n if (!canSkipThisTile) {\n // This tile is too coarse, but we require loading it before we can start loading higher-res children.\n args.markReady(this);\n }\n }\n\n return SelectParent.No;\n }\n\n // This tile is not ready to be drawn. Request it *only* if we cannot skip it.\n if (!canSkipThisTile)\n args.insertMissing(this);\n\n return this.isParentDisplayable ? SelectParent.Yes : SelectParent.No;\n }\n\n public override clearLayers(): void {\n super.clearLayers();\n this.disposeChildren();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IModelTile.js","sourceRoot":"","sources":["../../../../src/internal/tile/IModelTile.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAe,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,QAAQ,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,yBAAyB,EAAuB,UAAU,EAAE,UAAU,GAChI,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EACL,eAAe,EAAkB,IAAI,EAAE,iBAAiB,EAA6B,cAAc,EAC/E,kBAAkB,EAAE,cAAc,GACvD,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,UAAU,wBAAwB,CAAC,KAAgB,EAAE,MAA8B;IACvF,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAE5C,IAAI,YAAY,CAAC;IACjB,IAAI,SAAS,KAAK,KAAK,CAAC,YAAY;QAClC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAsB,KAAK,CAAC,YAAY,CAAC,CAAC;IAE3E,OAAO,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;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpB,IAAI,CAAC,eAAe,EAAE,CAAC;oBACrB,sGAAsG;oBACtG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBACvB,CAAC;YACH,CAAC;YAED,OAAO,YAAY,CAAC,EAAE,CAAC;QACzB,CAAC;QAED,8EAA8E;QAC9E,IAAI,CAAC,eAAe;YAClB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAE3B,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;IACvE,CAAC;IAEe,WAAW;QACzB,KAAK,CAAC,WAAW,EAAE,CAAC;QACpB,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,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 Tiles\n */\n\nimport { assert, BentleyError, BeTimePoint, ByteStream } from \"@itwin/core-bentley\";\nimport { Range3d, Transform } from \"@itwin/core-geometry\";\nimport {\n ColorDef, computeChildTileProps, computeChildTileRanges, computeTileChordTolerance, ElementAlignedBox3d, LinePixels, TileFormat, TileProps,\n} from \"@itwin/core-common\";\nimport { IModelApp } from \"../../IModelApp\";\nimport { GraphicBuilder } from \"../../render/GraphicBuilder\";\nimport { RenderSystem } from \"../../render/RenderSystem\";\nimport {\n addRangeGraphic, IModelTileTree, Tile, TileBoundingBoxes, TileContent, TileDrawArgs, TileLoadStatus, TileParams, TileRequest,\n TileRequestChannel, TileTreeLoadStatus, TileVisibility,\n} from \"./../../tile/internal\";\n\n/** Parameters used to construct an [[IModelTile]].\n */\nexport interface IModelTileParams extends TileParams {\n sizeMultiplier?: number;\n}\n\nexport function iModelTileParamsFromJSON(props: TileProps, parent: IModelTile | undefined): IModelTileParams {\n const { contentId, maximumSize, isLeaf, sizeMultiplier } = props;\n const range = Range3d.fromJSON(props.range);\n\n let contentRange;\n if (undefined !== props.contentRange)\n contentRange = Range3d.fromJSON<ElementAlignedBox3d>(props.contentRange);\n\n return { contentId, range, maximumSize, isLeaf, parent, contentRange, sizeMultiplier };\n}\n\n/**\n * Indicates whether a parent tile should be drawn in place of a child tile.\n */\nexport enum SelectParent {\n No,\n Yes,\n}\n\nexport interface IModelTileContent extends TileContent {\n /** If this tile was produced by refinement, the multiplier applied to its screen size. */\n sizeMultiplier?: number;\n /** A bitfield describing empty sub-volumes of this tile's volume. */\n emptySubRangeMask?: number;\n}\n\n/** A tile belonging to an [[IModelTileTree].\n */\nexport class IModelTile extends Tile {\n private _sizeMultiplier?: number;\n private _emptySubRangeMask?: number;\n /** If an initial attempt to obtain this tile's content (e.g., from cloud storage cache) failed,\n * the next channel to try.\n */\n public requestChannel?: TileRequestChannel;\n\n public constructor(params: IModelTileParams, tree: IModelTileTree) {\n super(params, tree);\n this._sizeMultiplier = params.sizeMultiplier;\n\n if (!this.isLeaf && this.tree.is3d && !this.isReady) { // ###TODO: Want to know specifically if tree is *spatial*.\n // Do not sub-divide such that chord tolerance would be below specified minimum, if minimum defined.\n const minTolerance = IModelApp.tileAdmin.minimumSpatialTolerance;\n if (minTolerance > 0 && computeTileChordTolerance(this, this.tree.is3d, this.iModelTree.tileScreenSize) <= minTolerance)\n this.setLeaf();\n }\n }\n\n public get iModelTree(): IModelTileTree { return this.tree as IModelTileTree; }\n public get iModelChildren(): IModelTile[] | undefined { return this.children as IModelTile[] | undefined; }\n public get emptySubRangeMask(): number { return this._emptySubRangeMask ?? 0; }\n\n public get sizeMultiplier(): number | undefined { return this._sizeMultiplier; }\n public get hasSizeMultiplier() { return undefined !== this.sizeMultiplier; }\n public override get maximumSize(): number {\n return super.maximumSize * (this.sizeMultiplier ?? 1.0);\n }\n\n public get channel(): TileRequestChannel {\n return IModelApp.tileAdmin.channels.getIModelTileChannel(this);\n }\n\n public async requestContent(): Promise<TileRequest.Response> {\n return IModelApp.tileAdmin.generateTileContent(this);\n }\n\n public async readContent(data: TileRequest.ResponseData, system: RenderSystem, isCanceled?: () => boolean): Promise<IModelTileContent> {\n if (undefined === isCanceled)\n isCanceled = () => !this.isLoading;\n\n assert(data instanceof Uint8Array);\n const streamBuffer = ByteStream.fromUint8Array(data);\n\n const position = streamBuffer.curPos;\n const format = streamBuffer.readUint32();\n streamBuffer.curPos = position;\n\n let content: IModelTileContent = { isLeaf: true };\n assert(TileFormat.IModel === format);\n if (format !== TileFormat.IModel)\n return content;\n\n const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;\n\n const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : Transform.createIdentity();\n try {\n content = await this.iModelTree.decoder.decode({\n stream: streamBuffer,\n options: { tileId: this.contentId },\n system,\n isCanceled,\n sizeMultiplier,\n tileData: {\n ecefTransform,\n range: this.range,\n layerClassifiers: this.tree.layerHandler?.layerClassifiers,\n },\n });\n } catch {\n //\n }\n\n return content;\n }\n\n public override setContent(content: IModelTileContent): void {\n super.setContent(content);\n\n this._emptySubRangeMask = content.emptySubRangeMask;\n\n // NB: If this tile has no graphics, it may or may not have children - but we don't want to load the children until\n // this tile is too coarse for view based on its size in pixels.\n // That is different than an \"undisplayable\" tile (maximumSize=0) whose children should be loaded immediately.\n if (undefined !== content.graphic && 0 === this.maximumSize)\n this._maximumSize = this.iModelTree.tileScreenSize;\n\n const sizeMult = content.sizeMultiplier;\n if (undefined !== sizeMult && (undefined === this._sizeMultiplier || sizeMult > this._sizeMultiplier)) {\n this._sizeMultiplier = sizeMult;\n this._contentId = this.iModelTree.contentIdProvider.idFromParentAndMultiplier(this.contentId, sizeMult);\n if (undefined !== this.children && this.children.length > 1)\n this.disposeChildren();\n }\n }\n\n protected _loadChildren(resolve: (children: Tile[]) => void, reject: (error: Error) => void): void {\n try {\n const tree = this.iModelTree;\n const kids = computeChildTileProps(this, tree.contentIdProvider, tree);\n IModelApp.tileAdmin.onTilesElided(kids.numEmpty);\n\n const children: IModelTile[] = [];\n for (const props of kids.children) {\n const child = new IModelTile(iModelTileParamsFromJSON(props, this), tree);\n children.push(child);\n }\n\n resolve(children);\n } catch (err) {\n reject(err instanceof Error ? err : new Error(BentleyError.getErrorMessage(err)));\n }\n }\n\n protected override get rangeGraphicColor(): ColorDef {\n return this.hasSizeMultiplier ? ColorDef.red : super.rangeGraphicColor;\n }\n\n protected override addRangeGraphic(builder: GraphicBuilder, type: TileBoundingBoxes): void {\n if (TileBoundingBoxes.ChildVolumes !== type) {\n super.addRangeGraphic(builder, type);\n return;\n }\n\n const ranges = computeChildTileRanges(this, this.iModelTree);\n for (const range of ranges) {\n const color = range.isEmpty ? ColorDef.blue : ColorDef.green;\n const pixels = !range.isEmpty ? LinePixels.HiddenLine : LinePixels.Solid;\n const width = !range.isEmpty ? 2 : 1;\n builder.setSymbology(color, color, width, pixels);\n addRangeGraphic(builder, range.range, this.tree.is2d);\n }\n }\n\n public pruneChildren(olderThan: BeTimePoint): void {\n // A tile's usage marker indicates its the most recent time its *children* were used.\n if (this.usageMarker.isExpired(olderThan)) {\n this.disposeChildren();\n return;\n }\n\n // this node has been used recently. Keep it, but potentially unload its grandchildren.\n const children = this.iModelChildren;\n if (undefined !== children)\n for (const child of children)\n child.pruneChildren(olderThan);\n }\n\n public selectTiles(selected: Tile[], args: TileDrawArgs, numSkipped: number): SelectParent {\n let vis = this.computeVisibility(args);\n if (TileVisibility.OutsideFrustum === vis)\n return SelectParent.No;\n\n const maxDepth = this.iModelTree.debugMaxDepth;\n if (undefined !== maxDepth && this.depth >= maxDepth)\n vis = TileVisibility.Visible;\n\n if (TileVisibility.Visible === vis) {\n // This tile is of appropriate resolution to draw. If need loading or refinement, enqueue.\n if (!this.isReady)\n args.insertMissing(this);\n\n if (this.hasGraphics) {\n // It can be drawn - select it\n args.markReady(this);\n selected.push(this);\n } else if (!this.isReady) {\n // It can't be drawn. Try to draw children in its place; otherwise draw the parent.\n // Do not load/request the children for this purpose.\n const initialSize = selected.length;\n const kids = this.iModelChildren;\n if (undefined === kids)\n return SelectParent.Yes;\n\n // Find any descendant to draw, until we exceed max initial tiles to skip.\n if (this.depth < this.iModelTree.maxInitialTilesToSkip) {\n for (const kid of kids) {\n if (SelectParent.Yes === kid.selectTiles(selected, args, numSkipped)) {\n selected.length = initialSize;\n return SelectParent.Yes;\n }\n\n return SelectParent.No;\n }\n }\n\n // If all visible direct children can be drawn, draw them.\n for (const kid of kids) {\n if (TileVisibility.OutsideFrustum !== kid.computeVisibility(args)) {\n if (!kid.hasGraphics) {\n selected.length = initialSize;\n return SelectParent.Yes;\n } else {\n selected.push(kid);\n }\n }\n }\n\n args.markUsed(this);\n }\n\n // We're drawing either this tile, or its direct children.\n return SelectParent.No;\n }\n\n // This tile is too coarse to draw. Try to draw something more appropriate.\n // If it is not ready to draw, we may want to skip loading in favor of loading its descendants.\n // If we previously loaded and later unloaded content for this tile to free memory, don't force it to reload its content - proceed to children.\n let canSkipThisTile = (this._hadGraphics && !this.hasGraphics) || this.depth < this.iModelTree.maxInitialTilesToSkip;\n if (canSkipThisTile) {\n numSkipped = 1;\n } else {\n canSkipThisTile = this.isReady || this.isParentDisplayable || this.depth < this.iModelTree.maxInitialTilesToSkip;\n if (canSkipThisTile && this.isDisplayable) { // skipping an undisplayable tile doesn't count toward the maximum\n // Some tiles do not sub-divide - they only facet the same geometry to a higher resolution. We can skip directly to the correct resolution.\n const isNotReady = !this.isReady && !this.hasGraphics && !this.hasSizeMultiplier;\n if (isNotReady) {\n if (numSkipped >= this.iModelTree.maxTilesToSkip)\n canSkipThisTile = false;\n else\n numSkipped += 1;\n }\n }\n }\n\n const childrenLoadStatus = this.loadChildren(); // NB: asynchronous\n const children = canSkipThisTile ? this.iModelChildren : undefined;\n if (canSkipThisTile && TileTreeLoadStatus.Loading === childrenLoadStatus) {\n args.markChildrenLoading();\n args.markUsed(this);\n }\n\n if (undefined !== children) {\n // If we are the root tile and we are not displayable, then we want to draw *any* currently available children in our place, or else we would draw nothing.\n // Otherwise, if we want to draw children in our place, we should wait for *all* of them to load, or else we would show missing chunks where not-yet-loaded children belong.\n const isUndisplayableRootTile = this.isUndisplayableRootTile;\n args.markUsed(this);\n let drawChildren = true;\n const initialSize = selected.length;\n for (const child of children) {\n // NB: We must continue iterating children so that they can be requested if missing.\n if (SelectParent.Yes === child.selectTiles(selected, args, numSkipped)) {\n if (child.loadStatus === TileLoadStatus.NotFound) {\n // At least one child we want to draw failed to load. e.g., we reached max depth of map tile tree. Draw parent instead.\n drawChildren = canSkipThisTile = false;\n } else {\n // At least one child we want to draw is not yet loaded. Wait for it to load before drawing it and its siblings, unless we have nothing to draw in their place.\n drawChildren = isUndisplayableRootTile;\n }\n }\n }\n\n if (drawChildren)\n return SelectParent.No;\n\n // Some types of tiles (like maps) allow the ready children to be drawn on top of the parent while other children are not yet loaded.\n if (args.parentsAndChildrenExclusive)\n selected.length = initialSize;\n }\n\n if (this.isReady) {\n if (this.hasGraphics) {\n selected.push(this);\n if (!canSkipThisTile) {\n // This tile is too coarse, but we require loading it before we can start loading higher-res children.\n args.markReady(this);\n }\n }\n\n return SelectParent.No;\n }\n\n // This tile is not ready to be drawn. Request it *only* if we cannot skip it.\n if (!canSkipThisTile)\n args.insertMissing(this);\n\n return this.isParentDisplayable ? SelectParent.Yes : SelectParent.No;\n }\n\n public override clearLayers(): void {\n super.clearLayers();\n this.disposeChildren();\n }\n}"]}
|
|
@@ -11,7 +11,7 @@ export interface IModelTileTreeOptions {
|
|
|
11
11
|
readonly edges: EdgeOptions | false;
|
|
12
12
|
readonly batchType: BatchType;
|
|
13
13
|
readonly is3d: boolean;
|
|
14
|
-
|
|
14
|
+
timeline: RenderSchedule.ModelTimeline | undefined;
|
|
15
15
|
}
|
|
16
16
|
/** Parameters used to construct an [[IModelTileTree]]
|
|
17
17
|
*/
|
|
@@ -36,7 +36,7 @@ export type RootIModelTile = Tile & {
|
|
|
36
36
|
* @internal exported strictly for display-test-app until we remove CommonJS support.
|
|
37
37
|
*/
|
|
38
38
|
export declare class IModelTileTree extends TileTree {
|
|
39
|
-
|
|
39
|
+
decoder: ImdlDecoder;
|
|
40
40
|
private readonly _rootTile;
|
|
41
41
|
private readonly _options;
|
|
42
42
|
private readonly _transformNodeRanges?;
|
|
@@ -80,5 +80,7 @@ export declare class IModelTileTree extends TileTree {
|
|
|
80
80
|
get hiddenElements(): Id64Array;
|
|
81
81
|
getTransformNodeRange(nodeId: number): Range3d | undefined;
|
|
82
82
|
get containsTransformNodes(): boolean;
|
|
83
|
+
onScheduleEditingChanged(changes: RenderSchedule.EditingChanges[]): Promise<void>;
|
|
84
|
+
onScheduleEditingCommitted(): void;
|
|
83
85
|
}
|
|
84
86
|
//# sourceMappingURL=IModelTileTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTileTree.d.ts","sourceRoot":"","sources":["../../../../src/internal/tile/IModelTileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"IModelTileTree.d.ts","sourceRoot":"","sources":["../../../../src/internal/tile/IModelTileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAiC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,EAAE,OAAO,EAAa,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,SAAS,EAAE,iBAAiB,EAAE,WAAW,EACzC,gBAAgB,EAAE,mBAAmB,EAAwB,cAAc,EAAE,SAAS,EACvF,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EACkC,WAAW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GAAG,IAAI;IAO9B,KAAK,IAAI,IAAI;IAKpB,kCAAkC;IAClC,IAAW,SAAS,IAAI,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAExE;IAED,kCAAkC;IAClC,IAAW,cAAc,IAAI,SAAS,CAGrC;IAEM,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAIjE,IAAW,sBAAsB,IAAI,OAAO,CAE3C;IAEqB,wBAAwB,CAAC,OAAO,EAAE,cAAc,CAAC,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDvF,0BAA0B;CAI3C"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Tiles
|
|
7
7
|
*/
|
|
8
|
-
import { assert, BeTimePoint } from "@itwin/core-bentley";
|
|
8
|
+
import { assert, BeTimePoint, DbOpcode } from "@itwin/core-bentley";
|
|
9
9
|
import { Range3d, Transform } from "@itwin/core-geometry";
|
|
10
|
-
import { BatchType, ContentIdProvider, FeatureAppearanceProvider } from "@itwin/core-common";
|
|
10
|
+
import { BatchType, ContentIdProvider, FeatureAppearanceProvider, RenderSchedule } from "@itwin/core-common";
|
|
11
11
|
import { IModelApp } from "../../IModelApp";
|
|
12
12
|
import { GraphicalEditingScope } from "../../GraphicalEditingScope";
|
|
13
13
|
import { GraphicBranch } from "../../render/GraphicBranch";
|
|
@@ -107,6 +107,19 @@ class DynamicState {
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
class ScheduleScriptDynamicState {
|
|
111
|
+
type = "dynamic";
|
|
112
|
+
rootTile;
|
|
113
|
+
_dispose;
|
|
114
|
+
[Symbol.dispose]() {
|
|
115
|
+
this._dispose();
|
|
116
|
+
this.rootTile[Symbol.dispose]();
|
|
117
|
+
}
|
|
118
|
+
constructor(root, elemChanges) {
|
|
119
|
+
this.rootTile = DynamicIModelTile.create(root, elemChanges);
|
|
120
|
+
this._dispose = () => { };
|
|
121
|
+
}
|
|
122
|
+
}
|
|
110
123
|
/** The tile tree has been disposed. */
|
|
111
124
|
class DisposedState {
|
|
112
125
|
type = "disposed";
|
|
@@ -345,5 +358,50 @@ export class IModelTileTree extends TileTree {
|
|
|
345
358
|
get containsTransformNodes() {
|
|
346
359
|
return undefined !== this._transformNodeRanges;
|
|
347
360
|
}
|
|
361
|
+
async onScheduleEditingChanged(changes) {
|
|
362
|
+
const displayStyle = IModelApp.viewManager.selectedView?.displayStyle;
|
|
363
|
+
const newScript = displayStyle?.scheduleScript;
|
|
364
|
+
const scriptRef = newScript ? new RenderSchedule.ScriptReference(displayStyle.id, newScript) : undefined;
|
|
365
|
+
const scriptInfo = IModelApp.tileAdmin.getScriptInfoForTreeId(this.modelId, scriptRef);
|
|
366
|
+
if (scriptInfo?.timeline && this.timeline !== scriptInfo.timeline) {
|
|
367
|
+
this.decoder = acquireImdlDecoder({
|
|
368
|
+
type: this.batchType,
|
|
369
|
+
omitEdges: this.edgeOptions === false,
|
|
370
|
+
timeline: scriptInfo.timeline,
|
|
371
|
+
iModel: this.iModel,
|
|
372
|
+
batchModelId: this.modelId,
|
|
373
|
+
is3d: this.is3d,
|
|
374
|
+
containsTransformNodes: this.containsTransformNodes,
|
|
375
|
+
noWorker: !IModelApp.tileAdmin.decodeImdlInWorker,
|
|
376
|
+
});
|
|
377
|
+
this._options.timeline = scriptInfo.timeline;
|
|
378
|
+
}
|
|
379
|
+
const relevantChange = changes.find((c) => c.timeline.modelId === this.modelId);
|
|
380
|
+
if (!relevantChange || relevantChange.elements.size === 0)
|
|
381
|
+
return;
|
|
382
|
+
const elementIds = Array.from(relevantChange.elements);
|
|
383
|
+
const placements = await this.iModel.elements.getPlacements(elementIds, {
|
|
384
|
+
type: this.is3d ? "3d" : "2d",
|
|
385
|
+
});
|
|
386
|
+
if (placements.length === 0)
|
|
387
|
+
return;
|
|
388
|
+
const changedElements = placements.map((x) => {
|
|
389
|
+
return {
|
|
390
|
+
id: x.elementId,
|
|
391
|
+
type: DbOpcode.Update,
|
|
392
|
+
range: x.calculateRange(),
|
|
393
|
+
};
|
|
394
|
+
});
|
|
395
|
+
if (changedElements.length === 0)
|
|
396
|
+
return;
|
|
397
|
+
if (this._rootTile.tileState.type === "dynamic") {
|
|
398
|
+
this._rootTile.transition(new StaticState(this._rootTile));
|
|
399
|
+
}
|
|
400
|
+
this._rootTile.transition(new ScheduleScriptDynamicState(this._rootTile, changedElements));
|
|
401
|
+
}
|
|
402
|
+
onScheduleEditingCommitted() {
|
|
403
|
+
if (this._rootTile.tileState.type !== "static")
|
|
404
|
+
this._rootTile.transition(new StaticState(this._rootTile));
|
|
405
|
+
}
|
|
348
406
|
}
|
|
349
407
|
//# sourceMappingURL=IModelTileTree.js.map
|