@ifc-lite/create 4.0.0 → 5.1.1

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 (336) hide show
  1. package/README.md +34 -0
  2. package/dist/in-store/align-boxes.d.ts +38 -0
  3. package/dist/in-store/align-boxes.d.ts.map +1 -0
  4. package/dist/in-store/align-boxes.js +97 -0
  5. package/dist/in-store/align-boxes.js.map +1 -0
  6. package/dist/in-store/anchor.d.ts.map +1 -1
  7. package/dist/in-store/anchor.js +13 -2
  8. package/dist/in-store/anchor.js.map +1 -1
  9. package/dist/in-store/beam.d.ts.map +1 -1
  10. package/dist/in-store/beam.js +3 -10
  11. package/dist/in-store/beam.js.map +1 -1
  12. package/dist/in-store/copy-array.d.ts +17 -0
  13. package/dist/in-store/copy-array.d.ts.map +1 -0
  14. package/dist/in-store/copy-array.js +47 -0
  15. package/dist/in-store/copy-array.js.map +1 -0
  16. package/dist/in-store/copy-batch.d.ts +27 -0
  17. package/dist/in-store/copy-batch.d.ts.map +1 -0
  18. package/dist/in-store/copy-batch.js +101 -0
  19. package/dist/in-store/copy-batch.js.map +1 -0
  20. package/dist/in-store/copy-dependent-walk.d.ts +27 -0
  21. package/dist/in-store/copy-dependent-walk.d.ts.map +1 -0
  22. package/dist/in-store/copy-dependent-walk.js +61 -0
  23. package/dist/in-store/copy-dependent-walk.js.map +1 -0
  24. package/dist/in-store/copy-frame.d.ts +4 -3
  25. package/dist/in-store/copy-frame.d.ts.map +1 -1
  26. package/dist/in-store/copy-frame.js +14 -1
  27. package/dist/in-store/copy-frame.js.map +1 -1
  28. package/dist/in-store/copy-product.d.ts +0 -20
  29. package/dist/in-store/copy-product.d.ts.map +1 -1
  30. package/dist/in-store/copy-product.js +35 -35
  31. package/dist/in-store/copy-product.js.map +1 -1
  32. package/dist/in-store/duplicate.d.ts +8 -0
  33. package/dist/in-store/duplicate.d.ts.map +1 -1
  34. package/dist/in-store/duplicate.js +8 -1
  35. package/dist/in-store/duplicate.js.map +1 -1
  36. package/dist/in-store/edit/effective-mutation-view.d.ts +6 -0
  37. package/dist/in-store/edit/effective-mutation-view.d.ts.map +1 -0
  38. package/dist/in-store/edit/effective-mutation-view.js +45 -0
  39. package/dist/in-store/edit/effective-mutation-view.js.map +1 -0
  40. package/dist/in-store/edit/effective-storey.d.ts +13 -0
  41. package/dist/in-store/edit/effective-storey.d.ts.map +1 -0
  42. package/dist/in-store/edit/effective-storey.js +36 -0
  43. package/dist/in-store/edit/effective-storey.js.map +1 -0
  44. package/dist/in-store/edit/effective-storeys.d.ts +9 -0
  45. package/dist/in-store/edit/effective-storeys.d.ts.map +1 -0
  46. package/dist/in-store/edit/effective-storeys.js +16 -0
  47. package/dist/in-store/edit/effective-storeys.js.map +1 -0
  48. package/dist/in-store/edit/hosted-opening-refit.d.ts +29 -0
  49. package/dist/in-store/edit/hosted-opening-refit.d.ts.map +1 -0
  50. package/dist/in-store/edit/hosted-opening-refit.js +168 -0
  51. package/dist/in-store/edit/hosted-opening-refit.js.map +1 -0
  52. package/dist/in-store/edit/length-unit-scale.d.ts +24 -0
  53. package/dist/in-store/edit/length-unit-scale.d.ts.map +1 -0
  54. package/dist/in-store/edit/length-unit-scale.js +37 -0
  55. package/dist/in-store/edit/length-unit-scale.js.map +1 -0
  56. package/dist/in-store/edit/linear-element-edit.d.ts +131 -0
  57. package/dist/in-store/edit/linear-element-edit.d.ts.map +1 -0
  58. package/dist/in-store/edit/linear-element-edit.js +259 -0
  59. package/dist/in-store/edit/linear-element-edit.js.map +1 -0
  60. package/dist/in-store/edit/metadata-clone-effective.d.ts +5 -0
  61. package/dist/in-store/edit/metadata-clone-effective.d.ts.map +1 -0
  62. package/dist/in-store/edit/metadata-clone-effective.js +47 -0
  63. package/dist/in-store/edit/metadata-clone-effective.js.map +1 -0
  64. package/dist/in-store/edit/metadata-clone.d.ts +40 -0
  65. package/dist/in-store/edit/metadata-clone.d.ts.map +1 -0
  66. package/dist/in-store/edit/metadata-clone.js +142 -0
  67. package/dist/in-store/edit/metadata-clone.js.map +1 -0
  68. package/dist/in-store/edit/placement-core.d.ts +140 -0
  69. package/dist/in-store/edit/placement-core.d.ts.map +1 -0
  70. package/dist/in-store/edit/placement-core.js +317 -0
  71. package/dist/in-store/edit/placement-core.js.map +1 -0
  72. package/dist/in-store/edit/polygon-clip.d.ts +58 -0
  73. package/dist/in-store/edit/polygon-clip.d.ts.map +1 -0
  74. package/dist/in-store/edit/polygon-clip.js +153 -0
  75. package/dist/in-store/edit/polygon-clip.js.map +1 -0
  76. package/dist/in-store/edit/read-profile.d.ts +6 -0
  77. package/dist/in-store/edit/read-profile.d.ts.map +1 -0
  78. package/dist/in-store/edit/read-profile.js +95 -0
  79. package/dist/in-store/edit/read-profile.js.map +1 -0
  80. package/dist/in-store/edit/slab-edit-frame.d.ts +40 -0
  81. package/dist/in-store/edit/slab-edit-frame.d.ts.map +1 -0
  82. package/dist/in-store/edit/slab-edit-frame.js +146 -0
  83. package/dist/in-store/edit/slab-edit-frame.js.map +1 -0
  84. package/dist/in-store/edit/slab-edit.d.ts +112 -0
  85. package/dist/in-store/edit/slab-edit.d.ts.map +1 -0
  86. package/dist/in-store/edit/slab-edit.js +275 -0
  87. package/dist/in-store/edit/slab-edit.js.map +1 -0
  88. package/dist/in-store/edit/slab-opening-carry.d.ts +10 -0
  89. package/dist/in-store/edit/slab-opening-carry.d.ts.map +1 -0
  90. package/dist/in-store/edit/slab-opening-carry.js +65 -0
  91. package/dist/in-store/edit/slab-opening-carry.js.map +1 -0
  92. package/dist/in-store/edit/split-guid.d.ts +29 -0
  93. package/dist/in-store/edit/split-guid.d.ts.map +1 -0
  94. package/dist/in-store/edit/split-guid.js +64 -0
  95. package/dist/in-store/edit/split-guid.js.map +1 -0
  96. package/dist/in-store/edit/split-target.d.ts +90 -0
  97. package/dist/in-store/edit/split-target.d.ts.map +1 -0
  98. package/dist/in-store/edit/split-target.js +116 -0
  99. package/dist/in-store/edit/split-target.js.map +1 -0
  100. package/dist/in-store/edit/target.d.ts +8 -0
  101. package/dist/in-store/edit/target.d.ts.map +1 -0
  102. package/dist/in-store/edit/target.js +5 -0
  103. package/dist/in-store/edit/target.js.map +1 -0
  104. package/dist/in-store/edit/trim-extend-geometry.d.ts +99 -0
  105. package/dist/in-store/edit/trim-extend-geometry.d.ts.map +1 -0
  106. package/dist/in-store/edit/trim-extend-geometry.js +105 -0
  107. package/dist/in-store/edit/trim-extend-geometry.js.map +1 -0
  108. package/dist/in-store/edit/wall-axis-edit.d.ts +16 -0
  109. package/dist/in-store/edit/wall-axis-edit.d.ts.map +1 -0
  110. package/dist/in-store/edit/wall-axis-edit.js +40 -0
  111. package/dist/in-store/edit/wall-axis-edit.js.map +1 -0
  112. package/dist/in-store/edit/wall-edit.d.ts +157 -0
  113. package/dist/in-store/edit/wall-edit.d.ts.map +1 -0
  114. package/dist/in-store/edit/wall-edit.js +276 -0
  115. package/dist/in-store/edit/wall-edit.js.map +1 -0
  116. package/dist/in-store/edit/wall-hosted-cuts.d.ts +35 -0
  117. package/dist/in-store/edit/wall-hosted-cuts.d.ts.map +1 -0
  118. package/dist/in-store/edit/wall-hosted-cuts.js +27 -0
  119. package/dist/in-store/edit/wall-hosted-cuts.js.map +1 -0
  120. package/dist/in-store/edit/wall-opening-reassign.d.ts +18 -0
  121. package/dist/in-store/edit/wall-opening-reassign.d.ts.map +1 -0
  122. package/dist/in-store/edit/wall-opening-reassign.js +50 -0
  123. package/dist/in-store/edit/wall-opening-reassign.js.map +1 -0
  124. package/dist/in-store/element-align.d.ts +13 -0
  125. package/dist/in-store/element-align.d.ts.map +1 -0
  126. package/dist/in-store/element-align.js +90 -0
  127. package/dist/in-store/element-align.js.map +1 -0
  128. package/dist/in-store/element-replacement.d.ts +26 -0
  129. package/dist/in-store/element-replacement.d.ts.map +1 -0
  130. package/dist/in-store/element-replacement.js +68 -0
  131. package/dist/in-store/element-replacement.js.map +1 -0
  132. package/dist/in-store/element-size-edit.d.ts +40 -0
  133. package/dist/in-store/element-size-edit.d.ts.map +1 -0
  134. package/dist/in-store/element-size-edit.js +103 -0
  135. package/dist/in-store/element-size-edit.js.map +1 -0
  136. package/dist/in-store/element-split-axis.d.ts +6 -0
  137. package/dist/in-store/element-split-axis.d.ts.map +1 -0
  138. package/dist/in-store/element-split-axis.js +87 -0
  139. package/dist/in-store/element-split-axis.js.map +1 -0
  140. package/dist/in-store/element-split-joined.d.ts +13 -0
  141. package/dist/in-store/element-split-joined.d.ts.map +1 -0
  142. package/dist/in-store/element-split-joined.js +74 -0
  143. package/dist/in-store/element-split-joined.js.map +1 -0
  144. package/dist/in-store/element-split-placement.d.ts +19 -0
  145. package/dist/in-store/element-split-placement.d.ts.map +1 -0
  146. package/dist/in-store/element-split-placement.js +48 -0
  147. package/dist/in-store/element-split-placement.js.map +1 -0
  148. package/dist/in-store/element-split-slab.d.ts +19 -0
  149. package/dist/in-store/element-split-slab.d.ts.map +1 -0
  150. package/dist/in-store/element-split-slab.js +86 -0
  151. package/dist/in-store/element-split-slab.js.map +1 -0
  152. package/dist/in-store/element-split.d.ts +49 -0
  153. package/dist/in-store/element-split.d.ts.map +1 -0
  154. package/dist/in-store/element-split.js +52 -0
  155. package/dist/in-store/element-split.js.map +1 -0
  156. package/dist/in-store/element-transform-edit.d.ts +33 -0
  157. package/dist/in-store/element-transform-edit.d.ts.map +1 -0
  158. package/dist/in-store/element-transform-edit.js +97 -0
  159. package/dist/in-store/element-transform-edit.js.map +1 -0
  160. package/dist/in-store/element-transform-frames.d.ts +45 -0
  161. package/dist/in-store/element-transform-frames.d.ts.map +1 -0
  162. package/dist/in-store/element-transform-frames.js +121 -0
  163. package/dist/in-store/element-transform-frames.js.map +1 -0
  164. package/dist/in-store/element-transform-joins.d.ts +4 -0
  165. package/dist/in-store/element-transform-joins.d.ts.map +1 -0
  166. package/dist/in-store/element-transform-joins.js +62 -0
  167. package/dist/in-store/element-transform-joins.js.map +1 -0
  168. package/dist/in-store/element-transform-plan.d.ts +38 -0
  169. package/dist/in-store/element-transform-plan.d.ts.map +1 -0
  170. package/dist/in-store/element-transform-plan.js +115 -0
  171. package/dist/in-store/element-transform-plan.js.map +1 -0
  172. package/dist/in-store/element-trim-extend.d.ts +25 -0
  173. package/dist/in-store/element-trim-extend.d.ts.map +1 -0
  174. package/dist/in-store/element-trim-extend.js +97 -0
  175. package/dist/in-store/element-trim-extend.js.map +1 -0
  176. package/dist/in-store/extract-grids.d.ts +7 -17
  177. package/dist/in-store/extract-grids.d.ts.map +1 -1
  178. package/dist/in-store/extract-grids.js +11 -2
  179. package/dist/in-store/extract-grids.js.map +1 -1
  180. package/dist/in-store/grid-column.d.ts +23 -0
  181. package/dist/in-store/grid-column.d.ts.map +1 -0
  182. package/dist/in-store/grid-column.js +73 -0
  183. package/dist/in-store/grid-column.js.map +1 -0
  184. package/dist/in-store/grid-intersection-read.d.ts +10 -0
  185. package/dist/in-store/grid-intersection-read.d.ts.map +1 -0
  186. package/dist/in-store/grid-intersection-read.js +45 -0
  187. package/dist/in-store/grid-intersection-read.js.map +1 -0
  188. package/dist/in-store/grid.d.ts +7 -1
  189. package/dist/in-store/grid.d.ts.map +1 -1
  190. package/dist/in-store/grid.js +12 -2
  191. package/dist/in-store/grid.js.map +1 -1
  192. package/dist/in-store/group-evidence.d.ts +49 -0
  193. package/dist/in-store/group-evidence.d.ts.map +1 -0
  194. package/dist/in-store/group-evidence.js +111 -0
  195. package/dist/in-store/group-evidence.js.map +1 -0
  196. package/dist/in-store/group-graph.d.ts +51 -0
  197. package/dist/in-store/group-graph.d.ts.map +1 -0
  198. package/dist/in-store/group-graph.js +207 -0
  199. package/dist/in-store/group-graph.js.map +1 -0
  200. package/dist/in-store/group.d.ts +34 -0
  201. package/dist/in-store/group.d.ts.map +1 -0
  202. package/dist/in-store/group.js +181 -0
  203. package/dist/in-store/group.js.map +1 -0
  204. package/dist/in-store/host-geometry-frame.d.ts +5 -1
  205. package/dist/in-store/host-geometry-frame.d.ts.map +1 -1
  206. package/dist/in-store/host-geometry-frame.js +58 -10
  207. package/dist/in-store/host-geometry-frame.js.map +1 -1
  208. package/dist/in-store/index.d.ts +7 -0
  209. package/dist/in-store/index.d.ts.map +1 -1
  210. package/dist/in-store/index.js +7 -0
  211. package/dist/in-store/index.js.map +1 -1
  212. package/dist/in-store/linear-profile-frame.d.ts +10 -0
  213. package/dist/in-store/linear-profile-frame.d.ts.map +1 -0
  214. package/dist/in-store/linear-profile-frame.js +17 -0
  215. package/dist/in-store/linear-profile-frame.js.map +1 -0
  216. package/dist/in-store/material.d.ts.map +1 -1
  217. package/dist/in-store/material.js +17 -6
  218. package/dist/in-store/material.js.map +1 -1
  219. package/dist/in-store/member.d.ts.map +1 -1
  220. package/dist/in-store/member.js +3 -7
  221. package/dist/in-store/member.js.map +1 -1
  222. package/dist/in-store/ordinary-element.d.ts +47 -0
  223. package/dist/in-store/ordinary-element.d.ts.map +1 -0
  224. package/dist/in-store/ordinary-element.js +38 -0
  225. package/dist/in-store/ordinary-element.js.map +1 -0
  226. package/dist/in-store/placement-frame.d.ts +5 -17
  227. package/dist/in-store/placement-frame.d.ts.map +1 -1
  228. package/dist/in-store/placement-frame.js +59 -43
  229. package/dist/in-store/placement-frame.js.map +1 -1
  230. package/dist/in-store/resolve-anchor.d.ts +3 -2
  231. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  232. package/dist/in-store/resolve-anchor.js +7 -5
  233. package/dist/in-store/resolve-anchor.js.map +1 -1
  234. package/dist/in-store/resolve-relations.d.ts +3 -1
  235. package/dist/in-store/resolve-relations.d.ts.map +1 -1
  236. package/dist/in-store/resolve-relations.js +8 -3
  237. package/dist/in-store/resolve-relations.js.map +1 -1
  238. package/dist/in-store/resolve-source.d.ts.map +1 -1
  239. package/dist/in-store/resolve-source.js +10 -3
  240. package/dist/in-store/resolve-source.js.map +1 -1
  241. package/dist/in-store/room-candidates.d.ts +58 -0
  242. package/dist/in-store/room-candidates.d.ts.map +1 -0
  243. package/dist/in-store/room-candidates.js +135 -0
  244. package/dist/in-store/room-candidates.js.map +1 -0
  245. package/dist/in-store/room-creation-plan.d.ts +16 -0
  246. package/dist/in-store/room-creation-plan.d.ts.map +1 -0
  247. package/dist/in-store/room-creation-plan.js +28 -0
  248. package/dist/in-store/room-creation-plan.js.map +1 -0
  249. package/dist/in-store/room-floor-height.d.ts +24 -0
  250. package/dist/in-store/room-floor-height.d.ts.map +1 -0
  251. package/dist/in-store/room-floor-height.js +32 -0
  252. package/dist/in-store/room-floor-height.js.map +1 -0
  253. package/dist/in-store/room-footprint-native.d.ts +19 -0
  254. package/dist/in-store/room-footprint-native.d.ts.map +1 -0
  255. package/dist/in-store/room-footprint-native.js +117 -0
  256. package/dist/in-store/room-footprint-native.js.map +1 -0
  257. package/dist/in-store/room-layout-cache.d.ts +23 -0
  258. package/dist/in-store/room-layout-cache.d.ts.map +1 -0
  259. package/dist/in-store/room-layout-cache.js +84 -0
  260. package/dist/in-store/room-layout-cache.js.map +1 -0
  261. package/dist/in-store/room-layout-core.d.ts +68 -0
  262. package/dist/in-store/room-layout-core.d.ts.map +1 -0
  263. package/dist/in-store/room-layout-core.js +153 -0
  264. package/dist/in-store/room-layout-core.js.map +1 -0
  265. package/dist/in-store/room-population.d.ts +5 -0
  266. package/dist/in-store/room-population.d.ts.map +1 -0
  267. package/dist/in-store/room-population.js +28 -0
  268. package/dist/in-store/room-population.js.map +1 -0
  269. package/dist/in-store/room-space-meshes.d.ts +15 -0
  270. package/dist/in-store/room-space-meshes.d.ts.map +1 -0
  271. package/dist/in-store/room-space-meshes.js +38 -0
  272. package/dist/in-store/room-space-meshes.js.map +1 -0
  273. package/dist/in-store/room-store.d.ts +55 -0
  274. package/dist/in-store/room-store.d.ts.map +1 -0
  275. package/dist/in-store/room-store.js +173 -0
  276. package/dist/in-store/room-store.js.map +1 -0
  277. package/dist/in-store/room-storey-elevation.d.ts +5 -0
  278. package/dist/in-store/room-storey-elevation.d.ts.map +1 -0
  279. package/dist/in-store/room-storey-elevation.js +42 -0
  280. package/dist/in-store/room-storey-elevation.js.map +1 -0
  281. package/dist/in-store/room-storey-frame.d.ts +47 -0
  282. package/dist/in-store/room-storey-frame.d.ts.map +1 -0
  283. package/dist/in-store/room-storey-frame.js +48 -0
  284. package/dist/in-store/room-storey-frame.js.map +1 -0
  285. package/dist/in-store/room-wall-rects.d.ts +117 -0
  286. package/dist/in-store/room-wall-rects.d.ts.map +1 -0
  287. package/dist/in-store/room-wall-rects.js +157 -0
  288. package/dist/in-store/room-wall-rects.js.map +1 -0
  289. package/dist/in-store/schema-attributes.d.ts +3 -3
  290. package/dist/in-store/schema-attributes.d.ts.map +1 -1
  291. package/dist/in-store/schema-attributes.js +9 -7
  292. package/dist/in-store/schema-attributes.js.map +1 -1
  293. package/dist/in-store/slab.d.ts.map +1 -1
  294. package/dist/in-store/slab.js +1 -4
  295. package/dist/in-store/slab.js.map +1 -1
  296. package/dist/in-store/stair-removal.d.ts +17 -0
  297. package/dist/in-store/stair-removal.d.ts.map +1 -0
  298. package/dist/in-store/stair-removal.js +134 -0
  299. package/dist/in-store/stair-removal.js.map +1 -0
  300. package/dist/in-store/storey-plan-frame.d.ts +2 -1
  301. package/dist/in-store/storey-plan-frame.d.ts.map +1 -1
  302. package/dist/in-store/storey-plan-frame.js +20 -11
  303. package/dist/in-store/storey-plan-frame.js.map +1 -1
  304. package/dist/in-store/storey-reassignment-plan.d.ts +53 -0
  305. package/dist/in-store/storey-reassignment-plan.d.ts.map +1 -0
  306. package/dist/in-store/storey-reassignment-plan.js +237 -0
  307. package/dist/in-store/storey-reassignment-plan.js.map +1 -0
  308. package/dist/in-store/storey-reassignment.d.ts +8 -0
  309. package/dist/in-store/storey-reassignment.d.ts.map +1 -0
  310. package/dist/in-store/storey-reassignment.js +52 -0
  311. package/dist/in-store/storey-reassignment.js.map +1 -0
  312. package/dist/in-store/trim-extend-plan.d.ts +27 -0
  313. package/dist/in-store/trim-extend-plan.d.ts.map +1 -0
  314. package/dist/in-store/trim-extend-plan.js +49 -0
  315. package/dist/in-store/trim-extend-plan.js.map +1 -0
  316. package/dist/in-store/wall-join-edit.d.ts +0 -17
  317. package/dist/in-store/wall-join-edit.d.ts.map +1 -1
  318. package/dist/in-store/wall-join-edit.js +41 -7
  319. package/dist/in-store/wall-join-edit.js.map +1 -1
  320. package/dist/in-store/wall-section-edit.d.ts +16 -0
  321. package/dist/in-store/wall-section-edit.d.ts.map +1 -0
  322. package/dist/in-store/wall-section-edit.js +75 -0
  323. package/dist/in-store/wall-section-edit.js.map +1 -0
  324. package/dist/in-store/wall-size-edit.d.ts +29 -0
  325. package/dist/in-store/wall-size-edit.d.ts.map +1 -0
  326. package/dist/in-store/wall-size-edit.js +65 -0
  327. package/dist/in-store/wall-size-edit.js.map +1 -0
  328. package/dist/index.d.ts +24 -0
  329. package/dist/index.d.ts.map +1 -1
  330. package/dist/index.js +23 -0
  331. package/dist/index.js.map +1 -1
  332. package/dist/landxml/profile-geometry.d.ts +10 -0
  333. package/dist/landxml/profile-geometry.d.ts.map +1 -1
  334. package/dist/landxml/profile-geometry.js +16 -1
  335. package/dist/landxml/profile-geometry.js.map +1 -1
  336. package/package.json +9 -8
