@itwin/core-backend 5.11.0-dev.9 → 5.12.0-dev.2

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/lib/cjs/BlobContainerService.d.ts +14 -1
  3. package/lib/cjs/BlobContainerService.d.ts.map +1 -1
  4. package/lib/cjs/BlobContainerService.js.map +1 -1
  5. package/lib/cjs/BriefcaseManager.d.ts +3 -1
  6. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  7. package/lib/cjs/BriefcaseManager.js +3 -3
  8. package/lib/cjs/BriefcaseManager.js.map +1 -1
  9. package/lib/cjs/CloudSqlite.d.ts +1 -1
  10. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  11. package/lib/cjs/CloudSqlite.js +4 -1
  12. package/lib/cjs/CloudSqlite.js.map +1 -1
  13. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  14. package/lib/cjs/DisplayStyle.js +4 -8
  15. package/lib/cjs/DisplayStyle.js.map +1 -1
  16. package/lib/cjs/EditTxn.d.ts +56 -1
  17. package/lib/cjs/EditTxn.d.ts.map +1 -1
  18. package/lib/cjs/EditTxn.js +138 -0
  19. package/lib/cjs/EditTxn.js.map +1 -1
  20. package/lib/cjs/GeoCoordConfig.d.ts +6 -0
  21. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  22. package/lib/cjs/GeoCoordConfig.js +6 -0
  23. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  24. package/lib/cjs/IModelDb.d.ts +40 -0
  25. package/lib/cjs/IModelDb.d.ts.map +1 -1
  26. package/lib/cjs/IModelDb.js +18 -0
  27. package/lib/cjs/IModelDb.js.map +1 -1
  28. package/lib/cjs/IModelHost.d.ts +5 -3
  29. package/lib/cjs/IModelHost.d.ts.map +1 -1
  30. package/lib/cjs/IModelHost.js.map +1 -1
  31. package/lib/cjs/NativeHost.js +1 -1
  32. package/lib/cjs/NativeHost.js.map +1 -1
  33. package/lib/cjs/workspace/SettingsEditor.d.ts +4 -9
  34. package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -1
  35. package/lib/cjs/workspace/SettingsEditor.js +31 -15
  36. package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
  37. package/lib/esm/BlobContainerService.d.ts +14 -1
  38. package/lib/esm/BlobContainerService.d.ts.map +1 -1
  39. package/lib/esm/BlobContainerService.js.map +1 -1
  40. package/lib/esm/BriefcaseManager.d.ts +3 -1
  41. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  42. package/lib/esm/BriefcaseManager.js +3 -3
  43. package/lib/esm/BriefcaseManager.js.map +1 -1
  44. package/lib/esm/CloudSqlite.d.ts +1 -1
  45. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  46. package/lib/esm/CloudSqlite.js +4 -1
  47. package/lib/esm/CloudSqlite.js.map +1 -1
  48. package/lib/esm/DisplayStyle.d.ts.map +1 -1
  49. package/lib/esm/DisplayStyle.js +4 -8
  50. package/lib/esm/DisplayStyle.js.map +1 -1
  51. package/lib/esm/EditTxn.d.ts +56 -1
  52. package/lib/esm/EditTxn.d.ts.map +1 -1
  53. package/lib/esm/EditTxn.js +140 -2
  54. package/lib/esm/EditTxn.js.map +1 -1
  55. package/lib/esm/GeoCoordConfig.d.ts +6 -0
  56. package/lib/esm/GeoCoordConfig.d.ts.map +1 -1
  57. package/lib/esm/GeoCoordConfig.js +6 -0
  58. package/lib/esm/GeoCoordConfig.js.map +1 -1
  59. package/lib/esm/IModelDb.d.ts +40 -0
  60. package/lib/esm/IModelDb.d.ts.map +1 -1
  61. package/lib/esm/IModelDb.js +18 -0
  62. package/lib/esm/IModelDb.js.map +1 -1
  63. package/lib/esm/IModelHost.d.ts +5 -3
  64. package/lib/esm/IModelHost.d.ts.map +1 -1
  65. package/lib/esm/IModelHost.js.map +1 -1
  66. package/lib/esm/NativeHost.js +1 -1
  67. package/lib/esm/NativeHost.js.map +1 -1
  68. package/lib/esm/test/TestUtils.d.ts +17 -2
  69. package/lib/esm/test/TestUtils.d.ts.map +1 -1
  70. package/lib/esm/test/TestUtils.js +21 -2
  71. package/lib/esm/test/TestUtils.js.map +1 -1
  72. package/lib/esm/test/annotations/TextAnnotation.test.js +81 -16
  73. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  74. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +4 -2
  75. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  76. package/lib/esm/test/ecdb/ECDb.test.js +1 -1
  77. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  78. package/lib/esm/test/ecdb/ECSqlStatement.test.js +8 -2
  79. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  80. package/lib/esm/test/hubaccess/CodeSwap.test.d.ts +2 -0
  81. package/lib/esm/test/hubaccess/CodeSwap.test.d.ts.map +1 -0
  82. package/lib/esm/test/hubaccess/CodeSwap.test.js +431 -0
  83. package/lib/esm/test/hubaccess/CodeSwap.test.js.map +1 -0
  84. package/lib/esm/test/imodel/IModel.test.js +10 -2
  85. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  86. package/lib/esm/test/standalone/ChangeElementParentModel.test.d.ts +2 -0
  87. package/lib/esm/test/standalone/ChangeElementParentModel.test.d.ts.map +1 -0
  88. package/lib/esm/test/standalone/ChangeElementParentModel.test.js +460 -0
  89. package/lib/esm/test/standalone/ChangeElementParentModel.test.js.map +1 -0
  90. package/lib/esm/test/standalone/ChangesetReader.test.js +3 -0
  91. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  92. package/lib/esm/test/standalone/CloudSqlite.test.d.ts +2 -0
  93. package/lib/esm/test/standalone/CloudSqlite.test.d.ts.map +1 -0
  94. package/lib/esm/test/standalone/CloudSqlite.test.js +43 -0
  95. package/lib/esm/test/standalone/CloudSqlite.test.js.map +1 -0
  96. package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
  97. package/lib/esm/test/standalone/IModelWrite.test.js +2 -33
  98. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  99. package/lib/esm/test/standalone/ITwinWorkspace.test.js +118 -1
  100. package/lib/esm/test/standalone/ITwinWorkspace.test.js.map +1 -1
  101. package/lib/esm/test/standalone/Workspace.test.js +2 -2
  102. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  103. package/lib/esm/workspace/SettingsEditor.d.ts +4 -9
  104. package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -1
  105. package/lib/esm/workspace/SettingsEditor.js +31 -15
  106. package/lib/esm/workspace/SettingsEditor.js.map +1 -1
  107. package/package.json +16 -16
  108. package/lib/esm/test/misc/GeoServices.test.d.ts +0 -2
  109. package/lib/esm/test/misc/GeoServices.test.d.ts.map +0 -1
  110. package/lib/esm/test/misc/GeoServices.test.js +0 -918
  111. package/lib/esm/test/misc/GeoServices.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayStyle.js","sourceRoot":"","sources":["../../src/DisplayStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAyB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1G,OAAO,EACL,WAAW,EAAE,IAAI,EAA4B,QAAQ,EAAuB,sBAAsB,EAC/E,oBAAoB,EAAiF,cAAc,EAAoB,SAAS,GACpK,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAgB,YAAa,SAAQ,iBAAiB;IACnD,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IAGzE,YAAsB,KAAwB,EAAE,MAAgB;QAC9D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E,QAAQ,CAAC,CAAC;IACzD,CAAC;IAiBM,MAAM,CAAC,MAAM,CAAC,OAA2B,EAAE,iBAA6B,EAAE,IAAY,EAAE,OAAqC;QAClI,MAAM,GAAG,GAAG,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACzE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/E,OAAO,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,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 ViewDefinitions\n */\n\nimport { CompressedId64Set, Id64, Id64Array, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport {\n BisCodeSpec, Code, CodeScopeProps, CodeSpec, ColorDef, DisplayStyle3dProps, DisplayStyle3dSettings, DisplayStyle3dSettingsProps,\n DisplayStyleProps, DisplayStyleSettings, DisplayStyleSubCategoryProps, EntityReferenceSet, PlanProjectionSettingsProps, RenderSchedule, SkyBoxImageProps, ViewFlags,\n} from \"@itwin/core-common\";\nimport { DefinitionElement, RenderTimeline } from \"./Element\";\nimport { EditTxn } from \"./EditTxn\";\nimport { IModelDb } from \"./IModelDb\";\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\nimport { DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\nimport { _implicitTxn } from \"./internal/Symbols\";\n\n/** A DisplayStyle defines the parameters for 'styling' the contents of a view.\n * Internally a DisplayStyle consists of a dictionary of several named 'styles' describing specific aspects of the display style as a whole.\n * Many ViewDefinitions may share the same DisplayStyle.\n * @public @preview\n */\nexport abstract class DisplayStyle extends DefinitionElement {\n public static override get className(): string { return \"DisplayStyle\"; }\n public abstract get settings(): DisplayStyleSettings;\n\n protected constructor(props: DisplayStyleProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n /** @beta */\n public static override deserialize(props: DeserializeEntityArgs): DisplayStyleProps {\n const elProps = super.deserialize(props);\n const displayOptions = props.options?.element?.displayStyle;\n // Uncompress excludedElements if they are compressed\n if (!displayOptions?.compressExcludedElementIds && elProps.jsonProperties?.styles?.excludedElements) {\n const excludedElements = elProps.jsonProperties.styles.excludedElements;\n if (typeof excludedElements === \"string\" && excludedElements.startsWith(\"+\")) {\n const ids: string[] = [];\n CompressedId64Set.decompressSet(excludedElements).forEach((id: string) => {\n ids.push(id);\n });\n elProps.jsonProperties.styles.excludedElements = ids;\n }\n }\n // Omit Schedule Script Element Ids if the option is set\n if (displayOptions?.omitScheduleScriptElementIds && elProps.jsonProperties?.styles?.scheduleScript) {\n const scheduleScript: RenderSchedule.ScriptProps = elProps.jsonProperties.styles.scheduleScript;\n elProps.jsonProperties.styles.scheduleScript = RenderSchedule.Script.removeScheduleScriptElementIds(scheduleScript);\n }\n return elProps;\n }\n\n /** @beta */\n public static override serialize(props: DisplayStyleProps, iModel: IModelDb): ECSqlRow {\n const inst = super.serialize(props, iModel);\n return inst;\n }\n\n /** Create a Code for a DisplayStyle given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the DisplayStyle and provides the scope for its name.\n * @param codeValue The DisplayStyle name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.displayStyle);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n for (const [id] of this.settings.subCategoryOverrides) {\n referenceIds.addElement(id);\n }\n\n for (const excludedElementId of this.settings.excludedElementIds)\n referenceIds.addElement(excludedElementId);\n\n if (this.settings.renderTimeline) {\n referenceIds.addElement(this.settings.renderTimeline);\n } else {\n const script = this.loadScheduleScript();\n if (script)\n script.script.discloseIds(referenceIds);\n }\n }\n\n /** @alpha */\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: DisplayStyleProps, targetElementProps: DisplayStyleProps): Promise<void> {\n await super.onCloned(context, sourceElementProps, targetElementProps);\n\n if (!context.isBetweenIModels || !targetElementProps.jsonProperties?.styles)\n return;\n\n const settings = targetElementProps.jsonProperties.styles;\n if (settings.subCategoryOvr) {\n const targetOverrides: DisplayStyleSubCategoryProps[] = [];\n for (const ovr of settings.subCategoryOvr) {\n ovr.subCategory;\n const targetSubCategoryId = context.findTargetElementId(Id64.fromJSON(ovr.subCategory));\n if (Id64.isValid(targetSubCategoryId))\n targetOverrides.push({ ...ovr, subCategory: targetSubCategoryId });\n }\n settings.subCategoryOvr = targetOverrides;\n }\n\n if (settings.excludedElements) {\n const excluded: Id64Array = \"string\" === typeof settings.excludedElements ? CompressedId64Set.decompressArray(settings.excludedElements) : settings.excludedElements;\n const excludedTargetElements: Id64Array = [];\n for (const excludedElement of excluded) {\n const remapped = context.findTargetElementId(excludedElement);\n if (Id64.isValid(remapped))\n excludedTargetElements.push(remapped);\n }\n\n if (0 === excludedTargetElements.length)\n delete settings.excludedElements;\n else\n settings.excludedElements = CompressedId64Set.compressIds(OrderedId64Iterable.sortArray(excludedTargetElements));\n }\n\n if (settings.renderTimeline) {\n const renderTimeline = context.findTargetElementId(settings.renderTimeline);\n if (Id64.isValid(renderTimeline))\n settings.renderTimeline = renderTimeline;\n else\n delete settings.renderTimeline;\n } else if (settings.scheduleScript) {\n const scheduleScript = RenderTimeline.remapScript(context, settings.scheduleScript);\n if (scheduleScript.length > 0)\n settings.scheduleScript = scheduleScript;\n else\n delete settings.scheduleScript;\n }\n }\n\n public loadScheduleScript(): RenderSchedule.ScriptReference | undefined {\n let script;\n let sourceId;\n if (this.settings.renderTimeline) {\n const timeline = this.iModel.elements.tryGetElement<RenderTimeline>(this.settings.renderTimeline);\n if (timeline) {\n script = RenderSchedule.Script.fromJSON(timeline.scriptProps);\n sourceId = timeline.id;\n }\n } else if (this.settings.scheduleScriptProps) {\n script = RenderSchedule.Script.fromJSON(this.settings.scheduleScriptProps);\n sourceId = this.id;\n }\n\n return undefined !== sourceId && undefined !== script ? new RenderSchedule.ScriptReference(sourceId, script) : undefined;\n }\n}\n\n/** A DisplayStyle for 2d views.\n * @public @preview\n */\nexport class DisplayStyle2d extends DisplayStyle {\n public static override get className(): string { return \"DisplayStyle2d\"; }\n private readonly _settings: DisplayStyleSettings;\n\n public get settings(): DisplayStyleSettings { return this._settings; }\n\n protected constructor(props: DisplayStyleProps, iModel: IModelDb) {\n super(props, iModel);\n this._settings = new DisplayStyleSettings(this.jsonProperties);\n }\n /** Create a DisplayStyle2d for use by a ViewDefinition.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the DisplayStyle2d\n * @returns The newly constructed DisplayStyle2d element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DisplayStyle2d {\n const displayStyleProps: DisplayStyleProps = {\n classFullName: this.classFullName,\n code: this.createCode(iModelDb, definitionModelId, name),\n model: definitionModelId,\n isPrivate: false,\n jsonProperties: {\n styles: {\n backgroundColor: 0,\n monochromeColor: ColorDef.white.toJSON(),\n viewflags: ViewFlags.defaults,\n },\n },\n };\n return new DisplayStyle2d(displayStyleProps, iModelDb);\n }\n /**\n * Insert a DisplayStyle2d for use by a ViewDefinition.\n * @param txn The EditTxn to use\n * @param definitionModelId Insert the new DisplayStyle2d into this DefinitionModel\n * @param name The name of the DisplayStyle2d\n * @returns The Id of the newly inserted DisplayStyle2d element.\n * @throws [[IModelError]] if unable to insert the element.\n * @beta\n */\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string): Id64String;\n /**\n * Insert a DisplayStyle2d for use by a ViewDefinition.\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use DisplayStyle2d.insert(txn, ...) instead.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string): Id64String;\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string): Id64String {\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\n const displayStyle = this.create(txn.iModel, definitionModelId, name);\n return displayStyle.insert(txn);\n }\n}\n\n/** Describes initial settings for a new [[DisplayStyle3d]].\n * Most properties are inherited from [DisplayStyle3dSettingsProps]($common), but for backwards compatibility reasons, this interface is slightly awkward:\n * - It adds a `viewFlags` member that differs only in case and type from [DisplayStyleSettingsProps.viewflags]($common); and\n * - It extends the type of [DisplayStyleSettingsProps.backgroundColor]($common) to include [ColorDef]($common).\n * These idiosyncrasies will be addressed in a future version of core-backend.\n * @see [[DisplayStyle3d.create]].\n * @public @preview\n */\nexport interface DisplayStyleCreationOptions extends Omit<DisplayStyle3dSettingsProps, \"backgroundColor\" | \"scheduleScript\"> {\n /** If supplied, the [ViewFlags]($common) applied by the display style.\n * If undefined, [DisplayStyle3dSettingsProps.viewflags]($common) will be used if present (note the difference in case); otherwise, default-constructed [ViewFlags]($common) will be used.\n */\n viewFlags?: ViewFlags;\n backgroundColor?: ColorDef | number;\n}\n\n/** A DisplayStyle for 3d views.\n * See [how to create a DisplayStyle3d]($docs/learning/backend/CreateElements.md#DisplayStyle3d).\n * @public @preview\n */\nexport class DisplayStyle3d extends DisplayStyle {\n public static override get className(): string { return \"DisplayStyle3d\"; }\n private readonly _settings: DisplayStyle3dSettings;\n\n public get settings(): DisplayStyle3dSettings { return this._settings; }\n\n protected constructor(props: DisplayStyle3dProps, iModel: IModelDb) {\n super(props, iModel);\n this._settings = new DisplayStyle3dSettings(this.jsonProperties);\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n for (const textureId of this.settings.environment.sky.textureIds)\n referenceIds.addElement(textureId);\n\n if (this.settings.planProjectionSettings)\n for (const planProjectionSetting of this.settings.planProjectionSettings)\n referenceIds.addElement(planProjectionSetting[0]);\n\n const groups = this.settings.contours.groups;\n for (const group of groups) {\n const subCategories = group.subCategories;\n for (const subCategoryId of subCategories) {\n referenceIds.addElement(subCategoryId);\n }\n }\n }\n\n /** @alpha */\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: DisplayStyle3dProps, targetElementProps: DisplayStyle3dProps): Promise<void> {\n await super.onCloned(context, sourceElementProps, targetElementProps);\n if (context.isBetweenIModels) {\n const convertTexture = (id: string) => Id64.isValidId64(id) ? context.findTargetElementId(id) : id;\n\n const skyBoxImageProps: SkyBoxImageProps | undefined = targetElementProps?.jsonProperties?.styles?.environment?.sky?.image;\n if (skyBoxImageProps?.texture && Id64.isValidId64(skyBoxImageProps.texture))\n skyBoxImageProps.texture = convertTexture(skyBoxImageProps.texture);\n\n if (skyBoxImageProps?.textures) {\n skyBoxImageProps.textures.front = convertTexture(skyBoxImageProps.textures.front);\n skyBoxImageProps.textures.back = convertTexture(skyBoxImageProps.textures.back);\n skyBoxImageProps.textures.left = convertTexture(skyBoxImageProps.textures.left);\n skyBoxImageProps.textures.right = convertTexture(skyBoxImageProps.textures.right);\n skyBoxImageProps.textures.top = convertTexture(skyBoxImageProps.textures.top);\n skyBoxImageProps.textures.bottom = convertTexture(skyBoxImageProps.textures.bottom);\n }\n\n if (targetElementProps?.jsonProperties?.styles?.planProjections) {\n const remappedPlanProjections: { [modelId: string]: PlanProjectionSettingsProps } = {};\n for (const entry of Object.entries(targetElementProps.jsonProperties.styles.planProjections)) {\n const remappedModelId: Id64String = context.findTargetElementId(entry[0]);\n if (Id64.isValidId64(remappedModelId)) {\n remappedPlanProjections[remappedModelId] = entry[1];\n }\n }\n targetElementProps.jsonProperties.styles.planProjections = remappedPlanProjections;\n }\n\n const groups = targetElementProps?.jsonProperties?.styles?.contours?.groups;\n if (groups) {\n for (const group of groups) {\n if (group.subCategories) {\n const subCategories = CompressedId64Set.decompressArray(group.subCategories);\n const remappedSubCategories: Id64String[] = [];\n for (const subCategoryId of subCategories) {\n const remappedSubCategoryId: Id64String = context.findTargetElementId(subCategoryId);\n if (Id64.isValidId64(remappedSubCategoryId)) {\n remappedSubCategories.push(remappedSubCategoryId);\n }\n }\n group.subCategories = CompressedId64Set.sortAndCompress(remappedSubCategories);\n }\n }\n }\n }\n }\n\n /** Create a DisplayStyle3d for use by a ViewDefinition.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the DisplayStyle3d\n * @returns The newly constructed DisplayStyle3d element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): DisplayStyle3d {\n options = options ?? {};\n let viewflags = options.viewFlags?.toJSON();\n if (!viewflags)\n viewflags = options.viewflags ?? new ViewFlags().toJSON();\n\n const backgroundColor = options.backgroundColor instanceof ColorDef ? options.backgroundColor.toJSON() : options.backgroundColor;\n\n const settings: DisplayStyle3dSettingsProps = {\n ...options,\n viewflags,\n backgroundColor,\n };\n\n const displayStyleProps: DisplayStyle3dProps = {\n classFullName: this.classFullName,\n code: this.createCode(iModelDb, definitionModelId, name),\n model: definitionModelId,\n jsonProperties: { styles: settings },\n isPrivate: false,\n\n };\n\n return new DisplayStyle3d(displayStyleProps, iModelDb);\n }\n /**\n * Insert a DisplayStyle3d for use by a ViewDefinition.\n * @param txn The EditTxn to use\n * @param definitionModelId Insert the new DisplayStyle3d into this [[DefinitionModel]]\n * @param name The name of the DisplayStyle3d\n * @param options Creation options\n * @returns The Id of the newly inserted DisplayStyle3d element.\n * @throws [[IModelError]] if unable to insert the element.\n * @beta\n */\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): Id64String;\n /**\n * Insert a DisplayStyle3d for use by a ViewDefinition.\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use DisplayStyle3d.insert(txn, ...) instead.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): Id64String;\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): Id64String {\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\n const displayStyle = this.create(txn.iModel, definitionModelId, name, options);\n return displayStyle.insert(txn);\n }\n}\n\n\n\n"]}
