@mlightcad/cad-simple-viewer 1.5.5 → 1.5.7

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 (462) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +69 -1
  3. package/dist/{index.js → cad-simple-viewer.js} +34247 -29923
  4. package/dist/cad-simple-viewer.umd.cjs +913 -0
  5. package/dist/dxf-parser-worker.js +2091 -0
  6. package/dist/libredwg-parser-worker.js +5388 -5122
  7. package/dist/mtext-renderer-worker.js +3061 -2858
  8. package/lib/app/AcApContext.d.ts.map +1 -1
  9. package/lib/app/AcApContext.js +15 -2
  10. package/lib/app/AcApContext.js.map +1 -1
  11. package/lib/app/AcApDocManager.d.ts +63 -0
  12. package/lib/app/AcApDocManager.d.ts.map +1 -1
  13. package/lib/app/AcApDocManager.js +195 -23
  14. package/lib/app/AcApDocManager.js.map +1 -1
  15. package/lib/app/AcApDocument.d.ts +81 -0
  16. package/lib/app/AcApDocument.d.ts.map +1 -1
  17. package/lib/app/AcApDocument.js +154 -0
  18. package/lib/app/AcApDocument.js.map +1 -1
  19. package/lib/app/AcApLayerSessionState.d.ts +15 -0
  20. package/lib/app/AcApLayerSessionState.d.ts.map +1 -0
  21. package/lib/app/AcApLayerSessionState.js +2 -0
  22. package/lib/app/AcApLayerSessionState.js.map +1 -0
  23. package/lib/app/AcApOpenFileDialog.d.ts +35 -0
  24. package/lib/app/AcApOpenFileDialog.d.ts.map +1 -0
  25. package/lib/app/AcApOpenFileDialog.js +192 -0
  26. package/lib/app/AcApOpenFileDialog.js.map +1 -0
  27. package/lib/app/AcApWebworkerReadiness.d.ts +18 -0
  28. package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -0
  29. package/lib/app/AcApWebworkerReadiness.js +126 -0
  30. package/lib/app/AcApWebworkerReadiness.js.map +1 -0
  31. package/lib/app/AcDbOpenDatabaseOptions.d.ts +29 -0
  32. package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -1
  33. package/lib/app/AcDbOpenDatabaseOptions.js +10 -1
  34. package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -1
  35. package/lib/app/index.d.ts +4 -0
  36. package/lib/app/index.d.ts.map +1 -1
  37. package/lib/app/index.js +3 -0
  38. package/lib/app/index.js.map +1 -1
  39. package/lib/command/AcApCacheFontCmd.d.ts +25 -0
  40. package/lib/command/AcApCacheFontCmd.d.ts.map +1 -0
  41. package/lib/command/AcApCacheFontCmd.js +142 -0
  42. package/lib/command/AcApCacheFontCmd.js.map +1 -0
  43. package/lib/command/AcApOpenCmd.d.ts +3 -22
  44. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  45. package/lib/command/AcApOpenCmd.js +3 -22
  46. package/lib/command/AcApOpenCmd.js.map +1 -1
  47. package/lib/command/AcApRedoCmd.d.ts +10 -0
  48. package/lib/command/AcApRedoCmd.d.ts.map +1 -0
  49. package/lib/command/AcApRedoCmd.js +85 -0
  50. package/lib/command/AcApRedoCmd.js.map +1 -0
  51. package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
  52. package/lib/command/AcApSysVarCmd.js +5 -11
  53. package/lib/command/AcApSysVarCmd.js.map +1 -1
  54. package/lib/command/AcApUndoCmd.d.ts +10 -0
  55. package/lib/command/AcApUndoCmd.d.ts.map +1 -0
  56. package/lib/command/AcApUndoCmd.js +85 -0
  57. package/lib/command/AcApUndoCmd.js.map +1 -0
  58. package/lib/command/convert/AcApPngConvertor.d.ts +1 -1
  59. package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -1
  60. package/lib/command/convert/AcApPngConvertor.js +5 -2
  61. package/lib/command/convert/AcApPngConvertor.js.map +1 -1
  62. package/lib/command/draw/AcApArcCmd.d.ts.map +1 -1
  63. package/lib/command/draw/AcApArcCmd.js +2 -5
  64. package/lib/command/draw/AcApArcCmd.js.map +1 -1
  65. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
  66. package/lib/command/draw/AcApEllipseCmd.js +14 -9
  67. package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
  68. package/lib/command/draw/AcApHatchCmd.d.ts +1 -1
  69. package/lib/command/draw/AcApLineCmd.d.ts.map +1 -1
  70. package/lib/command/draw/AcApLineCmd.js +8 -2
  71. package/lib/command/draw/AcApLineCmd.js.map +1 -1
  72. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
  73. package/lib/command/draw/AcApMLineCmd.js +4 -2
  74. package/lib/command/draw/AcApMLineCmd.js.map +1 -1
  75. package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
  76. package/lib/command/draw/AcApPolygonCmd.js +2 -5
  77. package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
  78. package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -1
  79. package/lib/command/draw/AcApPolylineCmd.js +3 -0
  80. package/lib/command/draw/AcApPolylineCmd.js.map +1 -1
  81. package/lib/command/draw/AcApRectCmd.d.ts +6 -0
  82. package/lib/command/draw/AcApRectCmd.d.ts.map +1 -1
  83. package/lib/command/draw/AcApRectCmd.js +12 -10
  84. package/lib/command/draw/AcApRectCmd.js.map +1 -1
  85. package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -1
  86. package/lib/command/draw/AcApSplineCmd.js +2 -0
  87. package/lib/command/draw/AcApSplineCmd.js.map +1 -1
  88. package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -1
  89. package/lib/command/draw/AcApXLineCmd.js +1 -1
  90. package/lib/command/draw/AcApXLineCmd.js.map +1 -1
  91. package/lib/command/index.d.ts +3 -0
  92. package/lib/command/index.d.ts.map +1 -1
  93. package/lib/command/index.js +3 -0
  94. package/lib/command/index.js.map +1 -1
  95. package/lib/command/layer/AcApLayerCmd.d.ts +3 -194
  96. package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
  97. package/lib/command/layer/AcApLayerCmd.js +64 -398
  98. package/lib/command/layer/AcApLayerCmd.js.map +1 -1
  99. package/lib/command/layer/AcApLayerCurCmd.d.ts +2 -34
  100. package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
  101. package/lib/command/layer/AcApLayerCurCmd.js +18 -77
  102. package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
  103. package/lib/command/layer/AcApLayerDelCmd.d.ts +2 -32
  104. package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
  105. package/lib/command/layer/AcApLayerDelCmd.js +26 -169
  106. package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
  107. package/lib/command/layer/AcApLayerFreezeCmd.d.ts +2 -16
  108. package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
  109. package/lib/command/layer/AcApLayerFreezeCmd.js +32 -54
  110. package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
  111. package/lib/command/layer/AcApLayerIsoCmd.d.ts +2 -31
  112. package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
  113. package/lib/command/layer/AcApLayerIsoCmd.js +19 -198
  114. package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
  115. package/lib/command/layer/AcApLayerLockCmd.d.ts +2 -40
  116. package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
  117. package/lib/command/layer/AcApLayerLockCmd.js +18 -65
  118. package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
  119. package/lib/command/layer/AcApLayerMutationCmd.d.ts +13 -0
  120. package/lib/command/layer/AcApLayerMutationCmd.d.ts.map +1 -0
  121. package/lib/command/layer/AcApLayerMutationCmd.js +42 -0
  122. package/lib/command/layer/AcApLayerMutationCmd.js.map +1 -0
  123. package/lib/command/layer/AcApLayerOffCmd.d.ts +2 -9
  124. package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
  125. package/lib/command/layer/AcApLayerOffCmd.js +32 -43
  126. package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
  127. package/lib/command/layer/AcApLayerOnCmd.d.ts +2 -22
  128. package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
  129. package/lib/command/layer/AcApLayerOnCmd.js +8 -62
  130. package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
  131. package/lib/command/layer/AcApLayerPCmd.d.ts +2 -75
  132. package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
  133. package/lib/command/layer/AcApLayerPCmd.js +6 -165
  134. package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
  135. package/lib/command/layer/AcApLayerThawCmd.d.ts +2 -29
  136. package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
  137. package/lib/command/layer/AcApLayerThawCmd.js +8 -74
  138. package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
  139. package/lib/command/layer/AcApLayerUnisoCmd.d.ts +2 -44
  140. package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
  141. package/lib/command/layer/AcApLayerUnisoCmd.js +10 -122
  142. package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
  143. package/lib/command/layer/AcApLayerUnlockCmd.d.ts +2 -40
  144. package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
  145. package/lib/command/layer/AcApLayerUnlockCmd.js +18 -65
  146. package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
  147. package/lib/command/modify/AcApCopyCmd.d.ts +12 -0
  148. package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -1
  149. package/lib/command/modify/AcApCopyCmd.js +67 -177
  150. package/lib/command/modify/AcApCopyCmd.js.map +1 -1
  151. package/lib/command/modify/AcApCopyPreviewJig.d.ts +21 -0
  152. package/lib/command/modify/AcApCopyPreviewJig.d.ts.map +1 -0
  153. package/lib/command/modify/AcApCopyPreviewJig.js +61 -0
  154. package/lib/command/modify/AcApCopyPreviewJig.js.map +1 -0
  155. package/lib/command/modify/AcApEraseCmd.d.ts +0 -6
  156. package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -1
  157. package/lib/command/modify/AcApEraseCmd.js +11 -38
  158. package/lib/command/modify/AcApEraseCmd.js.map +1 -1
  159. package/lib/command/modify/AcApHideObjectsCmd.d.ts +0 -7
  160. package/lib/command/modify/AcApHideObjectsCmd.d.ts.map +1 -1
  161. package/lib/command/modify/AcApHideObjectsCmd.js +1 -8
  162. package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
  163. package/lib/command/modify/AcApMoveCmd.d.ts +0 -6
  164. package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -1
  165. package/lib/command/modify/AcApMoveCmd.js +26 -105
  166. package/lib/command/modify/AcApMoveCmd.js.map +1 -1
  167. package/lib/command/modify/AcApMovePreviewJig.d.ts +18 -0
  168. package/lib/command/modify/AcApMovePreviewJig.d.ts.map +1 -0
  169. package/lib/command/modify/AcApMovePreviewJig.js +45 -0
  170. package/lib/command/modify/AcApMovePreviewJig.js.map +1 -0
  171. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
  172. package/lib/command/modify/AcApOffsetCmd.js +14 -37
  173. package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
  174. package/lib/command/modify/AcApRotateCmd.d.ts +2 -2
  175. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
  176. package/lib/command/modify/AcApRotateCmd.js +38 -204
  177. package/lib/command/modify/AcApRotateCmd.js.map +1 -1
  178. package/lib/command/modify/AcApRotatePreviewJig.d.ts +47 -0
  179. package/lib/command/modify/AcApRotatePreviewJig.d.ts.map +1 -0
  180. package/lib/command/modify/AcApRotatePreviewJig.js +97 -0
  181. package/lib/command/modify/AcApRotatePreviewJig.js.map +1 -0
  182. package/lib/command/modify/AcApUnisolateObjectsCmd.d.ts.map +1 -1
  183. package/lib/command/modify/AcApUnisolateObjectsCmd.js +3 -3
  184. package/lib/command/modify/AcApUnisolateObjectsCmd.js.map +1 -1
  185. package/lib/editor/command/AcEdCommand.d.ts +24 -0
  186. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  187. package/lib/editor/command/AcEdCommand.js +71 -5
  188. package/lib/editor/command/AcEdCommand.js.map +1 -1
  189. package/lib/editor/global/AcEdUiColor.d.ts +13 -13
  190. package/lib/editor/global/AcEdUiColor.d.ts.map +1 -1
  191. package/lib/editor/global/AcEdUiColor.js +21 -20
  192. package/lib/editor/global/AcEdUiColor.js.map +1 -1
  193. package/lib/editor/global/eventBus.d.ts +16 -2
  194. package/lib/editor/global/eventBus.d.ts.map +1 -1
  195. package/lib/editor/global/eventBus.js.map +1 -1
  196. package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
  197. package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -0
  198. package/lib/editor/grip/AcEdGripAppearance.js +30 -0
  199. package/lib/editor/grip/AcEdGripAppearance.js.map +1 -0
  200. package/lib/editor/grip/AcEdGripEditSession.d.ts +29 -0
  201. package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -0
  202. package/lib/editor/grip/AcEdGripEditSession.js +83 -0
  203. package/lib/editor/grip/AcEdGripEditSession.js.map +1 -0
  204. package/lib/editor/grip/AcEdGripHandle.d.ts +21 -0
  205. package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -0
  206. package/lib/editor/grip/AcEdGripHandle.js +62 -0
  207. package/lib/editor/grip/AcEdGripHandle.js.map +1 -0
  208. package/lib/editor/grip/AcEdGripManager.d.ts +171 -0
  209. package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -0
  210. package/lib/editor/grip/AcEdGripManager.js +376 -0
  211. package/lib/editor/grip/AcEdGripManager.js.map +1 -0
  212. package/lib/editor/grip/AcEdGripPolicy.d.ts +6 -0
  213. package/lib/editor/grip/AcEdGripPolicy.d.ts.map +1 -0
  214. package/lib/editor/grip/AcEdGripPolicy.js +30 -0
  215. package/lib/editor/grip/AcEdGripPolicy.js.map +1 -0
  216. package/lib/editor/grip/AcEdGripPreviewJig.d.ts +21 -0
  217. package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -0
  218. package/lib/editor/grip/AcEdGripPreviewJig.js +73 -0
  219. package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -0
  220. package/lib/editor/grip/index.d.ts +5 -0
  221. package/lib/editor/grip/index.d.ts.map +1 -0
  222. package/lib/editor/grip/index.js +5 -0
  223. package/lib/editor/grip/index.js.map +1 -0
  224. package/lib/editor/index.d.ts +1 -0
  225. package/lib/editor/index.d.ts.map +1 -1
  226. package/lib/editor/index.js +1 -0
  227. package/lib/editor/index.js.map +1 -1
  228. package/lib/editor/input/AcEdBatchPreview.d.ts +96 -0
  229. package/lib/editor/input/AcEdBatchPreview.d.ts.map +1 -0
  230. package/lib/editor/input/AcEdBatchPreview.js +125 -0
  231. package/lib/editor/input/AcEdBatchPreview.js.map +1 -0
  232. package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
  233. package/lib/editor/input/AcEdCursorManager.js +2 -2
  234. package/lib/editor/input/AcEdCursorManager.js.map +1 -1
  235. package/lib/editor/input/AcEdOsnapResolver.d.ts +34 -0
  236. package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -0
  237. package/lib/editor/input/AcEdOsnapResolver.js +117 -0
  238. package/lib/editor/input/AcEdOsnapResolver.js.map +1 -0
  239. package/lib/editor/input/AcEdPreviewJig.d.ts +1 -1
  240. package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -1
  241. package/lib/editor/input/AcEdPreviewJig.js +14 -0
  242. package/lib/editor/input/AcEdPreviewJig.js.map +1 -1
  243. package/lib/editor/input/AcEdSelectionPreviewJig.d.ts +109 -0
  244. package/lib/editor/input/AcEdSelectionPreviewJig.d.ts.map +1 -0
  245. package/lib/editor/input/AcEdSelectionPreviewJig.js +185 -0
  246. package/lib/editor/input/AcEdSelectionPreviewJig.js.map +1 -0
  247. package/lib/editor/input/handler/AcEdAngleHandler.d.ts +2 -1
  248. package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -1
  249. package/lib/editor/input/handler/AcEdAngleHandler.js +6 -0
  250. package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -1
  251. package/lib/editor/input/handler/AcEdInputHandler.d.ts +20 -1
  252. package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -1
  253. package/lib/editor/input/handler/AcEdKeywordHandler.d.ts +2 -1
  254. package/lib/editor/input/handler/AcEdKeywordHandler.d.ts.map +1 -1
  255. package/lib/editor/input/handler/AcEdKeywordHandler.js +3 -0
  256. package/lib/editor/input/handler/AcEdKeywordHandler.js.map +1 -1
  257. package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +2 -1
  258. package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -1
  259. package/lib/editor/input/handler/AcEdNumericalHandler.js +6 -0
  260. package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -1
  261. package/lib/editor/input/handler/AcEdPointHandler.d.ts +17 -1
  262. package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
  263. package/lib/editor/input/handler/AcEdPointHandler.js +89 -0
  264. package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
  265. package/lib/editor/input/handler/AcEdStringHandler.d.ts +2 -1
  266. package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -1
  267. package/lib/editor/input/handler/AcEdStringHandler.js +3 -0
  268. package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -1
  269. package/lib/editor/input/index.d.ts +3 -0
  270. package/lib/editor/input/index.d.ts.map +1 -1
  271. package/lib/editor/input/index.js +3 -0
  272. package/lib/editor/input/index.js.map +1 -1
  273. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
  274. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
  275. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
  276. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
  277. package/lib/editor/input/session/AcEdInputSession.d.ts +11 -1
  278. package/lib/editor/input/session/AcEdInputSession.d.ts.map +1 -1
  279. package/lib/editor/input/session/AcEdInputSession.js.map +1 -1
  280. package/lib/editor/input/session/AcEdPromptInputSession.d.ts +51 -0
  281. package/lib/editor/input/session/AcEdPromptInputSession.d.ts.map +1 -0
  282. package/lib/editor/input/session/AcEdPromptInputSession.js +109 -0
  283. package/lib/editor/input/session/AcEdPromptInputSession.js.map +1 -0
  284. package/lib/editor/input/session/index.d.ts +1 -0
  285. package/lib/editor/input/session/index.d.ts.map +1 -1
  286. package/lib/editor/input/session/index.js +1 -0
  287. package/lib/editor/input/session/index.js.map +1 -1
  288. package/lib/editor/input/ui/AcEdCommandLine.d.ts +10 -0
  289. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  290. package/lib/editor/input/ui/AcEdCommandLine.js +67 -35
  291. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  292. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +0 -11
  293. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  294. package/lib/editor/input/ui/AcEdFloatingInput.js +9 -119
  295. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  296. package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -1
  297. package/lib/editor/input/ui/AcEdFloatingInputBox.js +10 -2
  298. package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
  299. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
  300. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +9 -4
  301. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
  302. package/lib/editor/input/ui/AcEdInputManager.d.ts +26 -23
  303. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  304. package/lib/editor/input/ui/AcEdInputManager.js +135 -83
  305. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  306. package/lib/editor/input/ui/AcEdMTextEditor.js +2 -2
  307. package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
  308. package/lib/editor/view/AcEdBaseView.d.ts +44 -2
  309. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  310. package/lib/editor/view/AcEdBaseView.js +26 -12
  311. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  312. package/lib/editor/view/AcEdSpatialQueryResult.d.ts +28 -0
  313. package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
  314. package/lib/editor/view/AcEdSpatialQueryResult.js +65 -1
  315. package/lib/editor/view/AcEdSpatialQueryResult.js.map +1 -1
  316. package/lib/i18n/AcApI18n.d.ts +42 -0
  317. package/lib/i18n/AcApI18n.d.ts.map +1 -1
  318. package/lib/i18n/AcApI18n.js +56 -4
  319. package/lib/i18n/AcApI18n.js.map +1 -1
  320. package/lib/i18n/en/command.d.ts +26 -0
  321. package/lib/i18n/en/command.d.ts.map +1 -1
  322. package/lib/i18n/en/command.js +26 -0
  323. package/lib/i18n/en/command.js.map +1 -1
  324. package/lib/i18n/en/jig.d.ts +26 -0
  325. package/lib/i18n/en/jig.d.ts.map +1 -1
  326. package/lib/i18n/en/jig.js +134 -108
  327. package/lib/i18n/en/jig.js.map +1 -1
  328. package/lib/i18n/en/main.d.ts +3 -0
  329. package/lib/i18n/en/main.d.ts.map +1 -1
  330. package/lib/i18n/en/main.js +4 -1
  331. package/lib/i18n/en/main.js.map +1 -1
  332. package/lib/i18n/zh/command.d.ts +26 -0
  333. package/lib/i18n/zh/command.d.ts.map +1 -1
  334. package/lib/i18n/zh/command.js +26 -0
  335. package/lib/i18n/zh/command.js.map +1 -1
  336. package/lib/i18n/zh/jig.d.ts +26 -0
  337. package/lib/i18n/zh/jig.d.ts.map +1 -1
  338. package/lib/i18n/zh/jig.js +134 -108
  339. package/lib/i18n/zh/jig.js.map +1 -1
  340. package/lib/i18n/zh/main.d.ts +3 -0
  341. package/lib/i18n/zh/main.d.ts.map +1 -1
  342. package/lib/i18n/zh/main.js +4 -1
  343. package/lib/i18n/zh/main.js.map +1 -1
  344. package/lib/index.d.ts +1 -0
  345. package/lib/index.d.ts.map +1 -1
  346. package/lib/index.js +1 -0
  347. package/lib/index.js.map +1 -1
  348. package/lib/plugin/AcApLazyPluginRegistration.d.ts +3 -8
  349. package/lib/plugin/AcApLazyPluginRegistration.d.ts.map +1 -1
  350. package/lib/service/AcApEntitySelection.d.ts +42 -0
  351. package/lib/service/AcApEntitySelection.d.ts.map +1 -0
  352. package/lib/service/AcApEntitySelection.js +156 -0
  353. package/lib/service/AcApEntitySelection.js.map +1 -0
  354. package/lib/service/AcApEntityService.d.ts +115 -0
  355. package/lib/service/AcApEntityService.d.ts.map +1 -0
  356. package/lib/service/AcApEntityService.js +194 -0
  357. package/lib/service/AcApEntityService.js.map +1 -0
  358. package/lib/{command/layer → service}/AcApLayerIsoState.d.ts +6 -24
  359. package/lib/service/AcApLayerIsoState.d.ts.map +1 -0
  360. package/lib/service/AcApLayerIsoState.js +28 -0
  361. package/lib/service/AcApLayerIsoState.js.map +1 -0
  362. package/lib/service/AcApLayerService.d.ts +400 -0
  363. package/lib/service/AcApLayerService.d.ts.map +1 -0
  364. package/lib/service/AcApLayerService.js +1240 -0
  365. package/lib/service/AcApLayerService.js.map +1 -0
  366. package/lib/service/AcApLayerStore.d.ts +198 -0
  367. package/lib/service/AcApLayerStore.d.ts.map +1 -0
  368. package/lib/service/AcApLayerStore.js +335 -0
  369. package/lib/service/AcApLayerStore.js.map +1 -0
  370. package/lib/service/AcApServiceEdit.d.ts +18 -0
  371. package/lib/service/AcApServiceEdit.d.ts.map +1 -0
  372. package/lib/service/AcApServiceEdit.js +34 -0
  373. package/lib/service/AcApServiceEdit.js.map +1 -0
  374. package/lib/service/index.d.ts +16 -0
  375. package/lib/service/index.d.ts.map +1 -0
  376. package/lib/service/index.js +16 -0
  377. package/lib/service/index.js.map +1 -0
  378. package/lib/service/types.d.ts +116 -0
  379. package/lib/service/types.d.ts.map +1 -0
  380. package/lib/service/types.js +5 -0
  381. package/lib/service/types.js.map +1 -0
  382. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +22 -7
  383. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  384. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +58 -12
  385. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  386. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +2 -2
  387. package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
  388. package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -3
  389. package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
  390. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +2 -2
  391. package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
  392. package/lib/spatialIndex/AcTrRBushSpatialIndex.js +19 -5
  393. package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
  394. package/lib/spatialIndex/AcTrSpatialIndex.d.ts +10 -1
  395. package/lib/spatialIndex/AcTrSpatialIndex.d.ts.map +1 -1
  396. package/lib/spatialIndex/AcTrSpatialIndex.js +7 -1
  397. package/lib/spatialIndex/AcTrSpatialIndex.js.map +1 -1
  398. package/lib/util/AcApDatabaseEdit.d.ts +11 -0
  399. package/lib/util/AcApDatabaseEdit.d.ts.map +1 -0
  400. package/lib/util/AcApDatabaseEdit.js +20 -0
  401. package/lib/util/AcApDatabaseEdit.js.map +1 -0
  402. package/lib/util/AcApFontUtil.d.ts +14 -2
  403. package/lib/util/AcApFontUtil.d.ts.map +1 -1
  404. package/lib/util/AcApFontUtil.js +18 -0
  405. package/lib/util/AcApFontUtil.js.map +1 -1
  406. package/lib/util/AcApGeTransform.d.ts +10 -0
  407. package/lib/util/AcApGeTransform.d.ts.map +1 -0
  408. package/lib/util/AcApGeTransform.js +15 -0
  409. package/lib/util/AcApGeTransform.js.map +1 -0
  410. package/lib/util/index.d.ts +2 -0
  411. package/lib/util/index.d.ts.map +1 -1
  412. package/lib/util/index.js +2 -0
  413. package/lib/util/index.js.map +1 -1
  414. package/lib/view/AcEdViewKeyHandler.d.ts +32 -0
  415. package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -0
  416. package/lib/view/AcEdViewKeyHandler.js +101 -0
  417. package/lib/view/AcEdViewKeyHandler.js.map +1 -0
  418. package/lib/view/AcTrEntityDisplayController.d.ts +46 -0
  419. package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -0
  420. package/lib/view/AcTrEntityDisplayController.js +114 -0
  421. package/lib/view/AcTrEntityDisplayController.js.map +1 -0
  422. package/lib/view/AcTrGroupWcsBboxAssert.d.ts +43 -0
  423. package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -0
  424. package/lib/view/AcTrGroupWcsBboxAssert.js +84 -0
  425. package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -0
  426. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +49 -0
  427. package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -0
  428. package/lib/view/AcTrInheritedLayerMaterialMapper.js +138 -0
  429. package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -0
  430. package/lib/view/AcTrLayer.d.ts +33 -2
  431. package/lib/view/AcTrLayer.d.ts.map +1 -1
  432. package/lib/view/AcTrLayer.js +75 -2
  433. package/lib/view/AcTrLayer.js.map +1 -1
  434. package/lib/view/AcTrLayerAppearanceController.d.ts +55 -0
  435. package/lib/view/AcTrLayerAppearanceController.d.ts.map +1 -0
  436. package/lib/view/AcTrLayerAppearanceController.js +86 -0
  437. package/lib/view/AcTrLayerAppearanceController.js.map +1 -0
  438. package/lib/view/AcTrLayout.d.ts +37 -2
  439. package/lib/view/AcTrLayout.d.ts.map +1 -1
  440. package/lib/view/AcTrLayout.js +161 -15
  441. package/lib/view/AcTrLayout.js.map +1 -1
  442. package/lib/view/AcTrProgressiveOpenFitController.d.ts +64 -0
  443. package/lib/view/AcTrProgressiveOpenFitController.d.ts.map +1 -0
  444. package/lib/view/AcTrProgressiveOpenFitController.js +209 -0
  445. package/lib/view/AcTrProgressiveOpenFitController.js.map +1 -0
  446. package/lib/view/AcTrScene.d.ts +47 -1
  447. package/lib/view/AcTrScene.d.ts.map +1 -1
  448. package/lib/view/AcTrScene.js +78 -3
  449. package/lib/view/AcTrScene.js.map +1 -1
  450. package/lib/view/AcTrView2d.d.ts +118 -27
  451. package/lib/view/AcTrView2d.d.ts.map +1 -1
  452. package/lib/view/AcTrView2d.js +584 -362
  453. package/lib/view/AcTrView2d.js.map +1 -1
  454. package/lib/view/index.d.ts +3 -0
  455. package/lib/view/index.d.ts.map +1 -1
  456. package/lib/view/index.js +3 -0
  457. package/lib/view/index.js.map +1 -1
  458. package/package.json +13 -11
  459. package/dist/index.umd.cjs +0 -897
  460. package/lib/command/layer/AcApLayerIsoState.d.ts.map +0 -1
  461. package/lib/command/layer/AcApLayerIsoState.js +0 -53
  462. package/lib/command/layer/AcApLayerIsoState.js.map +0 -1