@@ -0,0 +1,53 @@
1
+ import { type MutablePropertyView } from '@ifc-lite/mutations';
2
+ import type { IfcDataStore } from '@ifc-lite/parser';
3
+ import { type Frame3 } from './host-geometry-frame.js';
4
+ export type ReassignmentRelationship = {
5
+ id: number;
6
+ type: string;
7
+ parent: number;
8
+ children: number[];
9
+ listIndex: number;
10
+ parentIndex: number;
11
+ attributes: readonly unknown[];
12
+ };
13
+ export type StoreyReassignmentPlan = {
14
+ sourceStorey: {
15
+ expressId: number;
16
+ GlobalId: string;
17
+ };
18
+ destinationStorey: {
19
+ expressId: number;
20
+ GlobalId: string;
21
+ };
22
+ sourceStoreyId: number;
23
+ destinationStoreyId: number;
24
+ destinationPlacementId: number;
25
+ products: {
26
+ expressId: number;
27
+ GlobalId: string;
28
+ type: string;
29
+ attributes: readonly unknown[];
30
+ placementId: number;
31
+ world: Frame3;
32
+ }[];
33
+ placements: {
34
+ expressId: number;
35
+ relative: Frame3;
36
+ }[];
37
+ relationships: ReassignmentRelationship[];
38
+ sourceMemberships: ReassignmentRelationship[];
39
+ };
40
+ /** Complete read-only admission for one destination. */
41
+ export declare function planStoreyReassignment(store: IfcDataStore, view: MutablePropertyView, selectedIds: readonly number[], sourceStoreyId: number, destinationStoreyId: number): StoreyReassignmentPlan;
42
+ /** Selection capture shares one effective Root/relationship inventory across
43
+ * at most 20 destination candidates. Each refusal remains explicit. */
44
+ export declare function planStoreyReassignmentCandidates(store: IfcDataStore, view: MutablePropertyView, selectedIds: readonly number[], sourceStoreyId: number, destinationStoreyIds: readonly number[]): ({
45
+ destinationStoreyId: number;
46
+ plan: StoreyReassignmentPlan;
47
+ refusal: null;
48
+ } | {
49
+ destinationStoreyId: number;
50
+ plan: null;
51
+ refusal: string;
52
+ })[];
53
+ //# sourceMappingURL=storey-reassignment-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storey-reassignment-plan.d.ts","sourceRoot":"","sources":["../../src/in-store/storey-reassignment-plan.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKrD,OAAO,EAAmD,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIxG,MAAM,MAAM,wBAAwB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,CAAC;AAChL,MAAM,MAAM,sBAAsB,GAAG;IACnC,YAAY,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,iBAAiB,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAClH,cAAc,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAC;IACpF,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtI,UAAU,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,aAAa,EAAE,wBAAwB,EAAE,CAAC;IAC1C,iBAAiB,EAAE,wBAAwB,EAAE,CAAC;CAC/C,CAAC;AAyKF,wDAAwD;AACxD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,EACnH,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,sBAAsB,CAE7E;AAED;uEACuE;AACvE,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,EAC7H,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,SAAS,MAAM,EAAE;;;;;;;;KAUhE"}
@@ -0,0 +1,237 @@
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
+ import { iterateEffectiveEntityIds } from '@ifc-lite/mutations';
5
+ import { editOwnershipRefusal } from '@ifc-lite/export';
6
+ import { AnchorEntityReader } from './resolve-anchor.js';
7
+ import { conformsTo, schemaRegistry } from './schema-attributes.js';
8
+ import { placementInAncestor, placementRelativeTo, refId } from './host-geometry-frame.js';
9
+ const OP = 'reassignElementsToStoreyInStore';
10
+ const fail = (message) => { throw new Error(`${OP}: ${message}`); };
11
+ function refs(value) {
12
+ if (!Array.isArray(value) || value.length === 0)
13
+ return fail('unreadable empty relationship membership');
14
+ const ids = value.map(refId);
15
+ if (ids.some(id => id === null) || new Set(ids).size !== ids.length)
16
+ return fail('unreadable or duplicate relationship membership');
17
+ return ids;
18
+ }
19
+ /** Effective relationships, not stale parser edges. The finite closure includes
20
+ * aggregate/nested parts and the complete host → opening → filling chain. */
21
+ function relationships(reader) {
22
+ const result = [];
23
+ let work = 0;
24
+ for (const type of ['IFCRELAGGREGATES', 'IFCRELNESTS', 'IFCRELVOIDSELEMENT', 'IFCRELFILLSELEMENT', 'IFCRELCONTAINEDINSPATIALSTRUCTURE']) {
25
+ for (const id of reader.ids(type)) {
26
+ const entity = reader.entity(id) ?? fail(`unreadable relationship #${id}`);
27
+ const contained = type === 'IFCRELCONTAINEDINSPATIALSTRUCTURE';
28
+ const parentIndex = contained ? 5 : 4, listIndex = contained ? 4 : 5;
29
+ const parent = refId(entity.attributes[parentIndex]) ?? fail(`unreadable parent of #${id}`);
30
+ const singleton = type === 'IFCRELVOIDSELEMENT' || type === 'IFCRELFILLSELEMENT';
31
+ const rawChildren = entity.attributes[listIndex];
32
+ work += 1 + (Array.isArray(rawChildren) ? rawChildren.length : 1);
33
+ if (work > 2_000_000)
34
+ fail('relationship inventory exceeds 2,000,000 references');
35
+ const children = singleton ? [refId(entity.attributes[listIndex]) ?? fail(`unreadable child of #${id}`)] : refs(entity.attributes[listIndex]);
36
+ result.push({ id, type, parent, children, listIndex, parentIndex, attributes: entity.attributes });
37
+ }
38
+ }
39
+ return result;
40
+ }
41
+ /** One ephemeral effective snapshot per synchronous planning request. Never
42
+ * reuse it across mutation revisions or native transactions. */
43
+ function planningInventory(store, view) {
44
+ class CachedReader extends AnchorEntityReader {
45
+ records = new Map();
46
+ entity(id) {
47
+ if (!this.records.has(id))
48
+ this.records.set(id, super.entity(id));
49
+ return this.records.get(id) ?? null;
50
+ }
51
+ }
52
+ const reader = new CachedReader(store, view), registry = schemaRegistry(store.schemaVersion, OP);
53
+ const allRelationships = relationships(reader), outgoing = new Map();
54
+ const incomingById = new Map(), relationOrder = new Map();
55
+ for (const [index, rel] of allRelationships.entries()) {
56
+ relationOrder.set(rel.id, index);
57
+ const edges = outgoing.get(rel.parent) ?? [];
58
+ edges.push(rel);
59
+ outgoing.set(rel.parent, edges);
60
+ for (const child of rel.children) {
61
+ const parents = incomingById.get(child) ?? [];
62
+ parents.push(rel);
63
+ incomingById.set(child, parents);
64
+ }
65
+ }
66
+ const rootTypes = Object.entries(registry.entities).filter(([name, entity]) => name === 'IfcRoot' || entity.inheritanceChain?.includes('IfcRoot')).map(([name]) => name.toUpperCase());
67
+ const guidCounts = new Map();
68
+ for (const { expressId } of iterateEffectiveEntityIds(store, view, rootTypes)) {
69
+ const guid = reader.entity(expressId)?.attributes[0];
70
+ if (typeof guid === 'string')
71
+ guidCounts.set(guid, (guidCounts.get(guid) ?? 0) + 1);
72
+ }
73
+ return { reader, registry, outgoing, incomingById, relationOrder, guidCounts, ownership: new Map() };
74
+ }
75
+ function planWithInventory(store, view, selectedIds, sourceStoreyId, destinationStoreyId, inventory) {
76
+ if (!selectedIds.length || selectedIds.length > 200 || new Set(selectedIds).size !== selectedIds.length)
77
+ fail('select 1–200 distinct products');
78
+ if (sourceStoreyId === destinationStoreyId)
79
+ fail('source and destination storeys must differ');
80
+ const { reader, registry, outgoing, incomingById, relationOrder, guidCounts, ownership } = inventory;
81
+ const storeyPlacement = (id) => {
82
+ const entity = reader.entity(id);
83
+ if (entity?.type.toUpperCase() !== 'IFCBUILDINGSTOREY')
84
+ return fail(`#${id} is not a live IfcBuildingStorey in this model`);
85
+ const placement = refId(entity.attributes[5]) ?? fail(`storey #${id} has no placement`);
86
+ if (!placementInAncestor(reader, placement, null))
87
+ fail(`storey #${id} has an unreadable world placement`);
88
+ return placement;
89
+ };
90
+ storeyPlacement(sourceStoreyId);
91
+ const destinationPlacementId = storeyPlacement(destinationStoreyId);
92
+ const ids = new Set(selectedIds), queue = [...ids];
93
+ for (let index = 0; index < queue.length; index++) {
94
+ for (const rel of outgoing.get(queue[index]) ?? []) {
95
+ for (const child of rel.children) {
96
+ if (ids.has(child))
97
+ continue;
98
+ if (ids.size >= 5_000)
99
+ fail('dependency closure exceeds 5,000 products');
100
+ ids.add(child);
101
+ queue.push(child);
102
+ }
103
+ }
104
+ }
105
+ const incoming = new Map();
106
+ for (const child of ids)
107
+ for (const rel of incomingById.get(child) ?? []) {
108
+ const parents = incoming.get(child) ?? [];
109
+ parents.push(rel);
110
+ incoming.set(child, parents);
111
+ if (!ids.has(rel.parent) && rel.parent !== sourceStoreyId)
112
+ fail(`#${child} belongs to an external host, assembly or container #${rel.parent}`);
113
+ if (rel.parent === sourceStoreyId && ['IFCRELVOIDSELEMENT', 'IFCRELFILLSELEMENT'].includes(rel.type))
114
+ fail('storey cannot own hosted dependencies');
115
+ }
116
+ // Each direct spatial owner is unique; host and aggregate ownership may
117
+ // coexist with containment but never be silently detached.
118
+ for (const id of ids) {
119
+ const spatial = (incoming.get(id) ?? []).filter(rel => rel.type === 'IFCRELCONTAINEDINSPATIALSTRUCTURE'
120
+ || (rel.type === 'IFCRELAGGREGATES' && rel.parent === sourceStoreyId));
121
+ if (spatial.length > 1)
122
+ fail(`#${id} has duplicate spatial ownership`);
123
+ for (const family of [['IFCRELAGGREGATES', 'IFCRELNESTS'], ['IFCRELVOIDSELEMENT'], ['IFCRELFILLSELEMENT']]) {
124
+ if ((incoming.get(id) ?? []).filter(rel => family.includes(rel.type)).length > 1)
125
+ fail(`#${id} has ambiguous dependency ownership`);
126
+ }
127
+ }
128
+ const ownedRelationships = [...ids].flatMap(id => outgoing.get(id) ?? []).sort((a, b) => relationOrder.get(a.id) - relationOrder.get(b.id));
129
+ const indegree = new Map([...ids].map(id => [id, 0]));
130
+ for (const rel of ownedRelationships)
131
+ for (const child of rel.children)
132
+ indegree.set(child, (indegree.get(child) ?? 0) + 1);
133
+ const roots = [...ids].filter(id => indegree.get(id) === 0), topo = [...roots];
134
+ for (let i = 0; i < topo.length; i++)
135
+ for (const rel of outgoing.get(topo[i]) ?? []) {
136
+ for (const child of rel.children) {
137
+ const n = indegree.get(child) - 1;
138
+ indegree.set(child, n);
139
+ if (n === 0)
140
+ topo.push(child);
141
+ }
142
+ }
143
+ if (topo.length !== ids.size)
144
+ fail('cyclic hosted or aggregate dependencies');
145
+ for (const id of roots) {
146
+ const spatialRoot = conformsTo(registry, reader.entity(id)?.type ?? '', 'IfcSpatialStructureElement');
147
+ if (!(incoming.get(id) ?? []).some(rel => rel.parent === sourceStoreyId &&
148
+ (rel.type === 'IFCRELCONTAINEDINSPATIALSTRUCTURE' || (spatialRoot && rel.type === 'IFCRELAGGREGATES')))) {
149
+ fail('selected roots must have a spatial owner directly in the declared source storey');
150
+ }
151
+ }
152
+ const products = [...ids].sort((a, b) => a - b).map(expressId => {
153
+ const entity = reader.entity(expressId) ?? fail(`missing product #${expressId}`);
154
+ if (!conformsTo(registry, entity.type, 'IfcProduct') || ['IFCSITE', 'IFCBUILDING', 'IFCBUILDINGSTOREY', 'IFCGRID'].includes(entity.type.toUpperCase()))
155
+ fail(`#${expressId} is not a supported movable product`);
156
+ const guid = entity.attributes[0];
157
+ const GlobalId = typeof guid === 'string' && /^[0-3][0-9A-Za-z_$]{21}$/.test(guid) ? guid : fail(`#${expressId} has no valid GlobalId`);
158
+ const placementId = refId(entity.attributes[5]) ?? fail(`#${expressId} has no ObjectPlacement`);
159
+ const world = placementInAncestor(reader, placementId, null) ?? fail(`#${expressId} has an unreadable world placement`);
160
+ return { expressId, GlobalId, type: entity.type, attributes: entity.attributes, placementId, world };
161
+ });
162
+ const storeyGuids = [sourceStoreyId, destinationStoreyId].map(id => {
163
+ const guid = reader.entity(id)?.attributes[0];
164
+ return typeof guid === 'string' && /^[0-3][0-9A-Za-z_$]{21}$/.test(guid) ? guid : fail(`storey #${id} has no valid GlobalId`);
165
+ });
166
+ const guids = new Set([...storeyGuids, ...products.map(product => product.GlobalId)]);
167
+ if (guids.size !== products.length + 2 || [...guids].some(guid => guidCounts.get(guid) !== 1))
168
+ fail('ambiguous duplicate product GlobalId');
169
+ const sourceMemberships = (outgoing.get(sourceStoreyId) ?? []).filter(rel => rel.children.some(id => ids.has(id)));
170
+ for (const relation of [...ownedRelationships, ...sourceMemberships]) {
171
+ const guid = relation.attributes[0];
172
+ const GlobalId = typeof guid === 'string' && /^[0-3][0-9A-Za-z_$]{21}$/.test(guid)
173
+ ? guid : fail(`relationship GlobalId is missing or malformed for #${relation.id}`);
174
+ if (guidCounts.get(GlobalId) !== 1)
175
+ fail(`ambiguous duplicate relationship GlobalId for #${relation.id}`);
176
+ }
177
+ const placementIds = new Set(products.map(product => product.placementId));
178
+ const placements = [...placementIds].filter(id => {
179
+ const visited = new Set();
180
+ let parent = refId(reader.entity(id)?.attributes[0]);
181
+ while (parent !== null) {
182
+ if (visited.has(parent) || visited.size >= 10_000)
183
+ return fail('cyclic placement ancestry');
184
+ visited.add(parent);
185
+ if (placementIds.has(parent))
186
+ return false;
187
+ parent = refId(reader.entity(parent)?.attributes[0]);
188
+ }
189
+ return true;
190
+ }).map(expressId => {
191
+ // Reparenting under a descendant would introduce a new placement cycle.
192
+ const visited = new Set();
193
+ let parent = destinationPlacementId;
194
+ while (parent !== null) {
195
+ if (parent === expressId)
196
+ fail('destination placement depends on a moved product');
197
+ if (visited.has(parent) || visited.size >= 10_000)
198
+ fail('cyclic destination placement');
199
+ visited.add(parent);
200
+ parent = refId(reader.entity(parent)?.attributes[0]);
201
+ }
202
+ const relative = placementRelativeTo(reader, expressId, destinationPlacementId) ?? fail(`cannot express placement #${expressId} in destination frame`);
203
+ return { expressId, relative };
204
+ });
205
+ const ownershipKey = JSON.stringify([placements.map(p => p.expressId), products.map(p => p.expressId)]);
206
+ if (!ownership.has(ownershipKey))
207
+ ownership.set(ownershipKey, editOwnershipRefusal(store, view, placements.map(p => p.expressId), ids));
208
+ const refusal = ownership.get(ownershipKey);
209
+ if (refusal)
210
+ fail(refusal);
211
+ return { sourceStorey: { expressId: sourceStoreyId, GlobalId: storeyGuids[0] },
212
+ destinationStorey: { expressId: destinationStoreyId, GlobalId: storeyGuids[1] },
213
+ sourceStoreyId, destinationStoreyId, destinationPlacementId, products, placements,
214
+ relationships: ownedRelationships, sourceMemberships };
215
+ }
216
+ /** Complete read-only admission for one destination. */
217
+ export function planStoreyReassignment(store, view, selectedIds, sourceStoreyId, destinationStoreyId) {
218
+ return planWithInventory(store, view, selectedIds, sourceStoreyId, destinationStoreyId, planningInventory(store, view));
219
+ }
220
+ /** Selection capture shares one effective Root/relationship inventory across
221
+ * at most 20 destination candidates. Each refusal remains explicit. */
222
+ export function planStoreyReassignmentCandidates(store, view, selectedIds, sourceStoreyId, destinationStoreyIds) {
223
+ if (destinationStoreyIds.length > 20 || new Set(destinationStoreyIds).size !== destinationStoreyIds.length)
224
+ fail('choose at most 20 distinct destination storeys');
225
+ const inventory = planningInventory(store, view);
226
+ return destinationStoreyIds.map(destinationStoreyId => {
227
+ try {
228
+ return { destinationStoreyId, plan: planWithInventory(store, view, selectedIds, sourceStoreyId, destinationStoreyId, inventory), refusal: null };
229
+ }
230
+ catch (error) {
231
+ if (!(error instanceof Error))
232
+ throw error;
233
+ return { destinationStoreyId, plan: null, refusal: error.message };
234
+ }
235
+ });
236
+ }
237
+ //# sourceMappingURL=storey-reassignment-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storey-reassignment-plan.js","sourceRoot":"","sources":["../../src/in-store/storey-reassignment-plan.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE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,CAAC,EAAE;QACpD,IAAI,CAAC;YAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAAC,CAAC;QACzJ,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC;gBAAE,MAAM,KAAK,CAAC;YAC3C,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QACrE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { StoreEditor } from '@ifc-lite/mutations';
2
+ import type { IfcDataStore } from '@ifc-lite/parser';
3
+ import { type StoreyReassignmentPlan } from './storey-reassignment-plan.js';
4
+ /** Transactional, same-identity move. Existing local placement identities are
5
+ * retained so dependent placement chains keep following their original parent.
6
+ * Caller records this one compound operation for native history/Undo (#7328). */
7
+ export declare function reassignElementsToStoreyInStore(store: IfcDataStore, editor: StoreEditor, selectedIds: readonly number[], sourceStoreyId: number, destinationStoreyId: number, expected?: StoreyReassignmentPlan): StoreyReassignmentPlan;
8
+ //# sourceMappingURL=storey-reassignment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storey-reassignment.d.ts","sourceRoot":"","sources":["../../src/in-store/storey-reassignment.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEpG;;iFAEiF;AACjF,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAC7H,QAAQ,CAAC,EAAE,sBAAsB,GAChC,sBAAsB,CAsCxB"}
@@ -0,0 +1,52 @@
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
+ import { generateIfcGuid } from '@ifc-lite/encoding';
5
+ import { AnchorEntityReader } from './resolve-anchor.js';
6
+ import { planStoreyReassignment } from './storey-reassignment-plan.js';
7
+ /** Transactional, same-identity move. Existing local placement identities are
8
+ * retained so dependent placement chains keep following their original parent.
9
+ * Caller records this one compound operation for native history/Undo (#7328). */
10
+ export function reassignElementsToStoreyInStore(store, editor, selectedIds, sourceStoreyId, destinationStoreyId, expected) {
11
+ return editor.runAtomic(draft => {
12
+ const view = draft.getMutationView();
13
+ const plan = planStoreyReassignment(store, view, selectedIds, sourceStoreyId, destinationStoreyId);
14
+ if (expected && JSON.stringify(plan) !== JSON.stringify(expected))
15
+ throw new Error('reassignElementsToStoreyInStore: reviewed source, dependency or destination frame is stale');
16
+ const reader = new AnchorEntityReader(store, view);
17
+ const ownerHistory = reader.firstId('IFCOWNERHISTORY');
18
+ if (store.schemaVersion === 'IFC2X3' && ownerHistory === null)
19
+ throw new Error('reassignElementsToStoreyInStore: IFC2X3 requires IfcOwnerHistory');
20
+ const ref = (id) => `#${id}`;
21
+ for (const placement of plan.placements) {
22
+ const frame = placement.relative;
23
+ const point = draft.addEntity('IfcCartesianPoint', [frame.o]).expressId;
24
+ const z = draft.addEntity('IfcDirection', [frame.z]).expressId;
25
+ const x = draft.addEntity('IfcDirection', [frame.x]).expressId;
26
+ const axis = draft.addEntity('IfcAxis2Placement3D', [ref(point), ref(z), ref(x)]).expressId;
27
+ draft.setPositionalAttribute(placement.expressId, 0, ref(plan.destinationPlacementId));
28
+ draft.setPositionalAttribute(placement.expressId, 1, ref(axis));
29
+ }
30
+ const moved = new Set(plan.products.map(product => product.expressId));
31
+ // Move each existing relationship independently. Exhausted source entries
32
+ // retain their own Root identity/metadata; partial entries split with a
33
+ // fresh identity and the original metadata rather than merging named groups.
34
+ for (const membership of plan.sourceMemberships) {
35
+ const remaining = membership.children.filter(id => !moved.has(id));
36
+ if (!remaining.length) {
37
+ draft.setPositionalAttribute(membership.id, membership.parentIndex, ref(destinationStoreyId));
38
+ continue;
39
+ }
40
+ draft.setPositionalAttribute(membership.id, membership.listIndex, remaining.map(ref));
41
+ const attributes = [...membership.attributes];
42
+ attributes[0] = generateIfcGuid();
43
+ if (store.schemaVersion === 'IFC2X3' && attributes[1] == null)
44
+ attributes[1] = ref(ownerHistory);
45
+ attributes[membership.parentIndex] = ref(destinationStoreyId);
46
+ attributes[membership.listIndex] = membership.children.filter(id => moved.has(id)).map(ref);
47
+ draft.addEntity(membership.type, attributes);
48
+ }
49
+ return plan;
50
+ });
51
+ }
52
+ //# sourceMappingURL=storey-reassignment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storey-reassignment.js","sourceRoot":"","sources":["../../src/in-store/storey-reassignment.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAA+B,MAAM,+BAA+B,CAAC;AAEpG;;iFAEiF;AACjF,MAAM,UAAU,+BAA+B,CAC7C,KAAmB,EAAE,MAAmB,EAAE,WAA8B,EAAE,cAAsB,EAAE,mBAA2B,EAC7H,QAAiC;IAEjC,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,eAAe,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,sBAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,cA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;YAC9D,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC5F,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { type WallJoinWall } from './wall-join.js';
2
+ import type { WallJoinRead } from './wall-join-read.js';
3
+ import { type HostedCuts } from './edit/wall-hosted-cuts.js';
4
+ import { type ReachBoundary, type ReachMode, type ReachRefusal, type ReachTarget, type ReachPlan } from './edit/trim-extend-geometry.js';
5
+ type Vec2 = readonly [number, number];
6
+ export interface TrimAxisTarget {
7
+ readonly kind: 'wall' | 'beam';
8
+ readonly axis: ReachTarget;
9
+ readonly wall: WallJoinRead | null;
10
+ }
11
+ export type TrimPlanRefusal = ReachRefusal | 'wallBody' | 'hostedUnreadable' | 'hosted' | 'join';
12
+ export type TrimAxisPlan = (Extract<ReachPlan, {
13
+ ok: true;
14
+ }> & {
15
+ readonly wall: WallJoinWall | null;
16
+ readonly joinKind: 'L' | 'T' | 'butt' | null;
17
+ }) | {
18
+ readonly ok: false;
19
+ readonly reason: TrimPlanRefusal;
20
+ readonly count?: number;
21
+ readonly detail?: string;
22
+ };
23
+ /** Shared live policy: joins include physical cut faces; moving the start or
24
+ * contracting the body requires every hosted cut to be readable and inside. */
25
+ export declare function planTrimAxis(target: TrimAxisTarget, boundary: ReachBoundary, mode: ReachMode, click: Vec2, boundaryWall: WallJoinWall | null, hosted: HostedCuts | null): TrimAxisPlan;
26
+ export {};
27
+ //# sourceMappingURL=trim-extend-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trim-extend-plan.d.ts","sourceR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,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAC7E,YAAY,EAAE,YAAY,GAAG,IAAI,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,GAC3D,YAAY,CAgCd"}
@@ -0,0 +1,49 @@
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
+ import { computeWallJoin, reshapeWallAxis, wallBodyOutline } from './wall-join.js';
5
+ import { cutsOutside } from './edit/wall-hosted-cuts.js';
6
+ import { clickAlong, planReach } from './edit/trim-extend-geometry.js';
7
+ import { MIN_WALL_SEGMENT_LENGTH } from './edit/wall-edit.js';
8
+ import { MIN_LINEAR_SEGMENT_LENGTH } from './edit/linear-element-edit.js';
9
+ /** Shared live policy: joins include physical cut faces; moving the start or
10
+ * contracting the body requires every hosted cut to be readable and inside. */
11
+ export function planTrimAxis(target, boundary, mode, click, boundaryWall, hosted) {
12
+ const plan = planReach(target.axis, boundary, mode, clickAlong(target.axis, click), target.kind === 'wall' ? MIN_WALL_SEGMENT_LENGTH : MIN_LINEAR_SEGMENT_LENGTH, boundaryWall !== null && target.kind === 'wall');
13
+ if (!plan.ok)
14
+ return plan;
15
+ if (target.kind === 'beam')
16
+ return { ...plan, wall: null, joinKind: null };
17
+ const read = target.wall;
18
+ if (!read)
19
+ return { ok: false, reason: 'wallBody' };
20
+ try {
21
+ let wall = reshapeWallAxis(read.wall, [plan.start[0], plan.start[1]], [plan.stop[0], plan.stop[1]]);
22
+ let joinKind = null;
23
+ if (boundaryWall) {
24
+ const join = computeWallJoin(boundaryWall, wall);
25
+ wall = join.b.wall;
26
+ joinKind = join.kind;
27
+ }
28
+ const span = (body) => {
29
+ const [dx, dy] = target.axis.dir;
30
+ const first = (body.start[0] - read.origin[0]) * dx + (body.start[1] - read.origin[1]) * dy;
31
+ const { corners } = wallBodyOutline(body);
32
+ return [first + Math.max(corners[0][0], corners[3][0]), first + Math.min(corners[1][0], corners[2][0])];
33
+ };
34
+ if (!hosted)
35
+ return { ok: false, reason: 'hostedUnreadable', count: 1 };
36
+ const previous = span(read.wall), next = span(wall);
37
+ const contracts = next[0] > previous[0] + 1e-9 || next[1] < previous[1] - 1e-9;
38
+ if ((plan.moved < 0 || contracts || (plan.end === 'start' && plan.moved !== 0)) && hosted.unreadable.length > 0)
39
+ return { ok: false, reason: 'hostedUnreadable', count: hosted.unreadable.length };
40
+ const outside = cutsOutside(hosted.cuts, next[0], next[1]);
41
+ if (outside.length > 0)
42
+ return { ok: false, reason: 'hosted', count: outside.length };
43
+ return { ...plan, wall, joinKind };
44
+ }
45
+ catch (error) {
46
+ return { ok: false, reason: 'join', detail: error instanceof Error ? error.message : String(error) };
47
+ }
48
+ }
49
+ //# sourceMappingURL=trim-extend-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trim-extend-plan.js","sourceRoot":"","sources":["../../src/in-store/trim-extend-plan.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AAEtG,OAAO,EAAE,WAAW,EAAmB,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,SAAS,EAA2F,MAAM,gCAAgC,CAAC;AAChK,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAa1E;+EAC+E;AAC/E,MAAM,UAAU,YAAY,CAC1B,MAAsB,EAAE,QAAuB,EAAE,IAAe,EAAE,KAAW,EAC7E,YAAiC,EAAE,MAAyB;IAE5D,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAChF,MAAM,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AAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACpF,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QACtF,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACvG,CAAC;AACH,CAAC"}
@@ -1,20 +1,3 @@
1
- /**
2
- * Editing joined walls in the store (#6232 B2): join two walls that are
3
- * already there, and move wall ends with their joins following.
4
- *
5
- * - `joinWallsInStore` reads both walls, then writes the join. Two walls that
6
- * are already joined get the new `IfcRelConnectsPathElements` in place of
7
- * the old one, never a second beside it.
8
- * - `reshapeWallsInStore` gives walls new axis ends. A dragged corner brings
9
- * the walls joined at that end along, changed ends are made square while
10
- * unchanged ends retain their cuts, and every affected join is recomputed. A join that
11
- * no longer holds (the axes no longer meet) is removed and the wall that did
12
- * not move stops square at its own end.
13
- *
14
- * Both write through the editor only. Joining is atomic; reshaping runs inside
15
- * the caller's transaction. Hosts record either as one undo step. Every length
16
- * in and out is metres, storey-local.
17
- */
18
1
  import type { StoreEditor } from '@ifc-lite/mutations';
