@itwin/core-frontend 5.1.0-dev.54 → 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/CHANGELOG.md +6 -1
- 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/common/gltf/GltfSchema.d.ts +9 -0
- package/lib/cjs/common/gltf/GltfSchema.d.ts.map +1 -1
- package/lib/cjs/common/gltf/GltfSchema.js +1 -0
- package/lib/cjs/common/gltf/GltfSchema.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/GltfReader.d.ts +4 -2
- package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
- package/lib/cjs/tile/GltfReader.js +85 -18
- package/lib/cjs/tile/GltfReader.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/common/gltf/GltfSchema.d.ts +9 -0
- package/lib/esm/common/gltf/GltfSchema.d.ts.map +1 -1
- package/lib/esm/common/gltf/GltfSchema.js +1 -0
- package/lib/esm/common/gltf/GltfSchema.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/GltfReader.d.ts +4 -2
- package/lib/esm/tile/GltfReader.d.ts.map +1 -1
- package/lib/esm/tile/GltfReader.js +84 -18
- package/lib/esm/tile/GltfReader.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImdlReader.js","sourceRoot":"","sources":["../../../src/tile/ImdlReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAuB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,SAAS,EAAE,4BAA4B,EAAE,aAAa,EAAE,cAAc,GACvE,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,EAAE,mBAAmB,EAAmD,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC3I,OAAO,EAAE,kBAAkB,EAAqB,MAAM,YAAY,CAAC;AASnE;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAAiB,EAAE,MAAwB,EAAE,OAAmB,EAAE,IAAa,EAAE,OAA8B;IACvJ,MAAM,MAAM,GAAG,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC/B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO;QACtC,MAAM,EAAE,SAAS,CAAC,YAAY;KAC/B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC;AAyBD,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAA+H;IACnK,MA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C,CAAC;IACnH,CAAC;IAED,OAAO;QACL,UAAU,EAAE,cAAc,CAAC,OAAO;QAClC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY;QAC5E,OAAO;QACP,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;KAC7C,CAAC;AACJ,CAAC;AAOD,gBAAgB;AAChB,MAAM,KAAW,UAAU,CAM1B;AAND,WAAiB,UAAU;IACzB,SAAgB,MAAM,CAAC,IAA0B;QAC/C,OAAO;YACL,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;SACxC,CAAC;IACJ,CAAC;IAJe,iBAAM,SAIrB,CAAA;AACH,CAAC,EANgB,UAAU,KAAV,UAAU,QAM1B","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 { ByteStream, Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\nimport {\n BatchType, decodeTileContentDescription, TileReadError, TileReadStatus,\n} from \"@itwin/core-common\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { GraphicBranch } from \"../render/GraphicBranch\";\nimport { RenderGraphic } from \"../render/RenderGraphic\";\nimport { RenderSystem } from \"../render/RenderSystem\";\nimport { ImdlModel } from \"../common/imdl/ImdlModel\";\nimport { convertFeatureTable, ImdlParseError, ImdlParserOptions, ImdlTimeline, parseImdlDocument } from \"../common/imdl/ParseImdlDocument\";\nimport { decodeImdlGraphics, IModelTileContent } from \"./internal\";\nimport { BatchOptions } from \"../common/render/BatchOptions\";\nimport { LayerTileData } from \"../internal/render/webgl/MapLayerParams\";\n\n/** @internal */\nexport interface ImdlReaderResult extends IModelTileContent {\n readStatus: TileReadStatus;\n}\n\n/** Convert the byte array returned by [[TileAdmin.requestElementGraphics]] into a [[RenderGraphic]].\n * @param bytes The binary graphics data obtained from `requestElementGraphics`.\n * @param iModel The iModel with which the graphics are associated.\n * @param modelId The Id of the [[GeometricModelState]] with which the graphics are associated. Can be an invalid Id.\n * @param is3d True if the graphics are 3d.\n * @param options Options customizing how [Feature]($common)s within the graphic can be resymbolized; or false if you don't want to produce a batch.\n * @public\n * @extensions\n */\nexport async function readElementGraphics(bytes: Uint8Array, iModel: IModelConnection, modelId: Id64String, is3d: boolean, options?: BatchOptions | false): Promise<RenderGraphic | undefined> {\n const stream = ByteStream.fromUint8Array(bytes);\n const reader = ImdlReader.create({\n stream, iModel, modelId, is3d, options,\n system: IModelApp.renderSystem,\n });\n\n const result = await reader.read();\n return result.graphic;\n}\n\n/** Arguments supplied to [[ImdlReader.create]]\n * @internal\n */\nexport interface ImdlReaderCreateArgs {\n stream: ByteStream;\n iModel: IModelConnection;\n modelId: Id64String;\n is3d: boolean;\n /** If undefined, the tile's leafness will be deduced by decodeTileContentDescription. */\n isLeaf?: boolean;\n system: RenderSystem;\n type?: BatchType; // default Primary\n loadEdges?: boolean; // default true\n isCanceled?: () => boolean;\n sizeMultiplier?: number;\n options?: BatchOptions | false;\n containsTransformNodes?: boolean; // default false\n /** Supplied if the graphics in the tile are to be split up based on the nodes in the timeline. */\n timeline?: ImdlTimeline;\n modelGroups?: Id64Set[];\n tileData?: LayerTileData;\n}\n\n/** @internal */\nexport async function readImdlContent(args: ImdlReaderCreateArgs & { parseDocument?: (parseOpts: ImdlParserOptions) => Promise<ImdlModel.Document | ImdlParseError> }): Promise<ImdlReaderResult> {\n const isCanceled = args.isCanceled ?? (() => false);\n let content;\n try {\n content = decodeTileContentDescription({\n stream: args.stream,\n sizeMultiplier: args.sizeMultiplier,\n is2d: !args.is3d,\n options: IModelApp.tileAdmin,\n isVolumeClassifier: BatchType.VolumeClassifier === args.type,\n isLeaf: args.isLeaf,\n });\n } catch (e) {\n if (e instanceof TileReadError)\n return { isLeaf: true, readStatus: e.errorNumber };\n else\n throw e;\n }\n\n args.stream.reset();\n const parseOpts: ImdlParserOptions = {\n data: args.stream.readBytes(0, args.stream.length),\n batchModelId: args.modelId,\n is3d: args.is3d,\n maxVertexTableSize: IModelApp.renderSystem.maxTextureSize,\n omitEdges: false === args.loadEdges,\n createUntransformedRootNode: args.containsTransformNodes,\n modelGroups: args.modelGroups,\n };\n\n const document = args.parseDocument ? (await args.parseDocument(parseOpts)) : await parseImdlDocument({ ...parseOpts, timeline: args.timeline });\n if (isCanceled())\n return { isLeaf: true, readStatus: TileReadStatus.Canceled };\n else if (typeof document === \"number\")\n return { isLeaf: true, readStatus: document };\n\n let graphic = await decodeImdlGraphics({\n system: args.system,\n iModel: args.iModel,\n document,\n isCanceled: args.isCanceled,\n tileData: args.tileData,\n });\n\n if (isCanceled())\n return { isLeaf: true, readStatus: TileReadStatus.Canceled };\n\n if (graphic && false !== args.options) {\n const featureTable = convertFeatureTable(document.featureTable, args.modelId);\n graphic = args.system.createBatch(graphic, featureTable, content.contentRange, args.options);\n }\n\n if (graphic && document.rtcCenter) {\n const rtcBranch = new GraphicBranch(true);\n rtcBranch.add(graphic);\n graphic = args.system.createBranch(rtcBranch, Transform.createTranslation(Point3d.fromJSON(document.rtcCenter)));\n }\n\n return {\n readStatus: TileReadStatus.Success,\n isLeaf: content.isLeaf,\n sizeMultiplier: content.sizeMultiplier,\n contentRange: content.contentRange.isNull ? undefined : content.contentRange,\n graphic,\n emptySubRangeMask: content.emptySubRangeMask,\n };\n}\n\n/** @internal */\nexport interface ImdlReader {\n read: () => Promise<ImdlReaderResult>;\n}\n\n/** @internal */\nexport namespace ImdlReader {\n export function create(args: ImdlReaderCreateArgs): ImdlReader {\n return {\n read: async () => readImdlContent(args),\n };\n }\n}
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EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY;QAC5E,OAAO;QACP,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;KAC7C,CAAC;AACJ,CAAC;AAOD,gBAAgB;AAChB,MAAM,KAAW,UAAU,CAM1B;AAND,WAAiB,UAAU;IACzB,SAAgB,MAAM,CAAC,IAA0B;QAC/C,OAAO;YACL,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC;SACxC,CAAC;IACJ,CAAC;IAJe,iBAAM,SAIrB,CAAA;AACH,CAAC,EANgB,UAAU,KAAV,UAAU,QAM1B","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 { ByteStream, Id64Set, Id64String } from \"@itwin/core-bentley\";\nimport { Point3d, Transform } from \"@itwin/core-geometry\";\nimport {\n BatchType, decodeTileContentDescription, TileReadError, TileReadStatus,\n} from \"@itwin/core-common\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { GraphicBranch } from \"../render/GraphicBranch\";\nimport { RenderGraphic } from \"../render/RenderGraphic\";\nimport { RenderSystem } from \"../render/RenderSystem\";\nimport { ImdlModel } from \"../common/imdl/ImdlModel\";\nimport { convertFeatureTable, ImdlParseError, ImdlParserOptions, ImdlTimeline, parseImdlDocument } from \"../common/imdl/ParseImdlDocument\";\nimport { decodeImdlGraphics, IModelTileContent } from \"./internal\";\nimport { BatchOptions } from \"../common/render/BatchOptions\";\nimport { LayerTileData } from \"../internal/render/webgl/MapLayerParams\";\n\n/** @internal */\nexport interface ImdlReaderResult extends IModelTileContent {\n readStatus: TileReadStatus;\n}\n\n/** Convert the byte array returned by [[TileAdmin.requestElementGraphics]] into a [[RenderGraphic]].\n * @param bytes The binary graphics data obtained from `requestElementGraphics`.\n * @param iModel The iModel with which the graphics are associated.\n * @param modelId The Id of the [[GeometricModelState]] with which the graphics are associated. Can be an invalid Id.\n * @param is3d True if the graphics are 3d.\n * @param options Options customizing how [Feature]($common)s within the graphic can be resymbolized; or false if you don't want to produce a batch.\n * @public\n * @extensions\n */\nexport async function readElementGraphics(bytes: Uint8Array, iModel: IModelConnection, modelId: Id64String, is3d: boolean, options?: BatchOptions | false): Promise<RenderGraphic | undefined> {\n const stream = ByteStream.fromUint8Array(bytes);\n const reader = ImdlReader.create({\n stream, iModel, modelId, is3d, options,\n system: IModelApp.renderSystem,\n });\n\n const result = await reader.read();\n return result.graphic;\n}\n\n/** Arguments supplied to [[ImdlReader.create]]\n * @internal\n */\nexport interface ImdlReaderCreateArgs {\n stream: ByteStream;\n iModel: IModelConnection;\n modelId: Id64String;\n is3d: boolean;\n /** If undefined, the tile's leafness will be deduced by decodeTileContentDescription. */\n isLeaf?: boolean;\n system: RenderSystem;\n type?: BatchType; // default Primary\n loadEdges?: boolean; // default true\n isCanceled?: () => boolean;\n sizeMultiplier?: number;\n options?: BatchOptions | false;\n containsTransformNodes?: boolean; // default false\n /** Supplied if the graphics in the tile are to be split up based on the nodes in the timeline. */\n timeline?: ImdlTimeline;\n modelGroups?: Id64Set[];\n tileData?: LayerTileData;\n}\n\n/** @internal */\nexport async function readImdlContent(args: ImdlReaderCreateArgs & { parseDocument?: (parseOpts: ImdlParserOptions) => Promise<ImdlModel.Document | ImdlParseError> }): Promise<ImdlReaderResult> {\n const isCanceled = args.isCanceled ?? (() => false);\n let content;\n try {\n content = decodeTileContentDescription({\n stream: args.stream,\n sizeMultiplier: args.sizeMultiplier,\n is2d: !args.is3d,\n options: IModelApp.tileAdmin,\n isVolumeClassifier: BatchType.VolumeClassifier === args.type,\n isLeaf: args.isLeaf,\n });\n } catch (e) {\n if (e instanceof TileReadError)\n return { isLeaf: true, readStatus: e.errorNumber };\n else\n throw e;\n }\n\n args.stream.reset();\n const parseOpts: ImdlParserOptions = {\n data: args.stream.readBytes(0, args.stream.length),\n batchModelId: args.modelId,\n is3d: args.is3d,\n maxVertexTableSize: IModelApp.renderSystem.maxTextureSize,\n omitEdges: false === args.loadEdges,\n createUntransformedRootNode: args.containsTransformNodes,\n modelGroups: args.modelGroups,\n };\n\n const document = args.parseDocument ? (await args.parseDocument(parseOpts)) : await parseImdlDocument({ ...parseOpts, timeline: args.timeline });\n if (isCanceled())\n return { isLeaf: true, readStatus: TileReadStatus.Canceled };\n else if (typeof document === \"number\")\n return { isLeaf: true, readStatus: document };\n\n let graphic = await decodeImdlGraphics({\n system: args.system,\n iModel: args.iModel,\n document,\n isCanceled: args.isCanceled,\n tileData: args.tileData,\n });\n\n if (isCanceled())\n return { isLeaf: true, readStatus: TileReadStatus.Canceled };\n\n if (graphic && false !== args.options) {\n const featureTable = convertFeatureTable(document.featureTable, args.modelId);\n graphic = args.system.createBatch(graphic, featureTable, content.contentRange, args.options);\n }\n\n if (graphic && document.rtcCenter) {\n const rtcBranch = new GraphicBranch(true);\n rtcBranch.add(graphic);\n graphic = args.system.createBranch(rtcBranch, Transform.createTranslation(Point3d.fromJSON(document.rtcCenter)));\n }\n\n return {\n readStatus: TileReadStatus.Success,\n isLeaf: content.isLeaf,\n sizeMultiplier: content.sizeMultiplier,\n contentRange: content.contentRange.isNull ? undefined : content.contentRange,\n graphic,\n emptySubRangeMask: content.emptySubRangeMask,\n };\n}\n\n/** @internal */\nexport interface ImdlReader {\n read: () => Promise<ImdlReaderResult>;\n}\n\n/** @internal */\nexport namespace ImdlReader {\n export function create(args: ImdlReaderCreateArgs): ImdlReader {\n return {\n read: async () => readImdlContent(args),\n };\n }\n}"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BeDuration, BeTimePoint, Id64String } from "@itwin/core-bentley";
|
|
5
5
|
import { Matrix4d, Range3d, Transform } from "@itwin/core-geometry";
|
|
6
|
-
import { ElementAlignedBox3d, FrustumPlanes, ViewFlagOverrides } from "@itwin/core-common";
|
|
6
|
+
import { ElementAlignedBox3d, FrustumPlanes, RenderSchedule, ViewFlagOverrides } from "@itwin/core-common";
|
|
7
7
|
import { IModelConnection } from "../IModelConnection";
|
|
8
8
|
import { RenderClipVolume } from "../render/RenderClipVolume";
|
|
9
9
|
import { RenderMemory } from "../render/RenderMemory";
|
|
@@ -124,5 +124,18 @@ export declare abstract class TileTree {
|
|
|
124
124
|
* @beta
|
|
125
125
|
*/
|
|
126
126
|
collectTileGeometry(_collector: TileGeometryCollector): void;
|
|
127
|
+
/**
|
|
128
|
+
* Invoked when a schedule script is edited.
|
|
129
|
+
* Override to handle updates for affected elements or timelines.
|
|
130
|
+
*
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
onScheduleEditingChanged(_changes: RenderSchedule.EditingChanges[]): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Invoked when a schedule script is committed during editing.
|
|
136
|
+
* Override in specific tile tree types to handle the change.
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
onScheduleEditingCommitted(): void;
|
|
127
140
|
}
|
|
128
141
|
//# sourceMappingURL=TileTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTree.d.ts","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAW,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"TileTree.d.ts","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH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AC,KAAK,EAAE,YAAY,CAAC,UAAU,GAAG,IAAI;IAI9D,2GAA2G;IACpG,UAAU,IAAI,MAAM;IAI3B,gBAAgB;IACT,0BAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI;IAI7H;;;;OAIG;IACU,gBAAgB,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAkB/D;;;;OAIG;IACI,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI;IAGnE;;;;;OAKG;IACU,wBAAwB,CAAC,QAAQ,EAAE,cAAc,CAAC,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/F;;;;OAIG;IACI,0BAA0B,IAAI,IAAI;CAC1C"}
|
package/lib/esm/tile/TileTree.js
CHANGED
|
@@ -158,5 +158,18 @@ export class TileTree {
|
|
|
158
158
|
*/
|
|
159
159
|
collectTileGeometry(_collector) {
|
|
160
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Invoked when a schedule script is edited.
|
|
163
|
+
* Override to handle updates for affected elements or timelines.
|
|
164
|
+
*
|
|
165
|
+
* @internal
|
|
166
|
+
*/
|
|
167
|
+
async onScheduleEditingChanged(_changes) { }
|
|
168
|
+
/**
|
|
169
|
+
* Invoked when a schedule script is committed during editing.
|
|
170
|
+
* Override in specific tile tree types to handle the change.
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
onScheduleEditingCommitted() { }
|
|
161
174
|
}
|
|
162
175
|
//# sourceMappingURL=TileTree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,WAAW,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAGnF,OAAO,E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QAAQ,GAAG,MAAM,oCAAoC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACjF,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ;YACX,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAErD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,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 { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FrustumPlanes, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { LayerTileTreeHandler, Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\n\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\n * @see [[TileTreeOwner]].\n * @public\n * @extensions\n */\nexport enum TileTreeLoadStatus {\n /** No attempt to load the tile tree has yet been made. */\n NotLoaded,\n /** The tile tree is in the process of being loaded. */\n Loading,\n /** The tile tree has been successfully loaded. */\n Loaded,\n /** An attempt to load the tile tree failed. */\n NotFound,\n}\n\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\n * Tile trees originate from a variety of sources:\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\n * - A [[DisplayStyleState]]'s map settings or reality models;\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\n * - [[TiledGraphicsProvider]]s associated with a viewport.\n *\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\n *\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\n * that it calls.\n * @public\n * @extensions\n */\nexport abstract class TileTree {\n private _isDisposed = false;\n /** @internal */\n protected _lastSelected = BeTimePoint.now();\n /** @internal */\n protected _clipVolume?: RenderClipVolume;\n public readonly iModel: IModelConnection;\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\n public readonly iModelTransform: Transform;\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\n public readonly id: string;\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\n */\n public readonly modelId: Id64String;\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\n public readonly expirationTime: BeDuration;\n /** @internal */\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\n private readonly _loadPriority: TileLoadPriority;\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\n public readonly contentRange?: ElementAlignedBox3d;\n\n /** The lowest-resolution tile in this tree. */\n public abstract get rootTile(): Tile;\n /** True if this tile tree contains 3d graphics. */\n public abstract get is3d(): boolean;\n /** Returns the maximum depth of this tree, if any. */\n public abstract get maxDepth(): number | undefined;\n\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\n\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\n public get isContentUnbounded(): boolean {\n return false;\n }\n\n /** Implement this method to select tiles of appropriate resolution. */\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\n\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\n public abstract draw(args: TileDrawArgs): void;\n\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\n public abstract prune(): void;\n\n /** True if this tile tree contains 2d graphics. */\n public get is2d(): boolean { return !this.is3d; }\n /** @internal */\n public get isPointCloud(): boolean { return false; }\n /** @internal */\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\n\n /** The volume of space occupied by this tile tree. */\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\n /** The most recent time at which tiles [[selectTiles]] was called. */\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\n /** True if a tile and its child tiles should not be drawn simultaneously.\n * Default: true.\n */\n public get parentsAndChildrenExclusive(): boolean { return true; }\n\n /** @internal */\n public get layerHandler(): LayerTileTreeHandler | undefined { return undefined; }\n\n /** Constructor */\n protected constructor(params: TileTreeParams) {\n this._lastSelected = BeTimePoint.now();\n this.iModel = params.iModel;\n this.iModelTransform = params.location;\n this._clipVolume = params.clipVolume;\n this.modelId = params.modelId;\n this.id = params.id;\n this.contentRange = params.contentRange;\n\n const admin = IModelApp.tileAdmin;\n this._loadPriority = params.priority;\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\n }\n\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\n * @note Do **not** override this method. Implement [[_selectTiles]].\n */\n public selectTiles(args: TileDrawArgs): Tile[] {\n this._lastSelected = BeTimePoint.now();\n const tiles = this._selectTiles(args);\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\n args.processSelectedTiles(tiles);\n return tiles;\n }\n\n /** True if [[dispose]] has been called on this tile tree. */\n public get isDisposed(): boolean { return this._isDisposed; }\n\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\n public [Symbol.dispose](): void {\n if (this.isDisposed)\n return;\n\n this._isDisposed = true;\n dispose(this.rootTile);\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n this.rootTile.collectStatistics(stats);\n }\n\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\n public countTiles(): number {\n return 1 + this.rootTile.countDescendants();\n }\n\n /** @internal */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\n }\n\n /**\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\n * @beta\n */\n public async getEcefTransform(): Promise<Transform | undefined> {\n if (!this.iModel.ecefLocation)\n return undefined;\n\n let dbToEcef: Transform | undefined;\n const range = this.contentRange ? this.contentRange : this.range;\n const center = range.localXYZToWorld(.5, .5, .5);\n if (center) {\n this.iModelTransform.multiplyPoint3d(center, center);\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\n dbToEcef = ecefToDb?.inverse();\n }\n if (!dbToEcef)\n dbToEcef = this.iModel.ecefLocation.getTransform();\n\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\n }\n\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\n * The base implementation does nothing.\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\n * @beta\n */\n public collectTileGeometry(_collector: TileGeometryCollector): void {\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"TileTree.js","sourceRoot":"","sources":["../../../src/tile/TileTree.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,WAAW,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAC;AAGnF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC;;;;GAIG;AACH,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC5B,0DAA0D;IAC1D,qEAAS,CAAA;IACT,uDAAuD;IACvD,iEAAO,CAAA;IACP,kDAAkD;IAClD,+DAAM,CAAA;IACN,+CAA+C;IAC/C,mEAAQ,CAAA;AACV,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAgB,QAAQ;IACpB,WAAW,GAAG,KAAK,CAAC;IAC5B,gBAAgB;IACN,aAAa,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAC5C,gBAAgB;IACN,WAAW,CAAoB;IACzB,MAAM,CAAmB;IACzC,yFAAyF;IACzE,eAAe,CAAY;IAC3C,2FAA2F;IAC3E,EAAE,CAAS;IAC3B;;;OAGG;IACa,OAAO,CAAa;IACpC,qIAAqI;IACrH,cAAc,CAAa;IAC3C,gBAAgB;IAChB,IAAW,YAAY,KAAuB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACzD,aAAa,CAAmB;IACjD,0FAA0F;IAC1E,YAAY,CAAuB;IAYnD,kGAAkG;IAClG,IAAW,kBAAkB;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAWD,mDAAmD;IACnD,IAAW,IAAI,KAAc,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,gBAAgB;IAChB,IAAW,YAAY,KAAc,OAAO,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AI,CAAC,KAAK,CAAC;QACjE,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACrD,MAAM,QAAQ,GAAG,MAAM,oCAAoC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACjF,QAAQ,GAAG,QAAQ,EAAE,OAAO,EAAE,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,QAAQ;YACX,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;QAErD,OAAO,QAAQ,CAAC,0BAA0B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CAAC,UAAiC;IAC5D,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,wBAAwB,CAAC,QAAyC,IAAkB,CAAC;IAClG;;;;OAIG;IACI,0BAA0B,KAAU,CAAC;CAC7C","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 { BeDuration, BeTimePoint, dispose, Id64String } from \"@itwin/core-bentley\";\nimport { Matrix4d, Range3d, Transform } from \"@itwin/core-geometry\";\nimport { ElementAlignedBox3d, FrustumPlanes, RenderSchedule, ViewFlagOverrides } from \"@itwin/core-common\";\nimport { calculateEcefToDbTransformAtLocation } from \"../BackgroundMapGeometry\";\nimport { IModelApp } from \"../IModelApp\";\nimport { IModelConnection } from \"../IModelConnection\";\nimport { RenderClipVolume } from \"../render/RenderClipVolume\";\nimport { RenderMemory } from \"../render/RenderMemory\";\nimport { LayerTileTreeHandler, Tile, TileDrawArgs, TileGeometryCollector, TileLoadPriority, TileTreeParams } from \"./internal\";\n\n/** Describes the current state of a [[TileTree]]. TileTrees are loaded asynchronously and may be unloaded after a period of disuse.\n * @see [[TileTreeOwner]].\n * @public\n * @extensions\n */\nexport enum TileTreeLoadStatus {\n /** No attempt to load the tile tree has yet been made. */\n NotLoaded,\n /** The tile tree is in the process of being loaded. */\n Loading,\n /** The tile tree has been successfully loaded. */\n Loaded,\n /** An attempt to load the tile tree failed. */\n NotFound,\n}\n\n/** A hierarchical level-of-detail tree of [3d Tiles](https://github.com/CesiumGS/3d-tiles) to be rendered in a [[Viewport]].\n * Tile trees originate from a variety of sources:\n * - Each [[GeometricModelState]] can supply its graphics as a tile tree;\n * - A [[DisplayStyleState]]'s map settings or reality models;\n * - [ViewAttachment]($backend)s in a [[SheetModelState]];\n * - [[TiledGraphicsProvider]]s associated with a viewport.\n *\n * The same TileTree can be displayed in any number of viewports using multiple [[TileTreeReference]]s.\n * A TileTree's lifetime is managed by a [[TileTreeOwner]].\n *\n * @note Some methods carry a warning that they should **not** be overridden by subclasses; typically a protected method exists that can be\n * overridden instead to customize the behavior. For example, [[selectTiles]] should not be overridden; instead, override the[[_selectTiles]] method\n * that it calls.\n * @public\n * @extensions\n */\nexport abstract class TileTree {\n private _isDisposed = false;\n /** @internal */\n protected _lastSelected = BeTimePoint.now();\n /** @internal */\n protected _clipVolume?: RenderClipVolume;\n public readonly iModel: IModelConnection;\n /** Transform from this tile tree's coordinate space to the iModel's coordinate space. */\n public readonly iModelTransform: Transform;\n /** Uniquely identifies this tree among all other tile trees associated with the iModel. */\n public readonly id: string;\n /** A 64-bit identifier for this tile tree, unique within the context of its [[IModelConnection]].\n * For a tile tree associated with a [[GeometricModelState]], this is the Id of the model. Other types of tile trees\n * typically use a transient Id obtained from [[IModelConnection.transientIds]].\n */\n public readonly modelId: Id64String;\n /** The length of time after which tiles belonging to this tree are considered elegible for disposal if they are no longer in use. */\n public readonly expirationTime: BeDuration;\n /** @internal */\n public get loadPriority(): TileLoadPriority { return this._loadPriority; }\n private readonly _loadPriority: TileLoadPriority;\n /** Optional tight bounding box around the entire contents of all of this tree's tiles. */\n public readonly contentRange?: ElementAlignedBox3d;\n\n /** The lowest-resolution tile in this tree. */\n public abstract get rootTile(): Tile;\n /** True if this tile tree contains 3d graphics. */\n public abstract get is3d(): boolean;\n /** Returns the maximum depth of this tree, if any. */\n public abstract get maxDepth(): number | undefined;\n\n /** The overrides that should be applied to the view's [ViewFlags]($common) when this tile tree is drawn. Can be overridden by individual [[TileTreeReference]]s. */\n public abstract get viewFlagOverrides(): ViewFlagOverrides;\n\n /** True if this tile tree has no bounds - e.g., a tile tree representing a globe is unbounded. */\n public get isContentUnbounded(): boolean {\n return false;\n }\n\n /** Implement this method to select tiles of appropriate resolution. */\n protected abstract _selectTiles(args: TileDrawArgs): Tile[];\n\n /** Produce graphics of appropriate resolution to be drawn in a [[Viewport]]. */\n public abstract draw(args: TileDrawArgs): void;\n\n /** Discard tiles and/or tile contents, presumably based on a least-recently-used and/or least-likely-to-be-needed criterion. */\n public abstract prune(): void;\n\n /** True if this tile tree contains 2d graphics. */\n public get is2d(): boolean { return !this.is3d; }\n /** @internal */\n public get isPointCloud(): boolean { return false; }\n /** @internal */\n public get clipVolume(): RenderClipVolume | undefined { return this._clipVolume; }\n\n /** The volume of space occupied by this tile tree. */\n public get range(): ElementAlignedBox3d { return this.rootTile.range; }\n /** The most recent time at which tiles [[selectTiles]] was called. */\n public get lastSelectedTime(): BeTimePoint { return this._lastSelected; }\n /** True if a tile and its child tiles should not be drawn simultaneously.\n * Default: true.\n */\n public get parentsAndChildrenExclusive(): boolean { return true; }\n\n /** @internal */\n public get layerHandler(): LayerTileTreeHandler | undefined { return undefined; }\n\n /** Constructor */\n protected constructor(params: TileTreeParams) {\n this._lastSelected = BeTimePoint.now();\n this.iModel = params.iModel;\n this.iModelTransform = params.location;\n this._clipVolume = params.clipVolume;\n this.modelId = params.modelId;\n this.id = params.id;\n this.contentRange = params.contentRange;\n\n const admin = IModelApp.tileAdmin;\n this._loadPriority = params.priority;\n this.expirationTime = params.expirationTime ?? admin.tileExpirationTime;\n }\n\n /** Selects tiles of appropriate resolution for some purpose like drawing to the screen, producing a shadow map, etc.\n * @note Do **not** override this method. Implement [[_selectTiles]].\n */\n public selectTiles(args: TileDrawArgs): Tile[] {\n this._lastSelected = BeTimePoint.now();\n const tiles = this._selectTiles(args);\n IModelApp.tileAdmin.addTilesForUser(args.context.viewport, tiles, args.readyTiles, args.touchedTiles);\n args.processSelectedTiles(tiles);\n return tiles;\n }\n\n /** True if [[dispose]] has been called on this tile tree. */\n public get isDisposed(): boolean { return this._isDisposed; }\n\n /** Dispose of this tree and any resources owned by it. This is typically invoked by a [[TileTreeOwner]]. */\n public [Symbol.dispose](): void {\n if (this.isDisposed)\n return;\n\n this._isDisposed = true;\n dispose(this.rootTile);\n }\n\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [Symbol.dispose] instead. */\n public dispose() {\n this[Symbol.dispose]();\n }\n\n /** @internal */\n public collectStatistics(stats: RenderMemory.Statistics): void {\n this.rootTile.collectStatistics(stats);\n }\n\n /** Returns the number of [[Tile]]s currently in memory belonging to this tree, primarily for debugging. */\n public countTiles(): number {\n return 1 + this.rootTile.countDescendants();\n }\n\n /** @internal */\n public accumulateTransformedRange(range: Range3d, matrix: Matrix4d, location: Transform, frustumPlanes?: FrustumPlanes): void {\n this.rootTile.extendRangeForContent(range, matrix, location, frustumPlanes);\n }\n\n /**\n * Return the transform from the tile tree's coordinate space to [ECEF](https://en.wikipedia.org/wiki/ECEF) (Earth Centered Earth Fixed) coordinates.\n * If a geographic coordinate system is present then this transform will be calculated at the tile tree center.\n * @beta\n */\n public async getEcefTransform(): Promise<Transform | undefined> {\n if (!this.iModel.ecefLocation)\n return undefined;\n\n let dbToEcef: Transform | undefined;\n const range = this.contentRange ? this.contentRange : this.range;\n const center = range.localXYZToWorld(.5, .5, .5);\n if (center) {\n this.iModelTransform.multiplyPoint3d(center, center);\n const ecefToDb = await calculateEcefToDbTransformAtLocation(center, this.iModel);\n dbToEcef = ecefToDb?.inverse();\n }\n if (!dbToEcef)\n dbToEcef = this.iModel.ecefLocation.getTransform();\n\n return dbToEcef.multiplyTransformTransform(this.iModelTransform);\n }\n\n /** Populate [[TileGeometryCollector.polyfaces]] with geometry obtained from this tile tree's tiles satisfying the collector's criteria.\n * The base implementation does nothing.\n * @see [[TileTreeReference.createGeometryTreeReference]] to attempt to create a TileTree that can collect geometry.\n * @beta\n */\n public collectTileGeometry(_collector: TileGeometryCollector): void {\n }\n\n /**\n * Invoked when a schedule script is edited.\n * Override to handle updates for affected elements or timelines.\n *\n * @internal\n */\n public async onScheduleEditingChanged(_changes: RenderSchedule.EditingChanges[]): Promise<void> {}\n /**\n * Invoked when a schedule script is committed during editing.\n * Override in specific tile tree types to handle the change.\n * @internal\n */\n public onScheduleEditingCommitted(): void {}\n}\n\n"]}
|