@itwin/core-backend 5.10.0-dev.11 → 5.10.0-dev.12

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 (101) hide show
  1. package/lib/cjs/Category.d.ts +4 -4
  2. package/lib/cjs/Category.js.map +1 -1
  3. package/lib/cjs/ChangesetECAdaptor.d.ts +6 -6
  4. package/lib/cjs/ChangesetECAdaptor.js +4 -4
  5. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  6. package/lib/cjs/CodeSpecs.d.ts +3 -3
  7. package/lib/cjs/CodeSpecs.js.map +1 -1
  8. package/lib/cjs/DisplayStyle.d.ts +2 -2
  9. package/lib/cjs/DisplayStyle.js.map +1 -1
  10. package/lib/cjs/Element.d.ts +10 -10
  11. package/lib/cjs/Element.js +2 -2
  12. package/lib/cjs/Element.js.map +1 -1
  13. package/lib/cjs/ElementAspect.d.ts +1 -1
  14. package/lib/cjs/ElementAspect.js.map +1 -1
  15. package/lib/cjs/ElementTreeWalker.d.ts +5 -5
  16. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  17. package/lib/cjs/ExternalSource.d.ts +2 -2
  18. package/lib/cjs/ExternalSource.js.map +1 -1
  19. package/lib/cjs/IModelDb.d.ts +33 -23
  20. package/lib/cjs/IModelDb.d.ts.map +1 -1
  21. package/lib/cjs/IModelDb.js +32 -20
  22. package/lib/cjs/IModelDb.js.map +1 -1
  23. package/lib/cjs/LineStyle.d.ts +6 -6
  24. package/lib/cjs/LineStyle.js.map +1 -1
  25. package/lib/cjs/Material.d.ts +1 -1
  26. package/lib/cjs/Material.js.map +1 -1
  27. package/lib/cjs/Model.d.ts +6 -6
  28. package/lib/cjs/Model.js.map +1 -1
  29. package/lib/cjs/Relationship.d.ts +10 -10
  30. package/lib/cjs/Relationship.js +6 -6
  31. package/lib/cjs/Relationship.js.map +1 -1
  32. package/lib/cjs/SheetIndex.d.ts +4 -4
  33. package/lib/cjs/SheetIndex.js.map +1 -1
  34. package/lib/cjs/Texture.d.ts +1 -1
  35. package/lib/cjs/Texture.js.map +1 -1
  36. package/lib/cjs/ViewDefinition.d.ts +6 -6
  37. package/lib/cjs/ViewDefinition.js.map +1 -1
  38. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
  39. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  40. package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -1
  41. package/lib/cjs/annotations/FrameGeometry.js +2 -3
  42. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  43. package/lib/cjs/domains/FunctionalElements.d.ts +1 -1
  44. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  45. package/lib/cjs/domains/GenericElements.d.ts +2 -2
  46. package/lib/cjs/domains/GenericElements.js.map +1 -1
  47. package/lib/cjs/internal/ChannelAdmin.d.ts +2 -2
  48. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  49. package/lib/esm/Category.d.ts +4 -4
  50. package/lib/esm/Category.js.map +1 -1
  51. package/lib/esm/ChangesetECAdaptor.d.ts +6 -6
  52. package/lib/esm/ChangesetECAdaptor.js +4 -4
  53. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  54. package/lib/esm/CodeSpecs.d.ts +3 -3
  55. package/lib/esm/CodeSpecs.js.map +1 -1
  56. package/lib/esm/DisplayStyle.d.ts +2 -2
  57. package/lib/esm/DisplayStyle.js.map +1 -1
  58. package/lib/esm/Element.d.ts +10 -10
  59. package/lib/esm/Element.js +2 -2
  60. package/lib/esm/Element.js.map +1 -1
  61. package/lib/esm/ElementAspect.d.ts +1 -1
  62. package/lib/esm/ElementAspect.js.map +1 -1
  63. package/lib/esm/ElementTreeWalker.d.ts +5 -5
  64. package/lib/esm/ElementTreeWalker.js.map +1 -1
  65. package/lib/esm/ExternalSource.d.ts +2 -2
  66. package/lib/esm/ExternalSource.js.map +1 -1
  67. package/lib/esm/IModelDb.d.ts +33 -23
  68. package/lib/esm/IModelDb.d.ts.map +1 -1
  69. package/lib/esm/IModelDb.js +32 -20
  70. package/lib/esm/IModelDb.js.map +1 -1
  71. package/lib/esm/LineStyle.d.ts +6 -6
  72. package/lib/esm/LineStyle.js.map +1 -1
  73. package/lib/esm/Material.d.ts +1 -1
  74. package/lib/esm/Material.js.map +1 -1
  75. package/lib/esm/Model.d.ts +6 -6
  76. package/lib/esm/Model.js.map +1 -1
  77. package/lib/esm/Relationship.d.ts +10 -10
  78. package/lib/esm/Relationship.js +6 -6
  79. package/lib/esm/Relationship.js.map +1 -1
  80. package/lib/esm/SheetIndex.d.ts +4 -4
  81. package/lib/esm/SheetIndex.js.map +1 -1
  82. package/lib/esm/Texture.d.ts +1 -1
  83. package/lib/esm/Texture.js.map +1 -1
  84. package/lib/esm/ViewDefinition.d.ts +6 -6
  85. package/lib/esm/ViewDefinition.js.map +1 -1
  86. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
  87. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  88. package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -1
  89. package/lib/esm/annotations/FrameGeometry.js +2 -3
  90. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  91. package/lib/esm/domains/FunctionalElements.d.ts +1 -1
  92. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  93. package/lib/esm/domains/GenericElements.d.ts +2 -2
  94. package/lib/esm/domains/GenericElements.js.map +1 -1
  95. package/lib/esm/internal/ChannelAdmin.d.ts +2 -2
  96. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  97. package/lib/esm/test/annotations/FrameGeometry.test.js +2 -1
  98. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  99. package/lib/esm/test/standalone/DeleteElements.test.js +45 -0
  100. package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
  101. package/package.json +13 -13