19
2
  import type { IfcDataStore } from '@ifc-lite/parser';
20
3
  import { resolveAuthoringAnchor } from './resolve-relations.js';
@@ -1 +1 @@
1
- {"version":3,"file":"wall-join-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E,MAAM,EACX,OAAO,GAAE,oBAAyB,GACjC,qBAAqB,CAEvB;AA4BD,yFAAyF;AACzF,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,gGAAgG;IAChG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iCAAiC;IACjC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gEAAgE;IAChE,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAKD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CA8FnB"}
@@ -1,6 +1,24 @@
1
1
  /* This Source Code Form is subject to the terms of the Mozilla Public
2
2
  * License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Editing joined walls in the store (#6232 B2): join two walls that are
6
+ * already there, and move wall ends with their joins following.
7
+ *
8
+ * - `joinWallsInStore` reads both walls, then writes the join. Two walls that
9
+ * are already joined get the new `IfcRelConnectsPathElements` in place of
10
+ * the old one, never a second beside it.
11
+ * - `reshapeWallsInStore` gives walls new axis ends. A dragged corner brings
12
+ * the walls joined at that end along, changed ends are made square while
13
+ * unchanged ends retain their cuts, and every affected join is recomputed. A join that
14
+ * no longer holds (the axes no longer meet) is removed and the wall that did
15
+ * not move stops square at its own end.
16
+ *
17
+ * Both write through the editor only. Joining is atomic; reshaping runs inside
18
+ * the caller's transaction. Hosts record either as one undo step. Every length
19
+ * in and out is metres, storey-local.
20
+ */
21
+ import { editOwnershipRefusal, expandAffectedSet } from '@ifc-lite/export';
4
22
  import { toNativeLength } from './anchor.js';
