@ifc-lite/create 2.2.1 → 2.5.0

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 (62) hide show
  1. package/dist/ifc-creator-math.d.ts +14 -0
  2. package/dist/ifc-creator-math.d.ts.map +1 -1
  3. package/dist/ifc-creator-math.js +36 -0
  4. package/dist/ifc-creator-math.js.map +1 -1
  5. package/dist/ifc-creator-scheduling.d.ts +27 -0
  6. package/dist/ifc-creator-scheduling.d.ts.map +1 -0
  7. package/dist/ifc-creator-scheduling.js +131 -0
  8. package/dist/ifc-creator-scheduling.js.map +1 -0
  9. package/dist/ifc-creator.d.ts +23 -6
  10. package/dist/ifc-creator.d.ts.map +1 -1
  11. package/dist/ifc-creator.js +39 -59
  12. package/dist/ifc-creator.js.map +1 -1
  13. package/dist/in-store/anchor.d.ts +16 -1
  14. package/dist/in-store/anchor.d.ts.map +1 -1
  15. package/dist/in-store/anchor.js +20 -0
  16. package/dist/in-store/anchor.js.map +1 -1
  17. package/dist/in-store/drawing-markup-geometry.d.ts +46 -0
  18. package/dist/in-store/drawing-markup-geometry.d.ts.map +1 -0
  19. package/dist/in-store/drawing-markup-geometry.js +80 -0
  20. package/dist/in-store/drawing-markup-geometry.js.map +1 -0
  21. package/dist/in-store/drawing-markup-tags.d.ts +29 -0
  22. package/dist/in-store/drawing-markup-tags.d.ts.map +1 -0
  23. package/dist/in-store/drawing-markup-tags.js +31 -0
  24. package/dist/in-store/drawing-markup-tags.js.map +1 -0
  25. package/dist/in-store/drawing-markup.d.ts +184 -0
  26. package/dist/in-store/drawing-markup.d.ts.map +1 -0
  27. package/dist/in-store/drawing-markup.js +196 -0
  28. package/dist/in-store/drawing-markup.js.map +1 -0
  29. package/dist/in-store/extract-walls.d.ts +16 -16
  30. package/dist/in-store/extract-walls.d.ts.map +1 -1
  31. package/dist/in-store/extract-walls.js +31 -289
  32. package/dist/in-store/extract-walls.js.map +1 -1
  33. package/dist/in-store/length-unit-scale.d.ts +34 -0
  34. package/dist/in-store/length-unit-scale.d.ts.map +1 -0
  35. package/dist/in-store/length-unit-scale.js +44 -0
  36. package/dist/in-store/length-unit-scale.js.map +1 -0
  37. package/dist/in-store/placement-frame.d.ts +132 -0
  38. package/dist/in-store/placement-frame.d.ts.map +1 -0
  39. package/dist/in-store/placement-frame.js +266 -0
  40. package/dist/in-store/placement-frame.js.map +1 -0
  41. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  42. package/dist/in-store/resolve-anchor.js +7 -14
  43. package/dist/in-store/resolve-anchor.js.map +1 -1
  44. package/dist/in-store/resolve-source.d.ts.map +1 -1
  45. package/dist/in-store/resolve-source.js +3 -10
  46. package/dist/in-store/resolve-source.js.map +1 -1
  47. package/dist/in-store/spatial-zone.js +1 -1
  48. package/dist/in-store/storey-plan-frame.d.ts +69 -0
  49. package/dist/in-store/storey-plan-frame.d.ts.map +1 -0
  50. package/dist/in-store/storey-plan-frame.js +157 -0
  51. package/dist/in-store/storey-plan-frame.js.map +1 -0
  52. package/dist/index.d.ts +4 -1
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +3 -0
  55. package/dist/index.js.map +1 -1
  56. package/dist/types-scheduling.d.ts +169 -0
  57. package/dist/types-scheduling.d.ts.map +1 -0
  58. package/dist/types-scheduling.js +5 -0
  59. package/dist/types-scheduling.js.map +1 -0
  60. package/dist/types.d.ts +1 -96
  61. package/dist/types.d.ts.map +1 -1
  62. package/package.json +4 -4
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Geometry emitters local to `drawing-markup.ts`, kept out of the shared
3
+ * `_emit-helpers.ts` deliberately: annotation curves/placements are a
4
+ * different shape than the swept-solid prologue every element builder
5
+ * shares (bare `IfcPolyline`, not a closed profile; an `Annotation`
6
+ * `IfcShapeRepresentation`, not `Body`), so folding them into the shared
7
+ * file would grow it for callers that never touch markup.
8
+ */
9
+ import type { StoreEditor } from '@ifc-lite/mutations';
10
+ /**
11
+ * Emit an `IfcPolyline` through 2D points, in order. When `close` is true
12
+ * and the input isn't already closed (first/last within epsilon), the first
13
+ * point is appended again — same auto-close rule `_emit-helpers.ts`'s
14
+ * `emitPolygonProfile` uses, minus the `IfcArbitraryClosedProfileDef`
15
+ * wrapper: markup curves are annotation geometry, not extrusion profiles.
16
+ */
17
+ export declare function emitMarkupPolyline(editor: StoreEditor, points: ReadonlyArray<readonly [number, number]>, close: boolean): number;
18
+ /**
19
+ * Emit an `IfcAxis2Placement2D` at a 2D point (no rotation) — the `Placement`
20
+ * a text literal needs.
21
+ */
22
+ export declare function emitMarkupPoint2DPlacement(editor: StoreEditor, point: readonly [number, number]): number;
23
+ /**
24
+ * Emit a fresh `IfcGeometricRepresentationSubContext` for markup geometry,
25
+ * chained to `parentContextId` (the model's root 3D
26
+ * `IfcGeometricRepresentationContext`). `targetView` is written verbatim
27
+ * into `TargetView` (dot-wrapped enum, e.g. `'PLAN_VIEW'` → `.PLAN_VIEW.`).
28
+ *
29
+ * `CoordinateSpaceDimension` / `Precision` / `WorldCoordinateSystem` /
30
+ * `TrueNorth` are DERIVE-redeclared on `IfcGeometricRepresentationSubContext`
31
+ * in the IFC4 EXPRESS schema (`Ifc4.RepresentationResource`) — not given
32
+ * their own values, but STEP still reserves their positional slots with the
33
+ * `*` derived-attribute token (`packages/export/src/step-serialization.ts`'s
34
+ * `serializeStepValue` passes a literal `'*'` through unquoted), which is
35
+ * how mainstream IFC exporters emit this entity.
36
+ */
37
+ export declare function emitMarkupSubContext(editor: StoreEditor, parentContextId: number, targetView: 'PLAN_VIEW' | 'SECTION_VIEW', contextIdentifier?: string): number;
38
+ /**
39
+ * Emit an `Annotation` `IfcShapeRepresentation` + `IfcProductDefinitionShape`
40
+ * wrapping one representation item, for `IfcAnnotation.Representation`.
41
+ */
42
+ export declare function emitMarkupRepresentation(editor: StoreEditor, contextId: number, representationType: string, itemId: number): {
43
+ shapeRepId: number;
44
+ productShapeId: number;
45
+ };
46
+ //# sourceMappingURL=drawing-markup-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawing-markup-geometry.d.ts","sourceRoot":"","sources":["../../src/in-store/drawing-markup-geometry.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChD,KAAK,EAAE,OAAO,GACb,MAAM,CAcR;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAGxG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EACnB,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,WAAW,GAAG,cAAc,EACxC,iBAAiB,SAAe,GAC/B,MAAM,CAaR;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,WAAW,EACnB,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,MAAM,EAC1B,MAAM,EAAE,MAAM,GACb;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAahD"}
@@ -0,0 +1,80 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ const POINT_EPSILON = 1e-6;
5
+ /**
6
+ * Emit an `IfcPolyline` through 2D points, in order. When `close` is true
7
+ * and the input isn't already closed (first/last within epsilon), the first
8
+ * point is appended again — same auto-close rule `_emit-helpers.ts`'s
9
+ * `emitPolygonProfile` uses, minus the `IfcArbitraryClosedProfileDef`
10
+ * wrapper: markup curves are annotation geometry, not extrusion profiles.
11
+ */
12
+ export function emitMarkupPolyline(editor, points, close) {
13
+ if (points.length < 2) {
14
+ throw new Error('emitMarkupPolyline: needs at least 2 points');
15
+ }
16
+ let sequence = points;
17
+ if (close) {
18
+ const first = points[0];
19
+ const last = points[points.length - 1];
20
+ const alreadyClosed = Math.abs(first[0] - last[0]) < POINT_EPSILON && Math.abs(first[1] - last[1]) < POINT_EPSILON;
21
+ sequence = alreadyClosed ? points : [...points, first];
22
+ }
23
+ const pointIds = sequence.map((pt) => editor.addEntity('IfcCartesianPoint', [[pt[0], pt[1]]]).expressId);
24
+ return editor.addEntity('IfcPolyline', [pointIds.map((id) => `#${id}`)]).expressId;
25
+ }
26
+ /**
27
+ * Emit an `IfcAxis2Placement2D` at a 2D point (no rotation) — the `Placement`
28
+ * a text literal needs.
29
+ */
30
+ export function emitMarkupPoint2DPlacement(editor, point) {
31
+ const originPt = editor.addEntity('IfcCartesianPoint', [[point[0], point[1]]]).expressId;
32
+ return editor.addEntity('IfcAxis2Placement2D', [`#${originPt}`, null]).expressId;
33
+ }
34
+ /**
35
+ * Emit a fresh `IfcGeometricRepresentationSubContext` for markup geometry,
36
+ * chained to `parentContextId` (the model's root 3D
37
+ * `IfcGeometricRepresentationContext`). `targetView` is written verbatim
38
+ * into `TargetView` (dot-wrapped enum, e.g. `'PLAN_VIEW'` → `.PLAN_VIEW.`).
39
+ *
40
+ * `CoordinateSpaceDimension` / `Precision` / `WorldCoordinateSystem` /
41
+ * `TrueNorth` are DERIVE-redeclared on `IfcGeometricRepresentationSubContext`
42
+ * in the IFC4 EXPRESS schema (`Ifc4.RepresentationResource`) — not given
43
+ * their own values, but STEP still reserves their positional slots with the
44
+ * `*` derived-attribute token (`packages/export/src/step-serialization.ts`'s
45
+ * `serializeStepValue` passes a literal `'*'` through unquoted), which is
46
+ * how mainstream IFC exporters emit this entity.
47
+ */
48
+ export function emitMarkupSubContext(editor, parentContextId, targetView, contextIdentifier = 'Annotation') {
49
+ return editor.addEntity('IfcGeometricRepresentationSubContext', [
50
+ contextIdentifier,
51
+ 'Model',
52
+ '*',
53
+ '*',
54
+ '*',
55
+ '*',
56
+ `#${parentContextId}`,
57
+ null,
58
+ `.${targetView}.`,
59
+ null,
60
+ ]).expressId;
61
+ }
62
+ /**
63
+ * Emit an `Annotation` `IfcShapeRepresentation` + `IfcProductDefinitionShape`
64
+ * wrapping one representation item, for `IfcAnnotation.Representation`.
65
+ */
66
+ export function emitMarkupRepresentation(editor, contextId, representationType, itemId) {
67
+ const shapeRepId = editor.addEntity('IfcShapeRepresentation', [
68
+ `#${contextId}`,
69
+ 'Annotation',
70
+ representationType,
71
+ [`#${itemId}`],
72
+ ]).expressId;
73
+ const productShapeId = editor.addEntity('IfcProductDefinitionShape', [
74
+ null,
75
+ null,
76
+ [`#${shapeRepId}`],
77
+ ]).expressId;
78
+ return { shapeRepId, productShapeId };
79
+ }
80
+ //# sourceMappingURL=drawing-markup-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawing-markup-geometry.js","sourceRoot":"","sources":["../../src/in-store/drawing-markup-geometry.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAa/D,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAmB,EACnB,MAAgD,EAChD,KAAc;IAEd,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,QAAQ,GAA6C,MAAM,CAAC;IAChE,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvC,MAAM,aAAa,GACjB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,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,OAAO;QACP,GAAG;QACH,GAAG;QACH,GAAG;QACH,GAAG;QACH,IAAI,eAAe,EAAE;QACrB,IAAI;QACJ,IAAI,UAAU,GAAG;QACjB,IAAI;KACL,CAAC,CAAC,SAAS,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAmB,EACnB,SAAiB,EACjB,kBAA0B,EAC1B,MAAc;IAEd,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,wBAAwB,EAAE;QAC5D,IAAI,SAAS,EAAE;QACf,YAAY;QACZ,kBAAkB;QAClB,CAAC,IAAI,MAAM,EAAE,CAAC;KACf,CAAC,CAAC,SAAS,CAAC;IACb,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,2BAA2B,EAAE;QACnE,IAAI;QACJ,IAAI;QACJ,CAAC,IAAI,UAAU,EAAE,CAAC;KACnB,CAAC,CAAC,SAAS,CAAC;IACb,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Round-trip tag values for 2D drawing markup translated into IFC by
3
+ * `drawing-markup.ts`. Stamped into `IfcAnnotation.ObjectType` — the same
4
+ * spot `generate-spaces.ts`'s `GENERATED_SPACE_OBJECTTYPE` uses to mark a
5
+ * baked `IfcSpace` as tool-generated.
6
+ *
7
+ * Without this, saved markup reads back through the generic symbolic-overlay
8
+ * parser as plain polylines/text/fills — visible, but no longer the typed
9
+ * `Measure2DResult` / `PolygonArea2DResult` / `TextAnnotation2D` /
10
+ * `CloudAnnotation2D` it started as, and no longer editable as one.
11
+ *
12
+ * Exported from this ONE place so a future read-side translator (issue
13
+ * #4153's read-back follow-up — not implemented here) imports these instead
14
+ * of re-declaring the string literals. Two independently-typed copies of the
15
+ * same tag is exactly the failure mode this exists to prevent: the writer
16
+ * tags with one spelling, the reader checks for another, and every saved
17
+ * annotation silently falls back to untyped overlay geometry.
18
+ */
19
+ export declare const DRAWING_MARKUP_OBJECTTYPE: {
20
+ readonly MEASURE: "IfcLite:Markup:Measure";
21
+ readonly POLYGON_AREA: "IfcLite:Markup:PolygonArea";
22
+ readonly TEXT: "IfcLite:Markup:Text";
23
+ readonly CLOUD: "IfcLite:Markup:Cloud";
24
+ };
25
+ export type DrawingMarkupObjectType = (typeof DRAWING_MARKUP_OBJECTTYPE)[keyof typeof DRAWING_MARKUP_OBJECTTYPE];
26
+ /** The derived-value quantity/property set names markup entities carry. */
27
+ export declare const DRAWING_MARKUP_QSET_NAME = "Qto_IfcLiteMarkup";
28
+ export declare const DRAWING_MARKUP_PSET_NAME = "Pset_IfcLiteMarkup";
29
+ //# sourceMappingURL=drawing-markup-tags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawing-markup-tags.d.ts","sourceRoot":"","sources":["../../src/in-store/drawing-markup-tags.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAE7E,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAC5D,eAAO,MAAM,wBAAwB,uBAAuB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Round-trip tag values for 2D drawing markup translated into IFC by
6
+ * `drawing-markup.ts`. Stamped into `IfcAnnotation.ObjectType` — the same
7
+ * spot `generate-spaces.ts`'s `GENERATED_SPACE_OBJECTTYPE` uses to mark a
8
+ * baked `IfcSpace` as tool-generated.
9
+ *
10
+ * Without this, saved markup reads back through the generic symbolic-overlay
11
+ * parser as plain polylines/text/fills — visible, but no longer the typed
12
+ * `Measure2DResult` / `PolygonArea2DResult` / `TextAnnotation2D` /
13
+ * `CloudAnnotation2D` it started as, and no longer editable as one.
14
+ *
15
+ * Exported from this ONE place so a future read-side translator (issue
16
+ * #4153's read-back follow-up — not implemented here) imports these instead
17
+ * of re-declaring the string literals. Two independently-typed copies of the
18
+ * same tag is exactly the failure mode this exists to prevent: the writer
19
+ * tags with one spelling, the reader checks for another, and every saved
20
+ * annotation silently falls back to untyped overlay geometry.
21
+ */
22
+ export const DRAWING_MARKUP_OBJECTTYPE = {
23
+ MEASURE: 'IfcLite:Markup:Measure',
24
+ POLYGON_AREA: 'IfcLite:Markup:PolygonArea',
25
+ TEXT: 'IfcLite:Markup:Text',
26
+ CLOUD: 'IfcLite:Markup:Cloud',
27
+ };
28
+ /** The derived-value quantity/property set names markup entities carry. */
29
+ export const DRAWING_MARKUP_QSET_NAME = 'Qto_IfcLiteMarkup';
30
+ export const DRAWING_MARKUP_PSET_NAME = 'Pset_IfcLiteMarkup';
31
+ //# sourceMappingURL=drawing-markup-tags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawing-markup-tags.js","sourceRoot":"","sources":["../../src/in-store/drawing-markup-tags.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE,wBAAwB;IACjC,YAAY,EAAE,4BAA4B;IAC1C,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,sBAAsB;CACrB,CAAC;AAKX,2EAA2E;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAC5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Translate 2D drawing markup (issue #4153's "save into the model" option)
3
+ * into IFC entities via the additive `StoreEditor` overlay — modelled on
4
+ * `space.ts`'s `addSpaceToStore`.
5
+ *
6
+ * WRITE SIDE ONLY. This module has no UI wiring and does not import or edit
7
+ * `apps/viewer/src/store/slices/drawing2DSlice.ts` — a "save into model"
8
+ * action, and the read-side translator that recognises
9
+ * `DRAWING_MARKUP_OBJECTTYPE` and rehydrates `Drawing2DState`, are both
10
+ * future follow-ups. The param shapes below (`MarkupPoint2D`,
11
+ * `MeasureMarkupParams`, …) intentionally mirror `Drawing2DState`'s arrays
12
+ * structurally without importing `apps/viewer` — a published package
13
+ * (`@ifc-lite/create`) cannot depend on the app.
14
+ *
15
+ * Geometry frame: every point is treated as already resolved into the
16
+ * target `IfcGeometricRepresentationSubContext`'s 2D plane, in METRES —
17
+ * the same "drawing units (typically meters)" `Drawing2DState`'s own
18
+ * comments describe. Reprojecting a plan/section drawing's local 2D
19
+ * coordinates into that frame (accounting for the `SectionConfig` cut
20
+ * plane) is a UI/wiring concern for the future "save into model" action,
21
+ * not this translation layer.
22
+ *
23
+ * Additive by construction, same guarantee `StoreEditor.addEntity` documents:
24
+ * every call only APPENDS overlay entities (new `IfcAnnotation` +
25
+ * geometry + property/quantity sets); nothing existing is read, mutated,
26
+ * or renumbered.
27
+ */
28
+ import { type RandomSource } from '@ifc-lite/encoding';
29
+ import type { StoreEditor } from '@ifc-lite/mutations';
30
+ import type { SpatialAnchorSchema } from './anchor.js';
31
+ export { DRAWING_MARKUP_OBJECTTYPE, DRAWING_MARKUP_PSET_NAME, DRAWING_MARKUP_QSET_NAME, type DrawingMarkupObjectType, } from './drawing-markup-tags.js';
32
+ /** A 2D point in drawing space (metres). Structurally matches `Drawing2DState`'s `Point2D`. */
33
+ export interface MarkupPoint2D {
34
+ x: number;
35
+ y: number;
36
+ }
37
+ /**
38
+ * Placement/unit context shared by every markup builder — the subset of
39
+ * `SpatialAnchor` (`anchor.ts`) markup needs. Deliberately narrower than the
40
+ * full `SpatialAnchor`: markup has no Body/Axis solid geometry, so it needs
41
+ * no `bodyContextId`/`axisContextId`.
42
+ */
43
+ export interface MarkupAnchor {
44
+ /** IfcOwnerHistory expressId, or null when the model has none (see `SpatialAnchor`). */
45
+ ownerHistoryId: number | null;
46
+ /** The IfcLocalPlacement each markup annotation's own placement chains from
47
+ * (typically the target storey's placement, from `resolveSpatialAnchor`). */
48
+ storeyPlacementId: number;
49
+ /** Target schema; see `SpatialAnchor.schema`. Defaults to IFC4. */
50
+ schema?: SpatialAnchorSchema;
51
+ /** Model length-unit scale (metres per native unit); see `SpatialAnchor.lengthUnitScale`. */
52
+ lengthUnitScale?: number;
53
+ /** Optional seeded randomness for emitted GlobalIds; see `SpatialAnchor.guidRandom`. */
54
+ guidRandom?: RandomSource;
55
+ }
56
+ export interface MeasureMarkupParams {
57
+ start: MarkupPoint2D;
58
+ end: MarkupPoint2D;
59
+ /** Measured distance, metres — preserved verbatim so a reader restores it
60
+ * without recomputing from the (possibly re-projected) polyline. */
61
+ distance: number;
62
+ Name?: string;
63
+ }
64
+ export interface MeasureMarkupResult {
65
+ annotationId: number;
66
+ placementId: number;
67
+ polylineId: number;
68
+ shapeRepId: number;
69
+ productShapeId: number;
70
+ }
71
+ export interface PolygonAreaMarkupParams {
72
+ /** Closed polygon vertices, drawing coords (metres). */
73
+ points: MarkupPoint2D[];
74
+ area: number;
75
+ perimeter: number;
76
+ Name?: string;
77
+ }
78
+ export interface PolygonAreaMarkupResult {
79
+ annotationId: number;
80
+ placementId: number;
81
+ polylineId: number;
82
+ shapeRepId: number;
83
+ productShapeId: number;
84
+ }
85
+ export interface TextMarkupParams {
86
+ /** Top-left corner, drawing coords (metres). */
87
+ position: MarkupPoint2D;
88
+ text: string;
89
+ /** IfcPlanarExtent (SizeInX, SizeInY), metres. Defaults are a nominal box —
90
+ * a future "save into model" action should size this from the on-screen
91
+ * layout, since `fontSize` alone doesn't determine a world-space extent. */
92
+ extent?: {
93
+ sizeX: number;
94
+ sizeY: number;
95
+ };
96
+ boxAlignment?: string;
97
+ Name?: string;
98
+ }
99
+ export interface TextMarkupResult {
100
+ annotationId: number;
101
+ placementId: number;
102
+ textLiteralId: number;
103
+ shapeRepId: number;
104
+ productShapeId: number;
105
+ }
106
+ export interface CloudMarkupParams {
107
+ /** Rectangle corners, drawing coords (metres): [topLeft, bottomRight]. */
108
+ points: readonly [MarkupPoint2D, MarkupPoint2D];
109
+ label: string;
110
+ Name?: string;
111
+ }
112
+ export interface CloudMarkupResult {
113
+ annotationId: number;
114
+ placementId: number;
115
+ polylineId: number;
116
+ fillAreaId: number;
117
+ shapeRepId: number;
118
+ productShapeId: number;
119
+ }
120
+ /** A polyline annotation for one `Measure2DResult`. Distance is preserved as
121
+ * a LENGTH quantity (native length unit, matching every other in-store
122
+ * builder's LENGTH convention — see `space.ts`'s `GrossPerimeter`) rather
123
+ * than recomputed from the two endpoints on read-back. */
124
+ export declare function addMeasureMarkupToStore(editor: StoreEditor, anchor: MarkupAnchor, contextId: number, params: MeasureMarkupParams): MeasureMarkupResult;
125
+ /** A closed polyline annotation for one `PolygonArea2DResult`. Area/perimeter
126
+ * preserved so a reader doesn't recompute a shoelace sum from re-projected
127
+ * points (area is SI m², not unit-scaled — same split `space.ts` uses for
128
+ * AREA vs LENGTH quantities). */
129
+ export declare function addPolygonAreaMarkupToStore(editor: StoreEditor, anchor: MarkupAnchor, contextId: number, params: PolygonAreaMarkupParams): PolygonAreaMarkupResult;
130
+ /** An `IfcTextLiteralWithExtent` annotation for one `TextAnnotation2D`. The
131
+ * literal string is the derived value here — it lives in `Literal` itself,
132
+ * the same field the read-side symbolic parser already consumes, so no
133
+ * separate property-set copy is needed (unlike distance/area/perimeter,
134
+ * which have nowhere else to live). `fontSize`/colors are display-only
135
+ * presentation state, not a derived value this issue asks to preserve, and
136
+ * are left for a future presentation-style follow-up. */
137
+ export declare function addTextMarkupToStore(editor: StoreEditor, anchor: MarkupAnchor, contextId: number, params: TextMarkupParams): TextMarkupResult;
138
+ /**
139
+ * An `IfcAnnotationFillArea` annotation for one `CloudAnnotation2D`.
140
+ *
141
+ * Chose fill-area over a bare polyline because a revision cloud is
142
+ * semantically a bounded REGION (its two stored points are a rectangle's
143
+ * corners, not an open path), and `IfcAnnotationFillArea` is what the read
144
+ * side's own symbolic parser already recognises as a fill (`AnnotationFill2D`
145
+ * in `apps/viewer/src/lib/overlay-parse/symbolic-shapes.ts`) — a bare
146
+ * polyline would render as an outline only, losing the "this is a cloud
147
+ * region" distinction a reader needs to tell it apart from a measurement.
148
+ */
149
+ export declare function addCloudMarkupToStore(editor: StoreEditor, anchor: MarkupAnchor, contextId: number, params: CloudMarkupParams): CloudMarkupResult;
150
+ /** Batch input mirroring the four markup arrays on `Drawing2DState`
151
+ * (`apps/viewer/src/store/slices/drawing2DSlice.ts`) structurally, without
152
+ * importing that module. `id` fields are accepted and ignored here — the
153
+ * overlay expressId IS the new stable identity; carrying the old
154
+ * browser-local id forward is a read-side/UI concern. */
155
+ export interface DrawingMarkupBatchInput {
156
+ measure2DResults?: Array<{
157
+ id: string;
158
+ } & MeasureMarkupParams>;
159
+ polygonArea2DResults?: Array<{
160
+ id: string;
161
+ } & PolygonAreaMarkupParams>;
162
+ textAnnotations2D?: Array<{
163
+ id: string;
164
+ } & TextMarkupParams>;
165
+ cloudAnnotations2D?: Array<{
166
+ id: string;
167
+ } & CloudMarkupParams>;
168
+ }
169
+ export interface DrawingMarkupBatchResult {
170
+ subContextId: number;
171
+ measures: MeasureMarkupResult[];
172
+ polygons: PolygonAreaMarkupResult[];
173
+ texts: TextMarkupResult[];
174
+ clouds: CloudMarkupResult[];
175
+ }
176
+ /**
177
+ * Translate a full `Drawing2DState` markup snapshot into the store overlay:
178
+ * one shared `Annotation` `IfcGeometricRepresentationSubContext` (created
179
+ * fresh under `rootContextId`, the model's root 3D
180
+ * `IfcGeometricRepresentationContext`), then one `IfcAnnotation` per markup
181
+ * item, tagged per {@link DRAWING_MARKUP_OBJECTTYPE}.
182
+ */
183
+ export declare function addDrawingMarkupToStore(editor: StoreEditor, anchor: MarkupAnchor, rootContextId: number, input: DrawingMarkupBatchInput, targetView?: 'PLAN_VIEW' | 'SECTION_VIEW'): DrawingMarkupBatchResult;
184
+ //# sourceMappingURL=drawing-markup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawing-markup.d.ts","sourceRoot":"","sources":["../../src/in-store/drawing-markup.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAWvD,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAElC,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,wFAAwF;IACxF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;kFAC8E;IAC9E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,6FAA6F;IAC7F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wFAAwF;IACxF,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,aAAa,CAAC;IACrB,GAAG,EAAE,aAAa,CAAC;IACnB;yEACqE;IACrE,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,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AuB,EAAE,CAAC;IACpC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,uBAAuB,EAC9B,UAAU,GAAE,WAAW,GAAG,cAA4B,GACrD,wBAAwB,CAO1B"}
@@ -0,0 +1,196 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Translate 2D drawing markup (issue #4153's "save into the model" option)
6
+ * into IFC entities via the additive `StoreEditor` overlay — modelled on
7
+ * `space.ts`'s `addSpaceToStore`.
8
+ *
9
+ * WRITE SIDE ONLY. This module has no UI wiring and does not import or edit
10
+ * `apps/viewer/src/store/slices/drawing2DSlice.ts` — a "save into model"
11
+ * action, and the read-side translator that recognises
12
+ * `DRAWING_MARKUP_OBJECTTYPE` and rehydrates `Drawing2DState`, are both
13
+ * future follow-ups. The param shapes below (`MarkupPoint2D`,
14
+ * `MeasureMarkupParams`, …) intentionally mirror `Drawing2DState`'s arrays
15
+ * structurally without importing `apps/viewer` — a published package
16
+ * (`@ifc-lite/create`) cannot depend on the app.
17
+ *
18
+ * Geometry frame: every point is treated as already resolved into the
19
+ * target `IfcGeometricRepresentationSubContext`'s 2D plane, in METRES —
20
+ * the same "drawing units (typically meters)" `Drawing2DState`'s own
21
+ * comments describe. Reprojecting a plan/section drawing's local 2D
22
+ * coordinates into that frame (accounting for the `SectionConfig` cut
23
+ * plane) is a UI/wiring concern for the future "save into model" action,
24
+ * not this translation layer.
25
+ *
26
+ * Additive by construction, same guarantee `StoreEditor.addEntity` documents:
27
+ * every call only APPENDS overlay entities (new `IfcAnnotation` +
28
+ * geometry + property/quantity sets); nothing existing is read, mutated,
29
+ * or renumbered.
30
+ */
31
+ import { generateIfcGuid } from '@ifc-lite/encoding';
32
+ import { toNativeLength } from './anchor.js';
33
+ import { emitLocalPlacement, ownerHistoryRef } from './_emit-helpers.js';
34
+ import { emitMarkupPolyline, emitMarkupPoint2DPlacement, emitMarkupSubContext, emitMarkupRepresentation, } from './drawing-markup-geometry.js';
35
+ import { DRAWING_MARKUP_OBJECTTYPE, DRAWING_MARKUP_PSET_NAME, DRAWING_MARKUP_QSET_NAME } from './drawing-markup-tags.js';
36
+ export { DRAWING_MARKUP_OBJECTTYPE, DRAWING_MARKUP_PSET_NAME, DRAWING_MARKUP_QSET_NAME, } from './drawing-markup-tags.js';
37
+ /**
38
+ * A drawing-space coordinate may legitimately be negative or zero — the
39
+ * caller's own drawing origin, not this module's to constrain — so this only
40
+ * rejects NaN/Infinity, never a sign check. Same split `spatial-zone.ts`'s
41
+ * `validateZone` uses for its Footprint points, the closest analog: without
42
+ * it, a NaN/Infinity coordinate reaches `IfcCartesianPoint` as the literal
43
+ * `$` inside a mandatory-REAL attribute list — schema-invalid STEP written
44
+ * with no error.
45
+ */
46
+ function assertFinitePoint(functionName, label, p) {
47
+ if (!Number.isFinite(p.x) || !Number.isFinite(p.y)) {
48
+ throw new Error(`${functionName}: ${label} needs a finite point`);
49
+ }
50
+ }
51
+ /**
52
+ * Distance/area/perimeter/extent are derived measurements: never negative,
53
+ * but legitimately zero (a degenerate measurement, e.g. a zero-length
54
+ * measure). So this rejects NaN/Infinity and negative values, not `<= 0`
55
+ * like `_emit-helpers.ts`'s `assertPositiveFinite` (which guards true
56
+ * dimensions — Width, Height — that can never be zero). Without this, a NaN
57
+ * silently becomes a zeroed quantity value on write (`toNativeLength(NaN)`
58
+ * multiplies through to `NaN`, which the STEP writer would still need to
59
+ * catch) rather than failing loudly here.
60
+ */
61
+ function assertFiniteNonNegative(functionName, label, value) {
62
+ if (!Number.isFinite(value) || value < 0) {
63
+ throw new Error(`${functionName}: ${label} must be finite and non-negative`);
64
+ }
65
+ }
66
+ /** IfcAnnotation attribute order: GlobalId, OwnerHistory, Name, Description,
67
+ * ObjectType, ObjectPlacement, Representation — same 7-slot shape across
68
+ * IFC2X3/IFC4/IFC4X3 (schema-registry.ts `IfcAnnotation.allAttributes`). */
69
+ function emitAnnotation(editor, anchor, name, objectType, placementId, productShapeId) {
70
+ return editor.addEntity('IfcAnnotation', [
71
+ generateIfcGuid(anchor.guidRandom),
72
+ ownerHistoryRef(anchor.ownerHistoryId),
73
+ name,
74
+ null,
75
+ objectType,
76
+ `#${placementId}`,
77
+ `#${productShapeId}`,
78
+ ]).expressId;
79
+ }
80
+ /** A polyline annotation for one `Measure2DResult`. Distance is preserved as
81
+ * a LENGTH quantity (native length unit, matching every other in-store
82
+ * builder's LENGTH convention — see `space.ts`'s `GrossPerimeter`) rather
83
+ * than recomputed from the two endpoints on read-back. */
84
+ export function addMeasureMarkupToStore(editor, anchor, contextId, params) {
85
+ assertFinitePoint('addMeasureMarkupToStore', 'start', params.start);
86
+ assertFinitePoint('addMeasureMarkupToStore', 'end', params.end);
87
+ assertFiniteNonNegative('addMeasureMarkupToStore', 'distance', params.distance);
88
+ const n = (metres) => toNativeLength(anchor, metres);
89
+ const placementId = emitLocalPlacement(editor, anchor.storeyPlacementId, [0, 0, 0]);
90
+ const polylineId = emitMarkupPolyline(editor, [[n(params.start.x), n(params.start.y)], [n(params.end.x), n(params.end.y)]], false);
91
+ const { shapeRepId, productShapeId } = emitMarkupRepresentation(editor, contextId, 'Curve2D', polylineId);
92
+ const annotationId = emitAnnotation(editor, anchor, params.Name ?? 'Measurement', DRAWING_MARKUP_OBJECTTYPE.MEASURE, placementId, productShapeId);
93
+ editor.addQuantitySet(annotationId, DRAWING_MARKUP_QSET_NAME, [
94
+ { name: 'Distance', value: n(params.distance), quantityType: 'LENGTH' },
95
+ ]);
96
+ return { annotationId, placementId, polylineId, shapeRepId, productShapeId };
97
+ }
98
+ /** A closed polyline annotation for one `PolygonArea2DResult`. Area/perimeter
99
+ * preserved so a reader doesn't recompute a shoelace sum from re-projected
100
+ * points (area is SI m², not unit-scaled — same split `space.ts` uses for
101
+ * AREA vs LENGTH quantities). */
102
+ export function addPolygonAreaMarkupToStore(editor, anchor, contextId, params) {
103
+ if (params.points.length < 3) {
104
+ throw new Error('addPolygonAreaMarkupToStore: needs at least 3 points');
105
+ }
106
+ for (const [i, point] of params.points.entries()) {
107
+ assertFinitePoint('addPolygonAreaMarkupToStore', `points[${i}]`, point);
108
+ }
109
+ assertFiniteNonNegative('addPolygonAreaMarkupToStore', 'area', params.area);
110
+ assertFiniteNonNegative('addPolygonAreaMarkupToStore', 'perimeter', params.perimeter);
111
+ const n = (metres) => toNativeLength(anchor, metres);
112
+ const placementId = emitLocalPlacement(editor, anchor.storeyPlacementId, [0, 0, 0]);
113
+ const polylineId = emitMarkupPolyline(editor, params.points.map((p) => [n(p.x), n(p.y)]), true);
114
+ const { shapeRepId, productShapeId } = emitMarkupRepresentation(editor, contextId, 'Curve2D', polylineId);
115
+ const annotationId = emitAnnotation(editor, anchor, params.Name ?? 'Area', DRAWING_MARKUP_OBJECTTYPE.POLYGON_AREA, placementId, productShapeId);
116
+ editor.addQuantitySet(annotationId, DRAWING_MARKUP_QSET_NAME, [
117
+ { name: 'Area', value: params.area, quantityType: 'AREA' },
118
+ { name: 'Perimeter', value: n(params.perimeter), quantityType: 'LENGTH' },
119
+ ]);
120
+ return { annotationId, placementId, polylineId, shapeRepId, productShapeId };
121
+ }
122
+ /** An `IfcTextLiteralWithExtent` annotation for one `TextAnnotation2D`. The
123
+ * literal string is the derived value here — it lives in `Literal` itself,
124
+ * the same field the read-side symbolic parser already consumes, so no
125
+ * separate property-set copy is needed (unlike distance/area/perimeter,
126
+ * which have nowhere else to live). `fontSize`/colors are display-only
127
+ * presentation state, not a derived value this issue asks to preserve, and
128
+ * are left for a future presentation-style follow-up. */
129
+ export function addTextMarkupToStore(editor, anchor, contextId, params) {
130
+ assertFinitePoint('addTextMarkupToStore', 'position', params.position);
131
+ const extent = params.extent ?? { sizeX: 1, sizeY: 0.25 };
132
+ assertFiniteNonNegative('addTextMarkupToStore', 'extent.sizeX', extent.sizeX);
133
+ assertFiniteNonNegative('addTextMarkupToStore', 'extent.sizeY', extent.sizeY);
134
+ const n = (metres) => toNativeLength(anchor, metres);
135
+ const placementId = emitLocalPlacement(editor, anchor.storeyPlacementId, [0, 0, 0]);
136
+ const textPlacementId = emitMarkupPoint2DPlacement(editor, [n(params.position.x), n(params.position.y)]);
137
+ const extentId = editor.addEntity('IfcPlanarExtent', [n(extent.sizeX), n(extent.sizeY)]).expressId;
138
+ const textLiteralId = editor.addEntity('IfcTextLiteralWithExtent', [
139
+ params.text,
140
+ `#${textPlacementId}`,
141
+ '.RIGHT.',
142
+ `#${extentId}`,
143
+ params.boxAlignment ?? 'top-left',
144
+ ]).expressId;
145
+ const { shapeRepId, productShapeId } = emitMarkupRepresentation(editor, contextId, 'Annotation2D', textLiteralId);
146
+ const annotationId = emitAnnotation(editor, anchor, params.Name ?? 'Note', DRAWING_MARKUP_OBJECTTYPE.TEXT, placementId, productShapeId);
147
+ return { annotationId, placementId, textLiteralId, shapeRepId, productShapeId };
148
+ }
149
+ /**
150
+ * An `IfcAnnotationFillArea` annotation for one `CloudAnnotation2D`.
151
+ *
152
+ * Chose fill-area over a bare polyline because a revision cloud is
153
+ * semantically a bounded REGION (its two stored points are a rectangle's
154
+ * corners, not an open path), and `IfcAnnotationFillArea` is what the read
155
+ * side's own symbolic parser already recognises as a fill (`AnnotationFill2D`
156
+ * in `apps/viewer/src/lib/overlay-parse/symbolic-shapes.ts`) — a bare
157
+ * polyline would render as an outline only, losing the "this is a cloud
158
+ * region" distinction a reader needs to tell it apart from a measurement.
159
+ */
160
+ export function addCloudMarkupToStore(editor, anchor, contextId, params) {
161
+ const [topLeft, bottomRight] = params.points;
162
+ assertFinitePoint('addCloudMarkupToStore', 'points[0]', topLeft);
163
+ assertFinitePoint('addCloudMarkupToStore', 'points[1]', bottomRight);
164
+ const n = (metres) => toNativeLength(anchor, metres);
165
+ const corners = [
166
+ [n(topLeft.x), n(topLeft.y)],
167
+ [n(bottomRight.x), n(topLeft.y)],
168
+ [n(bottomRight.x), n(bottomRight.y)],
169
+ [n(topLeft.x), n(bottomRight.y)],
170
+ ];
171
+ const placementId = emitLocalPlacement(editor, anchor.storeyPlacementId, [0, 0, 0]);
172
+ const polylineId = emitMarkupPolyline(editor, corners, true);
173
+ const fillAreaId = editor.addEntity('IfcAnnotationFillArea', [`#${polylineId}`, null]).expressId;
174
+ const { shapeRepId, productShapeId } = emitMarkupRepresentation(editor, contextId, 'Annotation2D', fillAreaId);
175
+ const annotationId = emitAnnotation(editor, anchor, params.Name ?? 'Cloud', DRAWING_MARKUP_OBJECTTYPE.CLOUD, placementId, productShapeId);
176
+ editor.addPropertySet(annotationId, DRAWING_MARKUP_PSET_NAME, [
177
+ { name: 'Label', value: params.label, type: 'TEXT' },
178
+ ]);
179
+ return { annotationId, placementId, polylineId, fillAreaId, shapeRepId, productShapeId };
180
+ }
181
+ /**
182
+ * Translate a full `Drawing2DState` markup snapshot into the store overlay:
183
+ * one shared `Annotation` `IfcGeometricRepresentationSubContext` (created
184
+ * fresh under `rootContextId`, the model's root 3D
185
+ * `IfcGeometricRepresentationContext`), then one `IfcAnnotation` per markup
186
+ * item, tagged per {@link DRAWING_MARKUP_OBJECTTYPE}.
187
+ */
188
+ export function addDrawingMarkupToStore(editor, anchor, rootContextId, input, targetView = 'PLAN_VIEW') {
189
+ const subContextId = emitMarkupSubContext(editor, rootContextId, targetView);
190
+ const measures = (input.measure2DResults ?? []).map((m) => addMeasureMarkupToStore(editor, anchor, subContextId, m));
191
+ const polygons = (input.polygonArea2DResults ?? []).map((p) => addPolygonAreaMarkupToStore(editor, anchor, subContextId, p));
192
+ const texts = (input.textAnnotations2D ?? []).map((t) => addTextMarkupToStore(editor, anchor, subContextId, t));
193
+ const clouds = (input.cloudAnnotations2D ?? []).map((c) => addCloudMarkupToStore(editor, anchor, subContextId, c));
194
+ return { subContextId, measures, polygons, texts, clouds };
195
+ }
196
+ //# sourceMappingURL=drawing-markup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawing-markup.js","sourceRoot":"","sources":["../../src/in-store/drawing-markup.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAGxE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzH,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GAEzB,MAAM,0BAA0B,CAAC;AAiGlC;;;;;;;;GAQG;AACH,SAAS,iBAAiB,CAAC,YAAoB,EAAE,KAAa,EAAE,CAAgB;IAC9E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,GAAG,YAAY,KAAK,KAAK,uBAAuB,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,uBAAuB,CAAC,YAAoB,EAAE,KAAa,EAAE,KAAa;IACjF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,GAAG,YAAY,KAAK,KAAK,kCAAkC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