@mlightcad/data-model 1.3.3 → 1.3.5

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 (344) hide show
  1. package/dist/data-model.cjs +5 -0
  2. package/dist/data-model.js +25995 -0
  3. package/dist/dxf-parser-worker.js +1715 -0
  4. package/lib/base/AcDbHostApplicationServices.d.ts +96 -0
  5. package/lib/base/AcDbHostApplicationServices.d.ts.map +1 -0
  6. package/lib/base/AcDbHostApplicationServices.js +118 -0
  7. package/lib/base/AcDbHostApplicationServices.js.map +1 -0
  8. package/lib/base/AcDbObject.d.ts +205 -0
  9. package/lib/base/AcDbObject.d.ts.map +1 -0
  10. package/lib/base/AcDbObject.js +236 -0
  11. package/lib/base/AcDbObject.js.map +1 -0
  12. package/lib/base/index.d.ts +3 -0
  13. package/lib/base/index.d.ts.map +1 -0
  14. package/lib/base/index.js +3 -0
  15. package/lib/base/index.js.map +1 -0
  16. package/lib/converter/AcDbBatchProcessing.d.ts +146 -0
  17. package/lib/converter/AcDbBatchProcessing.d.ts.map +1 -0
  18. package/lib/converter/AcDbBatchProcessing.js +272 -0
  19. package/lib/converter/AcDbBatchProcessing.js.map +1 -0
  20. package/lib/converter/AcDbDxfConverter.d.ts +272 -0
  21. package/lib/converter/AcDbDxfConverter.d.ts.map +1 -0
  22. package/lib/converter/AcDbDxfConverter.js +883 -0
  23. package/lib/converter/AcDbDxfConverter.js.map +1 -0
  24. package/lib/converter/AcDbDxfParser.d.ts +23 -0
  25. package/lib/converter/AcDbDxfParser.d.ts.map +1 -0
  26. package/lib/converter/AcDbDxfParser.js +85 -0
  27. package/lib/converter/AcDbDxfParser.js.map +1 -0
  28. package/lib/converter/AcDbEntitiyConverter.d.ts +160 -0
  29. package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -0
  30. package/lib/converter/AcDbEntitiyConverter.js +708 -0
  31. package/lib/converter/AcDbEntitiyConverter.js.map +1 -0
  32. package/lib/converter/AcDbObjectConverter.d.ts +61 -0
  33. package/lib/converter/AcDbObjectConverter.d.ts.map +1 -0
  34. package/lib/converter/AcDbObjectConverter.js +91 -0
  35. package/lib/converter/AcDbObjectConverter.js.map +1 -0
  36. package/lib/converter/AcDbRegenerator.d.ts +101 -0
  37. package/lib/converter/AcDbRegenerator.d.ts.map +1 -0
  38. package/lib/converter/AcDbRegenerator.js +334 -0
  39. package/lib/converter/AcDbRegenerator.js.map +1 -0
  40. package/lib/converter/index.d.ts +5 -0
  41. package/lib/converter/index.d.ts.map +1 -0
  42. package/lib/converter/index.js +5 -0
  43. package/lib/converter/index.js.map +1 -0
  44. package/lib/converter/worker/AcDbBaseWorker.d.ts +36 -0
  45. package/lib/converter/worker/AcDbBaseWorker.d.ts.map +1 -0
  46. package/lib/converter/worker/AcDbBaseWorker.js +93 -0
  47. package/lib/converter/worker/AcDbBaseWorker.js.map +1 -0
  48. package/lib/converter/worker/AcDbDxfParserWorker.d.ts +11 -0
  49. package/lib/converter/worker/AcDbDxfParserWorker.d.ts.map +1 -0
  50. package/lib/converter/worker/AcDbDxfParserWorker.js +75 -0
  51. package/lib/converter/worker/AcDbDxfParserWorker.js.map +1 -0
  52. package/lib/converter/worker/AcDbWorkerManager.d.ts +107 -0
  53. package/lib/converter/worker/AcDbWorkerManager.d.ts.map +1 -0
  54. package/lib/converter/worker/AcDbWorkerManager.js +360 -0
  55. package/lib/converter/worker/AcDbWorkerManager.js.map +1 -0
  56. package/lib/converter/worker/index.d.ts +3 -0
  57. package/lib/converter/worker/index.d.ts.map +1 -0
  58. package/lib/converter/worker/index.js +3 -0
  59. package/lib/converter/worker/index.js.map +1 -0
  60. package/lib/database/AcDbBlockTable.d.ts +56 -0
  61. package/lib/database/AcDbBlockTable.d.ts.map +1 -0
  62. package/lib/database/AcDbBlockTable.js +98 -0
  63. package/lib/database/AcDbBlockTable.js.map +1 -0
  64. package/lib/database/AcDbBlockTableRecord.d.ts +185 -0
  65. package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -0
  66. package/lib/database/AcDbBlockTableRecord.js +261 -0
  67. package/lib/database/AcDbBlockTableRecord.js.map +1 -0
  68. package/lib/database/AcDbDatabase.d.ts +563 -0
  69. package/lib/database/AcDbDatabase.d.ts.map +1 -0
  70. package/lib/database/AcDbDatabase.js +842 -0
  71. package/lib/database/AcDbDatabase.js.map +1 -0
  72. package/lib/database/AcDbDatabaseConverter.d.ts +292 -0
  73. package/lib/database/AcDbDatabaseConverter.d.ts.map +1 -0
  74. package/lib/database/AcDbDatabaseConverter.js +448 -0
  75. package/lib/database/AcDbDatabaseConverter.js.map +1 -0
  76. package/lib/database/AcDbDatabaseConverterManager.d.ts +141 -0
  77. package/lib/database/AcDbDatabaseConverterManager.d.ts.map +1 -0
  78. package/lib/database/AcDbDatabaseConverterManager.js +173 -0
  79. package/lib/database/AcDbDatabaseConverterManager.js.map +1 -0
  80. package/lib/database/AcDbDimStyleTable.d.ts +31 -0
  81. package/lib/database/AcDbDimStyleTable.d.ts.map +1 -0
  82. package/lib/database/AcDbDimStyleTable.js +49 -0
  83. package/lib/database/AcDbDimStyleTable.js.map +1 -0
  84. package/lib/database/AcDbDimStyleTableRecord.d.ts +797 -0
  85. package/lib/database/AcDbDimStyleTableRecord.d.ts.map +1 -0
  86. package/lib/database/AcDbDimStyleTableRecord.js +1294 -0
  87. package/lib/database/AcDbDimStyleTableRecord.js.map +1 -0
  88. package/lib/database/AcDbDwgVersion.d.ts +32 -0
  89. package/lib/database/AcDbDwgVersion.d.ts.map +1 -0
  90. package/lib/database/AcDbDwgVersion.js +126 -0
  91. package/lib/database/AcDbDwgVersion.js.map +1 -0
  92. package/lib/database/AcDbLayerTable.d.ts +51 -0
  93. package/lib/database/AcDbLayerTable.d.ts.map +1 -0
  94. package/lib/database/AcDbLayerTable.js +92 -0
  95. package/lib/database/AcDbLayerTable.js.map +1 -0
  96. package/lib/database/AcDbLayerTableRecord.d.ts +278 -0
  97. package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -0
  98. package/lib/database/AcDbLayerTableRecord.js +397 -0
  99. package/lib/database/AcDbLayerTableRecord.js.map +1 -0
  100. package/lib/database/AcDbLinetypeTable.d.ts +30 -0
  101. package/lib/database/AcDbLinetypeTable.d.ts.map +1 -0
  102. package/lib/database/AcDbLinetypeTable.js +48 -0
  103. package/lib/database/AcDbLinetypeTable.js.map +1 -0
  104. package/lib/database/AcDbLinetypeTableRecord.d.ts +79 -0
  105. package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -0
  106. package/lib/database/AcDbLinetypeTableRecord.js +129 -0
  107. package/lib/database/AcDbLinetypeTableRecord.js.map +1 -0
  108. package/lib/database/AcDbSymbolTable.d.ts +199 -0
  109. package/lib/database/AcDbSymbolTable.d.ts.map +1 -0
  110. package/lib/database/AcDbSymbolTable.js +264 -0
  111. package/lib/database/AcDbSymbolTable.js.map +1 -0
  112. package/lib/database/AcDbSymbolTableRecord.d.ts +61 -0
  113. package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -0
  114. package/lib/database/AcDbSymbolTableRecord.js +82 -0
  115. package/lib/database/AcDbSymbolTableRecord.js.map +1 -0
  116. package/lib/database/AcDbTextStyleTable.d.ts +48 -0
  117. package/lib/database/AcDbTextStyleTable.d.ts.map +1 -0
  118. package/lib/database/AcDbTextStyleTable.js +112 -0
  119. package/lib/database/AcDbTextStyleTable.js.map +1 -0
  120. package/lib/database/AcDbTextStyleTableRecord.d.ts +179 -0
  121. package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -0
  122. package/lib/database/AcDbTextStyleTableRecord.js +276 -0
  123. package/lib/database/AcDbTextStyleTableRecord.js.map +1 -0
  124. package/lib/database/AcDbViewportTable.d.ts +31 -0
  125. package/lib/database/AcDbViewportTable.d.ts.map +1 -0
  126. package/lib/database/AcDbViewportTable.js +49 -0
  127. package/lib/database/AcDbViewportTable.js.map +1 -0
  128. package/lib/database/AcDbViewportTableRecord.d.ts +154 -0
  129. package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -0
  130. package/lib/database/AcDbViewportTableRecord.js +318 -0
  131. package/lib/database/AcDbViewportTableRecord.js.map +1 -0
  132. package/lib/database/index.d.ts +19 -0
  133. package/lib/database/index.d.ts.map +1 -0
  134. package/lib/database/index.js +19 -0
  135. package/lib/database/index.js.map +1 -0
  136. package/lib/entity/AcDb2dPolyline.d.ts +146 -0
  137. package/lib/entity/AcDb2dPolyline.d.ts.map +1 -0
  138. package/lib/entity/AcDb2dPolyline.js +220 -0
  139. package/lib/entity/AcDb2dPolyline.js.map +1 -0
  140. package/lib/entity/AcDb2dVertex.d.ts +143 -0
  141. package/lib/entity/AcDb2dVertex.d.ts.map +1 -0
  142. package/lib/entity/AcDb2dVertex.js +210 -0
  143. package/lib/entity/AcDb2dVertex.js.map +1 -0
  144. package/lib/entity/AcDb3dPolyline.d.ts +102 -0
  145. package/lib/entity/AcDb3dPolyline.d.ts.map +1 -0
  146. package/lib/entity/AcDb3dPolyline.js +158 -0
  147. package/lib/entity/AcDb3dPolyline.js.map +1 -0
  148. package/lib/entity/AcDb3dVertex.d.ts +83 -0
  149. package/lib/entity/AcDb3dVertex.d.ts.map +1 -0
  150. package/lib/entity/AcDb3dVertex.js +133 -0
  151. package/lib/entity/AcDb3dVertex.js.map +1 -0
  152. package/lib/entity/AcDbArc.d.ts +254 -0
  153. package/lib/entity/AcDbArc.d.ts.map +1 -0
  154. package/lib/entity/AcDbArc.js +340 -0
  155. package/lib/entity/AcDbArc.js.map +1 -0
  156. package/lib/entity/AcDbBlockReference.d.ts +190 -0
  157. package/lib/entity/AcDbBlockReference.d.ts.map +1 -0
  158. package/lib/entity/AcDbBlockReference.js +302 -0
  159. package/lib/entity/AcDbBlockReference.js.map +1 -0
  160. package/lib/entity/AcDbCircle.d.ts +186 -0
  161. package/lib/entity/AcDbCircle.d.ts.map +1 -0
  162. package/lib/entity/AcDbCircle.js +249 -0
  163. package/lib/entity/AcDbCircle.js.map +1 -0
  164. package/lib/entity/AcDbCurve.d.ts +42 -0
  165. package/lib/entity/AcDbCurve.d.ts.map +1 -0
  166. package/lib/entity/AcDbCurve.js +44 -0
  167. package/lib/entity/AcDbCurve.js.map +1 -0
  168. package/lib/entity/AcDbEllipse.d.ts +207 -0
  169. package/lib/entity/AcDbEllipse.d.ts.map +1 -0
  170. package/lib/entity/AcDbEllipse.js +272 -0
  171. package/lib/entity/AcDbEllipse.js.map +1 -0
  172. package/lib/entity/AcDbEntity.d.ts +385 -0
  173. package/lib/entity/AcDbEntity.d.ts.map +1 -0
  174. package/lib/entity/AcDbEntity.js +561 -0
  175. package/lib/entity/AcDbEntity.js.map +1 -0
  176. package/lib/entity/AcDbFace.d.ts +151 -0
  177. package/lib/entity/AcDbFace.d.ts.map +1 -0
  178. package/lib/entity/AcDbFace.js +224 -0
  179. package/lib/entity/AcDbFace.js.map +1 -0
  180. package/lib/entity/AcDbHatch.d.ts +174 -0
  181. package/lib/entity/AcDbHatch.d.ts.map +1 -0
  182. package/lib/entity/AcDbHatch.js +250 -0
  183. package/lib/entity/AcDbHatch.js.map +1 -0
  184. package/lib/entity/AcDbLeader.d.ts +243 -0
  185. package/lib/entity/AcDbLeader.d.ts.map +1 -0
  186. package/lib/entity/AcDbLeader.js +358 -0
  187. package/lib/entity/AcDbLeader.js.map +1 -0
  188. package/lib/entity/AcDbLine.d.ts +198 -0
  189. package/lib/entity/AcDbLine.d.ts.map +1 -0
  190. package/lib/entity/AcDbLine.js +300 -0
  191. package/lib/entity/AcDbLine.js.map +1 -0
  192. package/lib/entity/AcDbMText.d.ts +248 -0
  193. package/lib/entity/AcDbMText.d.ts.map +1 -0
  194. package/lib/entity/AcDbMText.js +414 -0
  195. package/lib/entity/AcDbMText.js.map +1 -0
  196. package/lib/entity/AcDbPoint.d.ts +113 -0
  197. package/lib/entity/AcDbPoint.d.ts.map +1 -0
  198. package/lib/entity/AcDbPoint.js +155 -0
  199. package/lib/entity/AcDbPoint.js.map +1 -0
  200. package/lib/entity/AcDbPolyline.d.ts +221 -0
  201. package/lib/entity/AcDbPolyline.d.ts.map +1 -0
  202. package/lib/entity/AcDbPolyline.js +301 -0
  203. package/lib/entity/AcDbPolyline.js.map +1 -0
  204. package/lib/entity/AcDbRasterImage.d.ts +216 -0
  205. package/lib/entity/AcDbRasterImage.d.ts.map +1 -0
  206. package/lib/entity/AcDbRasterImage.js +451 -0
  207. package/lib/entity/AcDbRasterImage.js.map +1 -0
  208. package/lib/entity/AcDbRay.d.ts +150 -0
  209. package/lib/entity/AcDbRay.d.ts.map +1 -0
  210. package/lib/entity/AcDbRay.js +208 -0
  211. package/lib/entity/AcDbRay.js.map +1 -0
  212. package/lib/entity/AcDbSpline.d.ts +135 -0
  213. package/lib/entity/AcDbSpline.d.ts.map +1 -0
  214. package/lib/entity/AcDbSpline.js +142 -0
  215. package/lib/entity/AcDbSpline.js.map +1 -0
  216. package/lib/entity/AcDbTable.d.ts +260 -0
  217. package/lib/entity/AcDbTable.d.ts.map +1 -0
  218. package/lib/entity/AcDbTable.js +452 -0
  219. package/lib/entity/AcDbTable.js.map +1 -0
  220. package/lib/entity/AcDbText.d.ts +388 -0
  221. package/lib/entity/AcDbText.d.ts.map +1 -0
  222. package/lib/entity/AcDbText.js +523 -0
  223. package/lib/entity/AcDbText.js.map +1 -0
  224. package/lib/entity/AcDbTrace.d.ts +193 -0
  225. package/lib/entity/AcDbTrace.d.ts.map +1 -0
  226. package/lib/entity/AcDbTrace.js +271 -0
  227. package/lib/entity/AcDbTrace.js.map +1 -0
  228. package/lib/entity/AcDbViewport.d.ts +173 -0
  229. package/lib/entity/AcDbViewport.d.ts.map +1 -0
  230. package/lib/entity/AcDbViewport.js +295 -0
  231. package/lib/entity/AcDbViewport.js.map +1 -0
  232. package/lib/entity/AcDbWipeout.d.ts +39 -0
  233. package/lib/entity/AcDbWipeout.d.ts.map +1 -0
  234. package/lib/entity/AcDbWipeout.js +70 -0
  235. package/lib/entity/AcDbWipeout.js.map +1 -0
  236. package/lib/entity/AcDbXline.d.ts +151 -0
  237. package/lib/entity/AcDbXline.d.ts.map +1 -0
  238. package/lib/entity/AcDbXline.js +209 -0
  239. package/lib/entity/AcDbXline.js.map +1 -0
  240. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +92 -0
  241. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -0
  242. package/lib/entity/dimension/AcDb3PointAngularDimension.js +157 -0
  243. package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -0
  244. package/lib/entity/dimension/AcDbAlignedDimension.d.ts +220 -0
  245. package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +1 -0
  246. package/lib/entity/dimension/AcDbAlignedDimension.js +341 -0
  247. package/lib/entity/dimension/AcDbAlignedDimension.js.map +1 -0
  248. package/lib/entity/dimension/AcDbArcDimension.d.ts +94 -0
  249. package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -0
  250. package/lib/entity/dimension/AcDbArcDimension.js +159 -0
  251. package/lib/entity/dimension/AcDbArcDimension.js.map +1 -0
  252. package/lib/entity/dimension/AcDbDiametricDimension.d.ts +145 -0
  253. package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +1 -0
  254. package/lib/entity/dimension/AcDbDiametricDimension.js +275 -0
  255. package/lib/entity/dimension/AcDbDiametricDimension.js.map +1 -0
  256. package/lib/entity/dimension/AcDbDimension.d.ts +257 -0
  257. package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -0
  258. package/lib/entity/dimension/AcDbDimension.js +466 -0
  259. package/lib/entity/dimension/AcDbDimension.js.map +1 -0
  260. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +78 -0
  261. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +1 -0
  262. package/lib/entity/dimension/AcDbOrdinateDimension.js +133 -0
  263. package/lib/entity/dimension/AcDbOrdinateDimension.js.map +1 -0
  264. package/lib/entity/dimension/AcDbRadialDimension.d.ts +214 -0
  265. package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +1 -0
  266. package/lib/entity/dimension/AcDbRadialDimension.js +288 -0
  267. package/lib/entity/dimension/AcDbRadialDimension.js.map +1 -0
  268. package/lib/entity/dimension/index.d.ts +8 -0
  269. package/lib/entity/dimension/index.d.ts.map +1 -0
  270. package/lib/entity/dimension/index.js +8 -0
  271. package/lib/entity/dimension/index.js.map +1 -0
  272. package/lib/entity/index.d.ts +28 -0
  273. package/lib/entity/index.d.ts.map +1 -0
  274. package/lib/entity/index.js +28 -0
  275. package/lib/entity/index.js.map +1 -0
  276. package/lib/index.d.ts +10 -0
  277. package/lib/index.d.ts.map +1 -0
  278. package/lib/index.js +10 -0
  279. package/lib/index.js.map +1 -0
  280. package/lib/misc/AcDbAngleUnits.d.ts +20 -0
  281. package/lib/misc/AcDbAngleUnits.d.ts.map +1 -0
  282. package/lib/misc/AcDbAngleUnits.js +21 -0
  283. package/lib/misc/AcDbAngleUnits.js.map +1 -0
  284. package/lib/misc/AcDbCodePage.d.ts +50 -0
  285. package/lib/misc/AcDbCodePage.d.ts.map +1 -0
  286. package/lib/misc/AcDbCodePage.js +100 -0
  287. package/lib/misc/AcDbCodePage.js.map +1 -0
  288. package/lib/misc/AcDbConstants.d.ts +24 -0
  289. package/lib/misc/AcDbConstants.d.ts.map +1 -0
  290. package/lib/misc/AcDbConstants.js +24 -0
  291. package/lib/misc/AcDbConstants.js.map +1 -0
  292. package/lib/misc/AcDbDimArrowType.d.ts +89 -0
  293. package/lib/misc/AcDbDimArrowType.d.ts.map +1 -0
  294. package/lib/misc/AcDbDimArrowType.js +90 -0
  295. package/lib/misc/AcDbDimArrowType.js.map +1 -0
  296. package/lib/misc/AcDbObjectIterator.d.ts +64 -0
  297. package/lib/misc/AcDbObjectIterator.d.ts.map +1 -0
  298. package/lib/misc/AcDbObjectIterator.js +84 -0
  299. package/lib/misc/AcDbObjectIterator.js.map +1 -0
  300. package/lib/misc/AcDbOsnapMode.d.ts +51 -0
  301. package/lib/misc/AcDbOsnapMode.d.ts.map +1 -0
  302. package/lib/misc/AcDbOsnapMode.js +52 -0
  303. package/lib/misc/AcDbOsnapMode.js.map +1 -0
  304. package/lib/misc/AcDbRenderingCache.d.ts +141 -0
  305. package/lib/misc/AcDbRenderingCache.d.ts.map +1 -0
  306. package/lib/misc/AcDbRenderingCache.js +239 -0
  307. package/lib/misc/AcDbRenderingCache.js.map +1 -0
  308. package/lib/misc/AcDbUnitsValue.d.ts +101 -0
  309. package/lib/misc/AcDbUnitsValue.d.ts.map +1 -0
  310. package/lib/misc/AcDbUnitsValue.js +121 -0
  311. package/lib/misc/AcDbUnitsValue.js.map +1 -0
  312. package/lib/misc/index.d.ts +9 -0
  313. package/lib/misc/index.d.ts.map +1 -0
  314. package/lib/misc/index.js +9 -0
  315. package/lib/misc/index.js.map +1 -0
  316. package/lib/object/AcDbDictionary.d.ts +178 -0
  317. package/lib/object/AcDbDictionary.d.ts.map +1 -0
  318. package/lib/object/AcDbDictionary.js +264 -0
  319. package/lib/object/AcDbDictionary.js.map +1 -0
  320. package/lib/object/AcDbRasterImageDef.d.ts +54 -0
  321. package/lib/object/AcDbRasterImageDef.d.ts.map +1 -0
  322. package/lib/object/AcDbRasterImageDef.js +82 -0
  323. package/lib/object/AcDbRasterImageDef.js.map +1 -0
  324. package/lib/object/index.d.ts +4 -0
  325. package/lib/object/index.d.ts.map +1 -0
  326. package/lib/object/index.js +4 -0
  327. package/lib/object/index.js.map +1 -0
  328. package/lib/object/layout/AcDbLayout.d.ts +190 -0
  329. package/lib/object/layout/AcDbLayout.d.ts.map +1 -0
  330. package/lib/object/layout/AcDbLayout.js +253 -0
  331. package/lib/object/layout/AcDbLayout.js.map +1 -0
  332. package/lib/object/layout/AcDbLayoutDictionary.d.ts +47 -0
  333. package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +1 -0
  334. package/lib/object/layout/AcDbLayoutDictionary.js +122 -0
  335. package/lib/object/layout/AcDbLayoutDictionary.js.map +1 -0
  336. package/lib/object/layout/AcDbLayoutManager.d.ts +188 -0
  337. package/lib/object/layout/AcDbLayoutManager.d.ts.map +1 -0
  338. package/lib/object/layout/AcDbLayoutManager.js +245 -0
  339. package/lib/object/layout/AcDbLayoutManager.js.map +1 -0
  340. package/lib/object/layout/index.d.ts +4 -0
  341. package/lib/object/layout/index.d.ts.map +1 -0
  342. package/lib/object/layout/index.js +4 -0
  343. package/lib/object/layout/index.js.map +1 -0
  344. package/package.json +4 -4