@@ -279,7 +279,7 @@ export declare namespace LineStyleDefinition {
279
279
  */
280
280
  static createStrokePatternComponent(txn: EditTxn, props: StrokePatternProps): StyleProps;
281
281
  /** Create a file property for a new stroke pattern component.
282
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createStrokePatternComponent(txn, ...) instead.
282
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createStrokePatternComponent(txn, ...) instead.
283
283
  */
284
284
  static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps;
285
285
  /** Create a file property for a new point symbol component using an explicit EditTxn.
@@ -289,7 +289,7 @@ export declare namespace LineStyleDefinition {
289
289
  static createPointSymbolComponent(txn: EditTxn, props: PointSymbolProps): StyleProps | undefined;
290
290
  /** Create a file property for a new point symbol component.
291
291
  * If base and size parameters are not supplied, queries GeometryPart by id to set them.
292
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createPointSymbolComponent(txn, ...) instead.
292
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createPointSymbolComponent(txn, ...) instead.
293
293
  */
294
294
  static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined;
295
295
  /** Create a file property for a new stroke point component using an explicit EditTxn.
@@ -297,7 +297,7 @@ export declare namespace LineStyleDefinition {
297
297
  */
298
298
  static createStrokePointComponent(txn: EditTxn, props: StrokePointProps): StyleProps;
299
299
  /** Create a file property for a new stroke point component.
300
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createStrokePointComponent(txn, ...) instead.
300
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createStrokePointComponent(txn, ...) instead.
301
301
  */
302
302
  static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps;
303
303
  /** Create a file property for a new compound component using an explicit EditTxn.
@@ -305,7 +305,7 @@ export declare namespace LineStyleDefinition {
305
305
  */
306
306
  static createCompoundComponent(txn: EditTxn, props: CompoundProps): StyleProps;
307
307
  /** Create a file property for a new compound component.
308
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createCompoundComponent(txn, ...) instead.
308
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createCompoundComponent(txn, ...) instead.
309
309
  */
310
310
  static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps;
311
311
  /** Create a file property for a new raster image component using an explicit EditTxn.
@@ -313,7 +313,7 @@ export declare namespace LineStyleDefinition {
313
313
  */
314
314
  static createRasterComponent(txn: EditTxn, props: RasterImageProps, image: Uint8Array): StyleProps | undefined;
315
315
  /** Create a file property for a new raster image component.
316
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createRasterComponent(txn, ...) instead.
316
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createRasterComponent(txn, ...) instead.
317
317
  */
318
318
  static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined;
319
319
  /** Query for an existing line style with the supplied name. */
@@ -325,7 +325,7 @@ export declare namespace LineStyleDefinition {
325
325
  static createStyle(txn: EditTxn, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;
326
326
  /** Insert a new line style with the supplied name.
327
327
  * @throws [[IModelError]] if unable to insert the line style definition element.
328
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createStyle(txn, ...) instead.
328
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createStyle(txn, ...) instead.
329
329
  */
330
330
  static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;
331
331
  /** Get the name that can be use to query for an existing continuous line style. */
@@ -1 +1 @@
1
- {"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAqB,WAAW,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAgB,SAAS,EAA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D,IAAI,CAAC,CAAC,KAAK,QAAQ;gBACjB,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;YAEnE,MAAM,IAAI,GAAG,wBAAwB,QAAQ,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACzD,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjK,CAAC;KACF;IArMY,yBAAK,QAqMjB,CAAA;AACH,CAAC,EA7dgB,mBAAmB,KAAnB,mBAAmB,QA6dnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementGeometry\r\n */\r\n\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { FilePropertyProps, IModelError, LinePixels, LineStyleProps } from \"@itwin/core-common\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { GeometryPart, LineStyle } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\nfunction getLinePixelsLineCode(linePixels: LinePixels): number {\r\n switch (linePixels) {\r\n case LinePixels.Code1:\r\n return 1;\r\n case LinePixels.Code2:\r\n return 2;\r\n case LinePixels.Code3:\r\n return 3;\r\n case LinePixels.Code4:\r\n return 4;\r\n case LinePixels.Code5:\r\n return 5;\r\n case LinePixels.Code6:\r\n return 6;\r\n case LinePixels.Code7:\r\n return 7;\r\n default:\r\n return -1; // Invalid value...\r\n }\r\n}\r\n\r\n/** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.\r\n * There are three varieties of line styles:\r\n * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.\r\n * - A style using pre-defined pixel bit patterns [[LinePixels]] for dashed display (Code1-Code7).\r\n * - A style that uses a texture.\r\n *\r\n * A definition is defined by one or more components. A component is saved as a \"file property\" and can be referenced by other components. The line style definition references a component\r\n * by file property id and type and is saved as a dictionary element.\r\n * @public\r\n */\r\nexport namespace LineStyleDefinition {\r\n\r\n /** Line style component type identifiers */\r\n export enum ComponentType {\r\n /** Component type for [[LineStyleDefinition.PointSymbolProps]] */\r\n PointSymbol = 1,\r\n /** Component type for [[LineStyleDefinition.CompoundProps]] */\r\n Compound = 2,\r\n /** Component type for [[LineStyleDefinition.StrokePatternProps]] */\r\n StrokePattern = 3,\r\n /** Component type for [[LineStyleDefinition.StrokePointProps]] */\r\n StrokePoint = 4,\r\n /** Component type for [[LinePixels]], never saved as a file property */\r\n Internal = 6,\r\n /** Component type for [[LineStyleDefinition.RasterImageProps]] */\r\n RasterImage = 7,\r\n }\r\n\r\n /** Mask of values for StrokeMode */\r\n export enum StrokeMode {\r\n /** Stroke represents a blank space */\r\n Gap = 0x00,\r\n /** Stroke represents a solid dash */\r\n Dash = 0x01,\r\n /** Treat stroke as rigid and continue past a corner to complete the stroke as opposed to breaking at the corner */\r\n Ray = 0x02,\r\n /** Stroke length can be stretched when [[LineStyleDefinition.StrokePatternOptions.Iteration]] and [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] options are set, applicable to both Gap and Dash strokes */\r\n Scale = 0x04,\r\n /** Invert stroke in first stroke pattern */\r\n FirstInvert = 0x08,\r\n /** Invert stroke in last stroke pattern */\r\n LastInvert = 0x10,\r\n }\r\n\r\n /** Define constant width or tapered strokes with distance specified in meters */\r\n export enum StrokeWidth {\r\n /** Stroke draws as one pixel wide line */\r\n None = 0,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to left side of stroke */\r\n Left = 1,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to right side of stroke */\r\n Right = 2,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to both sides of stroke */\r\n Full = 3,\r\n }\r\n\r\n /** Controls appearance of stroke end caps. If StrokeCap is >= Hexagon, the end cap is stroked as an arc and the value of\r\n * StrokeCap indicates the number of vectors in the arc.\r\n */\r\n export enum StrokeCap {\r\n /** Stroke displays as a closed polygon */\r\n Closed = 0,\r\n /** Stroke displays lines at specified width instead of a polygon */\r\n Open = 1,\r\n /** Stroke length extended by half the stroke width */\r\n Extended = 2,\r\n /** Stroke end cap is a hexagon */\r\n Hexagon = 3,\r\n /** Stroke end cap is an octagon */\r\n Octagon = 4,\r\n /** Stroke end cap is a decagon */\r\n Decagon = 5,\r\n /** Stroke end cap is an arc */\r\n Arc = 30,\r\n }\r\n\r\n /** A stroke representing either a dash or gap in a stroke pattern */\r\n export interface StrokeProps {\r\n /** Length of stroke in meters */\r\n length: number;\r\n /** Width at start of stroke. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n orgWidth?: number;\r\n /** Width at end of stroke, same as start width if not present. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n endWidth?: number;\r\n /** Type and behavior of stroke */\r\n strokeMode?: StrokeMode;\r\n /** How to apply orgWidth and endWidth to stroke */\r\n widthMode?: StrokeWidth;\r\n /** Appearance of stroke end cap */\r\n capMode?: StrokeCap;\r\n }\r\n\r\n export type Strokes = StrokeProps[];\r\n\r\n /** Options to control how stroke pattern is applied to underlying curve */\r\n export enum StrokePatternOptions {\r\n /** Use default stroke behavior */\r\n None = 0x00,\r\n /** [[LineStyleDefinition.StrokePatternProps.phase]] represents fractional distance into first stroke of pattern */\r\n AutoPhase = 0x01,\r\n /** Use [[LineStyleDefinition.StrokePatternProps.maxIter]] to limit the number of iterations of the stroke pattern */\r\n Iteration = 0x08,\r\n /** Single segment mode restarts the stroke pattern at corners instead of continuing around corners */\r\n Segment = 0x10,\r\n /** Center the line style and stretch the ends */\r\n CenterStretch = 0x20,\r\n }\r\n\r\n /** Stroke pattern component definition [[LineStyleDefinition.ComponentType.StrokePattern]].\r\n * A stroke pattern component consists of a series of dashes and gaps having specified lengths and widths in meters. Simple dash-dot type line styles that do not\r\n * include point symbols can be created by referencing a stroke pattern component by its file property id.\r\n */\r\n export interface StrokePatternProps {\r\n /** Name for this stroke pattern */\r\n descr: string;\r\n /** Skip into the pattern before starting to draw. Value treated as fraction of the first stroke when [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] set. Value used as distance when [[LineStyleDefinition.StrokePatternOptions.CenterStretch]] is not set. */\r\n phase?: number;\r\n /** Options mask for this stroke pattern */\r\n options?: StrokePatternOptions;\r\n /** The entire stroke pattern will be repeated no more than maxIter on curve or segment when [[LineStyleDefinition.StrokePatternOptions.Iteration]] is set and stroke pattern includes stretchable strokes. */\r\n maxIter?: number;\r\n /** Array of strokes, maximum number that will be used is 32 */\r\n strokes: Strokes;\r\n }\r\n\r\n /** Flags to identify point symbol behavior */\r\n export enum PointSymbolFlags {\r\n /** Default symbol behavior */\r\n None = 0x0,\r\n /** Symbol includes 3d geometry */\r\n Is3d = 0x01,\r\n /** Symbol does not allow scaling */\r\n NoScale = 0x02,\r\n }\r\n\r\n /** Point symbol component definition [[LineStyleDefinition.ComponentType.PointSymbol]].\r\n * A point symbol component identifies a GeometryPart for reference by a [[LineStyleDefinition.SymbolProps]].\r\n */\r\n export interface PointSymbolProps {\r\n /** GeometryPart Id to use as a pattern symbol */\r\n geomPartId: Id64String;\r\n /** GeometryPart.bbox.low.x */\r\n baseX?: number;\r\n /** GeometryPart.bbox.low.y */\r\n baseY?: number;\r\n /** GeometryPart.bbox.low.z */\r\n baseZ?: number;\r\n /** GeometryPart.bbox.high.x */\r\n sizeX?: number;\r\n /** GeometryPart.bbox.high.y */\r\n sizeY?: number;\r\n /** GeometryPart.bbox.high.z */\r\n sizeZ?: number;\r\n /** Symbol behavior flags */\r\n symFlags?: PointSymbolFlags;\r\n /** Symbol scale, defaults to 1 */\r\n scale?: number;\r\n }\r\n\r\n /** Symbol options for location, orientation, and behavior */\r\n export enum SymbolOptions {\r\n /** No point symbol */\r\n None = 0x00,\r\n /** Symbol at origin of stroke */\r\n Origin = 0x01,\r\n /** Symbol at end of stroke */\r\n End = 0x02,\r\n /** symbol at center of stroke */\r\n Center = 0x03,\r\n /** Symbol at curve start point */\r\n CurveOrigin = 0x0004,\r\n /** Symbol at curve end point */\r\n CurveEnd = 0x0008,\r\n /** Symbol at each vertex */\r\n CurveVertex = 0x0010,\r\n /** Adjust symbol rotation left->right */\r\n AdjustRotation = 0x0020,\r\n /** Angle of symbol not relative to stroke direction */\r\n AbsoluteRotation = 0x0040,\r\n /** No scale on variable strokes */\r\n NoScale = 0x0100,\r\n /** No clip on partial strokes */\r\n NoClip = 0x0200,\r\n /** No partial strokes */\r\n NoPartial = 0x0400,\r\n /** Project partial origin */\r\n ProjectOrigin = 0x0800,\r\n /** Use color from symbol instead of inheriting curve color */\r\n UseColor = 0x4000,\r\n /** Use weight from symbol instead of inheriting curve weight */\r\n UseWeight = 0x8000,\r\n }\r\n\r\n /** Identifies a symbol and its location and orientation relative to a stroke pattern */\r\n export interface SymbolProps {\r\n /** The file property id of the symbol component, assumed to be [[LineStyleDefinition.ComponentType.PointSymbol]] if symType is undefined. */\r\n symId: number;\r\n /** The component type, leave undefined if symId is a [[LineStyleDefinition.ComponentType.PointSymbol]] */\r\n symType?: ComponentType;\r\n /** The 0 based stroke index for base stroke pattern [[LineStyleDefinition.ComponentType.StrokePattern]] component */\r\n strokeNum?: number;\r\n /** Symbol x offset distance in meters */\r\n xOffset?: number;\r\n /** Symbol y offset distance in meters */\r\n yOffset?: number;\r\n /** Symbol rotation in radians */\r\n angle?: number;\r\n /** Must set location for symbol as default value is [[LineStyleDefinition.SymbolOptions.None]] */\r\n mod1?: SymbolOptions;\r\n }\r\n\r\n export type Symbols = SymbolProps[];\r\n\r\n /** Stroke point component definition [[LineStyleDefinition.ComponentType.StrokePoint]].\r\n * A stroke point component identifies the locations of point symbol components relative to a base stroke pattern component.\r\n */\r\n export interface StrokePointProps {\r\n /** Name for this stroke point component */\r\n descr: string;\r\n /** The file property id of the stroke component, assumed to be [[LineStyleDefinition.ComponentType.StrokePattern]] if lcType is undefined */\r\n lcId: number;\r\n /** The component type, leave undefined if lcId is a [[LineStyleDefinition.ComponentType.StrokePattern]] */\r\n lcType?: ComponentType;\r\n /** Array of symbols */\r\n symbols: Symbols;\r\n }\r\n\r\n /** Raster component definition [[LineStyleDefinition.ComponentType.RasterImage]].\r\n * A raster component identifies a texture for a line style.\r\n */\r\n export interface RasterImageProps {\r\n /** Name for this raster image component */\r\n descr: string;\r\n /** Raster width */\r\n x: number;\r\n /** Raster height */\r\n y: number;\r\n /** True width flag */\r\n trueWidth?: number;\r\n /** Raster flags */\r\n flags?: number;\r\n /** The file property id of raster image */\r\n imageId?: number;\r\n }\r\n\r\n /** Identifies a component by file property id and type */\r\n export interface ComponentProps {\r\n /** The file property id of [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.StrokePoint]] component */\r\n id: number;\r\n /** The type of component for specified file property id */\r\n type: ComponentType;\r\n /** Offset distance for this component, default is 0 */\r\n offset?: number;\r\n }\r\n\r\n export type Components = ComponentProps[];\r\n\r\n /** Compound component definition [[LineStyleDefinition.ComponentType.Compound]].\r\n * A compound component is used to link stroke pattern and stroke point components to create a style that displays dashes, gaps, and symbols.\r\n */\r\n export interface CompoundProps {\r\n comps: Components;\r\n }\r\n\r\n /** Flags to describe a style or control style behavior */\r\n export enum StyleFlags {\r\n /** Use defaults */\r\n None = 0x00,\r\n /** Only snap to center line and not individual strokes and symbols of line style */\r\n NoSnap = 0x04,\r\n /** Style represents a continuous line with width (determined by looking at components if not set) */\r\n Continuous = 0x08,\r\n /** Style represents physical geometry and should be scaled as such */\r\n Physical = 0x80,\r\n }\r\n\r\n /** The line style definition element data */\r\n export interface StyleProps {\r\n /** The file property id for either a [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.Compound]] component */\r\n compId: number;\r\n /** The type of component for specified file property id */\r\n compType: ComponentType;\r\n /** Style behavior flags. Defaults to [[LineStyleDefinition.StyleFlags.NoSnap]] if left undefined */\r\n flags?: StyleFlags;\r\n /** Style scale, defaults to 1 */\r\n unitDef?: number;\r\n }\r\n\r\n /** Helper methods for creating and querying line styles */\r\n export class Utils {\r\n /** Create a file property for a new stroke pattern component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createStrokePatternComponent(txn: EditTxn, props: StrokePatternProps): StyleProps;\r\n /** Create a file property for a new stroke pattern component.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createStrokePatternComponent(txn, ...) instead.\r\n */\r\n public static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps;\r\n public static createStrokePatternComponent(txnOrIModel: EditTxn | IModelDb, props: StrokePatternProps): StyleProps {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const fileProps: FilePropertyProps = { name: \"LineCodeV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = txn.iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePattern };\r\n }\r\n\r\n /** Create a file property for a new point symbol component using an explicit EditTxn.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n * @beta\r\n */\r\n public static createPointSymbolComponent(txn: EditTxn, props: PointSymbolProps): StyleProps | undefined;\r\n /** Create a file property for a new point symbol component.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createPointSymbolComponent(txn, ...) instead.\r\n */\r\n public static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined;\r\n public static createPointSymbolComponent(txnOrIModel: EditTxn | IModelDb, props: PointSymbolProps): StyleProps | undefined {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const iModel = txn.iModel;\r\n // if part extents weren't supplied, set them up now.\r\n if (!props.baseX && !props.baseY && !props.baseZ && !props.sizeX && !props.sizeY && !props.sizeZ) {\r\n const geomPart = iModel.elements.getElement<GeometryPart>(props.geomPartId);\r\n if (!geomPart)\r\n return undefined;\r\n\r\n props.baseX = geomPart.bbox.low.x;\r\n props.baseY = geomPart.bbox.low.y;\r\n props.baseZ = geomPart.bbox.low.z;\r\n\r\n props.sizeX = geomPart.bbox.high.x;\r\n props.sizeY = geomPart.bbox.high.y;\r\n props.sizeZ = geomPart.bbox.high.z;\r\n }\r\n\r\n const fileProps: FilePropertyProps = { name: \"PointSymV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.PointSymbol };\r\n }\r\n\r\n /** Create a file property for a new stroke point component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createStrokePointComponent(txn: EditTxn, props: StrokePointProps): StyleProps;\r\n /** Create a file property for a new stroke point component.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createStrokePointComponent(txn, ...) instead.\r\n */\r\n public static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps;\r\n public static createStrokePointComponent(txnOrIModel: EditTxn | IModelDb, props: StrokePointProps): StyleProps {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const fileProps: FilePropertyProps = { name: \"LinePointV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = txn.iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePoint };\r\n }\r\n\r\n /** Create a file property for a new compound component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createCompoundComponent(txn: EditTxn, props: CompoundProps): StyleProps;\r\n /** Create a file property for a new compound component.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createCompoundComponent(txn, ...) instead.\r\n */\r\n public static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps;\r\n public static createCompoundComponent(txnOrIModel: EditTxn | IModelDb, props: CompoundProps): StyleProps {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const fileProps: FilePropertyProps = { name: \"CompoundV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = txn.iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.Compound };\r\n }\r\n\r\n /** Create a file property for a new raster image component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createRasterComponent(txn: EditTxn, props: RasterImageProps, image: Uint8Array): StyleProps | undefined;\r\n /** Create a file property for a new raster image component.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createRasterComponent(txn, ...) instead.\r\n */\r\n public static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined;\r\n public static createRasterComponent(txnOrIModel: EditTxn | IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const iModel = txn.iModel;\r\n const rasterFileProps: FilePropertyProps = { name: \"RasterImageV1\", namespace: \"dgn_LStyle\" };\r\n rasterFileProps.id = iModel.queryNextAvailableFileProperty(rasterFileProps);\r\n txn.saveFileProperty(rasterFileProps, undefined, image);\r\n props.imageId = rasterFileProps.id;\r\n const fileProps: FilePropertyProps = { name: \"RasterComponentV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.RasterImage };\r\n }\r\n\r\n /** Query for an existing line style with the supplied name. */\r\n public static queryStyle(imodel: IModelDb, scopeModelId: Id64String, name: string): Id64String | undefined {\r\n return imodel.elements.queryElementIdByCode(LineStyle.createCode(imodel, scopeModelId, name));\r\n }\r\n\r\n /** Insert a new line style with the supplied name using an explicit EditTxn.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n * @beta\r\n */\r\n public static createStyle(txn: EditTxn, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;\r\n /** Insert a new line style with the supplied name.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use createStyle(txn, ...) instead.\r\n */\r\n public static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;\r\n public static createStyle(txnOrIModel: EditTxn | IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const imodel = txn.iModel;\r\n if (undefined === props.flags)\r\n props.flags = StyleFlags.NoSnap; // If flags weren't supplied, default to not snapping to stroke geometry.\r\n\r\n const lsProps: LineStyleProps = {\r\n classFullName: \"BisCore:LineStyle\",\r\n model: scopeModelId,\r\n code: LineStyle.createCode(imodel, scopeModelId, name),\r\n data: JSON.stringify(props),\r\n };\r\n\r\n return txn.insertElement(lsProps);\r\n }\r\n\r\n /** Get the name that can be use to query for an existing continuous line style. */\r\n public static getContinuousStyleName(width?: number): string {\r\n if (width === undefined)\r\n return \"Continuous\";\r\n\r\n return `Continuous-${width}`;\r\n }\r\n\r\n /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.\r\n * There are 2 ways to define a continuous line style:\r\n * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.\r\n * - Defined using [[LineStyleDefinition.ComponentType.Internal]] with component id 0 [[LinePixels.Solid]] which has special behavior of being affected by width overrides.\r\n * - Width is specified in the style.\r\n * - Defined using a single stroke component that is a long dash.\r\n * @param txn Optional explicit EditTxn to use if the style must be created.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n * @beta\r\n */\r\n public static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number, txn?: EditTxn): Id64String {\r\n const writeTxn = txn ?? imodel[_implicitTxn];\r\n const name = this.getContinuousStyleName(width);\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n if (undefined !== lsId)\r\n return lsId;\r\n\r\n if (width === undefined)\r\n return this.createStyle(writeTxn, scopeModelId, name, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n\r\n const strokePatternData = this.createStrokePatternComponent(writeTxn, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });\r\n if (undefined === strokePatternData)\r\n throw new IModelError(IModelStatus.BadArg, \"Unable to insert stroke component\");\r\n\r\n return this.createStyle(writeTxn, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n }\r\n\r\n /** Get the name that can be use to query for an existing [[LinePixels]] line style.\r\n * @note Returns undefined for line pixels value that is not Code1 to Code7.\r\n */\r\n public static getLinePixelsStyleName(linePixels: LinePixels): string | undefined {\r\n const lineCode = getLinePixelsLineCode(linePixels);\r\n if (-1 === lineCode)\r\n return undefined;\r\n\r\n return `LinePixelsCodeNumber-${lineCode}`;\r\n }\r\n\r\n /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.\r\n * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.\r\n * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.\r\n * @param txn Optional explicit EditTxn to use if the style must be created.\r\n * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.\r\n * @beta\r\n */\r\n public static getOrCreateLinePixelsStyle(imodel: IModelDb, scopeModelId: Id64String, linePixels: LinePixels, txn?: EditTxn): Id64String {\r\n const lineCode = getLinePixelsLineCode(linePixels);\r\n if (-1 === lineCode)\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid LinePixels\");\r\n\r\n const name = `LinePixelsCodeNumber-${lineCode}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n return (undefined === lsId ? this.createStyle(txn ?? imodel[_implicitTxn], scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"LineStyle.js","sourceRoot":"","sources":["../../src/LineStyle.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAqB,WAAW,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAgB,SAAS,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,SAAS,qBAAqB,CAAC,UAAsB;IACnD,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,UAAU,CAAC,KAAK;YACnB,OAAO,CAAC,CAAC;QACX,KAAK,UAAU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AC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;YACzD,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACjK,CAAC;KACF;IArMY,yBAAK,QAqMjB,CAAA;AACH,CAAC,EA7dgB,mBAAmB,KAAnB,mBAAmB,QA6dnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ElementGeometry\r\n */\r\n\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { FilePropertyProps, IModelError, LinePixels, LineStyleProps } from \"@itwin/core-common\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { GeometryPart, LineStyle } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\nfunction getLinePixelsLineCode(linePixels: LinePixels): number {\r\n switch (linePixels) {\r\n case LinePixels.Code1:\r\n return 1;\r\n case LinePixels.Code2:\r\n return 2;\r\n case LinePixels.Code3:\r\n return 3;\r\n case LinePixels.Code4:\r\n return 4;\r\n case LinePixels.Code5:\r\n return 5;\r\n case LinePixels.Code6:\r\n return 6;\r\n case LinePixels.Code7:\r\n return 7;\r\n default:\r\n return -1; // Invalid value...\r\n }\r\n}\r\n\r\n/** A line style definition is a uniquely named pattern that repeats as it is displayed along a curve path. In the absence of a line style, curve display is limited to solid lines with a width in pixels.\r\n * There are three varieties of line styles:\r\n * - A style described by a stroke pattern (series of dashes and gaps) that may also include symbol graphics.\r\n * - A style using pre-defined pixel bit patterns [[LinePixels]] for dashed display (Code1-Code7).\r\n * - A style that uses a texture.\r\n *\r\n * A definition is defined by one or more components. A component is saved as a \"file property\" and can be referenced by other components. The line style definition references a component\r\n * by file property id and type and is saved as a dictionary element.\r\n * @public\r\n */\r\nexport namespace LineStyleDefinition {\r\n\r\n /** Line style component type identifiers */\r\n export enum ComponentType {\r\n /** Component type for [[LineStyleDefinition.PointSymbolProps]] */\r\n PointSymbol = 1,\r\n /** Component type for [[LineStyleDefinition.CompoundProps]] */\r\n Compound = 2,\r\n /** Component type for [[LineStyleDefinition.StrokePatternProps]] */\r\n StrokePattern = 3,\r\n /** Component type for [[LineStyleDefinition.StrokePointProps]] */\r\n StrokePoint = 4,\r\n /** Component type for [[LinePixels]], never saved as a file property */\r\n Internal = 6,\r\n /** Component type for [[LineStyleDefinition.RasterImageProps]] */\r\n RasterImage = 7,\r\n }\r\n\r\n /** Mask of values for StrokeMode */\r\n export enum StrokeMode {\r\n /** Stroke represents a blank space */\r\n Gap = 0x00,\r\n /** Stroke represents a solid dash */\r\n Dash = 0x01,\r\n /** Treat stroke as rigid and continue past a corner to complete the stroke as opposed to breaking at the corner */\r\n Ray = 0x02,\r\n /** Stroke length can be stretched when [[LineStyleDefinition.StrokePatternOptions.Iteration]] and [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] options are set, applicable to both Gap and Dash strokes */\r\n Scale = 0x04,\r\n /** Invert stroke in first stroke pattern */\r\n FirstInvert = 0x08,\r\n /** Invert stroke in last stroke pattern */\r\n LastInvert = 0x10,\r\n }\r\n\r\n /** Define constant width or tapered strokes with distance specified in meters */\r\n export enum StrokeWidth {\r\n /** Stroke draws as one pixel wide line */\r\n None = 0,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to left side of stroke */\r\n Left = 1,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to right side of stroke */\r\n Right = 2,\r\n /** Half [[LineStyleDefinition.StrokeProps.orgWidth]] and [[LineStyleDefinition.StrokeProps.endWidth]] applied to both sides of stroke */\r\n Full = 3,\r\n }\r\n\r\n /** Controls appearance of stroke end caps. If StrokeCap is >= Hexagon, the end cap is stroked as an arc and the value of\r\n * StrokeCap indicates the number of vectors in the arc.\r\n */\r\n export enum StrokeCap {\r\n /** Stroke displays as a closed polygon */\r\n Closed = 0,\r\n /** Stroke displays lines at specified width instead of a polygon */\r\n Open = 1,\r\n /** Stroke length extended by half the stroke width */\r\n Extended = 2,\r\n /** Stroke end cap is a hexagon */\r\n Hexagon = 3,\r\n /** Stroke end cap is an octagon */\r\n Octagon = 4,\r\n /** Stroke end cap is a decagon */\r\n Decagon = 5,\r\n /** Stroke end cap is an arc */\r\n Arc = 30,\r\n }\r\n\r\n /** A stroke representing either a dash or gap in a stroke pattern */\r\n export interface StrokeProps {\r\n /** Length of stroke in meters */\r\n length: number;\r\n /** Width at start of stroke. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n orgWidth?: number;\r\n /** Width at end of stroke, same as start width if not present. Behavior controlled by [[LineStyleDefinition.StrokeWidth]], choose value other than [[LineStyleDefinition.StrokeWidth.None]] */\r\n endWidth?: number;\r\n /** Type and behavior of stroke */\r\n strokeMode?: StrokeMode;\r\n /** How to apply orgWidth and endWidth to stroke */\r\n widthMode?: StrokeWidth;\r\n /** Appearance of stroke end cap */\r\n capMode?: StrokeCap;\r\n }\r\n\r\n export type Strokes = StrokeProps[];\r\n\r\n /** Options to control how stroke pattern is applied to underlying curve */\r\n export enum StrokePatternOptions {\r\n /** Use default stroke behavior */\r\n None = 0x00,\r\n /** [[LineStyleDefinition.StrokePatternProps.phase]] represents fractional distance into first stroke of pattern */\r\n AutoPhase = 0x01,\r\n /** Use [[LineStyleDefinition.StrokePatternProps.maxIter]] to limit the number of iterations of the stroke pattern */\r\n Iteration = 0x08,\r\n /** Single segment mode restarts the stroke pattern at corners instead of continuing around corners */\r\n Segment = 0x10,\r\n /** Center the line style and stretch the ends */\r\n CenterStretch = 0x20,\r\n }\r\n\r\n /** Stroke pattern component definition [[LineStyleDefinition.ComponentType.StrokePattern]].\r\n * A stroke pattern component consists of a series of dashes and gaps having specified lengths and widths in meters. Simple dash-dot type line styles that do not\r\n * include point symbols can be created by referencing a stroke pattern component by its file property id.\r\n */\r\n export interface StrokePatternProps {\r\n /** Name for this stroke pattern */\r\n descr: string;\r\n /** Skip into the pattern before starting to draw. Value treated as fraction of the first stroke when [[LineStyleDefinition.StrokePatternOptions.AutoPhase]] set. Value used as distance when [[LineStyleDefinition.StrokePatternOptions.CenterStretch]] is not set. */\r\n phase?: number;\r\n /** Options mask for this stroke pattern */\r\n options?: StrokePatternOptions;\r\n /** The entire stroke pattern will be repeated no more than maxIter on curve or segment when [[LineStyleDefinition.StrokePatternOptions.Iteration]] is set and stroke pattern includes stretchable strokes. */\r\n maxIter?: number;\r\n /** Array of strokes, maximum number that will be used is 32 */\r\n strokes: Strokes;\r\n }\r\n\r\n /** Flags to identify point symbol behavior */\r\n export enum PointSymbolFlags {\r\n /** Default symbol behavior */\r\n None = 0x0,\r\n /** Symbol includes 3d geometry */\r\n Is3d = 0x01,\r\n /** Symbol does not allow scaling */\r\n NoScale = 0x02,\r\n }\r\n\r\n /** Point symbol component definition [[LineStyleDefinition.ComponentType.PointSymbol]].\r\n * A point symbol component identifies a GeometryPart for reference by a [[LineStyleDefinition.SymbolProps]].\r\n */\r\n export interface PointSymbolProps {\r\n /** GeometryPart Id to use as a pattern symbol */\r\n geomPartId: Id64String;\r\n /** GeometryPart.bbox.low.x */\r\n baseX?: number;\r\n /** GeometryPart.bbox.low.y */\r\n baseY?: number;\r\n /** GeometryPart.bbox.low.z */\r\n baseZ?: number;\r\n /** GeometryPart.bbox.high.x */\r\n sizeX?: number;\r\n /** GeometryPart.bbox.high.y */\r\n sizeY?: number;\r\n /** GeometryPart.bbox.high.z */\r\n sizeZ?: number;\r\n /** Symbol behavior flags */\r\n symFlags?: PointSymbolFlags;\r\n /** Symbol scale, defaults to 1 */\r\n scale?: number;\r\n }\r\n\r\n /** Symbol options for location, orientation, and behavior */\r\n export enum SymbolOptions {\r\n /** No point symbol */\r\n None = 0x00,\r\n /** Symbol at origin of stroke */\r\n Origin = 0x01,\r\n /** Symbol at end of stroke */\r\n End = 0x02,\r\n /** symbol at center of stroke */\r\n Center = 0x03,\r\n /** Symbol at curve start point */\r\n CurveOrigin = 0x0004,\r\n /** Symbol at curve end point */\r\n CurveEnd = 0x0008,\r\n /** Symbol at each vertex */\r\n CurveVertex = 0x0010,\r\n /** Adjust symbol rotation left->right */\r\n AdjustRotation = 0x0020,\r\n /** Angle of symbol not relative to stroke direction */\r\n AbsoluteRotation = 0x0040,\r\n /** No scale on variable strokes */\r\n NoScale = 0x0100,\r\n /** No clip on partial strokes */\r\n NoClip = 0x0200,\r\n /** No partial strokes */\r\n NoPartial = 0x0400,\r\n /** Project partial origin */\r\n ProjectOrigin = 0x0800,\r\n /** Use color from symbol instead of inheriting curve color */\r\n UseColor = 0x4000,\r\n /** Use weight from symbol instead of inheriting curve weight */\r\n UseWeight = 0x8000,\r\n }\r\n\r\n /** Identifies a symbol and its location and orientation relative to a stroke pattern */\r\n export interface SymbolProps {\r\n /** The file property id of the symbol component, assumed to be [[LineStyleDefinition.ComponentType.PointSymbol]] if symType is undefined. */\r\n symId: number;\r\n /** The component type, leave undefined if symId is a [[LineStyleDefinition.ComponentType.PointSymbol]] */\r\n symType?: ComponentType;\r\n /** The 0 based stroke index for base stroke pattern [[LineStyleDefinition.ComponentType.StrokePattern]] component */\r\n strokeNum?: number;\r\n /** Symbol x offset distance in meters */\r\n xOffset?: number;\r\n /** Symbol y offset distance in meters */\r\n yOffset?: number;\r\n /** Symbol rotation in radians */\r\n angle?: number;\r\n /** Must set location for symbol as default value is [[LineStyleDefinition.SymbolOptions.None]] */\r\n mod1?: SymbolOptions;\r\n }\r\n\r\n export type Symbols = SymbolProps[];\r\n\r\n /** Stroke point component definition [[LineStyleDefinition.ComponentType.StrokePoint]].\r\n * A stroke point component identifies the locations of point symbol components relative to a base stroke pattern component.\r\n */\r\n export interface StrokePointProps {\r\n /** Name for this stroke point component */\r\n descr: string;\r\n /** The file property id of the stroke component, assumed to be [[LineStyleDefinition.ComponentType.StrokePattern]] if lcType is undefined */\r\n lcId: number;\r\n /** The component type, leave undefined if lcId is a [[LineStyleDefinition.ComponentType.StrokePattern]] */\r\n lcType?: ComponentType;\r\n /** Array of symbols */\r\n symbols: Symbols;\r\n }\r\n\r\n /** Raster component definition [[LineStyleDefinition.ComponentType.RasterImage]].\r\n * A raster component identifies a texture for a line style.\r\n */\r\n export interface RasterImageProps {\r\n /** Name for this raster image component */\r\n descr: string;\r\n /** Raster width */\r\n x: number;\r\n /** Raster height */\r\n y: number;\r\n /** True width flag */\r\n trueWidth?: number;\r\n /** Raster flags */\r\n flags?: number;\r\n /** The file property id of raster image */\r\n imageId?: number;\r\n }\r\n\r\n /** Identifies a component by file property id and type */\r\n export interface ComponentProps {\r\n /** The file property id of [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.StrokePoint]] component */\r\n id: number;\r\n /** The type of component for specified file property id */\r\n type: ComponentType;\r\n /** Offset distance for this component, default is 0 */\r\n offset?: number;\r\n }\r\n\r\n export type Components = ComponentProps[];\r\n\r\n /** Compound component definition [[LineStyleDefinition.ComponentType.Compound]].\r\n * A compound component is used to link stroke pattern and stroke point components to create a style that displays dashes, gaps, and symbols.\r\n */\r\n export interface CompoundProps {\r\n comps: Components;\r\n }\r\n\r\n /** Flags to describe a style or control style behavior */\r\n export enum StyleFlags {\r\n /** Use defaults */\r\n None = 0x00,\r\n /** Only snap to center line and not individual strokes and symbols of line style */\r\n NoSnap = 0x04,\r\n /** Style represents a continuous line with width (determined by looking at components if not set) */\r\n Continuous = 0x08,\r\n /** Style represents physical geometry and should be scaled as such */\r\n Physical = 0x80,\r\n }\r\n\r\n /** The line style definition element data */\r\n export interface StyleProps {\r\n /** The file property id for either a [[LineStyleDefinition.ComponentType.StrokePattern]] or [[LineStyleDefinition.ComponentType.Compound]] component */\r\n compId: number;\r\n /** The type of component for specified file property id */\r\n compType: ComponentType;\r\n /** Style behavior flags. Defaults to [[LineStyleDefinition.StyleFlags.NoSnap]] if left undefined */\r\n flags?: StyleFlags;\r\n /** Style scale, defaults to 1 */\r\n unitDef?: number;\r\n }\r\n\r\n /** Helper methods for creating and querying line styles */\r\n export class Utils {\r\n /** Create a file property for a new stroke pattern component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createStrokePatternComponent(txn: EditTxn, props: StrokePatternProps): StyleProps;\r\n /** Create a file property for a new stroke pattern component.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createStrokePatternComponent(txn, ...) instead.\r\n */\r\n public static createStrokePatternComponent(iModel: IModelDb, props: StrokePatternProps): StyleProps;\r\n public static createStrokePatternComponent(txnOrIModel: EditTxn | IModelDb, props: StrokePatternProps): StyleProps {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const fileProps: FilePropertyProps = { name: \"LineCodeV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = txn.iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePattern };\r\n }\r\n\r\n /** Create a file property for a new point symbol component using an explicit EditTxn.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n * @beta\r\n */\r\n public static createPointSymbolComponent(txn: EditTxn, props: PointSymbolProps): StyleProps | undefined;\r\n /** Create a file property for a new point symbol component.\r\n * If base and size parameters are not supplied, queries GeometryPart by id to set them.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createPointSymbolComponent(txn, ...) instead.\r\n */\r\n public static createPointSymbolComponent(iModel: IModelDb, props: PointSymbolProps): StyleProps | undefined;\r\n public static createPointSymbolComponent(txnOrIModel: EditTxn | IModelDb, props: PointSymbolProps): StyleProps | undefined {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const iModel = txn.iModel;\r\n // if part extents weren't supplied, set them up now.\r\n if (!props.baseX && !props.baseY && !props.baseZ && !props.sizeX && !props.sizeY && !props.sizeZ) {\r\n const geomPart = iModel.elements.getElement<GeometryPart>(props.geomPartId);\r\n if (!geomPart)\r\n return undefined;\r\n\r\n props.baseX = geomPart.bbox.low.x;\r\n props.baseY = geomPart.bbox.low.y;\r\n props.baseZ = geomPart.bbox.low.z;\r\n\r\n props.sizeX = geomPart.bbox.high.x;\r\n props.sizeY = geomPart.bbox.high.y;\r\n props.sizeZ = geomPart.bbox.high.z;\r\n }\r\n\r\n const fileProps: FilePropertyProps = { name: \"PointSymV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.PointSymbol };\r\n }\r\n\r\n /** Create a file property for a new stroke point component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createStrokePointComponent(txn: EditTxn, props: StrokePointProps): StyleProps;\r\n /** Create a file property for a new stroke point component.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createStrokePointComponent(txn, ...) instead.\r\n */\r\n public static createStrokePointComponent(iModel: IModelDb, props: StrokePointProps): StyleProps;\r\n public static createStrokePointComponent(txnOrIModel: EditTxn | IModelDb, props: StrokePointProps): StyleProps {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const fileProps: FilePropertyProps = { name: \"LinePointV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = txn.iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.StrokePoint };\r\n }\r\n\r\n /** Create a file property for a new compound component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createCompoundComponent(txn: EditTxn, props: CompoundProps): StyleProps;\r\n /** Create a file property for a new compound component.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createCompoundComponent(txn, ...) instead.\r\n */\r\n public static createCompoundComponent(iModel: IModelDb, props: CompoundProps): StyleProps;\r\n public static createCompoundComponent(txnOrIModel: EditTxn | IModelDb, props: CompoundProps): StyleProps {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const fileProps: FilePropertyProps = { name: \"CompoundV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = txn.iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.Compound };\r\n }\r\n\r\n /** Create a file property for a new raster image component using an explicit EditTxn.\r\n * @beta\r\n */\r\n public static createRasterComponent(txn: EditTxn, props: RasterImageProps, image: Uint8Array): StyleProps | undefined;\r\n /** Create a file property for a new raster image component.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createRasterComponent(txn, ...) instead.\r\n */\r\n public static createRasterComponent(iModel: IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined;\r\n public static createRasterComponent(txnOrIModel: EditTxn | IModelDb, props: RasterImageProps, image: Uint8Array): StyleProps | undefined {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const iModel = txn.iModel;\r\n const rasterFileProps: FilePropertyProps = { name: \"RasterImageV1\", namespace: \"dgn_LStyle\" };\r\n rasterFileProps.id = iModel.queryNextAvailableFileProperty(rasterFileProps);\r\n txn.saveFileProperty(rasterFileProps, undefined, image);\r\n props.imageId = rasterFileProps.id;\r\n const fileProps: FilePropertyProps = { name: \"RasterComponentV1\", namespace: \"dgn_LStyle\" };\r\n fileProps.id = iModel.queryNextAvailableFileProperty(fileProps);\r\n txn.saveFileProperty(fileProps, JSON.stringify(props));\r\n return { compId: fileProps.id, compType: ComponentType.RasterImage };\r\n }\r\n\r\n /** Query for an existing line style with the supplied name. */\r\n public static queryStyle(imodel: IModelDb, scopeModelId: Id64String, name: string): Id64String | undefined {\r\n return imodel.elements.queryElementIdByCode(LineStyle.createCode(imodel, scopeModelId, name));\r\n }\r\n\r\n /** Insert a new line style with the supplied name using an explicit EditTxn.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n * @beta\r\n */\r\n public static createStyle(txn: EditTxn, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;\r\n /** Insert a new line style with the supplied name.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use createStyle(txn, ...) instead.\r\n */\r\n public static createStyle(imodel: IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String;\r\n public static createStyle(txnOrIModel: EditTxn | IModelDb, scopeModelId: Id64String, name: string, props: StyleProps): Id64String {\r\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\r\n const imodel = txn.iModel;\r\n if (undefined === props.flags)\r\n props.flags = StyleFlags.NoSnap; // If flags weren't supplied, default to not snapping to stroke geometry.\r\n\r\n const lsProps: LineStyleProps = {\r\n classFullName: \"BisCore:LineStyle\",\r\n model: scopeModelId,\r\n code: LineStyle.createCode(imodel, scopeModelId, name),\r\n data: JSON.stringify(props),\r\n };\r\n\r\n return txn.insertElement(lsProps);\r\n }\r\n\r\n /** Get the name that can be use to query for an existing continuous line style. */\r\n public static getContinuousStyleName(width?: number): string {\r\n if (width === undefined)\r\n return \"Continuous\";\r\n\r\n return `Continuous-${width}`;\r\n }\r\n\r\n /** Query for a continuous line style that can be used to create curves with physical width instead of weight in pixels and create one if it does not already exist.\r\n * There are 2 ways to define a continuous line style:\r\n * - Width is not specified in the style itself and instead will be supplied as an override for each curve that is drawn.\r\n * - Defined using [[LineStyleDefinition.ComponentType.Internal]] with component id 0 [[LinePixels.Solid]] which has special behavior of being affected by width overrides.\r\n * - Width is specified in the style.\r\n * - Defined using a single stroke component that is a long dash.\r\n * @param txn Optional explicit EditTxn to use if the style must be created.\r\n * @throws [[IModelError]] if unable to insert the line style definition element.\r\n * @beta\r\n */\r\n public static getOrCreateContinuousStyle(imodel: IModelDb, scopeModelId: Id64String, width?: number, txn?: EditTxn): Id64String {\r\n const writeTxn = txn ?? imodel[_implicitTxn];\r\n const name = this.getContinuousStyleName(width);\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n if (undefined !== lsId)\r\n return lsId;\r\n\r\n if (width === undefined)\r\n return this.createStyle(writeTxn, scopeModelId, name, { compId: 0, compType: ComponentType.Internal, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n\r\n const strokePatternData = this.createStrokePatternComponent(writeTxn, { descr: name, strokes: [{ length: 1e37, orgWidth: width, strokeMode: StrokeMode.Dash, widthMode: StrokeWidth.Full }] });\r\n if (undefined === strokePatternData)\r\n throw new IModelError(IModelStatus.BadArg, \"Unable to insert stroke component\");\r\n\r\n return this.createStyle(writeTxn, scopeModelId, name, { compId: strokePatternData.compId, compType: strokePatternData.compType, flags: StyleFlags.Continuous | StyleFlags.NoSnap });\r\n }\r\n\r\n /** Get the name that can be use to query for an existing [[LinePixels]] line style.\r\n * @note Returns undefined for line pixels value that is not Code1 to Code7.\r\n */\r\n public static getLinePixelsStyleName(linePixels: LinePixels): string | undefined {\r\n const lineCode = getLinePixelsLineCode(linePixels);\r\n if (-1 === lineCode)\r\n return undefined;\r\n\r\n return `LinePixelsCodeNumber-${lineCode}`;\r\n }\r\n\r\n /** Query for a line style using the supplied [[LinePixels]] value (Code1-Code7) and create one if it does not already exist.\r\n * Most applications should instead use [[createStrokePatternComponent]] to define a style with physical dash and gap lengths.\r\n * Unlike other components, [[LineStyleDefinition.ComponentType.Internal]] uses the line code as the compId instead of a file property id.\r\n * @param txn Optional explicit EditTxn to use if the style must be created.\r\n * @throws [[IModelError]] if supplied an invalid [[LinePixels]] value or if unable to insert the line style definition element.\r\n * @beta\r\n */\r\n public static getOrCreateLinePixelsStyle(imodel: IModelDb, scopeModelId: Id64String, linePixels: LinePixels, txn?: EditTxn): Id64String {\r\n const lineCode = getLinePixelsLineCode(linePixels);\r\n if (-1 === lineCode)\r\n throw new IModelError(IModelStatus.BadArg, \"Invalid LinePixels\");\r\n\r\n const name = `LinePixelsCodeNumber-${lineCode}`;\r\n const lsId = this.queryStyle(imodel, scopeModelId, name);\r\n return (undefined === lsId ? this.createStyle(txn ?? imodel[_implicitTxn], scopeModelId, name, { compId: lineCode, compType: ComponentType.Internal }) : lsId);\r\n }\r\n }\r\n}\r\n"]}
@@ -88,7 +88,7 @@ export declare class RenderMaterialElement extends DefinitionElement {
88
88
  static insert(txn: EditTxn, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String;
89
89
  /**
90
90
  * Insert a new RenderMaterial into a model.
91
- * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use RenderMaterialElement.insert(txn, ...) instead.
91
+ * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use RenderMaterialElement.insert(txn, ...) instead.
92
92
  */
93
93
  static insert(iModelDb: IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String;
94
94
  /** @beta */
@@ -1 +1 @@
1
- {"version":3,"file":"Material.js","sourceRoot":"","sources":["../../src/Material.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,WAAW,EAAE,IAAI,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,W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------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n BisCodeSpec, Code, CodeScopeProps, CodeSpec, DefinitionElementProps, ElementProps, NormalMapProps, RenderMaterialAssetMapsProps, RenderMaterialProps, RgbFactorProps, TextureMapProps,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/** A PhysicalMaterial defines the matter that makes up physical elements.\r\n * @note See [[RenderMaterialElement]] for the DefinitionElement used to define rendering characteristics.\r\n * @public\r\n */\r\nexport abstract class PhysicalMaterial extends DefinitionElement {\r\n public static override get className(): string { return \"PhysicalMaterial\"; }\r\n /** Create a Code for a PhysicalMaterial given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param definitionModelId The Id of the DefinitionModel that will contain the PhysicalMaterial and provide the scope for its name.\r\n * @param name The name (codeValue) of the PhysicalMaterial\r\n */\r\n public static createCode(iModel: IModelDb, definitionModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.physicalMaterial);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: name });\r\n }\r\n /** Create a PhysicalMaterial\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the DefinitionModel that will contain the PhysicalMaterial and provide the scope for its name.\r\n * @param name The name (codeValue) of the PhysicalMaterial\r\n * @returns The newly constructed PhysicalMaterial\r\n * @throws [[IModelError]] if there is a problem creating the PhysicalMaterial\r\n */\r\n public static create<T extends PhysicalMaterial>(iModelDb: IModelDb, definitionModelId: CodeScopeProps, name: string): T {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n };\r\n return iModelDb.elements.createElement(elementProps);\r\n }\r\n}\r\n\r\n/** Defines a rendering material.\r\n * @note See [[PhysicalMaterial]] for the DefinitionElement used to define the matter that makes up physical elements.\r\n * @public\r\n */\r\nexport class RenderMaterialElement extends DefinitionElement {\r\n public static override get className(): string { return \"RenderMaterial\"; }\r\n\r\n /** The name of a palette that can be used to categorize multiple materials. */\r\n public paletteName: string;\r\n /** An optional description of the material. */\r\n public description?: string;\r\n\r\n private constructor(props: RenderMaterialProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.paletteName = props.paletteName;\r\n this.description = props.description;\r\n }\r\n\r\n public override toJSON(): RenderMaterialProps {\r\n const val = super.toJSON() as RenderMaterialProps;\r\n val.paletteName = this.paletteName;\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /**\r\n * RenderMaterialElement custom HandledProps includes 'paletteName'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"paletteName\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * RenderMaterialElement deserializes 'paletteName'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): RenderMaterialProps {\r\n const elProps = super.deserialize(props) as RenderMaterialProps;\r\n const instance = props.row;\r\n elProps.paletteName = JsonUtils.asString(instance.paletteName);\r\n return elProps;\r\n }\r\n\r\n /**\r\n * RenderMaterialElement serializes 'paletteName'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: RenderMaterialProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n inst.paletteName = props.paletteName;\r\n return inst;\r\n }\r\n\r\n /** Create a Code for a RenderMaterial given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the RenderMaterial and provides the scope for its name.\r\n * @param name The RenderMaterial name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.renderMaterial);\r\n return 0 === name.length ? Code.createEmpty() : new Code({ spec: codeSpec.id, scope: scopeModelId, value: name });\r\n }\r\n /**\r\n * Create a RenderMaterial with given parameters.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param materialName The name/CodeValue of the RenderMaterial\r\n * @param params Parameters object which describes how to construct the RenderMaterial\r\n * @returns The newly constructed RenderMaterial element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): RenderMaterialElement {\r\n let maps: RenderMaterialAssetMapsProps | undefined;\r\n const pbr_normal = params.normalMap?.scale;\r\n if (params.patternMap || params.normalMap) {\r\n // If both normal and pattern map are present, their texture mapping modes, angles, scales, etc are expected to match.\r\n type TexMap = Omit<TextureMapProps, \"TextureId\">;\r\n function choose<K extends keyof TexMap>(obj: TexMap, key: K): void {\r\n const pat = params.patternMap;\r\n if (pat && undefined !== pat[key])\r\n obj[key] = pat[key];\r\n else if (params.normalMap && undefined !== params.normalMap[key])\r\n obj[key] = params.normalMap[key];\r\n }\r\n\r\n const baseProps: TexMap = {};\r\n choose(baseProps, \"pattern_angle\");\r\n choose(baseProps, \"pattern_u_flip\");\r\n choose(baseProps, \"pattern_flip\");\r\n choose(baseProps, \"pattern_scale\");\r\n choose(baseProps, \"pattern_offset\");\r\n choose(baseProps, \"pattern_scalemode\");\r\n choose(baseProps, \"pattern_mapping\");\r\n choose(baseProps, \"pattern_weight\");\r\n choose(baseProps, \"pattern_useconstantlod\");\r\n choose(baseProps, \"pattern_constantlod_repetitions\");\r\n choose(baseProps, \"pattern_constantlod_offset\");\r\n choose(baseProps, \"pattern_constantlod_mindistanceclamp\");\r\n choose(baseProps, \"pattern_constantlod_maxdistanceclamp\");\r\n\r\n maps = {};\r\n if (params.patternMap)\r\n maps.Pattern = { ...params.patternMap, ...baseProps };\r\n\r\n if (params.normalMap) {\r\n maps.Normal = {\r\n ...params.normalMap,\r\n ...baseProps,\r\n };\r\n\r\n delete (maps.Normal as any).scale;\r\n }\r\n }\r\n\r\n const renderMaterialProps: RenderMaterialProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, materialName),\r\n paletteName: params.paletteName,\r\n description: params.description,\r\n jsonProperties: {\r\n materialAssets: {\r\n renderMaterial: {\r\n HasBaseColor: params.color !== undefined,\r\n color: params.color,\r\n HasSpecularColor: params.specularColor !== undefined,\r\n specular_color: params.specularColor,\r\n HasFinish: params.finish !== undefined,\r\n finish: params.finish,\r\n HasTransmit: params.transmit !== undefined ? true : undefined,\r\n transmit: params.transmit,\r\n HasDiffuse: params.diffuse !== undefined,\r\n diffuse: params.diffuse,\r\n HasSpecular: params.specular !== undefined,\r\n specular: params.specular,\r\n HasReflect: params.reflect !== undefined,\r\n reflect: params.reflect,\r\n HasReflectColor: params.reflectColor !== undefined,\r\n reflect_color: params.reflectColor,\r\n Map: maps,\r\n pbr_normal,\r\n },\r\n },\r\n },\r\n model: definitionModelId,\r\n isPrivate: false,\r\n };\r\n\r\n return new RenderMaterialElement(renderMaterialProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new RenderMaterial into a model.\r\n * @param txn The EditTxn to use\r\n * @param definitionModelId Insert the new Texture into this DefinitionModel\r\n * @param materialName The name/CodeValue of the RenderMaterial\r\n * @param params Parameters object which describes how to construct the RenderMaterial\r\n * @returns The Id of the newly inserted RenderMaterial element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String;\r\n /**\r\n * Insert a new RenderMaterial into a model.\r\n * @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use RenderMaterialElement.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const renderMaterial = this.create(txn.iModel, definitionModelId, materialName, params);\r\n return renderMaterial.insert(txn);\r\n }\r\n\r\n /** @beta */\r\n protected static override async onCloned(context: IModelElementCloneContext, sourceProps: ElementProps, targetProps: ElementProps) {\r\n await super.onCloned(context, sourceProps, targetProps);\r\n for (const mapName in sourceProps.jsonProperties?.materialAssets?.renderMaterial?.Map ?? {}) {\r\n if (typeof mapName !== \"string\")\r\n continue;\r\n const sourceMap = sourceProps.jsonProperties.materialAssets.renderMaterial.Map[mapName];\r\n // sourceMap could be null/undefined, keep it the same in targetProps\r\n if (!sourceMap) {\r\n targetProps.jsonProperties.materialAssets.renderMaterial.Map[mapName] = sourceMap;\r\n continue;\r\n }\r\n if (!Id64.isValid(sourceMap.TextureId) || sourceMap.TextureId === undefined)\r\n continue;\r\n targetProps.jsonProperties.materialAssets.renderMaterial.Map[mapName].TextureId = context.findTargetElementId(sourceMap.TextureId ?? Id64.invalid);\r\n }\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace RenderMaterialElement {\r\n /** Parameters used to construct a [[RenderMaterial]].\r\n * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat.\r\n * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type.\r\n * @deprecated in 3.6 - might be removed in next major version. Because it is not useful to use a `class` - just use [[RenderMaterialElementParams]] directly instead.\r\n */\r\n export class Params {\r\n /** A required palette name that categorizes this RenderMaterial */\r\n public paletteName: string;\r\n /** An optional description of this RenderMaterial */\r\n public description?: string;\r\n /** If defined, the color to use for surface fill or diffuse illumination, overriding the surface's own color. */\r\n public color?: RgbFactorProps;\r\n /** The color to use for specular illumination. Default: black. */\r\n public specularColor?: RgbFactorProps;\r\n /** The specular exponent describing the surface's shininess, in the range 0 through 128.\r\n * Default: 0.\r\n */\r\n public finish?: number;\r\n /** A transparency to be applied to the surface, ranging from 0 (fully opaque) to 1 (fully transparent).\r\n * If defined, then the material transparency overrides the transparency of whatever surface the material is applied to.\r\n * If undefined, the material has no effect on surface transparency.\r\n * Default: undefined.\r\n */\r\n public transmit?: number;\r\n /** The surface's diffuse reflectivity from 0.0 to 1.0. Default: 0.6. */\r\n public diffuse?: number;\r\n /** The surface's specular reflectivity from 0.0 to 1.0. Default: 0.0. */\r\n public specular?: number;\r\n /** Currently unused. */\r\n public reflect?: number;\r\n /** Currently unused. */\r\n public reflectColor?: number[];\r\n /** Specifies a texture image to map onto the surface, replacing or mixing with the surface's own color and transparency.\r\n * @note With the exception of `TextureId`, the [TextureMapProps]($common) of [[patternMap]] and [[normalMap]] are expected to be identical. If a property is defined in both\r\n * [[patternMap]]] and [[normalMap]], the value in [[patternMap]] takes precedence.\r\n */\r\n public patternMap?: TextureMapProps;\r\n /** Specifies a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to apply to the surface to simulate more surface detail than is present in the\r\n * surface's geometry.\r\n * @note With the exception of `TextureId`, the [TextureMapProps]($common) of [[patternMap]] and [[normalMap]] are expected to be identical. If a property is defined in both\r\n * [[patternMap]]] and [[normalMap]], the value in [[patternMap]] takes precedence.\r\n */\r\n public normalMap?: NormalMapProps & {\r\n /** A factor by which to multiply the components of the normal vectors read from the texture.\r\n * Default: 1.\r\n */\r\n scale?: number;\r\n };\r\n\r\n /** Construct a new RenderMaterial.Params object with the specified paletteName. Alter the public members on that object to specify settings. */\r\n public constructor(paletteName: string) {\r\n this.paletteName = paletteName;\r\n }\r\n }\r\n}\r\n\r\n/** Parameters used to create a [[RenderMaterial]] element.\r\n * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat.\r\n * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type.\r\n * @public\r\n */\r\nexport interface RenderMaterialElementParams extends RenderMaterialElement.Params { // eslint-disable-line @typescript-eslint/no-deprecated, @typescript-eslint/no-empty-object-type\r\n}\r\n"]}
1
+ {"version":3,"file":"Material.js","sourceRoot":"","sources":["../../src/Material.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EACL,WAAW,EAAE,IAAI,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,yDAAyD;AAEzD;;;GAGG;AACH,MAAM,OAAgB,gBAAiB,SAAQ,iBAAiB;IACvD,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;IAC7E;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,MAAgB,EAAE,iBAAiC,EAAE,IAAY;QACxF,MAAM,QAAQ,GAAa,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACpF,OAAO,IAAI,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,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,mBAAmB,CAAC,SAAS,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;QACrJ,CAAC;IACH,CAAC;;AAGH,cAAc;AACd,WAAiB,qBAAqB;IACpC;;;;OAIG;IACH,MAAa,MAAM;QACjB,mEAAmE;QAC5D,WAAW,CAAS;QAC3B,qDAAqD;QAC9C,WAAW,CAAU;QAC5B,iHAAiH;QAC1G,KAAK,CAAkB;QAC9B,kEAAkE;QAC3D,aAAa,CAAkB;QACtC;;WAEG;QACI,MAAM,CAAU;QACvB;;;;WAIG;QACI,QAAQ,CAAU;QACzB,wEAAwE;QACjE,OAAO,CAAU;QACxB,yEAAyE;QAClE,QAAQ,CAAU;QACzB,wBAAwB;QACjB,OAAO,CAAU;QACxB,wBAAwB;QACjB,YAAY,CAAY;QAC/B;;;WAGG;QACI,UAAU,CAAmB;QACpC;;;;WAIG;QACI,SAAS,CAKd;QAEF,gJAAgJ;QAChJ,YAAmB,WAAmB;YACpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QACjC,CAAC;KACF;IAhDY,4BAAM,SAgDlB,CAAA;AACH,CAAC,EAvDgB,qBAAqB,KAArB,qBAAqB,QAuDrC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n BisCodeSpec, Code, CodeScopeProps, CodeSpec, DefinitionElementProps, ElementProps, NormalMapProps, RenderMaterialAssetMapsProps, RenderMaterialProps, RgbFactorProps, TextureMapProps,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/** A PhysicalMaterial defines the matter that makes up physical elements.\r\n * @note See [[RenderMaterialElement]] for the DefinitionElement used to define rendering characteristics.\r\n * @public\r\n */\r\nexport abstract class PhysicalMaterial extends DefinitionElement {\r\n public static override get className(): string { return \"PhysicalMaterial\"; }\r\n /** Create a Code for a PhysicalMaterial given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param definitionModelId The Id of the DefinitionModel that will contain the PhysicalMaterial and provide the scope for its name.\r\n * @param name The name (codeValue) of the PhysicalMaterial\r\n */\r\n public static createCode(iModel: IModelDb, definitionModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.physicalMaterial);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: name });\r\n }\r\n /** Create a PhysicalMaterial\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the DefinitionModel that will contain the PhysicalMaterial and provide the scope for its name.\r\n * @param name The name (codeValue) of the PhysicalMaterial\r\n * @returns The newly constructed PhysicalMaterial\r\n * @throws [[IModelError]] if there is a problem creating the PhysicalMaterial\r\n */\r\n public static create<T extends PhysicalMaterial>(iModelDb: IModelDb, definitionModelId: CodeScopeProps, name: string): T {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n };\r\n return iModelDb.elements.createElement(elementProps);\r\n }\r\n}\r\n\r\n/** Defines a rendering material.\r\n * @note See [[PhysicalMaterial]] for the DefinitionElement used to define the matter that makes up physical elements.\r\n * @public\r\n */\r\nexport class RenderMaterialElement extends DefinitionElement {\r\n public static override get className(): string { return \"RenderMaterial\"; }\r\n\r\n /** The name of a palette that can be used to categorize multiple materials. */\r\n public paletteName: string;\r\n /** An optional description of the material. */\r\n public description?: string;\r\n\r\n private constructor(props: RenderMaterialProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.paletteName = props.paletteName;\r\n this.description = props.description;\r\n }\r\n\r\n public override toJSON(): RenderMaterialProps {\r\n const val = super.toJSON() as RenderMaterialProps;\r\n val.paletteName = this.paletteName;\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /**\r\n * RenderMaterialElement custom HandledProps includes 'paletteName'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"paletteName\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * RenderMaterialElement deserializes 'paletteName'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): RenderMaterialProps {\r\n const elProps = super.deserialize(props) as RenderMaterialProps;\r\n const instance = props.row;\r\n elProps.paletteName = JsonUtils.asString(instance.paletteName);\r\n return elProps;\r\n }\r\n\r\n /**\r\n * RenderMaterialElement serializes 'paletteName'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: RenderMaterialProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n inst.paletteName = props.paletteName;\r\n return inst;\r\n }\r\n\r\n /** Create a Code for a RenderMaterial given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the RenderMaterial and provides the scope for its name.\r\n * @param name The RenderMaterial name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.renderMaterial);\r\n return 0 === name.length ? Code.createEmpty() : new Code({ spec: codeSpec.id, scope: scopeModelId, value: name });\r\n }\r\n /**\r\n * Create a RenderMaterial with given parameters.\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param materialName The name/CodeValue of the RenderMaterial\r\n * @param params Parameters object which describes how to construct the RenderMaterial\r\n * @returns The newly constructed RenderMaterial element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): RenderMaterialElement {\r\n let maps: RenderMaterialAssetMapsProps | undefined;\r\n const pbr_normal = params.normalMap?.scale;\r\n if (params.patternMap || params.normalMap) {\r\n // If both normal and pattern map are present, their texture mapping modes, angles, scales, etc are expected to match.\r\n type TexMap = Omit<TextureMapProps, \"TextureId\">;\r\n function choose<K extends keyof TexMap>(obj: TexMap, key: K): void {\r\n const pat = params.patternMap;\r\n if (pat && undefined !== pat[key])\r\n obj[key] = pat[key];\r\n else if (params.normalMap && undefined !== params.normalMap[key])\r\n obj[key] = params.normalMap[key];\r\n }\r\n\r\n const baseProps: TexMap = {};\r\n choose(baseProps, \"pattern_angle\");\r\n choose(baseProps, \"pattern_u_flip\");\r\n choose(baseProps, \"pattern_flip\");\r\n choose(baseProps, \"pattern_scale\");\r\n choose(baseProps, \"pattern_offset\");\r\n choose(baseProps, \"pattern_scalemode\");\r\n choose(baseProps, \"pattern_mapping\");\r\n choose(baseProps, \"pattern_weight\");\r\n choose(baseProps, \"pattern_useconstantlod\");\r\n choose(baseProps, \"pattern_constantlod_repetitions\");\r\n choose(baseProps, \"pattern_constantlod_offset\");\r\n choose(baseProps, \"pattern_constantlod_mindistanceclamp\");\r\n choose(baseProps, \"pattern_constantlod_maxdistanceclamp\");\r\n\r\n maps = {};\r\n if (params.patternMap)\r\n maps.Pattern = { ...params.patternMap, ...baseProps };\r\n\r\n if (params.normalMap) {\r\n maps.Normal = {\r\n ...params.normalMap,\r\n ...baseProps,\r\n };\r\n\r\n delete (maps.Normal as any).scale;\r\n }\r\n }\r\n\r\n const renderMaterialProps: RenderMaterialProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, materialName),\r\n paletteName: params.paletteName,\r\n description: params.description,\r\n jsonProperties: {\r\n materialAssets: {\r\n renderMaterial: {\r\n HasBaseColor: params.color !== undefined,\r\n color: params.color,\r\n HasSpecularColor: params.specularColor !== undefined,\r\n specular_color: params.specularColor,\r\n HasFinish: params.finish !== undefined,\r\n finish: params.finish,\r\n HasTransmit: params.transmit !== undefined ? true : undefined,\r\n transmit: params.transmit,\r\n HasDiffuse: params.diffuse !== undefined,\r\n diffuse: params.diffuse,\r\n HasSpecular: params.specular !== undefined,\r\n specular: params.specular,\r\n HasReflect: params.reflect !== undefined,\r\n reflect: params.reflect,\r\n HasReflectColor: params.reflectColor !== undefined,\r\n reflect_color: params.reflectColor,\r\n Map: maps,\r\n pbr_normal,\r\n },\r\n },\r\n },\r\n model: definitionModelId,\r\n isPrivate: false,\r\n };\r\n\r\n return new RenderMaterialElement(renderMaterialProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new RenderMaterial into a model.\r\n * @param txn The EditTxn to use\r\n * @param definitionModelId Insert the new Texture into this DefinitionModel\r\n * @param materialName The name/CodeValue of the RenderMaterial\r\n * @param params Parameters object which describes how to construct the RenderMaterial\r\n * @returns The Id of the newly inserted RenderMaterial element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String;\r\n /**\r\n * Insert a new RenderMaterial into a model.\r\n * @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use RenderMaterialElement.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, materialName: string, params: RenderMaterialElementParams): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const renderMaterial = this.create(txn.iModel, definitionModelId, materialName, params);\r\n return renderMaterial.insert(txn);\r\n }\r\n\r\n /** @beta */\r\n protected static override async onCloned(context: IModelElementCloneContext, sourceProps: ElementProps, targetProps: ElementProps) {\r\n await super.onCloned(context, sourceProps, targetProps);\r\n for (const mapName in sourceProps.jsonProperties?.materialAssets?.renderMaterial?.Map ?? {}) {\r\n if (typeof mapName !== \"string\")\r\n continue;\r\n const sourceMap = sourceProps.jsonProperties.materialAssets.renderMaterial.Map[mapName];\r\n // sourceMap could be null/undefined, keep it the same in targetProps\r\n if (!sourceMap) {\r\n targetProps.jsonProperties.materialAssets.renderMaterial.Map[mapName] = sourceMap;\r\n continue;\r\n }\r\n if (!Id64.isValid(sourceMap.TextureId) || sourceMap.TextureId === undefined)\r\n continue;\r\n targetProps.jsonProperties.materialAssets.renderMaterial.Map[mapName].TextureId = context.findTargetElementId(sourceMap.TextureId ?? Id64.invalid);\r\n }\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace RenderMaterialElement {\r\n /** Parameters used to construct a [[RenderMaterial]].\r\n * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat.\r\n * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type.\r\n * @deprecated in 3.6 - might be removed in next major version. Because it is not useful to use a `class` - just use [[RenderMaterialElementParams]] directly instead.\r\n */\r\n export class Params {\r\n /** A required palette name that categorizes this RenderMaterial */\r\n public paletteName: string;\r\n /** An optional description of this RenderMaterial */\r\n public description?: string;\r\n /** If defined, the color to use for surface fill or diffuse illumination, overriding the surface's own color. */\r\n public color?: RgbFactorProps;\r\n /** The color to use for specular illumination. Default: black. */\r\n public specularColor?: RgbFactorProps;\r\n /** The specular exponent describing the surface's shininess, in the range 0 through 128.\r\n * Default: 0.\r\n */\r\n public finish?: number;\r\n /** A transparency to be applied to the surface, ranging from 0 (fully opaque) to 1 (fully transparent).\r\n * If defined, then the material transparency overrides the transparency of whatever surface the material is applied to.\r\n * If undefined, the material has no effect on surface transparency.\r\n * Default: undefined.\r\n */\r\n public transmit?: number;\r\n /** The surface's diffuse reflectivity from 0.0 to 1.0. Default: 0.6. */\r\n public diffuse?: number;\r\n /** The surface's specular reflectivity from 0.0 to 1.0. Default: 0.0. */\r\n public specular?: number;\r\n /** Currently unused. */\r\n public reflect?: number;\r\n /** Currently unused. */\r\n public reflectColor?: number[];\r\n /** Specifies a texture image to map onto the surface, replacing or mixing with the surface's own color and transparency.\r\n * @note With the exception of `TextureId`, the [TextureMapProps]($common) of [[patternMap]] and [[normalMap]] are expected to be identical. If a property is defined in both\r\n * [[patternMap]]] and [[normalMap]], the value in [[patternMap]] takes precedence.\r\n */\r\n public patternMap?: TextureMapProps;\r\n /** Specifies a [normal map](https://en.wikipedia.org/wiki/Normal_mapping) to apply to the surface to simulate more surface detail than is present in the\r\n * surface's geometry.\r\n * @note With the exception of `TextureId`, the [TextureMapProps]($common) of [[patternMap]] and [[normalMap]] are expected to be identical. If a property is defined in both\r\n * [[patternMap]]] and [[normalMap]], the value in [[patternMap]] takes precedence.\r\n */\r\n public normalMap?: NormalMapProps & {\r\n /** A factor by which to multiply the components of the normal vectors read from the texture.\r\n * Default: 1.\r\n */\r\n scale?: number;\r\n };\r\n\r\n /** Construct a new RenderMaterial.Params object with the specified paletteName. Alter the public members on that object to specify settings. */\r\n public constructor(paletteName: string) {\r\n this.paletteName = paletteName;\r\n }\r\n }\r\n}\r\n\r\n/** Parameters used to create a [[RenderMaterial]] element.\r\n * The persistent JSON representation - [RenderMaterialAssetProps]($common) - is quite verbose and unwieldy. This representation simplifies it somewhat.\r\n * @see [[RenderMaterialElement.create]] and [[RenderMaterialElement.insert]] to create a [[RenderMaterial]] from parameters of this type.\r\n * @public\r\n */\r\nexport interface RenderMaterialElementParams extends RenderMaterialElement.Params { // eslint-disable-line @typescript-eslint/no-deprecated, @typescript-eslint/no-empty-object-type\r\n}\r\n"]}
@@ -207,7 +207,7 @@ export declare class Model extends Entity {
207
207
  insert(txn: EditTxn): Id64String;
208
208
  /**
209
209
  * Insert this Model in the iModel.
210
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use Model.insert(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
210
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use Model.insert(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
211
211
  */
212
212
  insert(): Id64String;
213
213
  /**
@@ -217,7 +217,7 @@ export declare class Model extends Entity {
217
217
  update(txn: EditTxn): void;
218
218
  /**
219
219
  * Update this Model in the iModel.
220
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use Model.update(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
220
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use Model.update(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
221
221
  */
222
222
  update(): void;
223
223
  /**
@@ -227,7 +227,7 @@ export declare class Model extends Entity {
227
227
  delete(txn: EditTxn): void;
228
228
  /**
229
229
  * Delete this Model from the iModel.
230
- * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use Model.delete(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
230
+ * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use Model.delete(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help.
231
231
  */
232
232
  delete(): void;
233
233
  protected collectReferenceIds(referenceIds: EntityReferenceSet): void;
@@ -328,7 +328,7 @@ export declare class PhysicalModel extends SpatialModel {
328
328
  * @beta
329
329
  */
330
330
  static insert(txn: EditTxn, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String;
331
- /** @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use PhysicalModel.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
331
+ /** @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use PhysicalModel.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
332
332
  static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String;
333
333
  }
334
334
  /** A container for persisting spatial location elements.
@@ -347,7 +347,7 @@ export declare class SpatialLocationModel extends SpatialModel {
347
347
  * @beta
348
348
  */
349
349
  static insert(txn: EditTxn, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String;
350
- /** @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use SpatialLocationModel.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
350
+ /** @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use SpatialLocationModel.insert(txn, ...) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */
351
351
  static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String;
352
352
  }
353
353
  /** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.
@@ -402,7 +402,7 @@ export declare class SheetIndexModel extends InformationModel {
402
402
  * @throws [[IModelError]] if there is an insert problem.
403
403
  */
404
404
  static insert(txn: EditTxn, parentSubjectId: Id64String, name: string): Id64String;
405
- /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use SheetIndexModel.insert(txn, ...) instead. */
405
+ /** @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use SheetIndexModel.insert(txn, ...) instead. */
406
406
  static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String;
407
407
  }
408
408
  /** A container for persisting Information Record Elements