@itwin/core-backend 5.3.0-dev.24 → 5.3.0-dev.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Element.d.ts +29 -1
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +53 -1
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +24 -1
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +102 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +11 -0
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +18 -0
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/NavigationRelationship.d.ts +15 -0
- package/lib/cjs/NavigationRelationship.d.ts.map +1 -1
- package/lib/cjs/NavigationRelationship.js +22 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +5 -0
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +7 -0
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +3 -3
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.d.ts +13 -1
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +88 -10
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +7 -3
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/Element.d.ts +29 -1
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +53 -2
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +24 -1
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +101 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +11 -0
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +18 -0
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/NavigationRelationship.d.ts +15 -0
- package/lib/esm/NavigationRelationship.d.ts.map +1 -1
- package/lib/esm/NavigationRelationship.js +19 -0
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/Relationship.d.ts +5 -0
- package/lib/esm/Relationship.d.ts.map +1 -1
- package/lib/esm/Relationship.js +7 -0
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +3 -3
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.d.ts +13 -1
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +89 -12
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +7 -3
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +47 -2
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +46 -5
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/element/ProjectInformationRecord.test.d.ts +2 -0
- package/lib/esm/test/element/ProjectInformationRecord.test.d.ts.map +1 -0
- package/lib/esm/test/element/ProjectInformationRecord.test.js +80 -0
- package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -0
- package/lib/esm/test/element/SheetInformationAspect.test.d.ts +2 -0
- package/lib/esm/test/element/SheetInformationAspect.test.d.ts.map +1 -0
- package/lib/esm/test/element/SheetInformationAspect.test.js +182 -0
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -0
- package/lib/esm/test/imodel/IModel.test.js +130 -2
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +39 -30
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +33 -5
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeaderGeometry.test.js","sourceRoot":"","sources":["../../../../src/test/annotations/LeaderGeometry.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAwB,SAAS,EAAuB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9K,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,YAAY,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAClJ,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE/D,QAAQ,CAAC,gBAAgB,EAA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,EAAE,SAAS,EAAE;iBACvD;aACF,CAAC;YACF,MAAM,eAAe,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;YAChG,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;YACjC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;YAC1B,MAAM,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACjD,MAAM,CAAC,eAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,oDAAoD;QAC9G,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAA;AAEJ,CAAC,CAAC,CAAA","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\nimport { expect } from \"chai\";\nimport { ColorDef, GeometryParams, LineBreakRun, TextAnnotation, TextAnnotationLeader, TextBlock, TextFrameStyleProps, TextRun, TextStyleSettings } from \"@itwin/core-common\";\nimport { LineSegment3d, LineString3d, Point3d, Range2d, YawPitchRollAngles } from \"@itwin/core-geometry\";\nimport { appendLeadersToBuilder, computeElbowDirection, computeFrame, computeLeaderAttachmentPoint, TextStyleResolver } from \"../../core-backend\";\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { doLayout, MockBuilder } from \"../AnnotationTestUtils\";\n\ndescribe(\"LeaderGeometry\", () => {\n let builder: MockBuilder;\n let defaultParams: GeometryParams;\n\n const textBlock = TextBlock.create({ styleOverrides: { font: { name: \"Arial\" }, color: ColorDef.black.toJSON(), leader: {wantElbow: false} } });\n textBlock.appendRun(TextRun.create({ content: \"Hello\", styleOverrides: { font: { name: \"Arial\" } } }));\n textBlock.appendRun(LineBreakRun.create({\n styleOverrides: { font: { name: \"Arial\" } },\n }));\n textBlock.appendRun(TextRun.create({ content: \"World\", styleOverrides: { font: { name: \"Arial\" } } }));\n\n const frame: TextFrameStyleProps = { borderWeight: 1, shape: \"rectangle\" };\n\n const annotation = TextAnnotation.fromJSON({\n textBlock: textBlock.toJSON(),\n anchor: { horizontal: \"left\", vertical: \"top\" },\n orientation: YawPitchRollAngles.createDegrees(0, 0, 0).toJSON(),\n offset: { x: 0, y: 0 },\n });\n\n const findTextStyle = (id: Id64String) => TextStyleSettings.fromJSON(id === \"0x34\" ? { lineSpacingFactor: 12, font: { name: \"block\" }, frame } : { lineSpacingFactor: 99, font: { name: \"run\" }, frame });\n const textStyleResolver = new TextStyleResolver({\n textBlock,\n textStyleId: \"0x34\",\n iModel: {} as any,\n findTextStyle,\n });\n const layout = doLayout(textBlock, {\n textStyleId: \"0x34\",\n findTextStyle,\n findFontId: () => 0,\n });\n const scaleFactor = 1;\n\n\n const range = Range2d.fromJSON(layout.range);\n const transform = annotation.computeTransform(range);\n const frameCurve = computeFrame({ frame: frame.shape === \"none\" ? \"rectangle\" : (frame.shape ?? \"rectangle\"), range: layout.range, transform });\n\n beforeEach(() => {\n builder = new MockBuilder();\n defaultParams = new GeometryParams(Id64.invalid);\n });\n\n describe(\"appendLeaderToBuilder\", () => {\n it(\"should append a leader to the builder\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"Nearest\" }\n }\n ]\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const params = builder.params[builder.params.length - 1];\n expect(builder.params.length).to.be.equal(1);\n expect(params.lineColor).to.be.equal(ColorDef.black); // textBlock color\n expect(builder.geometries.length).to.be.equal(2); // One LineString3d for leadersLines and one for terminators\n for (const geometryEntry of builder.geometries) {\n expect(geometryEntry).to.be.instanceOf(LineString3d);\n }\n });\n\n it(\"should append multiple leaders to the builder\", () => {\n const leaders: TextAnnotationLeader[] = [{ startPoint: Point3d.create(20, 20, 0), attachment: { mode: \"Nearest\" } },\n { startPoint: Point3d.create(10, 0, 0), attachment: { mode: \"Nearest\" } }];\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n expect(builder.params.length).to.be.equal(2); // One for each leader\n expect(builder.geometries.length).to.be.equal(4); // Two LineString3d for leadersSegments and two for terminators\n for (const geometryEntry of builder.geometries) {\n expect(geometryEntry).to.be.instanceOf(LineString3d);\n }\n });\n\n it(\"should have intermediate points in geometry\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"Nearest\" },\n intermediatePoints: [Point3d.create(15, 15, 0), Point3d.create(20, 20, 0)]\n }\n ];\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const geometries = builder.geometries;\n const leaderLines = geometries[0] as LineString3d;\n expect(leaderLines.points.length).to.be.equal(4); // start + 2 intermediate + end\n });\n\n it(\"should have elbow in the geometry\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5\n }\n }\n }\n ];\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const geometries = builder.geometries;\n const leaderLines = geometries[0] as LineString3d;\n expect(leaderLines.points.length).to.be.equal(3); // start + elbowPoint + end\n });\n\n describe(\"should return correct geometry for different attachment modes\", () => {\n const leaders: TextAnnotationLeader[] = [{\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" }\n }, {\n startPoint: Point3d.create(20, 20, 0),\n attachment: { mode: \"KeyPoint\", curveIndex: 0, fraction: 0.5 }\n }, {\n startPoint: Point3d.create(30, 30, 0),\n attachment: { mode: \"Nearest\" }\n }]\n\n for (const leader of leaders) {\n builder = new MockBuilder();\n it(`${leader.attachment.mode}`, () => {\n const attachmentPoint = computeLeaderAttachmentPoint(leader, frameCurve, layout, transform);\n if (!attachmentPoint) {\n expect.fail(\"Attachment point should not be undefined\");\n }\n const result = appendLeadersToBuilder(builder, [leader], layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const leaderLines = builder.geometries[0] as LineString3d;\n // The last point in the geometry is the point on frame where leader is supposed to be attached.\n expect(leaderLines.points[leaderLines.points.length - 1].isAlmostEqual(attachmentPoint)).to.be.true;\n })\n }\n })\n describe(\"should return correct geometry for different styleOverrides\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5,\n color: ColorDef.red.toJSON(),\n terminatorHeightFactor: 2,\n terminatorWidthFactor: 2,\n }\n }\n }\n ];\n\n it(\"should apply color overrides\", () => {\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const params = builder.params[builder.params.length - 1];\n expect(params.lineColor).to.equal(ColorDef.red);\n });\n\n it(\"should apply terminator size overrides\", () => {\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const terminatorLines = builder.geometries[1] as LineString3d;\n const terminatorLength = LineSegment3d.create(terminatorLines.points[0], terminatorLines.points[1]).curveLength();\n const textHeight = 1;\n const terminatorWidth = (leaders[0].styleOverrides?.leader?.terminatorWidthFactor ?? 1) * textHeight;\n const terminatorHeight = (leaders[0].styleOverrides?.leader?.terminatorHeightFactor ?? 1) * textHeight;\n // terminator length is calculated based on the terminator width and height factors.\n const expectedTerminatorLength = Math.sqrt(terminatorWidth * terminatorWidth + terminatorHeight * terminatorHeight);\n expect(terminatorLength).to.be.closeTo(expectedTerminatorLength, 0.01);\n });\n\n it(\"should apply elbow length overrides\", () => {\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const leaderLines = builder.geometries[0] as LineString3d;\n // When elbow exists, the last two points in the leaderLines should form the elbow\n const elbowLine = LineSegment3d.create(leaderLines.points[leaderLines.points.length - 1], leaderLines.points[leaderLines.points.length - 2]);\n const elbowLength = elbowLine.curveLength();\n expect(elbowLength).to.be.closeTo(leaders[0].styleOverrides?.leader?.elbowLength ?? 1, 0.01);\n });\n });\n });\n\n describe(\"computeElbowDirection\", () => {\n it(\"should return elbow direction\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5\n }\n }\n }\n ];\n\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n if (attachmentPoint) {\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve,\n leaders[0].styleOverrides?.leader?.elbowLength ?? 1);\n expect(elbowDirection).to.exist;\n }\n });\n\n it(\"should return undefined if elbow is tangential\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"Nearest\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5\n }\n }\n }\n ];\n\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n if (attachmentPoint) {\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve,\n leaders[0].styleOverrides?.leader?.elbowLength ?? 1);\n expect(elbowDirection).to.be.undefined;\n }\n });\n })\n\n describe(\"computeLeaderAttachmentPoint\", () => {\n it(\"should return correct attachmentPoint for 'Nearest' mode\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(-20, 0, 0),\n attachment: { mode: \"Nearest\" }\n }\n ];\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n expect(attachmentPoint).to.exist;\n expect(attachmentPoint!.isAlmostEqual(Point3d.create(0, 0, 0))).to.be.true;\n });\n\n it(\"should return correct attachmentPoint for 'Keypoint' mode\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(-20, 0, 0),\n attachment: { mode: \"KeyPoint\", curveIndex: 0, fraction: 0 }\n }\n ];\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n expect(attachmentPoint).to.exist;\n expect(attachmentPoint?.y).to.be.equal(range.low.y); // expected to be at the bottom of the TextBlock\n });\n\n it(\"should return correct attachmentPoint for 'TextPoint' mode\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(-20, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" }\n }\n ];\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n expect(attachmentPoint).to.exist;\n const topY = range.high.y;\n const middleY = (range.low.y + range.high.y) / 2;\n expect(attachmentPoint!.y).to.be.within(middleY, topY); // expected to be in the upper half of the TextBlock\n });\n })\n\n})\n"]}
|
|
1
|
+
{"version":3,"file":"LeaderGeometry.test.js","sourceRoot":"","sources":["../../../../src/test/annotations/LeaderGeometry.test.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAmB,gBAAgB,EAAE,cAAc,EAAwB,SAAS,EAAuB,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACjN,OAAO,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C,CAAC;IACL,CAAC,CAAC,CAAA;AAEJ,CAAC,CAAC,CAAA","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\nimport { expect } from \"chai\";\nimport { ColorDef, GeometryParams, LineBreakRun, TerminatorShape, terminatorShapes, TextAnnotation, TextAnnotationLeader, TextBlock, TextFrameStyleProps, TextRun, TextStyleSettings } from \"@itwin/core-common\";\nimport { Arc3d, LineSegment3d, LineString3d, Point3d, Range2d, YawPitchRollAngles } from \"@itwin/core-geometry\";\nimport { appendLeadersToBuilder, computeElbowDirection, computeFrame, computeLeaderAttachmentPoint, TextStyleResolver } from \"../../core-backend\";\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\nimport { doLayout, MockBuilder } from \"../AnnotationTestUtils\";\n\ndescribe(\"LeaderGeometry\", () => {\n let builder: MockBuilder;\n let defaultParams: GeometryParams;\n\n const textBlock = TextBlock.create({ styleOverrides: { font: { name: \"Arial\" }, color: ColorDef.black.toJSON(), leader: { wantElbow: false } } });\n textBlock.appendRun(TextRun.create({ content: \"Hello\", styleOverrides: { font: { name: \"Arial\" } } }));\n textBlock.appendRun(LineBreakRun.create({\n styleOverrides: { font: { name: \"Arial\" } },\n }));\n textBlock.appendRun(TextRun.create({ content: \"World\", styleOverrides: { font: { name: \"Arial\" } } }));\n\n const frame: TextFrameStyleProps = { borderWeight: 1, shape: \"rectangle\" };\n\n const annotation = TextAnnotation.fromJSON({\n textBlock: textBlock.toJSON(),\n anchor: { horizontal: \"left\", vertical: \"top\" },\n orientation: YawPitchRollAngles.createDegrees(0, 0, 0).toJSON(),\n offset: { x: 0, y: 0 },\n });\n\n const findTextStyle = (id: Id64String) => TextStyleSettings.fromJSON(id === \"0x34\" ? { lineSpacingFactor: 12, font: { name: \"block\" }, frame } : { lineSpacingFactor: 99, font: { name: \"run\" }, frame });\n const textStyleResolver = new TextStyleResolver({\n textBlock,\n textStyleId: \"0x34\",\n iModel: {} as any,\n findTextStyle,\n });\n const layout = doLayout(textBlock, {\n textStyleId: \"0x34\",\n findTextStyle,\n findFontId: () => 0,\n });\n const scaleFactor = 1;\n\n\n const range = Range2d.fromJSON(layout.range);\n const transform = annotation.computeTransform(range);\n const frameCurve = computeFrame({ frame: frame.shape === \"none\" ? \"rectangle\" : (frame.shape ?? \"rectangle\"), range: layout.range, transform });\n\n beforeEach(() => {\n builder = new MockBuilder();\n defaultParams = new GeometryParams(Id64.invalid);\n });\n\n describe(\"appendLeaderToBuilder\", () => {\n it(\"should append a leader to the builder\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"Nearest\" }\n }\n ]\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const params = builder.params[builder.params.length - 1];\n expect(builder.params.length).to.be.equal(1);\n expect(params.lineColor).to.be.equal(ColorDef.black); // textBlock color\n expect(builder.geometries.length).to.be.equal(2); // One LineString3d for leadersLines and one for terminators\n for (const geometryEntry of builder.geometries) {\n expect(geometryEntry).to.be.instanceOf(LineString3d);\n }\n });\n\n it(\"should append multiple leaders to the builder\", () => {\n const leaders: TextAnnotationLeader[] = [{ startPoint: Point3d.create(20, 20, 0), attachment: { mode: \"Nearest\" } },\n { startPoint: Point3d.create(10, 0, 0), attachment: { mode: \"Nearest\" } }];\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n expect(builder.params.length).to.be.equal(2); // One for each leader\n expect(builder.geometries.length).to.be.equal(4); // Two LineString3d for leadersSegments and two for terminators\n for (const geometryEntry of builder.geometries) {\n expect(geometryEntry).to.be.instanceOf(LineString3d);\n }\n });\n\n it(\"should have intermediate points in geometry\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"Nearest\" },\n intermediatePoints: [Point3d.create(15, 15, 0), Point3d.create(20, 20, 0)]\n }\n ];\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const geometries = builder.geometries;\n const leaderLines = geometries[0] as LineString3d;\n expect(leaderLines.points.length).to.be.equal(4); // start + 2 intermediate + end\n });\n\n it(\"should have elbow in the geometry\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5\n }\n }\n }\n ];\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const geometries = builder.geometries;\n const leaderLines = geometries[0] as LineString3d;\n expect(leaderLines.points.length).to.be.equal(3); // start + elbowPoint + end\n });\n\n describe(\"should return correct geometry for different attachment modes\", () => {\n const leaders: TextAnnotationLeader[] = [{\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" }\n }, {\n startPoint: Point3d.create(20, 20, 0),\n attachment: { mode: \"KeyPoint\", curveIndex: 0, fraction: 0.5 }\n }, {\n startPoint: Point3d.create(30, 30, 0),\n attachment: { mode: \"Nearest\" }\n }]\n\n for (const leader of leaders) {\n builder = new MockBuilder();\n it(`${leader.attachment.mode}`, () => {\n const attachmentPoint = computeLeaderAttachmentPoint(leader, frameCurve, layout, transform);\n if (!attachmentPoint) {\n expect.fail(\"Attachment point should not be undefined\");\n }\n const result = appendLeadersToBuilder(builder, [leader], layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const leaderLines = builder.geometries[0] as LineString3d;\n // The last point in the geometry is the point on frame where leader is supposed to be attached.\n expect(leaderLines.points[leaderLines.points.length - 1].isAlmostEqual(attachmentPoint)).to.be.true;\n })\n }\n })\n describe(\"should return correct geometry for different styleOverrides\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5,\n color: ColorDef.red.toJSON(),\n terminatorShape: terminatorShapes[0],\n terminatorHeightFactor: 2,\n terminatorWidthFactor: 2,\n }\n }\n }\n ];\n\n it(\"should apply color overrides\", () => {\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const params = builder.params[builder.params.length - 1];\n expect(params.lineColor).to.equal(ColorDef.red);\n });\n\n it(\"should apply terminator size overrides\", () => {\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const terminatorLines = builder.geometries[1] as LineString3d;\n const terminatorLength = LineSegment3d.create(terminatorLines.points[0], terminatorLines.points[1]).curveLength();\n const textHeight = 1;\n const terminatorWidth = (leaders[0].styleOverrides?.leader?.terminatorWidthFactor ?? 1) * textHeight;\n const terminatorHeight = (leaders[0].styleOverrides?.leader?.terminatorHeightFactor ?? 1) * textHeight;\n // terminator length is calculated based on the terminator width and height factors.\n const expectedTerminatorLength = Math.sqrt(terminatorWidth * terminatorWidth + ((terminatorHeight / 2) * (terminatorHeight / 2)));\n expect(terminatorLength).to.be.closeTo(expectedTerminatorLength, 0.01);\n });\n\n it(\"should apply elbow length overrides\", () => {\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n const leaderLines = builder.geometries[0] as LineString3d;\n // When elbow exists, the last two points in the leaderLines should form the elbow\n const elbowLine = LineSegment3d.create(leaderLines.points[leaderLines.points.length - 1], leaderLines.points[leaderLines.points.length - 2]);\n const elbowLength = elbowLine.curveLength();\n expect(elbowLength).to.be.closeTo(leaders[0].styleOverrides?.leader?.elbowLength ?? 1, 0.01);\n });\n\n it(\"should apply terminator shape overrides\", () => {\n const textHeight = 1;\n const terminatorHeight = (leaders[0].styleOverrides?.leader?.terminatorHeightFactor ?? 1) * textHeight;\n const terminatorWidth = (leaders[0].styleOverrides?.leader?.terminatorWidthFactor ?? 1) * textHeight;\n let firstLeaderLineLengthBeforeTruncation: number;\n terminatorShapes.forEach((shape: TerminatorShape) => {\n it(`Terminator shape: ${shape}`, () => {\n leaders[0].styleOverrides = { ...leaders[0].styleOverrides, leader: { terminatorShape: shape } };\n const result = appendLeadersToBuilder(builder, leaders, layout, transform, defaultParams, textStyleResolver, scaleFactor);\n expect(result).to.be.true;\n if (shape === \"none\") {\n expect(builder.geometries.length).to.equal(1); // Only leader line should be present with no terminators\n } else {\n let terminatorGeometry = builder.geometries[1];\n if (shape.includes(\"Filled\")) {\n expect(builder.geometries.length).to.equal(3) // One entry for geometry query and another for geometryParams for fill\n terminatorGeometry = builder.geometries[2];\n }\n if (shape.includes(\"circle\")) {\n expect((terminatorGeometry as Arc3d).circularRadius()).to.equal(terminatorHeight / 2)\n }\n\n if (shape === \"slash\") {\n expect(terminatorGeometry).to.be.instanceOf(LineSegment3d);\n terminatorGeometry = terminatorGeometry as LineSegment3d;\n expect(terminatorGeometry.curveLength()).to.equal(terminatorHeight);\n }\n\n if (shape === \"closedArrow\") {\n // The leaderLine is truncated to accommodate the closed and hollow shape of the terminator\n const leaderLine = builder.geometries[0] as LineString3d;\n const firstLeaderLine = LineSegment3d.create(leaderLine.points[0], leaderLine.points[1]);\n const firstLeaderLineLength = firstLeaderLine.curveLength();\n expect(firstLeaderLineLength).to.be.closeTo(firstLeaderLineLengthBeforeTruncation - terminatorWidth, 0.01);\n } else {\n // keep record of first leader line length before truncation for closedArrow test\n const leaderLine = builder.geometries[0] as LineString3d;\n const firstLeaderLineBeforeTruncation = LineSegment3d.create(leaderLine.points[0], leaderLine.points[1]);\n firstLeaderLineLengthBeforeTruncation = firstLeaderLineBeforeTruncation.curveLength();\n }\n }\n\n });\n\n });\n });\n\n });\n });\n\n describe(\"computeElbowDirection\", () => {\n it(\"should return elbow direction\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5\n }\n }\n }\n ];\n\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n if (attachmentPoint) {\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve,\n leaders[0].styleOverrides?.leader?.elbowLength ?? 1);\n expect(elbowDirection).to.exist;\n }\n });\n\n it(\"should return undefined if elbow is tangential\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(10, 0, 0),\n attachment: { mode: \"Nearest\" },\n styleOverrides: {\n leader: {\n wantElbow: true,\n elbowLength: 5\n }\n }\n }\n ];\n\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n if (attachmentPoint) {\n const elbowDirection = computeElbowDirection(attachmentPoint, frameCurve,\n leaders[0].styleOverrides?.leader?.elbowLength ?? 1);\n expect(elbowDirection).to.be.undefined;\n }\n });\n })\n\n describe(\"computeLeaderAttachmentPoint\", () => {\n it(\"should return correct attachmentPoint for 'Nearest' mode\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(-20, 0, 0),\n attachment: { mode: \"Nearest\" }\n }\n ];\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n expect(attachmentPoint).to.exist;\n expect(attachmentPoint!.isAlmostEqual(Point3d.create(0, 0, 0))).to.be.true;\n });\n\n it(\"should return correct attachmentPoint for 'Keypoint' mode\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(-20, 0, 0),\n attachment: { mode: \"KeyPoint\", curveIndex: 0, fraction: 0 }\n }\n ];\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n expect(attachmentPoint).to.exist;\n expect(attachmentPoint?.y).to.be.equal(range.low.y); // expected to be at the bottom of the TextBlock\n });\n\n it(\"should return correct attachmentPoint for 'TextPoint' mode\", () => {\n const leaders: TextAnnotationLeader[] = [\n {\n startPoint: Point3d.create(-20, 0, 0),\n attachment: { mode: \"TextPoint\", position: \"TopLeft\" }\n }\n ];\n const attachmentPoint = computeLeaderAttachmentPoint(leaders[0], frameCurve, layout, transform);\n expect(attachmentPoint).to.exist;\n const topY = range.high.y;\n const middleY = (range.low.y + range.high.y) / 2;\n expect(attachmentPoint!.y).to.be.within(middleY, topY); // expected to be in the upper half of the TextBlock\n });\n })\n\n})\n"]}
|
|
@@ -787,13 +787,54 @@ describe("AnnotationTextStyle", () => {
|
|
|
787
787
|
}),
|
|
788
788
|
})).to.throw(`JSON version 999.999.999 is newer than supported version ${TEXT_STYLE_SETTINGS_JSON_VERSION}. Application update required to understand data.`);
|
|
789
789
|
});
|
|
790
|
-
it("
|
|
791
|
-
|
|
790
|
+
it("should migrate text style settings from 1.0.0", () => {
|
|
791
|
+
const oldStyleData = {
|
|
792
|
+
...TextStyleSettings.defaultProps,
|
|
793
|
+
leader: {
|
|
794
|
+
...TextStyleSettings.defaultProps.leader,
|
|
795
|
+
// Explicitly remove terminatorShape to simulate old data
|
|
796
|
+
terminatorShape: undefined
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
const migratedStyle = makeStyle({
|
|
792
800
|
settings: JSON.stringify({
|
|
793
|
-
version: "0.0
|
|
794
|
-
data:
|
|
801
|
+
version: "1.0.0",
|
|
802
|
+
data: oldStyleData
|
|
803
|
+
}),
|
|
804
|
+
});
|
|
805
|
+
const jsonStyleData = migratedStyle.toJSON();
|
|
806
|
+
if (jsonStyleData.settings) {
|
|
807
|
+
const jsonVersion = JSON.parse(jsonStyleData.settings).version;
|
|
808
|
+
expect(jsonVersion).to.equal(TEXT_STYLE_SETTINGS_JSON_VERSION);
|
|
809
|
+
}
|
|
810
|
+
expect(migratedStyle.settings.leader.terminatorShape).to.not.be.undefined;
|
|
811
|
+
});
|
|
812
|
+
it("should return same data when version is 1.0.1", () => {
|
|
813
|
+
const styleData = {
|
|
814
|
+
version: "1.0.1",
|
|
815
|
+
data: TextStyleSettings.defaultProps
|
|
816
|
+
};
|
|
817
|
+
const migratedStyle = makeStyle({
|
|
818
|
+
settings: JSON.stringify({
|
|
819
|
+
version: styleData.version,
|
|
820
|
+
data: styleData.data
|
|
795
821
|
}),
|
|
796
|
-
})
|
|
822
|
+
});
|
|
823
|
+
const jsonStyleData = migratedStyle.toJSON();
|
|
824
|
+
if (jsonStyleData.settings) {
|
|
825
|
+
const parsedJson = JSON.parse(jsonStyleData.settings);
|
|
826
|
+
expect(parsedJson.version).to.equal(styleData.version);
|
|
827
|
+
expect(parsedJson.data).to.deep.equal(styleData.data);
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
it("should return defaultProps when styleData is unrecognized", () => {
|
|
831
|
+
const textStyle = makeStyle({
|
|
832
|
+
settings: JSON.stringify({
|
|
833
|
+
version: "1.0.1",
|
|
834
|
+
data: { invalid: "data" }
|
|
835
|
+
}),
|
|
836
|
+
});
|
|
837
|
+
expect(textStyle.settings).to.be.deep.equal(TextStyleSettings.defaultProps);
|
|
797
838
|
});
|
|
798
839
|
});
|
|
799
840
|
describe("onCloned", () => {
|