@mlightcad/data-model 1.3.3 → 1.3.4

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