@@ -0,0 +1,883 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
27
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __read = (this && this.__read) || function (o, n) {
53
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
54
+ if (!m) return o;
55
+ var i = m.call(o), r, ar = [], e;
56
+ try {
57
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
58
+ }
59
+ catch (error) { e = { error: error }; }
60
+ finally {
61
+ try {
62
+ if (r && !r.done && (m = i["return"])) m.call(i);
63
+ }
64
+ finally { if (e) throw e.error; }
65
+ }
66
+ return ar;
67
+ };
68
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
69
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
70
+ if (ar || !(i in from)) {
71
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
72
+ ar[i] = from[i];
73
+ }
74
+ }
75
+ return to.concat(ar || Array.prototype.slice.call(from));
76
+ };
77
+ var __values = (this && this.__values) || function(o) {
78
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
79
+ if (m) return m.call(o);
80
+ if (o && typeof o.length === "number") return {
81
+ next: function () {
82
+ if (o && i >= o.length) o = void 0;
83
+ return { value: o && o[i++], done: !o };
84
+ }
85
+ };
86
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
87
+ };
88
+ import { AcCmColor } from '@mlightcad/common';
89
+ import { AcDbBlockTableRecord, AcDbDimStyleTableRecord, AcDbLayerTableRecord, AcDbLinetypeTableRecord, AcDbTextStyleTableRecord, AcDbViewportTableRecord } from '../database';
90
+ import { AcDbDatabaseConverter } from '../database/AcDbDatabaseConverter';
91
+ import { AcDbBatchProcessing } from './AcDbBatchProcessing';
92
+ import { AcDbDxfParser } from './AcDbDxfParser';
93
+ import { AcDbEntityConverter } from './AcDbEntitiyConverter';
94
+ import { AcDbObjectConverter } from './AcDbObjectConverter';
95
+ import { createWorkerApi } from './worker';
96
+ /**
97
+ * Default database converter for DXF files.
98
+ *
99
+ * This class extends AcDbDatabaseConverter to provide specialized functionality
100
+ * for converting DXF (Drawing Exchange Format) files into AcDbDatabase objects.
101
+ * It handles parsing DXF data, processing entities, blocks, tables, and other
102
+ * DXF-specific structures.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * const converter = new AcDbDxfConverter();
107
+ * const database = await converter.convert(dxfData);
108
+ * ```
109
+ */
110
+ var AcDbDxfConverter = /** @class */ (function (_super) {
111
+ __extends(AcDbDxfConverter, _super);
112
+ function AcDbDxfConverter(config) {
113
+ if (config === void 0) { config = {}; }
114
+ var _this = _super.call(this, config) || this;
115
+ if (!config.parserWorkerUrl) {
116
+ config.parserWorkerUrl = '/assets/dxf-parser-worker.js';
117
+ }
118
+ return _this;
119
+ }
120
+ /**
121
+ * Parses DXF data into a ParsedDxf object.
122
+ *
123
+ * @param data - The DXF data
124
+ * @returns Parsed DXF object containing all the parsed data
125
+ *
126
+ */
127
+ AcDbDxfConverter.prototype.parse = function (data) {
128
+ return __awaiter(this, void 0, void 0, function () {
129
+ var api, result, parser, result;
130
+ return __generator(this, function (_a) {
131
+ switch (_a.label) {
132
+ case 0:
133
+ if (!(this.config.useWorker && this.config.parserWorkerUrl)) return [3 /*break*/, 2];
134
+ api = createWorkerApi({
135
+ workerUrl: this.config.parserWorkerUrl,
136
+ // One concurrent worker needed for parser
137
+ maxConcurrentWorkers: 1
138
+ });
139
+ return [4 /*yield*/, api.execute(data)
140
+ // Release worker
141
+ ];
142
+ case 1:
143
+ result = _a.sent();
144
+ // Release worker
145
+ api.destroy();
146
+ if (result.success) {
147
+ return [2 /*return*/, {
148
+ model: result.data,
149
+ data: {
150
+ unknownEntityCount: 0
151
+ }
152
+ }];
153
+ }
154
+ else {
155
+ throw new Error("Failed to parse drawing due to error: '".concat(result.error, "'"));
156
+ }
157
+ return [3 /*break*/, 3];
158
+ case 2:
159
+ parser = new AcDbDxfParser();
160
+ result = parser.parse(data);
161
+ return [2 /*return*/, {
162
+ model: result,
163
+ data: {
164
+ unknownEntityCount: 0
165
+ }
166
+ }];
167
+ case 3: return [2 /*return*/];
168
+ }
169
+ });
170
+ });
171
+ };
172
+ /**
173
+ * Gets all fonts used by entities in model space and paper space.
174
+ *
175
+ * This method analyzes the DXF data to extract all font names used by
176
+ * text entities, MText entities, and insert entities throughout the drawing.
177
+ *
178
+ * @param dxf - Input parsed DXF model
179
+ * @returns Array of font names used in the drawing
180
+ *
181
+ * @example
182
+ * ```typescript
183
+ * const fonts = converter.getFonts(parsedDxf);
184
+ * console.log('Used fonts:', fonts);
185
+ * ```
186
+ */
187
+ AcDbDxfConverter.prototype.getFonts = function (dxf) {
188
+ var _a;
189
+ // Build text style map. The key is text style name, and the value is font name list.
190
+ var styleMap = new Map();
191
+ var getFontName = function (fontFileName) {
192
+ if (fontFileName) {
193
+ var lastDotIndex = fontFileName.lastIndexOf('.');
194
+ if (lastDotIndex >= 0) {
195
+ return fontFileName.substring(0, lastDotIndex).toLowerCase();
196
+ }
197
+ else {
198
+ return fontFileName.toLowerCase();
199
+ }
200
+ }
201
+ };
202
+ (_a = dxf.tables.STYLE) === null || _a === void 0 ? void 0 : _a.entries.forEach(function (style) {
203
+ var fontNames = [];
204
+ if (style.font) {
205
+ var fontName = getFontName(style.font);
206
+ if (fontName)
207
+ fontNames.push(fontName);
208
+ }
209
+ if (style.bigFont) {
210
+ var fontName = getFontName(style.bigFont);
211
+ if (fontName)
212
+ fontNames.push(fontName);
213
+ }
214
+ if (style.extendedFont) {
215
+ var fontName = getFontName(style.extendedFont);
216
+ if (fontName)
217
+ fontNames.push(fontName);
218
+ }
219
+ styleMap.set(style.name, fontNames);
220
+ });
221
+ var fonts = new Set();
222
+ this.getFontsInBlock(dxf.entities, dxf.blocks, styleMap, fonts);
223
+ return Array.from(fonts);
224
+ };
225
+ /**
226
+ * Iterates through entities in a block to get fonts used by text, MText, and insert entities.
227
+ *
228
+ * This is a helper method that recursively processes entities to extract font information
229
+ * from text-based entities and block references.
230
+ *
231
+ * @param entities - Array of DXF entities to process
232
+ * @param blockMap - Map of block definitions
233
+ * @param styleMap - Map of text styles to font names
234
+ * @param fonts - Set to collect font names
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * const fonts = new Set<string>();
239
+ * converter.getFontsInBlock(entities, blocks, styleMap, fonts);
240
+ * ```
241
+ */
242
+ AcDbDxfConverter.prototype.getFontsInBlock = function (entities, blockMap, styleMap, fonts) {
243
+ var _this = this;
244
+ var regex = /\\f(.*?)\|/g;
245
+ entities.forEach(function (entity) {
246
+ if (entity.type == 'MTEXT') {
247
+ var mtext = entity;
248
+ var text = mtext.text;
249
+ __spreadArray([], __read(text.matchAll(regex)), false).forEach(function (match) {
250
+ fonts.add(match[1].toLowerCase());
251
+ });
252
+ var fontNames = styleMap.get(mtext.styleName);
253
+ fontNames === null || fontNames === void 0 ? void 0 : fontNames.forEach(function (name) { return fonts.add(name); });
254
+ }
255
+ else if (entity.type == 'TEXT') {
256
+ var text = entity;
257
+ var fontNames = styleMap.get(text.styleName);
258
+ fontNames === null || fontNames === void 0 ? void 0 : fontNames.forEach(function (name) { return fonts.add(name); });
259
+ }
260
+ else if (entity.type == 'INSERT') {
261
+ var insert = entity;
262
+ var block = blockMap[insert.name];
263
+ if (block && block.entities)
264
+ _this.getFontsInBlock(block.entities, blockMap, styleMap, fonts);
265
+ }
266
+ });
267
+ };
268
+ /**
269
+ * Processes entities in batches to maintain UI responsiveness.
270
+ *
271
+ * This method breaks up the entity processing work into smaller chunks that are
272
+ * executed asynchronously. This is often referred to as "batch processing" or
273
+ * "cooperative multitasking," where the time-consuming task is broken into
274
+ * smaller pieces and executed in small intervals to allow the UI to remain responsive.
275
+ *
276
+ * @param dxf - Parsed DXF data
277
+ * @param db - Target database to add entities to
278
+ * @param minimumChunkSize - Minimum number of entities to process in each chunk
279
+ * @param startPercentage - Object containing the starting percentage for progress tracking
280
+ * @param progress - Optional callback for progress updates
281
+ *
282
+ * @example
283
+ * ```typescript
284
+ * await converter.processEntities(dxf, database, 100, { value: 0 }, progressCallback);
285
+ * ```
286
+ */
287
+ AcDbDxfConverter.prototype.processEntities = function (dxf, db, minimumChunkSize, startPercentage, progress) {
288
+ return __awaiter(this, void 0, void 0, function () {
289
+ var converter, entities, entityCount, batchProcessor, modelSpaceBlockTableRecord;
290
+ var _this = this;
291
+ return __generator(this, function (_a) {
292
+ switch (_a.label) {
293
+ case 0:
294
+ converter = new AcDbEntityConverter();
295
+ entities = dxf.entities;
296
+ entityCount = entities.length;
297
+ batchProcessor = new AcDbBatchProcessing(entityCount, 100 - startPercentage.value, minimumChunkSize);
298
+ // Groups entities by their `type` property and flattens the result into a single array.
299
+ if (this.config.convertByEntityType) {
300
+ entities = this.groupAndFlattenByType(entities);
301
+ }
302
+ modelSpaceBlockTableRecord = db.tables.blockTable.modelSpace;
303
+ return [4 /*yield*/, batchProcessor.processChunk(function (start, end) { return __awaiter(_this, void 0, void 0, function () {
304
+ var dbEntities, entityType, i, entity, dbEntity, percentage;
305
+ return __generator(this, function (_a) {
306
+ switch (_a.label) {
307
+ case 0:
308
+ dbEntities = [];
309
+ entityType = start < end ? entities[start].type : '';
310
+ for (i = start; i < end; i++) {
311
+ entity = entities[i];
312
+ dbEntity = converter.convert(entity);
313
+ if (dbEntity) {
314
+ if (this.config.convertByEntityType && entity.type !== entityType) {
315
+ modelSpaceBlockTableRecord.appendEntity(dbEntities);
316
+ dbEntities = [];
317
+ entityType = entity.type;
318
+ }
319
+ dbEntities.push(dbEntity);
320
+ }
321
+ }
322
+ // Use batch append to improve performance
323
+ modelSpaceBlockTableRecord.appendEntity(dbEntities);
324
+ if (!progress) return [3 /*break*/, 2];
325
+ percentage = startPercentage.value +
326
+ (end / entityCount) * (100 - startPercentage.value);
327
+ if (percentage > 100)
328
+ percentage = 100;
329
+ return [4 /*yield*/, progress(percentage, 'ENTITY', 'IN-PROGRESS')];
330
+ case 1:
331
+ _a.sent();
332
+ _a.label = 2;
333
+ case 2: return [2 /*return*/];
334
+ }
335
+ });
336
+ }); })];
337
+ case 1:
338
+ _a.sent();
339
+ return [2 /*return*/];
340
+ }
341
+ });
342
+ });
343
+ };
344
+ /**
345
+ * Processes entities within a specific block.
346
+ *
347
+ * This method handles the conversion and addition of entities to a specific
348
+ * block table record.
349
+ *
350
+ * @param entities - Array of DXF entities to process
351
+ * @param blockTableRecord - The block table record to use
352
+ *
353
+ * @example
354
+ * ```typescript
355
+ * await converter.processEntitiesInBlock(entities, blockRecord);
356
+ * ```
357
+ */
358
+ AcDbDxfConverter.prototype.processEntitiesInBlock = function (entities, blockTableRecord) {
359
+ return __awaiter(this, void 0, void 0, function () {
360
+ var converter, entityCount, dbEntities, i, entity, dbEntity;
361
+ return __generator(this, function (_a) {
362
+ converter = new AcDbEntityConverter();
363
+ entityCount = entities.length;
364
+ dbEntities = [];
365
+ for (i = 0; i < entityCount; i++) {
366
+ entity = entities[i];
367
+ dbEntity = converter.convert(entity);
368
+ if (dbEntity) {
369
+ dbEntities.push(dbEntity);
370
+ }
371
+ }
372
+ // Use batch append to improve performance
373
+ blockTableRecord.appendEntity(dbEntities);
374
+ return [2 /*return*/];
375
+ });
376
+ });
377
+ };
378
+ /**
379
+ * Processes blocks defined in the DXF file.
380
+ *
381
+ * This method iterates through all blocks in the DXF data and creates
382
+ * corresponding AcDbBlockTableRecord objects in the database.
383
+ *
384
+ * @param model - Parsed DXF model containing block definitions
385
+ * @param db - Target database to add blocks to
386
+ *
387
+ * @example
388
+ * ```typescript
389
+ * converter.processBlocks(parsedDxf, database);
390
+ * ```
391
+ */
392
+ AcDbDxfConverter.prototype.processBlocks = function (model, db) {
393
+ var e_1, _a;
394
+ var blocks = model.blocks;
395
+ try {
396
+ for (var _b = __values(Object.entries(blocks)), _c = _b.next(); !_c.done; _c = _b.next()) {
397
+ var _d = __read(_c.value, 2), name_1 = _d[0], block = _d[1];
398
+ var dbBlock = db.tables.blockTable.getAt(block.name);
399
+ if (!dbBlock) {
400
+ dbBlock = new AcDbBlockTableRecord();
401
+ dbBlock.objectId = block.handle;
402
+ // dbBlock.ownerId = block.ownerHandle
403
+ dbBlock.name = name_1;
404
+ dbBlock.origin.copy(block.position);
405
+ db.tables.blockTable.add(dbBlock);
406
+ }
407
+ if (block.entities) {
408
+ this.processEntitiesInBlock(block.entities, dbBlock);
409
+ }
410
+ }
411
+ }
412
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
413
+ finally {
414
+ try {
415
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
416
+ }
417
+ finally { if (e_1) throw e_1.error; }
418
+ }
419
+ };
420
+ /**
421
+ * Processes header variables from the DXF file.
422
+ *
423
+ * This method extracts and sets various header variables such as color settings,
424
+ * angle base, angle direction, units, and point display settings.
425
+ *
426
+ * @param model - Parsed DXF model containing header information
427
+ * @param db - Target database to set header variables on
428
+ *
429
+ * @example
430
+ * ```typescript
431
+ * converter.processHeader(parsedDxf, database);
432
+ * ```
433
+ */
434
+ AcDbDxfConverter.prototype.processHeader = function (model, db) {
435
+ var header = model.header;
436
+ if (header['$ACADVER']) {
437
+ db.version = header['$ACADVER'];
438
+ }
439
+ // Color index 256 is 'ByLayer'
440
+ db.cecolor.colorIndex = header['$CECOLOR'] || 256;
441
+ db.angBase = header['$ANGBASE'] || 0;
442
+ db.angDir = header['$ANGDIR'] || 0;
443
+ if (header['$AUNITS'] != null)
444
+ db.aunits = header['$AUNITS'];
445
+ if (header['$EXTMAX'])
446
+ db.extmax = header['$EXTMAX'];
447
+ if (header['$EXTMIN'])
448
+ db.extmin = header['$EXTMIN'];
449
+ if (header['$INSUNITS'] != null)
450
+ db.insunits = header['$INSUNITS'];
451
+ db.pdmode = header['$PDMODE'] || 0;
452
+ db.pdsize = header['$PDSIZE'] || 0.0;
453
+ };
454
+ /**
455
+ * Processes block table records from the DXF file.
456
+ *
457
+ * This method creates AcDbBlockTableRecord objects for each block record
458
+ * defined in the DXF tables section.
459
+ *
460
+ * @param dxf - Parsed DXF data
461
+ * @param db - Target database to add block table records to
462
+ *
463
+ * @example
464
+ * ```typescript
465
+ * converter.processBlockTables(parsedDxf, database);
466
+ * ```
467
+ */
468
+ AcDbDxfConverter.prototype.processBlockTables = function (dxf, db) {
469
+ var _a;
470
+ var btrs = (_a = dxf.tables.BLOCK_RECORD) === null || _a === void 0 ? void 0 : _a.entries;
471
+ if (btrs && btrs.length > 0) {
472
+ db.tables.blockTable.removeAll();
473
+ btrs.forEach(function (btr) {
474
+ var dbBlock = new AcDbBlockTableRecord();
475
+ dbBlock.objectId = btr.handle;
476
+ dbBlock.name = btr.name;
477
+ dbBlock.layoutId = btr.layoutObjects;
478
+ db.tables.blockTable.add(dbBlock);
479
+ });
480
+ }
481
+ };
482
+ /**
483
+ * Processes objects defined in the DXF file.
484
+ *
485
+ * This method handles the conversion of DXF objects such as layouts and
486
+ * image definitions into their corresponding AcDb objects.
487
+ *
488
+ * @param model - Parsed DXF model containing object definitions
489
+ * @param db - Target database to add objects to
490
+ *
491
+ * @example
492
+ * ```typescript
493
+ * converter.processObjects(parsedDxf, database);
494
+ * ```
495
+ */
496
+ AcDbDxfConverter.prototype.processObjects = function (model, db) {
497
+ var objects = model.objects.byName;
498
+ var objectConverter = new AcDbObjectConverter();
499
+ if ('LAYOUT' in objects) {
500
+ var layoutDict_1 = db.dictionaries.layouts;
501
+ objects['LAYOUT'].forEach(function (layout) {
502
+ var dbLayout = objectConverter.convertLayout(layout, model);
503
+ layoutDict_1.setAt(dbLayout.layoutName, dbLayout);
504
+ });
505
+ }
506
+ if ('IMAGEDEF' in objects) {
507
+ var imageDefDict_1 = db.dictionaries.imageDefs;
508
+ objects['IMAGEDEF'].forEach(function (imageDef) {
509
+ var dbImageDef = objectConverter.convertImageDef(imageDef);
510
+ imageDefDict_1.setAt(dbImageDef.objectId, dbImageDef);
511
+ });
512
+ }
513
+ };
514
+ /**
515
+ * Processes viewport table records from the DXF file.
516
+ *
517
+ * This method creates AcDbViewportTableRecord objects for each viewport
518
+ * defined in the DXF tables section, including their properties like
519
+ * center, corners, snap settings, and grid settings.
520
+ *
521
+ * @param model - Parsed DXF model containing viewport definitions
522
+ * @param db - Target database to add viewport table records to
523
+ *
524
+ * @example
525
+ * ```typescript
526
+ * converter.processViewports(parsedDxf, database);
527
+ * ```
528
+ */
529
+ AcDbDxfConverter.prototype.processViewports = function (model, db) {
530
+ var _this = this;
531
+ var _a, _b;
532
+ var viewports = (_b = (_a = model.tables) === null || _a === void 0 ? void 0 : _a.VPORT) === null || _b === void 0 ? void 0 : _b.entries;
533
+ if (viewports && viewports.length > 0) {
534
+ viewports.forEach(function (item) {
535
+ var record = new AcDbViewportTableRecord();
536
+ _this.processCommonTableEntryAttrs(item, record);
537
+ if (item.circleSides) {
538
+ record.circleSides = item.circleSides;
539
+ }
540
+ record.standardFlag = item.standardFlag;
541
+ record.center.copy(item.center);
542
+ record.lowerLeftCorner.copy(item.lowerLeftCorner);
543
+ record.upperRightCorner.copy(item.upperRightCorner);
544
+ if (item.snapBasePoint) {
545
+ record.snapBase.copy(item.snapBasePoint);
546
+ }
547
+ if (item.snapRotationAngle) {
548
+ record.snapAngle = item.snapRotationAngle;
549
+ }
550
+ if (item.snapSpacing) {
551
+ record.snapIncrements.copy(item.snapSpacing);
552
+ }
553
+ if (item.majorGridLines) {
554
+ record.gridMajor = item.majorGridLines;
555
+ }
556
+ if (item.gridSpacing) {
557
+ record.gridIncrements.copy(item.gridSpacing);
558
+ }
559
+ if (item.backgroundObjectId) {
560
+ record.backgroundObjectId = item.backgroundObjectId;
561
+ }
562
+ record.gsView.center.copy(item.center);
563
+ record.gsView.viewDirectionFromTarget.copy(item.viewDirectionFromTarget);
564
+ record.gsView.viewTarget.copy(item.viewTarget);
565
+ if (item.lensLength) {
566
+ record.gsView.lensLength = item.lensLength;
567
+ }
568
+ if (item.frontClippingPlane) {
569
+ record.gsView.frontClippingPlane = item.frontClippingPlane;
570
+ }
571
+ if (item.backClippingPlane) {
572
+ record.gsView.backClippingPlane = item.backClippingPlane;
573
+ }
574
+ if (item.viewHeight) {
575
+ record.gsView.viewHeight = item.viewHeight;
576
+ }
577
+ if (item.viewTwistAngle) {
578
+ record.gsView.viewTwistAngle = item.viewTwistAngle;
579
+ }
580
+ if (item.frozenLayers) {
581
+ record.gsView.frozenLayers = item.frozenLayers;
582
+ }
583
+ if (item.styleSheet) {
584
+ record.gsView.styleSheet = item.styleSheet;
585
+ }
586
+ if (item.renderMode) {
587
+ record.gsView.renderMode =
588
+ item.renderMode;
589
+ }
590
+ if (item.viewMode) {
591
+ record.gsView.viewMode = item.viewMode;
592
+ }
593
+ if (item.ucsIconSetting) {
594
+ record.gsView.ucsIconSetting = item.ucsIconSetting;
595
+ }
596
+ if (item.ucsOrigin) {
597
+ record.gsView.ucsOrigin.copy(item.ucsOrigin);
598
+ }
599
+ if (item.ucsXAxis) {
600
+ record.gsView.ucsXAxis.copy(item.ucsXAxis);
601
+ }
602
+ if (item.ucsYAxis) {
603
+ record.gsView.ucsYAxis.copy(item.ucsYAxis);
604
+ }
605
+ if (item.orthographicType) {
606
+ record.gsView.orthographicType =
607
+ item.orthographicType;
608
+ }
609
+ if (item.shadePlotSetting) {
610
+ record.gsView.shadePlotSetting = item.shadePlotSetting;
611
+ }
612
+ if (item.shadePlotObjectId) {
613
+ record.gsView.shadePlotObjectId = item.shadePlotObjectId;
614
+ }
615
+ if (item.visualStyleObjectId) {
616
+ record.gsView.visualStyleObjectId = item.visualStyleObjectId;
617
+ }
618
+ if (item.isDefaultLightingOn) {
619
+ record.gsView.isDefaultLightingOn = item.isDefaultLightingOn;
620
+ }
621
+ if (item.defaultLightingType) {
622
+ record.gsView.defaultLightingType =
623
+ item.defaultLightingType;
624
+ }
625
+ if (item.brightness) {
626
+ record.gsView.brightness = item.brightness;
627
+ }
628
+ if (item.contrast) {
629
+ record.gsView.contrast = item.contrast;
630
+ }
631
+ if (item.ambientColor) {
632
+ record.gsView.ambientColor = item.ambientColor;
633
+ }
634
+ db.tables.viewportTable.add(record);
635
+ });
636
+ }
637
+ };
638
+ /**
639
+ * Processes layer table records from the DXF file.
640
+ *
641
+ * This method creates AcDbLayerTableRecord objects for each layer
642
+ * defined in the DXF tables section, including their properties like
643
+ * color, linetype, lineweight, and visibility settings.
644
+ *
645
+ * @param model - Parsed DXF model containing layer definitions
646
+ * @param db - Target database to add layer table records to
647
+ *
648
+ * @example
649
+ * ```typescript
650
+ * converter.processLayers(parsedDxf, database);
651
+ * ```
652
+ */
653
+ AcDbDxfConverter.prototype.processLayers = function (model, db) {
654
+ var _this = this;
655
+ var _a, _b;
656
+ var layers = (_b = (_a = model.tables) === null || _a === void 0 ? void 0 : _a.LAYER) === null || _b === void 0 ? void 0 : _b.entries;
657
+ if (layers && layers.length > 0) {
658
+ layers.forEach(function (item) {
659
+ var color = new AcCmColor();
660
+ color.colorIndex = item.colorIndex;
661
+ var record = new AcDbLayerTableRecord({
662
+ name: item.name,
663
+ standardFlags: item.standardFlag,
664
+ linetype: item.lineType,
665
+ lineWeight: item.lineweight,
666
+ isOff: item.colorIndex < 0,
667
+ color: color,
668
+ isPlottable: item.isPlotting
669
+ });
670
+ _this.processCommonTableEntryAttrs(item, record);
671
+ db.tables.layerTable.add(record);
672
+ });
673
+ }
674
+ };
675
+ /**
676
+ * Processes linetype table records from the DXF file.
677
+ *
678
+ * This method creates AcDbLinetypeTableRecord objects for each linetype
679
+ * defined in the DXF tables section.
680
+ *
681
+ * @param model - Parsed DXF model containing linetype definitions
682
+ * @param db - Target database to add linetype table records to
683
+ *
684
+ * @example
685
+ * ```typescript
686
+ * converter.processLineTypes(parsedDxf, database);
687
+ * ```
688
+ */
689
+ AcDbDxfConverter.prototype.processLineTypes = function (model, db) {
690
+ var _this = this;
691
+ var _a, _b;
692
+ var lineTypes = (_b = (_a = model.tables) === null || _a === void 0 ? void 0 : _a.LTYPE) === null || _b === void 0 ? void 0 : _b.entries;
693
+ if (lineTypes && lineTypes.length > 0) {
694
+ lineTypes.forEach(function (item) {
695
+ var record = new AcDbLinetypeTableRecord(item);
696
+ _this.processCommonTableEntryAttrs(item, record);
697
+ record.name = item.name;
698
+ db.tables.linetypeTable.add(record);
699
+ });
700
+ }
701
+ };
702
+ /**
703
+ * Processes text style table records from the DXF file.
704
+ *
705
+ * This method creates AcDbTextStyleTableRecord objects for each text style
706
+ * defined in the DXF tables section.
707
+ *
708
+ * @param model - Parsed DXF model containing text style definitions
709
+ * @param db - Target database to add text style table records to
710
+ *
711
+ * @example
712
+ * ```typescript
713
+ * converter.processTextStyles(parsedDxf, database);
714
+ * ```
715
+ */
716
+ AcDbDxfConverter.prototype.processTextStyles = function (model, db) {
717
+ var _this = this;
718
+ var _a;
719
+ var textStyles = (_a = model.tables.STYLE) === null || _a === void 0 ? void 0 : _a.entries;
720
+ if (textStyles && textStyles.length > 0) {
721
+ textStyles.forEach(function (item) {
722
+ var record = new AcDbTextStyleTableRecord(item);
723
+ _this.processCommonTableEntryAttrs(item, record);
724
+ db.tables.textStyleTable.add(record);
725
+ });
726
+ }
727
+ };
728
+ /**
729
+ * Processes dimension style table records from the DXF file.
730
+ *
731
+ * This method creates AcDbDimStyleTableRecord objects for each dimension style
732
+ * defined in the DXF tables section, including all dimension-related properties
733
+ * like text positioning, arrow settings, and tolerance settings.
734
+ *
735
+ * @param model - Parsed DXF model containing dimension style definitions
736
+ * @param db - Target database to add dimension style table records to
737
+ *
738
+ * @example
739
+ * ```typescript
740
+ * converter.processDimStyles(parsedDxf, database);
741
+ * ```
742
+ */
743
+ AcDbDxfConverter.prototype.processDimStyles = function (model, db) {
744
+ var _this = this;
745
+ var _a;
746
+ var dimStyles = (_a = model.tables.DIMSTYLE) === null || _a === void 0 ? void 0 : _a.entries;
747
+ if (dimStyles && dimStyles.length > 0) {
748
+ dimStyles.forEach(function (item) {
749
+ var attrs = {
750
+ name: item.name,
751
+ ownerId: item.ownerObjectId,
752
+ dimpost: item.DIMPOST || '',
753
+ dimapost: item.DIMAPOST || '',
754
+ dimscale: item.DIMSCALE,
755
+ dimasz: item.DIMASZ,
756
+ dimexo: item.DIMEXO,
757
+ dimdli: item.DIMDLI,
758
+ dimexe: item.DIMEXE,
759
+ dimrnd: item.DIMRND,
760
+ dimdle: item.DIMDLE,
761
+ dimtp: item.DIMTP,
762
+ dimtm: item.DIMTM,
763
+ dimtxt: item.DIMTXT,
764
+ dimcen: item.DIMCEN,
765
+ dimtsz: item.DIMTSZ,
766
+ dimaltf: item.DIMALTF,
767
+ dimlfac: item.DIMLFAC,
768
+ dimtvp: item.DIMTVP,
769
+ dimtfac: item.DIMTFAC,
770
+ dimgap: item.DIMGAP,
771
+ dimaltrnd: item.DIMALTRND,
772
+ dimtol: item.DIMTOL == null || item.DIMTOL == 0 ? 0 : 1,
773
+ dimlim: item.DIMLIM == null || item.DIMLIM == 0 ? 0 : 1,
774
+ dimtih: item.DIMTIH == null || item.DIMTIH == 0 ? 0 : 1,
775
+ dimtoh: item.DIMTOH == null || item.DIMTOH == 0 ? 0 : 1,
776
+ dimse1: item.DIMSE1 == null || item.DIMSE1 == 0 ? 0 : 1,
777
+ dimse2: item.DIMSE2 == null || item.DIMSE2 == 0 ? 0 : 1,
778
+ dimtad: item.DIMTAD,
779
+ dimzin: item.DIMZIN,
780
+ dimazin: item.DIMAZIN,
781
+ dimalt: item.DIMALT,
782
+ dimaltd: item.DIMALTD,
783
+ dimtofl: item.DIMTOFL,
784
+ dimsah: item.DIMSAH,
785
+ dimtix: item.DIMTIX,
786
+ dimsoxd: item.DIMSOXD,
787
+ dimclrd: item.DIMCLRD,
788
+ dimclre: item.DIMCLRE,
789
+ dimclrt: item.DIMCLRT,
790
+ dimadec: item.DIMADEC || 0,
791
+ dimunit: item.DIMUNIT || 2,
792
+ dimdec: item.DIMDEC,
793
+ dimtdec: item.DIMTDEC,
794
+ dimaltu: item.DIMALTU,
795
+ dimalttd: item.DIMALTTD,
796
+ dimaunit: item.DIMAUNIT,
797
+ dimfrac: item.DIMFRAC,
798
+ dimlunit: item.DIMLUNIT,
799
+ dimdsep: item.DIMDSEP,
800
+ dimtmove: item.DIMTMOVE || 0,
801
+ dimjust: item.DIMJUST,
802
+ dimsd1: item.DIMSD1,
803
+ dimsd2: item.DIMSD2,
804
+ dimtolj: item.DIMTOLJ,
805
+ dimtzin: item.DIMTZIN,
806
+ dimaltz: item.DIMALTZ,
807
+ dimalttz: item.DIMALTTZ,
808
+ dimfit: item.DIMFIT || 0,
809
+ dimupt: item.DIMUPT,
810
+ dimatfit: item.DIMATFIT,
811
+ dimtxsty: item.DIMTXSTY || 'Standard',
812
+ dimldrblk: item.DIMLDRBLK || '',
813
+ dimblk: item.DIMBLK || '',
814
+ dimblk1: item.DIMBLK1 || '',
815
+ dimblk2: item.DIMBLK2 || '',
816
+ dimlwd: item.DIMLWD,
817
+ dimlwe: item.DIMLWE
818
+ };
819
+ var record = new AcDbDimStyleTableRecord(attrs);
820
+ _this.processCommonTableEntryAttrs(item, record);
821
+ db.tables.dimStyleTable.add(record);
822
+ });
823
+ }
824
+ };
825
+ /**
826
+ * Processes common table entry attributes from DXF data.
827
+ *
828
+ * This helper method sets the common attributes (name, objectId, ownerId)
829
+ * that are shared across all table entries.
830
+ *
831
+ * @param entry - DXF table entry containing the source data
832
+ * @param dbEntry - AcDbSymbolTableRecord to populate with the data
833
+ *
834
+ * @example
835
+ * ```typescript
836
+ * converter.processCommonTableEntryAttrs(dxfEntry, dbRecord);
837
+ * ```
838
+ */
839
+ AcDbDxfConverter.prototype.processCommonTableEntryAttrs = function (entry, dbEntry) {
840
+ dbEntry.name = entry.name;
841
+ dbEntry.objectId = entry.handle;
842
+ dbEntry.ownerId = entry.ownerObjectId;
843
+ };
844
+ /**
845
+ * Groups entities by their `type` property and flattens the result into a single array.
846
+ *
847
+ * The order of `type` groups follows the order in which they first appear in the input array.
848
+ * Items within each group preserve their original order.
849
+ *
850
+ * This runs in O(n) time, which is generally faster than sorting when you
851
+ * don't care about alphabetical order of types.
852
+ *
853
+ * @param entities - The array of entities to group and flatten.
854
+ *
855
+ * @returns A new array of entities grouped by their `type` property.
856
+ */
857
+ AcDbDxfConverter.prototype.groupAndFlattenByType = function (entities) {
858
+ var e_2, _a;
859
+ var groups = {};
860
+ var order = [];
861
+ try {
862
+ for (var entities_1 = __values(entities), entities_1_1 = entities_1.next(); !entities_1_1.done; entities_1_1 = entities_1.next()) {
863
+ var entity = entities_1_1.value;
864
+ if (!groups[entity.type]) {
865
+ groups[entity.type] = [];
866
+ order.push(entity.type);
867
+ }
868
+ groups[entity.type].push(entity);
869
+ }
870
+ }
871
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
872
+ finally {
873
+ try {
874
+ if (entities_1_1 && !entities_1_1.done && (_a = entities_1.return)) _a.call(entities_1);
875
+ }
876
+ finally { if (e_2) throw e_2.error; }
877
+ }
878
+ return order.flatMap(function (type) { return groups[type]; });
879
+ };
880
+ return AcDbDxfConverter;
881
+ }(AcDbDatabaseConverter));
882
+ export { AcDbDxfConverter };
883
+ //# sourceMappingURL=AcDbDxfConverter.js.map