5
23
  import { resolveAuthoringAnchor } from './resolve-relations.js';
6
24
  import { AnchorEntityReader } from './resolve-anchor.js';
@@ -117,6 +135,20 @@ export function reshapeWallsInStore(editor, store, anchor, edits, options = {})
117
135
  // walls), retaining supported cuts at unchanged ends on the same direction.
118
136
  const rels = readWallJoinRels(store, view(), new Set([...axes.keys(), ...(options.refresh ?? [])]));
119
137
  const touched = new Set(axes.keys());
138
+ // A refresh can rewrite either joined wall, including neighbours that did
139
+ // not move. Their solid/shape records must not belong to unrelated products.
140
+ for (const rel of rels) {
141
+ readOrNull(store, editor, targets, rel.relatingId, scale);
142
+ readOrNull(store, editor, targets, rel.relatedId, scale);
143
+ }
144
+ const bodyIds = [...targets.values()].flatMap(read => [read.solidId, read.productShapeId]);
145
+ const ownership = editOwnershipRefusal(store, view(), bodyIds, new Set(targets.keys()));
146
+ if (ownership)
147
+ throw new Error(`${op}: ${ownership}`);
148
+ const placementIds = [...axes].flatMap(([id, ends]) => holdsPlacement(load(id).wall, ends.start, ends.end) ? [] : [load(id).axisPlacementId]);
149
+ const placementOwnership = editOwnershipRefusal(store, view(), placementIds, expandAffectedSet(store, view(), targets.keys(), 'hostsChanged'));
150
+ if (placementOwnership)
151
+ throw new Error(`${op}: ${placementOwnership}`);
120
152
  for (const [id, { start, end, thickness }] of axes)
