@itwin/core-common 5.1.0-dev.38 → 5.1.0-dev.39
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/BackgroundMapSettings.d.ts +2 -2
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/ClipStyle.d.ts +1 -1
- package/lib/cjs/ClipStyle.d.ts.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +3 -3
- package/lib/cjs/ConcurrentQuery.js +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/MassProperties.d.ts +2 -2
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.d.ts +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/TerrainSettings.d.ts +1 -1
- package/lib/cjs/TerrainSettings.d.ts.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.d.ts +3 -3
- package/lib/cjs/internal/BackendTypes.d.ts.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.d.ts +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.d.ts +6 -6
- package/lib/cjs/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js +6 -6
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.d.ts +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.d.ts +2 -2
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +1 -1
- package/lib/cjs/tile/TileMetadata.js +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.d.ts +2 -2
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/ClipStyle.d.ts +1 -1
- package/lib/esm/ClipStyle.d.ts.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +3 -3
- package/lib/esm/ConcurrentQuery.js +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/MassProperties.d.ts +2 -2
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.d.ts +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/TerrainSettings.d.ts +1 -1
- package/lib/esm/TerrainSettings.d.ts.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/internal/BackendTypes.d.ts +3 -3
- package/lib/esm/internal/BackendTypes.d.ts.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.d.ts.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.d.ts +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.d.ts +6 -6
- package/lib/esm/rpc/core/RpcConstants.d.ts.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js +6 -6
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.d.ts +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.d.ts +2 -2
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +1 -1
- package/lib/esm/tile/TileMetadata.js +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA6SH,kEAGC;AAqGD,4EAgBC;AA2DD,4DA6CC;AAKD,4DAsBC;AAqKD,8CASC;AAGD,8CAOC;AAKD,wDAwBC;AAKD,sDA4EC;AAYD,gEAEC;AAaD,oEA4DC;AAOD,8DASC;AAn7BD,sDAE6B;AAC7B,wDAAyD;AACzD,kDAA4C;AAE5C,iDAA+F;AAC/F,qCAAyD;AAEzD,mCAAmC;AAEnC,+DAA+D;AAC/D,IAAU,SAAS,CAElB;AAFD,WAAU,SAAS;IACJ,qCAA2B,GAAG,CAAC,CAAC;AAC/C,CAAC,EAFS,SAAS,KAAT,SAAS,QAElB;AA6CD,SAAS,kBAAkB,CAAC,CAAsB,EAAE,CAAsB;IACxE,IAAI,OAAO,CAAC,KAAK,OAAO,CAAC;QACvB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpB,IAAI,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3B,IAAA,qBAAM,EAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC;QAC/B,OAAO,IAAA,8BAAe,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,IAAA,qBAAM,EAAC,OAA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ACtB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;YAC5C,KAAK,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;CACF;AAhCD,gDAgCC","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 Tile\n */\n\nimport {\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStrings, compareStringsOrUndefined, Id64, Id64String,\n} from \"@itwin/core-bentley\";\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\nimport { BatchType } from \"../FeatureTable\";\nimport { TileProps } from \"../TileProps\";\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\n\n// cspell:ignore imdl mult bitfield\n\n// NB: These constants correspond to those defined in Tile.cpp.\nnamespace Constants {\n export const minToleranceRatioMultiplier = 2;\n}\n\n/** Describes an iModel tile tree.\n * @internal\n */\nexport interface TileTreeMetadata {\n readonly modelId: Id64String;\n readonly is2d: boolean;\n readonly contentRange?: Range3d;\n readonly tileScreenSize: number;\n}\n\n/** Describes the contents of an iModel tile.\n * @internal\n */\nexport interface TileContentMetadata {\n readonly contentRange: Range3d;\n readonly isLeaf: boolean;\n readonly sizeMultiplier?: number;\n readonly emptySubRangeMask: number;\n}\n\n/** Describes an iModel tile.\n * @internal\n */\nexport interface TileMetadata extends TileContentMetadata {\n readonly contentId: string;\n readonly range: Range3d;\n}\n\n/** The type of edges to be produced for iMdl tiles.\n * @see [[EdgeOptions]].\n * @internal\n */\nexport type TileEdgeType = \"compact\" | \"indexed\" | \"non-indexed\";\n\n/** Describes how edges should be produced for tiles in a tile tree.\n * @internal\n */\nexport interface EdgeOptions {\n type: TileEdgeType;\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\n smooth: boolean;\n}\n\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\n if (typeof a !== typeof b)\n return a ? 1 : -1;\n\n if (typeof a === \"boolean\") {\n assert(typeof b === \"boolean\");\n return compareBooleans(a, b);\n }\n\n assert(typeof b === \"object\");\n let cmp = compareStrings(a.type, b.type);\n if (0 === cmp)\n cmp = compareBooleans(a.smooth, b.smooth);\n\n return cmp;\n}\n\n/** @internal */\nexport interface TileOptions {\n readonly maximumMajorTileFormatVersion: number;\n readonly enableInstancing: boolean;\n readonly enableImprovedElision: boolean;\n readonly ignoreAreaPatterns: boolean;\n readonly enableExternalTextures: boolean;\n readonly useProjectExtents: boolean;\n readonly expandProjectExtents: boolean;\n readonly optimizeBRepProcessing: boolean;\n readonly useLargerTiles: boolean;\n readonly disableMagnification: boolean;\n readonly alwaysSubdivideIncompleteTiles: boolean;\n readonly edgeOptions: EdgeOptions;\n readonly disablePolyfaceDecimation: boolean;\n}\n\n/** @internal */\nexport namespace TileOptions {\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\n * compute the [[TileOptions]] that were used to generate the Ids.\n * @throws Error if `treeId` or `contentId` are not valid Ids.\n * @note `treeId` and `contentId` are assumed to be valid Ids. They are not fully parsed and validated - only the information required by this function is extracted.\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\n */\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\n const tree = treeFlagsAndFormatVersionFromId(treeId);\n const contentFlags = contentFlagsFromId(contentId);\n const edgeOptions = edgeOptionsFromTreeId(treeId);\n\n return {\n maximumMajorTileFormatVersion: tree.version,\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\n expandProjectExtents: 0 !== (tree.flags & TreeFlags.ExpandProjectExtents),\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n edgeOptions,\n disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),\n };\n }\n}\n\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\" | \"disablePolyfaceDecimation\">;\ninterface ParsedClassifier {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n}\n\n/** The result of [[parseTileTreeIdAndContentId]].\n * @internal\n */\nexport interface ParsedTileTreeIdAndContentId {\n modelId: Id64String;\n treeId: IModelTileTreeId;\n contentId: ContentIdSpec;\n options: TileOptions;\n}\n\nclass Parser {\n public readonly input: string;\n public curPos = 0;\n\n public constructor(input: string) {\n this.input = input;\n }\n\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\n this.require(this.input.length > 0);\n\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\n while (this.curPos < this.input.length && this.cur() !== \"-\")\n this.advance();\n\n this.eat(\"-\");\n this.require(this.curPos < this.input.length);\n\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\n const animationId = this.parseAnimation();\n\n const primary = classifier ? undefined : this.parsePrimary();\n this.require((undefined === classifier) !== (undefined === primary));\n\n const modelId = this.input.substring(this.curPos);\n this.require(Id64.isId64(modelId));\n\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\n\n let parsedContentId: ContentIdSpec;\n try {\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\n } catch {\n this.reject(\"Invalid content Id\");\n }\n\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\n throw new Error(\"Invalid content Id\");\n\n const disablePolyfaceDecimation = options.disablePolyfaceDecimation;\n let treeId: IModelTileTreeId;\n if (classifier) {\n treeId = { ...classifier, animationId, disablePolyfaceDecimation };\n } else {\n assert(undefined !== primary);\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };\n }\n\n return {\n contentId: parsedContentId,\n modelId,\n options,\n treeId,\n };\n }\n\n private cur(): string {\n this.require(this.curPos < this.input.length);\n return this.input[this.curPos];\n }\n\n private advance(): void {\n this.require(this.curPos < this.input.length);\n ++this.curPos;\n }\n\n private eat(expectedChar: string): void {\n this.require(this.cur() === expectedChar);\n this.advance();\n }\n\n private reject(message = \"Invalid tree Id\"): never {\n throw new Error(message);\n }\n\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\n if (!condition)\n this.reject(message);\n }\n\n private parseClassifier(): ParsedClassifier | undefined {\n this.eat(\"C\");\n let type = BatchType.VolumeClassifier;\n if (this.cur() === \"P\") {\n type = BatchType.PlanarClassifier;\n this.advance();\n }\n\n this.eat(\":\");\n\n // C: or CP: is always folowed by expansion then an underscore.\n let expansionStr = \"\";\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\n expansionStr += this.cur();\n this.advance();\n }\n\n this.eat(\"_\");\n\n const expansion = Number.parseFloat(expansionStr);\n this.require(!Number.isNaN(expansion));\n\n return { type, expansion };\n }\n\n private parseAnimation(): Id64String | undefined {\n if (this.cur() !== \"A\")\n return undefined;\n\n this.eat(\"A\");\n this.eat(\":\");\n\n const termPos = this.input.indexOf(\"_\", this.curPos);\n this.require(termPos > this.curPos);\n\n const animationId = this.input.substring(this.curPos, termPos);\n this.require(Id64.isId64(animationId));\n\n this.curPos = termPos + 1; // Skip \"_\"\n return animationId;\n }\n\n private parsePrimary(): ParsedPrimary {\n const edges = this.parseEdges();\n const sectionCut = this.parseSectionCut();\n return { edges, sectionCut };\n }\n\n private parseEdges(): EdgeOptions | false {\n if (\"E\" !== this.cur())\n return { type: \"non-indexed\", smooth: false };\n\n this.eat(\"E\");\n this.eat(\":\");\n\n const flag = this.cur();\n this.eat(flag);\n this.eat(\"_\");\n\n return \"0\" === flag ? false : edgeOptionsFromFlag(flag);\n }\n\n private parseSectionCut(): string | undefined {\n if (\"S\" !== this.cur())\n return undefined;\n\n this.eat(\"S\");\n const termPos = this.input.indexOf(\"s\", this.curPos);\n this.require(termPos > this.curPos);\n\n const sectionCut = this.input.substring(this.curPos, termPos);\n this.curPos = termPos + 1; // Skip \"_\";\n return sectionCut;\n }\n}\n\n/** @internal */\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\n const parser = new Parser(treeId);\n return parser.parse(contentId);\n}\n\n/** @internal */\nexport const defaultTileOptions: TileOptions = Object.freeze({\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\n enableInstancing: true,\n enableImprovedElision: true,\n ignoreAreaPatterns: false,\n enableExternalTextures: true,\n useProjectExtents: true,\n expandProjectExtents: true,\n optimizeBRepProcessing: true,\n useLargerTiles: true,\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n disablePolyfaceDecimation: false,\n edgeOptions: {\n type: \"compact\" as const,\n smooth: true,\n },\n});\n\nfunction contentFlagsFromId(id: string): ContentFlags {\n if (0 === id.length || \"-\" !== id[0])\n throw new Error(\"Invalid content Id\");\n\n // V4: -flags-d-i-j-k-m - version in tree Id\n const end = id.indexOf(\"-\", 1);\n if (-1 !== end) {\n const flags = Number.parseInt(id.substring(1, end), 16);\n if (!Number.isNaN(flags))\n return flags;\n }\n\n throw new Error(\"Invalid content Id\");\n}\n\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\n if (0 === id.length)\n throw new Error(\"Invalid tree Id\");\n\n let parts = id.split(\"-\");\n if (parts.length > 0) {\n parts = parts[0].split(\"_\");\n if (parts.length === 2) {\n const version = Number.parseInt(parts[0], 16);\n const flags = Number.parseInt(parts[1], 16);\n if (!Number.isNaN(version) || !Number.isNaN(flags))\n return { version, flags };\n }\n }\n\n throw new Error(\"Invalid tree Id\");\n}\n\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\n const pos = id.indexOf(\"E:\");\n if (pos <= 0)\n return { type: \"non-indexed\", smooth: false };\n\n return edgeOptionsFromFlag(id[pos + 2]);\n}\n\nfunction edgeOptionsFromFlag(flag: string): EdgeOptions {\n if (\"0\" === flag)\n return defaultTileOptions.edgeOptions;\n\n const smooth = flag !== \"2\" && flag !== \"5\";\n let type: TileEdgeType;\n switch (flag) {\n case \"2\":\n case \"4\":\n type = \"indexed\";\n break;\n case \"3\":\n type = \"non-indexed\";\n break;\n case \"5\":\n case \"6\":\n type = \"compact\";\n break;\n default:\n throw new Error(\"Invalid tree Id\");\n }\n\n return { type, smooth };\n}\n\nfunction edgeOptionsToString(options: EdgeOptions | false) {\n if (!options)\n return \"E:0_\";\n\n switch (options.type) {\n case \"non-indexed\": return options.smooth ? \"E:3_\" : \"\";\n case \"indexed\": return options.smooth ? \"E:4_\" : \"E:2_\";\n case \"compact\": return options.smooth ? \"E:6_\" : \"E:5_\";\n default: throw new Error(\"Invalid tree Id\");\n }\n}\n\n/** @internal */\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\n // Ensure we do not request tiles of a newer major version than backend can supply or it can read; and also limit major version\n // to that optionally configured by the app.\n let majorVersion = maxMajorVersion;\n if (undefined !== formatVersion)\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\n\n // Version number less than 1 is invalid - ignore\n majorVersion = Math.max(majorVersion, 1);\n\n // Version number greater than current known version ignored\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\n\n // Version numbers are integers - round down\n return Math.max(Math.floor(majorVersion), 1);\n}\n\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\n * @alpha\n */\nexport enum TreeFlags {\n None = 0,\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\n ExpandProjectExtents = 1 << 4, // If UseProjectExtents, round them up/down to nearest powers of ten.\n DisablePolyfaceDecimation = 1 << 5, // Don't attempt to decimate polyfaces in element geometry streams.\n}\n\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\n * @internal\n */\nexport interface PrimaryTileTreeId {\n /** Describes the type of tile tree. */\n type: BatchType.Primary;\n /** The type of edges to include in tile content. */\n edges: EdgeOptions | false;\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\n animationId?: Id64String;\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\n * for ensuring the graphics display with correct priority.\n */\n enforceDisplayPriority?: boolean;\n /** If defined, the compact string representation of a clip vector applied to the tiles to produce cut geometry at the intersections with the clip planes.\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\n * @see [ClipVector.toCompactString[($core-geometry).\n */\n sectionCut?: string;\n disablePolyfaceDecimation?: boolean;\n}\n\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\n * @internal\n */\nexport interface ClassifierTileTreeId {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n animationId?: Id64String;\n disablePolyfaceDecimation?: boolean;\n}\n\nfunction animationIdToString(animationId: Id64String): string {\n return `A:${animationId}_`;\n}\n\n/** Describes the Id of an iModel tile tree.\n * @internal\n */\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\n\n/** Convert a tile tree Id to its string representation.\n * @internal\n */\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\n let idStr = \"\";\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\n if (options.optimizeBRepProcessing)\n flags |= TreeFlags.OptimizeBRepProcessing;\n\n if (options.disablePolyfaceDecimation)\n flags |= TreeFlags.DisablePolyfaceDecimation;\n\n if (options.useLargerTiles)\n flags |= TreeFlags.UseLargerTiles;\n\n if (options.expandProjectExtents)\n flags |= TreeFlags.ExpandProjectExtents;\n\n if (BatchType.Primary === treeId.type) {\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\n flags |= TreeFlags.EnforceDisplayPriority;\n\n const edges = edgeOptionsToString(treeId.edges);\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\n idStr = `${idStr}${edges}${sectionCut}`;\n } else {\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\n\n if (BatchType.VolumeClassifier === treeId.type) {\n // Volume classifiers always use the exact project extents.\n flags |= TreeFlags.UseProjectExtents;\n flags &= ~TreeFlags.ExpandProjectExtents;\n }\n\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n }\n\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\n if (version >= 4) {\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\n idStr = prefix + idStr;\n }\n\n return idStr + modelId;\n}\n\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\n * @internal\n */\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\n let cmp = compareNumbers(lhs.type, rhs.type);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\n\n if (0 !== cmp)\n return cmp;\n\n // NB: The redundant checks on BatchType below are to satisfy compiler.\n assert(lhs.type === rhs.type);\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\n if (0 === cmp) {\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\n }\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\n }\n\n return cmp;\n}\n\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\n * @alpha\n */\nexport enum ContentFlags {\n None = 0,\n AllowInstancing = 1 << 0,\n ImprovedElision = 1 << 1,\n IgnoreAreaPatterns = 1 << 2,\n ExternalTextures = 1 << 3,\n}\n\n/** Describes the components of a tile's content Id.\n *\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\n *\n * The i, j, and k parameters specify how to subdivide the tile's volume. Each sub-division is performed along the longest axis of the\n * volume. The volume is first sub-divided based on `i`, then the result sub-divided based on `j`, and finally that result sub-divided\n * based on `k`.\n *\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\n * produce a higher-resolution tile for the same volume.\n * @internal\n */\ninterface ContentIdSpec {\n depth: number;\n i: number;\n j: number;\n k: number;\n multiplier: number;\n}\n\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\n * the major version of the tile format.\n * @internal\n */\nexport abstract class ContentIdProvider {\n public readonly majorFormatVersion: number;\n public readonly contentFlags: ContentFlags;\n\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\n this.majorFormatVersion = formatVersion;\n this.contentFlags = contentFlags;\n }\n\n public get rootContentId(): string {\n return this.computeId(0, 0, 0, 0, 1);\n }\n\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\n const lastSepPos = parentId.lastIndexOf(this._separator);\n assert(-1 !== lastSepPos);\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\n }\n\n public specFromId(id: string): ContentIdSpec {\n const parts = id.split(this._separator);\n const len = parts.length;\n assert(len >= 5);\n return {\n depth: parseInt(parts[len - 5], 16),\n i: parseInt(parts[len - 4], 16),\n j: parseInt(parts[len - 3], 16),\n k: parseInt(parts[len - 2], 16),\n multiplier: parseInt(parts[len - 1], 16),\n };\n }\n\n public idFromSpec(spec: ContentIdSpec): string {\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\n }\n\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\n const sep = this._separator;\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\n }\n\n protected abstract get _separator(): string;\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\n\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\n * not supply tiles of a format the front-end doesn't recognize.\n */\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\n assert(majorVersion > 0);\n assert(Math.floor(majorVersion) === majorVersion);\n switch (majorVersion) {\n case 0:\n case 1:\n return new ContentIdV1Provider(majorVersion);\n case 2:\n case 3:\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\n default:\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\n }\n }\n}\n\n/** The original (major version 1) tile format used a content Id scheme of the format\n * `depth/i/j/k/multiplier`.\n * @internal\n */\nclass ContentIdV1Provider extends ContentIdProvider {\n public constructor(majorVersion: number) {\n super(majorVersion, ContentFlags.None);\n }\n\n protected get _separator() { return \"/\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\n * @internal\n */\nclass ContentIdV2Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n super(majorVersion, flags);\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"_\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\n * Format: `-flags-depth-i-j-k-multiplier`.\n * @internal\n */\nclass ContentIdV4Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n if (options.enableImprovedElision)\n flags = flags | ContentFlags.ImprovedElision;\n\n if (options.ignoreAreaPatterns)\n flags = flags | ContentFlags.IgnoreAreaPatterns;\n\n if (options.enableExternalTextures)\n flags = flags | ContentFlags.ExternalTextures;\n\n super(majorVersion, flags);\n this._prefix = this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"-\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** @internal */\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y && diag.x > diag.z)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else if (diag.y > diag.z)\n pt.y = (range.low.y + range.high.y) / 2.0;\n else\n pt.z = (range.low.z + range.high.z) / 2.0;\n}\n\n/** @internal */\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else\n pt.y = (range.low.y + range.high.y) / 2.0;\n}\n\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\n * @internal\n */\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\n const emptyMask = tile.emptySubRangeMask;\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n const isEmpty = 0 !== (emptyMask & emptyBit);\n\n const range = tile.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n ranges.push({ range, isEmpty });\n }\n }\n }\n\n return ranges;\n}\n\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\n * @internal\n */\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\n let numEmpty = 0;\n const children: TileProps[] = [];\n\n // Leaf nodes have no children\n if (parent.isLeaf)\n return { children, numEmpty };\n\n // One child, same volume as parent, but higher-resolution.\n if (undefined !== parent.sizeMultiplier) {\n const sizeMultiplier = parent.sizeMultiplier * 2;\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\n children.push({\n contentId,\n range: parent.range,\n contentRange: parent.contentRange,\n sizeMultiplier,\n isLeaf: false,\n maximumSize: root.tileScreenSize,\n });\n\n return { children, numEmpty };\n }\n\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\n const parentSpec = idProvider.specFromId(parent.contentId);\n const childSpec: ContentIdSpec = { ...parentSpec };\n childSpec.depth = parentSpec.depth + 1;\n\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\n // Don't bother creating children or requesting content for such empty volumes.\n const emptyMask = parent.emptySubRangeMask;\n\n // Spatial tree range == project extents; content range == model range.\n // Trivially reject children whose ranges are entirely outside model range.\n let treeContentRange = root.contentRange;\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\n // Parent is wholly within model range - don't bother testing child ranges against it.\n treeContentRange = undefined;\n }\n\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n if (0 !== (emptyMask & emptyBit)) {\n // volume is known to contain no geometry.\n ++numEmpty;\n continue;\n }\n\n const range = parent.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\n // volume is within project extents but entirely outside model range\n ++numEmpty;\n continue;\n }\n\n childSpec.i = parentSpec.i * 2 + i;\n childSpec.j = parentSpec.j * 2 + j;\n childSpec.k = parentSpec.k * 2 + k;\n\n const childId = idProvider.idFromSpec(childSpec);\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\n }\n }\n }\n\n return { children, numEmpty };\n}\n\n/** @internal */\nexport interface TileContentDescription extends TileContentMetadata {\n readonly featureTableStartPos: number;\n}\n\n/** Deserializes tile content metadata.\n * @throws [[TileReadError]]\n * @internal\n * @deprecated in 4.0. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.\n */\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\n return decodeTileContentDescription({ stream, sizeMultiplier, is2d, options, isVolumeClassifier });\n}\n\n/** @internal */\nexport interface DecodeTileContentDescriptionArgs {\n stream: ByteStream;\n options: TileOptions;\n isVolumeClassifier?: boolean;\n is2d?: boolean;\n sizeMultiplier?: number;\n isLeaf?: boolean;\n}\n\n/** @internal */\nexport function decodeTileContentDescription(args: DecodeTileContentDescriptionArgs): TileContentDescription {\n const { stream, options } = args;\n const isVolumeClassifier = args.isVolumeClassifier ?? false;\n\n stream.reset();\n\n const header = new ImdlHeader(stream);\n if (!header.isValid)\n throw new TileReadError(TileReadStatus.InvalidHeader);\n else if (!header.isReadableVersion)\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\n\n // Skip the feature table.\n const featureTableStartPos = stream.curPos;\n const ftHeader = FeatureTableHeader.readFrom(stream);\n if (undefined === ftHeader)\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\n\n stream.curPos = featureTableStartPos + ftHeader.length;\n\n let sizeMultiplier = args.sizeMultiplier;\n let isLeaf = args.isLeaf;\n if (undefined === isLeaf) {\n // Determine subdivision based on header data.\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\n isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\n if (!isLeaf) {\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\n // can be adversely affected by quantization issues when zooming in closely.\n const maxLeafTolerance = 1.0;\n\n // Must sub-divide if tile explicitly specifies...\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\n canSkipSubdivision = canSkipSubdivision && !args.is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\n // ...or app specifies incomplete tiles must always be sub-divided.\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\n if (canSkipSubdivision) {\n const minElementsPerTile = 100;\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\n if (!containsCurves)\n isLeaf = true;\n else if (undefined === sizeMultiplier)\n sizeMultiplier = 1.0;\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\n sizeMultiplier = 1.0;\n }\n }\n }\n }\n\n return {\n featureTableStartPos,\n contentRange: header.contentRange,\n isLeaf,\n sizeMultiplier,\n emptySubRangeMask: header.emptySubRanges,\n };\n}\n\nconst scratchRangeDiagonal = new Vector3d();\n\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\n * @internal\n */\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\n if (tile.range.isNull)\n return 0;\n\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\n\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\n}\n\n/** Deserializes tile metadata.\n * @internal\n */\nexport class TileMetadataReader {\n private readonly _is2d: boolean;\n private readonly _isVolumeClassifier: boolean;\n private readonly _options: TileOptions;\n\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\n this._is2d = is2d;\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\n this._options = options;\n }\n\n /** Produce metadata from the specified tile content.\n * @throws [[TileReadError]]\n */\n public read(stream: ByteStream, props: TileProps): TileMetadata {\n const content = decodeTileContentDescription({\n stream,\n sizeMultiplier: props.sizeMultiplier,\n is2d: this._is2d,\n options: this._options,\n isVolumeClassifier: this._isVolumeClassifier,\n });\n\n return {\n contentRange: content.contentRange,\n isLeaf: content.isLeaf,\n sizeMultiplier: content.sizeMultiplier,\n emptySubRangeMask: content.emptySubRangeMask,\n range: Range3d.fromJSON(props.range),\n contentId: props.contentId,\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA6SH,kEAGC;AAqGD,4EAgBC;AA2DD,4DA6CC;AAKD,4DAsBC;AAqKD,8CASC;AAGD,8CAOC;AAKD,wDAwBC;AAKD,sDA4EC;AAYD,gEAEC;AAaD,oEA4DC;AAOD,8DASC;AAn7BD,sDAE6B;AAC7B,wDAAyD;AACzD,kDAA4C;AAE5C,iDAA+F;AAC/F,qCAAyD;AAEzD,mCAAmC;AAEnC,+DAA+D;AAC/D,IAAU,SAAS,CAElB;AAFD,WAAU,SAAS;IACJ,qCAA2B,GAAG,CAAC,CAAC;AAC/C,CAAC,EAFS,SAAS,KAAT,SAAS,QAElB;AA6CD,SAAS,kBAAkB,CAAC,CAAsB,EAAE,CAAsB;IACxE,IAAI,OAAO,CAAC,KAAK,OAAO,CAAC;QACvB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpB,IAAI,OAAO,CAAC,KAAK,SAAS,EAAE,CAAC;QAC3B,IAAA,qBAAM,EAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC;QAC/B,OAAO,IAAA,8BAAe,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,IAAA,qBAAM,EAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;IAC9B,IAAI,GAAG,GAAG,IAAA,6BAAc,EAAC,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C5C,KAAK,EAAE,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;CACF;AAhCD,gDAgCC","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 Tile\n */\n\nimport {\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStrings, compareStringsOrUndefined, Id64, Id64String,\n} from \"@itwin/core-bentley\";\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\nimport { BatchType } from \"../FeatureTable\";\nimport { TileProps } from \"../TileProps\";\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\n\n// cspell:ignore imdl mult bitfield\n\n// NB: These constants correspond to those defined in Tile.cpp.\nnamespace Constants {\n export const minToleranceRatioMultiplier = 2;\n}\n\n/** Describes an iModel tile tree.\n * @internal\n */\nexport interface TileTreeMetadata {\n readonly modelId: Id64String;\n readonly is2d: boolean;\n readonly contentRange?: Range3d;\n readonly tileScreenSize: number;\n}\n\n/** Describes the contents of an iModel tile.\n * @internal\n */\nexport interface TileContentMetadata {\n readonly contentRange: Range3d;\n readonly isLeaf: boolean;\n readonly sizeMultiplier?: number;\n readonly emptySubRangeMask: number;\n}\n\n/** Describes an iModel tile.\n * @internal\n */\nexport interface TileMetadata extends TileContentMetadata {\n readonly contentId: string;\n readonly range: Range3d;\n}\n\n/** The type of edges to be produced for iMdl tiles.\n * @see [[EdgeOptions]].\n * @internal\n */\nexport type TileEdgeType = \"compact\" | \"indexed\" | \"non-indexed\";\n\n/** Describes how edges should be produced for tiles in a tile tree.\n * @internal\n */\nexport interface EdgeOptions {\n type: TileEdgeType;\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\n smooth: boolean;\n}\n\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\n if (typeof a !== typeof b)\n return a ? 1 : -1;\n\n if (typeof a === \"boolean\") {\n assert(typeof b === \"boolean\");\n return compareBooleans(a, b);\n }\n\n assert(typeof b === \"object\");\n let cmp = compareStrings(a.type, b.type);\n if (0 === cmp)\n cmp = compareBooleans(a.smooth, b.smooth);\n\n return cmp;\n}\n\n/** @internal */\nexport interface TileOptions {\n readonly maximumMajorTileFormatVersion: number;\n readonly enableInstancing: boolean;\n readonly enableImprovedElision: boolean;\n readonly ignoreAreaPatterns: boolean;\n readonly enableExternalTextures: boolean;\n readonly useProjectExtents: boolean;\n readonly expandProjectExtents: boolean;\n readonly optimizeBRepProcessing: boolean;\n readonly useLargerTiles: boolean;\n readonly disableMagnification: boolean;\n readonly alwaysSubdivideIncompleteTiles: boolean;\n readonly edgeOptions: EdgeOptions;\n readonly disablePolyfaceDecimation: boolean;\n}\n\n/** @internal */\nexport namespace TileOptions {\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\n * compute the [[TileOptions]] that were used to generate the Ids.\n * @throws Error if `treeId` or `contentId` are not valid Ids.\n * @note `treeId` and `contentId` are assumed to be valid Ids. They are not fully parsed and validated - only the information required by this function is extracted.\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\n */\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\n const tree = treeFlagsAndFormatVersionFromId(treeId);\n const contentFlags = contentFlagsFromId(contentId);\n const edgeOptions = edgeOptionsFromTreeId(treeId);\n\n return {\n maximumMajorTileFormatVersion: tree.version,\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\n expandProjectExtents: 0 !== (tree.flags & TreeFlags.ExpandProjectExtents),\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n edgeOptions,\n disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),\n };\n }\n}\n\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\" | \"disablePolyfaceDecimation\">;\ninterface ParsedClassifier {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n}\n\n/** The result of [[parseTileTreeIdAndContentId]].\n * @internal\n */\nexport interface ParsedTileTreeIdAndContentId {\n modelId: Id64String;\n treeId: IModelTileTreeId;\n contentId: ContentIdSpec;\n options: TileOptions;\n}\n\nclass Parser {\n public readonly input: string;\n public curPos = 0;\n\n public constructor(input: string) {\n this.input = input;\n }\n\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\n this.require(this.input.length > 0);\n\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\n while (this.curPos < this.input.length && this.cur() !== \"-\")\n this.advance();\n\n this.eat(\"-\");\n this.require(this.curPos < this.input.length);\n\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\n const animationId = this.parseAnimation();\n\n const primary = classifier ? undefined : this.parsePrimary();\n this.require((undefined === classifier) !== (undefined === primary));\n\n const modelId = this.input.substring(this.curPos);\n this.require(Id64.isId64(modelId));\n\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\n\n let parsedContentId: ContentIdSpec;\n try {\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\n } catch {\n this.reject(\"Invalid content Id\");\n }\n\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\n throw new Error(\"Invalid content Id\");\n\n const disablePolyfaceDecimation = options.disablePolyfaceDecimation;\n let treeId: IModelTileTreeId;\n if (classifier) {\n treeId = { ...classifier, animationId, disablePolyfaceDecimation };\n } else {\n assert(undefined !== primary);\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };\n }\n\n return {\n contentId: parsedContentId,\n modelId,\n options,\n treeId,\n };\n }\n\n private cur(): string {\n this.require(this.curPos < this.input.length);\n return this.input[this.curPos];\n }\n\n private advance(): void {\n this.require(this.curPos < this.input.length);\n ++this.curPos;\n }\n\n private eat(expectedChar: string): void {\n this.require(this.cur() === expectedChar);\n this.advance();\n }\n\n private reject(message = \"Invalid tree Id\"): never {\n throw new Error(message);\n }\n\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\n if (!condition)\n this.reject(message);\n }\n\n private parseClassifier(): ParsedClassifier | undefined {\n this.eat(\"C\");\n let type = BatchType.VolumeClassifier;\n if (this.cur() === \"P\") {\n type = BatchType.PlanarClassifier;\n this.advance();\n }\n\n this.eat(\":\");\n\n // C: or CP: is always folowed by expansion then an underscore.\n let expansionStr = \"\";\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\n expansionStr += this.cur();\n this.advance();\n }\n\n this.eat(\"_\");\n\n const expansion = Number.parseFloat(expansionStr);\n this.require(!Number.isNaN(expansion));\n\n return { type, expansion };\n }\n\n private parseAnimation(): Id64String | undefined {\n if (this.cur() !== \"A\")\n return undefined;\n\n this.eat(\"A\");\n this.eat(\":\");\n\n const termPos = this.input.indexOf(\"_\", this.curPos);\n this.require(termPos > this.curPos);\n\n const animationId = this.input.substring(this.curPos, termPos);\n this.require(Id64.isId64(animationId));\n\n this.curPos = termPos + 1; // Skip \"_\"\n return animationId;\n }\n\n private parsePrimary(): ParsedPrimary {\n const edges = this.parseEdges();\n const sectionCut = this.parseSectionCut();\n return { edges, sectionCut };\n }\n\n private parseEdges(): EdgeOptions | false {\n if (\"E\" !== this.cur())\n return { type: \"non-indexed\", smooth: false };\n\n this.eat(\"E\");\n this.eat(\":\");\n\n const flag = this.cur();\n this.eat(flag);\n this.eat(\"_\");\n\n return \"0\" === flag ? false : edgeOptionsFromFlag(flag);\n }\n\n private parseSectionCut(): string | undefined {\n if (\"S\" !== this.cur())\n return undefined;\n\n this.eat(\"S\");\n const termPos = this.input.indexOf(\"s\", this.curPos);\n this.require(termPos > this.curPos);\n\n const sectionCut = this.input.substring(this.curPos, termPos);\n this.curPos = termPos + 1; // Skip \"_\";\n return sectionCut;\n }\n}\n\n/** @internal */\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\n const parser = new Parser(treeId);\n return parser.parse(contentId);\n}\n\n/** @internal */\nexport const defaultTileOptions: TileOptions = Object.freeze({\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\n enableInstancing: true,\n enableImprovedElision: true,\n ignoreAreaPatterns: false,\n enableExternalTextures: true,\n useProjectExtents: true,\n expandProjectExtents: true,\n optimizeBRepProcessing: true,\n useLargerTiles: true,\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n disablePolyfaceDecimation: false,\n edgeOptions: {\n type: \"compact\" as const,\n smooth: true,\n },\n});\n\nfunction contentFlagsFromId(id: string): ContentFlags {\n if (0 === id.length || \"-\" !== id[0])\n throw new Error(\"Invalid content Id\");\n\n // V4: -flags-d-i-j-k-m - version in tree Id\n const end = id.indexOf(\"-\", 1);\n if (-1 !== end) {\n const flags = Number.parseInt(id.substring(1, end), 16);\n if (!Number.isNaN(flags))\n return flags;\n }\n\n throw new Error(\"Invalid content Id\");\n}\n\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\n if (0 === id.length)\n throw new Error(\"Invalid tree Id\");\n\n let parts = id.split(\"-\");\n if (parts.length > 0) {\n parts = parts[0].split(\"_\");\n if (parts.length === 2) {\n const version = Number.parseInt(parts[0], 16);\n const flags = Number.parseInt(parts[1], 16);\n if (!Number.isNaN(version) || !Number.isNaN(flags))\n return { version, flags };\n }\n }\n\n throw new Error(\"Invalid tree Id\");\n}\n\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\n const pos = id.indexOf(\"E:\");\n if (pos <= 0)\n return { type: \"non-indexed\", smooth: false };\n\n return edgeOptionsFromFlag(id[pos + 2]);\n}\n\nfunction edgeOptionsFromFlag(flag: string): EdgeOptions {\n if (\"0\" === flag)\n return defaultTileOptions.edgeOptions;\n\n const smooth = flag !== \"2\" && flag !== \"5\";\n let type: TileEdgeType;\n switch (flag) {\n case \"2\":\n case \"4\":\n type = \"indexed\";\n break;\n case \"3\":\n type = \"non-indexed\";\n break;\n case \"5\":\n case \"6\":\n type = \"compact\";\n break;\n default:\n throw new Error(\"Invalid tree Id\");\n }\n\n return { type, smooth };\n}\n\nfunction edgeOptionsToString(options: EdgeOptions | false) {\n if (!options)\n return \"E:0_\";\n\n switch (options.type) {\n case \"non-indexed\": return options.smooth ? \"E:3_\" : \"\";\n case \"indexed\": return options.smooth ? \"E:4_\" : \"E:2_\";\n case \"compact\": return options.smooth ? \"E:6_\" : \"E:5_\";\n default: throw new Error(\"Invalid tree Id\");\n }\n}\n\n/** @internal */\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\n // Ensure we do not request tiles of a newer major version than backend can supply or it can read; and also limit major version\n // to that optionally configured by the app.\n let majorVersion = maxMajorVersion;\n if (undefined !== formatVersion)\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\n\n // Version number less than 1 is invalid - ignore\n majorVersion = Math.max(majorVersion, 1);\n\n // Version number greater than current known version ignored\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\n\n // Version numbers are integers - round down\n return Math.max(Math.floor(majorVersion), 1);\n}\n\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\n * @alpha\n */\nexport enum TreeFlags {\n None = 0,\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\n ExpandProjectExtents = 1 << 4, // If UseProjectExtents, round them up/down to nearest powers of ten.\n DisablePolyfaceDecimation = 1 << 5, // Don't attempt to decimate polyfaces in element geometry streams.\n}\n\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\n * @internal\n */\nexport interface PrimaryTileTreeId {\n /** Describes the type of tile tree. */\n type: BatchType.Primary;\n /** The type of edges to include in tile content. */\n edges: EdgeOptions | false;\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\n animationId?: Id64String;\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\n * for ensuring the graphics display with correct priority.\n */\n enforceDisplayPriority?: boolean;\n /** If defined, the compact string representation of a clip vector applied to the tiles to produce cut geometry at the intersections with the clip planes.\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\n * @see [ClipVector.toCompactString[($core-geometry).\n */\n sectionCut?: string;\n disablePolyfaceDecimation?: boolean;\n}\n\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\n * @internal\n */\nexport interface ClassifierTileTreeId {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n animationId?: Id64String;\n disablePolyfaceDecimation?: boolean;\n}\n\nfunction animationIdToString(animationId: Id64String): string {\n return `A:${animationId}_`;\n}\n\n/** Describes the Id of an iModel tile tree.\n * @internal\n */\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\n\n/** Convert a tile tree Id to its string representation.\n * @internal\n */\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\n let idStr = \"\";\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\n if (options.optimizeBRepProcessing)\n flags |= TreeFlags.OptimizeBRepProcessing;\n\n if (options.disablePolyfaceDecimation)\n flags |= TreeFlags.DisablePolyfaceDecimation;\n\n if (options.useLargerTiles)\n flags |= TreeFlags.UseLargerTiles;\n\n if (options.expandProjectExtents)\n flags |= TreeFlags.ExpandProjectExtents;\n\n if (BatchType.Primary === treeId.type) {\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\n flags |= TreeFlags.EnforceDisplayPriority;\n\n const edges = edgeOptionsToString(treeId.edges);\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\n idStr = `${idStr}${edges}${sectionCut}`;\n } else {\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\n\n if (BatchType.VolumeClassifier === treeId.type) {\n // Volume classifiers always use the exact project extents.\n flags |= TreeFlags.UseProjectExtents;\n flags &= ~TreeFlags.ExpandProjectExtents;\n }\n\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n }\n\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\n if (version >= 4) {\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\n idStr = prefix + idStr;\n }\n\n return idStr + modelId;\n}\n\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\n * @internal\n */\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\n let cmp = compareNumbers(lhs.type, rhs.type);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\n\n if (0 !== cmp)\n return cmp;\n\n // NB: The redundant checks on BatchType below are to satisfy compiler.\n assert(lhs.type === rhs.type);\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\n if (0 === cmp) {\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\n }\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\n }\n\n return cmp;\n}\n\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\n * @alpha\n */\nexport enum ContentFlags {\n None = 0,\n AllowInstancing = 1 << 0,\n ImprovedElision = 1 << 1,\n IgnoreAreaPatterns = 1 << 2,\n ExternalTextures = 1 << 3,\n}\n\n/** Describes the components of a tile's content Id.\n *\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\n *\n * The i, j, and k parameters specify how to subdivide the tile's volume. Each sub-division is performed along the longest axis of the\n * volume. The volume is first sub-divided based on `i`, then the result sub-divided based on `j`, and finally that result sub-divided\n * based on `k`.\n *\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\n * produce a higher-resolution tile for the same volume.\n * @internal\n */\ninterface ContentIdSpec {\n depth: number;\n i: number;\n j: number;\n k: number;\n multiplier: number;\n}\n\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\n * the major version of the tile format.\n * @internal\n */\nexport abstract class ContentIdProvider {\n public readonly majorFormatVersion: number;\n public readonly contentFlags: ContentFlags;\n\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\n this.majorFormatVersion = formatVersion;\n this.contentFlags = contentFlags;\n }\n\n public get rootContentId(): string {\n return this.computeId(0, 0, 0, 0, 1);\n }\n\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\n const lastSepPos = parentId.lastIndexOf(this._separator);\n assert(-1 !== lastSepPos);\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\n }\n\n public specFromId(id: string): ContentIdSpec {\n const parts = id.split(this._separator);\n const len = parts.length;\n assert(len >= 5);\n return {\n depth: parseInt(parts[len - 5], 16),\n i: parseInt(parts[len - 4], 16),\n j: parseInt(parts[len - 3], 16),\n k: parseInt(parts[len - 2], 16),\n multiplier: parseInt(parts[len - 1], 16),\n };\n }\n\n public idFromSpec(spec: ContentIdSpec): string {\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\n }\n\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\n const sep = this._separator;\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\n }\n\n protected abstract get _separator(): string;\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\n\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\n * not supply tiles of a format the front-end doesn't recognize.\n */\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\n assert(majorVersion > 0);\n assert(Math.floor(majorVersion) === majorVersion);\n switch (majorVersion) {\n case 0:\n case 1:\n return new ContentIdV1Provider(majorVersion);\n case 2:\n case 3:\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\n default:\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\n }\n }\n}\n\n/** The original (major version 1) tile format used a content Id scheme of the format\n * `depth/i/j/k/multiplier`.\n * @internal\n */\nclass ContentIdV1Provider extends ContentIdProvider {\n public constructor(majorVersion: number) {\n super(majorVersion, ContentFlags.None);\n }\n\n protected get _separator() { return \"/\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\n * @internal\n */\nclass ContentIdV2Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n super(majorVersion, flags);\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"_\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\n * Format: `-flags-depth-i-j-k-multiplier`.\n * @internal\n */\nclass ContentIdV4Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n if (options.enableImprovedElision)\n flags = flags | ContentFlags.ImprovedElision;\n\n if (options.ignoreAreaPatterns)\n flags = flags | ContentFlags.IgnoreAreaPatterns;\n\n if (options.enableExternalTextures)\n flags = flags | ContentFlags.ExternalTextures;\n\n super(majorVersion, flags);\n this._prefix = this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"-\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** @internal */\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y && diag.x > diag.z)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else if (diag.y > diag.z)\n pt.y = (range.low.y + range.high.y) / 2.0;\n else\n pt.z = (range.low.z + range.high.z) / 2.0;\n}\n\n/** @internal */\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else\n pt.y = (range.low.y + range.high.y) / 2.0;\n}\n\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\n * @internal\n */\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\n const emptyMask = tile.emptySubRangeMask;\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n const isEmpty = 0 !== (emptyMask & emptyBit);\n\n const range = tile.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n ranges.push({ range, isEmpty });\n }\n }\n }\n\n return ranges;\n}\n\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\n * @internal\n */\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\n let numEmpty = 0;\n const children: TileProps[] = [];\n\n // Leaf nodes have no children\n if (parent.isLeaf)\n return { children, numEmpty };\n\n // One child, same volume as parent, but higher-resolution.\n if (undefined !== parent.sizeMultiplier) {\n const sizeMultiplier = parent.sizeMultiplier * 2;\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\n children.push({\n contentId,\n range: parent.range,\n contentRange: parent.contentRange,\n sizeMultiplier,\n isLeaf: false,\n maximumSize: root.tileScreenSize,\n });\n\n return { children, numEmpty };\n }\n\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\n const parentSpec = idProvider.specFromId(parent.contentId);\n const childSpec: ContentIdSpec = { ...parentSpec };\n childSpec.depth = parentSpec.depth + 1;\n\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\n // Don't bother creating children or requesting content for such empty volumes.\n const emptyMask = parent.emptySubRangeMask;\n\n // Spatial tree range == project extents; content range == model range.\n // Trivially reject children whose ranges are entirely outside model range.\n let treeContentRange = root.contentRange;\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\n // Parent is wholly within model range - don't bother testing child ranges against it.\n treeContentRange = undefined;\n }\n\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n if (0 !== (emptyMask & emptyBit)) {\n // volume is known to contain no geometry.\n ++numEmpty;\n continue;\n }\n\n const range = parent.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\n // volume is within project extents but entirely outside model range\n ++numEmpty;\n continue;\n }\n\n childSpec.i = parentSpec.i * 2 + i;\n childSpec.j = parentSpec.j * 2 + j;\n childSpec.k = parentSpec.k * 2 + k;\n\n const childId = idProvider.idFromSpec(childSpec);\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\n }\n }\n }\n\n return { children, numEmpty };\n}\n\n/** @internal */\nexport interface TileContentDescription extends TileContentMetadata {\n readonly featureTableStartPos: number;\n}\n\n/** Deserializes tile content metadata.\n * @throws [[TileReadError]]\n * @internal\n * @deprecated in 4.0 - might be removed in next major version. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.\n */\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\n return decodeTileContentDescription({ stream, sizeMultiplier, is2d, options, isVolumeClassifier });\n}\n\n/** @internal */\nexport interface DecodeTileContentDescriptionArgs {\n stream: ByteStream;\n options: TileOptions;\n isVolumeClassifier?: boolean;\n is2d?: boolean;\n sizeMultiplier?: number;\n isLeaf?: boolean;\n}\n\n/** @internal */\nexport function decodeTileContentDescription(args: DecodeTileContentDescriptionArgs): TileContentDescription {\n const { stream, options } = args;\n const isVolumeClassifier = args.isVolumeClassifier ?? false;\n\n stream.reset();\n\n const header = new ImdlHeader(stream);\n if (!header.isValid)\n throw new TileReadError(TileReadStatus.InvalidHeader);\n else if (!header.isReadableVersion)\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\n\n // Skip the feature table.\n const featureTableStartPos = stream.curPos;\n const ftHeader = FeatureTableHeader.readFrom(stream);\n if (undefined === ftHeader)\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\n\n stream.curPos = featureTableStartPos + ftHeader.length;\n\n let sizeMultiplier = args.sizeMultiplier;\n let isLeaf = args.isLeaf;\n if (undefined === isLeaf) {\n // Determine subdivision based on header data.\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\n isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\n if (!isLeaf) {\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\n // can be adversely affected by quantization issues when zooming in closely.\n const maxLeafTolerance = 1.0;\n\n // Must sub-divide if tile explicitly specifies...\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\n canSkipSubdivision = canSkipSubdivision && !args.is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\n // ...or app specifies incomplete tiles must always be sub-divided.\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\n if (canSkipSubdivision) {\n const minElementsPerTile = 100;\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\n if (!containsCurves)\n isLeaf = true;\n else if (undefined === sizeMultiplier)\n sizeMultiplier = 1.0;\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\n sizeMultiplier = 1.0;\n }\n }\n }\n }\n\n return {\n featureTableStartPos,\n contentRange: header.contentRange,\n isLeaf,\n sizeMultiplier,\n emptySubRangeMask: header.emptySubRanges,\n };\n}\n\nconst scratchRangeDiagonal = new Vector3d();\n\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\n * @internal\n */\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\n if (tile.range.isNull)\n return 0;\n\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\n\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\n}\n\n/** Deserializes tile metadata.\n * @internal\n */\nexport class TileMetadataReader {\n private readonly _is2d: boolean;\n private readonly _isVolumeClassifier: boolean;\n private readonly _options: TileOptions;\n\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\n this._is2d = is2d;\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\n this._options = options;\n }\n\n /** Produce metadata from the specified tile content.\n * @throws [[TileReadError]]\n */\n public read(stream: ByteStream, props: TileProps): TileMetadata {\n const content = decodeTileContentDescription({\n stream,\n sizeMultiplier: props.sizeMultiplier,\n is2d: this._is2d,\n options: this._options,\n isVolumeClassifier: this._isVolumeClassifier,\n });\n\n return {\n contentRange: content.contentRange,\n isLeaf: content.isLeaf,\n sizeMultiplier: content.sizeMultiplier,\n emptySubRangeMask: content.emptySubRangeMask,\n range: Range3d.fromJSON(props.range),\n contentId: props.contentId,\n };\n }\n}\n"]}
|
|
@@ -58,11 +58,11 @@ export interface BackgroundMapProps {
|
|
|
58
58
|
export interface DeprecatedBackgroundMapProps {
|
|
59
59
|
/** Identifies the source of the map tiles. Currently supported providers are "BingProvider" and "MapBoxProvider".
|
|
60
60
|
* Default value: "BingProvider"
|
|
61
|
-
* @deprecated in 3.x.
|
|
61
|
+
* @deprecated in 3.x - might be removed in next major version. Use MapImageryProps.backgroundBase.
|
|
62
62
|
*/
|
|
63
63
|
providerName?: string;
|
|
64
64
|
/** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.
|
|
65
|
-
* @deprecated in 3.x.
|
|
65
|
+
* @deprecated in 3.x - might be removed in next major version. Use MapImageryProps.backgroundBase
|
|
66
66
|
*/
|
|
67
67
|
providerData?: {
|
|
68
68
|
/** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAuB,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAgB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAgED,SAAS,kBAAkB,CA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AAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,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 DisplayStyles\n */\n\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\n\n/** Describes the projection of the background map\n * @see [[BackgroundMapProps]]\n * @see [[DisplayStyleSettingsProps]]\n * @public\n * @extensions\n */\nexport enum GlobeMode {\n /** Display Earth as 3d ellipsoid */\n Ellipsoid = 0,\n /** Display Earth as plane. */\n Plane = 1,\n}\n\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\n * @public\n * @extensions\n */\nexport interface BackgroundMapProps {\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\n groundBias?: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\n * Default value: false.\n */\n transparency?: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n useDepthBuffer?: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n applyTerrain?: boolean;\n /** Properties associated with terrain display. */\n terrainSettings?: TerrainProps;\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\n globeMode?: GlobeMode;\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n nonLocatable?: boolean;\n /** A planar mask applied to the map geometry\n * @beta\n */\n planarClipMask?: PlanarClipMaskProps;\n\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\n providerName?: never;\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\n providerData?: never;\n}\n\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\n * @public\n * @extensions\n */\nexport interface DeprecatedBackgroundMapProps {\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\n * Default value: \"BingProvider\"\n * @deprecated in 3.x. use MapImageryProps.backgroundBase.\n */\n providerName?: string;\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\n * @deprecated in 3.x. use MapImageryProps.backgroundBase\n */\n providerData?: {\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\n mapType?: BackgroundMapType;\n };\n}\n\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\n * @public\n * @extensions\n */\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\n\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\n}\n\nfunction normalizeTransparency(trans?: number | false): number | false {\n if (\"number\" === typeof trans)\n return Math.min(1, Math.max(0, trans));\n\n return false;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\n * @public\n */\nexport class BackgroundMapSettings {\n /** Retained strictly for persistence. */\n private readonly _provider: BackgroundMapProvider;\n\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\n public readonly groundBias: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\n public readonly transparency: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n public readonly useDepthBuffer: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n public readonly applyTerrain: boolean;\n /** Settings associated with terrain display. */\n public readonly terrainSettings: TerrainSettings;\n /** Globe display mode. */\n public readonly globeMode: GlobeMode;\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\n * @beta\n */\n public readonly planarClipMask: PlanarClipMaskSettings;\n private readonly _locatable: boolean;\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n public get locatable(): boolean {\n // Handle legacy TerrainProps.nonLocatable:\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\n // - Otherwise, use BackgroundMapProps.nonLocatable.\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\n return false;\n\n return this._locatable;\n }\n\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\n\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\n this.groundBias = props.groundBias ?? 0;\n this.transparency = normalizeTransparency(props.transparency);\n this.useDepthBuffer = props.useDepthBuffer ?? false;\n this.applyTerrain = props.applyTerrain ?? false;\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\n this.globeMode = normalizeGlobeMode(props.globeMode);\n this._locatable = true !== props.nonLocatable;\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\n }\n\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\n * the iModel - otherwise, prefer [[fromJSON]].\n */\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\n return new this(json ?? {});\n }\n\n /** Construct from JSON, performing validation and applying default values for undefined fields.\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\n */\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\n return new BackgroundMapSettings(json ?? {});\n }\n\n /** Convert these settings to their in-memory JSON representation.\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\n */\n public toJSON(): BackgroundMapProps {\n const props: BackgroundMapProps = {};\n if (0 !== this.groundBias)\n props.groundBias = this.groundBias;\n if (this.applyTerrain)\n props.applyTerrain = true;\n if (false !== this.transparency)\n props.transparency = this.transparency;\n if (GlobeMode.Ellipsoid !== this.globeMode)\n props.globeMode = this.globeMode;\n if (this.useDepthBuffer)\n props.useDepthBuffer = true;\n if (!this._locatable)\n props.nonLocatable = true;\n\n const terrainSettings = this.terrainSettings.toJSON();\n for (const prop of Object.values(terrainSettings)) {\n if (undefined !== prop) {\n props.terrainSettings = terrainSettings;\n break;\n }\n }\n\n if (this.planarClipMask.isValid)\n props.planarClipMask = this.planarClipMask.toJSON();\n\n return props;\n }\n\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\n * the iModel - otherwise, prefer [[toJSON]].\n */\n public toPersistentJSON(): PersistentBackgroundMapProps {\n const props = this.toJSON() as PersistentBackgroundMapProps;\n\n // Preserve deprecated imagery provider properties.\n if (\"BingProvider\" !== this._provider.name)\n props.providerName = this._provider.name; // eslint-disable-line @typescript-eslint/no-deprecated\n if (BackgroundMapType.Hybrid !== this._provider.type)\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line @typescript-eslint/no-deprecated\n\n return props;\n }\n\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\n public equalsJSON(json?: BackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromJSON(json));\n }\n\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\n }\n\n /** Returns true if these settings are equivalent to `other`. */\n public equals(other: BackgroundMapSettings): boolean {\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\n }\n\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\n if (undefined === changedProps)\n return this;\n\n const props = {\n groundBias: changedProps.groundBias ?? this.groundBias,\n transparency: changedProps.transparency ?? this.transparency,\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\n globeMode: changedProps.globeMode ?? this.globeMode,\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\n providerName: this._provider.name,\n providerData: { mapType: this._provider.type },\n };\n\n return BackgroundMapSettings.fromPersistentJSON(props);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BackgroundMapSettings.js","sourceRoot":"","sources":["../../src/BackgroundMapSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAuB,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAgB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,oCAAoC;IACpC,mDAAa,CAAA;IACb,8BAA8B;IAC9B,2CAAS,CAAA;AACX,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAgED,SAAS,kBAAkB,CAAC,IAAgB;IAC1C,OAAO,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;AAC/D,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAsB;IACnD,IAAI,QAAQ,KAAK,OAAO,KAAK;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAChC,yCAAyC;IACxB,SAAS,CAAwB;IAElD,yDAAyD;IACzC,UAAU,CAAS;IACnC,2MAA2M;IAC3L,YAAY,CAAiB;IAC7C,+LAA+L;IAC/K,cAAc,CAAU;IACxC,0GAA0G;IAC1F,YAAY,CAAU;IACtC,gDAAgD;IAChC,eAAe,CAAkB;IACjD,0BAA0B;IACV,SAAS,CAAY;IACrC;;OAEG;IACa,cAAc,CAAyB;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ED;;;OAGG;IACI,KAAK,CAAC,YAAiC;QAC5C,IAAI,SAAS,KAAK,YAAY;YAC5B,OAAO,IAAI,CAAC;QAEd,MAAM,KAAK,GAAG;YACZ,UAAU,EAAE,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU;YACtD,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,cAAc,EAAE,YAAY,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc;YAClE,SAAS,EAAE,YAAY,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS;YACnD,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,UAAU;YAC3D,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;YACjJ,cAAc,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAC5I,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI;YACjC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;SAC/C,CAAC;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACzD,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 DisplayStyles\n */\n\nimport { BackgroundMapProvider, BackgroundMapType } from \"./BackgroundMapProvider\";\nimport { PlanarClipMaskProps, PlanarClipMaskSettings } from \"./PlanarClipMask\";\nimport { TerrainProps, TerrainSettings } from \"./TerrainSettings\";\n\n/** Describes the projection of the background map\n * @see [[BackgroundMapProps]]\n * @see [[DisplayStyleSettingsProps]]\n * @public\n * @extensions\n */\nexport enum GlobeMode {\n /** Display Earth as 3d ellipsoid */\n Ellipsoid = 0,\n /** Display Earth as plane. */\n Plane = 1,\n}\n\n/** In-memory JSON representation of a [[BackgroundMapSettings]].\n * @see [[PersistentBackgroundMapProps]] for the persistent JSON representation.\n * @public\n * @extensions\n */\nexport interface BackgroundMapProps {\n /** The elevation of the map in meters relative the WGS84 ellipsoid. Default value: 0. */\n groundBias?: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden.\n * Default value: false.\n */\n transparency?: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n useDepthBuffer?: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n applyTerrain?: boolean;\n /** Properties associated with terrain display. */\n terrainSettings?: TerrainProps;\n /** Globe Mode. Default value: GlobeMode.Ellipsoid */\n globeMode?: GlobeMode;\n /** If true, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n nonLocatable?: boolean;\n /** A planar mask applied to the map geometry\n * @beta\n */\n planarClipMask?: PlanarClipMaskProps;\n\n /** See [[DeprecatedBackgroundMapProps.providerName]]. */\n providerName?: never;\n /** See [[DeprecatedBackgroundMapProps.providerData]]. */\n providerData?: never;\n}\n\n/** Properties of [[PersistentBackgroundMapProps]] that have been deprecated, but are retained for backwards compatibility.\n * These properties are omitted from [[BackgroundMapProps]] as they are no longer part of the API, but are included in\n * [[PersistentBackgroundMapProps]] because they remain part of the persistence format.\n * @public\n * @extensions\n */\nexport interface DeprecatedBackgroundMapProps {\n /** Identifies the source of the map tiles. Currently supported providers are \"BingProvider\" and \"MapBoxProvider\".\n * Default value: \"BingProvider\"\n * @deprecated in 3.x - might be removed in next major version. Use MapImageryProps.backgroundBase.\n */\n providerName?: string;\n /** Options for customizing the tiles supplied by the provider. If undefined, default values of all members are used.\n * @deprecated in 3.x - might be removed in next major version. Use MapImageryProps.backgroundBase\n */\n providerData?: {\n /** The type of map graphics to request. Default value: BackgroundMapType.Hybrid. */\n mapType?: BackgroundMapType;\n };\n}\n\n/** Persistent JSON representation of a [[BackgroundMapSettings]].\n * @public\n * @extensions\n */\nexport type PersistentBackgroundMapProps = Omit<BackgroundMapProps, keyof DeprecatedBackgroundMapProps> & DeprecatedBackgroundMapProps;\n\nfunction normalizeGlobeMode(mode?: GlobeMode): GlobeMode {\n return GlobeMode.Plane === mode ? mode : GlobeMode.Ellipsoid;\n}\n\nfunction normalizeTransparency(trans?: number | false): number | false {\n if (\"number\" === typeof trans)\n return Math.min(1, Math.max(0, trans));\n\n return false;\n}\n\n/** As part of a [[DisplayStyleSettings]], controls aspects of how the background map is displayed.\n * @see [[DisplayStyleSettings.backgroundMap]] to query or change these settings for a display style.\n * @see [[MapImagerySettings]] to control the type of imagery applied to the background map.\n * @public\n */\nexport class BackgroundMapSettings {\n /** Retained strictly for persistence. */\n private readonly _provider: BackgroundMapProvider;\n\n /** Elevation in meters, relative to WGS84 Ellipsoid.. */\n public readonly groundBias: number;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\n public readonly transparency: number | false;\n /** If set to true, the map tiles will be rendered with depth, allowing them to obscure other geometry. Otherwise, they are always rendered behind all other geometry. Default value: false. */\n public readonly useDepthBuffer: boolean;\n /** If true, terrain heights will be applied to the map; otherwise the map will be rendered as a plane. */\n public readonly applyTerrain: boolean;\n /** Settings associated with terrain display. */\n public readonly terrainSettings: TerrainSettings;\n /** Globe display mode. */\n public readonly globeMode: GlobeMode;\n /** Planar Mask - used to mask the background map to avoid overlapping with other geometry\n * @beta\n */\n public readonly planarClipMask: PlanarClipMaskSettings;\n private readonly _locatable: boolean;\n /** If false, the map will be treated as non-locatable - i.e., tools will not interact with it. This is particularly useful when the map is transparent - it\n * allows the user to select elements that are behind the map.\n */\n public get locatable(): boolean {\n // Handle legacy TerrainProps.nonLocatable:\n // - If TerrainProps.nonLocatable=true and terrain is on, terrain is not locatable.\n // - Otherwise, use BackgroundMapProps.nonLocatable.\n if (this.applyTerrain && this.terrainSettings.nonLocatable)\n return false;\n\n return this._locatable;\n }\n\n /** If transparency is overridden, the transparency to apply; otherwise, undefined. */\n public get transparencyOverride(): number | undefined { return false !== this.transparency ? this.transparency : undefined; }\n\n private constructor(props: BackgroundMapProps | PersistentBackgroundMapProps) {\n this.groundBias = props.groundBias ?? 0;\n this.transparency = normalizeTransparency(props.transparency);\n this.useDepthBuffer = props.useDepthBuffer ?? false;\n this.applyTerrain = props.applyTerrain ?? false;\n this.terrainSettings = TerrainSettings.fromJSON(props.terrainSettings);\n this.globeMode = normalizeGlobeMode(props.globeMode);\n this._locatable = true !== props.nonLocatable;\n this.planarClipMask = PlanarClipMaskSettings.fromJSON(props.planarClipMask);\n this._provider = BackgroundMapProvider.fromBackgroundMapProps(props);\n }\n\n /** Create settings from their persistent representation. In general, this method should only be used when reading the settings directly from\n * the iModel - otherwise, prefer [[fromJSON]].\n */\n public static fromPersistentJSON(json?: PersistentBackgroundMapProps): BackgroundMapSettings {\n return new this(json ?? {});\n }\n\n /** Construct from JSON, performing validation and applying default values for undefined fields.\n * @see [[fromPersistentJSON]] if you are reading the settings directly from the iModel.\n */\n public static fromJSON(json?: BackgroundMapProps): BackgroundMapSettings {\n return new BackgroundMapSettings(json ?? {});\n }\n\n /** Convert these settings to their in-memory JSON representation.\n * @see [[toPersistentJSON]] if you intend to write the JSON directly to an iModel.\n */\n public toJSON(): BackgroundMapProps {\n const props: BackgroundMapProps = {};\n if (0 !== this.groundBias)\n props.groundBias = this.groundBias;\n if (this.applyTerrain)\n props.applyTerrain = true;\n if (false !== this.transparency)\n props.transparency = this.transparency;\n if (GlobeMode.Ellipsoid !== this.globeMode)\n props.globeMode = this.globeMode;\n if (this.useDepthBuffer)\n props.useDepthBuffer = true;\n if (!this._locatable)\n props.nonLocatable = true;\n\n const terrainSettings = this.terrainSettings.toJSON();\n for (const prop of Object.values(terrainSettings)) {\n if (undefined !== prop) {\n props.terrainSettings = terrainSettings;\n break;\n }\n }\n\n if (this.planarClipMask.isValid)\n props.planarClipMask = this.planarClipMask.toJSON();\n\n return props;\n }\n\n /** Convert these settings to their persistent representation. In general, this method should only be used when writing the settings directly to\n * the iModel - otherwise, prefer [[toJSON]].\n */\n public toPersistentJSON(): PersistentBackgroundMapProps {\n const props = this.toJSON() as PersistentBackgroundMapProps;\n\n // Preserve deprecated imagery provider properties.\n if (\"BingProvider\" !== this._provider.name)\n props.providerName = this._provider.name; // eslint-disable-line @typescript-eslint/no-deprecated\n if (BackgroundMapType.Hybrid !== this._provider.type)\n props.providerData = { mapType: this._provider.type }; // eslint-disable-line @typescript-eslint/no-deprecated\n\n return props;\n }\n\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\n public equalsJSON(json?: BackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromJSON(json));\n }\n\n /** Returns true if the persistent representation of these settings is equivalent to `json`. */\n public equalsPersistentJSON(json?: PersistentBackgroundMapProps): boolean {\n return this.equals(BackgroundMapSettings.fromPersistentJSON(json));\n }\n\n /** Returns true if these settings are equivalent to `other`. */\n public equals(other: BackgroundMapSettings): boolean {\n return this.groundBias === other.groundBias && this.useDepthBuffer === other.useDepthBuffer && this.transparency === other.transparency\n && this.globeMode === other.globeMode && this._locatable === other._locatable && this.applyTerrain === other.applyTerrain\n && this.terrainSettings.equals(other.terrainSettings) && this.planarClipMask.equals(other.planarClipMask)\n && this._provider.name === other._provider.name && this._provider.type === other._provider.type;\n }\n\n /** Create a copy of this BackgroundMapSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A BackgroundMapSettings with all of its properties set to match those of `this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: BackgroundMapProps): BackgroundMapSettings {\n if (undefined === changedProps)\n return this;\n\n const props = {\n groundBias: changedProps.groundBias ?? this.groundBias,\n transparency: changedProps.transparency ?? this.transparency,\n useDepthBuffer: changedProps.useDepthBuffer ?? this.useDepthBuffer,\n globeMode: changedProps.globeMode ?? this.globeMode,\n nonLocatable: changedProps.nonLocatable ?? !this._locatable,\n applyTerrain: changedProps.applyTerrain ?? this.applyTerrain,\n terrainSettings: changedProps.terrainSettings ? this.terrainSettings.clone(changedProps.terrainSettings).toJSON() : this.terrainSettings.toJSON(),\n planarClipMask: changedProps.planarClipMask ? this.planarClipMask.clone(changedProps.planarClipMask).toJSON() : this.planarClipMask.toJSON(),\n providerName: this._provider.name,\n providerData: { mapType: this._provider.type },\n };\n\n return BackgroundMapSettings.fromPersistentJSON(props);\n }\n}\n"]}
|
package/lib/esm/ClipStyle.d.ts
CHANGED
|
@@ -139,7 +139,7 @@ export declare class ClipStyle {
|
|
|
139
139
|
/** The default style, which overrides none of the view's settings. */
|
|
140
140
|
static readonly defaults: ClipStyle;
|
|
141
141
|
private constructor();
|
|
142
|
-
/** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */
|
|
142
|
+
/** @deprecated in 4.x - might be removed in next major version. Use [[create(style: ClipStyleCreateArgs]] */
|
|
143
143
|
static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;
|
|
144
144
|
/** Create a style from its components. */
|
|
145
145
|
static create(style: ClipStyleCreateArgs): ClipStyle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipStyle.d.ts","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":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,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { ViewFlagOverrides } from \"./ViewFlags\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { HiddenLine } from \"./HiddenLine\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\n * @see [[ClipStyleProps.cutStyle]].\n * @public\n * @extensions\n */\nexport interface CutStyleProps {\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\n viewflags?: ViewFlagOverrides;\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\n hiddenLine?: HiddenLine.SettingsProps;\n /** If defined, overrides aspects of the cut geometry's symbology. */\n appearance?: FeatureAppearanceProps;\n}\n\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\n * @public\n */\nexport class CutStyle {\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\n public readonly viewflags: Readonly<ViewFlagOverrides>;\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\n public readonly hiddenLine?: HiddenLine.Settings;\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\n public readonly appearance?: FeatureAppearance;\n\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\n public static readonly defaults = new CutStyle();\n\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\n this.viewflags = viewflags ?? {};\n if (hiddenLine && !hiddenLine.matchesDefaults)\n this.hiddenLine = hiddenLine;\n\n if (appearance && !appearance.matchesDefaults)\n this.appearance = appearance;\n }\n\n /** Create a CutStyle from its components. */\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\n return new CutStyle(viewflags, hiddenLine, appearance);\n\n return this.defaults;\n }\n\n public static fromJSON(props?: CutStyleProps): CutStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const viewflags = { ...props?.viewflags };\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\n\n return this.create(viewflags, hiddenLine, appearance);\n } else {\n return this.defaults;\n }\n }\n\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\n public toJSON(): CutStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: CutStyleProps = {};\n if (JsonUtils.isNonEmptyObject(this.viewflags))\n props.viewflags = this.viewflags;\n\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\n props.hiddenLine = this.hiddenLine?.toJSON();\n\n if (this.appearance && !this.appearance.matchesDefaults)\n props.appearance = this.appearance.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\n public get matchesDefaults(): boolean {\n if (this === CutStyle.defaults)\n return true;\n\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\n }\n}\n\n/** Wire format describing a [[ClipIntersectionStyle]].\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\n * @public\n * @extensions\n */\nexport interface ClipIntersectionStyleProps {\n /** Color to apply to intersection of geometry and clip planes, default white */\n color?: RgbColorProps;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n width?: number;\n}\n\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\n * @public\n * @extensions\n */\nexport class ClipIntersectionStyle {\n /** Color to apply to intersection of geometry and clip planes, default white */\n public readonly color: RgbColor;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n public readonly width: number;\n\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\n this.color = color;\n this.width = width;\n }\n /** Create a highlight from its components. */\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\n if (!color && !width)\n return this.defaults;\n\n return new ClipIntersectionStyle(color, width);\n }\n\n public static readonly defaults = new ClipIntersectionStyle();\n\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\n if (props === undefined) {\n return ClipIntersectionStyle.defaults;\n }\n\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\n const width = props.width ? props.width : 1;\n return new ClipIntersectionStyle(color, width);\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipIntersectionStyleProps | undefined {\n const props: ClipIntersectionStyleProps = {};\n\n if (this.matchesDefaults) {\n return undefined;\n }\n\n if (this.color)\n props.color = this.color.toJSON();\n\n if (this.width)\n props.width = this.width;\n\n return props;\n }\n\n public get matchesDefaults(): boolean {\n if (this === ClipIntersectionStyle.defaults)\n return true;\n\n return !this.color && !this.width;\n }\n}\n\n/** Arguments supplied to [[ClipStyle.create]].\n * @public\n * @extensions\n */\nexport interface ClipStyleCreateArgs {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If `true`, intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyle;\n}\n\n/** Wire format describing a [[ClipStyle]].\n * @see [[DisplayStyleSettingsProps.clipStyle]].\n * @public\n * @extensions\n */\nexport interface ClipStyleProps {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyleProps;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColorProps;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColorProps;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyleProps;\n}\n\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\n * @see [[DisplayStyleSettings.clipStyle]].\n * @public\n */\nexport class ClipStyle {\n /** If `true`, geometry will be produced at the clip planes.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n public readonly produceCutGeometry: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n public readonly colorizeIntersection: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n public readonly cutStyle: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n public readonly insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n public readonly outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n public readonly intersectionStyle?: ClipIntersectionStyle;\n\n /** The default style, which overrides none of the view's settings. */\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\n\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\n this.produceCutGeometry = produceCutGeometry;\n this.colorizeIntersection = colorizeIntersection;\n this.cutStyle = cutStyle;\n this.insideColor = inside;\n this.outsideColor = outside;\n this.intersectionStyle = intersectionStyle;\n }\n\n /** @deprecated in 4.x. Use [[create(style: ClipStyleCreateArgs]] */\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\n\n /** Create a style from its components. */\n public static create(style: ClipStyleCreateArgs): ClipStyle;\n\n /** @internal */\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\n\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\n\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\n return this.defaults;\n }\n\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\n }\n\n const style = styleOrProduceCutGeometry;\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\n return this.defaults;\n\n const produceCutGeometry = style.produceCutGeometry ? true : false;\n const colorizeIntersection = style.colorizeIntersection ? true : false;\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\n\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\n }\n\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const produceCutGeometry = props.produceCutGeometry ?? false;\n const colorizeIntersection = props.colorizeIntersection ? true : false;\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\n\n return this.create({produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle});\n }\n\n return this.defaults;\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: ClipStyleProps = {};\n if (this.produceCutGeometry)\n props.produceCutGeometry = true;\n\n if (this.colorizeIntersection)\n props.colorizeIntersection = true;\n\n const cutStyle = this.cutStyle.toJSON();\n if (cutStyle) {\n assert(!this.cutStyle.matchesDefaults);\n props.cutStyle = cutStyle;\n }\n\n if (this.insideColor)\n props.insideColor = this.insideColor.toJSON();\n\n if (this.outsideColor)\n props.outsideColor = this.outsideColor.toJSON();\n\n if (this.intersectionStyle)\n props.intersectionStyle = this.intersectionStyle.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\n public get matchesDefaults(): boolean {\n if (this === ClipStyle.defaults)\n return true;\n\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ClipStyle.js","sourceRoot":"","sources":["../../src/ClipStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAA0B,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAgBtC;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACnB,oGAAoG;IACpF,SAAS,CAA8B;IACvD,sGAAsG;IACtF,UAAU,CAAuB;IACjD,kFAAkF;IAClE,UAAU,CAAqB;IAE/C,sHAAsH;IAC/G,MAAM,CAAU,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAEjD,YAAoB,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC3H,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;QACjC,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE/B,IAAI,UAAU,IAAI,CAAC,UAAU,CAAC,eAAe;YAC3C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,MAAM,CAAC,SAAuC,EAAE,UAAgC,EAAE,UAA8B;QAC5H,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,UA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AAO,IAAI,CAAC;QAEd,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC;IACvK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Views\n */\n\nimport { assert, JsonUtils } from \"@itwin/core-bentley\";\nimport { ViewFlagOverrides } from \"./ViewFlags\";\nimport { RgbColor, RgbColorProps } from \"./RgbColor\";\nimport { HiddenLine } from \"./HiddenLine\";\nimport { FeatureAppearance, FeatureAppearanceProps } from \"./FeatureSymbology\";\nimport { ColorDef } from \"./ColorDef\";\n\n/** Wire format describing a [[CutStyle]] applied to section-cut geometry produced at intersections with a view's [ClipVector]($core-geometry).\n * @see [[ClipStyleProps.cutStyle]].\n * @public\n * @extensions\n */\nexport interface CutStyleProps {\n /** If defined, overrides aspects of the view's [[ViewFlags]] when drawing the cut geometry. */\n viewflags?: ViewFlagOverrides;\n /** If defined, overrides the view's [[HiddenLine.Settings]] when drawing the cut geometry. */\n hiddenLine?: HiddenLine.SettingsProps;\n /** If defined, overrides aspects of the cut geometry's symbology. */\n appearance?: FeatureAppearanceProps;\n}\n\n/** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.\n * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.\n * @public\n */\nexport class CutStyle {\n /** Selectively overrides some of the view's [[ViewFlags]] when drawing the section-cut graphics. */\n public readonly viewflags: Readonly<ViewFlagOverrides>;\n /** If defined, overrides the settings the view uses to draw the edges of the section-cut graphics. */\n public readonly hiddenLine?: HiddenLine.Settings;\n /** If defined, overrides aspects of the symbology of the section-cut graphics. */\n public readonly appearance?: FeatureAppearance;\n\n /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */\n public static readonly defaults = new CutStyle();\n\n private constructor(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance) {\n this.viewflags = viewflags ?? {};\n if (hiddenLine && !hiddenLine.matchesDefaults)\n this.hiddenLine = hiddenLine;\n\n if (appearance && !appearance.matchesDefaults)\n this.appearance = appearance;\n }\n\n /** Create a CutStyle from its components. */\n public static create(viewflags?: Readonly<ViewFlagOverrides>, hiddenLine?: HiddenLine.Settings, appearance?: FeatureAppearance): CutStyle {\n if ((viewflags && JsonUtils.isNonEmptyObject(viewflags)) || (hiddenLine && !hiddenLine.matchesDefaults) || (appearance && !appearance.matchesDefaults))\n return new CutStyle(viewflags, hiddenLine, appearance);\n\n return this.defaults;\n }\n\n public static fromJSON(props?: CutStyleProps): CutStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const viewflags = { ...props?.viewflags };\n const hiddenLine = props?.hiddenLine ? HiddenLine.Settings.fromJSON(props.hiddenLine) : undefined;\n const appearance = props?.appearance ? FeatureAppearance.fromJSON(props.appearance) : undefined;\n\n return this.create(viewflags, hiddenLine, appearance);\n } else {\n return this.defaults;\n }\n }\n\n /** Return JSON representation. The representation is `undefined` if this style matches the default style. */\n public toJSON(): CutStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: CutStyleProps = {};\n if (JsonUtils.isNonEmptyObject(this.viewflags))\n props.viewflags = this.viewflags;\n\n if (this.hiddenLine && !this.hiddenLine.matchesDefaults)\n props.hiddenLine = this.hiddenLine?.toJSON();\n\n if (this.appearance && !this.appearance.matchesDefaults)\n props.appearance = this.appearance.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the default style - that is, it overrides none of the view's settings. */\n public get matchesDefaults(): boolean {\n if (this === CutStyle.defaults)\n return true;\n\n return !JsonUtils.isNonEmptyObject(this.viewflags) && (!this.hiddenLine || this.hiddenLine.matchesDefaults) && (!this.appearance || this.appearance.matchesDefaults);\n }\n}\n\n/** Wire format describing a [[ClipIntersectionStyle]].\n * @see [[ClipStyleProps.ClipIntersectionStyle]].\n * @public\n * @extensions\n */\nexport interface ClipIntersectionStyleProps {\n /** Color to apply to intersection of geometry and clip planes, default white */\n color?: RgbColorProps;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n width?: number;\n}\n\n/** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.\n * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.\n * @public\n * @extensions\n */\nexport class ClipIntersectionStyle {\n /** Color to apply to intersection of geometry and clip planes, default white */\n public readonly color: RgbColor;\n /** Number of pixels to be considered intersecting the clip plane, default 1 */\n public readonly width: number;\n\n private constructor(color: RgbColor = RgbColor.fromColorDef(ColorDef.white), width: number = 1) {\n this.color = color;\n this.width = width;\n }\n /** Create a highlight from its components. */\n public static create(color?: RgbColor, width?: number): ClipIntersectionStyle {\n if (!color && !width)\n return this.defaults;\n\n return new ClipIntersectionStyle(color, width);\n }\n\n public static readonly defaults = new ClipIntersectionStyle();\n\n public static fromJSON(props?: ClipIntersectionStyleProps): ClipIntersectionStyle {\n if (props === undefined) {\n return ClipIntersectionStyle.defaults;\n }\n\n const color = props.color ? RgbColor.fromJSON(props.color) : RgbColor.fromColorDef(ColorDef.white);\n const width = props.width ? props.width : 1;\n return new ClipIntersectionStyle(color, width);\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipIntersectionStyleProps | undefined {\n const props: ClipIntersectionStyleProps = {};\n\n if (this.matchesDefaults) {\n return undefined;\n }\n\n if (this.color)\n props.color = this.color.toJSON();\n\n if (this.width)\n props.width = this.width;\n\n return props;\n }\n\n public get matchesDefaults(): boolean {\n if (this === ClipIntersectionStyle.defaults)\n return true;\n\n return !this.color && !this.width;\n }\n}\n\n/** Arguments supplied to [[ClipStyle.create]].\n * @public\n * @extensions\n */\nexport interface ClipStyleCreateArgs {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If `true`, intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyle;\n}\n\n/** Wire format describing a [[ClipStyle]].\n * @see [[DisplayStyleSettingsProps.clipStyle]].\n * @public\n * @extensions\n */\nexport interface ClipStyleProps {\n /** If `true`, geometry will be produced at the clip planes in a 3d view.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n produceCutGeometry?: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n colorizeIntersection?: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n cutStyle?: CutStyleProps;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n insideColor?: RgbColorProps;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n outsideColor?: RgbColorProps;\n /** Controls the style of the intersection of geometry and clip planes */\n intersectionStyle?: ClipIntersectionStyleProps;\n}\n\n/** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].\n * @see [[DisplayStyleSettings.clipStyle]].\n * @public\n */\nexport class ClipStyle {\n /** If `true`, geometry will be produced at the clip planes.\n * - Solids (closed volumes) will produce facets on the clip planes.\n * - Other surfaces will produce line strings representing the edges of the surface at the clip planes.\n * @note Cut geometry will only be produced for element geometry - not for, e.g., terrain or reality models.\n */\n public readonly produceCutGeometry: boolean;\n /** If 'true', intersection of geometry and clip planes will be colorized */\n public readonly colorizeIntersection: boolean;\n /** Controls aspects of how the cut geometry is displayed, if [[produceCutGeometry]] is `true`. */\n public readonly cutStyle: CutStyle;\n /** If defined, geometry inside the clip planes will be drawn in this color. */\n public readonly insideColor?: RgbColor;\n /** If defined, geometry outside of the clip planes will be drawn in this color instead of being clipped. */\n public readonly outsideColor?: RgbColor;\n /** Controls the style of the intersection of geometry and clip planes */\n public readonly intersectionStyle?: ClipIntersectionStyle;\n\n /** The default style, which overrides none of the view's settings. */\n public static readonly defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);\n\n private constructor(produceCutGeometry: boolean, colorizeIntersection: boolean, cutStyle: CutStyle, inside: RgbColor | undefined, outside: RgbColor | undefined, intersectionStyle: ClipIntersectionStyle | undefined) {\n this.produceCutGeometry = produceCutGeometry;\n this.colorizeIntersection = colorizeIntersection;\n this.cutStyle = cutStyle;\n this.insideColor = inside;\n this.outsideColor = outside;\n this.intersectionStyle = intersectionStyle;\n }\n\n /** @deprecated in 4.x - might be removed in next major version. Use [[create(style: ClipStyleCreateArgs]] */\n public static create(produceCutGeometry: boolean, cutStyle: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle;\n\n /** Create a style from its components. */\n public static create(style: ClipStyleCreateArgs): ClipStyle;\n\n /** @internal */\n public static create(styleOrProduceCutGeometry: ClipStyleCreateArgs | boolean, cutStyle?: CutStyle, insideColor?: RgbColor, outsideColor?: RgbColor): ClipStyle {\n\n if (typeof styleOrProduceCutGeometry === \"boolean\") {\n cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;\n\n if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {\n return this.defaults;\n }\n\n return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);\n }\n\n const style = styleOrProduceCutGeometry;\n if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)\n return this.defaults;\n\n const produceCutGeometry = style.produceCutGeometry ? true : false;\n const colorizeIntersection = style.colorizeIntersection ? true : false;\n cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;\n\n return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);\n }\n\n public static fromJSON(props?: ClipStyleProps): ClipStyle {\n if (JsonUtils.isNonEmptyObject(props)) {\n const produceCutGeometry = props.produceCutGeometry ?? false;\n const colorizeIntersection = props.colorizeIntersection ? true : false;\n const cutStyle = CutStyle.fromJSON(props.cutStyle);\n const insideColor = props.insideColor ? RgbColor.fromJSON(props.insideColor) : undefined;\n const outsideColor = props.outsideColor ? RgbColor.fromJSON(props.outsideColor) : undefined;\n const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;\n\n return this.create({ produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle });\n }\n\n return this.defaults;\n }\n\n /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */\n public toJSON(): ClipStyleProps | undefined {\n if (this.matchesDefaults)\n return undefined;\n\n const props: ClipStyleProps = {};\n if (this.produceCutGeometry)\n props.produceCutGeometry = true;\n\n if (this.colorizeIntersection)\n props.colorizeIntersection = true;\n\n const cutStyle = this.cutStyle.toJSON();\n if (cutStyle) {\n assert(!this.cutStyle.matchesDefaults);\n props.cutStyle = cutStyle;\n }\n\n if (this.insideColor)\n props.insideColor = this.insideColor.toJSON();\n\n if (this.outsideColor)\n props.outsideColor = this.outsideColor.toJSON();\n\n if (this.intersectionStyle)\n props.intersectionStyle = this.intersectionStyle.toJSON();\n\n return props;\n }\n\n /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */\n public get matchesDefaults(): boolean {\n if (this === ClipStyle.defaults)\n return true;\n\n return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;\n }\n}\n"]}
|
|
@@ -55,7 +55,7 @@ export interface QueryPropertyMetaData {
|
|
|
55
55
|
/** The name is the property's alias if the property is a generated one, otherwise, it is the name of the property. */
|
|
56
56
|
name: string;
|
|
57
57
|
/** If this property is a PrimitiveECProperty, extend type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extend type is set to an empty string.
|
|
58
|
-
* @deprecated in 4.11 Use extendedType instead
|
|
58
|
+
* @deprecated in 4.11 - might be removed in next major version. Use extendedType instead
|
|
59
59
|
*/
|
|
60
60
|
extendType: string;
|
|
61
61
|
/** If this property is a PrimitiveECProperty, extended type is the extended type name of this property, if it is not defined locally will be inherited from base property if one exists, otherwise extended type will be undefined. */
|
|
@@ -133,7 +133,7 @@ export interface QueryOptions extends BaseReaderOptions {
|
|
|
133
133
|
/**
|
|
134
134
|
* Convert ECClassId, SourceECClassId, TargetECClassId and RelClassId to respective name.
|
|
135
135
|
* When true, XXXXClassId property will be returned as className.
|
|
136
|
-
* @deprecated in 4.11 Use ecsql function ec_classname to get class name instead.
|
|
136
|
+
* @deprecated in 4.11 - might be removed in next major version. Use ecsql function ec_classname to get class name instead.
|
|
137
137
|
* */
|
|
138
138
|
convertClassIdsToClassNames?: boolean;
|
|
139
139
|
/**
|
|
@@ -194,7 +194,7 @@ export declare class QueryOptionsBuilder {
|
|
|
194
194
|
* If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.
|
|
195
195
|
* @param val A boolean value.
|
|
196
196
|
* @returns @type QueryOptionsBuilder for fluent interface.
|
|
197
|
-
* @deprecated in 4.11 Use ecsql function ec_classname to get class name instead.
|
|
197
|
+
* @deprecated in 4.11 - might be removed in next major version. Use ecsql function ec_classname to get class name instead.
|
|
198
198
|
*/
|
|
199
199
|
setConvertClassIdsToNames(val: boolean): this;
|
|
200
200
|
/**
|
|
@@ -98,7 +98,7 @@ export class QueryOptionsBuilder {
|
|
|
98
98
|
* If set ECClassId, SourceECClassId and TargetECClassId system properties will return qualified name of class instead of a @typedef Id64String.
|
|
99
99
|
* @param val A boolean value.
|
|
100
100
|
* @returns @type QueryOptionsBuilder for fluent interface.
|
|
101
|
-
* @deprecated in 4.11 Use ecsql function ec_classname to get class name instead.
|
|
101
|
+
* @deprecated in 4.11 - might be removed in next major version. Use ecsql function ec_classname to get class name instead.
|
|
102
102
|
*/
|
|
103
103
|
setConvertClassIdsToNames(val) {
|
|
104
104
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|