@mlightcad/data-model 1.3.0 → 1.3.3

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