@itwin/core-backend 5.3.0-dev.2 → 5.3.0-dev.4

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 (45) hide show
  1. package/lib/cjs/IModelDb.js +1 -1
  2. package/lib/cjs/IModelDb.js.map +1 -1
  3. package/lib/cjs/annotations/FrameGeometry.js +6 -6
  4. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  5. package/lib/cjs/annotations/LeaderGeometry.js +4 -4
  6. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  7. package/lib/cjs/annotations/TextAnnotationElement.d.ts +101 -20
  8. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  9. package/lib/cjs/annotations/TextAnnotationElement.js +202 -64
  10. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  11. package/lib/cjs/annotations/TextBlockGeometry.js +3 -3
  12. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  13. package/lib/cjs/annotations/TextBlockLayout.d.ts +2 -2
  14. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
  15. package/lib/cjs/annotations/TextBlockLayout.js +52 -25
  16. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  17. package/lib/esm/IModelDb.js +1 -1
  18. package/lib/esm/IModelDb.js.map +1 -1
  19. package/lib/esm/annotations/FrameGeometry.js +6 -6
  20. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  21. package/lib/esm/annotations/LeaderGeometry.js +4 -4
  22. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  23. package/lib/esm/annotations/TextAnnotationElement.d.ts +101 -20
  24. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  25. package/lib/esm/annotations/TextAnnotationElement.js +201 -63
  26. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  27. package/lib/esm/annotations/TextBlockGeometry.js +3 -3
  28. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  29. package/lib/esm/annotations/TextBlockLayout.d.ts +2 -2
  30. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
  31. package/lib/esm/annotations/TextBlockLayout.js +52 -25
  32. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  33. package/lib/esm/test/AnnotationTestUtils.js +1 -1
  34. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  35. package/lib/esm/test/annotations/Fields.test.js +2 -2
  36. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  37. package/lib/esm/test/annotations/FrameGeometry.test.js +4 -4
  38. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  39. package/lib/esm/test/annotations/LeaderGeometry.test.js +8 -8
  40. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  41. package/lib/esm/test/annotations/TextAnnotation.test.js +130 -35
  42. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  43. package/lib/esm/test/annotations/TextBlock.test.js +218 -151
  44. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  45. package/package.json +14 -14
@@ -26,20 +26,20 @@ function appendFrameToBuilder(builder, frame, range, transform, geomParams) {
26
26
  return false;
27
27
  }
28
28
  const params = geomParams.clone();