1
+ {"version":3,"file":"DisplayStyle.js","sourceRoot":"","sources":["../../src/DisplayStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAyB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1G,OAAO,EACL,WAAW,EAAE,IAAI,EAA4B,QAAQ,EAAuB,sBAAsB,EAC/E,oBAAoB,EAAiF,cAAc,EAAoB,SAAS,GACpK,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAgB,YAAa,SAAQ,iBAAiB;IACnD,MAAM,KAAc,SAAS,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IAGzE,YAAsB,KAAwB,EAAE,MAAgB;QAC9D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,YAAY;IACL,MAAM,CAAU,WAAW,CAAC,KAA4B;QAC7D,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,C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O,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS;YACZ,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,SAAS,EAAE,CAAC,MAAM,EAAE,CAAC;QAE5D,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,YAAY,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;QAEjI,MAAM,QAAQ,GAAgC;YAC5C,GAAG,OAAO;YACV,SAAS;YACT,eAAe;SAChB,CAAC;QAEF,MAAM,iBAAiB,GAAwB;YAC7C,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,CAAC;YACxD,KAAK,EAAE,iBAAiB;YACxB,cAAc,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;YACpC,SAAS,EAAE,KAAK;SAEjB,CAAC;QAEF,OAAO,IAAI,cAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;IACzD,CAAC;IAiBM,MAAM,CAAC,MAAM,CAAC,OAA2B,EAAE,iBAA6B,EAAE,IAAY,EAAE,OAAqC;QAClI,MAAM,GAAG,GAAG,OAAO,YAAY,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACzE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/E,OAAO,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,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 ViewDefinitions\n */\n\nimport { CompressedId64Set, Id64, Id64Array, Id64String, OrderedId64Iterable } from \"@itwin/core-bentley\";\nimport {\n BisCodeSpec, Code, CodeScopeProps, CodeSpec, ColorDef, DisplayStyle3dProps, DisplayStyle3dSettings, DisplayStyle3dSettingsProps,\n DisplayStyleProps, DisplayStyleSettings, DisplayStyleSubCategoryProps, EntityReferenceSet, PlanProjectionSettingsProps, RenderSchedule, SkyBoxImageProps, ViewFlags,\n} from \"@itwin/core-common\";\nimport { DefinitionElement, RenderTimeline } from \"./Element\";\nimport { EditTxn } from \"./EditTxn\";\nimport { IModelDb } from \"./IModelDb\";\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\nimport { DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\nimport { _implicitTxn } from \"./internal/Symbols\";\n\n/** A DisplayStyle defines the parameters for 'styling' the contents of a view.\n * Internally a DisplayStyle consists of a dictionary of several named 'styles' describing specific aspects of the display style as a whole.\n * Many ViewDefinitions may share the same DisplayStyle.\n * @public @preview\n */\nexport abstract class DisplayStyle extends DefinitionElement {\n public static override get className(): string { return \"DisplayStyle\"; }\n public abstract get settings(): DisplayStyleSettings;\n\n protected constructor(props: DisplayStyleProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n /** @beta */\n public static override deserialize(props: DeserializeEntityArgs): DisplayStyleProps {\n const elProps = super.deserialize(props);\n const displayOptions = props.options?.element?.displayStyle;\n // Uncompress excludedElements if they are compressed\n if (!displayOptions?.compressExcludedElementIds) {\n const styles = elProps.jsonProperties?.styles;\n if (styles && CompressedId64Set.isValid(styles.excludedElements)) {\n styles.excludedElements = CompressedId64Set.decompressArray(styles.excludedElements);\n }\n }\n // Omit Schedule Script Element Ids if the option is set\n if (displayOptions?.omitScheduleScriptElementIds && elProps.jsonProperties?.styles?.scheduleScript) {\n const scheduleScript: RenderSchedule.ScriptProps = elProps.jsonProperties.styles.scheduleScript;\n elProps.jsonProperties.styles.scheduleScript = RenderSchedule.Script.removeScheduleScriptElementIds(scheduleScript);\n }\n return elProps;\n }\n\n /** @beta */\n public static override serialize(props: DisplayStyleProps, iModel: IModelDb): ECSqlRow {\n const inst = super.serialize(props, iModel);\n return inst;\n }\n\n /** Create a Code for a DisplayStyle given a name that is meant to be unique within the scope of the specified DefinitionModel.\n * @param iModel The IModelDb\n * @param scopeModelId The Id of the DefinitionModel that contains the DisplayStyle and provides the scope for its name.\n * @param codeValue The DisplayStyle name\n */\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.displayStyle);\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n for (const [id] of this.settings.subCategoryOverrides) {\n referenceIds.addElement(id);\n }\n\n for (const excludedElementId of this.settings.excludedElementIds)\n referenceIds.addElement(excludedElementId);\n\n if (this.settings.renderTimeline) {\n referenceIds.addElement(this.settings.renderTimeline);\n } else {\n const script = this.loadScheduleScript();\n if (script)\n script.script.discloseIds(referenceIds);\n }\n }\n\n /** @alpha */\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: DisplayStyleProps, targetElementProps: DisplayStyleProps): Promise<void> {\n await super.onCloned(context, sourceElementProps, targetElementProps);\n\n if (!context.isBetweenIModels || !targetElementProps.jsonProperties?.styles)\n return;\n\n const settings = targetElementProps.jsonProperties.styles;\n if (settings.subCategoryOvr) {\n const targetOverrides: DisplayStyleSubCategoryProps[] = [];\n for (const ovr of settings.subCategoryOvr) {\n ovr.subCategory;\n const targetSubCategoryId = context.findTargetElementId(Id64.fromJSON(ovr.subCategory));\n if (Id64.isValid(targetSubCategoryId))\n targetOverrides.push({ ...ovr, subCategory: targetSubCategoryId });\n }\n settings.subCategoryOvr = targetOverrides;\n }\n\n if (settings.excludedElements) {\n const excluded: Id64Array = \"string\" === typeof settings.excludedElements ? CompressedId64Set.decompressArray(settings.excludedElements) : settings.excludedElements;\n const excludedTargetElements: Id64Array = [];\n for (const excludedElement of excluded) {\n const remapped = context.findTargetElementId(excludedElement);\n if (Id64.isValid(remapped))\n excludedTargetElements.push(remapped);\n }\n\n if (0 === excludedTargetElements.length)\n delete settings.excludedElements;\n else\n settings.excludedElements = CompressedId64Set.compressIds(OrderedId64Iterable.sortArray(excludedTargetElements));\n }\n\n if (settings.renderTimeline) {\n const renderTimeline = context.findTargetElementId(settings.renderTimeline);\n if (Id64.isValid(renderTimeline))\n settings.renderTimeline = renderTimeline;\n else\n delete settings.renderTimeline;\n } else if (settings.scheduleScript) {\n const scheduleScript = RenderTimeline.remapScript(context, settings.scheduleScript);\n if (scheduleScript.length > 0)\n settings.scheduleScript = scheduleScript;\n else\n delete settings.scheduleScript;\n }\n }\n\n public loadScheduleScript(): RenderSchedule.ScriptReference | undefined {\n let script;\n let sourceId;\n if (this.settings.renderTimeline) {\n const timeline = this.iModel.elements.tryGetElement<RenderTimeline>(this.settings.renderTimeline);\n if (timeline) {\n script = RenderSchedule.Script.fromJSON(timeline.scriptProps);\n sourceId = timeline.id;\n }\n } else if (this.settings.scheduleScriptProps) {\n script = RenderSchedule.Script.fromJSON(this.settings.scheduleScriptProps);\n sourceId = this.id;\n }\n\n return undefined !== sourceId && undefined !== script ? new RenderSchedule.ScriptReference(sourceId, script) : undefined;\n }\n}\n\n/** A DisplayStyle for 2d views.\n * @public @preview\n */\nexport class DisplayStyle2d extends DisplayStyle {\n public static override get className(): string { return \"DisplayStyle2d\"; }\n private readonly _settings: DisplayStyleSettings;\n\n public get settings(): DisplayStyleSettings { return this._settings; }\n\n protected constructor(props: DisplayStyleProps, iModel: IModelDb) {\n super(props, iModel);\n this._settings = new DisplayStyleSettings(this.jsonProperties);\n }\n /** Create a DisplayStyle2d for use by a ViewDefinition.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the DisplayStyle2d\n * @returns The newly constructed DisplayStyle2d element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DisplayStyle2d {\n const displayStyleProps: DisplayStyleProps = {\n classFullName: this.classFullName,\n code: this.createCode(iModelDb, definitionModelId, name),\n model: definitionModelId,\n isPrivate: false,\n jsonProperties: {\n styles: {\n backgroundColor: 0,\n monochromeColor: ColorDef.white.toJSON(),\n viewflags: ViewFlags.defaults,\n },\n },\n };\n return new DisplayStyle2d(displayStyleProps, iModelDb);\n }\n /**\n * Insert a DisplayStyle2d for use by a ViewDefinition.\n * @param txn The EditTxn to use\n * @param definitionModelId Insert the new DisplayStyle2d into this DefinitionModel\n * @param name The name of the DisplayStyle2d\n * @returns The Id of the newly inserted DisplayStyle2d element.\n * @throws [[IModelError]] if unable to insert the element.\n * @beta\n */\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string): Id64String;\n /**\n * Insert a DisplayStyle2d for use by a ViewDefinition.\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use DisplayStyle2d.insert(txn, ...) instead.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string): Id64String;\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string): Id64String {\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\n const displayStyle = this.create(txn.iModel, definitionModelId, name);\n return displayStyle.insert(txn);\n }\n}\n\n/** Describes initial settings for a new [[DisplayStyle3d]].\n * Most properties are inherited from [DisplayStyle3dSettingsProps]($common), but for backwards compatibility reasons, this interface is slightly awkward:\n * - It adds a `viewFlags` member that differs only in case and type from [DisplayStyleSettingsProps.viewflags]($common); and\n * - It extends the type of [DisplayStyleSettingsProps.backgroundColor]($common) to include [ColorDef]($common).\n * These idiosyncrasies will be addressed in a future version of core-backend.\n * @see [[DisplayStyle3d.create]].\n * @public @preview\n */\nexport interface DisplayStyleCreationOptions extends Omit<DisplayStyle3dSettingsProps, \"backgroundColor\" | \"scheduleScript\"> {\n /** If supplied, the [ViewFlags]($common) applied by the display style.\n * If undefined, [DisplayStyle3dSettingsProps.viewflags]($common) will be used if present (note the difference in case); otherwise, default-constructed [ViewFlags]($common) will be used.\n */\n viewFlags?: ViewFlags;\n backgroundColor?: ColorDef | number;\n}\n\n/** A DisplayStyle for 3d views.\n * See [how to create a DisplayStyle3d]($docs/learning/backend/CreateElements.md#DisplayStyle3d).\n * @public @preview\n */\nexport class DisplayStyle3d extends DisplayStyle {\n public static override get className(): string { return \"DisplayStyle3d\"; }\n private readonly _settings: DisplayStyle3dSettings;\n\n public get settings(): DisplayStyle3dSettings { return this._settings; }\n\n protected constructor(props: DisplayStyle3dProps, iModel: IModelDb) {\n super(props, iModel);\n this._settings = new DisplayStyle3dSettings(this.jsonProperties);\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n for (const textureId of this.settings.environment.sky.textureIds)\n referenceIds.addElement(textureId);\n\n if (this.settings.planProjectionSettings)\n for (const planProjectionSetting of this.settings.planProjectionSettings)\n referenceIds.addElement(planProjectionSetting[0]);\n\n const groups = this.settings.contours.groups;\n for (const group of groups) {\n const subCategories = group.subCategories;\n for (const subCategoryId of subCategories) {\n referenceIds.addElement(subCategoryId);\n }\n }\n }\n\n /** @alpha */\n protected static override async onCloned(context: IModelElementCloneContext, sourceElementProps: DisplayStyle3dProps, targetElementProps: DisplayStyle3dProps): Promise<void> {\n await super.onCloned(context, sourceElementProps, targetElementProps);\n if (context.isBetweenIModels) {\n const convertTexture = (id: string) => Id64.isValidId64(id) ? context.findTargetElementId(id) : id;\n\n const skyBoxImageProps: SkyBoxImageProps | undefined = targetElementProps?.jsonProperties?.styles?.environment?.sky?.image;\n if (skyBoxImageProps?.texture && Id64.isValidId64(skyBoxImageProps.texture))\n skyBoxImageProps.texture = convertTexture(skyBoxImageProps.texture);\n\n if (skyBoxImageProps?.textures) {\n skyBoxImageProps.textures.front = convertTexture(skyBoxImageProps.textures.front);\n skyBoxImageProps.textures.back = convertTexture(skyBoxImageProps.textures.back);\n skyBoxImageProps.textures.left = convertTexture(skyBoxImageProps.textures.left);\n skyBoxImageProps.textures.right = convertTexture(skyBoxImageProps.textures.right);\n skyBoxImageProps.textures.top = convertTexture(skyBoxImageProps.textures.top);\n skyBoxImageProps.textures.bottom = convertTexture(skyBoxImageProps.textures.bottom);\n }\n\n if (targetElementProps?.jsonProperties?.styles?.planProjections) {\n const remappedPlanProjections: { [modelId: string]: PlanProjectionSettingsProps } = {};\n for (const entry of Object.entries(targetElementProps.jsonProperties.styles.planProjections)) {\n const remappedModelId: Id64String = context.findTargetElementId(entry[0]);\n if (Id64.isValidId64(remappedModelId)) {\n remappedPlanProjections[remappedModelId] = entry[1];\n }\n }\n targetElementProps.jsonProperties.styles.planProjections = remappedPlanProjections;\n }\n\n const groups = targetElementProps?.jsonProperties?.styles?.contours?.groups;\n if (groups) {\n for (const group of groups) {\n if (group.subCategories) {\n const subCategories = CompressedId64Set.decompressArray(group.subCategories);\n const remappedSubCategories: Id64String[] = [];\n for (const subCategoryId of subCategories) {\n const remappedSubCategoryId: Id64String = context.findTargetElementId(subCategoryId);\n if (Id64.isValidId64(remappedSubCategoryId)) {\n remappedSubCategories.push(remappedSubCategoryId);\n }\n }\n group.subCategories = CompressedId64Set.sortAndCompress(remappedSubCategories);\n }\n }\n }\n }\n }\n\n /** Create a DisplayStyle3d for use by a ViewDefinition.\n * @param iModelDb The iModel\n * @param definitionModelId The [[DefinitionModel]]\n * @param name The name/CodeValue of the DisplayStyle3d\n * @returns The newly constructed DisplayStyle3d element.\n * @throws [[IModelError]] if unable to create the element.\n */\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): DisplayStyle3d {\n options = options ?? {};\n let viewflags = options.viewFlags?.toJSON();\n if (!viewflags)\n viewflags = options.viewflags ?? new ViewFlags().toJSON();\n\n const backgroundColor = options.backgroundColor instanceof ColorDef ? options.backgroundColor.toJSON() : options.backgroundColor;\n\n const settings: DisplayStyle3dSettingsProps = {\n ...options,\n viewflags,\n backgroundColor,\n };\n\n const displayStyleProps: DisplayStyle3dProps = {\n classFullName: this.classFullName,\n code: this.createCode(iModelDb, definitionModelId, name),\n model: definitionModelId,\n jsonProperties: { styles: settings },\n isPrivate: false,\n\n };\n\n return new DisplayStyle3d(displayStyleProps, iModelDb);\n }\n /**\n * Insert a DisplayStyle3d for use by a ViewDefinition.\n * @param txn The EditTxn to use\n * @param definitionModelId Insert the new DisplayStyle3d into this [[DefinitionModel]]\n * @param name The name of the DisplayStyle3d\n * @param options Creation options\n * @returns The Id of the newly inserted DisplayStyle3d element.\n * @throws [[IModelError]] if unable to insert the element.\n * @beta\n */\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): Id64String;\n /**\n * Insert a DisplayStyle3d for use by a ViewDefinition.\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use DisplayStyle3d.insert(txn, ...) instead.\n */\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): Id64String;\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, options?: DisplayStyleCreationOptions): Id64String {\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\n const displayStyle = this.create(txn.iModel, definitionModelId, name, options);\n return displayStyle.insert(txn);\n }\n}\n\n\n\n"]}
@@ -6,7 +6,7 @@ import { EcefLocationProps, ElementAspectProps, ElementProps, FilePropertyProps,
6
6
  import { Range3dProps } from "@itwin/core-geometry";
7
7
  import type { CloudSqlite } from "./CloudSqlite";
8
8
  import type { ImplicitWriteEnforcement } from "./IModelHost";
9
- import type { IModelDb, InsertElementOptions, UpdateModelOptions } from "./IModelDb";
9
+ import type { ChangeElementModelProps, ChangeElementParentProps, IModelDb, InsertElementOptions, UpdateModelOptions } from "./IModelDb";
10
10
  import type { SettingsContainer } from "./workspace/Settings";
11
11
  /** Options for bulk deleting elements from an iModelDb.
12
12
  * @beta
@@ -142,6 +142,61 @@ export declare class EditTxn {
142
142
  * @throws [[ITwinError]] if deletion fails.
143
143
  */
144
144
  deleteElement(ids: Id64Arg): void;
145
+ /** Change the parent of an element within its model.
146
+ *
147
+ * The new parent must be in the same model as the element. Cross-model reparenting is not allowed;
148
+ * use [[changeElementModel]] only to move root elements between models.
149
+ * Only the target element is reparented — its children and their model membership are unaffected.
150
+ *
151
+ * **Blocked cases** (will throw):
152
+ * - The new parent is in a different model than the element.
153
+ * - Element has a `ParentElement`-scoped code (code uniqueness is tied to the parent; use delete+insert instead).
154
+ *
155
+ * **Allowed cases**:
156
+ * - Element has a `Repository`-scoped code (unique across entire iModel — unaffected by the parent change).
157
+ * - Element has a `RelatedElement`-scoped code (scope element is independent of the parent).
158
+ * - Element has a `Model`-scoped code (the model does not change, so the code remains valid).
159
+ * - Element has no meaningful code (empty code).
160
+ *
161
+ * Channel verification is performed on the element's model.
162
+ * Lock enforcement: requires an exclusive lock on the element, and a shared lock on the new parent.
163
+ * @param props The reparent parameters: element id and new parent id.
164
+ * @throws EditTxnError if this EditTxn is not active.
165
+ * @throws [[ITwinError]] if the operation fails.
166
+ * @beta
167
+ */
168
+ changeElementParent(props: ChangeElementParentProps): void;
169
+ /** Change the model of a root element, making it a root element in the new model.
170
+ *
171
+ * The element must not have a parent.
172
+ * The element's entire subtree moves with it: BIS requires a parent and all of its children to reside
173
+ * in the same model, so every descendant of the element is relocated into the target model as well.
174
+ * The parent-child hierarchy is preserved. The whole subtree is validated before anything is moved, so
175
+ * a rejected change leaves the iModel untouched.
176
+ *
177
+ * **Blocked cases** (will throw):
178
+ * - Element has a parent (only root elements can be moved between models).
179
+ * - Any element in the subtree has a `Model`-scoped code (code uniqueness is tied to the source model; use delete+insert instead).
180
+ * - The moved (root) element has a `ParentElement`-scoped code (use delete+insert instead). A descendant's `ParentElement`-scoped code is allowed, because its parent moves with it.
181
+ *
182
+ * **Allowed cases** (for any element in the subtree):
183
+ * - A `Repository`-scoped code (unique across entire iModel — unaffected by the model change).
184
+ * - A `RelatedElement`-scoped code (scope element is independent of the model).
185
+ * - No meaningful code (empty code).
186
+ *
187
+ * The source and target models must be of the same class (classFullName must match exactly).
188
+ * Channel verification is performed on both the source and target models.
189
+ * Lock enforcement: requires an exclusive lock on every element in the moved subtree, and a shared lock on the target model.
190
+ * @param props The model change parameters: element id and target model id.
191
+ * @throws EditTxnError if this EditTxn is not active.
192
+ * @throws [[ITwinError]] if the operation fails.
193
+ * @beta
194
+ */
195
+ changeElementModel(props: ChangeElementModelProps): void;
196
+ /** Collect an element together with all of its descendants by walking the `ElementOwnsChildElements`
197
+ * hierarchy depth-first. Used to invalidate the cached props of every element affected by a subtree move.
198
+ */
199
+ private collectSubtreeIds;
145
200
  /**
146
201
  * Delete multiple elements from the iModel.
147
202
  * @param ids The ids of the elements to delete. All ids must be well-formed and valid [[Id64String]]s.
@@ -1 +1 @@
1
- {"version":3,"file":"EditTxn.d.ts","sourceRoot":"","sources":["../../src/EditTxn.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAQ,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAsC,MAAM,qBAAqB,CAAC;AAClI,OAAO,EAAgB,iBAAiB,EAAgB,kBAAkB,EAAE,YAAY,EAAE,iBAAiB,EAAe,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrM,OAAO,EAAW,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,k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us, ITwinError, OpenMode } from "@itwin/core-bentley";
9
- import { EcefLocation, EditTxnError, IModelError } from "@itwin/core-common";
9
+ import { EcefLocation, EditTxnError, ElementError, IModelError } from "@itwin/core-common";
10
10
  import { Range3d } from "@itwin/core-geometry";
11
- import { _activeTxn, _cache, _instanceKeyCache, _nativeDb } from "./internal/Symbols";
11
+ import { _activeTxn, _cache, _instanceKeyCache, _nativeDb, _verifyChannel } from "./internal/Symbols";
12
12
  /**
13
13
  * Status of a bulk element delete operation, mirroring the C++ `BulkDeleteStatus` enum.
14
14
  * @beta
@@ -207,6 +207,144 @@ export class EditTxn {
207
207
  }
208
208
  });
209
209
  }
210
+ /** Change the parent of an element within its model.
211
+ *
212
+ * The new parent must be in the same model as the element. Cross-model reparenting is not allowed;
213
+ * use [[changeElementModel]] only to move root elements between models.
214
+ * Only the target element is reparented — its children and their model membership are unaffected.
215
+ *
216
+ * **Blocked cases** (will throw):
217
+ * - The new parent is in a different model than the element.
218
+ * - Element has a `ParentElement`-scoped code (code uniqueness is tied to the parent; use delete+insert instead).
219
+ *
220
+ * **Allowed cases**:
221
+ * - Element has a `Repository`-scoped code (unique across entire iModel — unaffected by the parent change).
222
+ * - Element has a `RelatedElement`-scoped code (scope element is independent of the parent).
223
+ * - Element has a `Model`-scoped code (the model does not change, so the code remains valid).
224
+ * - Element has no meaningful code (empty code).
225
+ *
226
+ * Channel verification is performed on the element's model.
227
+ * Lock enforcement: requires an exclusive lock on the element, and a shared lock on the new parent.
228
+ * @param props The reparent parameters: element id and new parent id.
229
+ * @throws EditTxnError if this EditTxn is not active.
230
+ * @throws [[ITwinError]] if the operation fails.
231
+ * @beta
232
+ */
233
+ changeElementParent(props) {
234
+ this.verifyWriteable();
235
+ const iModel = this.iModel;
236
+ // Lock enforcement: exclusive lock on the element being reparented, shared lock on the new parent.
237
+ iModel.locks.checkExclusiveLock(props.id, "element", "changeParent");
238
+ iModel.locks.checkSharedLock(props.parentId, "parent", "changeParent");
239
+ // The new parent must be in the same model as the element. Cross-model reparenting is not
240
+ // allowed here; changeElementModel only moves root elements between models. Check this up
241
+ // front so consumers get a clear error instead of the addon's lower-level "wrong model" status.
242
+ const sourceModelId = iModel.elements.getElementProps({ id: props.id }).model;
243
+ const parentModelId = iModel.elements.getElementProps({ id: props.parentId }).model;
244
+ if (sourceModelId !== parentModelId)
245
+ ElementError.throwError("invalid-arguments", `cannot reparent element '${props.id}' to a parent in a different model ('${parentModelId}' != '${sourceModelId}'); changeElementModel only moves root elements between models`);
246
+ // Channel verification on the element's model.
247
+ iModel.channels[_verifyChannel](sourceModelId);
248
+ // Invalidate caches for the element being reparented.
249
+ iModel.elements[_cache].delete({ id: props.id });
250
+ iModel.elements[_instanceKeyCache].deleteById(props.id);
251
+ try {
252
+ iModel[_nativeDb].changeElementParent({ id: props.id, parentId: props.parentId });
253
+ }
254
+ catch (err) {
255
+ err.message = `Error changing element parent [${err.message}], id: ${props.id}, parentId: ${props.parentId}`;
256
+ err.metadata = { props };
257
+ throw err;
258
+ }
259
+ // The model is unchanged and descendants are not moved, so only the reparented element's cache is stale.
260
+ iModel.elements[_cache].delete({ id: props.id });
261
+ iModel.elements[_instanceKeyCache].deleteById(props.id);
262
+ }
263
+ /** Change the model of a root element, making it a root element in the new model.
264
+ *
265
+ * The element must not have a parent.
266
+ * The element's entire subtree moves with it: BIS requires a parent and all of its children to reside
267
+ * in the same model, so every descendant of the element is relocated into the target model as well.
268
+ * The parent-child hierarchy is preserved. The whole subtree is validated before anything is moved, so
269
+ * a rejected change leaves the iModel untouched.
270
+ *
271
+ * **Blocked cases** (will throw):
272
+ * - Element has a parent (only root elements can be moved between models).
273
+ * - Any element in the subtree has a `Model`-scoped code (code uniqueness is tied to the source model; use delete+insert instead).
274
+ * - The moved (root) element has a `ParentElement`-scoped code (use delete+insert instead). A descendant's `ParentElement`-scoped code is allowed, because its parent moves with it.
275
+ *
276
+ * **Allowed cases** (for any element in the subtree):
277
+ * - A `Repository`-scoped code (unique across entire iModel — unaffected by the model change).
278
+ * - A `RelatedElement`-scoped code (scope element is independent of the model).
279
+ * - No meaningful code (empty code).
280
+ *
281
+ * The source and target models must be of the same class (classFullName must match exactly).
282
+ * Channel verification is performed on both the source and target models.
283
+ * Lock enforcement: requires an exclusive lock on every element in the moved subtree, and a shared lock on the target model.
284
+ * @param props The model change parameters: element id and target model id.
285
+ * @throws EditTxnError if this EditTxn is not active.
286
+ * @throws [[ITwinError]] if the operation fails.
287
+ * @beta
288
+ */
289
+ changeElementModel(props) {
290
+ this.verifyWriteable();
291
+ const iModel = this.iModel;
292
+ // Resolve the source model
293
+ const sourceModelId = iModel.elements.getElementProps({ id: props.id }).model;
294
+ // Channel verification on the source model
295
+ iModel.channels[_verifyChannel](sourceModelId);
296
+ // Model type check: source and target models must be the same class
297
+ const sourceModel = iModel.models.getModel(sourceModelId);
298
+ const targetModel = iModel.models.getModel(props.modelId);
299
+ if (sourceModel.classFullName !== targetModel.classFullName)
300
+ ElementError.throwError("model-type-mismatch", `cannot move element from model of type '${sourceModel.classFullName}' to model of type '${targetModel.classFullName}'`);
301
+ // Shared lock on target model
302
+ iModel.locks.checkSharedLock(props.modelId, "model", "changeModel");
303
+ // Lock enforcement: every element in the subtree is updated by the native bulk move.
304
+ const subtreeIds = this.collectSubtreeIds(props.id);
305
+ for (const id of subtreeIds)
306
+ iModel.locks.checkExclusiveLock(id, "element", "changeModel");
307
+ // Channel verification on the target model
308
+ iModel.channels[_verifyChannel](props.modelId);
309
+ // Invalidate caches
310
+ iModel.elements[_cache].delete({ id: props.id });
311
+ iModel.elements[_instanceKeyCache].deleteById(props.id);
312
+ try {
313
+ iModel[_nativeDb].changeElementModel({ id: props.id, modelId: props.modelId });
314
+ }
315
+ catch (err) {
316
+ err.message = `Error changing element model [${err.message}], id: ${props.id}, modelId: ${props.modelId}`;
317
+ err.metadata = { props };
318
+ throw err;
319
+ }
320
+ // The move relocates the element's entire subtree into the target model (BIS requires a parent and
321
+ // its children to reside in the same model). Every descendant's cached props therefore hold a stale
322
+ // `model`, so invalidate the whole subtree rather than just the target element.
323
+ for (const id of subtreeIds) {
324
+ iModel.elements[_cache].delete({ id });
325
+ iModel.elements[_instanceKeyCache].deleteById(id);
326
+ }
327
+ // Moving the subtree changes the membership - and therefore the geometry-derived state such as
328
+ // GeometricModel.geometryGuid - of both the source and target models. Element insert/update/delete
329
+ // invalidate models[_cache] via Element.onInserted/onUpdated/onDeleted for the same reason, but the
330
+ // native changeElementModel does not fire those element callbacks, so invalidate both affected models
331
+ // here to keep the model cache contract local to this wrapper.
332
+ iModel.models[_cache].delete(sourceModelId);
333
+ iModel.models[_cache].delete(props.modelId);
334
+ }
335
+ /** Collect an element together with all of its descendants by walking the `ElementOwnsChildElements`
336
+ * hierarchy depth-first. Used to invalidate the cached props of every element affected by a subtree move.
337
+ */
338
+ collectSubtreeIds(rootId) {
339
+ const ids = [];
340
+ const stack = [rootId];
341
+ for (let id = stack.pop(); undefined !== id; id = stack.pop()) {
342
+ ids.push(id);
343
+ for (const childId of this.iModel.elements.queryChildren(id))
344
+ stack.push(childId);
345
+ }
346
+ return ids;
347
+ }
210
348
  /**
211
349
  * Delete multiple elements from the iModel.
212
350
  * @param ids The ids of the elements to delete. All ids must be well-formed and valid [[Id64String]]s.