121
153
  targets.set(id, writeAxis(editor, anchor, load(id), start, end, thickness));
122
154
  // Recompute every join that touches a moved wall: the joined end snaps to the
@@ -179,19 +211,21 @@ function joinOptionsOf(rel, tolerance) {
179
211
  * gets a fresh point and direction at the new start (the old ones may be
180
212
  * shared with other walls).
181
213
  */
214
+ /** The existing axis writer retains placement when start and direction stay. */
215
+ function holdsPlacement(old, start, end) {
216
+ const oldLength = Math.hypot(old.end[0] - old.start[0], old.end[1] - old.start[1]);
217
+ const length = Math.hypot(end[0] - start[0], end[1] - start[1]);
218
+ return Math.hypot(start[0] - old.start[0], start[1] - old.start[1]) <= MOVE_EPS
219
+ && (((end[0] - start[0]) / length) * ((old.end[0] - old.start[0]) / oldLength)
220
+ + ((end[1] - start[1]) / length) * ((old.end[1] - old.start[1]) / oldLength)) > 1 - 1e-12;
221
+ }
182
222
  function writeAxis(editor, anchor, read, start, end, thickness = read.wall.thickness) {
183
223
  const length = Math.hypot(end[0] - start[0], end[1] - start[1]);
184
224
  const native = (v) => toNativeLength(anchor, v);
185
225
  const reshaped = reshapeWallAxis({ ...read.wall, thickness }, start, end);
186
- const old = read.wall;
187
- const oldLength = Math.hypot(old.end[0] - old.start[0], old.end[1] - old.start[1]);
188
226
  const ux = (end[0] - start[0]) / length;
189
227
  const uy = (end[1] - start[1]) / length;
190
- const ox = (old.end[0] - old.start[0]) / oldLength;
191
- const oy = (old.end[1] - old.start[1]) / oldLength;
192
- const startHeld = Math.hypot(start[0] - old.start[0], start[1] - old.start[1]) <= MOVE_EPS;
193
- const directionHeld = ux * ox + uy * oy > 1 - 1e-12;
194
- if (startHeld && directionHeld) {
228
+ if (holdsPlacement(read.wall, start, end)) {
195
229
  return { ...read, ...rewriteWall(editor, anchor, { ...read, wall: reshaped }, reshaped), wall: reshaped, plain: false };
196
230
  }
197
231
  const point = editor.addEntity('IfcCartesianPoint', [[native(start[0]), native(start[1]), read.location[2]]]).expressId;