@@ -0,0 +1,84 @@
1
+ var __values = (this && this.__values) || function(o) {
2
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
+ if (m) return m.call(o);
4
+ if (o && typeof o.length === "number") return {
5
+ next: function () {
6
+ if (o && i >= o.length) o = void 0;
7
+ return { value: o && o[i++], done: !o };
8
+ }
9
+ };
10
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
+ };
12
+ import * as THREE from 'three';
13
+ var WCS_BBOX_TOLERANCE = 1e-5;
14
+ /**
15
+ * Tests whether a 2D axis-aligned box has finite extents.
16
+ *
17
+ * Deferred MText/Shape geometry can seed `±Infinity` placeholders in
18
+ * {@link AcTrGroup.wcsChildBoxes}; those entries must be skipped when unioning
19
+ * bounds for spatial indexing.
20
+ */
21
+ export function isFiniteSpatialBBox(box) {
22
+ return (Number.isFinite(box.minX) &&
23
+ Number.isFinite(box.minY) &&
24
+ Number.isFinite(box.maxX) &&
25
+ Number.isFinite(box.maxY));
26
+ }
27
+ /**
28
+ * Unions per-child WCS boxes into one axis-aligned WCS box.
29
+ *
30
+ * Non-finite child boxes are skipped, matching
31
+ * {@link AcTrGroup.syncWcsBboxFromChildBoxes}.
32
+ */
33
+ export function unionGroupWcsChildBoxes(group) {
34
+ var e_1, _a;
35
+ var union = new THREE.Box3();
36
+ try {
37
+ for (var _b = __values(group.wcsChildBoxes), _c = _b.next(); !_c.done; _c = _b.next()) {
38
+ var box = _c.value;
39
+ if (!isFiniteSpatialBBox(box)) {
40
+ continue;
41
+ }
42
+ union.union(new THREE.Box3(new THREE.Vector3(box.minX, box.minY, 0), new THREE.Vector3(box.maxX, box.maxY, 0)));
43
+ }
44
+ }
45
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
46
+ finally {
47
+ try {
48
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
49
+ }
50
+ finally { if (e_1) throw e_1.error; }
51
+ }
52
+ return union;
53
+ }
54
+ /**
55
+ * Verifies that a block group's aggregate {@link AcTrGroup.wcsBbox} matches the
56
+ * union of its per-child {@link AcTrGroup.wcsChildBoxes}.
57
+ *
58
+ * Called from {@link AcTrView2d.handleGroup} in non-production builds. After
59
+ * {@link AcDbRenderingCache.draw} applies the INSERT transform via
60
+ * `applyMatrix`, both fields must stay in sync for spatial indexing.
61
+ */
62
+ export function assertGroupWcsBboxesConsistent(group) {
63
+ if (group.wcsChildBoxes.length === 0) {
64
+ return;
65
+ }
66
+ var union = unionGroupWcsChildBoxes(group);
67
+ var wcs = group.wcsBbox;
68
+ var cornersMatch = Math.abs(wcs.min.x - union.min.x) <= WCS_BBOX_TOLERANCE &&
69
+ Math.abs(wcs.min.y - union.min.y) <= WCS_BBOX_TOLERANCE &&
70
+ Math.abs(wcs.min.z - union.min.z) <= WCS_BBOX_TOLERANCE &&
71
+ Math.abs(wcs.max.x - union.max.x) <= WCS_BBOX_TOLERANCE &&
72
+ Math.abs(wcs.max.y - union.max.y) <= WCS_BBOX_TOLERANCE &&
73
+ Math.abs(wcs.max.z - union.max.z) <= WCS_BBOX_TOLERANCE;
74
+ if (!cornersMatch) {
75
+ throw new Error("[AcTrView2d] Group wcsBbox [".concat(wcs.min.x, ", ").concat(wcs.min.y, "]\u2013[").concat(wcs.max.x, ", ").concat(wcs.max.y, "] ") +
76
+ "does not match wcsChildBoxes union [".concat(union.min.x, ", ").concat(union.min.y, "]\u2013[").concat(union.max.x, ", ").concat(union.max.y, "]. ") +
77
+ 'Ensure AcDbRenderingCache.draw applied the INSERT transform before handleGroup.');
78
+ }
79
+ }
80
+ /** @internal Narrow helper for handleGroup dev checks. */
81
+ export function assertAcTrGroupWcsBboxesConsistent(group) {
82
+ assertGroupWcsBboxesConsistent(group);
83
+ }
84
+ //# sourceMappingURL=AcTrGroupWcsBboxAssert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcTrGroupWcsBboxAssert.js","sourceRoot":"","sources":["../../src/view/AcTrGroupWcsBboxAssert.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,IAAM,kBAAkB,GAAG,IAAI,CAAA;AAY/B;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAKnC;IACC,OAAO,CACL,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAC1B,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAA2B;;IAE3B,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;;QAC9B,KAAkB,IAAA,KAAA,SAAA,KAAK,CAAC,aAAa,CAAA,gBAAA,4BAAE,CAAC;YAAnC,IAAM,GAAG,WAAA;YACZ,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,SA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,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAA;IAEzD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,sCAA+B,GAAG,CAAC,GAAG,CAAC,CAAC,eAAK,GAAG,CAAC,GAAG,CAAC,CAAC,qBAAM,GAAG,CAAC,GAAG,CAAC,CAAC,eAAK,GAAG,CAAC,GAAG,CAAC,CAAC,OAAI;YACrF,8CAAuC,KAAK,CAAC,GAAG,CAAC,CAAC,eAAK,KAAK,CAAC,GAAG,CAAC,CAAC,qBAAM,KAAK,CAAC,GAAG,CAAC,CAAC,eAAK,KAAK,CAAC,GAAG,CAAC,CAAC,QAAK;YACxG,iFAAiF,CACpF,CAAA;IACH,CAAC;AACH,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,kCAAkC,CAAC,KAAgB;IACjE,8BAA8B,CAAC,KAAK,CAAC,CAAA;AACvC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { AcGiSubEntityTraits } from '@mlightcad/data-model';
2
+ import { AcTrRenderer } from '@mlightcad/three-renderer';
3
+ import * as THREE from 'three';
4
+ /**
5
+ * Remaps layer metadata and material bindings when block contents inherit an INSERT layer.
6
+ *
7
+ * AutoCAD requires entities authored on layer "0" inside a block to inherit the INSERT's
8
+ * layer for ByLayer traits. This mapper mutates drawable `userData.layerName` and rebinds
9
+ * materials via the renderer style cache so subsequent layer-level style edits target the
10
+ * correct material instances.
11
+ */
12
+ export declare class AcTrInheritedLayerMaterialMapper {
13
+ private readonly getLayerTraits;
14
+ private readonly renderer;
15
+ /**
16
+ * @param getLayerTraits - Resolves live layer-table traits for an effective layer name.
17
+ * @param renderer - Renderer used to rebind materials through the style cache.
18
+ */
19
+ constructor(getLayerTraits: (layerName: string) => Partial<AcGiSubEntityTraits> | undefined, renderer: AcTrRenderer);
20
+ /**
21
+ * Remaps materials for objects in a layer bucket after INSERT decomposition.
22
+ *
23
+ * @param objects - Root objects in the current layer bucket to traverse and remap.
24
+ * @param sourceLayerName - Layer name found in the block definition before inheritance.
25
+ * @param effectiveLayerName - Final layer name used by rendering and style updates.
26
+ */
27
+ remap(objects: THREE.Object3D[], sourceLayerName: string, effectiveLayerName: string): void;
28
+ /**
29
+ * Layer-0 block contents with ByLayer color resolve to ACI-7 foreground materials before
30
+ * INSERT remapping. Those materials must still inherit the INSERT layer when their colour
31
+ * is layer-bound, while explicit ACI-7 entities on layer 0 stay untouched.
32
+ *
33
+ * @param material - Candidate material to evaluate for INSERT-layer rebinding.
34
+ * @param sourceLayerName - Layer name from the block definition before inheritance.
35
+ * @returns True when the material should be rebound to the INSERT layer.
36
+ */
37
+ private shouldRemap;
38
+ /**
39
+ * Some DXF conversion paths lose `isByLayerColor` on layer-0 block contents while still
40
+ * retaining other ByLayer markers (lineType/lineWeight/transparency). For AutoCAD-compatible
41
+ * INSERT inheritance, treat such colors as inheritable when remapping from layer "0".
42
+ *
43
+ * @param material - Material whose ByLayer metadata may need normalization.
44
+ * @param sourceLayerName - Source bucket layer name (typically `"0"`).
45
+ * @returns The same material instance, possibly with patched metadata.
46
+ */
47
+ private promoteLayerZeroByLayerColor;
48
+ }
49
+ //# sourceMappingURL=AcTrInheritedLayerMaterialMapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcTrInheritedLayerMaterialMapper.d.ts","sourceRoot":"","sources":["../../src/view/AcTrInheritedLayerMaterialMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EACL,YAAY,EAMb,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;;;;;GAOG;AACH,qBAAa,gCAAgC;IAMzC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAG/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B;;;OAGG;gBAEgB,cAAc,EAAE,CAC/B,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,EAC5B,QAAQ,EAAE,YAAY;IAGzC;;;;;;OAMG;IACH,KAAK,CACH,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,EACzB,eAAe,EAAE,MAAM,EACvB,kBAAkB,EAAE,MAAM,GACzB,IAAI;IAoEP;;;;;;;;OAQG;IACH,OAAO,CAAC,WAAW;IAsBnB;;;;;;;;OAQG;IACH,OAAO,CAAC,4BAA4B;CAarC"}
@@ -0,0 +1,138 @@
1
+ var __values = (this && this.__values) || function(o) {
2
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
+ if (m) return m.call(o);
4
+ if (o && typeof o.length === "number") return {
5
+ next: function () {
6
+ if (o && i >= o.length) o = void 0;
7
+ return { value: o && o[i++], done: !o };
8
+ }
9
+ };
10
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
+ };
12
+ import { getMaterialMetadata, getSceneDrawableUserData, hasByLayerBinding, setMaterialMetadata, syncStyleMaterialIdFromMaterials } from '@mlightcad/three-renderer';
13
+ /**
14
+ * Remaps layer metadata and material bindings when block contents inherit an INSERT layer.
15
+ *
16
+ * AutoCAD requires entities authored on layer "0" inside a block to inherit the INSERT's
17
+ * layer for ByLayer traits. This mapper mutates drawable `userData.layerName` and rebinds
18
+ * materials via the renderer style cache so subsequent layer-level style edits target the
19
+ * correct material instances.
20
+ */
21
+ var AcTrInheritedLayerMaterialMapper = /** @class */ (function () {
22
+ /**
23
+ * @param getLayerTraits - Resolves live layer-table traits for an effective layer name.
24
+ * @param renderer - Renderer used to rebind materials through the style cache.
25
+ */
26
+ function AcTrInheritedLayerMaterialMapper(getLayerTraits, renderer) {
27
+ this.getLayerTraits = getLayerTraits;
28
+ this.renderer = renderer;
29
+ }
30
+ /**
31
+ * Remaps materials for objects in a layer bucket after INSERT decomposition.
32
+ *
33
+ * @param objects - Root objects in the current layer bucket to traverse and remap.
34
+ * @param sourceLayerName - Layer name found in the block definition before inheritance.
35
+ * @param effectiveLayerName - Final layer name used by rendering and style updates.
36
+ */
37
+ AcTrInheritedLayerMaterialMapper.prototype.remap = function (objects, sourceLayerName, effectiveLayerName) {
38
+ var e_1, _a;
39
+ var _this = this;
40
+ if (sourceLayerName === effectiveLayerName) {
41
+ return;
42
+ }
43
+ var layerTraits = this.getLayerTraits(effectiveLayerName);
44
+ try {
45
+ for (var objects_1 = __values(objects), objects_1_1 = objects_1.next(); !objects_1_1.done; objects_1_1 = objects_1.next()) {
46
+ var object = objects_1_1.value;
47
+ object.traverse(function (child) {
48
+ var inheritsInsertLayer = child.userData.layerName === sourceLayerName;
49
+ if (inheritsInsertLayer) {
50
+ child.userData.layerName = effectiveLayerName;
51
+ }
52
+ if (!('material' in child)) {
53
+ return;
54
+ }
55
+ // Only layer-"0" (or the current source bucket) inherits INSERT traits.
56
+ // Attributes/text on other layers must keep their own layer materials.
57
+ if (!inheritsInsertLayer) {
58
+ return;
59
+ }
60
+ var material = child.material;
61
+ if (Array.isArray(material)) {
62
+ var materials = material;
63
+ child.material = materials.map(function (entry) {
64
+ var _a;
65
+ if (!_this.shouldRemap(entry, sourceLayerName)) {
66
+ return entry;
67
+ }
68
+ return ((_a = _this.renderer.getLayerBoundMaterial(_this.promoteLayerZeroByLayerColor(entry, sourceLayerName), effectiveLayerName, layerTraits)) !== null && _a !== void 0 ? _a : entry);
69
+ });
70
+ syncStyleMaterialIdFromMaterials(getSceneDrawableUserData(child), child.material);
71
+ return;
72
+ }
73
+ if (!_this.shouldRemap(material, sourceLayerName)) {
74
+ return;
75
+ }
76
+ var remappedMaterial = _this.renderer.getLayerBoundMaterial(_this.promoteLayerZeroByLayerColor(material, sourceLayerName), effectiveLayerName, layerTraits);
77
+ if (!remappedMaterial) {
78
+ return;
79
+ }
80
+ child.material = remappedMaterial;
81
+ syncStyleMaterialIdFromMaterials(getSceneDrawableUserData(child), remappedMaterial);
82
+ });
83
+ }
84
+ }
85
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
86
+ finally {
87
+ try {
88
+ if (objects_1_1 && !objects_1_1.done && (_a = objects_1.return)) _a.call(objects_1);
89
+ }
90
+ finally { if (e_1) throw e_1.error; }
91
+ }
92
+ };
93
+ /**
94
+ * Layer-0 block contents with ByLayer color resolve to ACI-7 foreground materials before
95
+ * INSERT remapping. Those materials must still inherit the INSERT layer when their colour
96
+ * is layer-bound, while explicit ACI-7 entities on layer 0 stay untouched.
97
+ *
98
+ * @param material - Candidate material to evaluate for INSERT-layer rebinding.
99
+ * @param sourceLayerName - Layer name from the block definition before inheritance.
100
+ * @returns True when the material should be rebound to the INSERT layer.
101
+ */
102
+ AcTrInheritedLayerMaterialMapper.prototype.shouldRemap = function (material, sourceLayerName) {
103
+ var metadata = getMaterialMetadata(material);
104
+ if (metadata.isForeground !== true) {
105
+ return true;
106
+ }
107
+ if (sourceLayerName !== '0') {
108
+ return false;
109
+ }
110
+ if (metadata.isByLayerColor === true) {
111
+ return true;
112
+ }
113
+ return (sourceLayerName === '0' &&
114
+ (metadata.isByLayerLineType === true ||
115
+ metadata.isByLayerLineWeight === true ||
116
+ metadata.isByLayerTransparency === true));
117
+ };
118
+ /**
119
+ * Some DXF conversion paths lose `isByLayerColor` on layer-0 block contents while still
120
+ * retaining other ByLayer markers (lineType/lineWeight/transparency). For AutoCAD-compatible
121
+ * INSERT inheritance, treat such colors as inheritable when remapping from layer "0".
122
+ *
123
+ * @param material - Material whose ByLayer metadata may need normalization.
124
+ * @param sourceLayerName - Source bucket layer name (typically `"0"`).
125
+ * @returns The same material instance, possibly with patched metadata.
126
+ */
127
+ AcTrInheritedLayerMaterialMapper.prototype.promoteLayerZeroByLayerColor = function (material, sourceLayerName) {
128
+ var metadata = getMaterialMetadata(material);
129
+ var hasAnyOtherByLayerBinding = hasByLayerBinding(metadata) && metadata.isByLayerColor !== true;
130
+ if (sourceLayerName === '0' && hasAnyOtherByLayerBinding) {
131
+ setMaterialMetadata(material, { isByLayerColor: true });
132
+ }
133
+ return material;
134
+ };
135
+ return AcTrInheritedLayerMaterialMapper;
136
+ }());
137
+ export { AcTrInheritedLayerMaterialMapper };
138
+ //# sourceMappingURL=AcTrInheritedLayerMaterialMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcTrInheritedLayerMaterialMapper.js","sourceRoot":"","sources":["../../src/view/AcTrInheritedLayerMaterialMapper.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAEL,mBAAmB,EACnB,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,gCAAgC,EACjC,MAAM,2BAA2B,CAAA;AAGlC;;;;;;;GAOG;AACH;IACE;;;OAGG;IACH,0CACmB,cAE4B,EAC5B,QAAsB;QAHtB,mBAAc,GAAd,cAAc,CAEc;QAC5B,aAAQ,GAAR,QAAQ,CAAc;IACtC,CAAC;IAEJ;;;;;;OAMG;IACH,gDAAK,GAAL,UACE,OAAyB,EACzB,eAAuB,EACvB,kBAA0B;;QAH5B,iBAsEC;QAjEC,IAAI,eAAe,KAAK,kBAAkB,EAAE,CAAC;YAC3C,OAAM;QACR,CAAC;QAED,IAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAA;;YAC3D,KAAqB,IAAA,YAAA,SAAA,OAAO,CAAA,gCAAA,qDAAE,CAAC;gBAA1B,IAAM,MAAM,oBAAA;gBACf,MAAM,CAAC,QAAQ,CAAC,UAAA,KAAK;oBACnB,IAAM,mBAAmB,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,KAAK,eAAe,CAAA;oBACxE,IAAI,mBAAmB,EAAE,CAAC;wBACxB,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,kBAAkB,CAAA;oBAC/C,CAAC;oBAED,IAAI,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,EAAE,CAAC;wBAC3B,OAAM;oBACR,CAAC;oBACD,wEAAwE;oBACxE,uEAAuE;oBACvE,IAAI,C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AW,GAAnB,UACE,QAAwB,EACxB,eAAuB;QAEvB,IAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;QAC9C,IAAI,QAAQ,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YACnC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,IAAI,eAAe,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAA;QACd,CAAC;QACD,IAAI,QAAQ,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC;YACrC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,CACL,eAAe,KAAK,GAAG;YACvB,CAAC,QAAQ,CAAC,iBAAiB,KAAK,IAAI;gBAClC,QAAQ,CAAC,mBAAmB,KAAK,IAAI;gBACrC,QAAQ,CAAC,qBAAqB,KAAK,IAAI,CAAC,CAC3C,CAAA;IACH,CAAC;IAED;;;;;;;;OAQG;IACK,uEAA4B,GAApC,UACE,QAAwB,EACxB,eAAuB;QAEvB,IAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;QAC9C,IAAM,yBAAyB,GAC7B,iBAAiB,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,cAAc,KAAK,IAAI,CAAA;QAEjE,IAAI,eAAe,KAAK,GAAG,IAAI,yBAAyB,EAAE,CAAC;YACzD,mBAAmB,CAAC,QAAQ,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,OAAO,QAAQ,CAAA;IACjB,CAAC;IACH,uCAAC;AAAD,CAAC,AAhJD,IAgJC"}
@@ -1,5 +1,5 @@
1
- import { AcDbObjectId } from '@mlightcad/data-model';
2
- import { AcTrBatchedGroup, AcTrBatchedGroupStats, AcTrEntity } from '@mlightcad/three-renderer';
1
+ import { AcDbObjectId, AcGiSubEntityTraits } from '@mlightcad/data-model';
2
+ import { AcTrBatchedGroup, AcTrBatchedGroupStats, AcTrEntity, AcTrPreviewSubsetOptions, AcTrRenderer, AcTrStyleManager } from '@mlightcad/three-renderer';
3
3
  import * as THREE from 'three';
