@itwin/core-common 5.12.0-dev.2 → 5.12.0-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/lib/cjs/ClipStyle.d.ts +1 -1
- package/lib/cjs/ClipStyle.d.ts.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +5 -5
- package/lib/cjs/ConcurrentQuery.js +2 -2
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +6 -6
- package/lib/cjs/EntityProps.js +2 -2
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/Fonts.d.ts +2 -2
- package/lib/cjs/Fonts.js +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.d.ts +1 -1
- package/lib/cjs/GeoCoordinateServices.js +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/MassProperties.d.ts +2 -2
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.d.ts +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/TerrainSettings.d.ts +1 -1
- package/lib/cjs/TerrainSettings.d.ts.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.d.ts +4 -4
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +4 -4
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +1 -1
- package/lib/cjs/tile/TileMetadata.js +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/esm/ClipStyle.d.ts +1 -1
- package/lib/esm/ClipStyle.d.ts.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +5 -5
- package/lib/esm/ConcurrentQuery.js +2 -2
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +6 -6
- package/lib/esm/EntityProps.js +2 -2
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Fonts.d.ts +2 -2
- package/lib/esm/Fonts.js +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.d.ts +1 -1
- package/lib/esm/GeoCoordinateServices.js +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/MassProperties.d.ts +2 -2
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.d.ts +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/TerrainSettings.d.ts +1 -1
- package/lib/esm/TerrainSettings.d.ts.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.d.ts +4 -4
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +4 -4
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +1 -1
- package/lib/esm/tile/TileMetadata.js +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialProps.js","sourceRoot":"","sources":["../../src/MaterialProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAqBH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wCAAwC;IACxC,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,qDAAQ,CAAA;IACR,yDAAU,CAAA;AACZ,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AA4CD;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,wBAAwB;IACxB,mDAAQ,CAAA;IACR;;OAEG;IACH,yDAAgB,CAAA;IAChB,uFAAuF;IACvF,uEAAuB,CAAA;AACzB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { DefinitionElementProps } from \"./ElementProps\";\nimport { TextureMapping } from \"./TextureMapping\";\n\n/** Describes a color as an array of three numbers ranging from 0 to 1 where the first entry corresponds to the color's red component,\n * the second to green, and the third to blue.\n * @see usage in [[RenderMaterialAssetProps]].\n * @public\n * @extensions\n */\nexport type RgbFactorProps = number[];\n\n/** A 2d point specified as an array of 2 numbers [x, y].\n * @see usage in [[TextureMapProps]].\n * @public\n * @extensions\n */\nexport type Point2dProps = number[];\n\n/** Describes the units in which a [[TextureMapProps]]' scale is expressed.\n * @public\n * @extensions\n */\nexport enum TextureMapUnits {\n /** Indicates the scale has no units. */\n Relative = 0,\n Meters = 3,\n Millimeters = 4,\n Feet = 5,\n Inches = 6,\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** As part of a [[RenderMaterialAssetProps]], describes how to map a [[RenderTexture]]'s image to the triangles of a mesh to which the material is applied.\n * @see [[RenderMaterialAssetMapsProps]] for the supported types of texture mappings.\n * @public\n * @extensions\n */\nexport interface TextureMapProps {\n /** Angle in degrees to rotate texture when applying; defaults to 0.0 if undefined */\n pattern_angle?: number;\n /** If true, flip the pattern map in U; if undefined, defaults to false */\n pattern_u_flip?: boolean;\n /** If true, flip the pattern map in V; if undefined, defaults to false */\n pattern_flip?: boolean;\n /** X, Y scale to apply to the pattern map; if undefined, defaults to {0,0}, which is almost never useful. */\n pattern_scale?: Point2dProps;\n /** X, Y offset to apply to the pattern map; if undefined, defaults to {0,0} */\n pattern_offset?: Point2dProps;\n /** Units to use when applying the scaling; if undefined, defaults to [[TextureMapUnits.Relative]] */\n pattern_scalemode?: TextureMapUnits;\n /** Mapping mode to use for the texture application; if undefined, defaults to [[TextureMapping.Mode.Parametric]] */\n pattern_mapping?: TextureMapping.Mode;\n /** Weight at which to combine diffuse image and color; if undefined, defaults to 1.0 */\n pattern_weight?: number;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false.\n * @deprecated in 4.4 - will not be removed until after 2026-06-13. It never functioned properly - use [[pattern_useconstantlod]] instead.\n */\n pattern_useConstantLod?: boolean;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false. */\n pattern_useconstantlod?: boolean;\n /** The number of times the texture is repeated if pattern_useconstantlod is true. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1.*/\n pattern_constantlod_repetitions?: number;\n /** An offset in world units used to shift the texture when pattern_useconstantlod is true. Defaults to (0, 0). */\n pattern_constantlod_offset?: Point2dProps;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 1. */\n pattern_constantlod_mindistanceclamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 2^32. */\n pattern_constantlod_maxdistanceclamp?: number;\n /** The Id of the persistent [Texture]($backend) element defining the texture image. */\n TextureId: Id64String;\n}\n\n/** Flags applied to a [[NormalMapProps]]. The enum values can be combined using bitwise operators.\n * @public\n */\nexport enum NormalMapFlags {\n /** No special flags. */\n None = 0,\n /** Indicates that the Y component of each vector - stored in the texture's green channel - points upward along the positive Y axis and should\n * be negated. By default it points downward.\n */\n GreenUp = 1 << 0,\n /** If true, override the mapping mode with constant LOD mapping for the normal map. */\n UseConstantLod = 1 << 1,\n}\n\n/** Describes how to apply [normal mapping](https://en.wikipedia.org/wiki/Normal_mapping) to a surface material.\n * @see [[RenderMaterialAssetMapsProps.Normal]] to define a normal map for a [[RenderMaterialAssetProps]].\n * @public\n */\nexport interface NormalMapProps extends TextureMapProps {\n /** Flags controlling how the normal map is applied. Default: [[NormalMapFlags.None]]. */\n NormalFlags?: NormalMapFlags;\n}\n\n/** Describes different types of textures to be applied to a surface material to alter its appearance.\n * @note While technically both [[Pattern]] and [[Normal]] can define their own mapping parameters (`pattern_angle`, `pattern_mapping`, etc), in practice\n * if both maps are present they are expected to have identical mapping parameters, with the exception of `TextureId`.\n * @see [[RenderMaterialAssetProps.Map]] to define the texture maps for a material asset.\n * @public\n */\nexport interface RenderMaterialAssetMapsProps {\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Pattern?: TextureMapProps;\n /** Maps a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to the surface, simulating more complex surface details than are\n * present in the surface's geometry.\n */\n Normal?: NormalMapProps;\n /** Maps an image describing detailed minor height variation of the surface geometry. */\n Bump?: TextureMapProps;\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Diffuse?: TextureMapProps;\n /** Maps an image describing the glossiness of the surface's finish */\n Finish?: TextureMapProps;\n /** Maps an image describing glowing parts of the surface */\n GlowColor?: TextureMapProps;\n /** Maps an image describing the reflectiveness of the surface */\n Reflect?: TextureMapProps;\n /** Maps an image describing the specular component of the surface */\n Specular?: TextureMapProps;\n /** Maps an image describing the translucency of the surface, how much light comes out the back of the surface */\n TranslucencyColor?: TextureMapProps;\n /** Maps an image describing the transparency of the surface, how visible objects behind this object are */\n TransparentColor?: TextureMapProps;\n /** Maps an image describing the displacement of the surface geometry */\n Displacement?: TextureMapProps;\n}\n\n/** Describes the graphical properties of a [RenderMaterialElement]($backend) as part of a [[RenderMaterialProps]].\n * This representation is used to persist the material properties into the [IModelDb]($backend), but is unwieldy and verbose.\n * @see [RenderMaterialElementParams]($backend) for a somewhat more ergonomic representation.\n * @public\n * @extensions\n */\nexport interface RenderMaterialAssetProps {\n /** If true, this material has a fill/diffuse color; if undefined, defaults to false */\n HasBaseColor?: boolean;\n /** Surface color used for fill or diffuse illumination; if undefined, defaults to black */\n color?: RgbFactorProps;\n /** If true, this material has a specular color; if undefined, defaults to false */\n HasSpecularColor?: boolean;\n /** Surface color used for specular illumination; if undefined, defaults to black */\n specular_color?: RgbFactorProps;\n /** If true, this material has a specular exponent; if undefined, defaults to false */\n HasFinish?: boolean;\n /** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */\n finish?: number;\n /** If true, then this material overrides the surface transparency to be the value of [[transmit]].\n * If false, then this material overrides the surface to be fully opaque.\n * If undefined, then this material does not override the surface transparency at all.\n */\n HasTransmit?: boolean;\n /** Surface transparency; if undefined, defaults to 0.0. Has no effect unless [[HasTransmit]] is true. */\n transmit?: number;\n /** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */\n HasDiffuse?: boolean;\n /** Surface diffuse reflectivity; if undefined, defaults to 0.6 */\n diffuse?: number;\n /** If true, this material has a value for specular reflectivity; if undefined, defaults to false. If false, specular value is actually set to 0.0 */\n HasSpecular?: boolean;\n /** Surface specular reflectivity; if undefined, defaults to 0.4 */\n specular?: number;\n /** If true, this material has a value for environmental reflectivity; if undefined, defaults to false */\n HasReflect?: boolean;\n /** Surface environmental reflectivity; stored as fraction of specular in V8 material settings; if undefined defaults to 0.0 */\n reflect?: number;\n /** If true, this material has a surface reflectance color; if undefined, defaults to false. If false, reflectance color is actually set to specular color */\n HasReflectColor?: boolean;\n /** Surface reflectance color; if undefined, defaults to black */\n reflect_color?: RgbFactorProps;\n /** A scale by which to multiply the components of the normals read from [[Map.Normal]], if a normal map is defined.\n * Default: 1.0\n */\n pbr_normal?: number;\n /** An optional set of texture maps associated with this material. */\n Map?: RenderMaterialAssetMapsProps;\n}\n\n/** Properties that define a [RenderMaterialElement]($backend).\n * @see [[RenderMaterial]] for the representation used by the display system.\n * @public\n * @extensions\n */\nexport interface RenderMaterialProps extends DefinitionElementProps {\n /** The name of a palette that can be used to categorize multiple materials. */\n paletteName: string;\n /** An optional description of the material. */\n description?: string;\n jsonProperties?: {\n /** A container for various \"assets\" describing aspects of the material. */\n materialAssets?: {\n /** Properties of the material describing how it is displayed. */\n renderMaterial?: RenderMaterialAssetProps;\n };\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MaterialProps.js","sourceRoot":"","sources":["../../src/MaterialProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAqBH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,wCAAwC;IACxC,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,mEAAe,CAAA;IACf,qDAAQ,CAAA;IACR,yDAAU,CAAA;AACZ,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AA4CD;;GAEG;AACH,MAAM,CAAN,IAAY,cASX;AATD,WAAY,cAAc;IACxB,wBAAwB;IACxB,mDAAQ,CAAA;IACR;;OAEG;IACH,yDAAgB,CAAA;IAChB,uFAAuF;IACvF,uEAAuB,CAAA;AACzB,CAAC,EATW,cAAc,KAAd,cAAc,QASzB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { DefinitionElementProps } from \"./ElementProps\";\nimport { TextureMapping } from \"./TextureMapping\";\n\n/** Describes a color as an array of three numbers ranging from 0 to 1 where the first entry corresponds to the color's red component,\n * the second to green, and the third to blue.\n * @see usage in [[RenderMaterialAssetProps]].\n * @public\n * @extensions\n */\nexport type RgbFactorProps = number[];\n\n/** A 2d point specified as an array of 2 numbers [x, y].\n * @see usage in [[TextureMapProps]].\n * @public\n * @extensions\n */\nexport type Point2dProps = number[];\n\n/** Describes the units in which a [[TextureMapProps]]' scale is expressed.\n * @public\n * @extensions\n */\nexport enum TextureMapUnits {\n /** Indicates the scale has no units. */\n Relative = 0,\n Meters = 3,\n Millimeters = 4,\n Feet = 5,\n Inches = 6,\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** As part of a [[RenderMaterialAssetProps]], describes how to map a [[RenderTexture]]'s image to the triangles of a mesh to which the material is applied.\n * @see [[RenderMaterialAssetMapsProps]] for the supported types of texture mappings.\n * @public\n * @extensions\n */\nexport interface TextureMapProps {\n /** Angle in degrees to rotate texture when applying; defaults to 0.0 if undefined */\n pattern_angle?: number;\n /** If true, flip the pattern map in U; if undefined, defaults to false */\n pattern_u_flip?: boolean;\n /** If true, flip the pattern map in V; if undefined, defaults to false */\n pattern_flip?: boolean;\n /** X, Y scale to apply to the pattern map; if undefined, defaults to {0,0}, which is almost never useful. */\n pattern_scale?: Point2dProps;\n /** X, Y offset to apply to the pattern map; if undefined, defaults to {0,0} */\n pattern_offset?: Point2dProps;\n /** Units to use when applying the scaling; if undefined, defaults to [[TextureMapUnits.Relative]] */\n pattern_scalemode?: TextureMapUnits;\n /** Mapping mode to use for the texture application; if undefined, defaults to [[TextureMapping.Mode.Parametric]] */\n pattern_mapping?: TextureMapping.Mode;\n /** Weight at which to combine diffuse image and color; if undefined, defaults to 1.0 */\n pattern_weight?: number;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false.\n * @deprecated in 4.4 - might be removed in next major version. It never functioned properly - use [[pattern_useconstantlod]] instead.\n */\n pattern_useConstantLod?: boolean;\n /** If true, override the mapping mode with constant LOD mapping for the normal map, defaults to false. */\n pattern_useconstantlod?: boolean;\n /** The number of times the texture is repeated if pattern_useconstantlod is true. Increasing this will make the texture pattern appear smaller, decreasing it will make it larger. Defaults to 1.*/\n pattern_constantlod_repetitions?: number;\n /** An offset in world units used to shift the texture when pattern_useconstantlod is true. Defaults to (0, 0). */\n pattern_constantlod_offset?: Point2dProps;\n /** The minimum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 1. */\n pattern_constantlod_mindistanceclamp?: number;\n /** The maximum distance (from the eye to the surface) at which to clamp the texture size when pattern_useconstantlod is true. Defaults to 2^32. */\n pattern_constantlod_maxdistanceclamp?: number;\n /** The Id of the persistent [Texture]($backend) element defining the texture image. */\n TextureId: Id64String;\n}\n\n/** Flags applied to a [[NormalMapProps]]. The enum values can be combined using bitwise operators.\n * @public\n */\nexport enum NormalMapFlags {\n /** No special flags. */\n None = 0,\n /** Indicates that the Y component of each vector - stored in the texture's green channel - points upward along the positive Y axis and should\n * be negated. By default it points downward.\n */\n GreenUp = 1 << 0,\n /** If true, override the mapping mode with constant LOD mapping for the normal map. */\n UseConstantLod = 1 << 1,\n}\n\n/** Describes how to apply [normal mapping](https://en.wikipedia.org/wiki/Normal_mapping) to a surface material.\n * @see [[RenderMaterialAssetMapsProps.Normal]] to define a normal map for a [[RenderMaterialAssetProps]].\n * @public\n */\nexport interface NormalMapProps extends TextureMapProps {\n /** Flags controlling how the normal map is applied. Default: [[NormalMapFlags.None]]. */\n NormalFlags?: NormalMapFlags;\n}\n\n/** Describes different types of textures to be applied to a surface material to alter its appearance.\n * @note While technically both [[Pattern]] and [[Normal]] can define their own mapping parameters (`pattern_angle`, `pattern_mapping`, etc), in practice\n * if both maps are present they are expected to have identical mapping parameters, with the exception of `TextureId`.\n * @see [[RenderMaterialAssetProps.Map]] to define the texture maps for a material asset.\n * @public\n */\nexport interface RenderMaterialAssetMapsProps {\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Pattern?: TextureMapProps;\n /** Maps a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to the surface, simulating more complex surface details than are\n * present in the surface's geometry.\n */\n Normal?: NormalMapProps;\n /** Maps an image describing detailed minor height variation of the surface geometry. */\n Bump?: TextureMapProps;\n /** Maps an image describing the diffuse color of the surface, replacing or mixing with the surface's own color. */\n Diffuse?: TextureMapProps;\n /** Maps an image describing the glossiness of the surface's finish */\n Finish?: TextureMapProps;\n /** Maps an image describing glowing parts of the surface */\n GlowColor?: TextureMapProps;\n /** Maps an image describing the reflectiveness of the surface */\n Reflect?: TextureMapProps;\n /** Maps an image describing the specular component of the surface */\n Specular?: TextureMapProps;\n /** Maps an image describing the translucency of the surface, how much light comes out the back of the surface */\n TranslucencyColor?: TextureMapProps;\n /** Maps an image describing the transparency of the surface, how visible objects behind this object are */\n TransparentColor?: TextureMapProps;\n /** Maps an image describing the displacement of the surface geometry */\n Displacement?: TextureMapProps;\n}\n\n/** Describes the graphical properties of a [RenderMaterialElement]($backend) as part of a [[RenderMaterialProps]].\n * This representation is used to persist the material properties into the [IModelDb]($backend), but is unwieldy and verbose.\n * @see [RenderMaterialElementParams]($backend) for a somewhat more ergonomic representation.\n * @public\n * @extensions\n */\nexport interface RenderMaterialAssetProps {\n /** If true, this material has a fill/diffuse color; if undefined, defaults to false */\n HasBaseColor?: boolean;\n /** Surface color used for fill or diffuse illumination; if undefined, defaults to black */\n color?: RgbFactorProps;\n /** If true, this material has a specular color; if undefined, defaults to false */\n HasSpecularColor?: boolean;\n /** Surface color used for specular illumination; if undefined, defaults to black */\n specular_color?: RgbFactorProps;\n /** If true, this material has a specular exponent; if undefined, defaults to false */\n HasFinish?: boolean;\n /** Specular exponent (surface shininess); range is 0 to 128; if undefined, defaults to 13.5 */\n finish?: number;\n /** If true, then this material overrides the surface transparency to be the value of [[transmit]].\n * If false, then this material overrides the surface to be fully opaque.\n * If undefined, then this material does not override the surface transparency at all.\n */\n HasTransmit?: boolean;\n /** Surface transparency; if undefined, defaults to 0.0. Has no effect unless [[HasTransmit]] is true. */\n transmit?: number;\n /** If true, this material has a value for diffuse reflectivity; if undefined, defaults to false */\n HasDiffuse?: boolean;\n /** Surface diffuse reflectivity; if undefined, defaults to 0.6 */\n diffuse?: number;\n /** If true, this material has a value for specular reflectivity; if undefined, defaults to false. If false, specular value is actually set to 0.0 */\n HasSpecular?: boolean;\n /** Surface specular reflectivity; if undefined, defaults to 0.4 */\n specular?: number;\n /** If true, this material has a value for environmental reflectivity; if undefined, defaults to false */\n HasReflect?: boolean;\n /** Surface environmental reflectivity; stored as fraction of specular in V8 material settings; if undefined defaults to 0.0 */\n reflect?: number;\n /** If true, this material has a surface reflectance color; if undefined, defaults to false. If false, reflectance color is actually set to specular color */\n HasReflectColor?: boolean;\n /** Surface reflectance color; if undefined, defaults to black */\n reflect_color?: RgbFactorProps;\n /** A scale by which to multiply the components of the normals read from [[Map.Normal]], if a normal map is defined.\n * Default: 1.0\n */\n pbr_normal?: number;\n /** An optional set of texture maps associated with this material. */\n Map?: RenderMaterialAssetMapsProps;\n}\n\n/** Properties that define a [RenderMaterialElement]($backend).\n * @see [[RenderMaterial]] for the representation used by the display system.\n * @public\n * @extensions\n */\nexport interface RenderMaterialProps extends DefinitionElementProps {\n /** The name of a palette that can be used to categorize multiple materials. */\n paletteName: string;\n /** An optional description of the material. */\n description?: string;\n jsonProperties?: {\n /** A container for various \"assets\" describing aspects of the material. */\n materialAssets?: {\n /** Properties of the material describing how it is displayed. */\n renderMaterial?: RenderMaterialAssetProps;\n };\n };\n}\n"]}
|
|
@@ -73,7 +73,7 @@ export declare class TerrainSettings {
|
|
|
73
73
|
* @internal
|
|
74
74
|
*/
|
|
75
75
|
get nonLocatable(): true | undefined;
|
|
76
|
-
/** @deprecated in 4.5.0 -
|
|
76
|
+
/** @deprecated in 4.5.0 - might be removed in next major version. Use the overload that takes [[TerrainProps]]. */
|
|
77
77
|
constructor(providerName?: string, exaggeration?: number, applyLighting?: boolean, heightOrigin?: number, heightOriginMode?: TerrainHeightOriginMode);
|
|
78
78
|
constructor(props?: TerrainProps);
|
|
79
79
|
static fromJSON(json?: TerrainProps): TerrainSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainSettings.d.ts","sourceRoot":"","sources":["../../src/TerrainSettings.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAI7D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,YAAY,CAAC,E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AC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,UAAU,EAAE,YAAY,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU;YACtD,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,aAAa,EAAE,YAAY,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa;YAC/D,YAAY,EAAE,YAAY,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY;YAC5D,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB;SACzE,CAAC;QAEF,OAAO,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { BackgroundMapProps } from \"./BackgroundMapSettings\";\nimport { CesiumTerrainAssetId } from \"./CesiumIonAssets\";\n\n\n/** JSON representation of the settings of the terrain applied to background map display by a [[DisplayStyle]].\n * @see [[DisplayStyleSettingsProps]]\n * @see [[BackgroundMapProps]]\n * @public\n * @extensions\n */\nexport interface TerrainProps {\n /** Identifies the [TerrainProvider]($frontend) that will supply terrain meshes.\n * If omitted, it defaults to \"CesiumWorldTerrain\".\n */\n providerName?: string;\n /** Identifies the specific terrain data source to be supplied by the [TerrainProvider]($frontend) identified by [[providerName]],\n * for those providers that support multiple data sources.\n * For example, the \"CesiumWorldTerrain\" provider uses this field to store a [[CesiumTerrainAssetId]].\n * Default value: an empty string.\n */\n dataSource?: string;\n /** A value greater than one will cause terrain height to be exaggerated/scaled.false (or 1.0) indicate no exaggeration. Default value: 1.0 */\n exaggeration?: number;\n /** Applying lighting can help to visualize subtle terrain variation. Default value: true */\n applyLighting?: boolean;\n /** Origin value - height of the IModel origin at the project center as defined by heightOriginMode. Default value: 0.0 */\n heightOrigin?: number;\n /** Determines how/if the heightOrigin is applied to the terrain height. Default value: Geodetic */\n heightOriginMode?: TerrainHeightOriginMode;\n /** If true, the terrain will not be locatable. Otherwise, [[BackgroundMapProps.nonLocatable]] will determine whether terrain is locatable.\n * @internal use [[BackgroundMapProps.nonLocatable]]. Retained for backwards compatibility only.\n */\n nonLocatable?: boolean;\n}\n\n/** Correction modes for terrain height\n * @see [[TerrainProps]]\n * @public\n * @extensions\n */\nexport enum TerrainHeightOriginMode {\n /** Height value indicates the geodetic height of the IModel origin (also referred to as ellipsoidal or GPS height) */\n Geodetic = 0,\n /** Height value indicates the geoidal height of the IModel origin (commonly referred to as sea level). */\n Geoid = 1,\n /** Height value indicates the height of the IModel origin relative to ground level at project center. */\n Ground = 2,\n}\n\n/** Normalized version of [[TerrainProps]] for which provider has been validated and default values of all members are used.\n * @public\n */\nexport class TerrainSettings {\n private _nonLocatable: true | undefined;\n /** Identifies the [TerrainProvider]($frontend) that will supply terrain meshes.\n * Defaults to \"CesiumWorldTerrain\".\n */\n public readonly providerName: string;\n /** Identifies the specific terrain data source to be supplied by the [TerrainProvider]($frontend) identified by [[providerName]],\n * for those providers that support multiple data sources.\n * For example, the \"CesiumWorldTerrain\" provider uses this field to store a [[CesiumTerrainAssetId]].\n * Default value: an empty string.\n */\n public readonly dataSource: string;\n /** A value greater than one will cause terrain height to be exaggerated/scaled. 1.0 indicates no exaggeration. Default value: 1.0 */\n public readonly exaggeration: number;\n /** Applying lighting can help to visualize subtle terrain variations. Default value: false */\n public readonly applyLighting: boolean;\n /** Origin value - height of the IModel origin at the project center as defined by heightOriginMode. Default value 0.0 */\n public readonly heightOrigin: number;\n /** Determines how/if the heightOrigin is applied to the terrain height. Default value: Geodetic */\n public readonly heightOriginMode: TerrainHeightOriginMode;\n /** Optionally overrides [[BackgroundMapSettings.locatable]]. For backwards compatibility only.\n * @see [[TerrainProps.nonLocatable]].\n * @internal\n */\n public get nonLocatable(): true | undefined {\n return this._nonLocatable;\n }\n\n /** @deprecated in 4.5.0 - will not be removed until after 2026-06-13. Use the overload that takes [[TerrainProps]]. */\n constructor(providerName?: string, exaggeration?: number, applyLighting?: boolean, heightOrigin?: number, heightOriginMode?: TerrainHeightOriginMode);\n\n constructor(props?: TerrainProps);\n\n /** @internal */\n constructor(providerNameOrProps: string | TerrainProps | undefined, exaggeration?: number, applyLighting?: boolean, heightOrigin?: number, heightOriginMode?: TerrainHeightOriginMode) {\n let providerName;\n let dataSource;\n let nonLocatable;\n if (typeof providerNameOrProps === \"string\") {\n providerName = providerNameOrProps;\n } else if (providerNameOrProps) {\n ({ providerName, dataSource, exaggeration, applyLighting, heightOrigin, heightOriginMode, nonLocatable } = providerNameOrProps);\n }\n\n this.providerName = providerName ?? \"CesiumWorldTerrain\";\n this.dataSource = dataSource ?? \"\";\n this.exaggeration = Math.min(100, Math.max(0.1, exaggeration ?? 1.0));\n this.applyLighting = applyLighting ?? false;\n this.heightOrigin = heightOrigin ?? 0.0;\n\n if (true === nonLocatable)\n this._nonLocatable = true;\n\n switch (heightOriginMode) {\n case TerrainHeightOriginMode.Ground:\n case TerrainHeightOriginMode.Geoid:\n this.heightOriginMode = heightOriginMode;\n break;\n default:\n this.heightOriginMode = TerrainHeightOriginMode.Geodetic;\n break;\n }\n }\n\n public static fromJSON(json?: TerrainProps) {\n return new TerrainSettings(json);\n }\n\n /** Create settings that obtain terrain from a [Cesium ION asset](https://cesium.com/platform/cesium-ion/content/) such as\n * one of those defined by [[CesiumTerrainAssetId]].\n * @note You must ensure your Cesium ION account has access to the specified asset.\n */\n public static fromCesiumIonAsset(assetId: string = CesiumTerrainAssetId.Default, options?: Omit<TerrainProps, \"providerName\" | \"dataSource\">): TerrainSettings {\n return TerrainSettings.fromJSON({\n ...options,\n dataSource: assetId,\n });\n }\n\n public toJSON(): TerrainProps {\n const props: TerrainProps = { heightOriginMode: this.heightOriginMode };\n if (\"CesiumWorldTerrain\" !== this.providerName)\n props.providerName = this.providerName;\n if (this.dataSource)\n props.dataSource = this.dataSource;\n if (1 !== this.exaggeration)\n props.exaggeration = this.exaggeration;\n if (this.nonLocatable)\n props.nonLocatable = true;\n if (this.applyLighting)\n props.applyLighting = true;\n if (0 !== this.heightOrigin)\n props.heightOrigin = this.heightOrigin;\n\n return props;\n }\n\n public equals(other: TerrainSettings): boolean {\n return this.providerName === other.providerName && this.dataSource === other.dataSource && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting\n && this.heightOrigin === other.heightOrigin && this.heightOriginMode === other.heightOriginMode && this.nonLocatable === other.nonLocatable;\n }\n\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\n public equalsJSON(json?: BackgroundMapProps): boolean {\n return this.equals(TerrainSettings.fromJSON(json));\n }\n\n /** Create a copy of this TerrainSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A TerrainSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: TerrainProps): TerrainSettings {\n if (undefined === changedProps)\n return this;\n\n const props = {\n providerName: changedProps.providerName ?? this.providerName,\n dataSource: changedProps.dataSource ?? this.dataSource,\n exaggeration: changedProps.exaggeration ?? this.exaggeration,\n nonLocatable: changedProps.nonLocatable ?? this.nonLocatable,\n applyLighting: changedProps.applyLighting ?? this.applyLighting,\n heightOrigin: changedProps.heightOrigin ?? this.heightOrigin,\n heightOriginMode: changedProps.heightOriginMode ?? this.heightOriginMode,\n };\n\n return TerrainSettings.fromJSON(props);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TerrainSettings.js","sourceRoot":"","sources":["../../src/TerrainSettings.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAkCzD;;;;GAIG;AACH,MAAM,CAAN,IAAY,uBAOX;AAPD,WAAY,uBAAuB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AAC,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module DisplayStyles\n */\n\nimport { BackgroundMapProps } from \"./BackgroundMapSettings\";\nimport { CesiumTerrainAssetId } from \"./CesiumIonAssets\";\n\n\n/** JSON representation of the settings of the terrain applied to background map display by a [[DisplayStyle]].\n * @see [[DisplayStyleSettingsProps]]\n * @see [[BackgroundMapProps]]\n * @public\n * @extensions\n */\nexport interface TerrainProps {\n /** Identifies the [TerrainProvider]($frontend) that will supply terrain meshes.\n * If omitted, it defaults to \"CesiumWorldTerrain\".\n */\n providerName?: string;\n /** Identifies the specific terrain data source to be supplied by the [TerrainProvider]($frontend) identified by [[providerName]],\n * for those providers that support multiple data sources.\n * For example, the \"CesiumWorldTerrain\" provider uses this field to store a [[CesiumTerrainAssetId]].\n * Default value: an empty string.\n */\n dataSource?: string;\n /** A value greater than one will cause terrain height to be exaggerated/scaled.false (or 1.0) indicate no exaggeration. Default value: 1.0 */\n exaggeration?: number;\n /** Applying lighting can help to visualize subtle terrain variation. Default value: true */\n applyLighting?: boolean;\n /** Origin value - height of the IModel origin at the project center as defined by heightOriginMode. Default value: 0.0 */\n heightOrigin?: number;\n /** Determines how/if the heightOrigin is applied to the terrain height. Default value: Geodetic */\n heightOriginMode?: TerrainHeightOriginMode;\n /** If true, the terrain will not be locatable. Otherwise, [[BackgroundMapProps.nonLocatable]] will determine whether terrain is locatable.\n * @internal use [[BackgroundMapProps.nonLocatable]]. Retained for backwards compatibility only.\n */\n nonLocatable?: boolean;\n}\n\n/** Correction modes for terrain height\n * @see [[TerrainProps]]\n * @public\n * @extensions\n */\nexport enum TerrainHeightOriginMode {\n /** Height value indicates the geodetic height of the IModel origin (also referred to as ellipsoidal or GPS height) */\n Geodetic = 0,\n /** Height value indicates the geoidal height of the IModel origin (commonly referred to as sea level). */\n Geoid = 1,\n /** Height value indicates the height of the IModel origin relative to ground level at project center. */\n Ground = 2,\n}\n\n/** Normalized version of [[TerrainProps]] for which provider has been validated and default values of all members are used.\n * @public\n */\nexport class TerrainSettings {\n private _nonLocatable: true | undefined;\n /** Identifies the [TerrainProvider]($frontend) that will supply terrain meshes.\n * Defaults to \"CesiumWorldTerrain\".\n */\n public readonly providerName: string;\n /** Identifies the specific terrain data source to be supplied by the [TerrainProvider]($frontend) identified by [[providerName]],\n * for those providers that support multiple data sources.\n * For example, the \"CesiumWorldTerrain\" provider uses this field to store a [[CesiumTerrainAssetId]].\n * Default value: an empty string.\n */\n public readonly dataSource: string;\n /** A value greater than one will cause terrain height to be exaggerated/scaled. 1.0 indicates no exaggeration. Default value: 1.0 */\n public readonly exaggeration: number;\n /** Applying lighting can help to visualize subtle terrain variations. Default value: false */\n public readonly applyLighting: boolean;\n /** Origin value - height of the IModel origin at the project center as defined by heightOriginMode. Default value 0.0 */\n public readonly heightOrigin: number;\n /** Determines how/if the heightOrigin is applied to the terrain height. Default value: Geodetic */\n public readonly heightOriginMode: TerrainHeightOriginMode;\n /** Optionally overrides [[BackgroundMapSettings.locatable]]. For backwards compatibility only.\n * @see [[TerrainProps.nonLocatable]].\n * @internal\n */\n public get nonLocatable(): true | undefined {\n return this._nonLocatable;\n }\n\n /** @deprecated in 4.5.0 - might be removed in next major version. Use the overload that takes [[TerrainProps]]. */\n constructor(providerName?: string, exaggeration?: number, applyLighting?: boolean, heightOrigin?: number, heightOriginMode?: TerrainHeightOriginMode);\n\n constructor(props?: TerrainProps);\n\n /** @internal */\n constructor(providerNameOrProps: string | TerrainProps | undefined, exaggeration?: number, applyLighting?: boolean, heightOrigin?: number, heightOriginMode?: TerrainHeightOriginMode) {\n let providerName;\n let dataSource;\n let nonLocatable;\n if (typeof providerNameOrProps === \"string\") {\n providerName = providerNameOrProps;\n } else if (providerNameOrProps) {\n ({ providerName, dataSource, exaggeration, applyLighting, heightOrigin, heightOriginMode, nonLocatable } = providerNameOrProps);\n }\n\n this.providerName = providerName ?? \"CesiumWorldTerrain\";\n this.dataSource = dataSource ?? \"\";\n this.exaggeration = Math.min(100, Math.max(0.1, exaggeration ?? 1.0));\n this.applyLighting = applyLighting ?? false;\n this.heightOrigin = heightOrigin ?? 0.0;\n\n if (true === nonLocatable)\n this._nonLocatable = true;\n\n switch (heightOriginMode) {\n case TerrainHeightOriginMode.Ground:\n case TerrainHeightOriginMode.Geoid:\n this.heightOriginMode = heightOriginMode;\n break;\n default:\n this.heightOriginMode = TerrainHeightOriginMode.Geodetic;\n break;\n }\n }\n\n public static fromJSON(json?: TerrainProps) {\n return new TerrainSettings(json);\n }\n\n /** Create settings that obtain terrain from a [Cesium ION asset](https://cesium.com/platform/cesium-ion/content/) such as\n * one of those defined by [[CesiumTerrainAssetId]].\n * @note You must ensure your Cesium ION account has access to the specified asset.\n */\n public static fromCesiumIonAsset(assetId: string = CesiumTerrainAssetId.Default, options?: Omit<TerrainProps, \"providerName\" | \"dataSource\">): TerrainSettings {\n return TerrainSettings.fromJSON({\n ...options,\n dataSource: assetId,\n });\n }\n\n public toJSON(): TerrainProps {\n const props: TerrainProps = { heightOriginMode: this.heightOriginMode };\n if (\"CesiumWorldTerrain\" !== this.providerName)\n props.providerName = this.providerName;\n if (this.dataSource)\n props.dataSource = this.dataSource;\n if (1 !== this.exaggeration)\n props.exaggeration = this.exaggeration;\n if (this.nonLocatable)\n props.nonLocatable = true;\n if (this.applyLighting)\n props.applyLighting = true;\n if (0 !== this.heightOrigin)\n props.heightOrigin = this.heightOrigin;\n\n return props;\n }\n\n public equals(other: TerrainSettings): boolean {\n return this.providerName === other.providerName && this.dataSource === other.dataSource && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting\n && this.heightOrigin === other.heightOrigin && this.heightOriginMode === other.heightOriginMode && this.nonLocatable === other.nonLocatable;\n }\n\n /** Returns true if these settings are equivalent to the supplied JSON settings. */\n public equalsJSON(json?: BackgroundMapProps): boolean {\n return this.equals(TerrainSettings.fromJSON(json));\n }\n\n /** Create a copy of this TerrainSettings, optionally modifying some of its properties.\n * @param changedProps JSON representation of the properties to change.\n * @returns A TerrainSettings with all of its properties set to match those of`this`, except those explicitly defined in `changedProps`.\n */\n public clone(changedProps?: TerrainProps): TerrainSettings {\n if (undefined === changedProps)\n return this;\n\n const props = {\n providerName: changedProps.providerName ?? this.providerName,\n dataSource: changedProps.dataSource ?? this.dataSource,\n exaggeration: changedProps.exaggeration ?? this.exaggeration,\n nonLocatable: changedProps.nonLocatable ?? this.nonLocatable,\n applyLighting: changedProps.applyLighting ?? this.applyLighting,\n heightOrigin: changedProps.heightOrigin ?? this.heightOrigin,\n heightOriginMode: changedProps.heightOriginMode ?? this.heightOriginMode,\n };\n\n return TerrainSettings.fromJSON(props);\n }\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { RpcRoutingToken } from "./core/RpcRoutingToken";
|
|
|
7
7
|
/** The RPC interface for working with *snapshot* iModels.
|
|
8
8
|
* This interface is intended for desktop and mobile products. Web products are discouraged from registering this interface.
|
|
9
9
|
* @internal
|
|
10
|
-
* @deprecated in 5.0 -
|
|
10
|
+
* @deprecated in 5.0 - might be removed in next major version. Check [[IpcAppFunctions]] or [[CheckpointConnection]] for replacements.
|
|
11
11
|
*/
|
|
12
12
|
export declare abstract class SnapshotIModelRpcInterface extends RpcInterface {
|
|
13
13
|
/** Returns the SnapshotIModelRpcInterface client instance for the frontend. */
|
|
@@ -19,15 +19,15 @@ export declare abstract class SnapshotIModelRpcInterface extends RpcInterface {
|
|
|
19
19
|
/** The version of the interface. */
|
|
20
20
|
static interfaceVersion: string;
|
|
21
21
|
/**
|
|
22
|
-
* @deprecated in 5.0 -
|
|
22
|
+
* @deprecated in 5.0 - might be removed in next major version. Use [[IpcAppFunctions.openSnapshot]] in IPC applications, no replacement for Web applications.
|
|
23
23
|
*/
|
|
24
24
|
openFile(_filePath: string, _opts?: SnapshotOpenOptions): Promise<IModelConnectionProps>;
|
|
25
25
|
/**
|
|
26
|
-
* @deprecated in 4.10 -
|
|
26
|
+
* @deprecated in 4.10 - might be removed in next major version. Use [[CheckpointConnection.openRemote]].
|
|
27
27
|
*/
|
|
28
28
|
openRemote(_key: string, _opts?: SnapshotOpenOptions): Promise<IModelConnectionProps>;
|
|
29
29
|
/**
|
|
30
|
-
* @deprecated in 5.0 -
|
|
30
|
+
* @deprecated in 5.0 - might be removed in next major version. Use [[IpcAppFunctions.closeIModel]] in IPC applications, no replacement for Web applications.
|
|
31
31
|
*/
|
|
32
32
|
close(_iModelRpcProps: IModelRpcProps): Promise<boolean>;
|
|
33
33
|
}
|
|
@@ -18,7 +18,7 @@ const unknownIModelId = (req) => ({ iModelId: "undefined", key: req.parameters[0
|
|
|
18
18
|
/** The RPC interface for working with *snapshot* iModels.
|
|
19
19
|
* This interface is intended for desktop and mobile products. Web products are discouraged from registering this interface.
|
|
20
20
|
* @internal
|
|
21
|
-
* @deprecated in 5.0 -
|
|
21
|
+
* @deprecated in 5.0 - might be removed in next major version. Check [[IpcAppFunctions]] or [[CheckpointConnection]] for replacements.
|
|
22
22
|
*/
|
|
23
23
|
export class SnapshotIModelRpcInterface extends RpcInterface {
|
|
24
24
|
/** Returns the SnapshotIModelRpcInterface client instance for the frontend. */
|
|
@@ -34,15 +34,15 @@ export class SnapshotIModelRpcInterface extends RpcInterface {
|
|
|
34
34
|
NOTE: Please consult the README in this folder for the semantic versioning rules.
|
|
35
35
|
===========================================================================================*/
|
|
36
36
|
/**
|
|
37
|
-
* @deprecated in 5.0 -
|
|
37
|
+
* @deprecated in 5.0 - might be removed in next major version. Use [[IpcAppFunctions.openSnapshot]] in IPC applications, no replacement for Web applications.
|
|
38
38
|
*/
|
|
39
39
|
async openFile(_filePath, _opts) { return this.forward(arguments); }
|
|
40
40
|
/**
|
|
41
|
-
* @deprecated in 4.10 -
|
|
41
|
+
* @deprecated in 4.10 - might be removed in next major version. Use [[CheckpointConnection.openRemote]].
|
|
42
42
|
*/
|
|
43
43
|
async openRemote(_key, _opts) { return this.forward(arguments); }
|
|
44
44
|
/**
|
|
45
|
-
* @deprecated in 5.0 -
|
|
45
|
+
* @deprecated in 5.0 - might be removed in next major version. Use [[IpcAppFunctions.closeIModel]] in IPC applications, no replacement for Web applications.
|
|
46
46
|
*/
|
|
47
47
|
async close(_iModelRpcProps) { return this.forward(arguments); }
|
|
48
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnapshotIModelRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/SnapshotIModelRpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,MAAM,eAAe,GAA8B,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAEhH;;;;GAIG;AACH,MAAM,OAAgB,0BAA2B,SAAQ,YAAY;IACnE,+EAA+E;IACxE,MAAM,CAAC,SAAS,KAAiC,OAAO,UAAU,CAAC,qBAAqB,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAE9H,qGAAqG;IAC9F,MAAM,CAAC,mBAAmB,CAAC,KAAsB,IAAgC,OAAO,UAAU,CAAC,qBAAqB,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAErK,2CAA2C;IACpC,MAAM,CAAU,aAAa,GAAG,4BAA4B,CAAC;IAEpE,oCAAoC;IAC7B,MAAM,CAAC,gBAAgB,GAAG,OAAO,CAAC;IAEzC;;;iGAG6F;IAE7F;;OAEG;IAEU,AAAN,KAAK,CAAC,QAAQ,CAAC,SAAiB,EAAE,KAA2B,IAAoC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEzI;;OAEG;IAEU,AAAN,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,KAA2B,IAAoC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAEtI;;OAEG;IACI,KAAK,CAAC,KAAK,CAAC,eAA+B,IAAsB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;;AAX5F;IADZ,YAAY,CAAC,eAAe,CAAC,eAAe,CAAC;0DAC2F;AAM5H;IADZ,YAAY,CAAC,eAAe,CAAC,eAAe,CAAC;4DACwF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nimport { IModelConnectionProps, IModelRpcProps, SnapshotOpenOptions } from \"../IModel\";\nimport { RpcInterface } from \"../RpcInterface\";\nimport { RpcManager } from \"../RpcManager\";\nimport { RpcOperation } from \"./core/RpcOperation\";\nimport { RpcRequestTokenSupplier_T } from \"./core/RpcRequest\";\nimport { RpcRoutingToken } from \"./core/RpcRoutingToken\";\n\nconst unknownIModelId: RpcRequestTokenSupplier_T = (req) => ({ iModelId: \"undefined\", key: req.parameters[0] });\n\n/** The RPC interface for working with *snapshot* iModels.\n * This interface is intended for desktop and mobile products. Web products are discouraged from registering this interface.\n * @internal\n * @deprecated in 5.0 -
|
|
1
|
+
{"version":3,"file":"SnapshotIModelRpcInterface.js","sourceRoot":"","sources":["../../../src/rpc/SnapshotIModelRpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB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["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RpcInterface\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nimport { IModelConnectionProps, IModelRpcProps, SnapshotOpenOptions } from \"../IModel\";\nimport { RpcInterface } from \"../RpcInterface\";\nimport { RpcManager } from \"../RpcManager\";\nimport { RpcOperation } from \"./core/RpcOperation\";\nimport { RpcRequestTokenSupplier_T } from \"./core/RpcRequest\";\nimport { RpcRoutingToken } from \"./core/RpcRoutingToken\";\n\nconst unknownIModelId: RpcRequestTokenSupplier_T = (req) => ({ iModelId: \"undefined\", key: req.parameters[0] });\n\n/** The RPC interface for working with *snapshot* iModels.\n * This interface is intended for desktop and mobile products. Web products are discouraged from registering this interface.\n * @internal\n * @deprecated in 5.0 - might be removed in next major version. Check [[IpcAppFunctions]] or [[CheckpointConnection]] for replacements.\n */\nexport abstract class SnapshotIModelRpcInterface extends RpcInterface {\n /** Returns the SnapshotIModelRpcInterface client instance for the frontend. */\n public static getClient(): SnapshotIModelRpcInterface { return RpcManager.getClientForInterface(SnapshotIModelRpcInterface); }\n\n /** Returns the SnapshotIModelRpcInterface client instance for a custom RPC routing configuration. */\n public static getClientForRouting(token: RpcRoutingToken): SnapshotIModelRpcInterface { return RpcManager.getClientForInterface(SnapshotIModelRpcInterface, token); }\n\n /** The immutable name of the interface. */\n public static readonly interfaceName = \"SnapshotIModelRpcInterface\";\n\n /** The version of the interface. */\n public static interfaceVersion = \"2.0.0\";\n\n /*===========================================================================================\n NOTE: Any add/remove/change to the methods below requires an update of the interface version.\n NOTE: Please consult the README in this folder for the semantic versioning rules.\n ===========================================================================================*/\n\n /**\n * @deprecated in 5.0 - might be removed in next major version. Use [[IpcAppFunctions.openSnapshot]] in IPC applications, no replacement for Web applications.\n */\n @RpcOperation.setRoutingProps(unknownIModelId)\n public async openFile(_filePath: string, _opts?: SnapshotOpenOptions): Promise<IModelConnectionProps> { return this.forward(arguments); }\n\n /**\n * @deprecated in 4.10 - might be removed in next major version. Use [[CheckpointConnection.openRemote]].\n */\n @RpcOperation.setRoutingProps(unknownIModelId)\n public async openRemote(_key: string, _opts?: SnapshotOpenOptions): Promise<IModelConnectionProps> { return this.forward(arguments); }\n\n /**\n * @deprecated in 5.0 - might be removed in next major version. Use [[IpcAppFunctions.closeIModel]] in IPC applications, no replacement for Web applications.\n */\n public async close(_iModelRpcProps: IModelRpcProps): Promise<boolean> { return this.forward(arguments); }\n}\n"]}
|
|
@@ -213,7 +213,7 @@ export interface TileContentDescription extends TileContentMetadata {
|
|
|
213
213
|
/** Deserializes tile content metadata.
|
|
214
214
|
* @throws [[TileReadError]]
|
|
215
215
|
* @internal
|
|
216
|
-
* @deprecated in 4.0 -
|
|
216
|
+
* @deprecated in 4.0 - might be removed in next major version. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.
|
|
217
217
|
*/
|
|
218
218
|
export declare function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription;
|
|
219
219
|
/** @internal */
|
|
@@ -603,7 +603,7 @@ export function computeChildTileProps(parent, idProvider, root) {
|
|
|
603
603
|
/** Deserializes tile content metadata.
|
|
604
604
|
* @throws [[TileReadError]]
|
|
605
605
|
* @internal
|
|
606
|
-
* @deprecated in 4.0 -
|
|
606
|
+
* @deprecated in 4.0 - might be removed in next major version. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.
|
|
607
607
|
*/
|
|
608
608
|
export function readTileContentDescription(stream, sizeMultiplier, is2d, options, isVolumeClassifier) {
|
|
609
609
|
return decodeTileContentDescription({ stream, sizeMultiplier, is2d, options, isVolumeClassifier });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../src/tile/TileMetadata.ts"],"names":[],"mappings":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EtE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,OAAO,QAAQ,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,2BAA2B,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACZ,KAAK,CAAU;IACf,mBAAmB,CAAU;IAC7B,QAAQ,CAAc;IAEvC,YAAmB,IAAe,EAAE,IAAa,EAAE,OAAoB;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,mBAAmB,GAAG,SAAS,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,4BAA4B,CAAC;YAC3C,MAAM;YACN,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,kBAAkB,EAAE,IAAI,CAAC,mBAAmB;SAC7C,CAAC,CAAC;QAEH,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,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tile\n */\n\nimport {\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStrings, compareStringsOrUndefined, Id64, Id64String,\n} from \"@itwin/core-bentley\";\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\nimport { BatchType } from \"../FeatureTable\";\nimport { TileProps } from \"../TileProps\";\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\n\n// cspell:ignore imdl mult bitfield\n\n// NB: These constants correspond to those defined in Tile.cpp.\nnamespace Constants {\n export const minToleranceRatioMultiplier = 2;\n}\n\n/** Describes an iModel tile tree.\n * @internal\n */\nexport interface TileTreeMetadata {\n readonly modelId: Id64String;\n readonly is2d: boolean;\n readonly contentRange?: Range3d;\n readonly tileScreenSize: number;\n}\n\n/** Describes the contents of an iModel tile.\n * @internal\n */\nexport interface TileContentMetadata {\n readonly contentRange: Range3d;\n readonly isLeaf: boolean;\n readonly sizeMultiplier?: number;\n readonly emptySubRangeMask: number;\n}\n\n/** Describes an iModel tile.\n * @internal\n */\nexport interface TileMetadata extends TileContentMetadata {\n readonly contentId: string;\n readonly range: Range3d;\n}\n\n/** The type of edges to be produced for iMdl tiles.\n * @see [[EdgeOptions]].\n * @internal\n */\nexport type TileEdgeType = \"compact\" | \"indexed\" | \"non-indexed\";\n\n/** Describes how edges should be produced for tiles in a tile tree.\n * @internal\n */\nexport interface EdgeOptions {\n type: TileEdgeType;\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\n smooth: boolean;\n}\n\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\n if (typeof a !== typeof b)\n return a ? 1 : -1;\n\n if (typeof a === \"boolean\") {\n assert(typeof b === \"boolean\");\n return compareBooleans(a, b);\n }\n\n assert(typeof b === \"object\");\n let cmp = compareStrings(a.type, b.type);\n if (0 === cmp)\n cmp = compareBooleans(a.smooth, b.smooth);\n\n return cmp;\n}\n\n/** @internal */\nexport interface TileOptions {\n readonly maximumMajorTileFormatVersion: number;\n readonly enableInstancing: boolean;\n readonly enableImprovedElision: boolean;\n readonly ignoreAreaPatterns: boolean;\n readonly enableExternalTextures: boolean;\n readonly useProjectExtents: boolean;\n readonly expandProjectExtents: boolean;\n readonly optimizeBRepProcessing: boolean;\n readonly useLargerTiles: boolean;\n readonly disableMagnification: boolean;\n readonly alwaysSubdivideIncompleteTiles: boolean;\n readonly edgeOptions: EdgeOptions;\n readonly disablePolyfaceDecimation: boolean;\n}\n\n/** @internal */\nexport namespace TileOptions {\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\n * compute the [[TileOptions]] that were used to generate the Ids.\n * @throws Error if `treeId` or `contentId` are not valid Ids.\n * @note `treeId` and `contentId` are assumed to be valid Ids. They are not fully parsed and validated - only the information required by this function is extracted.\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\n */\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\n const tree = treeFlagsAndFormatVersionFromId(treeId);\n const contentFlags = contentFlagsFromId(contentId);\n const edgeOptions = edgeOptionsFromTreeId(treeId);\n\n return {\n maximumMajorTileFormatVersion: tree.version,\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\n expandProjectExtents: 0 !== (tree.flags & TreeFlags.ExpandProjectExtents),\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n edgeOptions,\n disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),\n };\n }\n}\n\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\" | \"disablePolyfaceDecimation\">;\ninterface ParsedClassifier {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n}\n\n/** The result of [[parseTileTreeIdAndContentId]].\n * @internal\n */\nexport interface ParsedTileTreeIdAndContentId {\n modelId: Id64String;\n treeId: IModelTileTreeId;\n contentId: ContentIdSpec;\n options: TileOptions;\n}\n\nclass Parser {\n public readonly input: string;\n public curPos = 0;\n\n public constructor(input: string) {\n this.input = input;\n }\n\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\n this.require(this.input.length > 0);\n\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\n while (this.curPos < this.input.length && this.cur() !== \"-\")\n this.advance();\n\n this.eat(\"-\");\n this.require(this.curPos < this.input.length);\n\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\n const animationId = this.parseAnimation();\n\n const primary = classifier ? undefined : this.parsePrimary();\n this.require((undefined === classifier) !== (undefined === primary));\n\n const modelId = this.input.substring(this.curPos);\n this.require(Id64.isId64(modelId));\n\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\n\n let parsedContentId: ContentIdSpec;\n try {\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\n } catch {\n this.reject(\"Invalid content Id\");\n }\n\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\n throw new Error(\"Invalid content Id\");\n\n const disablePolyfaceDecimation = options.disablePolyfaceDecimation;\n let treeId: IModelTileTreeId;\n if (classifier) {\n treeId = { ...classifier, animationId, disablePolyfaceDecimation };\n } else {\n assert(undefined !== primary);\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };\n }\n\n return {\n contentId: parsedContentId,\n modelId,\n options,\n treeId,\n };\n }\n\n private cur(): string {\n this.require(this.curPos < this.input.length);\n return this.input[this.curPos];\n }\n\n private advance(): void {\n this.require(this.curPos < this.input.length);\n ++this.curPos;\n }\n\n private eat(expectedChar: string): void {\n this.require(this.cur() === expectedChar);\n this.advance();\n }\n\n private reject(message = \"Invalid tree Id\"): never {\n throw new Error(message);\n }\n\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\n if (!condition)\n this.reject(message);\n }\n\n private parseClassifier(): ParsedClassifier | undefined {\n this.eat(\"C\");\n let type = BatchType.VolumeClassifier;\n if (this.cur() === \"P\") {\n type = BatchType.PlanarClassifier;\n this.advance();\n }\n\n this.eat(\":\");\n\n // C: or CP: is always folowed by expansion then an underscore.\n let expansionStr = \"\";\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\n expansionStr += this.cur();\n this.advance();\n }\n\n this.eat(\"_\");\n\n const expansion = Number.parseFloat(expansionStr);\n this.require(!Number.isNaN(expansion));\n\n return { type, expansion };\n }\n\n private parseAnimation(): Id64String | undefined {\n if (this.cur() !== \"A\")\n return undefined;\n\n this.eat(\"A\");\n this.eat(\":\");\n\n const termPos = this.input.indexOf(\"_\", this.curPos);\n this.require(termPos > this.curPos);\n\n const animationId = this.input.substring(this.curPos, termPos);\n this.require(Id64.isId64(animationId));\n\n this.curPos = termPos + 1; // Skip \"_\"\n return animationId;\n }\n\n private parsePrimary(): ParsedPrimary {\n const edges = this.parseEdges();\n const sectionCut = this.parseSectionCut();\n return { edges, sectionCut };\n }\n\n private parseEdges(): EdgeOptions | false {\n if (\"E\" !== this.cur())\n return { type: \"non-indexed\", smooth: false };\n\n this.eat(\"E\");\n this.eat(\":\");\n\n const flag = this.cur();\n this.eat(flag);\n this.eat(\"_\");\n\n return \"0\" === flag ? false : edgeOptionsFromFlag(flag);\n }\n\n private parseSectionCut(): string | undefined {\n if (\"S\" !== this.cur())\n return undefined;\n\n this.eat(\"S\");\n const termPos = this.input.indexOf(\"s\", this.curPos);\n this.require(termPos > this.curPos);\n\n const sectionCut = this.input.substring(this.curPos, termPos);\n this.curPos = termPos + 1; // Skip \"_\";\n return sectionCut;\n }\n}\n\n/** @internal */\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\n const parser = new Parser(treeId);\n return parser.parse(contentId);\n}\n\n/** @internal */\nexport const defaultTileOptions: TileOptions = Object.freeze({\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\n enableInstancing: true,\n enableImprovedElision: true,\n ignoreAreaPatterns: false,\n enableExternalTextures: true,\n useProjectExtents: true,\n expandProjectExtents: true,\n optimizeBRepProcessing: true,\n useLargerTiles: true,\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n disablePolyfaceDecimation: false,\n edgeOptions: {\n type: \"compact\" as const,\n smooth: true,\n },\n});\n\nfunction contentFlagsFromId(id: string): ContentFlags {\n if (0 === id.length || \"-\" !== id[0])\n throw new Error(\"Invalid content Id\");\n\n // V4: -flags-d-i-j-k-m - version in tree Id\n const end = id.indexOf(\"-\", 1);\n if (-1 !== end) {\n const flags = Number.parseInt(id.substring(1, end), 16);\n if (!Number.isNaN(flags))\n return flags;\n }\n\n throw new Error(\"Invalid content Id\");\n}\n\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\n if (0 === id.length)\n throw new Error(\"Invalid tree Id\");\n\n let parts = id.split(\"-\");\n if (parts.length > 0) {\n parts = parts[0].split(\"_\");\n if (parts.length === 2) {\n const version = Number.parseInt(parts[0], 16);\n const flags = Number.parseInt(parts[1], 16);\n if (!Number.isNaN(version) || !Number.isNaN(flags))\n return { version, flags };\n }\n }\n\n throw new Error(\"Invalid tree Id\");\n}\n\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\n const pos = id.indexOf(\"E:\");\n if (pos <= 0)\n return { type: \"non-indexed\", smooth: false };\n\n return edgeOptionsFromFlag(id[pos + 2]);\n}\n\nfunction edgeOptionsFromFlag(flag: string): EdgeOptions {\n if (\"0\" === flag)\n return defaultTileOptions.edgeOptions;\n\n const smooth = flag !== \"2\" && flag !== \"5\";\n let type: TileEdgeType;\n switch (flag) {\n case \"2\":\n case \"4\":\n type = \"indexed\";\n break;\n case \"3\":\n type = \"non-indexed\";\n break;\n case \"5\":\n case \"6\":\n type = \"compact\";\n break;\n default:\n throw new Error(\"Invalid tree Id\");\n }\n\n return { type, smooth };\n}\n\nfunction edgeOptionsToString(options: EdgeOptions | false) {\n if (!options)\n return \"E:0_\";\n\n switch (options.type) {\n case \"non-indexed\": return options.smooth ? \"E:3_\" : \"\";\n case \"indexed\": return options.smooth ? \"E:4_\" : \"E:2_\";\n case \"compact\": return options.smooth ? \"E:6_\" : \"E:5_\";\n default: throw new Error(\"Invalid tree Id\");\n }\n}\n\n/** @internal */\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\n // Ensure we do not request tiles of a newer major version than backend can supply or it can read; and also limit major version\n // to that optionally configured by the app.\n let majorVersion = maxMajorVersion;\n if (undefined !== formatVersion)\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\n\n // Version number less than 1 is invalid - ignore\n majorVersion = Math.max(majorVersion, 1);\n\n // Version number greater than current known version ignored\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\n\n // Version numbers are integers - round down\n return Math.max(Math.floor(majorVersion), 1);\n}\n\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\n * @alpha\n */\nexport enum TreeFlags {\n None = 0,\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\n ExpandProjectExtents = 1 << 4, // If UseProjectExtents, round them up/down to nearest powers of ten.\n DisablePolyfaceDecimation = 1 << 5, // Don't attempt to decimate polyfaces in element geometry streams.\n}\n\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\n * @internal\n */\nexport interface PrimaryTileTreeId {\n /** Describes the type of tile tree. */\n type: BatchType.Primary;\n /** The type of edges to include in tile content. */\n edges: EdgeOptions | false;\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\n animationId?: Id64String;\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\n * for ensuring the graphics display with correct priority.\n */\n enforceDisplayPriority?: boolean;\n /** If defined, the compact string representation of a clip vector applied to the tiles to produce cut geometry at the intersections with the clip planes.\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\n * @see [ClipVector.toCompactString[($core-geometry).\n */\n sectionCut?: string;\n disablePolyfaceDecimation?: boolean;\n}\n\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\n * @internal\n */\nexport interface ClassifierTileTreeId {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n animationId?: Id64String;\n disablePolyfaceDecimation?: boolean;\n}\n\nfunction animationIdToString(animationId: Id64String): string {\n return `A:${animationId}_`;\n}\n\n/** Describes the Id of an iModel tile tree.\n * @internal\n */\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\n\n/** Convert a tile tree Id to its string representation.\n * @internal\n */\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\n let idStr = \"\";\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\n if (options.optimizeBRepProcessing)\n flags |= TreeFlags.OptimizeBRepProcessing;\n\n if (options.disablePolyfaceDecimation)\n flags |= TreeFlags.DisablePolyfaceDecimation;\n\n if (options.useLargerTiles)\n flags |= TreeFlags.UseLargerTiles;\n\n if (options.expandProjectExtents)\n flags |= TreeFlags.ExpandProjectExtents;\n\n if (BatchType.Primary === treeId.type) {\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\n flags |= TreeFlags.EnforceDisplayPriority;\n\n const edges = edgeOptionsToString(treeId.edges);\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\n idStr = `${idStr}${edges}${sectionCut}`;\n } else {\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\n\n if (BatchType.VolumeClassifier === treeId.type) {\n // Volume classifiers always use the exact project extents.\n flags |= TreeFlags.UseProjectExtents;\n flags &= ~TreeFlags.ExpandProjectExtents;\n }\n\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n }\n\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\n if (version >= 4) {\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\n idStr = prefix + idStr;\n }\n\n return idStr + modelId;\n}\n\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\n * @internal\n */\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\n let cmp = compareNumbers(lhs.type, rhs.type);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\n\n if (0 !== cmp)\n return cmp;\n\n // NB: The redundant checks on BatchType below are to satisfy compiler.\n assert(lhs.type === rhs.type);\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\n if (0 === cmp) {\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\n }\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\n }\n\n return cmp;\n}\n\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\n * @alpha\n */\nexport enum ContentFlags {\n None = 0,\n AllowInstancing = 1 << 0,\n ImprovedElision = 1 << 1,\n IgnoreAreaPatterns = 1 << 2,\n ExternalTextures = 1 << 3,\n}\n\n/** Describes the components of a tile's content Id.\n *\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\n *\n * The i, j, and k parameters specify how to subdivide the tile's volume. Each sub-division is performed along the longest axis of the\n * volume. The volume is first sub-divided based on `i`, then the result sub-divided based on `j`, and finally that result sub-divided\n * based on `k`.\n *\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\n * produce a higher-resolution tile for the same volume.\n * @internal\n */\ninterface ContentIdSpec {\n depth: number;\n i: number;\n j: number;\n k: number;\n multiplier: number;\n}\n\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\n * the major version of the tile format.\n * @internal\n */\nexport abstract class ContentIdProvider {\n public readonly majorFormatVersion: number;\n public readonly contentFlags: ContentFlags;\n\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\n this.majorFormatVersion = formatVersion;\n this.contentFlags = contentFlags;\n }\n\n public get rootContentId(): string {\n return this.computeId(0, 0, 0, 0, 1);\n }\n\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\n const lastSepPos = parentId.lastIndexOf(this._separator);\n assert(-1 !== lastSepPos);\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\n }\n\n public specFromId(id: string): ContentIdSpec {\n const parts = id.split(this._separator);\n const len = parts.length;\n assert(len >= 5);\n return {\n depth: parseInt(parts[len - 5], 16),\n i: parseInt(parts[len - 4], 16),\n j: parseInt(parts[len - 3], 16),\n k: parseInt(parts[len - 2], 16),\n multiplier: parseInt(parts[len - 1], 16),\n };\n }\n\n public idFromSpec(spec: ContentIdSpec): string {\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\n }\n\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\n const sep = this._separator;\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\n }\n\n protected abstract get _separator(): string;\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\n\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\n * not supply tiles of a format the front-end doesn't recognize.\n */\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\n assert(majorVersion > 0);\n assert(Math.floor(majorVersion) === majorVersion);\n switch (majorVersion) {\n case 0:\n case 1:\n return new ContentIdV1Provider(majorVersion);\n case 2:\n case 3:\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\n default:\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\n }\n }\n}\n\n/** The original (major version 1) tile format used a content Id scheme of the format\n * `depth/i/j/k/multiplier`.\n * @internal\n */\nclass ContentIdV1Provider extends ContentIdProvider {\n public constructor(majorVersion: number) {\n super(majorVersion, ContentFlags.None);\n }\n\n protected get _separator() { return \"/\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\n * @internal\n */\nclass ContentIdV2Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n super(majorVersion, flags);\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"_\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\n * Format: `-flags-depth-i-j-k-multiplier`.\n * @internal\n */\nclass ContentIdV4Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n if (options.enableImprovedElision)\n flags = flags | ContentFlags.ImprovedElision;\n\n if (options.ignoreAreaPatterns)\n flags = flags | ContentFlags.IgnoreAreaPatterns;\n\n if (options.enableExternalTextures)\n flags = flags | ContentFlags.ExternalTextures;\n\n super(majorVersion, flags);\n this._prefix = this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"-\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** @internal */\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y && diag.x > diag.z)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else if (diag.y > diag.z)\n pt.y = (range.low.y + range.high.y) / 2.0;\n else\n pt.z = (range.low.z + range.high.z) / 2.0;\n}\n\n/** @internal */\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else\n pt.y = (range.low.y + range.high.y) / 2.0;\n}\n\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\n * @internal\n */\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\n const emptyMask = tile.emptySubRangeMask;\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n const isEmpty = 0 !== (emptyMask & emptyBit);\n\n const range = tile.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n ranges.push({ range, isEmpty });\n }\n }\n }\n\n return ranges;\n}\n\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\n * @internal\n */\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\n let numEmpty = 0;\n const children: TileProps[] = [];\n\n // Leaf nodes have no children\n if (parent.isLeaf)\n return { children, numEmpty };\n\n // One child, same volume as parent, but higher-resolution.\n if (undefined !== parent.sizeMultiplier) {\n const sizeMultiplier = parent.sizeMultiplier * 2;\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\n children.push({\n contentId,\n range: parent.range,\n contentRange: parent.contentRange,\n sizeMultiplier,\n isLeaf: false,\n maximumSize: root.tileScreenSize,\n });\n\n return { children, numEmpty };\n }\n\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\n const parentSpec = idProvider.specFromId(parent.contentId);\n const childSpec: ContentIdSpec = { ...parentSpec };\n childSpec.depth = parentSpec.depth + 1;\n\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\n // Don't bother creating children or requesting content for such empty volumes.\n const emptyMask = parent.emptySubRangeMask;\n\n // Spatial tree range == project extents; content range == model range.\n // Trivially reject children whose ranges are entirely outside model range.\n let treeContentRange = root.contentRange;\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\n // Parent is wholly within model range - don't bother testing child ranges against it.\n treeContentRange = undefined;\n }\n\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n if (0 !== (emptyMask & emptyBit)) {\n // volume is known to contain no geometry.\n ++numEmpty;\n continue;\n }\n\n const range = parent.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\n // volume is within project extents but entirely outside model range\n ++numEmpty;\n continue;\n }\n\n childSpec.i = parentSpec.i * 2 + i;\n childSpec.j = parentSpec.j * 2 + j;\n childSpec.k = parentSpec.k * 2 + k;\n\n const childId = idProvider.idFromSpec(childSpec);\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\n }\n }\n }\n\n return { children, numEmpty };\n}\n\n/** @internal */\nexport interface TileContentDescription extends TileContentMetadata {\n readonly featureTableStartPos: number;\n}\n\n/** Deserializes tile content metadata.\n * @throws [[TileReadError]]\n * @internal\n * @deprecated in 4.0 - will not be removed until after 2026-06-13. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.\n */\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\n return decodeTileContentDescription({ stream, sizeMultiplier, is2d, options, isVolumeClassifier });\n}\n\n/** @internal */\nexport interface DecodeTileContentDescriptionArgs {\n stream: ByteStream;\n options: TileOptions;\n isVolumeClassifier?: boolean;\n is2d?: boolean;\n sizeMultiplier?: number;\n isLeaf?: boolean;\n}\n\n/** @internal */\nexport function decodeTileContentDescription(args: DecodeTileContentDescriptionArgs): TileContentDescription {\n const { stream, options } = args;\n const isVolumeClassifier = args.isVolumeClassifier ?? false;\n\n stream.reset();\n\n const header = new ImdlHeader(stream);\n if (!header.isValid)\n throw new TileReadError(TileReadStatus.InvalidHeader);\n else if (!header.isReadableVersion)\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\n\n // Skip the feature table.\n const featureTableStartPos = stream.curPos;\n const ftHeader = FeatureTableHeader.readFrom(stream);\n if (undefined === ftHeader)\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\n\n stream.curPos = featureTableStartPos + ftHeader.length;\n\n let sizeMultiplier = args.sizeMultiplier;\n let isLeaf = args.isLeaf;\n if (undefined === isLeaf) {\n // Determine subdivision based on header data.\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\n isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\n if (!isLeaf) {\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\n // can be adversely affected by quantization issues when zooming in closely.\n const maxLeafTolerance = 1.0;\n\n // Must sub-divide if tile explicitly specifies...\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\n canSkipSubdivision = canSkipSubdivision && !args.is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\n // ...or app specifies incomplete tiles must always be sub-divided.\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\n if (canSkipSubdivision) {\n const minElementsPerTile = 100;\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\n if (!containsCurves)\n isLeaf = true;\n else if (undefined === sizeMultiplier)\n sizeMultiplier = 1.0;\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\n sizeMultiplier = 1.0;\n }\n }\n }\n }\n\n return {\n featureTableStartPos,\n contentRange: header.contentRange,\n isLeaf,\n sizeMultiplier,\n emptySubRangeMask: header.emptySubRanges,\n };\n}\n\nconst scratchRangeDiagonal = new Vector3d();\n\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\n * @internal\n */\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\n if (tile.range.isNull)\n return 0;\n\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\n\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\n}\n\n/** Deserializes tile metadata.\n * @internal\n */\nexport class TileMetadataReader {\n private readonly _is2d: boolean;\n private readonly _isVolumeClassifier: boolean;\n private readonly _options: TileOptions;\n\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\n this._is2d = is2d;\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\n this._options = options;\n }\n\n /** Produce metadata from the specified tile content.\n * @throws [[TileReadError]]\n */\n public read(stream: ByteStream, props: TileProps): TileMetadata {\n const content = decodeTileContentDescription({\n stream,\n sizeMultiplier: props.sizeMultiplier,\n is2d: this._is2d,\n options: this._options,\n isVolumeClassifier: this._isVolumeClassifier,\n });\n\n return {\n contentRange: content.contentRange,\n isLeaf: content.isLeaf,\n sizeMultiplier: content.sizeMultiplier,\n emptySubRangeMask: content.emptySubRangeMask,\n range: Range3d.fromJSON(props.range),\n contentId: props.contentId,\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TileMetadata.js","sourceRoot":"","sources":["../../../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AQ,CAAC,WAAW,EAAE,CAAC;IAEtE,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,OAAO,QAAQ,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,2BAA2B,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACjG,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,kBAAkB;IACZ,KAAK,CAAU;IACf,mBAAmB,CAAU;IAC7B,QAAQ,CAAc;IAEvC,YAAmB,IAAe,EAAE,IAAa,EAAE,OAAoB;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,mBAAmB,GAAG,SAAS,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,4BAA4B,CAAC;YAC3C,MAAM;YACN,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,kBAAkB,EAAE,IAAI,CAAC,mBAAmB;SAC7C,CAAC,CAAC;QAEH,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,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tile\n */\n\nimport {\n assert, ByteStream, compareBooleans, compareBooleansOrUndefined, compareNumbers, compareStrings, compareStringsOrUndefined, Id64, Id64String,\n} from \"@itwin/core-bentley\";\nimport { Range3d, Vector3d } from \"@itwin/core-geometry\";\nimport { BatchType } from \"../FeatureTable\";\nimport { TileProps } from \"../TileProps\";\nimport { CurrentImdlVersion, FeatureTableHeader, ImdlFlags, ImdlHeader } from \"./IModelTileIO\";\nimport { TileReadError, TileReadStatus } from \"./TileIO\";\n\n// cspell:ignore imdl mult bitfield\n\n// NB: These constants correspond to those defined in Tile.cpp.\nnamespace Constants {\n export const minToleranceRatioMultiplier = 2;\n}\n\n/** Describes an iModel tile tree.\n * @internal\n */\nexport interface TileTreeMetadata {\n readonly modelId: Id64String;\n readonly is2d: boolean;\n readonly contentRange?: Range3d;\n readonly tileScreenSize: number;\n}\n\n/** Describes the contents of an iModel tile.\n * @internal\n */\nexport interface TileContentMetadata {\n readonly contentRange: Range3d;\n readonly isLeaf: boolean;\n readonly sizeMultiplier?: number;\n readonly emptySubRangeMask: number;\n}\n\n/** Describes an iModel tile.\n * @internal\n */\nexport interface TileMetadata extends TileContentMetadata {\n readonly contentId: string;\n readonly range: Range3d;\n}\n\n/** The type of edges to be produced for iMdl tiles.\n * @see [[EdgeOptions]].\n * @internal\n */\nexport type TileEdgeType = \"compact\" | \"indexed\" | \"non-indexed\";\n\n/** Describes how edges should be produced for tiles in a tile tree.\n * @internal\n */\nexport interface EdgeOptions {\n type: TileEdgeType;\n /** For polyfaces that lack edge visibility information, generate edges for all faces; otherwise, infer edges from mesh topology. */\n smooth: boolean;\n}\n\nfunction compareEdgeOptions(a: EdgeOptions | false, b: EdgeOptions | false): number {\n if (typeof a !== typeof b)\n return a ? 1 : -1;\n\n if (typeof a === \"boolean\") {\n assert(typeof b === \"boolean\");\n return compareBooleans(a, b);\n }\n\n assert(typeof b === \"object\");\n let cmp = compareStrings(a.type, b.type);\n if (0 === cmp)\n cmp = compareBooleans(a.smooth, b.smooth);\n\n return cmp;\n}\n\n/** @internal */\nexport interface TileOptions {\n readonly maximumMajorTileFormatVersion: number;\n readonly enableInstancing: boolean;\n readonly enableImprovedElision: boolean;\n readonly ignoreAreaPatterns: boolean;\n readonly enableExternalTextures: boolean;\n readonly useProjectExtents: boolean;\n readonly expandProjectExtents: boolean;\n readonly optimizeBRepProcessing: boolean;\n readonly useLargerTiles: boolean;\n readonly disableMagnification: boolean;\n readonly alwaysSubdivideIncompleteTiles: boolean;\n readonly edgeOptions: EdgeOptions;\n readonly disablePolyfaceDecimation: boolean;\n}\n\n/** @internal */\nexport namespace TileOptions {\n /** Given the string representation of an [[IModelTileTreeId]] and the contentId of a [Tile]($frontend) belonging to that [TileTree]($frontend),\n * compute the [[TileOptions]] that were used to generate the Ids.\n * @throws Error if `treeId` or `contentId` are not valid Ids.\n * @note `treeId` and `contentId` are assumed to be valid Ids. They are not fully parsed and validated - only the information required by this function is extracted.\n * @note `treeId` and `contentId` are assumed to have been produced for version 4 or later of the iMdl tile format.\n */\n export function fromTreeIdAndContentId(treeId: string, contentId: string): TileOptions {\n const tree = treeFlagsAndFormatVersionFromId(treeId);\n const contentFlags = contentFlagsFromId(contentId);\n const edgeOptions = edgeOptionsFromTreeId(treeId);\n\n return {\n maximumMajorTileFormatVersion: tree.version,\n enableInstancing: 0 !== (contentFlags & ContentFlags.AllowInstancing),\n enableImprovedElision: 0 !== (contentFlags & ContentFlags.ImprovedElision),\n ignoreAreaPatterns: 0 !== (contentFlags & ContentFlags.IgnoreAreaPatterns),\n enableExternalTextures: 0 !== (contentFlags & ContentFlags.ExternalTextures),\n useProjectExtents: 0 !== (tree.flags & TreeFlags.UseProjectExtents),\n expandProjectExtents: 0 !== (tree.flags & TreeFlags.ExpandProjectExtents),\n optimizeBRepProcessing: 0 !== (tree.flags & TreeFlags.OptimizeBRepProcessing),\n useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n edgeOptions,\n disablePolyfaceDecimation: 0 !== (tree.flags & TreeFlags.DisablePolyfaceDecimation),\n };\n }\n}\n\ntype ParsedPrimary = Omit<PrimaryTileTreeId, \"type\" | \"animationId\" | \"enforceDisplayPriority\" | \"disablePolyfaceDecimation\">;\ninterface ParsedClassifier {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n}\n\n/** The result of [[parseTileTreeIdAndContentId]].\n * @internal\n */\nexport interface ParsedTileTreeIdAndContentId {\n modelId: Id64String;\n treeId: IModelTileTreeId;\n contentId: ContentIdSpec;\n options: TileOptions;\n}\n\nclass Parser {\n public readonly input: string;\n public curPos = 0;\n\n public constructor(input: string) {\n this.input = input;\n }\n\n public parse(contentId: string): ParsedTileTreeIdAndContentId {\n this.require(this.input.length > 0);\n\n // Skip version and flags, they're handled by TileOptions.fromTreeIdAndContentId\n while (this.curPos < this.input.length && this.cur() !== \"-\")\n this.advance();\n\n this.eat(\"-\");\n this.require(this.curPos < this.input.length);\n\n const classifier = this.cur() === \"C\" ? this.parseClassifier() : undefined;\n const animationId = this.parseAnimation();\n\n const primary = classifier ? undefined : this.parsePrimary();\n this.require((undefined === classifier) !== (undefined === primary));\n\n const modelId = this.input.substring(this.curPos);\n this.require(Id64.isId64(modelId));\n\n const { flags: treeFlags } = treeFlagsAndFormatVersionFromId(this.input);\n const options = TileOptions.fromTreeIdAndContentId(this.input, contentId);\n\n let parsedContentId: ContentIdSpec;\n try {\n parsedContentId = ContentIdProvider.create(true, options).specFromId(contentId);\n } catch {\n this.reject(\"Invalid content Id\");\n }\n\n if (Object.keys(parsedContentId).some((key) => parsedContentId.hasOwnProperty(key) && typeof parsedContentId[key as keyof ContentIdSpec] === \"number\" && !Number.isFinite(parsedContentId[key as keyof ContentIdSpec])))\n throw new Error(\"Invalid content Id\");\n\n const disablePolyfaceDecimation = options.disablePolyfaceDecimation;\n let treeId: IModelTileTreeId;\n if (classifier) {\n treeId = { ...classifier, animationId, disablePolyfaceDecimation };\n } else {\n assert(undefined !== primary);\n const enforceDisplayPriority = (treeFlags & TreeFlags.EnforceDisplayPriority) !== 0 ? true : undefined;\n treeId = { ...primary, animationId, type: BatchType.Primary, enforceDisplayPriority, disablePolyfaceDecimation };\n }\n\n return {\n contentId: parsedContentId,\n modelId,\n options,\n treeId,\n };\n }\n\n private cur(): string {\n this.require(this.curPos < this.input.length);\n return this.input[this.curPos];\n }\n\n private advance(): void {\n this.require(this.curPos < this.input.length);\n ++this.curPos;\n }\n\n private eat(expectedChar: string): void {\n this.require(this.cur() === expectedChar);\n this.advance();\n }\n\n private reject(message = \"Invalid tree Id\"): never {\n throw new Error(message);\n }\n\n private require(condition: boolean, message = \"Invalid tree Id\"): asserts condition {\n if (!condition)\n this.reject(message);\n }\n\n private parseClassifier(): ParsedClassifier | undefined {\n this.eat(\"C\");\n let type = BatchType.VolumeClassifier;\n if (this.cur() === \"P\") {\n type = BatchType.PlanarClassifier;\n this.advance();\n }\n\n this.eat(\":\");\n\n // C: or CP: is always folowed by expansion then an underscore.\n let expansionStr = \"\";\n while (this.curPos < this.input.length && (this.cur() >= \"0\" && this.cur() <= \"9\" || this.cur() === \".\")) {\n expansionStr += this.cur();\n this.advance();\n }\n\n this.eat(\"_\");\n\n const expansion = Number.parseFloat(expansionStr);\n this.require(!Number.isNaN(expansion));\n\n return { type, expansion };\n }\n\n private parseAnimation(): Id64String | undefined {\n if (this.cur() !== \"A\")\n return undefined;\n\n this.eat(\"A\");\n this.eat(\":\");\n\n const termPos = this.input.indexOf(\"_\", this.curPos);\n this.require(termPos > this.curPos);\n\n const animationId = this.input.substring(this.curPos, termPos);\n this.require(Id64.isId64(animationId));\n\n this.curPos = termPos + 1; // Skip \"_\"\n return animationId;\n }\n\n private parsePrimary(): ParsedPrimary {\n const edges = this.parseEdges();\n const sectionCut = this.parseSectionCut();\n return { edges, sectionCut };\n }\n\n private parseEdges(): EdgeOptions | false {\n if (\"E\" !== this.cur())\n return { type: \"non-indexed\", smooth: false };\n\n this.eat(\"E\");\n this.eat(\":\");\n\n const flag = this.cur();\n this.eat(flag);\n this.eat(\"_\");\n\n return \"0\" === flag ? false : edgeOptionsFromFlag(flag);\n }\n\n private parseSectionCut(): string | undefined {\n if (\"S\" !== this.cur())\n return undefined;\n\n this.eat(\"S\");\n const termPos = this.input.indexOf(\"s\", this.curPos);\n this.require(termPos > this.curPos);\n\n const sectionCut = this.input.substring(this.curPos, termPos);\n this.curPos = termPos + 1; // Skip \"_\";\n return sectionCut;\n }\n}\n\n/** @internal */\nexport function parseTileTreeIdAndContentId(treeId: string, contentId: string): ParsedTileTreeIdAndContentId {\n const parser = new Parser(treeId);\n return parser.parse(contentId);\n}\n\n/** @internal */\nexport const defaultTileOptions: TileOptions = Object.freeze({\n maximumMajorTileFormatVersion: CurrentImdlVersion.Major,\n enableInstancing: true,\n enableImprovedElision: true,\n ignoreAreaPatterns: false,\n enableExternalTextures: true,\n useProjectExtents: true,\n expandProjectExtents: true,\n optimizeBRepProcessing: true,\n useLargerTiles: true,\n disableMagnification: false,\n alwaysSubdivideIncompleteTiles: false,\n disablePolyfaceDecimation: false,\n edgeOptions: {\n type: \"compact\" as const,\n smooth: true,\n },\n});\n\nfunction contentFlagsFromId(id: string): ContentFlags {\n if (0 === id.length || \"-\" !== id[0])\n throw new Error(\"Invalid content Id\");\n\n // V4: -flags-d-i-j-k-m - version in tree Id\n const end = id.indexOf(\"-\", 1);\n if (-1 !== end) {\n const flags = Number.parseInt(id.substring(1, end), 16);\n if (!Number.isNaN(flags))\n return flags;\n }\n\n throw new Error(\"Invalid content Id\");\n}\n\nfunction treeFlagsAndFormatVersionFromId(id: string): { flags: TreeFlags, version: number } {\n if (0 === id.length)\n throw new Error(\"Invalid tree Id\");\n\n let parts = id.split(\"-\");\n if (parts.length > 0) {\n parts = parts[0].split(\"_\");\n if (parts.length === 2) {\n const version = Number.parseInt(parts[0], 16);\n const flags = Number.parseInt(parts[1], 16);\n if (!Number.isNaN(version) || !Number.isNaN(flags))\n return { version, flags };\n }\n }\n\n throw new Error(\"Invalid tree Id\");\n}\n\nfunction edgeOptionsFromTreeId(id: string): EdgeOptions {\n const pos = id.indexOf(\"E:\");\n if (pos <= 0)\n return { type: \"non-indexed\", smooth: false };\n\n return edgeOptionsFromFlag(id[pos + 2]);\n}\n\nfunction edgeOptionsFromFlag(flag: string): EdgeOptions {\n if (\"0\" === flag)\n return defaultTileOptions.edgeOptions;\n\n const smooth = flag !== \"2\" && flag !== \"5\";\n let type: TileEdgeType;\n switch (flag) {\n case \"2\":\n case \"4\":\n type = \"indexed\";\n break;\n case \"3\":\n type = \"non-indexed\";\n break;\n case \"5\":\n case \"6\":\n type = \"compact\";\n break;\n default:\n throw new Error(\"Invalid tree Id\");\n }\n\n return { type, smooth };\n}\n\nfunction edgeOptionsToString(options: EdgeOptions | false) {\n if (!options)\n return \"E:0_\";\n\n switch (options.type) {\n case \"non-indexed\": return options.smooth ? \"E:3_\" : \"\";\n case \"indexed\": return options.smooth ? \"E:4_\" : \"E:2_\";\n case \"compact\": return options.smooth ? \"E:6_\" : \"E:5_\";\n default: throw new Error(\"Invalid tree Id\");\n }\n}\n\n/** @internal */\nexport function getMaximumMajorTileFormatVersion(maxMajorVersion: number, formatVersion?: number): number {\n // The `formatVersion` input is from the backend, telling us precisely the maximum major+minor version it can produce.\n // Ensure we do not request tiles of a newer major version than backend can supply or it can read; and also limit major version\n // to that optionally configured by the app.\n let majorVersion = maxMajorVersion;\n if (undefined !== formatVersion)\n majorVersion = Math.min((formatVersion >>> 0x10), majorVersion);\n\n // Version number less than 1 is invalid - ignore\n majorVersion = Math.max(majorVersion, 1);\n\n // Version number greater than current known version ignored\n majorVersion = Math.min(majorVersion, CurrentImdlVersion.Major);\n\n // Version numbers are integers - round down\n return Math.max(Math.floor(majorVersion), 1);\n}\n\n/** Flags controlling the structure of a tile tree. The flags are part of the tile tree's Id.\n * @alpha\n */\nexport enum TreeFlags {\n None = 0,\n UseProjectExtents = 1 << 0, // Use project extents as the basis of the tile tree's range.\n EnforceDisplayPriority = 1 << 1, // For 3d plan projection models, group graphics into layers based on subcategory.\n OptimizeBRepProcessing = 1 << 2, // Use an optimized pipeline for producing facets from BRep entities.\n UseLargerTiles = 1 << 3, // Produce tiles of larger size in screen pixels.\n ExpandProjectExtents = 1 << 4, // If UseProjectExtents, round them up/down to nearest powers of ten.\n DisablePolyfaceDecimation = 1 << 5, // Don't attempt to decimate polyfaces in element geometry streams.\n}\n\n/** Describes a tile tree used to draw the contents of a model, possibly with embedded animation.\n * @internal\n */\nexport interface PrimaryTileTreeId {\n /** Describes the type of tile tree. */\n type: BatchType.Primary;\n /** The type of edges to include in tile content. */\n edges: EdgeOptions | false;\n /** Id of the [DisplayStyle]($backend) or [RenderTimeline]($backend) element holding the [[RenderSchedule]] script to be applied to the tiles. */\n animationId?: Id64String;\n /** If true, meshes within the tiles will be grouped into nodes based on the display priority associated with their subcategories,\n * for ensuring the graphics display with correct priority.\n */\n enforceDisplayPriority?: boolean;\n /** If defined, the compact string representation of a clip vector applied to the tiles to produce cut geometry at the intersections with the clip planes.\n * Any geometry *not* intersecting the clip planes is omitted from the tiles.\n * @see [ClipVector.toCompactString[($core-geometry).\n */\n sectionCut?: string;\n disablePolyfaceDecimation?: boolean;\n}\n\n/** Describes a tile tree that can classify the contents of other tile trees using the model's geometry.\n * @internal\n */\nexport interface ClassifierTileTreeId {\n type: BatchType.VolumeClassifier | BatchType.PlanarClassifier;\n expansion: number;\n animationId?: Id64String;\n disablePolyfaceDecimation?: boolean;\n}\n\nfunction animationIdToString(animationId: Id64String): string {\n return `A:${animationId}_`;\n}\n\n/** Describes the Id of an iModel tile tree.\n * @internal\n */\nexport type IModelTileTreeId = PrimaryTileTreeId | ClassifierTileTreeId;\n\n/** Convert a tile tree Id to its string representation.\n * @internal\n */\nexport function iModelTileTreeIdToString(modelId: Id64String, treeId: IModelTileTreeId, options: TileOptions): string {\n let idStr = \"\";\n let flags = options.useProjectExtents ? TreeFlags.UseProjectExtents : TreeFlags.None;\n if (options.optimizeBRepProcessing)\n flags |= TreeFlags.OptimizeBRepProcessing;\n\n if (options.disablePolyfaceDecimation)\n flags |= TreeFlags.DisablePolyfaceDecimation;\n\n if (options.useLargerTiles)\n flags |= TreeFlags.UseLargerTiles;\n\n if (options.expandProjectExtents)\n flags |= TreeFlags.ExpandProjectExtents;\n\n if (BatchType.Primary === treeId.type) {\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive\n flags |= TreeFlags.EnforceDisplayPriority;\n\n const edges = edgeOptionsToString(treeId.edges);\n const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : \"\";\n idStr = `${idStr}${edges}${sectionCut}`;\n } else {\n const typeStr = BatchType.PlanarClassifier === treeId.type ? \"CP\" : \"C\";\n idStr = `${idStr + typeStr}:${treeId.expansion.toFixed(6)}_`;\n\n if (BatchType.VolumeClassifier === treeId.type) {\n // Volume classifiers always use the exact project extents.\n flags |= TreeFlags.UseProjectExtents;\n flags &= ~TreeFlags.ExpandProjectExtents;\n }\n\n if (undefined !== treeId.animationId)\n idStr = `${idStr}${animationIdToString(treeId.animationId)}`;\n }\n\n const version = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion);\n if (version >= 4) {\n const prefix = `${version.toString(16)}_${flags.toString(16)}-`;\n idStr = prefix + idStr;\n }\n\n return idStr + modelId;\n}\n\n/** Ordinal comparison of two tile tree Ids, e.g., for use in sorted containers.\n * @internal\n */\nexport function compareIModelTileTreeIds(lhs: IModelTileTreeId, rhs: IModelTileTreeId): number {\n let cmp = compareNumbers(lhs.type, rhs.type);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.animationId, rhs.animationId);\n\n if (0 !== cmp)\n return cmp;\n\n // NB: The redundant checks on BatchType below are to satisfy compiler.\n assert(lhs.type === rhs.type);\n if (BatchType.Primary === lhs.type && BatchType.Primary === rhs.type) {\n cmp = compareEdgeOptions(lhs.edges, rhs.edges);\n if (0 === cmp) {\n cmp = compareBooleansOrUndefined(lhs.enforceDisplayPriority, rhs.enforceDisplayPriority);\n if (0 === cmp)\n cmp = compareStringsOrUndefined(lhs.sectionCut, rhs.sectionCut);\n }\n } else if (BatchType.Primary !== lhs.type && BatchType.Primary !== rhs.type) {\n cmp = compareNumbers(lhs.expansion, rhs.expansion);\n }\n\n return cmp;\n}\n\n/** Flags controlling how tile content is produced. The flags are part of the ContentId.\n * @alpha\n */\nexport enum ContentFlags {\n None = 0,\n AllowInstancing = 1 << 0,\n ImprovedElision = 1 << 1,\n IgnoreAreaPatterns = 1 << 2,\n ExternalTextures = 1 << 3,\n}\n\n/** Describes the components of a tile's content Id.\n *\n * The depth specifies how many subdivisions from the root tile are to be performed to reach the sub-volume of interest.\n *\n * The i, j, and k parameters specify how to subdivide the tile's volume. Each sub-division is performed along the longest axis of the\n * volume. The volume is first sub-divided based on `i`, then the result sub-divided based on `j`, and finally that result sub-divided\n * based on `k`.\n *\n * The multiplier is an integer - generally a power of two - multiplied by the screen size of a tile (512 pixels) used to\n * produce a higher-resolution tile for the same volume.\n * @internal\n */\ninterface ContentIdSpec {\n depth: number;\n i: number;\n j: number;\n k: number;\n multiplier: number;\n}\n\n/** Contains logic for working with tile content Ids according to a specific content Id scheme. Which scheme is used depends on\n * the major version of the tile format.\n * @internal\n */\nexport abstract class ContentIdProvider {\n public readonly majorFormatVersion: number;\n public readonly contentFlags: ContentFlags;\n\n protected constructor(formatVersion: number, contentFlags: ContentFlags) {\n this.majorFormatVersion = formatVersion;\n this.contentFlags = contentFlags;\n }\n\n public get rootContentId(): string {\n return this.computeId(0, 0, 0, 0, 1);\n }\n\n public idFromParentAndMultiplier(parentId: string, multiplier: number): string {\n const lastSepPos = parentId.lastIndexOf(this._separator);\n assert(-1 !== lastSepPos);\n return parentId.substring(0, lastSepPos + 1) + multiplier.toString(16);\n }\n\n public specFromId(id: string): ContentIdSpec {\n const parts = id.split(this._separator);\n const len = parts.length;\n assert(len >= 5);\n return {\n depth: parseInt(parts[len - 5], 16),\n i: parseInt(parts[len - 4], 16),\n j: parseInt(parts[len - 3], 16),\n k: parseInt(parts[len - 2], 16),\n multiplier: parseInt(parts[len - 1], 16),\n };\n }\n\n public idFromSpec(spec: ContentIdSpec): string {\n return this.computeId(spec.depth, spec.i, spec.j, spec.k, spec.multiplier);\n }\n\n protected join(depth: number, i: number, j: number, k: number, mult: number): string {\n const sep = this._separator;\n return depth.toString(16) + sep + i.toString(16) + sep + j.toString(16) + sep + k.toString(16) + sep + mult.toString(16);\n }\n\n protected abstract get _separator(): string;\n protected abstract computeId(depth: number, i: number, j: number, k: number, mult: number): string;\n\n /** formatVersion is the maximum major version supported by the back-end supplying the tile tree.\n * Must ensure front-end does not request tiles of a format the back-end cannot supply, and back-end does\n * not supply tiles of a format the front-end doesn't recognize.\n */\n public static create(allowInstancing: boolean, options: TileOptions, formatVersion?: number): ContentIdProvider {\n const majorVersion = getMaximumMajorTileFormatVersion(options.maximumMajorTileFormatVersion, formatVersion);\n assert(majorVersion > 0);\n assert(Math.floor(majorVersion) === majorVersion);\n switch (majorVersion) {\n case 0:\n case 1:\n return new ContentIdV1Provider(majorVersion);\n case 2:\n case 3:\n return new ContentIdV2Provider(majorVersion, allowInstancing, options);\n default:\n return new ContentIdV4Provider(allowInstancing, options, majorVersion);\n }\n }\n}\n\n/** The original (major version 1) tile format used a content Id scheme of the format\n * `depth/i/j/k/multiplier`.\n * @internal\n */\nclass ContentIdV1Provider extends ContentIdProvider {\n public constructor(majorVersion: number) {\n super(majorVersion, ContentFlags.None);\n }\n\n protected get _separator() { return \"/\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 2 and 3 use a content Id scheme encoding styling flags and the major format version\n * into the content Id, of the format `_majorVersion_flags_depth_i_j_k_multiplier`.\n * @internal\n */\nclass ContentIdV2Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(majorVersion: number, allowInstancing: boolean, options: TileOptions) {\n const flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n super(majorVersion, flags);\n this._prefix = this._separator + majorVersion.toString(16) + this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"_\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** Tile formats 4+ encode styling flags but not major format version. (The version is specified by the tile tree's Id).\n * Format: `-flags-depth-i-j-k-multiplier`.\n * @internal\n */\nclass ContentIdV4Provider extends ContentIdProvider {\n private readonly _prefix: string;\n\n public constructor(allowInstancing: boolean, options: TileOptions, majorVersion: number) {\n let flags = (allowInstancing && options.enableInstancing) ? ContentFlags.AllowInstancing : ContentFlags.None;\n if (options.enableImprovedElision)\n flags = flags | ContentFlags.ImprovedElision;\n\n if (options.ignoreAreaPatterns)\n flags = flags | ContentFlags.IgnoreAreaPatterns;\n\n if (options.enableExternalTextures)\n flags = flags | ContentFlags.ExternalTextures;\n\n super(majorVersion, flags);\n this._prefix = this._separator + flags.toString(16) + this._separator;\n }\n\n protected get _separator() { return \"-\"; }\n protected computeId(depth: number, i: number, j: number, k: number, mult: number): string {\n return this._prefix + this.join(depth, i, j, k, mult);\n }\n}\n\n/** @internal */\nexport function bisectTileRange3d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y && diag.x > diag.z)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else if (diag.y > diag.z)\n pt.y = (range.low.y + range.high.y) / 2.0;\n else\n pt.z = (range.low.z + range.high.z) / 2.0;\n}\n\n/** @internal */\nexport function bisectTileRange2d(range: Range3d, takeUpper: boolean): void {\n const diag = range.diagonal();\n const pt = takeUpper ? range.high : range.low;\n if (diag.x > diag.y)\n pt.x = (range.low.x + range.high.x) / 2.0;\n else\n pt.y = (range.low.y + range.high.y) / 2.0;\n}\n\n/** Given a description of a tile, compute the ranges which would result from sub-dividing its range into 4 or 8 sub-volumes.\n * @internal\n */\nexport function computeChildTileRanges(tile: TileMetadata, root: TileTreeMetadata): Array<{ range: Range3d, isEmpty: boolean }> {\n const emptyMask = tile.emptySubRangeMask;\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n\n const ranges: Array<{ range: Range3d, isEmpty: boolean }> = [];\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n const isEmpty = 0 !== (emptyMask & emptyBit);\n\n const range = tile.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n ranges.push({ range, isEmpty });\n }\n }\n }\n\n return ranges;\n}\n\n/** Given a description of the parent tile, obtain the properties of its child tiles, and the number of empty children.\n * @internal\n */\nexport function computeChildTileProps(parent: TileMetadata, idProvider: ContentIdProvider, root: TileTreeMetadata): { children: TileProps[], numEmpty: number } {\n let numEmpty = 0;\n const children: TileProps[] = [];\n\n // Leaf nodes have no children\n if (parent.isLeaf)\n return { children, numEmpty };\n\n // One child, same volume as parent, but higher-resolution.\n if (undefined !== parent.sizeMultiplier) {\n const sizeMultiplier = parent.sizeMultiplier * 2;\n const contentId = idProvider.idFromParentAndMultiplier(parent.contentId, sizeMultiplier);\n children.push({\n contentId,\n range: parent.range,\n contentRange: parent.contentRange,\n sizeMultiplier,\n isLeaf: false,\n maximumSize: root.tileScreenSize,\n });\n\n return { children, numEmpty };\n }\n\n // Sub-divide parent's range into 4 (for 2d trees) or 8 (for 3d trees) child tiles.\n const parentSpec = idProvider.specFromId(parent.contentId);\n const childSpec: ContentIdSpec = { ...parentSpec };\n childSpec.depth = parentSpec.depth + 1;\n\n // This mask is a bitfield in which an 'on' bit indicates sub-volume containing no geometry.\n // Don't bother creating children or requesting content for such empty volumes.\n const emptyMask = parent.emptySubRangeMask;\n\n // Spatial tree range == project extents; content range == model range.\n // Trivially reject children whose ranges are entirely outside model range.\n let treeContentRange = root.contentRange;\n if (undefined !== treeContentRange && treeContentRange.containsRange(parent.range)) {\n // Parent is wholly within model range - don't bother testing child ranges against it.\n treeContentRange = undefined;\n }\n\n const is2d = root.is2d;\n const bisectRange = is2d ? bisectTileRange2d : bisectTileRange3d;\n for (let i = 0; i < 2; i++) {\n for (let j = 0; j < 2; j++) {\n for (let k = 0; k < (is2d ? 1 : 2); k++) {\n const emptyBit = 1 << (i + j * 2 + k * 4);\n if (0 !== (emptyMask & emptyBit)) {\n // volume is known to contain no geometry.\n ++numEmpty;\n continue;\n }\n\n const range = parent.range.clone();\n bisectRange(range, 0 === i);\n bisectRange(range, 0 === j);\n if (!is2d)\n bisectRange(range, 0 === k);\n\n if (undefined !== treeContentRange && !range.intersectsRange(treeContentRange)) {\n // volume is within project extents but entirely outside model range\n ++numEmpty;\n continue;\n }\n\n childSpec.i = parentSpec.i * 2 + i;\n childSpec.j = parentSpec.j * 2 + j;\n childSpec.k = parentSpec.k * 2 + k;\n\n const childId = idProvider.idFromSpec(childSpec);\n children.push({ contentId: childId, range, maximumSize: root.tileScreenSize });\n }\n }\n }\n\n return { children, numEmpty };\n}\n\n/** @internal */\nexport interface TileContentDescription extends TileContentMetadata {\n readonly featureTableStartPos: number;\n}\n\n/** Deserializes tile content metadata.\n * @throws [[TileReadError]]\n * @internal\n * @deprecated in 4.0 - might be removed in next major version. Use decodeTileContentDescription. I think tile agents (or their tests) are using this function.\n */\nexport function readTileContentDescription(stream: ByteStream, sizeMultiplier: number | undefined, is2d: boolean, options: TileOptions, isVolumeClassifier: boolean): TileContentDescription {\n return decodeTileContentDescription({ stream, sizeMultiplier, is2d, options, isVolumeClassifier });\n}\n\n/** @internal */\nexport interface DecodeTileContentDescriptionArgs {\n stream: ByteStream;\n options: TileOptions;\n isVolumeClassifier?: boolean;\n is2d?: boolean;\n sizeMultiplier?: number;\n isLeaf?: boolean;\n}\n\n/** @internal */\nexport function decodeTileContentDescription(args: DecodeTileContentDescriptionArgs): TileContentDescription {\n const { stream, options } = args;\n const isVolumeClassifier = args.isVolumeClassifier ?? false;\n\n stream.reset();\n\n const header = new ImdlHeader(stream);\n if (!header.isValid)\n throw new TileReadError(TileReadStatus.InvalidHeader);\n else if (!header.isReadableVersion)\n throw new TileReadError(TileReadStatus.NewerMajorVersion);\n\n // Skip the feature table.\n const featureTableStartPos = stream.curPos;\n const ftHeader = FeatureTableHeader.readFrom(stream);\n if (undefined === ftHeader)\n throw new TileReadError(TileReadStatus.InvalidFeatureTable);\n\n stream.curPos = featureTableStartPos + ftHeader.length;\n\n let sizeMultiplier = args.sizeMultiplier;\n let isLeaf = args.isLeaf;\n if (undefined === isLeaf) {\n // Determine subdivision based on header data.\n const completeTile = 0 === (header.flags & ImdlFlags.Incomplete);\n const emptyTile = completeTile && 0 === header.numElementsIncluded && 0 === header.numElementsExcluded;\n isLeaf = (emptyTile || isVolumeClassifier); // Current classifier algorithm supports only a single tile.\n if (!isLeaf) {\n // Non-spatial (2d) models are of arbitrary scale and contain geometry like line work and especially text which\n // can be adversely affected by quantization issues when zooming in closely.\n const maxLeafTolerance = 1.0;\n\n // Must sub-divide if tile explicitly specifies...\n let canSkipSubdivision = 0 === (header.flags & ImdlFlags.DisallowMagnification);\n // ...or in 2d, or if app explicitly disabled magnification, or tolerance large enough to risk quantization error...\n canSkipSubdivision = canSkipSubdivision && !args.is2d && !options.disableMagnification && header.tolerance <= maxLeafTolerance;\n // ...or app specifies incomplete tiles must always be sub-divided.\n canSkipSubdivision = canSkipSubdivision && (completeTile || !options.alwaysSubdivideIncompleteTiles);\n if (canSkipSubdivision) {\n const minElementsPerTile = 100;\n if (completeTile && 0 === header.numElementsExcluded && header.numElementsIncluded <= minElementsPerTile) {\n const containsCurves = 0 !== (header.flags & ImdlFlags.ContainsCurves);\n if (!containsCurves)\n isLeaf = true;\n else if (undefined === sizeMultiplier)\n sizeMultiplier = 1.0;\n } else if (undefined === sizeMultiplier && header.numElementsIncluded + header.numElementsExcluded <= minElementsPerTile) {\n sizeMultiplier = 1.0;\n }\n }\n }\n }\n\n return {\n featureTableStartPos,\n contentRange: header.contentRange,\n isLeaf,\n sizeMultiplier,\n emptySubRangeMask: header.emptySubRanges,\n };\n}\n\nconst scratchRangeDiagonal = new Vector3d();\n\n/** Compute the chord tolerance for the specified tile of the given range with the specified size multiplier.\n * @internal\n */\nexport function computeTileChordTolerance(tile: TileMetadata, is3d: boolean, tileScreenSize: number): number {\n if (tile.range.isNull)\n return 0;\n\n const diagonal = tile.range.diagonal(scratchRangeDiagonal);\n const diagDist = is3d ? diagonal.magnitude() : diagonal.magnitudeXY();\n\n const mult = Math.max(tile.sizeMultiplier ?? 1, 1);\n return diagDist / (tileScreenSize * Constants.minToleranceRatioMultiplier * Math.max(1, mult));\n}\n\n/** Deserializes tile metadata.\n * @internal\n */\nexport class TileMetadataReader {\n private readonly _is2d: boolean;\n private readonly _isVolumeClassifier: boolean;\n private readonly _options: TileOptions;\n\n public constructor(type: BatchType, is2d: boolean, options: TileOptions) {\n this._is2d = is2d;\n this._isVolumeClassifier = BatchType.VolumeClassifier === type;\n this._options = options;\n }\n\n /** Produce metadata from the specified tile content.\n * @throws [[TileReadError]]\n */\n public read(stream: ByteStream, props: TileProps): TileMetadata {\n const content = decodeTileContentDescription({\n stream,\n sizeMultiplier: props.sizeMultiplier,\n is2d: this._is2d,\n options: this._options,\n isVolumeClassifier: this._isVolumeClassifier,\n });\n\n return {\n contentRange: content.contentRange,\n isLeaf: content.isLeaf,\n sizeMultiplier: content.sizeMultiplier,\n emptySubRangeMask: content.emptySubRangeMask,\n range: Range3d.fromJSON(props.range),\n contentId: props.contentId,\n };\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-common",
|
|
3
|
-
"version": "5.12.0-dev.
|
|
3
|
+
"version": "5.12.0-dev.5",
|
|
4
4
|
"description": "iTwin.js components common to frontend and backend",
|
|
5
5
|
"main": "lib/cjs/core-common.js",
|
|
6
6
|
"module": "lib/esm/core-common.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"js-base64": "^3.6.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@itwin/core-bentley": "5.12.0-dev.
|
|
31
|
-
"@itwin/core-geometry": "5.12.0-dev.
|
|
30
|
+
"@itwin/core-bentley": "5.12.0-dev.5",
|
|
31
|
+
"@itwin/core-geometry": "5.12.0-dev.5"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@itwin/eslint-plugin": "^6.0.0",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"rimraf": "^6.0.1",
|
|
43
43
|
"typescript": "~5.6.2",
|
|
44
44
|
"vitest": "^4.1.8",
|
|
45
|
-
"@itwin/
|
|
46
|
-
"@itwin/
|
|
47
|
-
"@itwin/core-
|
|
45
|
+
"@itwin/build-tools": "5.12.0-dev.5",
|
|
46
|
+
"@itwin/core-geometry": "5.12.0-dev.5",
|
|
47
|
+
"@itwin/core-bentley": "5.12.0-dev.5"
|
|
48
48
|
},
|
|
49
49
|
"nyc": {
|
|
50
50
|
"extends": "./node_modules/@itwin/build-tools/.nycrc",
|