29
- if (frame.fill === "none" || frame.fill === undefined) {
29
+ if (frame.fillColor === "none" || frame.fillColor === undefined) {
30
30
  params.fillDisplay = core_common_1.FillDisplay.Never;
31
31
  }
32
- else if (frame.fill === "background") {
32
+ else if (frame.fillColor === "background") {
33
33
  params.backgroundFill = core_common_1.BackgroundFill.Solid;
34
34
  params.fillDisplay = core_common_1.FillDisplay.Blanking;
35
35
  }
36
- else if (frame.fill !== "subcategory") {
37
- params.fillColor = core_common_1.ColorDef.fromJSON(frame.fill);
36
+ else if (frame.fillColor !== "subcategory") {
37
+ params.fillColor = core_common_1.ColorDef.fromJSON(frame.fillColor);
38
38
  params.lineColor = params.fillColor;
39
39
  params.fillDisplay = core_common_1.FillDisplay.Blanking;
40
40
  }
41
- if (frame.border !== "subcategory") {
42
- params.lineColor = core_common_1.ColorDef.fromJSON(frame.border);
41
+ if (frame.borderColor !== "subcategory") {
42
+ params.lineColor = core_common_1.ColorDef.fromJSON(frame.borderColor);
43
43
  params.weight = frame.borderWeight;
44
44
  }
45
45
  const frameGeometry = computeFrame({ frame: frame.shape, range, transform });
@@ -1 +1 @@
1
- {"version":3,"file":"FrameGeometry.js","sourceRoot":"","sources":["../../../src/annotations/FrameGeometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAeH,oDAsCC;AAoBD,oCAeC;AAmBD,sDAWC;AAnHD,oDAA2J;AAC3J,wDAAiI;AAEjI;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,OAAgC,EAAE,KAA0B,EAAE,KAAc,EAAE,SAAoB,EAAE,UAA0B;IACjK,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IAElC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACtD,MAAM,CAAC,WAAW,GAAG,yBAAW,CAAC,KAAK,CAAC;IACzC,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACvC,MAAM,CAAC,cAAc,GAAG,4BAAc,CAAC,KAAK,CAAC;QAC7C,MAAM,CAAC,WAAW,GAAG,yBAAW,CAAC,QAAQ,CAAC;IAC5C,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QACxC,MAAM,CAAC,SAAS,GAAG,sBAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QACpC,M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AK,CAAC,uCAAuC,CAAC,CAAC;IAEpE,kEAAkE;IAClE,wDAAwD;IACxD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,kLAAkL;IAClL,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,kFAAkF;IAClF,MAAM,YAAY,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAEtD,6CAA6C;IAC7C,MAAM,cAAc,GAAG,GAAG,GAAG,CAAC,CAAC;IAC/B,MAAM,QAAQ,GAAc,EAAE,CAAC;IAE/B,8BAA8B;IAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,qBAAK,CAAC,aAAa,CAAC,CAAC,GAAG,cAAc,GAAG,WAAW,CAAC,CAAC;QACpE,MAAM,MAAM,GAAG,wBAAQ,CAAC,WAAW,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACzD,QAAQ,CAAC,IAAI,CAAC,uBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,oBAAoB;IACpB,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3B,4BAA4B;IAC5B,MAAM,KAAK,GAAG,4BAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAClD,OAAO,oBAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementGeometry\n */\n\n\nimport { BackgroundFill, ColorDef, ElementGeometry, FillDisplay, GeometryParams, TextAnnotationFrameShape, TextFrameStyleProps } from \"@itwin/core-common\";\nimport { Angle, AngleSweep, Arc3d, LineString3d, Loop, Path, Point3d, Range2d, Transform, Vector2d } from \"@itwin/core-geometry\";\n\n/**\n * Based on the frame style, this method will construct and append [[GeometryParams]] (for line style) and a [[Loop]] (for the frame shape) to the builder.\n * @param builder that will be appended to in place\n * @param frame\n * @param range to enclose with the frame\n * @param transform that transforms the range to world coordinates\n * @returns `true` if any geometry was appended to the builder\n* @beta\n */\nexport function appendFrameToBuilder(builder: ElementGeometry.Builder, frame: TextFrameStyleProps, range: Range2d, transform: Transform, geomParams: GeometryParams): boolean {\n if (frame.shape === \"none\" || frame.shape === undefined) {\n return false;\n }\n\n const params = geomParams.clone();\n\n if (frame.fill === \"none\" || frame.fill === undefined) {\n params.fillDisplay = FillDisplay.Never;\n } else if (frame.fill === \"background\") {\n params.backgroundFill = BackgroundFill.Solid;\n params.fillDisplay = FillDisplay.Blanking;\n } else if (frame.fill !== \"subcategory\") {\n params.fillColor = ColorDef.fromJSON(frame.fill);\n params.lineColor = params.fillColor;\n params.fillDisplay = FillDisplay.Blanking;\n }\n\n if (frame.border !== \"subcategory\") {\n params.lineColor = ColorDef.fromJSON(frame.border);\n params.weight = frame.borderWeight;\n }\n\n const frameGeometry = computeFrame({ frame: frame.shape, range, transform });\n if (!builder.appendGeometryParamsChange(params) || !builder.appendGeometryQuery(frameGeometry)) {\n return false;\n }\n\n // The tile generator does not produce an outline for shapes with blanking fill. We must add the outline separately.\n if (params.fillDisplay === FillDisplay.Blanking) {\n const outlineParams = params.clone();\n outlineParams.fillDisplay = FillDisplay.Never;\n if (!builder.appendGeometryParamsChange(outlineParams) || !builder.appendGeometryQuery(frameGeometry)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Arguments for the [[computeFrame]] method.\n * @beta\n */\nexport interface ComputeFrameArgs {\n /** Frame shape to be calculated */\n frame: Exclude<TextAnnotationFrameShape, \"none\">;\n /** Range to be enclosed */\n range: Range2d;\n /** Transform that translates and rotates the range to world coordinates */\n transform: Transform;\n}\n\n/**\n * Computes the frame geometry based on the provided frame shape and range.\n * @returns a [Loop]($geometry) or [Path]($geometry) (if it's just a line) that represents the frame geometry\n * @beta\n */\nexport function computeFrame(args: ComputeFrameArgs): Loop | Path {\n switch (args.frame) {\n case \"line\": return computeLine(args.range, args.transform);\n case \"rectangle\": return computeRectangle(args.range, args.transform);\n case \"circle\": return computeCircle(args.range, args.transform);\n case \"equilateralTriangle\": return computeTriangle(args.range, args.transform);\n case \"diamond\": return computeDiamond(args.range, args.transform);\n case \"square\": return computeSquare(args.range, args.transform);\n case \"pentagon\": return computePolygon(5, args.range, args.transform, 90);\n case \"hexagon\": return computePolygon(6, args.range, args.transform);\n case \"octagon\": return computePolygon(8, args.range, args.transform, 180 / 8); // or pi/8 in radians\n case \"capsule\": return computeCapsule(args.range, args.transform);\n case \"roundedRectangle\": return computeRoundedRectangle(args.range, args.transform);\n default: return computeRectangle(args.range, args.transform);\n }\n}\n\n/**\n * Arguments for the [[computeIntervalPoints]] method.\n * @beta\n */\nexport interface ComputeIntervalPointsArgs extends ComputeFrameArgs {\n /** A factor applied to divide each straight edge. A value of 1 will place a single point on each vertex. */\n lineIntervalFactor?: number;\n /** A factor applied to divide each straight edge. A value of 1 will place a single point on each vertex. */\n arcIntervalFactor?: number;\n}\n\n/**\n * Computes points along the edges of the frame geometry based on the provided frame shape, range, and interval factors.\n * These can be used for snapping or attaching leaders.\n * @returns an array of [[Point3d]] that represent the points along the edges of the frame geometry. Returns `undefined` if the loop created by `computeFrame` is empty.\n * @beta\n */\nexport function computeIntervalPoints({ frame, range, transform, lineIntervalFactor = 0.5, arcIntervalFactor = 0.25 }: ComputeIntervalPointsArgs): Point3d[] | undefined {\n const points: Point3d[] = [];\n const curves = computeFrame({ frame, range, transform }).collectCurvePrimitives(undefined, false, true);\n\n curves.forEach((curve) => {\n const end = curve instanceof Arc3d ? arcIntervalFactor : lineIntervalFactor;\n for (let interval = 0; interval <= 1; interval += end) {\n points.push(curve.fractionToPoint(interval));\n }\n });\n return points;\n}\n\n/** Line - currently just adds an underline. Once we have leaders, this method may change. */\nconst computeLine = (range: Range2d, transform: Transform): Path => {\n const points = [Point3d.create(range.low.x, range.low.y), Point3d.create(range.high.x, range.low.y)];\n const frame = LineString3d.createPoints(points);\n\n return Path.create(frame.cloneTransformed(transform));\n}\n\n/** Rectangle - simplest frame */\nconst computeRectangle = (range: Range2d, transform: Transform): Loop => {\n const points = range.corners3d(true);\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Rounded Rectangle: each corner will be turned into an arc with the radius of the arc being the @param radiusFactor * the height (yLength) of the range */\nconst computeRoundedRectangle = (range: Range2d, transform: Transform, radiusFactor: number = 0.25): Loop => {\n const radius = range.yLength() * radiusFactor * Math.sqrt(2);\n // We're going to circumscribe the range with our rounded edges. The corners of the range will fall on 45 degree angles.\n const radiusOffsetFactor = range.yLength() * radiusFactor;\n\n // These values are the origins of the circles\n const inLeft = range.low.x + radiusOffsetFactor;\n const inRight = range.high.x - radiusOffsetFactor;\n const inBottom = range.low.y + radiusOffsetFactor;\n const inTop = range.high.y - radiusOffsetFactor\n\n // These values exist on the circles\n const exLeft = inLeft - radius;\n const exRight = inRight + radius;\n const exBottom = inBottom - radius;\n const exTop = inTop + radius;\n\n const q1 = AngleSweep.createStartEndDegrees(0, 90);\n const q2 = AngleSweep.createStartEndDegrees(90, 180);\n const q3 = AngleSweep.createStartEndDegrees(180, 270);\n const q4 = AngleSweep.createStartEndDegrees(270, 360);\n\n\n const curves = [\n LineString3d.create([Point3d.create(inRight, exTop), Point3d.create(inLeft, exTop)]), // top\n Arc3d.createXY(Point3d.create(inLeft, inTop), radius, q2), // top left\n LineString3d.create([Point3d.create(exLeft, inTop), Point3d.create(exLeft, inBottom)]), // left\n Arc3d.createXY(Point3d.create(inLeft, inBottom), radius, q3), // bottom left\n LineString3d.create([Point3d.create(inLeft, exBottom), Point3d.create(inRight, exBottom)]), // bottom\n Arc3d.createXY(Point3d.create(inRight, inBottom), radius, q4), // bottom right\n LineString3d.create([Point3d.create(exRight, inBottom), Point3d.create(exRight, inTop)]), // right\n Arc3d.createXY(Point3d.create(inRight, inTop), radius, q1), // top right\n ];\n\n return Loop.createArray(curves.map((curve) => curve.cloneTransformed(transform)))\n}\n\n\n/** Circle */\nconst computeCircle = (range: Range2d, transform: Transform): Loop => {\n const radius = range.low.distance(range.high) / 2;\n const frame = Arc3d.createXY(Point3d.createFrom(range.center), radius);\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Equilateral Triangle */\nconst computeTriangle = (range: Range2d, transform: Transform): Loop => {\n\n const xLength = range.xLength();\n const yLength = range.yLength();\n const center = range.center;\n const points: Point3d[] = [];\n\n const magnitude = (xLength > yLength) ? (xLength * Math.sqrt(3) + yLength) / 2 : (yLength * Math.sqrt(3) + xLength) / 2;\n\n const v1 = Vector2d.create(0, magnitude);\n const vectors = [\n v1, // top\n v1.rotateXY(Angle.createDegrees(120)), // left\n v1.rotateXY(Angle.createDegrees(240)), // right\n v1 // top\n ];\n\n vectors.forEach((v) => {\n points.push(Point3d.create(center.x + v.x, center.y + v.y));\n });\n\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Diamond (square rotated 45 degrees) */\nconst computeDiamond = (range: Range2d, transform: Transform): Loop => {\n const offset = (range.xLength() + range.yLength()) / 2;\n const center = range.center;\n\n const points = [\n Point3d.createFrom({ x: center.x, y: center.y + offset }), // top\n Point3d.createFrom({ x: center.x + offset, y: center.y }), // right\n Point3d.createFrom({ x: center.x, y: center.y - offset }), // bottom\n Point3d.createFrom({ x: center.x - offset, y: center.y }), // left\n Point3d.createFrom({ x: center.x, y: center.y + offset }), // top\n ];\n\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Square */\nconst computeSquare = (range: Range2d, transform: Transform): Loop => {\n\n // Extend range\n const xLength = range.xLength() / 2;\n const yLength = range.yLength() / 2;\n const center = range.center;\n if (xLength > yLength) {\n range.extendPoint({ x: center.x, y: center.y + xLength });\n range.extendPoint({ x: center.x, y: center.y - xLength });\n } else {\n range.extendPoint({ x: center.x + yLength, y: center.y });\n range.extendPoint({ x: center.x - yLength, y: center.y });\n }\n\n const points = range.corners3d(true);\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Capsule (or pill shape) */\nconst computeCapsule = (range: Range2d, transform: Transform): Loop => {\n const height = range.yLength();\n const radius = height * (Math.sqrt(2) / 2);\n\n // We're going to circumscribe the range with our rounded edges. The corners of the range will fall on 45 degree angles.\n const radiusOffsetFactor = height / 2;\n\n // These values are the origins of the circles\n const inLeft = range.low.x + radiusOffsetFactor;\n const inRight = range.high.x - radiusOffsetFactor;\n const inBottom = range.low.y + radiusOffsetFactor;\n const inTop = range.high.y - radiusOffsetFactor\n\n // These values exist on the circles\n const exBottom = inBottom - radius;\n const exTop = inTop + radius;\n\n const leftHalfCircle = AngleSweep.createStartEndDegrees(90, 270);\n const rightHalfCircle = AngleSweep.createStartEndDegrees(-90, 90);\n\n const curves = [\n LineString3d.create([Point3d.create(inRight, exTop), Point3d.create(inLeft, exTop)]), // top\n Arc3d.createXY(Point3d.create(inLeft, range.center.y), radius, leftHalfCircle), // left\n LineString3d.create([Point3d.create(inLeft, exBottom), Point3d.create(inRight, exBottom)]), // bottom\n Arc3d.createXY(Point3d.create(inRight, range.center.y), radius, rightHalfCircle), // right\n ];\n\n return Loop.createArray(curves.map((curve) => curve.cloneTransformed(transform)));\n}\n\n/** Regular polygon with n sides: note, this a generic method that can be used to create any polygon, but the frame will not be as tightly encapsulating. */\nconst computePolygon = (n: number, range: Range2d, transform: Transform, angleOffset: number = 0): Loop => {\n // These are math terms: cspell:ignore inradius circumradius\n if (n < 3) throw new Error(\"A polygon must have at least 3 sides.\");\n\n // We're assuming the polygon is a regular polygon with `n` sides.\n // The center of the polygon is the center of the range.\n const center = range.center;\n // The inradius is the distance from the center to the midpoint of each side of the polygon. On our range, this coincides with the distance from the center to one of its corners.\n const inradius = range.low.distance(range.high) / 2;\n // The circumradius is the distance from the center to each vertex of the polygon.\n const circumradius = inradius / Math.cos(Math.PI / n);\n\n // The exterior angles add up to 360 degrees.\n const angleIncrement = 360 / n;\n const vertices: Point3d[] = [];\n\n // Add a point for each vertex\n for (let i = 0; i < n; i++) {\n const angle = Angle.createDegrees(i * angleIncrement + angleOffset);\n const vector = Vector2d.createPolar(circumradius, angle);\n vertices.push(Point3d.create(center.x + vector.x, center.y + vector.y));\n }\n\n // Close the polygon\n vertices.push(vertices[0]);\n\n // Finally compute the loop!\n const frame = LineString3d.createPoints(vertices);\n return Loop.create(frame.cloneTransformed(transform));\n};"]}
1
+ {"version":3,"file":"FrameGeometry.js","sourceRoot":"","sources":["../../../src/annotations/FrameGeometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAeH,oDAsCC;AAoBD,oCAeC;AAmBD,sDAWC;AAnHD,oDAA2J;AAC3J,wDAAiI;AAEjI;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,OAAgC,EAAE,KAA0B,EAAE,KAAc,EAAE,SAAoB,EAAE,UAA0B;IACjK,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;IAElC,IAAI,KAAK,CAAC,SAAS,KAAK,MAAM,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC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AM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,oBAAoB;IACpB,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3B,4BAA4B;IAC5B,MAAM,KAAK,GAAG,4BAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAClD,OAAO,oBAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementGeometry\n */\n\n\nimport { BackgroundFill, ColorDef, ElementGeometry, FillDisplay, GeometryParams, TextAnnotationFrameShape, TextFrameStyleProps } from \"@itwin/core-common\";\nimport { Angle, AngleSweep, Arc3d, LineString3d, Loop, Path, Point3d, Range2d, Transform, Vector2d } from \"@itwin/core-geometry\";\n\n/**\n * Based on the frame style, this method will construct and append [[GeometryParams]] (for line style) and a [[Loop]] (for the frame shape) to the builder.\n * @param builder that will be appended to in place\n * @param frame\n * @param range to enclose with the frame\n * @param transform that transforms the range to world coordinates\n * @returns `true` if any geometry was appended to the builder\n* @beta\n */\nexport function appendFrameToBuilder(builder: ElementGeometry.Builder, frame: TextFrameStyleProps, range: Range2d, transform: Transform, geomParams: GeometryParams): boolean {\n if (frame.shape === \"none\" || frame.shape === undefined) {\n return false;\n }\n\n const params = geomParams.clone();\n\n if (frame.fillColor === \"none\" || frame.fillColor === undefined) {\n params.fillDisplay = FillDisplay.Never;\n } else if (frame.fillColor === \"background\") {\n params.backgroundFill = BackgroundFill.Solid;\n params.fillDisplay = FillDisplay.Blanking;\n } else if (frame.fillColor !== \"subcategory\") {\n params.fillColor = ColorDef.fromJSON(frame.fillColor);\n params.lineColor = params.fillColor;\n params.fillDisplay = FillDisplay.Blanking;\n }\n\n if (frame.borderColor !== \"subcategory\") {\n params.lineColor = ColorDef.fromJSON(frame.borderColor);\n params.weight = frame.borderWeight;\n }\n\n const frameGeometry = computeFrame({ frame: frame.shape, range, transform });\n if (!builder.appendGeometryParamsChange(params) || !builder.appendGeometryQuery(frameGeometry)) {\n return false;\n }\n\n // The tile generator does not produce an outline for shapes with blanking fill. We must add the outline separately.\n if (params.fillDisplay === FillDisplay.Blanking) {\n const outlineParams = params.clone();\n outlineParams.fillDisplay = FillDisplay.Never;\n if (!builder.appendGeometryParamsChange(outlineParams) || !builder.appendGeometryQuery(frameGeometry)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Arguments for the [[computeFrame]] method.\n * @beta\n */\nexport interface ComputeFrameArgs {\n /** Frame shape to be calculated */\n frame: Exclude<TextAnnotationFrameShape, \"none\">;\n /** Range to be enclosed */\n range: Range2d;\n /** Transform that translates and rotates the range to world coordinates */\n transform: Transform;\n}\n\n/**\n * Computes the frame geometry based on the provided frame shape and range.\n * @returns a [Loop]($geometry) or [Path]($geometry) (if it's just a line) that represents the frame geometry\n * @beta\n */\nexport function computeFrame(args: ComputeFrameArgs): Loop | Path {\n switch (args.frame) {\n case \"line\": return computeLine(args.range, args.transform);\n case \"rectangle\": return computeRectangle(args.range, args.transform);\n case \"circle\": return computeCircle(args.range, args.transform);\n case \"equilateralTriangle\": return computeTriangle(args.range, args.transform);\n case \"diamond\": return computeDiamond(args.range, args.transform);\n case \"square\": return computeSquare(args.range, args.transform);\n case \"pentagon\": return computePolygon(5, args.range, args.transform, 90);\n case \"hexagon\": return computePolygon(6, args.range, args.transform);\n case \"octagon\": return computePolygon(8, args.range, args.transform, 180 / 8); // or pi/8 in radians\n case \"capsule\": return computeCapsule(args.range, args.transform);\n case \"roundedRectangle\": return computeRoundedRectangle(args.range, args.transform);\n default: return computeRectangle(args.range, args.transform);\n }\n}\n\n/**\n * Arguments for the [[computeIntervalPoints]] method.\n * @beta\n */\nexport interface ComputeIntervalPointsArgs extends ComputeFrameArgs {\n /** A factor applied to divide each straight edge. A value of 1 will place a single point on each vertex. */\n lineIntervalFactor?: number;\n /** A factor applied to divide each straight edge. A value of 1 will place a single point on each vertex. */\n arcIntervalFactor?: number;\n}\n\n/**\n * Computes points along the edges of the frame geometry based on the provided frame shape, range, and interval factors.\n * These can be used for snapping or attaching leaders.\n * @returns an array of [[Point3d]] that represent the points along the edges of the frame geometry. Returns `undefined` if the loop created by `computeFrame` is empty.\n * @beta\n */\nexport function computeIntervalPoints({ frame, range, transform, lineIntervalFactor = 0.5, arcIntervalFactor = 0.25 }: ComputeIntervalPointsArgs): Point3d[] | undefined {\n const points: Point3d[] = [];\n const curves = computeFrame({ frame, range, transform }).collectCurvePrimitives(undefined, false, true);\n\n curves.forEach((curve) => {\n const end = curve instanceof Arc3d ? arcIntervalFactor : lineIntervalFactor;\n for (let interval = 0; interval <= 1; interval += end) {\n points.push(curve.fractionToPoint(interval));\n }\n });\n return points;\n}\n\n/** Line - currently just adds an underline. Once we have leaders, this method may change. */\nconst computeLine = (range: Range2d, transform: Transform): Path => {\n const points = [Point3d.create(range.low.x, range.low.y), Point3d.create(range.high.x, range.low.y)];\n const frame = LineString3d.createPoints(points);\n\n return Path.create(frame.cloneTransformed(transform));\n}\n\n/** Rectangle - simplest frame */\nconst computeRectangle = (range: Range2d, transform: Transform): Loop => {\n const points = range.corners3d(true);\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Rounded Rectangle: each corner will be turned into an arc with the radius of the arc being the @param radiusFactor * the height (yLength) of the range */\nconst computeRoundedRectangle = (range: Range2d, transform: Transform, radiusFactor: number = 0.25): Loop => {\n const radius = range.yLength() * radiusFactor * Math.sqrt(2);\n // We're going to circumscribe the range with our rounded edges. The corners of the range will fall on 45 degree angles.\n const radiusOffsetFactor = range.yLength() * radiusFactor;\n\n // These values are the origins of the circles\n const inLeft = range.low.x + radiusOffsetFactor;\n const inRight = range.high.x - radiusOffsetFactor;\n const inBottom = range.low.y + radiusOffsetFactor;\n const inTop = range.high.y - radiusOffsetFactor\n\n // These values exist on the circles\n const exLeft = inLeft - radius;\n const exRight = inRight + radius;\n const exBottom = inBottom - radius;\n const exTop = inTop + radius;\n\n const q1 = AngleSweep.createStartEndDegrees(0, 90);\n const q2 = AngleSweep.createStartEndDegrees(90, 180);\n const q3 = AngleSweep.createStartEndDegrees(180, 270);\n const q4 = AngleSweep.createStartEndDegrees(270, 360);\n\n\n const curves = [\n LineString3d.create([Point3d.create(inRight, exTop), Point3d.create(inLeft, exTop)]), // top\n Arc3d.createXY(Point3d.create(inLeft, inTop), radius, q2), // top left\n LineString3d.create([Point3d.create(exLeft, inTop), Point3d.create(exLeft, inBottom)]), // left\n Arc3d.createXY(Point3d.create(inLeft, inBottom), radius, q3), // bottom left\n LineString3d.create([Point3d.create(inLeft, exBottom), Point3d.create(inRight, exBottom)]), // bottom\n Arc3d.createXY(Point3d.create(inRight, inBottom), radius, q4), // bottom right\n LineString3d.create([Point3d.create(exRight, inBottom), Point3d.create(exRight, inTop)]), // right\n Arc3d.createXY(Point3d.create(inRight, inTop), radius, q1), // top right\n ];\n\n return Loop.createArray(curves.map((curve) => curve.cloneTransformed(transform)))\n}\n\n\n/** Circle */\nconst computeCircle = (range: Range2d, transform: Transform): Loop => {\n const radius = range.low.distance(range.high) / 2;\n const frame = Arc3d.createXY(Point3d.createFrom(range.center), radius);\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Equilateral Triangle */\nconst computeTriangle = (range: Range2d, transform: Transform): Loop => {\n\n const xLength = range.xLength();\n const yLength = range.yLength();\n const center = range.center;\n const points: Point3d[] = [];\n\n const magnitude = (xLength > yLength) ? (xLength * Math.sqrt(3) + yLength) / 2 : (yLength * Math.sqrt(3) + xLength) / 2;\n\n const v1 = Vector2d.create(0, magnitude);\n const vectors = [\n v1, // top\n v1.rotateXY(Angle.createDegrees(120)), // left\n v1.rotateXY(Angle.createDegrees(240)), // right\n v1 // top\n ];\n\n vectors.forEach((v) => {\n points.push(Point3d.create(center.x + v.x, center.y + v.y));\n });\n\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Diamond (square rotated 45 degrees) */\nconst computeDiamond = (range: Range2d, transform: Transform): Loop => {\n const offset = (range.xLength() + range.yLength()) / 2;\n const center = range.center;\n\n const points = [\n Point3d.createFrom({ x: center.x, y: center.y + offset }), // top\n Point3d.createFrom({ x: center.x + offset, y: center.y }), // right\n Point3d.createFrom({ x: center.x, y: center.y - offset }), // bottom\n Point3d.createFrom({ x: center.x - offset, y: center.y }), // left\n Point3d.createFrom({ x: center.x, y: center.y + offset }), // top\n ];\n\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Square */\nconst computeSquare = (range: Range2d, transform: Transform): Loop => {\n\n // Extend range\n const xLength = range.xLength() / 2;\n const yLength = range.yLength() / 2;\n const center = range.center;\n if (xLength > yLength) {\n range.extendPoint({ x: center.x, y: center.y + xLength });\n range.extendPoint({ x: center.x, y: center.y - xLength });\n } else {\n range.extendPoint({ x: center.x + yLength, y: center.y });\n range.extendPoint({ x: center.x - yLength, y: center.y });\n }\n\n const points = range.corners3d(true);\n const frame = LineString3d.createPoints(points);\n\n return Loop.create(frame.cloneTransformed(transform));\n}\n\n/** Capsule (or pill shape) */\nconst computeCapsule = (range: Range2d, transform: Transform): Loop => {\n const height = range.yLength();\n const radius = height * (Math.sqrt(2) / 2);\n\n // We're going to circumscribe the range with our rounded edges. The corners of the range will fall on 45 degree angles.\n const radiusOffsetFactor = height / 2;\n\n // These values are the origins of the circles\n const inLeft = range.low.x + radiusOffsetFactor;\n const inRight = range.high.x - radiusOffsetFactor;\n const inBottom = range.low.y + radiusOffsetFactor;\n const inTop = range.high.y - radiusOffsetFactor\n\n // These values exist on the circles\n const exBottom = inBottom - radius;\n const exTop = inTop + radius;\n\n const leftHalfCircle = AngleSweep.createStartEndDegrees(90, 270);\n const rightHalfCircle = AngleSweep.createStartEndDegrees(-90, 90);\n\n const curves = [\n LineString3d.create([Point3d.create(inRight, exTop), Point3d.create(inLeft, exTop)]), // top\n Arc3d.createXY(Point3d.create(inLeft, range.center.y), radius, leftHalfCircle), // left\n LineString3d.create([Point3d.create(inLeft, exBottom), Point3d.create(inRight, exBottom)]), // bottom\n Arc3d.createXY(Point3d.create(inRight, range.center.y), radius, rightHalfCircle), // right\n ];\n\n return Loop.createArray(curves.map((curve) => curve.cloneTransformed(transform)));\n}\n\n/** Regular polygon with n sides: note, this a generic method that can be used to create any polygon, but the frame will not be as tightly encapsulating. */\nconst computePolygon = (n: number, range: Range2d, transform: Transform, angleOffset: number = 0): Loop => {\n // These are math terms: cspell:ignore inradius circumradius\n if (n < 3) throw new Error(\"A polygon must have at least 3 sides.\");\n\n // We're assuming the polygon is a regular polygon with `n` sides.\n // The center of the polygon is the center of the range.\n const center = range.center;\n // The inradius is the distance from the center to the midpoint of each side of the polygon. On our range, this coincides with the distance from the center to one of its corners.\n const inradius = range.low.distance(range.high) / 2;\n // The circumradius is the distance from the center to each vertex of the polygon.\n const circumradius = inradius / Math.cos(Math.PI / n);\n\n // The exterior angles add up to 360 degrees.\n const angleIncrement = 360 / n;\n const vertices: Point3d[] = [];\n\n // Add a point for each vertex\n for (let i = 0; i < n; i++) {\n const angle = Angle.createDegrees(i * angleIncrement + angleOffset);\n const vector = Vector2d.createPolar(circumradius, angle);\n vertices.push(Point3d.create(center.x + vector.x, center.y + vector.y));\n }\n\n // Close the polygon\n vertices.push(vertices[0]);\n\n // Finally compute the loop!\n const frame = LineString3d.createPoints(vertices);\n return Loop.create(frame.cloneTransformed(transform));\n};"]}
@@ -33,7 +33,7 @@ const FrameGeometry_1 = require("./FrameGeometry");
33
33
  */
34
34
  function appendLeadersToBuilder(builder, leaders, layout, transform, params, textStyleResolver, scaleFactor) {
35
35
  let result = true;
36
- const scaledLineHeight = textStyleResolver.blockSettings.lineHeight * scaleFactor;
36
+ const scaledBlockTextHeight = textStyleResolver.blockSettings.textHeight * scaleFactor;
37
37
  let frame = textStyleResolver.blockSettings.frame;
38
38
  // If there is no frame, use a rectangular frame to compute the attachmentPoints for leaders.
39
39
  if (frame === undefined || frame.shape === "none") {
@@ -65,7 +65,7 @@ function appendLeadersToBuilder(builder, leaders, layout, transform, params, tex
65
65
  leaderLinePoints.push(point);
66
66
  });
67
67
  if (leaderStyle.leader.wantElbow) {
68
- const elbowLength = leaderStyle.leader.elbowLength * scaledLineHeight;
68
+ const elbowLength = leaderStyle.leader.elbowLength * scaledBlockTextHeight;
69
69
  const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve, elbowLength);
70
70
  if (elbowDirection)
71
71
  leaderLinePoints.push(attachmentPoint.plusScaled(elbowDirection, elbowLength));
@@ -77,8 +77,8 @@ function appendLeadersToBuilder(builder, leaders, layout, transform, params, tex
77
77
  const termY = terminatorDirection?.unitCrossProduct(core_geometry_1.Vector3d.unitZ());
78
78
  if (!termY || !terminatorDirection)
79
79
  continue; // Assuming leaders without terminators is a valid case.
80
- const terminatorHeight = leaderStyle.leader.terminatorHeightFactor * scaledLineHeight;
81
- const terminatorWidth = leaderStyle.leader.terminatorWidthFactor * scaledLineHeight;
80
+ const terminatorHeight = leaderStyle.leader.terminatorHeightFactor * scaledBlockTextHeight;
81
+ const terminatorWidth = leaderStyle.leader.terminatorWidthFactor * scaledBlockTextHeight;
82
82
  const basePoint = leader.startPoint.plusScaled(terminatorDirection, terminatorWidth);
83
83
  const termPointA = basePoint.plusScaled(termY, terminatorHeight);
84
84
  const termPointB = basePoint.plusScaled(termY.negate(), terminatorHeight);
@@ -1 +1 @@
1
- {"version":3,"file":"LeaderGeometry.js","sourceRoot":"","sources":["../../../src/annotations/LeaderGeometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;G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,SAAS,CAAC,CAAC,KAAK,CAAC;QACpD,MAAM,UAAU,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC;QAClE,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,uBAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;QACvE,IAAI,qBAAqB,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE1G,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,qBAAqB,GAAG,qBAAqB,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7G,cAAc,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC;QAC3C,CAAC;QACD,uFAAuF;QACvF,+EAA+E;QAC/E,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC,8CAA8C;QACzH,MAAM,gBAAgB,GAAG,6BAAa,CAAC,MAAM,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;QAClF,MAAM,kBAAkB,GAAG,0BAAU,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QACvG,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementGeometry\n */\n\nimport { ColorDef, ElementGeometry, GeometryParams, TextAnnotationLeader, TextFrameStyleProps, TextStyleColor } from \"@itwin/core-common\";\nimport { CurveCurve, LineSegment3d, LineString3d, Loop, Path, Point3d, Transform, Vector3d } from \"@itwin/core-geometry\";\nimport { computeFrame } from \"./FrameGeometry\";\nimport { TextBlockLayout, TextStyleResolver } from \"./TextBlockLayout\";\n\n/**\n * Constructs and appends leader lines and their terminators to the provided geometry builder for a text annotation.\n *\n * This function processes an array of `TextAnnotationLeader` objects, computes their attachment points\n * relative to a text frame (or a default rectangular frame if none is provided), and appends the leader\n * line and terminator geometry to the builder. It also applies color overrides if specified\n * in the leader's style overrides.\n *\n * @param builder - The geometry builder to which the leader geometries will be appended.\n * @param leaders - An array of leader properties.\n * @param layout - The layout information for the text block, including its range.\n * @param transform - The transform to apply to the frame and leader geometry.\n * @param params - The geometry parameters, such as color, to use for the leader lines.\n * @param textStyleResolver - Resolver for text styles, used to obtain leader styles.\n * @param scaleFactor - The scale factor to apply to leader dimensions, usually comes from the `scaleFactor` of a [[Drawing]] element.\n * @returns `true` if at least one leader with a terminator was successfully appended; otherwise, `false`.\n * @beta\n */\nexport function appendLeadersToBuilder(builder: ElementGeometry.Builder, leaders: TextAnnotationLeader[], layout: TextBlockLayout, transform: Transform, params: GeometryParams, textStyleResolver: TextStyleResolver, scaleFactor: number): boolean {\n let result = true;\n const scaledLineHeight = textStyleResolver.blockSettings.lineHeight * scaleFactor;\n let frame: TextFrameStyleProps | undefined = textStyleResolver.blockSettings.frame;\n\n // If there is no frame, use a rectangular frame to compute the attachmentPoints for leaders.\n if (frame === undefined || frame.shape === \"none\") {\n frame = { shape: \"rectangle\" }\n }\n if (frame.shape === undefined || frame.shape === \"none\") return false;\n const frameCurve = computeFrame({ frame: frame.shape, range: layout.range, transform });\n\n for (const leader of leaders) {\n const leaderStyle = textStyleResolver.resolveSettings(leader.styleOverrides ?? {}, true);\n\n let effectiveColor: TextStyleColor = \"subcategory\";\n\n if (leaderStyle.leader.color === \"inherit\") {\n effectiveColor = leaderStyle.color;\n } else if (leaderStyle.leader.color !== \"subcategory\") {\n effectiveColor = leaderStyle.leader.color;\n }\n\n if (effectiveColor !== \"subcategory\") {\n params.lineColor = ColorDef.fromJSON(effectiveColor);\n result = result && builder.appendGeometryParamsChange(params);\n }\n\n const attachmentPoint = computeLeaderAttachmentPoint(leader, frameCurve, layout, transform);\n if (!attachmentPoint) return false;\n\n // Leader line geometry\n const leaderLinePoints: Point3d[] = [];\n\n leaderLinePoints.push(leader.startPoint)\n\n leader.intermediatePoints?.forEach((point) => {\n leaderLinePoints.push(point);\n });\n\n if (leaderStyle.leader.wantElbow) {\n const elbowLength = leaderStyle.leader.elbowLength * scaledLineHeight;\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve, elbowLength);\n if (elbowDirection)\n leaderLinePoints.push(attachmentPoint.plusScaled(elbowDirection, elbowLength))\n }\n\n leaderLinePoints.push(attachmentPoint)\n\n result = result && builder.appendGeometryQuery(LineString3d.create(leaderLinePoints));\n\n // Terminator geometry\n const terminatorDirection = Vector3d.createStartEnd(\n leaderLinePoints[0], leaderLinePoints[1]\n ).normalize();\n\n const termY = terminatorDirection?.unitCrossProduct(Vector3d.unitZ());\n if (!termY || !terminatorDirection) continue; // Assuming leaders without terminators is a valid case.\n const terminatorHeight = leaderStyle.leader.terminatorHeightFactor * scaledLineHeight;\n const terminatorWidth = leaderStyle.leader.terminatorWidthFactor * scaledLineHeight;\n const basePoint = leader.startPoint.plusScaled(terminatorDirection, terminatorWidth);\n const termPointA = basePoint.plusScaled(termY, terminatorHeight);\n const termPointB = basePoint.plusScaled(termY.negate(), terminatorHeight);\n result = result && builder.appendGeometryQuery(LineString3d.create([termPointA, leader.startPoint, termPointB]));\n\n }\n return result;\n}\n\n\n/**\n * Computes the direction vector for an \"elbow\" for leader based on the attachment point and a frame curve.\n * The elbow direction is determined by whether the attachment point is closer to the left or right side of the frame.\n * If the computed elbow would be tangent to the frame at the intersection, no elbow direction is returned.\n *\n * @param attachmentPoint - The point where the leader attaches.\n * @param frameCurve - The frame curve (either a Loop or Path) to which the leader is attached.\n * @param elbowLength - The length of the elbow segment to be created.\n * @returns The direction vector for the elbow, or `undefined` if the elbow would be tangent to the frame.\n * @beta\n */\nexport function computeElbowDirection(attachmentPoint: Point3d, frameCurve: Loop | Path, elbowLength: number): Vector3d | undefined {\n\n let elbowDirection: Vector3d | undefined;\n // Determine the direction based on the closest point's position relative to the frame\n const isCloserToLeft = Math.abs(attachmentPoint.x - frameCurve.range().low.x) < Math.abs(attachmentPoint.x - frameCurve.range().high.x);\n\n // Decide the direction: left (-X) or right (+X)\n elbowDirection = isCloserToLeft ? Vector3d.unitX().negate() : Vector3d.unitX();\n\n // Verify if the elbow is a tangent to the frame, if yes, do not create an elbow\n const elbowPoint = attachmentPoint.plusScaled(elbowDirection, elbowLength);\n const elbowLine = LineSegment3d.create(attachmentPoint, elbowPoint);\n // Find intersection points between the elbow and the frame\n const intersections = CurveCurve.intersectionXYZPairs(elbowLine, false, frameCurve, false);\n // As the elbow will intersect the frame only at one point, we can safely use the first intersection\n const intersection = intersections[0];\n const curveFraction = intersection.detailB.fraction;\n const derivative = intersection.detailB.curve?.fractionToPointAndDerivative(curveFraction);\n const tangent = derivative?.direction.normalize();\n const lineDirection = Vector3d.createStartEnd(elbowLine.point0Ref, elbowLine.point1Ref).normalize();\n if (tangent && lineDirection) {\n const dot = tangent.dotProduct(lineDirection);\n // If the tangent and line direction are aligned (dot product close to 1 or -1), it's tangent\n if (Math.abs(dot) > 0.999) {\n elbowDirection = undefined;\n }\n }\n return elbowDirection;\n}\n\n/**\n * Computes the attachment point for a leader line on a text annotation frame.\n *\n * The attachment point is determined based on the leader's attachment mode:\n * - `\"Nearest\"`: Finds the closest point on the frame curve to the leader's start point.\n * - `\"KeyPoint\"`: Uses a specific curve segment and fraction along that segment to determine the point.\n * - `\"TextPoint\"`: Calculates a point on the text layout (top/bottom, left/right) and projects it onto the frame curve.\n *\n * @param leader - The leader props.\n * @param frameCurve - The curve (Loop or Path) representing the annotation frame.\n * @param textLayout - The layout information for the text block.\n * @param transform - The transform applied to the text layout.\n * @returns The computed attachment point as a `Point3d`, or `undefined` if it cannot be determined.\n * @beta\n */\nexport function computeLeaderAttachmentPoint(\n leader: TextAnnotationLeader,\n frameCurve: Loop | Path,\n textLayout: TextBlockLayout,\n transform: Transform\n): Point3d | undefined {\n let attachmentPoint: Point3d | undefined;\n\n if (leader.attachment.mode === \"Nearest\") {\n attachmentPoint = frameCurve.closestPoint(leader.startPoint)?.point;\n } else if (leader.attachment.mode === \"KeyPoint\") {\n const curves = frameCurve.collectCurvePrimitives(undefined, false, true);\n const curveIndex = leader.attachment.curveIndex;\n const fraction = leader.attachment.fraction;\n if (curveIndex >= curves.length) {\n // If the curveIndex is invalid, use the last curve\n // This is a fallback to avoid out-of-bounds access\n attachmentPoint = curves[curves.length - 1].fractionToPoint(fraction);\n } else {\n attachmentPoint = curves[curveIndex].fractionToPoint(fraction);\n }\n } else { // attachment.mode=\"TextPoint\"\n let scaleDirection = transform.matrix.getColumn(0).negate(); // direction to draw a scaled line from text attachment point to find intersection point on frame\n let lineIndex: number;\n if (leader.attachment.position.includes(\"Top\")) {\n lineIndex = 0\n } else {\n lineIndex = textLayout.lines.length - 1\n }\n const lineRange = textLayout.lines[lineIndex].range;\n const lineOffset = textLayout.lines[lineIndex].offsetFromDocument;\n const origin = transform.multiplyPoint3d(Point3d.fromJSON(lineOffset));\n let attachmentPointOnText = origin.plusScaled(transform.matrix.getColumn(1), ((lineRange.yLength()) / 2));\n\n if (leader.attachment.position.includes(\"Right\")) {\n attachmentPointOnText = attachmentPointOnText.plusScaled(transform.matrix.getColumn(0), lineRange.xLength());\n scaleDirection = scaleDirection.negate();\n }\n // Find the nearest intersection point on the frame to get the correct attachment point\n // Extend the direction vector to create a target point far along the direction\n const targetPoint = attachmentPointOnText.plusScaled(scaleDirection, 1e6); // Scale the direction vector to a large value\n const intersectionLine = LineSegment3d.create(attachmentPointOnText, targetPoint);\n const closestPointDetail = CurveCurve.intersectionXYZPairs(intersectionLine, false, frameCurve, false);\n attachmentPoint = closestPointDetail[0]?.detailA.point;\n }\n return attachmentPoint;\n}"]}
1
+ {"version":3,"file":"LeaderGeometry.js","sourceRoot":"","sources":["../../../src/annotations/LeaderGeometry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAyBH,wDAmEC;AAcD,sDA4BC;AAiBD,oEA8CC;AAnMD,oDAA0I;AAC1I,wDAAyH;AACzH,mDAA+C;AAG/C;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,sBAAsB,CAAC,OAAgC,EAAE,OAA+B,EAAE,MAAuB,EAAE,SAAoB,EAAE,MAAsB,EAAE,iBAAoC,EAAE,WAAmB;IACxO,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,UAAU,GAAG,WAAW,CAAC;IACvF,IAAI,KAAK,GAAoC,iBAAiB,CAAC,aAAa,CAAC,KAAK,CAAC;IAEnF,6FAA6F;IAC7F,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE,CAAC;QAClD,KAAK,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAA;IAChC,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IACtE,MAAM,UAAU,GAAG,IAAA,4BAAY,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAExF,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,iBAAiB,CAAC,eAAe,CAAC,MAAM,CAA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gBAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QACvG,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ElementGeometry\n */\n\nimport { ColorDef, ElementGeometry, GeometryParams, TextAnnotationLeader, TextFrameStyleProps, TextStyleColor } from \"@itwin/core-common\";\nimport { CurveCurve, LineSegment3d, LineString3d, Loop, Path, Point3d, Transform, Vector3d } from \"@itwin/core-geometry\";\nimport { computeFrame } from \"./FrameGeometry\";\nimport { TextBlockLayout, TextStyleResolver } from \"./TextBlockLayout\";\n\n/**\n * Constructs and appends leader lines and their terminators to the provided geometry builder for a text annotation.\n *\n * This function processes an array of `TextAnnotationLeader` objects, computes their attachment points\n * relative to a text frame (or a default rectangular frame if none is provided), and appends the leader\n * line and terminator geometry to the builder. It also applies color overrides if specified\n * in the leader's style overrides.\n *\n * @param builder - The geometry builder to which the leader geometries will be appended.\n * @param leaders - An array of leader properties.\n * @param layout - The layout information for the text block, including its range.\n * @param transform - The transform to apply to the frame and leader geometry.\n * @param params - The geometry parameters, such as color, to use for the leader lines.\n * @param textStyleResolver - Resolver for text styles, used to obtain leader styles.\n * @param scaleFactor - The scale factor to apply to leader dimensions, usually comes from the `scaleFactor` of a [[Drawing]] element.\n * @returns `true` if at least one leader with a terminator was successfully appended; otherwise, `false`.\n * @beta\n */\nexport function appendLeadersToBuilder(builder: ElementGeometry.Builder, leaders: TextAnnotationLeader[], layout: TextBlockLayout, transform: Transform, params: GeometryParams, textStyleResolver: TextStyleResolver, scaleFactor: number): boolean {\n let result = true;\n const scaledBlockTextHeight = textStyleResolver.blockSettings.textHeight * scaleFactor;\n let frame: TextFrameStyleProps | undefined = textStyleResolver.blockSettings.frame;\n\n // If there is no frame, use a rectangular frame to compute the attachmentPoints for leaders.\n if (frame === undefined || frame.shape === \"none\") {\n frame = { shape: \"rectangle\" }\n }\n if (frame.shape === undefined || frame.shape === \"none\") return false;\n const frameCurve = computeFrame({ frame: frame.shape, range: layout.range, transform });\n\n for (const leader of leaders) {\n const leaderStyle = textStyleResolver.resolveSettings(leader.styleOverrides ?? {}, true);\n\n let effectiveColor: TextStyleColor = \"subcategory\";\n\n if (leaderStyle.leader.color === \"inherit\") {\n effectiveColor = leaderStyle.color;\n } else if (leaderStyle.leader.color !== \"subcategory\") {\n effectiveColor = leaderStyle.leader.color;\n }\n\n if (effectiveColor !== \"subcategory\") {\n params.lineColor = ColorDef.fromJSON(effectiveColor);\n result = result && builder.appendGeometryParamsChange(params);\n }\n\n const attachmentPoint = computeLeaderAttachmentPoint(leader, frameCurve, layout, transform);\n if (!attachmentPoint) return false;\n\n // Leader line geometry\n const leaderLinePoints: Point3d[] = [];\n\n leaderLinePoints.push(leader.startPoint)\n\n leader.intermediatePoints?.forEach((point) => {\n leaderLinePoints.push(point);\n });\n\n if (leaderStyle.leader.wantElbow) {\n const elbowLength = leaderStyle.leader.elbowLength * scaledBlockTextHeight;\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve, elbowLength);\n if (elbowDirection)\n leaderLinePoints.push(attachmentPoint.plusScaled(elbowDirection, elbowLength))\n }\n\n leaderLinePoints.push(attachmentPoint)\n\n result = result && builder.appendGeometryQuery(LineString3d.create(leaderLinePoints));\n\n // Terminator geometry\n const terminatorDirection = Vector3d.createStartEnd(\n leaderLinePoints[0], leaderLinePoints[1]\n ).normalize();\n\n const termY = terminatorDirection?.unitCrossProduct(Vector3d.unitZ());\n if (!termY || !terminatorDirection) continue; // Assuming leaders without terminators is a valid case.\n const terminatorHeight = leaderStyle.leader.terminatorHeightFactor * scaledBlockTextHeight;\n const terminatorWidth = leaderStyle.leader.terminatorWidthFactor * scaledBlockTextHeight;\n const basePoint = leader.startPoint.plusScaled(terminatorDirection, terminatorWidth);\n const termPointA = basePoint.plusScaled(termY, terminatorHeight);\n const termPointB = basePoint.plusScaled(termY.negate(), terminatorHeight);\n result = result && builder.appendGeometryQuery(LineString3d.create([termPointA, leader.startPoint, termPointB]));\n\n }\n return result;\n}\n\n\n/**\n * Computes the direction vector for an \"elbow\" for leader based on the attachment point and a frame curve.\n * The elbow direction is determined by whether the attachment point is closer to the left or right side of the frame.\n * If the computed elbow would be tangent to the frame at the intersection, no elbow direction is returned.\n *\n * @param attachmentPoint - The point where the leader attaches.\n * @param frameCurve - The frame curve (either a Loop or Path) to which the leader is attached.\n * @param elbowLength - The length of the elbow segment to be created.\n * @returns The direction vector for the elbow, or `undefined` if the elbow would be tangent to the frame.\n * @beta\n */\nexport function computeElbowDirection(attachmentPoint: Point3d, frameCurve: Loop | Path, elbowLength: number): Vector3d | undefined {\n\n let elbowDirection: Vector3d | undefined;\n // Determine the direction based on the closest point's position relative to the frame\n const isCloserToLeft = Math.abs(attachmentPoint.x - frameCurve.range().low.x) < Math.abs(attachmentPoint.x - frameCurve.range().high.x);\n\n // Decide the direction: left (-X) or right (+X)\n elbowDirection = isCloserToLeft ? Vector3d.unitX().negate() : Vector3d.unitX();\n\n // Verify if the elbow is a tangent to the frame, if yes, do not create an elbow\n const elbowPoint = attachmentPoint.plusScaled(elbowDirection, elbowLength);\n const elbowLine = LineSegment3d.create(attachmentPoint, elbowPoint);\n // Find intersection points between the elbow and the frame\n const intersections = CurveCurve.intersectionXYZPairs(elbowLine, false, frameCurve, false);\n // As the elbow will intersect the frame only at one point, we can safely use the first intersection\n const intersection = intersections[0];\n const curveFraction = intersection.detailB.fraction;\n const derivative = intersection.detailB.curve?.fractionToPointAndDerivative(curveFraction);\n const tangent = derivative?.direction.normalize();\n const lineDirection = Vector3d.createStartEnd(elbowLine.point0Ref, elbowLine.point1Ref).normalize();\n if (tangent && lineDirection) {\n const dot = tangent.dotProduct(lineDirection);\n // If the tangent and line direction are aligned (dot product close to 1 or -1), it's tangent\n if (Math.abs(dot) > 0.999) {\n elbowDirection = undefined;\n }\n }\n return elbowDirection;\n}\n\n/**\n * Computes the attachment point for a leader line on a text annotation frame.\n *\n * The attachment point is determined based on the leader's attachment mode:\n * - `\"Nearest\"`: Finds the closest point on the frame curve to the leader's start point.\n * - `\"KeyPoint\"`: Uses a specific curve segment and fraction along that segment to determine the point.\n * - `\"TextPoint\"`: Calculates a point on the text layout (top/bottom, left/right) and projects it onto the frame curve.\n *\n * @param leader - The leader props.\n * @param frameCurve - The curve (Loop or Path) representing the annotation frame.\n * @param textLayout - The layout information for the text block.\n * @param transform - The transform applied to the text layout.\n * @returns The computed attachment point as a `Point3d`, or `undefined` if it cannot be determined.\n * @beta\n */\nexport function computeLeaderAttachmentPoint(\n leader: TextAnnotationLeader,\n frameCurve: Loop | Path,\n textLayout: TextBlockLayout,\n transform: Transform\n): Point3d | undefined {\n let attachmentPoint: Point3d | undefined;\n\n if (leader.attachment.mode === \"Nearest\") {\n attachmentPoint = frameCurve.closestPoint(leader.startPoint)?.point;\n } else if (leader.attachment.mode === \"KeyPoint\") {\n const curves = frameCurve.collectCurvePrimitives(undefined, false, true);\n const curveIndex = leader.attachment.curveIndex;\n const fraction = leader.attachment.fraction;\n if (curveIndex >= curves.length) {\n // If the curveIndex is invalid, use the last curve\n // This is a fallback to avoid out-of-bounds access\n attachmentPoint = curves[curves.length - 1].fractionToPoint(fraction);\n } else {\n attachmentPoint = curves[curveIndex].fractionToPoint(fraction);\n }\n } else { // attachment.mode=\"TextPoint\"\n let scaleDirection = transform.matrix.getColumn(0).negate(); // direction to draw a scaled line from text attachment point to find intersection point on frame\n let lineIndex: number;\n if (leader.attachment.position.includes(\"Top\")) {\n lineIndex = 0\n } else {\n lineIndex = textLayout.lines.length - 1\n }\n const lineRange = textLayout.lines[lineIndex].range;\n const lineOffset = textLayout.lines[lineIndex].offsetFromDocument;\n const origin = transform.multiplyPoint3d(Point3d.fromJSON(lineOffset));\n let attachmentPointOnText = origin.plusScaled(transform.matrix.getColumn(1), ((lineRange.yLength()) / 2));\n\n if (leader.attachment.position.includes(\"Right\")) {\n attachmentPointOnText = attachmentPointOnText.plusScaled(transform.matrix.getColumn(0), lineRange.xLength());\n scaleDirection = scaleDirection.negate();\n }\n // Find the nearest intersection point on the frame to get the correct attachment point\n // Extend the direction vector to create a target point far along the direction\n const targetPoint = attachmentPointOnText.plusScaled(scaleDirection, 1e6); // Scale the direction vector to a large value\n const intersectionLine = LineSegment3d.create(attachmentPointOnText, targetPoint);\n const closestPointDetail = CurveCurve.intersectionXYZPairs(intersectionLine, false, frameCurve, false);\n attachmentPoint = closestPointDetail[0]?.detailA.point;\n }\n return attachmentPoint;\n}"]}
@@ -6,6 +6,12 @@ import { IModelDb } from "../IModelDb";
6
6
  import { AnnotationElement2d, DefinitionElement, GraphicalElement3d, OnElementIdArg, OnElementPropsArg } from "../Element";
7
7
  import { Id64String } from "@itwin/core-bentley";
8
8
  import { TextAnnotationUsesTextStyleByDefault, TextBlockAndId } from "./ElementDrivesTextAnnotation";
9
+ import { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from "../Entity";
10
+ /** The version of the JSON stored in `TextAnnotation2d/3dProps.textAnnotationData` used by the code.
11
+ * Uses the same semantics as [ECVersion]($ecschema-metadata).
12
+ * @internal
13
+ */
14
+ export declare const TEXT_ANNOTATION_JSON_VERSION = "1.0.0";
9
15
  /** Arguments supplied when creating a [[TextAnnotation2d]].
10
16
  * @beta
11
17
  */
@@ -19,7 +25,7 @@ export interface TextAnnotation2dCreateArgs {
19
25
  /** The default text style ID for the annotation. */
20
26
  defaultTextStyleId?: Id64String;
21
27
  /** Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation2d`. Essentially an empty element if not provided. */
22
- textAnnotationData?: TextAnnotationProps;
28
+ textAnnotationProps?: TextAnnotationProps;
23
29
  /** Optional code for the element. */
24
30
  code?: CodeProps;
25
31
  }
@@ -36,7 +42,7 @@ export interface TextAnnotation3dCreateArgs {
36
42
  /** The default text style ID for the annotation. */
37
43
  defaultTextStyleId?: Id64String;
38
44
  /** Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation3d`. Essentially an empty element if not provided. */
39
- textAnnotationData?: TextAnnotationProps;
45
+ textAnnotationProps?: TextAnnotationProps;
40
46
  /** Optional code for the element. */
41
47
  code?: CodeProps;
42
48
  }
@@ -53,8 +59,8 @@ export declare class TextAnnotation2d extends AnnotationElement2d {
53
59
  * @beta
54
60
  */
55
61
  defaultTextStyle?: TextAnnotationUsesTextStyleByDefault;
56
- /** Optional string containing the data associated with the text annotation. */
57
- private _textAnnotationData?;
62
+ /** The data associated with the text annotation. */
63
+ private _textAnnotationProps?;
58
64
  /** Extract the textual content, if present.
59
65
  * @see [[setAnnotation]] to change it.
60
66
  */
@@ -70,7 +76,6 @@ export declare class TextAnnotation2d extends AnnotationElement2d {
70
76
  /**
71
77
  * Converts the current `TextAnnotation2d` instance to its JSON representation.
72
78
  * It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.
73
-
74
79
  * @inheritdoc
75
80
  */
76
81
  toJSON(): TextAnnotation2dProps;
@@ -81,22 +86,42 @@ export declare class TextAnnotation2d extends AnnotationElement2d {
81
86
  */
82
87
  static create(iModelDb: IModelDb, arg: TextAnnotation2dCreateArgs): TextAnnotation2d;
83
88
  /**
84
- * Updates the geometry of the TextAnnotation2d on insert.
89
+ * Updates the geometry of the TextAnnotation2d on insert and validates version.
85
90
  * @inheritdoc
86
91
  * @beta
87
92
  */
88
93
  protected static onInsert(arg: OnElementPropsArg): void;
89
94
  /**
90
- * Updates the geometry of the TextAnnotation2d on update.
95
+ * Updates the geometry of the TextAnnotation2d on update and validates version.
91
96
  * @inheritdoc
92
97
  * @beta
93
98
  */
94
99
  protected static onUpdate(arg: OnElementPropsArg): void;
95
100
  /**
96
101
  * Populates the `elementGeometryBuilderParams` property in the [TextAnnotation2dProps]($common).
97
- * It only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
102
+ * Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
103
+ * Also, validates the version of the text annotation data and migrates it if necessary.
104
+ * @beta
105
+ */
106
+ protected static validateVersionAndUpdateGeometry(arg: OnElementPropsArg): void;
107
+ /**
108
+ * TextAnnotation2d custom HandledProps include 'textAnnotationData'.
109
+ * @inheritdoc
110
+ * @internal
98
111
  */
99
- protected static updateGeometry(iModelDb: IModelDb, props: TextAnnotation2dProps): void;
112
+ protected static readonly _customHandledProps: CustomHandledProperty[];
113
+ /**
114
+ * TextAnnotation2d deserializes 'textAnnotationData'.
115
+ * @inheritdoc
116
+ * @beta
117
+ */
118
+ static deserialize(props: DeserializeEntityArgs): TextAnnotation2dProps;
119
+ /**
120
+ * TextAnnotation2d serializes 'textAnnotationData'.
121
+ * @inheritdoc
122
+ * @beta
123
+ */
124
+ static serialize(props: TextAnnotation2dProps, iModel: IModelDb): ECSqlRow;
100
125
  /** @internal */
101
126
  getTextBlocks(): Iterable<TextBlockAndId>;
102
127
  /** @internal */
@@ -119,8 +144,8 @@ export declare class TextAnnotation3d extends GraphicalElement3d {
119
144
  * @beta
120
145
  */
121
146
  defaultTextStyle?: TextAnnotationUsesTextStyleByDefault;
122
- /** Optional string containing the data associated with the text annotation. */
123
- private _textAnnotationData?;
147
+ /** The data associated with the text annotation. */
148
+ private _textAnnotationProps?;
124
149
  /** Extract the textual content, if present.
125
150
  * @see [[setAnnotation]] to change it.
126
151
  */
@@ -146,22 +171,42 @@ export declare class TextAnnotation3d extends GraphicalElement3d {
146
171
  */
147
172
  static create(iModelDb: IModelDb, arg: TextAnnotation3dCreateArgs): TextAnnotation3d;
148
173
  /**
149
- * Updates the geometry of the TextAnnotation3d on insert.
174
+ * Updates the geometry of the TextAnnotation3d on insert and validates version..
150
175
  * @inheritdoc
151
176
  * @beta
152
177
  */
153
178
  protected static onInsert(arg: OnElementPropsArg): void;
154
179
  /**
155
- * Updates the geometry of the TextAnnotation3d on update.
180
+ * Updates the geometry of the TextAnnotation3d on update and validates version..
156
181
  * @inheritdoc
157
182
  * @beta
158
183
  */
159
184
  protected static onUpdate(arg: OnElementPropsArg): void;
160
185
  /**
161
186
  * Populates the `elementGeometryBuilderParams` property in the [TextAnnotation3dProps]($common).
162
- * It only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
187
+ * Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
188
+ * Also, validates the version of the text annotation data and migrates it if necessary.
189
+ * @beta
190
+ */
191
+ protected static validateVersionAndUpdateGeometry(arg: OnElementPropsArg): void;
192
+ /**
193
+ * TextAnnotation3d custom HandledProps include 'textAnnotationData'.
194
+ * @inheritdoc
195
+ * @internal
196
+ */
197
+ protected static readonly _customHandledProps: CustomHandledProperty[];
198
+ /**
199
+ * TextAnnotation3d deserializes 'textAnnotationData'.
200
+ * @inheritdoc
201
+ * @beta
202
+ */
203
+ static deserialize(props: DeserializeEntityArgs): TextAnnotation3dProps;
204
+ /**
205
+ * TextAnnotation3d serializes 'textAnnotationData'.
206
+ * @inheritdoc
207
+ * @beta
163
208
  */
164
- protected static updateGeometry(iModelDb: IModelDb, props: TextAnnotation3dProps): void;
209
+ static serialize(props: TextAnnotation3dProps, iModel: IModelDb): ECSqlRow;
165
210
  /** @internal */
166
211
  getTextBlocks(): Iterable<TextBlockAndId>;
167
212
  /** @internal */
@@ -171,6 +216,24 @@ export declare class TextAnnotation3d extends GraphicalElement3d {
171
216
  /** @internal */
172
217
  static onUpdated(arg: OnElementIdArg): void;
173
218
  }
219
+ /** The version of the JSON stored in `AnnotationTextStyleProps.settings` used by the code.
220
+ * Uses the same semantics as [ECVersion]($ecschema-metadata).
221
+ * @internal
222
+ */
223
+ export declare const TEXT_STYLE_SETTINGS_JSON_VERSION = "1.0.0";
224
+ /** Arguments supplied when creating an [[AnnotationTextStyle]].
225
+ * @beta
226
+ */
227
+ export interface TextStyleCreateArgs {
228
+ /** The ID of the [[DefinitionModel]]. */
229
+ definitionModelId: Id64String;
230
+ /** The name to assign to the [[AnnotationTextStyle]]. */
231
+ name: string;
232
+ /** Optional text style settings used to create the [[AnnotationTextStyle]]. Default settings will be used if not provided. */
233
+ settings?: TextStyleSettingsProps;
234
+ /** Optional description for the [[AnnotationTextStyle]]. */
235
+ description?: string;
236
+ }
174
237
  /**
175
238
  * The definition element that holds text style information.
176
239
  * The style is stored as a [TextStyleSettings]($common).
@@ -195,18 +258,17 @@ export declare class AnnotationTextStyle extends DefinitionElement {
195
258
  * @param iModel - The IModelDb.
196
259
  * @param definitionModelId - The ID of the DefinitionModel that contains the AnnotationTextStyle and provides the scope for its name.
197
260
  * @param name - The AnnotationTextStyle name.
261
+ * @beta
198
262
  */
199
263
  static createCode(iModel: IModelDb, definitionModelId: CodeScopeProps, name: string): Code;
200
264
  /**
201
265
  * Creates a new instance of `AnnotationTextStyle` with the specified properties.
202
266
  *
203
267
  * @param iModelDb - The iModelDb.
204
- * @param definitionModelId - The ID of the [[DefinitionModel]].
205
- * @param name - The name to assign to the `AnnotationTextStyle`.
206
- * @param settings - Optional text style settings used to create the `AnnotationTextStyle`. Default settings will be used if not provided.
207
- * @param description - Optional description for the `AnnotationTextStyle`.
268
+ * @param arg - The arguments for creating the AnnotationTextStyle.
269
+ * @beta
208
270
  */
209
- static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, settings?: TextStyleSettingsProps, description?: string): AnnotationTextStyle;
271
+ static create(iModelDb: IModelDb, arg: TextStyleCreateArgs): AnnotationTextStyle;
210
272
  /**
211
273
  * Converts the current `AnnotationTextStyle` instance to its JSON representation.
212
274
  * @inheritdoc
@@ -227,6 +289,25 @@ export declare class AnnotationTextStyle extends DefinitionElement {
227
289
  */
228
290
  protected static onUpdate(arg: OnElementPropsArg): void;
229
291
  private static validateSettings;
292
+ /**
293
+ * AnnotationTextStyle custom HandledProps include 'settings'.
294
+ * @inheritdoc
295
+ * @beta
296
+ */
297
+ protected static readonly _customHandledProps: CustomHandledProperty[];
298
+ /**
299
+ * AnnotationTextStyle deserializes 'settings'.
300
+ * @inheritdoc
301
+ * @beta
302
+ */
303
+ static deserialize(props: DeserializeEntityArgs): AnnotationTextStyleProps;
304
+ /**
305
+ * AnnotationTextStyle serializes 'settings'.
306
+ * @inheritdoc
307
+ * @beta
308
+ */
309
+ static serialize(props: AnnotationTextStyleProps, iModel: IModelDb): ECSqlRow;
310
+ /** Parses, validates, and potentially migrates the text style settings data from a JSON string. */
230
311
  private static parseTextStyleSettings;
231
312
  }
232
313
  //# sourceMappingURL=TextAnnotationElement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextAnnotationElement.d.ts","sourceRoot":"","sources":["../../../src/annotations/TextAnnotationElement.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,wBAAwB,EAAe,IAAI,EAAE,SAAS,EAAE,cAAc,EAAwE,gBAAgB,EAAe,gBAAgB,EAAkB,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjX,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,kBAAkB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpI,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAA+B,oCAAoC,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AA0BlI;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,0CAA0C;IAC1C,QAAQ,EAAE,UAAU,CAAC;IACrB,wDAAwD;IACxD,KAAK,EAAE,UAAU,CAAC;IAClB,mDAAmD;IACnD,SAAS,EAAE,gBAAgB,CAAC;IAC5B,oDAAoD;IACpD,kBAAkB,CAAC,EAAE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