@itwin/core-backend 5.1.0-dev.61 → 5.1.0-dev.62
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/IModelDb.d.ts +4 -1
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +9 -0
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts.map +1 -1
- package/lib/cjs/LocalHub.js +6 -4
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.d.ts +1 -2
- package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js +3 -4
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.d.ts +3 -3
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +17 -8
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +148 -10
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +296 -28
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +3 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js +13 -14
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.d.ts +47 -14
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +109 -38
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +0 -1
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +4 -1
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +9 -0
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/LocalHub.d.ts.map +1 -1
- package/lib/esm/LocalHub.js +6 -4
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.d.ts +1 -2
- package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js +3 -4
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.d.ts +3 -3
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +17 -8
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +148 -10
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +297 -30
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +3 -1
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js +13 -14
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.d.ts +47 -14
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +107 -37
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js +8 -2
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js +12 -4
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +21 -16
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +180 -121
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +249 -142
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +96 -0
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/workspace/Workspace.d.ts +0 -1
- package/lib/esm/workspace/Workspace.d.ts.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/package.json +12 -12
|
@@ -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,MAAM,oBAAoB,CAAC;AAC/H,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE/D,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAI,OAAoB,CAAC;IACzB,IAAI,aAA6B,CAAC;IAElC,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAA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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,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,gDAAgD;QACvG,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,OAAO,GAA2B;gBACtC;oBACE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;oBACrC,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,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 } from \"../../core-backend\";\nimport { Id64 } 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({ styleName: \"\", styleOverrides: { fontName: \"Arial\" } });\n textBlock.appendRun(TextRun.create({ content: \"Hello\", styleName: \"\", styleOverrides: { fontName: \"Arial\" } }));\n textBlock.appendRun(LineBreakRun.create({\n styleName: \"\",\n styleOverrides: { fontName: \"Arial\" },\n }));\n textBlock.appendRun(TextRun.create({ content: \"World\", styleName: \"\", styleOverrides: { fontName: \"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 frame\n });\n\n const layout = doLayout(textBlock, {\n findTextStyle: (name: string) => TextStyleSettings.fromJSON(name === \"block\" ? { lineSpacingFactor: 12, fontName: \"block\" } : { lineSpacingFactor: 99, fontName: \"run\" }),\n findFontId: () => 0,\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, frame);\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); // Default 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, frame);\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, frame);\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, frame);\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, frame);\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, frame);\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, frame);\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 lineHeight = 1;\n const terminatorWidth = (leaders[0].styleOverrides?.leader?.terminatorWidthFactor ?? 1) * lineHeight;\n const terminatorHeight = (leaders[0].styleOverrides?.leader?.terminatorHeightFactor ?? 1) * lineHeight;\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, frame);\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":["../../../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CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,gDAAgD;QACvG,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,OAAO,GAA2B;gBACtC;oBACE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;oBACrC,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,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({ styleId: \"0x34\", styleOverrides: { fontName: \"Arial\", color: ColorDef.black.toJSON(), leader: {wantElbow: false} } });\n textBlock.appendRun(TextRun.create({ content: \"Hello\", styleOverrides: { fontName: \"Arial\" } }));\n textBlock.appendRun(LineBreakRun.create({\n styleOverrides: { fontName: \"Arial\" },\n }));\n textBlock.appendRun(TextRun.create({ content: \"World\", styleOverrides: { fontName: \"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, fontName: \"block\", frame } : { lineSpacingFactor: 99, fontName: \"run\", frame });\n const textStyleResolver = new TextStyleResolver({\n textBlock,\n iModel: {} as any,\n modelId: undefined,\n findTextStyle,\n });\n const layout = doLayout(textBlock, {\n findTextStyle,\n findFontId: () => 0,\n });\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);\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);\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);\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);\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);\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);\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);\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 lineHeight = 1;\n const terminatorWidth = (leaders[0].styleOverrides?.leader?.terminatorWidthFactor ?? 1) * lineHeight;\n const terminatorHeight = (leaders[0].styleOverrides?.leader?.terminatorHeightFactor ?? 1) * lineHeight;\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);\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"]}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { expect } from "chai";
|
|
6
6
|
import { Angle, Point3d, Range2d, Range3d, YawPitchRollAngles } from "@itwin/core-geometry";
|
|
7
|
-
import {
|
|
7
|
+
import { FractionRun, SubCategoryAppearance, TextAnnotation, TextBlock, TextRun, TextStyleSettings } from "@itwin/core-common";
|
|
8
8
|
import { StandaloneDb } from "../../IModelDb";
|
|
9
|
-
import { TextAnnotation2d, TextAnnotation3d } from "../../annotations/TextAnnotationElement";
|
|
9
|
+
import { AnnotationTextStyle, TextAnnotation2d, TextAnnotation3d } from "../../annotations/TextAnnotationElement";
|
|
10
10
|
import { IModelTestUtils } from "../IModelTestUtils";
|
|
11
11
|
import { Subject } from "../../Element";
|
|
12
12
|
import { Guid, Id64 } from "@itwin/core-bentley";
|
|
@@ -26,6 +26,61 @@ function mockIModel() {
|
|
|
26
26
|
};
|
|
27
27
|
return iModel;
|
|
28
28
|
}
|
|
29
|
+
function createAnnotation(styleId) {
|
|
30
|
+
const styleOverrides = { fontName: "Karla" };
|
|
31
|
+
const block = TextBlock.create({ styleId: styleId ?? "0x42", styleOverrides });
|
|
32
|
+
block.appendRun(TextRun.create({ content: "Run, Barry,", styleOverrides }));
|
|
33
|
+
block.appendRun(TextRun.create({ content: " RUN!!! ", styleOverrides }));
|
|
34
|
+
block.appendRun(FractionRun.create({ numerator: "Harrison", denominator: "Wells", styleOverrides }));
|
|
35
|
+
block.margins = { left: 0, right: 1, top: 2, bottom: 3 };
|
|
36
|
+
const annotation = TextAnnotation.fromJSON({ textBlock: block.toJSON() });
|
|
37
|
+
annotation.anchor = { vertical: "middle", horizontal: "right" };
|
|
38
|
+
annotation.orientation = YawPitchRollAngles.createDegrees(1, 0, -1);
|
|
39
|
+
annotation.offset = Point3d.create(10, -5, 0);
|
|
40
|
+
annotation.leaders = [{ startPoint: Point3d.createZero(), attachment: { mode: "Nearest" } }];
|
|
41
|
+
return annotation;
|
|
42
|
+
}
|
|
43
|
+
const createJobSubjectElement = (iModel, name) => {
|
|
44
|
+
const subj = Subject.create(iModel, iModel.elements.getRootSubject().id, name);
|
|
45
|
+
subj.setJsonProperty("Subject", { Job: name }); // eslint-disable-line @typescript-eslint/naming-convention
|
|
46
|
+
return subj;
|
|
47
|
+
};
|
|
48
|
+
const insertDrawingModel = (standaloneModel, parentId, definitionModel) => {
|
|
49
|
+
const category = DrawingCategory.insert(standaloneModel, definitionModel, "DrawingCategory", new SubCategoryAppearance());
|
|
50
|
+
const [_, model] = IModelTestUtils.createAndInsertDrawingPartitionAndModel(standaloneModel, { spec: '0x1', scope: '0x1', value: 'Drawing' }, undefined, parentId);
|
|
51
|
+
const displayStyle = DisplayStyle2d.insert(standaloneModel, definitionModel, "DisplayStyle2d");
|
|
52
|
+
const categorySelector = CategorySelector.insert(standaloneModel, definitionModel, "DrawingCategories", [category]);
|
|
53
|
+
const viewRange = new Range2d(0, 0, 500, 500);
|
|
54
|
+
DrawingViewDefinition.insert(standaloneModel, definitionModel, "Drawing View", model, categorySelector, displayStyle, viewRange);
|
|
55
|
+
return { category, model };
|
|
56
|
+
};
|
|
57
|
+
const insertSpatialModel = (standaloneModel, parentId, definitionModel) => {
|
|
58
|
+
const category = SpatialCategory.insert(standaloneModel, definitionModel, "spatialCategory", new SubCategoryAppearance());
|
|
59
|
+
const [_, model] = IModelTestUtils.createAndInsertPhysicalPartitionAndModel(standaloneModel, { spec: '0x1', scope: '0x1', value: 'Spatial' }, undefined, parentId);
|
|
60
|
+
const modelSelector = ModelSelector.insert(standaloneModel, definitionModel, "SpatialModelSelector", [model]);
|
|
61
|
+
const displayStyle = DisplayStyle3d.insert(standaloneModel, definitionModel, "DisplayStyle3d");
|
|
62
|
+
const categorySelector = CategorySelector.insert(standaloneModel, definitionModel, "spatialCategories", [category]);
|
|
63
|
+
const viewRange = new Range3d(0, 0, 0, 500, 500, 500);
|
|
64
|
+
SpatialViewDefinition.insertWithCamera(standaloneModel, definitionModel, "spatial View", modelSelector, categorySelector, displayStyle, viewRange);
|
|
65
|
+
return { category, model };
|
|
66
|
+
};
|
|
67
|
+
const createIModel = async (name) => {
|
|
68
|
+
const filePath = IModelTestUtils.prepareOutputFile("annotationTests", `${name}.bim`);
|
|
69
|
+
const iModel = StandaloneDb.createEmpty(filePath, {
|
|
70
|
+
rootSubject: { name: `${name} tests`, description: `${name} tests` },
|
|
71
|
+
client: "integration tests",
|
|
72
|
+
globalOrigin: { x: 0, y: 0 },
|
|
73
|
+
projectExtents: { low: { x: -500, y: -500, z: -50 }, high: { x: 500, y: 500, z: 50 } },
|
|
74
|
+
guid: Guid.createValue(),
|
|
75
|
+
});
|
|
76
|
+
await iModel.fonts.embedFontFile({
|
|
77
|
+
file: FontFile.createFromTrueTypeFileName(IModelTestUtils.resolveFontFile("Karla-Regular.ttf"))
|
|
78
|
+
});
|
|
79
|
+
return iModel;
|
|
80
|
+
};
|
|
81
|
+
const createAnnotationTextStyle = (iModel, definitionModel, name, settings = TextStyleSettings.defaultProps) => {
|
|
82
|
+
return AnnotationTextStyle.create(iModel, definitionModel, name, settings, "description");
|
|
83
|
+
};
|
|
29
84
|
describe("TextAnnotation element", () => {
|
|
30
85
|
function makeElement(props) {
|
|
31
86
|
return TextAnnotation2d.fromJSON({
|
|
@@ -44,29 +99,21 @@ describe("TextAnnotation element", () => {
|
|
|
44
99
|
}, mockIModel());
|
|
45
100
|
}
|
|
46
101
|
describe("getAnnotation", () => {
|
|
47
|
-
it("returns undefined if not
|
|
102
|
+
it("returns undefined if not provided", () => {
|
|
48
103
|
expect(makeElement().getAnnotation()).to.be.undefined;
|
|
49
104
|
});
|
|
50
|
-
it("
|
|
105
|
+
it("converts JSON string to class instance", () => {
|
|
51
106
|
const elem = makeElement({
|
|
52
|
-
|
|
53
|
-
annotation: {
|
|
54
|
-
textBlock: TextBlock.create({ styleName: "block" }).toJSON(),
|
|
55
|
-
},
|
|
56
|
-
},
|
|
107
|
+
textAnnotationData: JSON.stringify({ textBlock: TextBlock.create({ styleId: "0x42" }).toJSON() })
|
|
57
108
|
});
|
|
58
109
|
const anno = elem.getAnnotation();
|
|
59
110
|
expect(anno).not.to.be.undefined;
|
|
60
111
|
expect(anno.textBlock.isEmpty).to.be.true;
|
|
61
|
-
expect(anno.textBlock.
|
|
112
|
+
expect(anno.textBlock.styleId).to.equal("0x42");
|
|
62
113
|
});
|
|
63
114
|
it("produces a new object each time it is called", () => {
|
|
64
115
|
const elem = makeElement({
|
|
65
|
-
|
|
66
|
-
annotation: {
|
|
67
|
-
textBlock: TextBlock.create({ styleName: "block" }).toJSON(),
|
|
68
|
-
},
|
|
69
|
-
},
|
|
116
|
+
textAnnotationData: JSON.stringify({ textBlock: TextBlock.create({ styleId: "0x42" }).toJSON() })
|
|
70
117
|
});
|
|
71
118
|
const anno1 = elem.getAnnotation();
|
|
72
119
|
const anno2 = elem.getAnnotation();
|
|
@@ -75,114 +122,45 @@ describe("TextAnnotation element", () => {
|
|
|
75
122
|
});
|
|
76
123
|
});
|
|
77
124
|
describe("setAnnotation", () => {
|
|
78
|
-
it("updates
|
|
125
|
+
it("updates properties", () => {
|
|
79
126
|
const elem = makeElement();
|
|
80
|
-
const textBlock = TextBlock.create({
|
|
81
|
-
textBlock.appendRun(TextRun.create({ content: "text"
|
|
127
|
+
const textBlock = TextBlock.create({ styleId: "0x42" });
|
|
128
|
+
textBlock.appendRun(TextRun.create({ content: "text" }));
|
|
82
129
|
const annotation = TextAnnotation.fromJSON({ textBlock: textBlock.toJSON() });
|
|
83
130
|
elem.setAnnotation(annotation);
|
|
84
|
-
expect(elem.
|
|
85
|
-
expect(elem.
|
|
131
|
+
expect(elem.getAnnotation().toJSON()).to.deep.equal(annotation.toJSON());
|
|
132
|
+
expect(elem.getAnnotation().toJSON()).not.to.equal(annotation.toJSON());
|
|
86
133
|
});
|
|
87
|
-
// it("uses default subcategory by default", () => {
|
|
88
|
-
// const elem = makeElement();
|
|
89
|
-
// elem.setAnnotation(TextAnnotation.fromJSON({ textBlock: { styleName: "block" } }));
|
|
90
|
-
// expect(elem.geom!.length).to.equal(1);
|
|
91
|
-
// expect(elem.geom![0].appearance!.subCategory).to.equal("0x13");
|
|
92
|
-
// });
|
|
93
|
-
// it("uses specific subcategory if provided", () => {
|
|
94
|
-
// const elem = makeElement();
|
|
95
|
-
// elem.setAnnotation(TextAnnotation.fromJSON({ textBlock: { styleName: "block" } }));
|
|
96
|
-
// expect(elem.geom!.length).to.equal(1);
|
|
97
|
-
// expect(elem.geom![0].appearance!.subCategory).to.equal("0x1234");
|
|
98
|
-
// });
|
|
99
134
|
});
|
|
100
|
-
function createAnnotation() {
|
|
101
|
-
const styleOverrides = { fontName: "Karla" };
|
|
102
|
-
const block = TextBlock.create({ styleName: "block", styleOverrides });
|
|
103
|
-
block.appendRun(TextRun.create({ content: "Run, Barry,", styleName: "run1", styleOverrides }));
|
|
104
|
-
block.appendRun(TextRun.create({ content: " RUN!!! ", styleName: "run2", styleOverrides }));
|
|
105
|
-
block.appendRun(FractionRun.create({ numerator: "Harrison", denominator: "Wells", styleName: "run3", styleOverrides }));
|
|
106
|
-
block.margins = { left: 0, right: 1, top: 2, bottom: 3 };
|
|
107
|
-
const annotation = TextAnnotation.fromJSON({ textBlock: block.toJSON() });
|
|
108
|
-
annotation.anchor = { vertical: "middle", horizontal: "right" };
|
|
109
|
-
annotation.orientation = YawPitchRollAngles.createDegrees(1, 0, -1);
|
|
110
|
-
annotation.offset = Point3d.create(10, -5, 0);
|
|
111
|
-
annotation.frame = { shape: "rectangle", border: ColorDef.red.toJSON(), fill: ColorDef.green.toJSON(), borderWeight: 2 };
|
|
112
|
-
annotation.leaders = [{ startPoint: Point3d.createZero(), attachment: { mode: "Nearest" } }];
|
|
113
|
-
return annotation;
|
|
114
|
-
}
|
|
115
|
-
const createJobSubjectElement = (iModel, name) => {
|
|
116
|
-
const subj = Subject.create(iModel, iModel.elements.getRootSubject().id, name);
|
|
117
|
-
subj.setJsonProperty("Subject", { Job: name }); // eslint-disable-line @typescript-eslint/naming-convention
|
|
118
|
-
return subj;
|
|
119
|
-
};
|
|
120
|
-
const insertDrawingModel = (standaloneModel, parentId) => {
|
|
121
|
-
const definitionModel = DefinitionModel.insert(standaloneModel, parentId, "DrawingDefinition");
|
|
122
|
-
const category = DrawingCategory.insert(standaloneModel, definitionModel, "DrawingCategory", new SubCategoryAppearance());
|
|
123
|
-
const [_, model] = IModelTestUtils.createAndInsertDrawingPartitionAndModel(standaloneModel, { spec: '0x1', scope: '0x1', value: 'Drawing' }, undefined, parentId);
|
|
124
|
-
const displayStyle = DisplayStyle2d.insert(standaloneModel, definitionModel, "DisplayStyle2d");
|
|
125
|
-
const categorySelector = CategorySelector.insert(standaloneModel, definitionModel, "DrawingCategories", [category]);
|
|
126
|
-
const viewRange = new Range2d(0, 0, 500, 500);
|
|
127
|
-
DrawingViewDefinition.insert(standaloneModel, definitionModel, "Drawing View", model, categorySelector, displayStyle, viewRange);
|
|
128
|
-
return { category, model };
|
|
129
|
-
};
|
|
130
|
-
const insertSpatialModel = (standaloneModel, parentId) => {
|
|
131
|
-
const definitionModel = DefinitionModel.insert(standaloneModel, parentId, "SpatialDefinition");
|
|
132
|
-
const category = SpatialCategory.insert(standaloneModel, definitionModel, "spatialCategory", new SubCategoryAppearance());
|
|
133
|
-
const [_, model] = IModelTestUtils.createAndInsertPhysicalPartitionAndModel(standaloneModel, { spec: '0x1', scope: '0x1', value: 'Spatial' }, undefined, parentId);
|
|
134
|
-
const modelSelector = ModelSelector.insert(standaloneModel, definitionModel, "SpatialModelSelector", [model]);
|
|
135
|
-
const displayStyle = DisplayStyle3d.insert(standaloneModel, definitionModel, "DisplayStyle3d");
|
|
136
|
-
const categorySelector = CategorySelector.insert(standaloneModel, definitionModel, "spatialCategories", [category]);
|
|
137
|
-
const viewRange = new Range3d(0, 0, 0, 500, 500, 500);
|
|
138
|
-
SpatialViewDefinition.insertWithCamera(standaloneModel, definitionModel, "spatial View", modelSelector, categorySelector, displayStyle, viewRange);
|
|
139
|
-
return { category, model };
|
|
140
|
-
};
|
|
141
|
-
const createIModel = async (name) => {
|
|
142
|
-
const filePath = IModelTestUtils.prepareOutputFile("annotationTests", `${name}.bim`);
|
|
143
|
-
const iModel = StandaloneDb.createEmpty(filePath, {
|
|
144
|
-
rootSubject: { name: `${name} tests`, description: `${name} tests` },
|
|
145
|
-
client: "integration tests",
|
|
146
|
-
globalOrigin: { x: 0, y: 0 },
|
|
147
|
-
projectExtents: { low: { x: -500, y: -500, z: -50 }, high: { x: 500, y: 500, z: 50 } },
|
|
148
|
-
guid: Guid.createValue(),
|
|
149
|
-
});
|
|
150
|
-
await iModel.fonts.embedFontFile({
|
|
151
|
-
file: FontFile.createFromTrueTypeFileName(IModelTestUtils.resolveFontFile("Karla-Regular.ttf"))
|
|
152
|
-
});
|
|
153
|
-
return iModel;
|
|
154
|
-
};
|
|
155
135
|
describe("TextAnnotation3d Persistence", () => {
|
|
156
136
|
let imodel;
|
|
157
137
|
let seedCategoryId;
|
|
158
138
|
let seedModelId;
|
|
139
|
+
let seedStyleId;
|
|
159
140
|
before(async () => {
|
|
160
141
|
imodel = await createIModel("TextAnnotation3d");
|
|
161
142
|
const jobSubjectId = createJobSubjectElement(imodel, "Job").insert();
|
|
162
|
-
const
|
|
143
|
+
const definitionModel = DefinitionModel.insert(imodel, jobSubjectId, "Definition");
|
|
144
|
+
const { category, model } = insertSpatialModel(imodel, jobSubjectId, definitionModel);
|
|
145
|
+
const styleId = createAnnotationTextStyle(imodel, definitionModel, "test", { fontName: "Totally Real Font", lineHeight: 0.25, isItalic: true }).insert();
|
|
163
146
|
expect(jobSubjectId).not.to.be.undefined;
|
|
164
147
|
expect(category).not.to.be.undefined;
|
|
165
148
|
expect(model).not.to.be.undefined;
|
|
149
|
+
expect(styleId).not.to.be.undefined;
|
|
166
150
|
seedCategoryId = category;
|
|
167
151
|
seedModelId = model;
|
|
152
|
+
seedStyleId = styleId;
|
|
168
153
|
});
|
|
169
154
|
after(() => imodel.close());
|
|
170
|
-
function createElement3d(
|
|
171
|
-
return TextAnnotation3d.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
placement: {
|
|
176
|
-
origin: { x: 0, y: 0, z: 0 },
|
|
177
|
-
angles: YawPitchRollAngles.createDegrees(0, 0, 0).toJSON(),
|
|
178
|
-
},
|
|
179
|
-
...props,
|
|
180
|
-
classFullName: TextAnnotation3d.classFullName,
|
|
181
|
-
}, imodel);
|
|
155
|
+
function createElement3d(createArgs) {
|
|
156
|
+
return TextAnnotation3d.create(imodel, seedCategoryId, seedModelId, {
|
|
157
|
+
origin: { x: 0, y: 0, z: 0 },
|
|
158
|
+
angles: YawPitchRollAngles.createDegrees(0, 0, 0).toJSON(),
|
|
159
|
+
}, createArgs?.textAnnotationData);
|
|
182
160
|
}
|
|
183
|
-
it("
|
|
161
|
+
it("creating element does not automatically compute the geometry", () => {
|
|
184
162
|
const annotation = createAnnotation();
|
|
185
|
-
const el = createElement3d({
|
|
163
|
+
const el = createElement3d({ textAnnotationData: annotation.toJSON() });
|
|
186
164
|
expect(el.getAnnotation().equals(annotation)).to.be.true;
|
|
187
165
|
expect(el.geom).to.be.undefined;
|
|
188
166
|
});
|
|
@@ -202,7 +180,6 @@ describe("TextAnnotation element", () => {
|
|
|
202
180
|
el0.setAnnotation(annotation);
|
|
203
181
|
}
|
|
204
182
|
expectPlacement3d(el0, false);
|
|
205
|
-
expect(el0.toJSON().elementGeometryBuilderParams).not.to.be.undefined;
|
|
206
183
|
const elId = el0.insert();
|
|
207
184
|
expect(Id64.isValidId64(elId)).to.be.true;
|
|
208
185
|
const el1 = imodel.elements.getElement(elId);
|
|
@@ -212,14 +189,16 @@ describe("TextAnnotation element", () => {
|
|
|
212
189
|
const anno = el1.getAnnotation();
|
|
213
190
|
if (!annotation) {
|
|
214
191
|
expect(anno).to.be.undefined;
|
|
192
|
+
expect(el0.toJSON().elementGeometryBuilderParams).to.be.undefined;
|
|
215
193
|
}
|
|
216
194
|
else {
|
|
217
195
|
expect(anno).not.to.be.undefined;
|
|
218
196
|
expect(anno.equals(annotation)).to.be.true;
|
|
197
|
+
expect(el0.toJSON().elementGeometryBuilderParams).not.to.be.undefined;
|
|
219
198
|
}
|
|
220
199
|
}
|
|
221
200
|
it("roundtrips an empty annotation", async () => { await test(); });
|
|
222
|
-
it("roundtrips an annotation with a style", async () => { await test(TextAnnotation.fromJSON({ textBlock: {
|
|
201
|
+
it("roundtrips an annotation with a style", async () => { await test(TextAnnotation.fromJSON({ textBlock: { styleId: seedStyleId } })); });
|
|
223
202
|
it("roundtrips an annotation with a textBlock", async () => { await test(createAnnotation()); });
|
|
224
203
|
});
|
|
225
204
|
});
|
|
@@ -227,36 +206,34 @@ describe("TextAnnotation element", () => {
|
|
|
227
206
|
let imodel;
|
|
228
207
|
let seedCategoryId;
|
|
229
208
|
let seedModelId;
|
|
209
|
+
let seedStyleId;
|
|
230
210
|
before(async () => {
|
|
231
211
|
imodel = await createIModel("TextAnnotation2d");
|
|
232
212
|
const jobSubjectId = createJobSubjectElement(imodel, "Job").insert();
|
|
233
|
-
const
|
|
213
|
+
const definitionModel = DefinitionModel.insert(imodel, jobSubjectId, "Definition");
|
|
214
|
+
const { category, model } = insertDrawingModel(imodel, jobSubjectId, definitionModel);
|
|
215
|
+
const styleId = createAnnotationTextStyle(imodel, definitionModel, "test", { fontName: "Totally Real Font", lineHeight: 0.25, isItalic: true }).insert();
|
|
234
216
|
expect(jobSubjectId).not.to.be.undefined;
|
|
235
217
|
expect(category).not.to.be.undefined;
|
|
236
218
|
expect(model).not.to.be.undefined;
|
|
219
|
+
expect(styleId).not.to.be.undefined;
|
|
237
220
|
seedCategoryId = category;
|
|
238
221
|
seedModelId = model;
|
|
222
|
+
seedStyleId = styleId;
|
|
239
223
|
});
|
|
240
224
|
after(() => {
|
|
241
225
|
imodel.saveChanges("tests");
|
|
242
226
|
imodel.close();
|
|
243
227
|
});
|
|
244
|
-
function createElement2d(
|
|
245
|
-
return TextAnnotation2d.
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
placement: {
|
|
250
|
-
origin: { x: 0, y: 0 },
|
|
251
|
-
angle: Angle.createDegrees(0).toJSON(),
|
|
252
|
-
},
|
|
253
|
-
...props,
|
|
254
|
-
classFullName: TextAnnotation2d.classFullName,
|
|
255
|
-
}, imodel);
|
|
228
|
+
function createElement2d(createArgs) {
|
|
229
|
+
return TextAnnotation2d.create(imodel, seedCategoryId, seedModelId, {
|
|
230
|
+
origin: { x: 0, y: 0 },
|
|
231
|
+
angle: Angle.createDegrees(0).toJSON(),
|
|
232
|
+
}, createArgs?.textAnnotationData);
|
|
256
233
|
}
|
|
257
|
-
it("
|
|
234
|
+
it("creating element does not automatically compute the geometry", () => {
|
|
258
235
|
const annotation = createAnnotation();
|
|
259
|
-
const el = createElement2d({
|
|
236
|
+
const el = createElement2d({ textAnnotationData: annotation.toJSON() });
|
|
260
237
|
expect(el.getAnnotation().equals(annotation)).to.be.true;
|
|
261
238
|
expect(el.geom).to.be.undefined;
|
|
262
239
|
});
|
|
@@ -273,7 +250,6 @@ describe("TextAnnotation element", () => {
|
|
|
273
250
|
el0.setAnnotation(annotation);
|
|
274
251
|
}
|
|
275
252
|
expectPlacement2d(el0, false);
|
|
276
|
-
expect(el0.toJSON().elementGeometryBuilderParams).not.to.be.undefined;
|
|
277
253
|
const elId = el0.insert();
|
|
278
254
|
expect(Id64.isValidId64(elId)).to.be.true;
|
|
279
255
|
const el1 = imodel.elements.getElement(elId);
|
|
@@ -283,16 +259,99 @@ describe("TextAnnotation element", () => {
|
|
|
283
259
|
const anno = el1.getAnnotation();
|
|
284
260
|
if (!annotation) {
|
|
285
261
|
expect(anno).to.be.undefined;
|
|
262
|
+
expect(el0.toJSON().elementGeometryBuilderParams).to.be.undefined;
|
|
286
263
|
}
|
|
287
264
|
else {
|
|
288
265
|
expect(anno).not.to.be.undefined;
|
|
289
266
|
expect(anno.equals(annotation)).to.be.true;
|
|
267
|
+
expect(el0.toJSON().elementGeometryBuilderParams).not.to.be.undefined;
|
|
290
268
|
}
|
|
291
269
|
}
|
|
292
270
|
it("roundtrips an empty annotation", async () => { await test(); });
|
|
293
|
-
it("roundtrips an annotation with a style", async () => { await test(TextAnnotation.fromJSON({ textBlock: {
|
|
271
|
+
it("roundtrips an annotation with a style", async () => { await test(TextAnnotation.fromJSON({ textBlock: { styleId: seedStyleId } })); });
|
|
294
272
|
it("roundtrips an annotation with a textBlock", async () => { await test(createAnnotation()); });
|
|
295
273
|
});
|
|
296
274
|
});
|
|
297
275
|
});
|
|
276
|
+
describe("AnnotationTextStyle", () => {
|
|
277
|
+
let imodel;
|
|
278
|
+
let seedSubjectId;
|
|
279
|
+
let seedDefinitionModel;
|
|
280
|
+
before(async () => {
|
|
281
|
+
imodel = await createIModel("AnnotationTextStyle");
|
|
282
|
+
const jobSubjectId = createJobSubjectElement(imodel, "Job").insert();
|
|
283
|
+
const definitionModel = DefinitionModel.insert(imodel, jobSubjectId, "Definition");
|
|
284
|
+
expect(jobSubjectId).not.to.be.undefined;
|
|
285
|
+
expect(definitionModel).not.to.be.undefined;
|
|
286
|
+
seedSubjectId = jobSubjectId;
|
|
287
|
+
seedDefinitionModel = definitionModel;
|
|
288
|
+
});
|
|
289
|
+
after(() => {
|
|
290
|
+
imodel.close();
|
|
291
|
+
});
|
|
292
|
+
it("inserts a style and round-trips through JSON", async () => {
|
|
293
|
+
const textStyle = TextStyleSettings.fromJSON({
|
|
294
|
+
fontName: "Totally Real Font",
|
|
295
|
+
isUnderlined: true,
|
|
296
|
+
lineHeight: 0.5
|
|
297
|
+
});
|
|
298
|
+
const el0 = createAnnotationTextStyle(imodel, seedDefinitionModel, "round-trip", textStyle.toJSON());
|
|
299
|
+
const elId = el0.insert();
|
|
300
|
+
expect(Id64.isValidId64(elId)).to.be.true;
|
|
301
|
+
const el1 = imodel.elements.getElement(elId);
|
|
302
|
+
expect(el1).not.to.be.undefined;
|
|
303
|
+
expect(el1 instanceof AnnotationTextStyle).to.be.true;
|
|
304
|
+
const style = el1.settings;
|
|
305
|
+
expect(style).not.to.be.undefined;
|
|
306
|
+
expect(style.toJSON()).to.deep.equal(textStyle.toJSON());
|
|
307
|
+
});
|
|
308
|
+
it("does not allow elements with invalid styles to be inserted", async () => {
|
|
309
|
+
// Default style should fail since it has no font
|
|
310
|
+
let annotationTextStyle = createAnnotationTextStyle(imodel, seedDefinitionModel, "default");
|
|
311
|
+
expect(() => annotationTextStyle.insert()).to.throw();
|
|
312
|
+
// font is required
|
|
313
|
+
annotationTextStyle = createAnnotationTextStyle(imodel, seedDefinitionModel, "no font", { fontName: "" });
|
|
314
|
+
expect(() => annotationTextStyle.insert()).to.throw();
|
|
315
|
+
// lineHeight should be positive
|
|
316
|
+
annotationTextStyle = createAnnotationTextStyle(imodel, seedDefinitionModel, "invalid lineHeight", { fontName: "Totally Real Font", lineHeight: 0 });
|
|
317
|
+
expect(() => annotationTextStyle.insert()).to.throw();
|
|
318
|
+
// stackedFractionScale should be positive
|
|
319
|
+
annotationTextStyle = createAnnotationTextStyle(imodel, seedDefinitionModel, "invalid stackedFractionScale", { fontName: "Totally Real Font", stackedFractionScale: 0 });
|
|
320
|
+
expect(() => annotationTextStyle.insert()).to.throw();
|
|
321
|
+
});
|
|
322
|
+
it("does not allow updating of elements to invalid styles", async () => {
|
|
323
|
+
const annotationTextStyle = createAnnotationTextStyle(imodel, seedDefinitionModel, "valid style", { fontName: "Totally Real Font" });
|
|
324
|
+
const elId = annotationTextStyle.insert();
|
|
325
|
+
expect(Id64.isValidId64(elId)).to.be.true;
|
|
326
|
+
const el1 = imodel.elements.getElement(elId);
|
|
327
|
+
expect(el1).not.to.be.undefined;
|
|
328
|
+
expect(el1 instanceof AnnotationTextStyle).to.be.true;
|
|
329
|
+
el1.settings = el1.settings.clone({ fontName: "" });
|
|
330
|
+
expect(() => el1.update()).to.throw();
|
|
331
|
+
el1.settings = el1.settings.clone({ fontName: "Totally Real Font", lineHeight: 0 });
|
|
332
|
+
expect(() => el1.update()).to.throw();
|
|
333
|
+
el1.settings = el1.settings.clone({ lineHeight: 2, stackedFractionScale: 0 });
|
|
334
|
+
expect(() => el1.update()).to.throw();
|
|
335
|
+
el1.settings = el1.settings.clone({ stackedFractionScale: 0.45 });
|
|
336
|
+
el1.update();
|
|
337
|
+
const updatedElement = imodel.elements.getElement(elId);
|
|
338
|
+
expect(updatedElement.settings.toJSON()).to.deep.equal(el1.settings.toJSON());
|
|
339
|
+
});
|
|
340
|
+
it("uses default style if none specified", async () => {
|
|
341
|
+
const el0 = AnnotationTextStyle.fromJSON({
|
|
342
|
+
classFullName: AnnotationTextStyle.classFullName,
|
|
343
|
+
model: seedSubjectId,
|
|
344
|
+
code: AnnotationTextStyle.createCode(imodel, seedSubjectId, "style1"),
|
|
345
|
+
}, imodel);
|
|
346
|
+
expect(el0.settings).not.to.be.undefined;
|
|
347
|
+
expect(el0.settings.toJSON()).to.deep.equal(TextStyleSettings.defaultProps);
|
|
348
|
+
});
|
|
349
|
+
it("can update style via cloning", async () => {
|
|
350
|
+
const el0 = createAnnotationTextStyle(imodel, seedDefinitionModel, "cloning", { fontName: "Totally Real Font" });
|
|
351
|
+
const newStyle = el0.settings.clone({ isBold: true, lineSpacingFactor: 3 });
|
|
352
|
+
expect(el0.settings.toJSON()).to.not.deep.equal(newStyle.toJSON());
|
|
353
|
+
el0.settings = newStyle;
|
|
354
|
+
expect(el0.settings.toJSON()).to.deep.equal(newStyle.toJSON());
|
|
355
|
+
});
|
|
356
|
+
});
|
|
298
357
|
//# sourceMappingURL=TextAnnotation.test.js.map
|