@itwin/core-common 3.2.0-dev.72 → 3.2.0-dev.76
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/HiddenLine.d.ts +12 -17
- package/lib/cjs/HiddenLine.d.ts.map +1 -1
- package/lib/cjs/HiddenLine.js +6 -2
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.d.ts +1 -0
- package/lib/cjs/rpc/web/RpcMultipart.d.ts.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts +1 -0
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/cjs/tile/ElementGraphics.d.ts +8 -2
- package/lib/cjs/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +18 -13
- package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +164 -134
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/HiddenLine.d.ts +12 -17
- package/lib/esm/HiddenLine.d.ts.map +1 -1
- package/lib/esm/HiddenLine.js +6 -2
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.d.ts +1 -0
- package/lib/esm/rpc/web/RpcMultipart.d.ts.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts +1 -0
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.d.ts.map +1 -1
- package/lib/esm/tile/ElementGraphics.d.ts +8 -2
- package/lib/esm/tile/ElementGraphics.d.ts.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +18 -13
- package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
- package/lib/esm/tile/TileMetadata.js +163 -133
- package/lib/esm/tile/TileMetadata.js.map +1 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CAAC,cAAc,GAAG,SAAS,CAAC,2BAA2B,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC;AATD,8DASC;AAED;;GAEG;AACH,MAAa,kBAAkB;IAK7B,YAAmB,IAAe,EAAE,IAAa,EAAE,OAAoB;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,mBAAmB,GAAG,wBAAS,CAAC,gBAAgB,KAAK,IAAI,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;OAEG;IACI,IAAI,CAAC,MAAkB,EAAE,KAAgB;QAC9C,MAAM,OAAO,GAAG,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC9H,OAAO;YACL,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,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;AAzBD,gDAyBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport {\r\n assert, ByteStream, compareBooleansOrUndefined, compareNumbers, compareStringsOrUndefined, Id64, Id64String,\r\n} from \"@itwin/core-bentley\";\r\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { BatchType } from \"../FeatureTable\";\r\nimport { TileProps } from \"../TileProps\";\r\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\r\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\r\n\r\n// cspell:ignore imdl mult bitfield\r\n\r\n// NB: These constants correspond to those defined in Tile.cpp.\r\nnamespace Constants {\r\n export const minToleranceRatioMultiplier = 2;\r\n}\r\n\r\n/** Describes an iModel tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeMetadata {\r\n readonly modelId: Id64String;\r\n readonly is2d: boolean;\r\n readonly contentRange?: Range3d;\r\n readonly tileScreenSize: number;\r\n}\r\n\r\n/** Describes the contents of an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileContentMetadata {\r\n readonly contentRange: Range3d;\r\n readonly isLeaf: boolean;\r\n readonly sizeMultiplier?: number;\r\n readonly emptySubRangeMask: number;\r\n}\r\n\r\n/** Describes an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileMetadata extends TileContentMetadata {\r\n readonly contentId: string;\r\n readonly range: Range3d;\r\n}\r\n\r\n/** @internal */\r\nexport interface TileOptions {\r\n readonly maximumMajorTileFormatVersion: number;\r\n readonly enableInstancing: boolean;\r\n readonly enableImprovedElision: boolean;\r\n readonly ignoreAreaPatterns: boolean;\r\n readonly enableExternalTextures: boolean;\r\n readonly useProjectExtents: boolean;\r\n readonly optimizeBRepProcessing: boolean;\r\n readonly useLargerTiles: boolean;\r\n readonly disableMagnification: boolean;\r\n readonly alwaysSubdivideIncompleteTiles: boolean;\r\n readonly enableIndexedEdges: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport namespace TileOptions {\r\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\r\n * compute the [[TileOptions]] that were used to generate the Ids.\r\n * @throws Error if `treeId` or `contentId` are not valid Ids.\r\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.\r\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\r\n */\r\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\r\n const tree = treeFlagsAndFormatVersionFromId(treeId);\r\n const contentFlags = contentFlagsFromId(contentId);\r\n\r\n return {\r\n maximumMajorTileFormatVersion: tree.version,\r\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\r\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\r\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\r\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\r\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\r\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\r\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: true,\r\n };\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): { modelId: Id64String, treeId: IModelTileTreeId, contentId: ContentIdSpec, options: TileOptions } {\r\n let idx = 0;\r\n let type: BatchType,\r\n expansion: number | undefined,\r\n animationId: string | undefined,\r\n edges: EdgeType | undefined,\r\n sectionCut: string | undefined;\r\n\r\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\r\n while (idx < treeId.length && treeId[idx] !== \"-\")\r\n idx++;\r\n idx++; // -\r\n if (idx >= treeId.length)\r\n throw new Error(\"Invalid tree Id\");\r\n\r\n if (treeId[idx] === \"C\") {\r\n // PlanarClassifier or VolumeClassifier\r\n ({ idx, type, expansion } = parseClassifier(idx, treeId, expansion));\r\n } else {\r\n type = BatchType.Primary;\r\n }\r\n\r\n // Animation\r\n // eslint-disable-next-line prefer-const\r\n ({ idx, animationId } = parseAnimation(idx, treeId, animationId));\r\n\r\n if (type === BatchType.Primary) {\r\n ({ idx, edges, sectionCut } = parsePrimary(idx, treeId, edges, sectionCut));\r\n }\r\n\r\n const modelId = treeId.substr(idx);\r\n if (!Id64.isId64(modelId))\r\n throw new Error(\"Invalid tree Id\");\r\n\r\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(treeId);\r\n const parsedTreeId = getTreeId(type, edges, sectionCut, animationId, expansion, (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined);\r\n const options = TileOptions.fromTreeIdAndContentId(treeId, contentId);\r\n\r\n let parsedContentId: ContentIdSpec;\r\n try {\r\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\r\n } catch (e) {\r\n throw new Error(\"Invalid content Id\");\r\n }\r\n\r\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\r\n throw new Error(\"Invalid content Id\");\r\n\r\n return {\r\n contentId: parsedContentId,\r\n modelId,\r\n options,\r\n treeId: parsedTreeId,\r\n };\r\n}\r\n\r\nfunction getTreeId(type: BatchType, edges?: EdgeType, sectionCut?: string, animationId?: string, expansion?: number, enforceDisplayPriority?: boolean): IModelTileTreeId {\r\n if (type === BatchType.Primary)\r\n return {\r\n type,\r\n edges,\r\n sectionCut,\r\n animationId,\r\n enforceDisplayPriority,\r\n } as PrimaryTileTreeId;\r\n else\r\n return {\r\n type,\r\n expansion,\r\n animationId,\r\n } as ClassifierTileTreeId;\r\n}\r\n\r\nfunction parsePrimary(idx: number, treeId: string, edges: EdgeType = EdgeType.None, sectionCut: string | undefined) {\r\n // Edges\r\n edges = EdgeType.NonIndexed;\r\n if (idx < treeId.length ) {\r\n const noEdgesStr = \"E:0_\";\r\n if (treeId.startsWith(noEdgesStr, idx))\r\n edges = EdgeType.None;\r\n else if (treeId.startsWith(\"E:2_\", idx))\r\n edges = EdgeType.Indexed;\r\n\r\n if (EdgeType.NonIndexed !== edges)\r\n idx += noEdgesStr.length;\r\n }\r\n\r\n // Section cut\r\n if (idx + 1 < treeId.length && treeId[idx] === \"S\") {\r\n idx++; // S\r\n sectionCut = \"\";\r\n while (idx < treeId.length && treeId[idx] !== \"s\") {\r\n sectionCut += treeId[idx++];\r\n }\r\n if (idx === treeId.length)\r\n throw new Error(\"Invalid tree Id\");\r\n idx++; // s\r\n }\r\n return { idx, edges, sectionCut };\r\n}\r\n\r\nfunction parseClassifier(idx: number, treeId: string, expansion: number | undefined) {\r\n let type: BatchType;\r\n idx++; // C\r\n if (idx + 1 < treeId.length && treeId[idx] === \"P\" && treeId[idx + 1] === \":\") {\r\n type = BatchType.PlanarClassifier;\r\n idx += 2; // P:\r\n } else if (idx < treeId.length && treeId[idx] === \":\") {\r\n type = BatchType.VolumeClassifier;\r\n idx++; // :\r\n } else {\r\n throw new Error(\"Invalid tree Id\");\r\n }\r\n\r\n // C: or CP: is always followed by {expansion}_\r\n let expansionStr = \"\";\r\n while (idx < treeId.length && (treeId[idx] >= \"0\" && treeId[idx] <= \"9\" || treeId[idx] === \".\")) {\r\n expansionStr += treeId[idx++];\r\n }\r\n\r\n if (idx === treeId.length || treeId[idx] !== \"_\")\r\n throw new Error(\"Invalid tree Id\");\r\n idx++; // _\r\n\r\n expansion = Number.parseFloat(expansionStr);\r\n return { idx, type, expansion };\r\n}\r\n\r\nfunction parseAnimation(idx: number, treeId: string, animationId: string | undefined) {\r\n if (idx < treeId.length && treeId[idx] === \"A\") {\r\n if (idx + 1 < treeId.length && treeId[idx + 1] !== \":\")\r\n throw new Error(\"Invalid tree Id\");\r\n idx += 2;\r\n\r\n // Parse animation id\r\n animationId = \"\";\r\n while (idx < treeId.length && treeId[idx] !== \"_\") {\r\n animationId += treeId[idx++];\r\n }\r\n\r\n if (!Id64.isId64(animationId) || idx === treeId.length)\r\n throw new Error(\"Invalid tree Id\");\r\n idx++; // _\r\n }\r\n\r\n return { idx, animationId };\r\n}\r\n\r\n/** @internal */\r\nexport const defaultTileOptions: TileOptions = Object.freeze({\r\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\r\n enableInstancing: true,\r\n enableImprovedElision: true,\r\n ignoreAreaPatterns: false,\r\n enableExternalTextures: true,\r\n useProjectExtents: true,\r\n optimizeBRepProcessing: true,\r\n useLargerTiles: true,\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: true,\r\n});\r\n\r\nfunction contentFlagsFromId(id: string): ContentFlags {\r\n if (0 === id.length || \"-\" !== id[0])\r\n throw new Error(\"Invalid content Id\");\r\n\r\n // V4: -flags-d-i-j-k-m - version in tree Id\r\n const end = id.indexOf(\"-\", 1);\r\n if (-1 !== end) {\r\n const flags = Number.parseInt(id.substring(1, end), 16);\r\n if (!Number.isNaN(flags))\r\n return flags;\r\n }\r\n\r\n throw new Error(\"Invalid content Id\");\r\n}\r\n\r\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\r\n if (0 === id.length)\r\n throw new Error(\"Invalid tree Id\");\r\n\r\n let parts = id.split(\"-\");\r\n if (parts.length > 0) {\r\n parts = parts[0].split(\"_\");\r\n if (parts.length === 2) {\r\n const version = Number.parseInt(parts[0], 16);\r\n const flags = Number.parseInt(parts[1], 16);\r\n if (!Number.isNaN(version) || !Number.isNaN(flags))\r\n return { version, flags };\r\n }\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\n/** @internal */\r\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\r\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\r\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\r\n // to that optionally configured by the app.\r\n let majorVersion = maxMajorVersion;\r\n if (undefined !== formatVersion)\r\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\r\n\r\n // Version number less than 1 is invalid - ignore\r\n majorVersion = Math.max(majorVersion, 1);\r\n\r\n // Version number greater than current known version ignored\r\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\r\n\r\n // Version numbers are integers - round down\r\n return Math.max(Math.floor(majorVersion), 1);\r\n}\r\n\r\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\r\n * @alpha\r\n */\r\nexport enum TreeFlags {\r\n None = 0,\r\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\r\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\r\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\r\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\r\n}\r\n\r\n/** Describes the type of edges to include in the graphics for a tile tree.\r\n * @alpha\r\n */\r\nexport enum EdgeType {\r\n /** Omit all edges. */\r\n None = 0,\r\n /** Include non-indexed edges, which consume more memory and are less efficient to draw than [[Indexed]] edges, but are compatible with WebGL 1. */\r\n NonIndexed = 1,\r\n /** Include indexed edges, which use less memory and draw more efficiently than [[NonIndexed]] edges, but require WebGL 2. */\r\n Indexed = 2,\r\n}\r\n\r\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\r\n * @internal\r\n */\r\nexport interface PrimaryTileTreeId {\r\n /** Describes the type of tile tree. */\r\n type: BatchType.Primary;\r\n /** The type of edges to include in tile content. */\r\n edges: EdgeType;\r\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\r\n animationId?: Id64String;\r\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\r\n * for ensuring the graphics display with correct priority.\r\n */\r\n enforceDisplayPriority?: boolean;\r\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.\r\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString[($core-geometry).\r\n */\r\n sectionCut?: string;\r\n}\r\n\r\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\r\n * @internal\r\n */\r\nexport interface ClassifierTileTreeId {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n animationId?: Id64String;\r\n}\r\n\r\nfunction animationIdToString(animationId: Id64String): string {\r\n return `A:${animationId}_`;\r\n}\r\n\r\n/** Describes the Id of an iModel tile tree.\r\n * @internal\r\n */\r\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\r\n\r\n/** Convert a tile tree Id to its string representation.\r\n * @internal\r\n */\r\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\r\n let idStr = \"\";\r\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\r\n if (options.optimizeBRepProcessing)\r\n flags |= TreeFlags.OptimizeBRepProcessing;\r\n\r\n if (options.useLargerTiles)\r\n flags |= TreeFlags.UseLargerTiles;\r\n\r\n if (BatchType.Primary === treeId.type) {\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\r\n flags |= TreeFlags.EnforceDisplayPriority;\r\n\r\n const edges = treeId.edges !== EdgeType.NonIndexed ? `E:${treeId.edges}_` : \"\";\r\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\r\n idStr = `${idStr}${edges}${sectionCut}`;\r\n } else {\r\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\r\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\r\n\r\n if (BatchType.VolumeClassifier === treeId.type)\r\n flags |= TreeFlags.UseProjectExtents;\r\n\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n }\r\n\r\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\r\n if (version >= 4) {\r\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\r\n idStr = prefix + idStr;\r\n }\r\n\r\n return idStr + modelId;\r\n}\r\n\r\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\r\n * @internal\r\n */\r\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\r\n let cmp = compareNumbers(lhs.type, rhs.type);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\r\n\r\n if (0 !== cmp)\r\n return cmp;\r\n\r\n // NB: The redundant checks on BatchType below are to satisfy compiler.\r\n assert(lhs.type === rhs.type);\r\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\r\n cmp = compareNumbers(lhs.edges, rhs.edges);\r\n if (0 === cmp) {\r\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\r\n }\r\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\r\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\r\n }\r\n\r\n return cmp;\r\n}\r\n\r\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\r\n * @alpha\r\n */\r\nexport enum ContentFlags {\r\n None = 0,\r\n AllowInstancing = 1 << 0,\r\n ImprovedElision = 1 << 1,\r\n IgnoreAreaPatterns = 1 << 2,\r\n ExternalTextures = 1 << 3,\r\n}\r\n\r\n/** Describes the components of a tile's content Id.\r\n *\r\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\r\n *\r\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\r\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\r\n * based on `k`.\r\n *\r\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\r\n * produce a higher-resolution tile for the same volume.\r\n * @internal\r\n */\r\ninterface ContentIdSpec {\r\n depth: number;\r\n i: number;\r\n j: number;\r\n k: number;\r\n multiplier: number;\r\n}\r\n\r\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\r\n * the major version of the tile format.\r\n * @internal\r\n */\r\nexport abstract class ContentIdProvider {\r\n public readonly majorFormatVersion: number;\r\n public readonly contentFlags: ContentFlags;\r\n\r\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\r\n this.majorFormatVersion = formatVersion;\r\n this.contentFlags = contentFlags;\r\n }\r\n\r\n public get rootContentId(): string {\r\n return this.computeId(0, 0, 0, 0, 1);\r\n }\r\n\r\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\r\n const lastSepPos = parentId.lastIndexOf(this._separator);\r\n assert(-1 !== lastSepPos);\r\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\r\n }\r\n\r\n public specFromId(id: string): ContentIdSpec {\r\n const parts = id.split(this._separator);\r\n const len = parts.length;\r\n assert(len >= 5);\r\n return {\r\n depth: parseInt(parts[len - 5], 16),\r\n i: parseInt(parts[len - 4], 16),\r\n j: parseInt(parts[len - 3], 16),\r\n k: parseInt(parts[len - 2], 16),\r\n multiplier: parseInt(parts[len - 1], 16),\r\n };\r\n }\r\n\r\n public idFromSpec(spec: ContentIdSpec): string {\r\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\r\n }\r\n\r\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\r\n const sep = this._separator;\r\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\r\n }\r\n\r\n protected abstract get _separator(): string;\r\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\r\n\r\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\r\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\r\n * not supply tiles of a format the front-end doesn't recognize.\r\n */\r\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\r\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\r\n assert(majorVersion > 0);\r\n assert(Math.floor(majorVersion) === majorVersion);\r\n switch (majorVersion) {\r\n case 0:\r\n case 1:\r\n return new ContentIdV1Provider(majorVersion);\r\n case 2:\r\n case 3:\r\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\r\n default:\r\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\r\n }\r\n }\r\n}\r\n\r\n/** The original (major version 1) tile format used a content Id scheme of the format\r\n * `depth/i/j/k/multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV1Provider extends ContentIdProvider {\r\n public constructor(majorVersion: number) {\r\n super(majorVersion, ContentFlags.None);\r\n }\r\n\r\n protected get _separator() { return \"/\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\r\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV2Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\r\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"_\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\r\n * Format: `-flags-depth-i-j-k-multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV4Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\r\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n if (options.enableImprovedElision)\r\n flags = flags | ContentFlags.ImprovedElision;\r\n\r\n if (options.ignoreAreaPatterns)\r\n flags = flags | ContentFlags.IgnoreAreaPatterns;\r\n\r\n if (options.enableExternalTextures)\r\n flags = flags | ContentFlags.ExternalTextures;\r\n\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"-\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y && diag.x > diag.z)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else if (diag.y > diag.z)\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n else\r\n pt.z = (range.low.z + range.high.z) / 2.0;\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n}\r\n\r\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\r\n * @internal\r\n */\r\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\r\n const emptyMask = tile.emptySubRangeMask;\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n\r\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n const isEmpty = 0 !== (emptyMask & emptyBit);\r\n\r\n const range = tile.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n ranges.push({ range, isEmpty });\r\n }\r\n }\r\n }\r\n\r\n return ranges;\r\n}\r\n\r\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\r\n * @internal\r\n */\r\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\r\n let numEmpty = 0;\r\n const children: TileProps[] = [];\r\n\r\n // Leaf nodes have no children\r\n if (parent.isLeaf)\r\n return { children, numEmpty };\r\n\r\n // One child, same volume as parent, but higher-resolution.\r\n if (undefined !== parent.sizeMultiplier) {\r\n const sizeMultiplier = parent.sizeMultiplier * 2;\r\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\r\n children.push({\r\n contentId,\r\n range: parent.range,\r\n contentRange: parent.contentRange,\r\n sizeMultiplier,\r\n isLeaf: false,\r\n maximumSize: root.tileScreenSize,\r\n });\r\n\r\n return { children, numEmpty };\r\n }\r\n\r\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\r\n const parentSpec = idProvider.specFromId(parent.contentId);\r\n const childSpec: ContentIdSpec = { ...parentSpec };\r\n childSpec.depth = parentSpec.depth + 1;\r\n\r\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\r\n // Don't bother creating children or requesting content for such empty volumes.\r\n const emptyMask = parent.emptySubRangeMask;\r\n\r\n // Spatial tree range == project extents; content range == model range.\r\n // Trivially reject children whose ranges are entirely outside model range.\r\n let treeContentRange = root.contentRange;\r\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\r\n // Parent is wholly within model range - don't bother testing child ranges against it.\r\n treeContentRange = undefined;\r\n }\r\n\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n if (0 !== (emptyMask & emptyBit)) {\r\n // volume is known to contain no geometry.\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n const range = parent.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\r\n // volume is within project extents but entirely outside model range\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n childSpec.i = parentSpec.i * 2 + i;\r\n childSpec.j = parentSpec.j * 2 + j;\r\n childSpec.k = parentSpec.k * 2 + k;\r\n\r\n const childId = idProvider.idFromSpec(childSpec);\r\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\r\n }\r\n }\r\n }\r\n\r\n return { children, numEmpty };\r\n}\r\n\r\n/** @internal */\r\nexport interface TileContentDescription extends TileContentMetadata {\r\n readonly featureTableStartPos: number;\r\n}\r\n\r\n/** Deserializes tile content metadata.\r\n * @throws [[TileReadError]]\r\n * @internal\r\n */\r\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\r\n stream.reset();\r\n\r\n const header = new ImdlHeader(stream);\r\n if (!header.isValid)\r\n throw new TileReadError(TileReadStatus.InvalidHeader);\r\n else if (!header.isReadableVersion)\r\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\r\n\r\n // Skip the feature table.\r\n const featureTableStartPos = stream.curPos;\r\n const ftHeader = FeatureTableHeader.readFrom(stream);\r\n if (undefined === ftHeader)\r\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\r\n\r\n stream.curPos = featureTableStartPos + ftHeader.length;\r\n\r\n // Determine subdivision based on header data.\r\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\r\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\r\n let isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\r\n if (!isLeaf) {\r\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\r\n // can be adversely affected by quantization issues when zooming in closely.\r\n const maxLeafTolerance = 1.0;\r\n\r\n // Must sub-divide if tile explicitly specifies...\r\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\r\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\r\n canSkipSubdivision = canSkipSubdivision && !is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\r\n // ...or app specifies incomplete tiles must always be sub-divided.\r\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\r\n if (canSkipSubdivision) {\r\n const minElementsPerTile = 100;\r\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\r\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\r\n if (!containsCurves)\r\n isLeaf = true;\r\n else if (undefined === sizeMultiplier)\r\n sizeMultiplier = 1.0;\r\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\r\n sizeMultiplier = 1.0;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n featureTableStartPos,\r\n contentRange: header.contentRange,\r\n isLeaf,\r\n sizeMultiplier,\r\n emptySubRangeMask: header.emptySubRanges,\r\n };\r\n}\r\n\r\nconst scratchRangeDiagonal = new Vector3d();\r\n\r\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\r\n * @internal\r\n */\r\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\r\n if (tile.range.isNull)\r\n return 0;\r\n\r\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\r\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\r\n\r\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\r\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\r\n}\r\n\r\n/** Deserializes tile metadata.\r\n * @internal\r\n */\r\nexport class TileMetadataReader {\r\n private readonly _is2d: boolean;\r\n private readonly _isVolumeClassifier: boolean;\r\n private readonly _options: TileOptions;\r\n\r\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\r\n this._is2d = is2d;\r\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\r\n this._options = options;\r\n }\r\n\r\n /** Produce metadata from the specified tile content.\r\n * @throws [[TileReadError]]\r\n */\r\n public read(stream: ByteStream, props: TileProps): TileMetadata {\r\n const content = readTileContentDescription(stream, props.sizeMultiplier, this._is2d, this._options, this._isVolumeClassifier);\r\n return {\r\n contentRange: content.contentRange,\r\n isLeaf: content.isLeaf,\r\n sizeMultiplier: content.sizeMultiplier,\r\n emptySubRangeMask: content.emptySubRangeMask,\r\n range: Range3d.fromJSON(props.range),\r\n contentId: props.contentId,\r\n };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,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;AA8CD,gBAAgB;AA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K,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC9H,OAAO;YACL,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,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;AAzBD,gDAyBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport {\r\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStringsOrUndefined, Id64, Id64String,\r\n} from \"@itwin/core-bentley\";\r\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\r\nimport { BatchType } from \"../FeatureTable\";\r\nimport { TileProps } from \"../TileProps\";\r\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\r\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\r\n\r\n// cspell:ignore imdl mult bitfield\r\n\r\n// NB: These constants correspond to those defined in Tile.cpp.\r\nnamespace Constants {\r\n export const minToleranceRatioMultiplier = 2;\r\n}\r\n\r\n/** Describes an iModel tile tree.\r\n * @internal\r\n */\r\nexport interface TileTreeMetadata {\r\n readonly modelId: Id64String;\r\n readonly is2d: boolean;\r\n readonly contentRange?: Range3d;\r\n readonly tileScreenSize: number;\r\n}\r\n\r\n/** Describes the contents of an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileContentMetadata {\r\n readonly contentRange: Range3d;\r\n readonly isLeaf: boolean;\r\n readonly sizeMultiplier?: number;\r\n readonly emptySubRangeMask: number;\r\n}\r\n\r\n/** Describes an iModel tile.\r\n * @internal\r\n */\r\nexport interface TileMetadata extends TileContentMetadata {\r\n readonly contentId: string;\r\n readonly range: Range3d;\r\n}\r\n\r\n/** @internal */\r\nexport interface TileOptions {\r\n readonly maximumMajorTileFormatVersion: number;\r\n readonly enableInstancing: boolean;\r\n readonly enableImprovedElision: boolean;\r\n readonly ignoreAreaPatterns: boolean;\r\n readonly enableExternalTextures: boolean;\r\n readonly useProjectExtents: boolean;\r\n readonly optimizeBRepProcessing: boolean;\r\n readonly useLargerTiles: boolean;\r\n readonly disableMagnification: boolean;\r\n readonly alwaysSubdivideIncompleteTiles: boolean;\r\n readonly enableIndexedEdges: boolean;\r\n readonly generateAllPolyfaceEdges: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport namespace TileOptions {\r\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\r\n * compute the [[TileOptions]] that were used to generate the Ids.\r\n * @throws Error if `treeId` or `contentId` are not valid Ids.\r\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.\r\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\r\n */\r\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\r\n const tree = treeFlagsAndFormatVersionFromId(treeId);\r\n const contentFlags = contentFlagsFromId(contentId);\r\n const edgeOptions = edgeOptionsFromTreeId(treeId);\r\n\r\n return {\r\n maximumMajorTileFormatVersion: tree.version,\r\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\r\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\r\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\r\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\r\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\r\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\r\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: edgeOptions && edgeOptions.indexed,\r\n generateAllPolyfaceEdges: edgeOptions && edgeOptions.smooth,\r\n };\r\n }\r\n}\r\n\r\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\">;\r\ninterface ParsedClassifier {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n}\r\n\r\n/** The result of [[parseTileTreeIdAndContentId]].\r\n * @internal\r\n */\r\nexport interface ParsedTileTreeIdAndContentId {\r\n modelId: Id64String;\r\n treeId: IModelTileTreeId;\r\n contentId: ContentIdSpec;\r\n options: TileOptions;\r\n}\r\n\r\nclass Parser {\r\n public readonly input: string;\r\n public curPos = 0;\r\n\r\n public constructor(input: string) {\r\n this.input = input;\r\n }\r\n\r\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\r\n this.require(this.input.length > 0);\r\n\r\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\r\n while (this.curPos < this.input.length && this.cur() !== \"-\")\r\n this.advance();\r\n\r\n this.eat(\"-\");\r\n this.require(this.curPos < this.input.length);\r\n\r\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\r\n const animationId = this.parseAnimation();\r\n\r\n const primary = classifier ? undefined : this.parsePrimary();\r\n this.require((undefined === classifier) !== (undefined === primary));\r\n\r\n const modelId = this.input.substr(this.curPos);\r\n this.require(Id64.isId64(modelId));\r\n\r\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\r\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\r\n\r\n let parsedContentId: ContentIdSpec;\r\n try {\r\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\r\n } catch (e) {\r\n this.reject(\"Invalid content Id\");\r\n }\r\n\r\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\r\n throw new Error(\"Invalid content Id\");\r\n\r\n let treeId: IModelTileTreeId;\r\n if (classifier) {\r\n treeId = { ...classifier, animationId };\r\n } else {\r\n assert(undefined !== primary);\r\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\r\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority };\r\n }\r\n\r\n return {\r\n contentId: parsedContentId,\r\n modelId,\r\n options,\r\n treeId,\r\n };\r\n }\r\n\r\n private cur(): string {\r\n this.require(this.curPos < this.input.length);\r\n return this.input[this.curPos];\r\n }\r\n\r\n private advance(): void {\r\n this.require(this.curPos < this.input.length);\r\n ++this.curPos;\r\n }\r\n\r\n private eat(expectedChar: string): void {\r\n this.require(this.cur() === expectedChar);\r\n this.advance();\r\n }\r\n\r\n private reject(message = \"Invalid tree Id\"): never {\r\n throw new Error(message);\r\n }\r\n\r\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\r\n if (!condition)\r\n this.reject(message);\r\n }\r\n\r\n private parseClassifier(): ParsedClassifier | undefined {\r\n this.eat(\"C\");\r\n let type = BatchType.VolumeClassifier;\r\n if (this.cur() === \"P\") {\r\n type = BatchType.PlanarClassifier;\r\n this.advance();\r\n }\r\n\r\n this.eat(\":\");\r\n\r\n // C: or CP: is always folowed by expansion then an underscore.\r\n let expansionStr = \"\";\r\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\r\n expansionStr += this.cur();\r\n this.advance();\r\n }\r\n\r\n this.eat(\"_\");\r\n\r\n const expansion = Number.parseFloat(expansionStr);\r\n this.require(!Number.isNaN(expansion));\r\n\r\n return { type, expansion };\r\n }\r\n\r\n private parseAnimation(): Id64String | undefined {\r\n if (this.cur() !== \"A\")\r\n return undefined;\r\n\r\n this.eat(\"A\");\r\n this.eat(\":\");\r\n\r\n const termPos = this.input.indexOf(\"_\", this.curPos);\r\n this.require(termPos > this.curPos);\r\n\r\n const animationId = this.input.substring(this.curPos, termPos);\r\n this.require(Id64.isId64(animationId));\r\n\r\n this.curPos = termPos + 1; // Skip \"_\"\r\n return animationId;\r\n }\r\n\r\n private parsePrimary(): ParsedPrimary {\r\n const edges = this.parseEdges();\r\n const sectionCut = this.parseSectionCut();\r\n return { edges, sectionCut };\r\n }\r\n\r\n private parseEdges(): EdgeOptions | false {\r\n if (\"E\" !== this.cur())\r\n return { indexed: false, smooth: false };\r\n\r\n this.eat(\"E\");\r\n this.eat(\":\");\r\n\r\n const typeStr = this.cur();\r\n this.eat(typeStr);\r\n this.eat(\"_\");\r\n\r\n switch (typeStr) {\r\n case \"0\": return false;\r\n case \"2\": return { indexed: true, smooth: false };\r\n case \"3\": return { indexed: false, smooth: true };\r\n case \"4\": return { indexed: true, smooth: true };\r\n default: this.reject();\r\n }\r\n }\r\n\r\n private parseSectionCut(): string | undefined {\r\n if (\"S\" !== this.cur())\r\n return undefined;\r\n\r\n this.eat(\"S\");\r\n const termPos = this.input.indexOf(\"s\", this.curPos);\r\n this.require(termPos > this.curPos);\r\n\r\n const sectionCut = this.input.substring(this.curPos, termPos);\r\n this.curPos = termPos + 1; // Skip \"_\";\r\n return sectionCut;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\r\n const parser = new Parser(treeId);\r\n return parser.parse(contentId);\r\n}\r\n\r\n/** @internal */\r\nexport const defaultTileOptions: TileOptions = Object.freeze({\r\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\r\n enableInstancing: true,\r\n enableImprovedElision: true,\r\n ignoreAreaPatterns: false,\r\n enableExternalTextures: true,\r\n useProjectExtents: true,\r\n optimizeBRepProcessing: true,\r\n useLargerTiles: true,\r\n disableMagnification: false,\r\n alwaysSubdivideIncompleteTiles: false,\r\n enableIndexedEdges: true,\r\n generateAllPolyfaceEdges: true,\r\n});\r\n\r\nfunction contentFlagsFromId(id: string): ContentFlags {\r\n if (0 === id.length || \"-\" !== id[0])\r\n throw new Error(\"Invalid content Id\");\r\n\r\n // V4: -flags-d-i-j-k-m - version in tree Id\r\n const end = id.indexOf(\"-\", 1);\r\n if (-1 !== end) {\r\n const flags = Number.parseInt(id.substring(1, end), 16);\r\n if (!Number.isNaN(flags))\r\n return flags;\r\n }\r\n\r\n throw new Error(\"Invalid content Id\");\r\n}\r\n\r\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\r\n if (0 === id.length)\r\n throw new Error(\"Invalid tree Id\");\r\n\r\n let parts = id.split(\"-\");\r\n if (parts.length > 0) {\r\n parts = parts[0].split(\"_\");\r\n if (parts.length === 2) {\r\n const version = Number.parseInt(parts[0], 16);\r\n const flags = Number.parseInt(parts[1], 16);\r\n if (!Number.isNaN(version) || !Number.isNaN(flags))\r\n return { version, flags };\r\n }\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\r\n const pos = id.indexOf(\"E:\");\r\n if (pos <= 0)\r\n return { indexed: false, smooth: false };\r\n\r\n switch (id[pos + 2]) {\r\n case \"0\": return { indexed: defaultTileOptions.enableIndexedEdges, smooth: defaultTileOptions.generateAllPolyfaceEdges };\r\n case \"2\": return { indexed: true, smooth: false };\r\n case \"3\": return { indexed: false, smooth: true };\r\n case \"4\": return { indexed: true, smooth: true };\r\n }\r\n\r\n throw new Error(\"Invalid tree Id\");\r\n}\r\n\r\n/** @internal */\r\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\r\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\r\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\r\n // to that optionally configured by the app.\r\n let majorVersion = maxMajorVersion;\r\n if (undefined !== formatVersion)\r\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\r\n\r\n // Version number less than 1 is invalid - ignore\r\n majorVersion = Math.max(majorVersion, 1);\r\n\r\n // Version number greater than current known version ignored\r\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\r\n\r\n // Version numbers are integers - round down\r\n return Math.max(Math.floor(majorVersion), 1);\r\n}\r\n\r\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\r\n * @alpha\r\n */\r\nexport enum TreeFlags {\r\n None = 0,\r\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\r\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\r\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\r\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\r\n}\r\n\r\n/** Describes how edges should be produced for tiles in a tile tree.\r\n * @internal\r\n */\r\nexport interface EdgeOptions {\r\n /** Generate indexed edges. These use less memory and draw more efficiently than non-indexed edges, but require WebGL 2.\r\n * Generally the display system will determine which to use based on the device's capabilities and application configuration.\r\n */\r\n indexed: boolean;\r\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\r\n smooth: boolean;\r\n}\r\n\r\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\r\n if (typeof a !== typeof b)\r\n return a ? 1 : -1;\r\n\r\n if (typeof a === \"boolean\") {\r\n assert(typeof b === \"boolean\");\r\n return compareBooleans(a, b);\r\n }\r\n\r\n assert(typeof b === \"object\");\r\n let cmp = compareBooleans(a.indexed, b.indexed);\r\n if (0 === cmp)\r\n cmp = compareBooleans(a.smooth, b.smooth);\r\n\r\n return cmp;\r\n}\r\n\r\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\r\n * @internal\r\n */\r\nexport interface PrimaryTileTreeId {\r\n /** Describes the type of tile tree. */\r\n type: BatchType.Primary;\r\n /** The type of edges to include in tile content. */\r\n edges: EdgeOptions | false;\r\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\r\n animationId?: Id64String;\r\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\r\n * for ensuring the graphics display with correct priority.\r\n */\r\n enforceDisplayPriority?: boolean;\r\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.\r\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString[($core-geometry).\r\n */\r\n sectionCut?: string;\r\n}\r\n\r\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\r\n * @internal\r\n */\r\nexport interface ClassifierTileTreeId {\r\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\r\n expansion: number;\r\n animationId?: Id64String;\r\n}\r\n\r\nfunction animationIdToString(animationId: Id64String): string {\r\n return `A:${animationId}_`;\r\n}\r\n\r\n/** Describes the Id of an iModel tile tree.\r\n * @internal\r\n */\r\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\r\n\r\n/** Convert a tile tree Id to its string representation.\r\n * @internal\r\n */\r\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\r\n let idStr = \"\";\r\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\r\n if (options.optimizeBRepProcessing)\r\n flags |= TreeFlags.OptimizeBRepProcessing;\r\n\r\n if (options.useLargerTiles)\r\n flags |= TreeFlags.UseLargerTiles;\r\n\r\n if (BatchType.Primary === treeId.type) {\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\r\n flags |= TreeFlags.EnforceDisplayPriority;\r\n\r\n let edges;\r\n if (!treeId.edges) {\r\n edges = \"E:0_\";\r\n } else {\r\n if (!treeId.edges.smooth)\r\n edges = treeId.edges.indexed ? \"E:2_\" : \"\";\r\n else\r\n edges = treeId.edges.indexed ? \"E:4_\" : \"E:3_\";\r\n }\r\n\r\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\r\n idStr = `${idStr}${edges}${sectionCut}`;\r\n } else {\r\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\r\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\r\n\r\n if (BatchType.VolumeClassifier === treeId.type)\r\n flags |= TreeFlags.UseProjectExtents;\r\n\r\n if (undefined !== treeId.animationId)\r\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\r\n }\r\n\r\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\r\n if (version >= 4) {\r\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\r\n idStr = prefix + idStr;\r\n }\r\n\r\n return idStr + modelId;\r\n}\r\n\r\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\r\n * @internal\r\n */\r\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\r\n let cmp = compareNumbers(lhs.type, rhs.type);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\r\n\r\n if (0 !== cmp)\r\n return cmp;\r\n\r\n // NB: The redundant checks on BatchType below are to satisfy compiler.\r\n assert(lhs.type === rhs.type);\r\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\r\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\r\n if (0 === cmp) {\r\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\r\n if (0 === cmp)\r\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\r\n }\r\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\r\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\r\n }\r\n\r\n return cmp;\r\n}\r\n\r\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\r\n * @alpha\r\n */\r\nexport enum ContentFlags {\r\n None = 0,\r\n AllowInstancing = 1 << 0,\r\n ImprovedElision = 1 << 1,\r\n IgnoreAreaPatterns = 1 << 2,\r\n ExternalTextures = 1 << 3,\r\n}\r\n\r\n/** Describes the components of a tile's content Id.\r\n *\r\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\r\n *\r\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\r\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\r\n * based on `k`.\r\n *\r\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\r\n * produce a higher-resolution tile for the same volume.\r\n * @internal\r\n */\r\ninterface ContentIdSpec {\r\n depth: number;\r\n i: number;\r\n j: number;\r\n k: number;\r\n multiplier: number;\r\n}\r\n\r\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\r\n * the major version of the tile format.\r\n * @internal\r\n */\r\nexport abstract class ContentIdProvider {\r\n public readonly majorFormatVersion: number;\r\n public readonly contentFlags: ContentFlags;\r\n\r\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\r\n this.majorFormatVersion = formatVersion;\r\n this.contentFlags = contentFlags;\r\n }\r\n\r\n public get rootContentId(): string {\r\n return this.computeId(0, 0, 0, 0, 1);\r\n }\r\n\r\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\r\n const lastSepPos = parentId.lastIndexOf(this._separator);\r\n assert(-1 !== lastSepPos);\r\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\r\n }\r\n\r\n public specFromId(id: string): ContentIdSpec {\r\n const parts = id.split(this._separator);\r\n const len = parts.length;\r\n assert(len >= 5);\r\n return {\r\n depth: parseInt(parts[len - 5], 16),\r\n i: parseInt(parts[len - 4], 16),\r\n j: parseInt(parts[len - 3], 16),\r\n k: parseInt(parts[len - 2], 16),\r\n multiplier: parseInt(parts[len - 1], 16),\r\n };\r\n }\r\n\r\n public idFromSpec(spec: ContentIdSpec): string {\r\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\r\n }\r\n\r\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\r\n const sep = this._separator;\r\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\r\n }\r\n\r\n protected abstract get _separator(): string;\r\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\r\n\r\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\r\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\r\n * not supply tiles of a format the front-end doesn't recognize.\r\n */\r\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\r\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\r\n assert(majorVersion > 0);\r\n assert(Math.floor(majorVersion) === majorVersion);\r\n switch (majorVersion) {\r\n case 0:\r\n case 1:\r\n return new ContentIdV1Provider(majorVersion);\r\n case 2:\r\n case 3:\r\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\r\n default:\r\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\r\n }\r\n }\r\n}\r\n\r\n/** The original (major version 1) tile format used a content Id scheme of the format\r\n * `depth/i/j/k/multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV1Provider extends ContentIdProvider {\r\n public constructor(majorVersion: number) {\r\n super(majorVersion, ContentFlags.None);\r\n }\r\n\r\n protected get _separator() { return \"/\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\r\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV2Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\r\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"_\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\r\n * Format: `-flags-depth-i-j-k-multiplier`.\r\n * @internal\r\n */\r\nclass ContentIdV4Provider extends ContentIdProvider {\r\n private readonly _prefix: string;\r\n\r\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\r\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\r\n if (options.enableImprovedElision)\r\n flags = flags | ContentFlags.ImprovedElision;\r\n\r\n if (options.ignoreAreaPatterns)\r\n flags = flags | ContentFlags.IgnoreAreaPatterns;\r\n\r\n if (options.enableExternalTextures)\r\n flags = flags | ContentFlags.ExternalTextures;\r\n\r\n super(majorVersion, flags);\r\n this._prefix = this._separator + flags.toString(16) + this._separator;\r\n }\r\n\r\n protected get _separator() { return \"-\"; }\r\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\r\n return this._prefix + this.join(depth, i, j, k, mult);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y && diag.x > diag.z)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else if (diag.y > diag.z)\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n else\r\n pt.z = (range.low.z + range.high.z) / 2.0;\r\n}\r\n\r\n/** @internal */\r\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\r\n const diag = range.diagonal();\r\n const pt = takeUpper ? range.high : range.low;\r\n if (diag.x > diag.y)\r\n pt.x = (range.low.x + range.high.x) / 2.0;\r\n else\r\n pt.y = (range.low.y + range.high.y) / 2.0;\r\n}\r\n\r\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\r\n * @internal\r\n */\r\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\r\n const emptyMask = tile.emptySubRangeMask;\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n\r\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n const isEmpty = 0 !== (emptyMask & emptyBit);\r\n\r\n const range = tile.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n ranges.push({ range, isEmpty });\r\n }\r\n }\r\n }\r\n\r\n return ranges;\r\n}\r\n\r\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\r\n * @internal\r\n */\r\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\r\n let numEmpty = 0;\r\n const children: TileProps[] = [];\r\n\r\n // Leaf nodes have no children\r\n if (parent.isLeaf)\r\n return { children, numEmpty };\r\n\r\n // One child, same volume as parent, but higher-resolution.\r\n if (undefined !== parent.sizeMultiplier) {\r\n const sizeMultiplier = parent.sizeMultiplier * 2;\r\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\r\n children.push({\r\n contentId,\r\n range: parent.range,\r\n contentRange: parent.contentRange,\r\n sizeMultiplier,\r\n isLeaf: false,\r\n maximumSize: root.tileScreenSize,\r\n });\r\n\r\n return { children, numEmpty };\r\n }\r\n\r\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\r\n const parentSpec = idProvider.specFromId(parent.contentId);\r\n const childSpec: ContentIdSpec = { ...parentSpec };\r\n childSpec.depth = parentSpec.depth + 1;\r\n\r\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\r\n // Don't bother creating children or requesting content for such empty volumes.\r\n const emptyMask = parent.emptySubRangeMask;\r\n\r\n // Spatial tree range == project extents; content range == model range.\r\n // Trivially reject children whose ranges are entirely outside model range.\r\n let treeContentRange = root.contentRange;\r\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\r\n // Parent is wholly within model range - don't bother testing child ranges against it.\r\n treeContentRange = undefined;\r\n }\r\n\r\n const is2d = root.is2d;\r\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\r\n for (let i = 0; i < 2; i++) {\r\n for (let j = 0; j < 2; j++) {\r\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\r\n const emptyBit = 1 << (i + j * 2 + k * 4);\r\n if (0 !== (emptyMask & emptyBit)) {\r\n // volume is known to contain no geometry.\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n const range = parent.range.clone();\r\n bisectRange(range, 0 === i);\r\n bisectRange(range, 0 === j);\r\n if (!is2d)\r\n bisectRange(range, 0 === k);\r\n\r\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\r\n // volume is within project extents but entirely outside model range\r\n ++numEmpty;\r\n continue;\r\n }\r\n\r\n childSpec.i = parentSpec.i * 2 + i;\r\n childSpec.j = parentSpec.j * 2 + j;\r\n childSpec.k = parentSpec.k * 2 + k;\r\n\r\n const childId = idProvider.idFromSpec(childSpec);\r\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\r\n }\r\n }\r\n }\r\n\r\n return { children, numEmpty };\r\n}\r\n\r\n/** @internal */\r\nexport interface TileContentDescription extends TileContentMetadata {\r\n readonly featureTableStartPos: number;\r\n}\r\n\r\n/** Deserializes tile content metadata.\r\n * @throws [[TileReadError]]\r\n * @internal\r\n */\r\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\r\n stream.reset();\r\n\r\n const header = new ImdlHeader(stream);\r\n if (!header.isValid)\r\n throw new TileReadError(TileReadStatus.InvalidHeader);\r\n else if (!header.isReadableVersion)\r\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\r\n\r\n // Skip the feature table.\r\n const featureTableStartPos = stream.curPos;\r\n const ftHeader = FeatureTableHeader.readFrom(stream);\r\n if (undefined === ftHeader)\r\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\r\n\r\n stream.curPos = featureTableStartPos + ftHeader.length;\r\n\r\n // Determine subdivision based on header data.\r\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\r\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\r\n let isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\r\n if (!isLeaf) {\r\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\r\n // can be adversely affected by quantization issues when zooming in closely.\r\n const maxLeafTolerance = 1.0;\r\n\r\n // Must sub-divide if tile explicitly specifies...\r\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\r\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\r\n canSkipSubdivision = canSkipSubdivision && !is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\r\n // ...or app specifies incomplete tiles must always be sub-divided.\r\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\r\n if (canSkipSubdivision) {\r\n const minElementsPerTile = 100;\r\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\r\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\r\n if (!containsCurves)\r\n isLeaf = true;\r\n else if (undefined === sizeMultiplier)\r\n sizeMultiplier = 1.0;\r\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\r\n sizeMultiplier = 1.0;\r\n }\r\n }\r\n }\r\n\r\n return {\r\n featureTableStartPos,\r\n contentRange: header.contentRange,\r\n isLeaf,\r\n sizeMultiplier,\r\n emptySubRangeMask: header.emptySubRanges,\r\n };\r\n}\r\n\r\nconst scratchRangeDiagonal = new Vector3d();\r\n\r\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\r\n * @internal\r\n */\r\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\r\n if (tile.range.isNull)\r\n return 0;\r\n\r\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\r\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\r\n\r\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\r\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\r\n}\r\n\r\n/** Deserializes tile metadata.\r\n * @internal\r\n */\r\nexport class TileMetadataReader {\r\n private readonly _is2d: boolean;\r\n private readonly _isVolumeClassifier: boolean;\r\n private readonly _options: TileOptions;\r\n\r\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\r\n this._is2d = is2d;\r\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\r\n this._options = options;\r\n }\r\n\r\n /** Produce metadata from the specified tile content.\r\n * @throws [[TileReadError]]\r\n */\r\n public read(stream: ByteStream, props: TileProps): TileMetadata {\r\n const content = readTileContentDescription(stream, props.sizeMultiplier, this._is2d, this._options, this._isVolumeClassifier);\r\n return {\r\n contentRange: content.contentRange,\r\n isLeaf: content.isLeaf,\r\n sizeMultiplier: content.sizeMultiplier,\r\n emptySubRangeMask: content.emptySubRangeMask,\r\n range: Range3d.fromJSON(props.range),\r\n contentId: props.contentId,\r\n };\r\n }\r\n}\r\n"]}
|
package/lib/esm/HiddenLine.d.ts
CHANGED
|
@@ -22,15 +22,15 @@ export declare namespace HiddenLine {
|
|
|
22
22
|
* - width is overridden if width != undefined and width != 0
|
|
23
23
|
* - pattern is overridden if pattern != undefined and pattern != LinePixels.Invalid
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
ovrColor?: boolean;
|
|
26
26
|
/** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */
|
|
27
|
-
|
|
27
|
+
color?: ColorDefProps;
|
|
28
28
|
/** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */
|
|
29
|
-
|
|
29
|
+
pattern?: LinePixels;
|
|
30
30
|
/** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.
|
|
31
31
|
* @note Non-integer values are truncated, and values are clamped to the range [1, 32].
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
width?: number;
|
|
34
34
|
}
|
|
35
35
|
/** Describes the symbology with which edges should be drawn. */
|
|
36
36
|
class Style {
|
|
@@ -58,20 +58,14 @@ export declare namespace HiddenLine {
|
|
|
58
58
|
equals(other: Style): boolean;
|
|
59
59
|
toJSON(): StyleProps;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
61
|
+
/** The JSON representation of a [[HiddenLine.Settings]]. */
|
|
62
62
|
interface SettingsProps {
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
* A value of 0.25 indicates any surface that is less than 25% opaque should not be drawn.
|
|
70
|
-
* A value of 1.0 indicates that all surfaces should be drawn regardless of transparency.
|
|
71
|
-
* @note values will be clamped to the range [0.0, 1.0].
|
|
72
|
-
* @note Defaults to 1.0.
|
|
73
|
-
*/
|
|
74
|
-
readonly transThreshold?: number;
|
|
63
|
+
/** @see [[HiddenLine.Settings.visible]]. */
|
|
64
|
+
visible?: StyleProps;
|
|
65
|
+
/** @see [[HiddenLine.Settings.hidden]]. */
|
|
66
|
+
hidden?: StyleProps;
|
|
67
|
+
/** @see [[HiddenLine.Settings.transparencyThreshold. */
|
|
68
|
+
transThreshold?: number;
|
|
75
69
|
}
|
|
76
70
|
/** Describes how visible and hidden edges and transparent surfaces should be rendered in "hidden line" and "solid fill" [[RenderMode]]s. */
|
|
77
71
|
class Settings {
|
|
@@ -87,6 +81,7 @@ export declare namespace HiddenLine {
|
|
|
87
81
|
* @note Defaults to 1.0.
|
|
88
82
|
*/
|
|
89
83
|
readonly transparencyThreshold: number;
|
|
84
|
+
/** An alias for [[transparencyThreshold]]. */
|
|
90
85
|
get transThreshold(): number;
|
|
91
86
|
/** The default display settings. */
|
|
92
87
|
static defaults: Settings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenLine.d.ts","sourceRoot":"","sources":["../../src/HiddenLine.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,yBAAiB,UAAU,CAAC;IAC1B,gEAAgE;IAChE,UAAiB,UAAU;QACzB;;;;;;;;;;;;WAYG;QACH,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"HiddenLine.d.ts","sourceRoot":"","sources":["../../src/HiddenLine.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY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pB,wDAAwD;QACxD,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB;IAED,4IAA4I;IAC5I,MAAa,QAAQ;QACnB,4FAA4F;QAC5F,SAAgB,OAAO,EAAE,KAAK,CAAC;QAC/B,yFAAyF;QACzF,SAAgB,MAAM,EAAE,KAAK,CAAC;QAC9B;;;;;;WAMG;QACH,SAAgB,qBAAqB,EAAE,MAAM,CAAC;QAE9C,8CAA8C;QAC9C,IAAW,cAAc,IAAI,MAAM,CAAuC;QAE1E,oCAAoC;QACpC,OAAc,QAAQ,WAAoB;QAE1C,6DAA6D;eAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ;QAS/C,MAAM,IAAI,aAAa;QAU9B,oHAAoH;QAC7G,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ;QAWxC,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;QASvC,IAAW,eAAe,IAAI,OAAO,CAEpC;QAED,OAAO;KAKR;CACF"}
|
package/lib/esm/HiddenLine.js
CHANGED
|
@@ -112,6 +112,7 @@ export var HiddenLine;
|
|
|
112
112
|
this.hidden = Style.fromJSON(json.hidden, true);
|
|
113
113
|
this.transparencyThreshold = JsonUtils.asDouble(json.transThreshold, 1.0);
|
|
114
114
|
}
|
|
115
|
+
/** An alias for [[transparencyThreshold]]. */
|
|
115
116
|
get transThreshold() { return this.transparencyThreshold; }
|
|
116
117
|
/** Create a DisplaySettings from its JSON representation. */
|
|
117
118
|
static fromJSON(json) {
|
|
@@ -123,11 +124,12 @@ export var HiddenLine;
|
|
|
123
124
|
return new Settings(json);
|
|
124
125
|
}
|
|
125
126
|
toJSON() {
|
|
126
|
-
|
|
127
|
+
const props = {
|
|
127
128
|
visible: this.visible.toJSON(),
|
|
128
129
|
hidden: this.hidden.toJSON(),
|
|
129
130
|
transThreshold: this.transThreshold,
|
|
130
131
|
};
|
|
132
|
+
return props;
|
|
131
133
|
}
|
|
132
134
|
/** Create a Settings equivalent to this one with the exception of those properties defined in the supplied JSON. */
|
|
133
135
|
override(props) {
|
|
@@ -143,7 +145,9 @@ export var HiddenLine;
|
|
|
143
145
|
equals(other) {
|
|
144
146
|
if (this === other)
|
|
145
147
|
return true;
|
|
146
|
-
return this.visible.equals(other.visible)
|
|
148
|
+
return this.visible.equals(other.visible)
|
|
149
|
+
&& this.hidden.equals(other.hidden)
|
|
150
|
+
&& this.transparencyThreshold === other.transparencyThreshold;
|
|
147
151
|
}
|
|
148
152
|
get matchesDefaults() {
|
|
149
153
|
return this.equals(Settings.defaults);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenLine.js","sourceRoot":"","sources":["../../src/HiddenLine.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,KAAW,UAAU,CA+N1B;AA/ND,WAAiB,UAAU;IA2BzB,gEAAgE;IAChE,MAAa,KAAK;QAYhB,YAAoB,IAAiB,EAAE,MAAa;YAClD,IAAI,SAAS,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE;gBAC5C,IAAI,MAAM;oBACR,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC;gBAEvC,OAAO;aACR;YAED,IAAI,GAAG,IAAkB,CAAC,CAAC,2CAA2C;YACtE,IAAI,SAAS,KAAK,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,QAAQ;gBACrD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAE7C,IAAI,SAAS,KAAK,IAAI,CAAC,OAAO,EAAE;gBAC9B,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC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CAAC,qBAAqB,KAAK,KAAK,CAAC,qBAAqB,CAAC;QAC9I,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;;IA1CD,oCAAoC;IACtB,iBAAQ,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAhB/B,mBAAQ,WAgEpB,CAAA;AACH,CAAC,EA/NgB,UAAU,KAAV,UAAU,QA+N1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\nimport { LinePixels } from \"./LinePixels\";\r\n\r\n/** Namespace containing types controlling how edges and surfaces should be drawn in \"hidden line\" and \"solid fill\" [[RenderMode]]s.\r\n * @public\r\n */\r\nexport namespace HiddenLine {\r\n /** Describes the symbology with which edges should be drawn. */\r\n export interface StyleProps {\r\n /** @internal\r\n * This JSON representation is awkward, but it must match that used in the db.\r\n * If the JSON came from the db then all members are present and:\r\n * - color is overridden only if ovrColor = true.\r\n * - width is overridden only if width != 0\r\n * - pattern is overridden only if pattern != LinePixels.Invalid\r\n * The 'public' JSON representation is more sensible:\r\n * - Color, width, and pattern are each overridden iff they are not undefined.\r\n * To make this work for both scenarios, the rules are:\r\n * - color is overridden if color != undefined and ovrColor != false\r\n * - width is overridden if width != undefined and width != 0\r\n * - pattern is overridden if pattern != undefined and pattern != LinePixels.Invalid\r\n */\r\n readonly ovrColor?: boolean;\r\n /** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\r\n readonly color?: ColorDefProps;\r\n /** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\r\n readonly pattern?: LinePixels;\r\n /** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\r\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\r\n */\r\n readonly width?: number;\r\n }\r\n\r\n /** Describes the symbology with which edges should be drawn. */\r\n export class Style {\r\n /** @internal */\r\n public get ovrColor(): boolean { return undefined !== this.color; }\r\n /** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\r\n public readonly color?: ColorDef;\r\n /** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\r\n public readonly pattern?: LinePixels;\r\n /** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\r\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\r\n */\r\n public readonly width?: number;\r\n\r\n private constructor(json?: StyleProps, hidden?: true) {\r\n if (JsonUtils.isEmptyObjectOrUndefined(json)) {\r\n if (hidden)\r\n this.pattern = LinePixels.HiddenLine;\r\n\r\n return;\r\n }\r\n\r\n json = json as StyleProps; // per JsonUtils.isEmptyObjectOrUndefined()\r\n if (undefined !== json.color && false !== json.ovrColor)\r\n this.color = ColorDef.fromJSON(json.color);\r\n\r\n if (undefined !== json.pattern) {\r\n const pattern = JsonUtils.asInt(json.pattern, hidden ? LinePixels.HiddenLine : LinePixels.Invalid);\r\n if (LinePixels.Invalid !== pattern)\r\n this.pattern = pattern;\r\n } else if (hidden) {\r\n this.pattern = LinePixels.HiddenLine;\r\n }\r\n\r\n if (undefined !== json.width) {\r\n let width = JsonUtils.asInt(json.width, 0);\r\n if (0 !== width) {\r\n width = Math.max(1, width);\r\n this.width = Math.min(32, width);\r\n }\r\n }\r\n }\r\n\r\n public static readonly defaultVisible = new Style({});\r\n public static readonly defaultHidden = new Style({}, true);\r\n\r\n public static fromJSON(json?: StyleProps, hidden?: true): Style {\r\n if (undefined !== json)\r\n return new Style(json, hidden);\r\n\r\n return hidden ? this.defaultHidden : this.defaultVisible;\r\n }\r\n\r\n /** Create a Style equivalent to this one but with the specified color override. */\r\n public overrideColor(color: ColorDef | undefined): Style {\r\n if (undefined === this.color && undefined === color)\r\n return this;\r\n\r\n if (undefined !== this.color && undefined !== color && this.color.equals(color))\r\n return this;\r\n\r\n return Style.fromJSON({\r\n color: color?.toJSON(),\r\n ovrColor: undefined !== color,\r\n pattern: this.pattern,\r\n width: this.width,\r\n });\r\n }\r\n\r\n /** Create a Style equivalent to this one but with the specified pattern override. */\r\n public overridePattern(pattern: LinePixels | undefined): Style {\r\n if (pattern === this.pattern)\r\n return this;\r\n\r\n return Style.fromJSON({\r\n color: this.color?.toJSON(),\r\n ovrColor: this.ovrColor,\r\n pattern,\r\n width: this.width,\r\n });\r\n }\r\n\r\n /** Create a Style equivalent to this one but with the specified width override. */\r\n public overrideWidth(width: number | undefined): Style {\r\n if (width === this.width)\r\n return this;\r\n\r\n return Style.fromJSON({\r\n color: this.color?.toJSON(),\r\n ovrColor: this.ovrColor,\r\n pattern: this.pattern,\r\n width,\r\n });\r\n }\r\n\r\n /** Returns true if this Style is equivalent to the supplied Style. */\r\n public equals(other: Style): boolean {\r\n if (this === other)\r\n return true;\r\n else if (this.ovrColor !== other.ovrColor || this.pattern !== other.pattern || this.width !== other.width)\r\n return false;\r\n else\r\n return undefined === this.color || this.color.equals(other.color!);\r\n }\r\n\r\n public toJSON(): StyleProps {\r\n return {\r\n ovrColor: this.ovrColor,\r\n color: this.color ? this.color.toJSON() : ColorDef.white.toJSON(),\r\n pattern: undefined !== this.pattern ? this.pattern : LinePixels.Invalid,\r\n width: undefined !== this.width ? this.width : 0,\r\n };\r\n }\r\n }\r\n\r\n /** Describes how visible and hidden edges and transparent surfaces should be rendered in \"hidden line\" and \"solid fill\" [[RenderMode]]s. */\r\n export interface SettingsProps {\r\n /** Describes how visible edges (those unobscured by other geometry) should be displayed. */\r\n readonly visible?: StyleProps;\r\n /** Describes how hidden edges (those obscured by other geometry) should be displayed. */\r\n readonly hidden?: StyleProps;\r\n /** A value in the range [0.0, 1.0] specifying a threshold below which transparent surfaces should not be drawn.\r\n * A value of 0.0 indicates any surface that is not 100% opaque should not be drawn.\r\n * A value of 0.25 indicates any surface that is less than 25% opaque should not be drawn.\r\n * A value of 1.0 indicates that all surfaces should be drawn regardless of transparency.\r\n * @note values will be clamped to the range [0.0, 1.0].\r\n * @note Defaults to 1.0.\r\n */\r\n readonly transThreshold?: number;\r\n }\r\n\r\n /** Describes how visible and hidden edges and transparent surfaces should be rendered in \"hidden line\" and \"solid fill\" [[RenderMode]]s. */\r\n export class Settings {\r\n /** Describes how visible edges (those unobscured by other geometry) should be displayed. */\r\n public readonly visible: Style;\r\n /** Describes how hidden edges (those obscured by other geometry) should be displayed. */\r\n public readonly hidden: Style;\r\n /** A value in the range [0.0, 1.0] specifying a threshold below which transparent surfaces should not be drawn.\r\n * A value of 0.0 indicates any surface that is not 100% opaque should not be drawn.\r\n * A value of 0.25 indicates any surface that is less than 25% opaque should not be drawn.\r\n * A value of 1.0 indicates that all surfaces should be drawn regardless of transparency.\r\n * @note values will be clamped to the range [0.0, 1.0].\r\n * @note Defaults to 1.0.\r\n */\r\n public readonly transparencyThreshold: number;\r\n public get transThreshold(): number { return this.transparencyThreshold; }\r\n\r\n /** The default display settings. */\r\n public static defaults = new Settings({});\r\n\r\n /** Create a DisplaySettings from its JSON representation. */\r\n public static fromJSON(json?: SettingsProps): Settings {\r\n if (JsonUtils.isEmptyObjectOrUndefined(json))\r\n return this.defaults;\r\n else if (json instanceof Settings)\r\n return json;\r\n else\r\n return new Settings(json!);\r\n }\r\n\r\n public toJSON(): SettingsProps {\r\n return {\r\n visible: this.visible.toJSON(),\r\n hidden: this.hidden.toJSON(),\r\n transThreshold: this.transThreshold,\r\n };\r\n }\r\n\r\n /** Create a Settings equivalent to this one with the exception of those properties defined in the supplied JSON. */\r\n public override(props: SettingsProps): Settings {\r\n const visible = props.visible;\r\n const hidden = props.hidden;\r\n const transparencyThreshold = props.transThreshold;\r\n return Settings.fromJSON({\r\n visible: undefined !== visible ? visible : this.visible.toJSON(),\r\n hidden: undefined !== hidden ? hidden : this.hidden.toJSON(),\r\n transThreshold: undefined !== transparencyThreshold ? transparencyThreshold : this.transparencyThreshold,\r\n });\r\n }\r\n\r\n public equals(other: Settings): boolean {\r\n if (this === other)\r\n return true;\r\n\r\n return this.visible.equals(other.visible) && this.hidden.equals(other.hidden) && this.transparencyThreshold === other.transparencyThreshold;\r\n }\r\n\r\n public get matchesDefaults(): boolean {\r\n return this.equals(Settings.defaults);\r\n }\r\n\r\n private constructor(json: SettingsProps) {\r\n this.visible = Style.fromJSON(json.visible);\r\n this.hidden = Style.fromJSON(json.hidden, true);\r\n this.transparencyThreshold = JsonUtils.asDouble(json.transThreshold, 1.0);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"HiddenLine.js","sourceRoot":"","sources":["../../src/HiddenLine.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,KAAW,UAAU,CA+N1B;AA/ND,WAAiB,UAAU;IA2BzB,gEAAgE;IAChE,MAAa,KAAK;QAYhB,YAAoB,IAAiB,EAAE,MAAa;YAClD,IAAI,SAAS,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE;gBAC5C,IAAI,MAAM;oBACR,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,UAAU,CAAC;gBAEvC,OAAO;aACR;YAED,IAAI,GAAG,IAAkB,CAAC,CAAC,2CAA2C;YACtE,IAAI,SAAS,KAAK,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,QAAQ;gBACrD,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,C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CAAC;YAEd,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;mBACpC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;mBAChC,IAAI,CAAC,qBAAqB,KAAK,KAAK,CAAC,qBAAqB,CAAC;QAClE,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;;IA9CD,oCAAoC;IACtB,iBAAQ,GAAG,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAlB/B,mBAAQ,WAsEpB,CAAA;AACH,CAAC,EA/NgB,UAAU,KAAV,UAAU,QA+N1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module DisplayStyles\r\n */\r\n\r\nimport { JsonUtils } from \"@itwin/core-bentley\";\r\nimport { ColorDef, ColorDefProps } from \"./ColorDef\";\r\nimport { LinePixels } from \"./LinePixels\";\r\n\r\n/** Namespace containing types controlling how edges and surfaces should be drawn in \"hidden line\" and \"solid fill\" [[RenderMode]]s.\r\n * @public\r\n */\r\nexport namespace HiddenLine {\r\n /** Describes the symbology with which edges should be drawn. */\r\n export interface StyleProps {\r\n /** @internal\r\n * This JSON representation is awkward, but it must match that used in the db.\r\n * If the JSON came from the db then all members are present and:\r\n * - color is overridden only if ovrColor = true.\r\n * - width is overridden only if width != 0\r\n * - pattern is overridden only if pattern != LinePixels.Invalid\r\n * The 'public' JSON representation is more sensible:\r\n * - Color, width, and pattern are each overridden iff they are not undefined.\r\n * To make this work for both scenarios, the rules are:\r\n * - color is overridden if color != undefined and ovrColor != false\r\n * - width is overridden if width != undefined and width != 0\r\n * - pattern is overridden if pattern != undefined and pattern != LinePixels.Invalid\r\n */\r\n ovrColor?: boolean;\r\n /** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\r\n color?: ColorDefProps;\r\n /** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\r\n pattern?: LinePixels;\r\n /** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\r\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\r\n */\r\n width?: number;\r\n }\r\n\r\n /** Describes the symbology with which edges should be drawn. */\r\n export class Style {\r\n /** @internal */\r\n public get ovrColor(): boolean { return undefined !== this.color; }\r\n /** If defined, the color used to draw the edges. If undefined, edges are drawn using the element's line color. */\r\n public readonly color?: ColorDef;\r\n /** If defined, the pixel pattern used to draw the edges. If undefined, edges are drawn using the element's line pattern. */\r\n public readonly pattern?: LinePixels;\r\n /** If defined, the width of the edges in pixels. If undefined (or 0), edges are drawn using the element's line width.\r\n * @note Non-integer values are truncated, and values are clamped to the range [1, 32].\r\n */\r\n public readonly width?: number;\r\n\r\n private constructor(json?: StyleProps, hidden?: true) {\r\n if (JsonUtils.isEmptyObjectOrUndefined(json)) {\r\n if (hidden)\r\n this.pattern = LinePixels.HiddenLine;\r\n\r\n return;\r\n }\r\n\r\n json = json as StyleProps; // per JsonUtils.isEmptyObjectOrUndefined()\r\n if (undefined !== json.color && false !== json.ovrColor)\r\n this.color = ColorDef.fromJSON(json.color);\r\n\r\n if (undefined !== json.pattern) {\r\n const pattern = JsonUtils.asInt(json.pattern, hidden ? LinePixels.HiddenLine : LinePixels.Invalid);\r\n if (LinePixels.Invalid !== pattern)\r\n this.pattern = pattern;\r\n } else if (hidden) {\r\n this.pattern = LinePixels.HiddenLine;\r\n }\r\n\r\n if (undefined !== json.width) {\r\n let width = JsonUtils.asInt(json.width, 0);\r\n if (0 !== width) {\r\n width = Math.max(1, width);\r\n this.width = Math.min(32, width);\r\n }\r\n }\r\n }\r\n\r\n public static readonly defaultVisible = new Style({});\r\n public static readonly defaultHidden = new Style({}, true);\r\n\r\n public static fromJSON(json?: StyleProps, hidden?: true): Style {\r\n if (undefined !== json)\r\n return new Style(json, hidden);\r\n\r\n return hidden ? this.defaultHidden : this.defaultVisible;\r\n }\r\n\r\n /** Create a Style equivalent to this one but with the specified color override. */\r\n public overrideColor(color: ColorDef | undefined): Style {\r\n if (undefined === this.color && undefined === color)\r\n return this;\r\n\r\n if (undefined !== this.color && undefined !== color && this.color.equals(color))\r\n return this;\r\n\r\n return Style.fromJSON({\r\n color: color?.toJSON(),\r\n ovrColor: undefined !== color,\r\n pattern: this.pattern,\r\n width: this.width,\r\n });\r\n }\r\n\r\n /** Create a Style equivalent to this one but with the specified pattern override. */\r\n public overridePattern(pattern: LinePixels | undefined): Style {\r\n if (pattern === this.pattern)\r\n return this;\r\n\r\n return Style.fromJSON({\r\n color: this.color?.toJSON(),\r\n ovrColor: this.ovrColor,\r\n pattern,\r\n width: this.width,\r\n });\r\n }\r\n\r\n /** Create a Style equivalent to this one but with the specified width override. */\r\n public overrideWidth(width: number | undefined): Style {\r\n if (width === this.width)\r\n return this;\r\n\r\n return Style.fromJSON({\r\n color: this.color?.toJSON(),\r\n ovrColor: this.ovrColor,\r\n pattern: this.pattern,\r\n width,\r\n });\r\n }\r\n\r\n /** Returns true if this Style is equivalent to the supplied Style. */\r\n public equals(other: Style): boolean {\r\n if (this === other)\r\n return true;\r\n else if (this.ovrColor !== other.ovrColor || this.pattern !== other.pattern || this.width !== other.width)\r\n return false;\r\n else\r\n return undefined === this.color || this.color.equals(other.color!);\r\n }\r\n\r\n public toJSON(): StyleProps {\r\n return {\r\n ovrColor: this.ovrColor,\r\n color: this.color ? this.color.toJSON() : ColorDef.white.toJSON(),\r\n pattern: undefined !== this.pattern ? this.pattern : LinePixels.Invalid,\r\n width: undefined !== this.width ? this.width : 0,\r\n };\r\n }\r\n }\r\n\r\n /** The JSON representation of a [[HiddenLine.Settings]]. */\r\n export interface SettingsProps {\r\n /** @see [[HiddenLine.Settings.visible]]. */\r\n visible?: StyleProps;\r\n /** @see [[HiddenLine.Settings.hidden]]. */\r\n hidden?: StyleProps;\r\n /** @see [[HiddenLine.Settings.transparencyThreshold. */\r\n transThreshold?: number;\r\n }\r\n\r\n /** Describes how visible and hidden edges and transparent surfaces should be rendered in \"hidden line\" and \"solid fill\" [[RenderMode]]s. */\r\n export class Settings {\r\n /** Describes how visible edges (those unobscured by other geometry) should be displayed. */\r\n public readonly visible: Style;\r\n /** Describes how hidden edges (those obscured by other geometry) should be displayed. */\r\n public readonly hidden: Style;\r\n /** A value in the range [0.0, 1.0] specifying a threshold below which transparent surfaces should not be drawn.\r\n * A value of 0.0 indicates any surface that is not 100% opaque should not be drawn.\r\n * A value of 0.25 indicates any surface that is less than 25% opaque should not be drawn.\r\n * A value of 1.0 indicates that all surfaces should be drawn regardless of transparency.\r\n * @note values will be clamped to the range [0.0, 1.0].\r\n * @note Defaults to 1.0.\r\n */\r\n public readonly transparencyThreshold: number;\r\n\r\n /** An alias for [[transparencyThreshold]]. */\r\n public get transThreshold(): number { return this.transparencyThreshold; }\r\n\r\n /** The default display settings. */\r\n public static defaults = new Settings({});\r\n\r\n /** Create a DisplaySettings from its JSON representation. */\r\n public static fromJSON(json?: SettingsProps): Settings {\r\n if (JsonUtils.isEmptyObjectOrUndefined(json))\r\n return this.defaults;\r\n else if (json instanceof Settings)\r\n return json;\r\n else\r\n return new Settings(json!);\r\n }\r\n\r\n public toJSON(): SettingsProps {\r\n const props: SettingsProps = {\r\n visible: this.visible.toJSON(),\r\n hidden: this.hidden.toJSON(),\r\n transThreshold: this.transThreshold,\r\n };\r\n\r\n return props;\r\n }\r\n\r\n /** Create a Settings equivalent to this one with the exception of those properties defined in the supplied JSON. */\r\n public override(props: SettingsProps): Settings {\r\n const visible = props.visible;\r\n const hidden = props.hidden;\r\n const transparencyThreshold = props.transThreshold;\r\n return Settings.fromJSON({\r\n visible: undefined !== visible ? visible : this.visible.toJSON(),\r\n hidden: undefined !== hidden ? hidden : this.hidden.toJSON(),\r\n transThreshold: undefined !== transparencyThreshold ? transparencyThreshold : this.transparencyThreshold,\r\n });\r\n }\r\n\r\n public equals(other: Settings): boolean {\r\n if (this === other)\r\n return true;\r\n\r\n return this.visible.equals(other.visible)\r\n && this.hidden.equals(other.hidden)\r\n && this.transparencyThreshold === other.transparencyThreshold;\r\n }\r\n\r\n public get matchesDefaults(): boolean {\r\n return this.equals(Settings.defaults);\r\n }\r\n\r\n private constructor(json: SettingsProps) {\r\n this.visible = Style.fromJSON(json.visible);\r\n this.hidden = Style.fromJSON(json.hidden, true);\r\n this.transparencyThreshold = JsonUtils.asDouble(json.transThreshold, 1.0);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcMultipart.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAIA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"RpcMultipart.d.ts","sourceRoot":"","sources":["../../../../src/rpc/web/RpcMultipart.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9E;AAED,gBAAgB;AAChB,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,UAAU,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,YAAY;IACvB,wDAAwD;WAC1C,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,QAAQ;IAM7D,mDAAmD;WACrC,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,gBAAgB;IAIxE,2DAA2D;WACvC,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAItF,gBAAgB;WACF,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,kBAAkB;CAY/E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcMultipartParser.d.ts","sourceRoot":"","sources":["../../../../../src/rpc/web/multipart/RpcMultipartParser.ts"],"names":[],"mappings":"AAIA;;GAEG;;
|
|
1
|
+
{"version":3,"file":"RpcMultipartParser.d.ts","sourceRoot":"","sources":["../../../../../src/rpc/web/multipart/RpcMultipartParser.ts"],"names":[],"mappings":"AAIA;;GAEG;;AA6BH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AA0B9D,gBAAgB;AAChB,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,gBAAgB,CAAgB;IACxC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,iBAAiB,CAAU;IACnC,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,WAAW,CAAW;IAC9B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAqB;gBAEhB,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAoC/C,KAAK,IAAI,kBAAkB;IAkNlC,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,kBAAkB;CAE3B"}
|
|
@@ -6,7 +6,7 @@ import { TransformProps } from "@itwin/core-geometry";
|
|
|
6
6
|
import { Placement2dProps, Placement3dProps } from "../ElementProps";
|
|
7
7
|
import { ElementGeometryDataEntry } from "../geometry/ElementGeometry";
|
|
8
8
|
import { GeometryStreamProps } from "../geometry/GeometryStream";
|
|
9
|
-
import { ContentFlags,
|
|
9
|
+
import { ContentFlags, TreeFlags } from "../tile/TileMetadata";
|
|
10
10
|
/** Wire format describing properties common to [[PersistentGraphicsRequestProps]] and [[DynamicGraphicsRequestProps]].
|
|
11
11
|
* @see [[ElementGraphicsRequestProps]] for more details.
|
|
12
12
|
* @public
|
|
@@ -31,9 +31,15 @@ export interface GraphicsRequestProps {
|
|
|
31
31
|
/** If true, surface edges will be omitted from the graphics. */
|
|
32
32
|
readonly omitEdges?: boolean;
|
|
33
33
|
/** If omitEdges is false, specifies the type of edges to produce. Generally determined by TileAdmin.requestElementGraphics.
|
|
34
|
+
* @note This uses the deleted EdgeType enum where 1 indicates non-indexed edges and 2 indicates indexed edges, to avoid breaking the RPC API.
|
|
34
35
|
* @internal
|
|
35
36
|
*/
|
|
36
|
-
readonly edgeType?:
|
|
37
|
+
readonly edgeType?: 1 | 2;
|
|
38
|
+
/** If true, and omitEdges is false, a polyface with no edge visibility info will display edges for all faces;
|
|
39
|
+
* if false, edges will be inferred from the polyface's topology.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
readonly smoothPolyfaceEdges?: boolean;
|
|
37
43
|
/** If true, the element's graphics will be clipped against the iModel's project extents. */
|
|
38
44
|
readonly clipToProjectExtents?: boolean;
|
|
39
45
|
/** If defined, the compact string representation of a [ClipVector]($core-geometry) to be applied to the geometry to produce section-cut
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementGraphics.d.ts","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"ElementGraphics.d.ts","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,yGAAyG;IACzG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+IAA+I;IAC/I,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,yIAAyI;IACzI,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC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A8B,SAAQ,2BAA2B;IAChF,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,2BAA2B;IAChF,oCAAoC;IACpC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;CACpD;AAED;;;;;;GAMG;AACH,oBAAY,2BAA2B,GAAG,8BAA8B,GAAG,6BAA6B,GAAG,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { TransformProps } from \"@itwin/core-geometry\";\r\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\r\nimport { ElementGeometryDataEntry } from \"../geometry/ElementGeometry\";\r\nimport { GeometryStreamProps } from \"../geometry/GeometryStream\";\r\nimport { ContentFlags,
|
|
1
|
+
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../../src/tile/ElementGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tile\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { TransformProps } from \"@itwin/core-geometry\";\r\nimport { Placement2dProps, Placement3dProps } from \"../ElementProps\";\r\nimport { ElementGeometryDataEntry } from \"../geometry/ElementGeometry\";\r\nimport { GeometryStreamProps } from \"../geometry/GeometryStream\";\r\nimport { ContentFlags, TreeFlags } from \"../tile/TileMetadata\";\r\n\r\n/** Wire format describing properties common to [[PersistentGraphicsRequestProps]] and [[DynamicGraphicsRequestProps]].\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface GraphicsRequestProps {\r\n /** Uniquely identifies this request among all [[ElementGraphicsRequestProps]] for a given [[IModel]]. */\r\n readonly id: string;\r\n /** Log10 of the chord tolerance with which to stroke the element's geometry. e.g., for a chord tolerance of 0.01 (10^-2) meters, supply -2. */\r\n readonly toleranceLog10: number;\r\n /** The major version of the \"iMdl\" format to use when producing the iMdl representation of the element's geometry.\r\n * If omitted, the most recent version known to the backend will be used.\r\n * @alpha\r\n */\r\n readonly formatVersion?: number;\r\n /** Optional flags. [[TreeFlags.UseProjectExtents]] has no effect. [[TreeFlags.EnforceDisplayPriority]] is not yet implemented. @alpha */\r\n readonly treeFlags?: TreeFlags;\r\n /** Optional flags. [[ContentFlags.ImprovedElision]] has no effect. @alpha */\r\n readonly contentFlags?: ContentFlags;\r\n /** Transform from element graphics to world coordinates. Defaults to identity. */\r\n readonly location?: TransformProps;\r\n /** If true, surface edges will be omitted from the graphics. */\r\n readonly omitEdges?: boolean;\r\n /** If omitEdges is false, specifies the type of edges to produce. Generally determined by TileAdmin.requestElementGraphics.\r\n * @note This uses the deleted EdgeType enum where 1 indicates non-indexed edges and 2 indicates indexed edges, to avoid breaking the RPC API.\r\n * @internal\r\n */\r\n readonly edgeType?: 1 | 2;\r\n /** If true, and omitEdges is false, a polyface with no edge visibility info will display edges for all faces;\r\n * if false, edges will be inferred from the polyface's topology.\r\n * @internal\r\n */\r\n readonly smoothPolyfaceEdges?: boolean;\r\n /** If true, the element's graphics will be clipped against the iModel's project extents. */\r\n readonly clipToProjectExtents?: boolean;\r\n /** If defined, the compact string representation of a [ClipVector]($core-geometry) to be applied to the geometry to produce section-cut\r\n * geometry at the intersections with the clip planes. Any geometry *not* intersecting the clip planes is omitted from the tiles.\r\n * @see [ClipVector.toCompactString]($core-geometry) to produce the string representation.\r\n */\r\n readonly sectionCut?: string;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single element.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface PersistentGraphicsRequestProps extends GraphicsRequestProps {\r\n /** The element whose geometry is to be used to generate the graphics. */\r\n readonly elementId: Id64String;\r\n}\r\n\r\n/** As part of a [[DynamicGraphicsRequestProps]], specifies the geometry from which to generate the graphics in JSON format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface JsonGeometryStream {\r\n /** Discriminator for [[DynamicGraphicsRequestProps.geometry]]. */\r\n format: \"json\";\r\n /** The geometry stream in JSON format. */\r\n data: GeometryStreamProps;\r\n}\r\n\r\n/** As part of a [[DynamicGraphicsRequestProps]], specifies the geometry from which to generate the graphics in binary flatbuffer-encoded format.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface FlatBufferGeometryStream {\r\n /** Discriminator for [[DynamicGraphicsRequestProps.geometry]]. */\r\n format: \"flatbuffer\";\r\n /** The geometry stream in flatbuffer format. */\r\n data: ElementGeometryDataEntry[];\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single geometry stream.\r\n * @see [[DynamicGraphicsRequest2dProps]] and [[DynamicGraphicsRequest3dProps]].\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequestProps extends GraphicsRequestProps {\r\n /** The geometry from which to generate the graphics. */\r\n readonly geometry: JsonGeometryStream | FlatBufferGeometryStream;\r\n /** The category to which the geometry belongs. This is required to identify a persistent [SpatialCategory]($backend) for 3d geometry or\r\n * [DrawingCategory]($backend) for 2d geometry.\r\n */\r\n readonly categoryId: Id64String;\r\n /** If specified, tools will recognize the generated graphics as being associated with this element. */\r\n readonly elementId?: Id64String;\r\n /** If specified, tools will recognize the generated graphics as being associated with this model.\r\n * It should identify a 3d model for 3d geometry or a 2d model for 2d geometry.\r\n * It needn't identify a persistent model - it can be a transient Id.\r\n */\r\n readonly modelId?: Id64String;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a 2d geometry stream.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequest2dProps extends DynamicGraphicsRequestProps {\r\n /** Specifies the geometry is 2d. */\r\n readonly type: \"2d\";\r\n /** The origin and rotation of the geometry. */\r\n readonly placement: Omit<Placement2dProps, \"bbox\">;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a 3d geometry stream.\r\n * @see [[ElementGraphicsRequestProps]] for more details.\r\n * @public\r\n * @extensions\r\n */\r\nexport interface DynamicGraphicsRequest3dProps extends DynamicGraphicsRequestProps {\r\n /** Specifies the geometry is 3d. */\r\n readonly type: \"3d\";\r\n /** The origin and rotation of the geometry. */\r\n readonly placement: Omit<Placement3dProps, \"bbox\">;\r\n}\r\n\r\n/** Wire format describing a request to produce graphics in \"iMdl\" format for a single element or geometry stream.\r\n * @note Every request must have an `id` that is unique amongst all extant requests for a given [[IModel]].\r\n * @see [TileAdmin.requestElementGraphics]($frontend) and [IModelDb.generateElementGraphics]($backend) to fulfill such a request.\r\n * @see [readElementGraphics]($frontend) to convert the result of a request to a [RenderGraphic]($frontend) for display.\r\n * @public\r\n * @extensions\r\n */\r\nexport type ElementGraphicsRequestProps = PersistentGraphicsRequestProps | DynamicGraphicsRequest2dProps | DynamicGraphicsRequest3dProps;\r\n"]}
|