4
4
  import { AcEdLayerInfo } from '../editor';
5
5
  /**
@@ -60,6 +60,13 @@ export type AcTrLayerStats = AcTrBatchedGroupStats & {
60
60
  * ```
61
61
  */
62
62
  export declare class AcTrLayer {
63
+ /**
64
+ * Resolves whether a layer should be visible in the view.
65
+ *
66
+ * Non-plottable layer suppression is handled in {@link AcDbEntity.worldDraw};
67
+ * only freeze/off state is reflected here.
68
+ */
69
+ static isLayerVisible(info: AcEdLayerInfo): boolean;
63
70
  /**
64
71
  * Layer name
65
72
  */
@@ -117,6 +124,22 @@ export declare class AcTrLayer {
117
124
  * @param material - The new material associated with entities
118
125
  */
119
126
  updateMaterial(oldId: number, material: THREE.Material): void;
127
+ /**
128
+ * Refreshes drawable materials after a layer-table style change.
129
+ *
130
+ * Updates batched material ids when the style cache remaps instances, patches
131
+ * unbatched drawables, and rematerializes text glyph hierarchies.
132
+ *
133
+ * @param layerName - Target layer whose drawables should be refreshed.
134
+ * @param layerTraits - Resolved layer traits from the live layer-table record.
135
+ * @param materials - Style-cache material map, keyed by previous material id.
136
+ * @param renderer - Renderer used to rebind layer-bound materials.
137
+ */
138
+ syncAppearanceFromRecord(layerName: string, layerTraits: Partial<AcGiSubEntityTraits>, materials: Record<number, THREE.Material>, renderer: AcTrRenderer): void;
139
+ /** Rebinds batched drawables whose materials follow live layer-table style. */
140
+ rebindMaterialsForLayer(layerName: string, layerTraits: Partial<AcGiSubEntityTraits>, getLayerBoundMaterial: (material: THREE.Material, layerName: string, layerTraits?: Partial<AcGiSubEntityTraits>) => THREE.Material | undefined, styleManager?: AcTrStyleManager): void;
141
+ /** Rematerializes MTEXT/TEXT drawables stored as unbatched glyph subtrees. */
142
+ rematerializeLayerTextDrawables(layerName: string, styleManager: AcTrStyleManager, layerTraits?: Partial<AcGiSubEntityTraits>): void;
120
143
  /**
121
144
  * Re-render points with latest point style settings
122
145
  * @param displayMode Input display mode of points
@@ -137,6 +160,14 @@ export declare class AcTrLayer {
137
160
  * Returns the current scene visibility for one entity.
138
161
  */
139
162
  getEntityVisible(objectId: AcDbObjectId): boolean | undefined;
163
+ /**
164
+ * Builds a preview subset for entities stored in this layer group.
165
+ *
166
+ * @param entityIds - Database object ids to extract from this layer
167
+ * @param options - Optional preview style and slot limits
168
+ * @returns Preview subset group, or `null` when extraction failed
169
+ */
170
+ createPreviewSubset(entityIds: AcDbObjectId[], options?: AcTrPreviewSubsetOptions): THREE.Group<THREE.Object3DEventMap> | null;
140
171
  /**
141
172
  * Add one AutoCAD entity into this layer.
142
173
  * @param entity Input AutoCAD entity to be added into this layer.
@@ -1 +1 @@
1
- {"version":3,"file":"AcTrLayer.d.ts","sourceRoot":"","sources":["../../src/view/AcTrLayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,UAAU,EACX,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAEzC;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG;IACnD,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAA;QACb,YAAY,EAAE,MAAM,CAAA;QACpB,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAA;YACZ,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,MAAM,CAAA;SACd,CAAA;KACF,CAAA;CACF,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,OAAO,CAAC,KAAK,CAAQ;IACrB;;OAEG;IACH,OAAO,CAAC,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AE,gBAAgB,EAC9B,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAS5C;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM;IAIlC;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,YAAY;IAIhC;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO;IAIzD;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,YAAY;IAIvC;;;;;;OAMG;IACH,mBAAmB,CACjB,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,CAAC,EAAE,wBAAwB;IAKpC;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,GAAE,OAAc;IAKzD;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;IAI5D;;;;OAIG;IACH,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO;IAQ7C;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO;IAkBzC;;OAEG;IACH,KAAK;IAOL;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,YAAY,EAAE;IAMzB;;OAEG;IACH,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE;IAM3B;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,YAAY,EAAE;IAM1B;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE;CAK7B"}
@@ -9,6 +9,22 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
12
28
  import { AcTrBatchedGroup } from '@mlightcad/three-renderer';
13
29
  import * as THREE from 'three';
14
30
  /**
@@ -58,8 +74,17 @@ var AcTrLayer = /** @class */ (function () {
58
74
  this._name = layer.name;
59
75
  this._cachedBox = new THREE.Box3();
60
76
  this._boxDirty = true;
61
- this._group.visible = !(layer.isFrozen || layer.isOff);
77
+ this._group.visible = AcTrLayer.isLayerVisible(layer);
62
78
  }
79
+ /**
80
+ * Resolves whether a layer should be visible in the view.
81
+ *
82
+ * Non-plottable layer suppression is handled in {@link AcDbEntity.worldDraw};
83
+ * only freeze/off state is reflected here.
84
+ */
85
+ AcTrLayer.isLayerVisible = function (info) {
86
+ return !(info.isFrozen || info.isOff);
87
+ };
63
88
  Object.defineProperty(AcTrLayer.prototype, "name", {
64
89
  /**
65
90
  * Layer name
@@ -147,7 +172,7 @@ var AcTrLayer = /** @class */ (function () {
147
172
  AcTrLayer.prototype.update = function (value) {
148
173
  var wasVisible = this.visible;
149
174
  this._name = value.name;
150
- this._group.visible = !(value.isFrozen || value.isOff);
175
+ this._group.visible = AcTrLayer.isLayerVisible(value);
151
176
  if (wasVisible !== this.visible) {
152
177
  this._boxDirty = true;
153
178
  }
@@ -160,6 +185,44 @@ var AcTrLayer = /** @class */ (function () {
160
185
  AcTrLayer.prototype.updateMaterial = function (oldId, material) {
161
186
  this._group.updateMaterial(oldId, material);
162
187
  };
188
+ /**
189
+ * Refreshes drawable materials after a layer-table style change.
190
+ *
191
+ * Updates batched material ids when the style cache remaps instances, patches
192
+ * unbatched drawables, and rematerializes text glyph hierarchies.
193
+ *
194
+ * @param layerName - Target layer whose drawables should be refreshed.
195
+ * @param layerTraits - Resolved layer traits from the live layer-table record.
196
+ * @param materials - Style-cache material map, keyed by previous material id.
197
+ * @param renderer - Renderer used to rebind layer-bound materials.
198
+ */
199
+ AcTrLayer.prototype.syncAppearanceFromRecord = function (layerName, layerTraits, materials, renderer) {
200
+ var needsIdPatch = Object.entries(materials).some(function (_a) {
201
+ var _b = __read(_a, 2), oldId = _b[0], material = _b[1];
202
+ return material.id !== Number(oldId);
203
+ });
204
+ if (needsIdPatch) {
205
+ for (var id in materials) {
206
+ var oldId = Number(id);
207
+ var material = materials[id];
208
+ if (material.id === oldId) {
209
+ continue;
210
+ }
211
+ this.updateMaterial(oldId, material);
212
+ }
213
+ }
214
+ this._group.syncAppearanceFromRecord(layerName, layerTraits, materials, needsIdPatch, function (material, boundLayerName, boundLayerTraits) {
215
+ return renderer.getLayerBoundMaterial(material, boundLayerName, boundLayerTraits);
216
+ }, renderer.styleManager);
217
+ };
218
+ /** Rebinds batched drawables whose materials follow live layer-table style. */
219
+ AcTrLayer.prototype.rebindMaterialsForLayer = function (layerName, layerTraits, getLayerBoundMaterial, styleManager) {
220
+ this._group.rebindMaterialsForLayer(layerName, layerTraits, getLayerBoundMaterial, styleManager);
221
+ };
222
+ /** Rematerializes MTEXT/TEXT drawables stored as unbatched glyph subtrees. */
223
+ AcTrLayer.prototype.rematerializeLayerTextDrawables = function (layerName, styleManager, layerTraits) {
224
+ this._group.rematerializeLayerTextDrawables(layerName, styleManager, layerTraits);
225
+ };
163
226
  /**
164
227
  * Re-render points with latest point style settings
165
228
  * @param displayMode Input display mode of points
@@ -188,6 +251,16 @@ var AcTrLayer = /** @class */ (function () {
188
251
  AcTrLayer.prototype.getEntityVisible = function (objectId) {
189
252
  return this._group.getEntityVisible(objectId);
190
253
  };
254
+ /**
255
+ * Builds a preview subset for entities stored in this layer group.
256
+ *
257
+ * @param entityIds - Database object ids to extract from this layer
258
+ * @param options - Optional preview style and slot limits
259
+ * @returns Preview subset group, or `null` when extraction failed
260
+ */
261
+ AcTrLayer.prototype.createPreviewSubset = function (entityIds, options) {
262
+ return this._group.createPreviewSubset(entityIds, options);
263
+ };
191
264
  /**
192
265
  * Add one AutoCAD entity into this layer.
193
266
  * @param entity Input AutoCAD entity to be added into this layer.
@@ -1 +1 @@
1
- {"version":3,"file":"AcTrLayer.js","sourceRoot":"","sources":["../../src/view/AcTrLayer.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EACL,gBAAgB,EAGjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyB9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH;IAgBE;;;OAGG;IACH,mBAAY,KAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAA;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAA;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QACrB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,CAAA;IACxD,CAAC;IAKD,sBAAI,2BAAI;QAHR;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;aACD,UAAS,KAAa;YACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,CAAC;;;OAHA;IAYD,sBAAI,0BAAG;QAPP;;;;;;WAMG;aACH;YACE,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;gBAC7C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;YACxB,CAAC;YACD,OAAO,IAAI,CAAC,UAAU,CAAA;QACxB,CAAC;;;OAAA;IAED;;OAEG;IACH,2CAAuB,GAAvB,UACE,MAAyB,EACzB,gBAAsC;QADtC,uBAAA,EAAA,aAAa,KAAK,CAAC,IAAI,EAAE;QAGzB,IAAI,CAA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derer';
3
+ import * as THREE from 'three';
4
+ import { AcTrScene } from './AcTrScene';
5
+ /**
6
+ * Synchronizes scene drawable materials with live layer-table style changes.
7
+ *
8
+ * The host view ({@link AcTrView2d}) delegates layer add/update and background
9
+ * refresh entry points here so material cache updates, scene fan-out, and text
10
+ * rematerialization stay out of the view class.
11
+ */
12
+ export declare class AcTrLayerAppearanceController {
13
+ private readonly scene;
14
+ private readonly renderer;
15
+ private readonly getLayerTraits?;
16
+ /**
17
+ * @param scene - Scene whose layout layer groups receive appearance updates.
18
+ * @param renderer - Renderer whose draw context supplies the active database.
19
+ * @param getLayerTraits - Optional override for resolving live layer-table traits.
20
+ */
21
+ constructor(scene: AcTrScene, renderer: AcTrRenderer, getLayerTraits?: ((layerName: string) => Partial<AcGiSubEntityTraits> | undefined) | undefined);
22
+ /**
23
+ * Returns true when a layer-table edit may require material refresh.
24
+ *
25
+ * @param changes - Partial layer record attributes from the edit event.
26
+ * @returns True when color, linetype, lineweight, or transparency changed.
27
+ */
28
+ layerStyleMayHaveChanged(changes: Partial<AcDbLayerTableRecordAttrs>): boolean;
29
+ /**
30
+ * Refreshes cached layer materials from the live layer-table record and
31
+ * propagates the result to batched drawables and text hierarchies.
32
+ *
33
+ * @param layer - Live layer-table record whose traits should drive the refresh.
34
+ */
35
+ syncFromLiveRecord(layer: AcDbLayerTableRecord): void;
36
+ /**
37
+ * Rebinds text materials after INSERT groups are split/reparented or when the
38
+ * canvas background changes (ACI-7 foreground inversion).
39
+ *
40
+ * @param root - Object subtree to traverse for text refresh hooks.
41
+ * @param layerTraits - Optional resolved traits passed through to text wrappers.
42
+ */
43
+ refreshTextMaterialsInObjectTree(root: THREE.Object3D, layerTraits?: Partial<AcGiSubEntityTraits>): void;
44
+ /**
45
+ * Builds resolved layer traits used when syncing appearance or remapping INSERT layers.
46
+ *
47
+ * Reads the active draw database from {@link AcTrRenderer.context} unless a custom
48
+ * resolver was supplied to the constructor.
49
+ *
50
+ * @param layerName - Name of the layer to resolve from the active database.
51
+ * @returns Resolved sub-entity traits, or undefined when the layer is missing.
52
+ */
53
+ getEffectiveLayerTraits(layerName: string): Partial<AcGiSubEntityTraits> | undefined;
54
+ }
55
+ //# sourceMappingURL=AcTrLayerAppearanceController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcTrLayerAppearanceController.d.ts","sourceRoot":"","sources":["../../src/view/AcTrLayerAppearanceController.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;GAMG;AACH,qBAAa,6BAA6B;IAOtC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IARlC;;;;OAIG;gBAEgB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,EACtB,cAAc,CAAC,GAAE,CAChC,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,aAAA;IAG/C;;;;;OAKG;IACH,wBAAwB,CACtB,OAAO,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAC1C,OAAO;IASV;;;;;OAKG;IACH,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI;IAiBrD;;;;;;OAMG;IACH,gCAAgC,CAC9B,IAAI,EAAE,KAAK,CAAC,QAAQ,EACpB,WAAW,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACzC,IAAI;IAeP;;;;;;;;OAQG;IACH,uBAAuB,CACrB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;CAY5C"}
@@ -0,0 +1,86 @@
1
+ import { AcApLayerService } from '../service/AcApLayerService';
2
+ /**
3
+ * Synchronizes scene drawable materials with live layer-table style changes.
4
+ *
5
+ * The host view ({@link AcTrView2d}) delegates layer add/update and background
6
+ * refresh entry points here so material cache updates, scene fan-out, and text
7
+ * rematerialization stay out of the view class.
8
+ */
9
+ var AcTrLayerAppearanceController = /** @class */ (function () {
10
+ /**
11
+ * @param scene - Scene whose layout layer groups receive appearance updates.
12
+ * @param renderer - Renderer whose draw context supplies the active database.
13
+ * @param getLayerTraits - Optional override for resolving live layer-table traits.
14
+ */
15
+ function AcTrLayerAppearanceController(scene, renderer, getLayerTraits) {
16
+ this.scene = scene;
17
+ this.renderer = renderer;
18
+ this.getLayerTraits = getLayerTraits;
19
+ }
20
+ /**
21
+ * Returns true when a layer-table edit may require material refresh.
22
+ *
23
+ * @param changes - Partial layer record attributes from the edit event.
24
+ * @returns True when color, linetype, lineweight, or transparency changed.
25
+ */
26
+ AcTrLayerAppearanceController.prototype.layerStyleMayHaveChanged = function (changes) {
27
+ return (changes.color != null ||
28
+ changes.linetype != null ||
29
+ changes.lineWeight !== undefined ||
30
+ changes.transparency != null);
31
+ };
32
+ /**
33
+ * Refreshes cached layer materials from the live layer-table record and
34
+ * propagates the result to batched drawables and text hierarchies.
35
+ *
36
+ * @param layer - Live layer-table record whose traits should drive the refresh.
37
+ */
38
+ AcTrLayerAppearanceController.prototype.syncFromLiveRecord = function (layer) {
39
+ var _this = this;
40
+ var layerTraits = this.getEffectiveLayerTraits(layer.name);
41
+ if (!layerTraits) {
42
+ return;
43
+ }
44
+ var materials = this.renderer.updateLayerMaterial(layer.name, layerTraits);
45
+ this.scene.forEachSceneLayer(layer.name, function (sceneLayer) {
46
+ return sceneLayer.syncAppearanceFromRecord(layer.name, layerTraits, materials, _this.renderer);
47
+ });
48
+ };
49
+ /**
50
+ * Rebinds text materials after INSERT groups are split/reparented or when the
51
+ * canvas background changes (ACI-7 foreground inversion).
52
+ *
53
+ * @param root - Object subtree to traverse for text refresh hooks.
54
+ * @param layerTraits - Optional resolved traits passed through to text wrappers.
55
+ */
56
+ AcTrLayerAppearanceController.prototype.refreshTextMaterialsInObjectTree = function (root, layerTraits) {
57
+ root.traverse(function (child) {
58
+ var refresh = child.refreshTextMaterials;
59
+ if (typeof refresh === 'function') {
60
+ refresh.call(child, layerTraits);
61
+ }
62
+ });
63
+ };
64
+ /**
65
+ * Builds resolved layer traits used when syncing appearance or remapping INSERT layers.
66
+ *
67
+ * Reads the active draw database from {@link AcTrRenderer.context} unless a custom
68
+ * resolver was supplied to the constructor.
69
+ *
70
+ * @param layerName - Name of the layer to resolve from the active database.
71
+ * @returns Resolved sub-entity traits, or undefined when the layer is missing.
72
+ */
73
+ AcTrLayerAppearanceController.prototype.getEffectiveLayerTraits = function (layerName) {
74
+ if (this.getLayerTraits) {
75
+ return this.getLayerTraits(layerName);
76
+ }
77
+ var database = this.renderer.context.database;
78
+ if (!database) {
79
+ return undefined;
80
+ }
81
+ return AcApLayerService.resolveLayerTraits(database, layerName);
82
+ };
83
+ return AcTrLayerAppearanceController;
84
+ }());
85
+ export { AcTrLayerAppearanceController };
86
+ //# sourceMappingURL=AcTrLayerAppearanceController.js.map