@mlightcad/data-model 1.3.1 → 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 (328) hide show
  1. package/package.json +4 -4
  2. package/dist/data-model.cjs +0 -5
  3. package/dist/data-model.js +0 -25475
  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 -867
  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 -85
  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/AcDbRegenerator.d.ts +0 -101
  38. package/lib/converter/AcDbRegenerator.d.ts.map +0 -1
  39. package/lib/converter/AcDbRegenerator.js +0 -334
  40. package/lib/converter/AcDbRegenerator.js.map +0 -1
  41. package/lib/converter/index.d.ts +0 -5
  42. package/lib/converter/index.d.ts.map +0 -1
  43. package/lib/converter/index.js +0 -5
  44. package/lib/converter/index.js.map +0 -1
  45. package/lib/converter/worker/AcDbBaseWorker.d.ts +0 -36
  46. package/lib/converter/worker/AcDbBaseWorker.d.ts.map +0 -1
  47. package/lib/converter/worker/AcDbBaseWorker.js +0 -93
  48. package/lib/converter/worker/AcDbBaseWorker.js.map +0 -1
  49. package/lib/converter/worker/AcDbDxfParserWorker.d.ts +0 -11
  50. package/lib/converter/worker/AcDbDxfParserWorker.d.ts.map +0 -1
  51. package/lib/converter/worker/AcDbDxfParserWorker.js +0 -75
  52. package/lib/converter/worker/AcDbDxfParserWorker.js.map +0 -1
  53. package/lib/converter/worker/AcDbWorkerManager.d.ts +0 -107
  54. package/lib/converter/worker/AcDbWorkerManager.d.ts.map +0 -1
  55. package/lib/converter/worker/AcDbWorkerManager.js +0 -360
  56. package/lib/converter/worker/AcDbWorkerManager.js.map +0 -1
  57. package/lib/converter/worker/index.d.ts +0 -3
  58. package/lib/converter/worker/index.d.ts.map +0 -1
  59. package/lib/converter/worker/index.js +0 -3
  60. package/lib/converter/worker/index.js.map +0 -1
  61. package/lib/database/AcDbBlockTable.d.ts +0 -56
  62. package/lib/database/AcDbBlockTable.d.ts.map +0 -1
  63. package/lib/database/AcDbBlockTable.js +0 -98
  64. package/lib/database/AcDbBlockTable.js.map +0 -1
  65. package/lib/database/AcDbBlockTableRecord.d.ts +0 -185
  66. package/lib/database/AcDbBlockTableRecord.d.ts.map +0 -1
  67. package/lib/database/AcDbBlockTableRecord.js +0 -261
  68. package/lib/database/AcDbBlockTableRecord.js.map +0 -1
  69. package/lib/database/AcDbDatabase.d.ts +0 -563
  70. package/lib/database/AcDbDatabase.d.ts.map +0 -1
  71. package/lib/database/AcDbDatabase.js +0 -842
  72. package/lib/database/AcDbDatabase.js.map +0 -1
  73. package/lib/database/AcDbDatabaseConverter.d.ts +0 -292
  74. package/lib/database/AcDbDatabaseConverter.d.ts.map +0 -1
  75. package/lib/database/AcDbDatabaseConverter.js +0 -446
  76. package/lib/database/AcDbDatabaseConverter.js.map +0 -1
  77. package/lib/database/AcDbDatabaseConverterManager.d.ts +0 -141
  78. package/lib/database/AcDbDatabaseConverterManager.d.ts.map +0 -1
  79. package/lib/database/AcDbDatabaseConverterManager.js +0 -173
  80. package/lib/database/AcDbDatabaseConverterManager.js.map +0 -1
  81. package/lib/database/AcDbDimStyleTable.d.ts +0 -31
  82. package/lib/database/AcDbDimStyleTable.d.ts.map +0 -1
  83. package/lib/database/AcDbDimStyleTable.js +0 -49
  84. package/lib/database/AcDbDimStyleTable.js.map +0 -1
  85. package/lib/database/AcDbDimStyleTableRecord.d.ts +0 -797
  86. package/lib/database/AcDbDimStyleTableRecord.d.ts.map +0 -1
  87. package/lib/database/AcDbDimStyleTableRecord.js +0 -1294
  88. package/lib/database/AcDbDimStyleTableRecord.js.map +0 -1
  89. package/lib/database/AcDbDwgVersion.d.ts +0 -32
  90. package/lib/database/AcDbDwgVersion.d.ts.map +0 -1
  91. package/lib/database/AcDbDwgVersion.js +0 -76
  92. package/lib/database/AcDbDwgVersion.js.map +0 -1
  93. package/lib/database/AcDbLayerTable.d.ts +0 -51
  94. package/lib/database/AcDbLayerTable.d.ts.map +0 -1
  95. package/lib/database/AcDbLayerTable.js +0 -92
  96. package/lib/database/AcDbLayerTable.js.map +0 -1
  97. package/lib/database/AcDbLayerTableRecord.d.ts +0 -278
  98. package/lib/database/AcDbLayerTableRecord.d.ts.map +0 -1
  99. package/lib/database/AcDbLayerTableRecord.js +0 -397
  100. package/lib/database/AcDbLayerTableRecord.js.map +0 -1
  101. package/lib/database/AcDbLinetypeTable.d.ts +0 -30
  102. package/lib/database/AcDbLinetypeTable.d.ts.map +0 -1
  103. package/lib/database/AcDbLinetypeTable.js +0 -48
  104. package/lib/database/AcDbLinetypeTable.js.map +0 -1
  105. package/lib/database/AcDbLinetypeTableRecord.d.ts +0 -79
  106. package/lib/database/AcDbLinetypeTableRecord.d.ts.map +0 -1
  107. package/lib/database/AcDbLinetypeTableRecord.js +0 -129
  108. package/lib/database/AcDbLinetypeTableRecord.js.map +0 -1
  109. package/lib/database/AcDbSymbolTable.d.ts +0 -199
  110. package/lib/database/AcDbSymbolTable.d.ts.map +0 -1
  111. package/lib/database/AcDbSymbolTable.js +0 -264
  112. package/lib/database/AcDbSymbolTable.js.map +0 -1
  113. package/lib/database/AcDbSymbolTableRecord.d.ts +0 -61
  114. package/lib/database/AcDbSymbolTableRecord.d.ts.map +0 -1
  115. package/lib/database/AcDbSymbolTableRecord.js +0 -82
  116. package/lib/database/AcDbSymbolTableRecord.js.map +0 -1
  117. package/lib/database/AcDbTextStyleTable.d.ts +0 -48
  118. package/lib/database/AcDbTextStyleTable.d.ts.map +0 -1
  119. package/lib/database/AcDbTextStyleTable.js +0 -112
  120. package/lib/database/AcDbTextStyleTable.js.map +0 -1
  121. package/lib/database/AcDbTextStyleTableRecord.d.ts +0 -179
  122. package/lib/database/AcDbTextStyleTableRecord.d.ts.map +0 -1
  123. package/lib/database/AcDbTextStyleTableRecord.js +0 -276
  124. package/lib/database/AcDbTextStyleTableRecord.js.map +0 -1
  125. package/lib/database/AcDbViewportTable.d.ts +0 -31
  126. package/lib/database/AcDbViewportTable.d.ts.map +0 -1
  127. package/lib/database/AcDbViewportTable.js +0 -49
  128. package/lib/database/AcDbViewportTable.js.map +0 -1
  129. package/lib/database/AcDbViewportTableRecord.d.ts +0 -154
  130. package/lib/database/AcDbViewportTableRecord.d.ts.map +0 -1
  131. package/lib/database/AcDbViewportTableRecord.js +0 -318
  132. package/lib/database/AcDbViewportTableRecord.js.map +0 -1
  133. package/lib/database/index.d.ts +0 -19
  134. package/lib/database/index.d.ts.map +0 -1
  135. package/lib/database/index.js +0 -19
  136. package/lib/database/index.js.map +0 -1
  137. package/lib/entity/AcDbArc.d.ts +0 -254
  138. package/lib/entity/AcDbArc.d.ts.map +0 -1
  139. package/lib/entity/AcDbArc.js +0 -340
  140. package/lib/entity/AcDbArc.js.map +0 -1
  141. package/lib/entity/AcDbBlockReference.d.ts +0 -190
  142. package/lib/entity/AcDbBlockReference.d.ts.map +0 -1
  143. package/lib/entity/AcDbBlockReference.js +0 -302
  144. package/lib/entity/AcDbBlockReference.js.map +0 -1
  145. package/lib/entity/AcDbCircle.d.ts +0 -186
  146. package/lib/entity/AcDbCircle.d.ts.map +0 -1
  147. package/lib/entity/AcDbCircle.js +0 -249
  148. package/lib/entity/AcDbCircle.js.map +0 -1
  149. package/lib/entity/AcDbCurve.d.ts +0 -42
  150. package/lib/entity/AcDbCurve.d.ts.map +0 -1
  151. package/lib/entity/AcDbCurve.js +0 -44
  152. package/lib/entity/AcDbCurve.js.map +0 -1
  153. package/lib/entity/AcDbEllipse.d.ts +0 -207
  154. package/lib/entity/AcDbEllipse.d.ts.map +0 -1
  155. package/lib/entity/AcDbEllipse.js +0 -272
  156. package/lib/entity/AcDbEllipse.js.map +0 -1
  157. package/lib/entity/AcDbEntity.d.ts +0 -385
  158. package/lib/entity/AcDbEntity.d.ts.map +0 -1
  159. package/lib/entity/AcDbEntity.js +0 -561
  160. package/lib/entity/AcDbEntity.js.map +0 -1
  161. package/lib/entity/AcDbFace.d.ts +0 -151
  162. package/lib/entity/AcDbFace.d.ts.map +0 -1
  163. package/lib/entity/AcDbFace.js +0 -224
  164. package/lib/entity/AcDbFace.js.map +0 -1
  165. package/lib/entity/AcDbHatch.d.ts +0 -174
  166. package/lib/entity/AcDbHatch.d.ts.map +0 -1
  167. package/lib/entity/AcDbHatch.js +0 -250
  168. package/lib/entity/AcDbHatch.js.map +0 -1
  169. package/lib/entity/AcDbLeader.d.ts +0 -243
  170. package/lib/entity/AcDbLeader.d.ts.map +0 -1
  171. package/lib/entity/AcDbLeader.js +0 -358
  172. package/lib/entity/AcDbLeader.js.map +0 -1
  173. package/lib/entity/AcDbLine.d.ts +0 -198
  174. package/lib/entity/AcDbLine.d.ts.map +0 -1
  175. package/lib/entity/AcDbLine.js +0 -300
  176. package/lib/entity/AcDbLine.js.map +0 -1
  177. package/lib/entity/AcDbMText.d.ts +0 -248
  178. package/lib/entity/AcDbMText.d.ts.map +0 -1
  179. package/lib/entity/AcDbMText.js +0 -414
  180. package/lib/entity/AcDbMText.js.map +0 -1
  181. package/lib/entity/AcDbPoint.d.ts +0 -113
  182. package/lib/entity/AcDbPoint.d.ts.map +0 -1
  183. package/lib/entity/AcDbPoint.js +0 -155
  184. package/lib/entity/AcDbPoint.js.map +0 -1
  185. package/lib/entity/AcDbPolyline.d.ts +0 -221
  186. package/lib/entity/AcDbPolyline.d.ts.map +0 -1
  187. package/lib/entity/AcDbPolyline.js +0 -301
  188. package/lib/entity/AcDbPolyline.js.map +0 -1
  189. package/lib/entity/AcDbRasterImage.d.ts +0 -216
  190. package/lib/entity/AcDbRasterImage.d.ts.map +0 -1
  191. package/lib/entity/AcDbRasterImage.js +0 -451
  192. package/lib/entity/AcDbRasterImage.js.map +0 -1
  193. package/lib/entity/AcDbRay.d.ts +0 -150
  194. package/lib/entity/AcDbRay.d.ts.map +0 -1
  195. package/lib/entity/AcDbRay.js +0 -208
  196. package/lib/entity/AcDbRay.js.map +0 -1
  197. package/lib/entity/AcDbSpline.d.ts +0 -135
  198. package/lib/entity/AcDbSpline.d.ts.map +0 -1
  199. package/lib/entity/AcDbSpline.js +0 -142
  200. package/lib/entity/AcDbSpline.js.map +0 -1
  201. package/lib/entity/AcDbTable.d.ts +0 -260
  202. package/lib/entity/AcDbTable.d.ts.map +0 -1
  203. package/lib/entity/AcDbTable.js +0 -452
  204. package/lib/entity/AcDbTable.js.map +0 -1
  205. package/lib/entity/AcDbText.d.ts +0 -388
  206. package/lib/entity/AcDbText.d.ts.map +0 -1
  207. package/lib/entity/AcDbText.js +0 -523
  208. package/lib/entity/AcDbText.js.map +0 -1
  209. package/lib/entity/AcDbTrace.d.ts +0 -193
  210. package/lib/entity/AcDbTrace.d.ts.map +0 -1
  211. package/lib/entity/AcDbTrace.js +0 -271
  212. package/lib/entity/AcDbTrace.js.map +0 -1
  213. package/lib/entity/AcDbViewport.d.ts +0 -173
  214. package/lib/entity/AcDbViewport.d.ts.map +0 -1
  215. package/lib/entity/AcDbViewport.js +0 -295
  216. package/lib/entity/AcDbViewport.js.map +0 -1
  217. package/lib/entity/AcDbWipeout.d.ts +0 -39
  218. package/lib/entity/AcDbWipeout.d.ts.map +0 -1
  219. package/lib/entity/AcDbWipeout.js +0 -70
  220. package/lib/entity/AcDbWipeout.js.map +0 -1
  221. package/lib/entity/AcDbXline.d.ts +0 -151
  222. package/lib/entity/AcDbXline.d.ts.map +0 -1
  223. package/lib/entity/AcDbXline.js +0 -209
  224. package/lib/entity/AcDbXline.js.map +0 -1
  225. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +0 -92
  226. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +0 -1
  227. package/lib/entity/dimension/AcDb3PointAngularDimension.js +0 -157
  228. package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +0 -1
  229. package/lib/entity/dimension/AcDbAlignedDimension.d.ts +0 -220
  230. package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +0 -1
  231. package/lib/entity/dimension/AcDbAlignedDimension.js +0 -341
  232. package/lib/entity/dimension/AcDbAlignedDimension.js.map +0 -1
  233. package/lib/entity/dimension/AcDbArcDimension.d.ts +0 -94
  234. package/lib/entity/dimension/AcDbArcDimension.d.ts.map +0 -1
  235. package/lib/entity/dimension/AcDbArcDimension.js +0 -159
  236. package/lib/entity/dimension/AcDbArcDimension.js.map +0 -1
  237. package/lib/entity/dimension/AcDbDiametricDimension.d.ts +0 -145
  238. package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +0 -1
  239. package/lib/entity/dimension/AcDbDiametricDimension.js +0 -275
  240. package/lib/entity/dimension/AcDbDiametricDimension.js.map +0 -1
  241. package/lib/entity/dimension/AcDbDimension.d.ts +0 -257
  242. package/lib/entity/dimension/AcDbDimension.d.ts.map +0 -1
  243. package/lib/entity/dimension/AcDbDimension.js +0 -466
  244. package/lib/entity/dimension/AcDbDimension.js.map +0 -1
  245. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +0 -78
  246. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +0 -1
  247. package/lib/entity/dimension/AcDbOrdinateDimension.js +0 -133
  248. package/lib/entity/dimension/AcDbOrdinateDimension.js.map +0 -1
  249. package/lib/entity/dimension/AcDbRadialDimension.d.ts +0 -214
  250. package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +0 -1
  251. package/lib/entity/dimension/AcDbRadialDimension.js +0 -288
  252. package/lib/entity/dimension/AcDbRadialDimension.js.map +0 -1
  253. package/lib/entity/dimension/index.d.ts +0 -8
  254. package/lib/entity/dimension/index.d.ts.map +0 -1
  255. package/lib/entity/dimension/index.js +0 -8
  256. package/lib/entity/dimension/index.js.map +0 -1
  257. package/lib/entity/index.d.ts +0 -24
  258. package/lib/entity/index.d.ts.map +0 -1
  259. package/lib/entity/index.js +0 -24
  260. package/lib/entity/index.js.map +0 -1
  261. package/lib/index.d.ts +0 -10
  262. package/lib/index.d.ts.map +0 -1
  263. package/lib/index.js +0 -10
  264. package/lib/index.js.map +0 -1
  265. package/lib/misc/AcDbAngleUnits.d.ts +0 -20
  266. package/lib/misc/AcDbAngleUnits.d.ts.map +0 -1
  267. package/lib/misc/AcDbAngleUnits.js +0 -21
  268. package/lib/misc/AcDbAngleUnits.js.map +0 -1
  269. package/lib/misc/AcDbCodePage.d.ts +0 -50
  270. package/lib/misc/AcDbCodePage.d.ts.map +0 -1
  271. package/lib/misc/AcDbCodePage.js +0 -100
  272. package/lib/misc/AcDbCodePage.js.map +0 -1
  273. package/lib/misc/AcDbConstants.d.ts +0 -24
  274. package/lib/misc/AcDbConstants.d.ts.map +0 -1
  275. package/lib/misc/AcDbConstants.js +0 -24
  276. package/lib/misc/AcDbConstants.js.map +0 -1
  277. package/lib/misc/AcDbDimArrowType.d.ts +0 -89
  278. package/lib/misc/AcDbDimArrowType.d.ts.map +0 -1
  279. package/lib/misc/AcDbDimArrowType.js +0 -90
  280. package/lib/misc/AcDbDimArrowType.js.map +0 -1
  281. package/lib/misc/AcDbObjectIterator.d.ts +0 -64
  282. package/lib/misc/AcDbObjectIterator.d.ts.map +0 -1
  283. package/lib/misc/AcDbObjectIterator.js +0 -84
  284. package/lib/misc/AcDbObjectIterator.js.map +0 -1
  285. package/lib/misc/AcDbOsnapMode.d.ts +0 -51
  286. package/lib/misc/AcDbOsnapMode.d.ts.map +0 -1
  287. package/lib/misc/AcDbOsnapMode.js +0 -52
  288. package/lib/misc/AcDbOsnapMode.js.map +0 -1
  289. package/lib/misc/AcDbRenderingCache.d.ts +0 -141
  290. package/lib/misc/AcDbRenderingCache.d.ts.map +0 -1
  291. package/lib/misc/AcDbRenderingCache.js +0 -239
  292. package/lib/misc/AcDbRenderingCache.js.map +0 -1
  293. package/lib/misc/AcDbUnitsValue.d.ts +0 -101
  294. package/lib/misc/AcDbUnitsValue.d.ts.map +0 -1
  295. package/lib/misc/AcDbUnitsValue.js +0 -121
  296. package/lib/misc/AcDbUnitsValue.js.map +0 -1
  297. package/lib/misc/index.d.ts +0 -9
  298. package/lib/misc/index.d.ts.map +0 -1
  299. package/lib/misc/index.js +0 -9
  300. package/lib/misc/index.js.map +0 -1
  301. package/lib/object/AcDbDictionary.d.ts +0 -178
  302. package/lib/object/AcDbDictionary.d.ts.map +0 -1
  303. package/lib/object/AcDbDictionary.js +0 -264
  304. package/lib/object/AcDbDictionary.js.map +0 -1
  305. package/lib/object/AcDbRasterImageDef.d.ts +0 -54
  306. package/lib/object/AcDbRasterImageDef.d.ts.map +0 -1
  307. package/lib/object/AcDbRasterImageDef.js +0 -82
  308. package/lib/object/AcDbRasterImageDef.js.map +0 -1
  309. package/lib/object/index.d.ts +0 -4
  310. package/lib/object/index.d.ts.map +0 -1
  311. package/lib/object/index.js +0 -4
  312. package/lib/object/index.js.map +0 -1
  313. package/lib/object/layout/AcDbLayout.d.ts +0 -190
  314. package/lib/object/layout/AcDbLayout.d.ts.map +0 -1
  315. package/lib/object/layout/AcDbLayout.js +0 -253
  316. package/lib/object/layout/AcDbLayout.js.map +0 -1
  317. package/lib/object/layout/AcDbLayoutDictionary.d.ts +0 -47
  318. package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +0 -1
  319. package/lib/object/layout/AcDbLayoutDictionary.js +0 -122
  320. package/lib/object/layout/AcDbLayoutDictionary.js.map +0 -1
  321. package/lib/object/layout/AcDbLayoutManager.d.ts +0 -188
  322. package/lib/object/layout/AcDbLayoutManager.d.ts.map +0 -1
  323. package/lib/object/layout/AcDbLayoutManager.js +0 -245
  324. package/lib/object/layout/AcDbLayoutManager.js.map +0 -1
  325. package/lib/object/layout/index.d.ts +0 -4
  326. package/lib/object/layout/index.d.ts.map +0 -1
  327. package/lib/object/layout/index.js +0 -4
  328. package/lib/object/layout/index.js.map +0 -1
@@ -1,842 +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 __values = (this && this.__values) || function(o) {
53
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
54
- if (m) return m.call(o);
55
- if (o && typeof o.length === "number") return {
56
- next: function () {
57
- if (o && i >= o.length) o = void 0;
58
- return { value: o && o[i++], done: !o };
59
- }
60
- };
61
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
62
- };
63
- /* eslint-disable simple-import-sort/imports */
64
- import { AcCmColor, AcCmEventManager } from '@mlightcad/common';
65
- import { AcDbObject } from '../base';
66
- import { AcDbRegenerator } from '../converter';
67
- import { AcDbDatabaseConverterManager, AcDbFileType } from './AcDbDatabaseConverterManager';
68
- import { AcDbAngleUnits, AcDbUnitsValue } from '../misc';
69
- import { AcDbDictionary, AcDbLayout, AcDbLayoutDictionary } from '../object';
70
- import { AcDbBlockTable } from './AcDbBlockTable';
71
- import { AcDbDimStyleTable } from './AcDbDimStyleTable';
72
- import { AcDbLayerTable } from './AcDbLayerTable';
73
- import { AcDbLayerTableRecord } from './AcDbLayerTableRecord';
74
- import { AcDbLinetypeTable } from './AcDbLinetypeTable';
75
- import { AcDbTextStyleTable } from './AcDbTextStyleTable';
76
- import { AcDbViewportTable } from './AcDbViewportTable';
77
- import { AcGeBox3d } from '@mlightcad/geometry-engine';
78
- import { AcDbLinetypeTableRecord } from './AcDbLinetypeTableRecord';
79
- import { AcDbTextStyleTableRecord } from './AcDbTextStyleTableRecord';
80
- import { AcDbDimStyleTableRecord } from './AcDbDimStyleTableRecord';
81
- import { AcDbDwgVersion } from './AcDbDwgVersion';
82
- /**
83
- * The AcDbDatabase class represents an AutoCAD drawing file.
84
- *
85
- * Each AcDbDatabase object contains the various header variables, symbol tables,
86
- * table records, entities, and objects that make up the drawing. The AcDbDatabase
87
- * class has member functions to allow access to all the symbol tables, to read
88
- * and write to DWG files, to get or set database defaults, to execute various
89
- * database-level operations, and to get or set all header variables.
90
- *
91
- * @example
92
- * ```typescript
93
- * const database = new AcDbDatabase();
94
- * await database.read(dxfData, { readOnly: true });
95
- * const entities = database.tables.blockTable.modelSpace.entities;
96
- * ```
97
- */
98
- var AcDbDatabase = /** @class */ (function (_super) {
99
- __extends(AcDbDatabase, _super);
100
- /**
101
- * Creates a new AcDbDatabase instance.
102
- */
103
- function AcDbDatabase() {
104
- var _this = _super.call(this) || this;
105
- /**
106
- * Events that can be triggered by the database.
107
- *
108
- * These events allow applications to respond to various database operations
109
- * such as entity modifications, layer changes, and progress updates.
110
- */
111
- _this.events = {
112
- /** Fired when an object is set to the dictionary */
113
- dictObjetSet: new AcCmEventManager(),
114
- /** Fired when an object in the dictionary is removed */
115
- dictObjectErased: new AcCmEventManager(),
116
- /** Fired when an entity is appended to the database */
117
- entityAppended: new AcCmEventManager(),
118
- /** Fired when an entity is modified in the database */
119
- entityModified: new AcCmEventManager(),
120
- /** Fired when a layer is appended to the database */
121
- layerAppended: new AcCmEventManager(),
122
- /** Fired when a layer is modified in the database */
123
- layerModified: new AcCmEventManager(),
124
- /** Fired when a layer is erased from the database */
125
- layerErased: new AcCmEventManager(),
126
- /** Fired during database opening operations to report progress */
127
- openProgress: new AcCmEventManager(),
128
- /** Fired when a header system variable is changed */
129
- headerSysVarChanged: new AcCmEventManager()
130
- };
131
- _this._version = new AcDbDwgVersion('AC1014');
132
- _this._angBase = 0;
133
- _this._angDir = 0;
134
- _this._aunits = AcDbAngleUnits.DecimalDegrees;
135
- _this._celtscale = 1;
136
- _this._cecolor = new AcCmColor();
137
- _this._extents = new AcGeBox3d();
138
- // TODO: Default value is 1 (imperial) or 4 (metric)
139
- _this._insunits = AcDbUnitsValue.Millimeters;
140
- _this._ltscale = 1;
141
- _this._pdmode = 0;
142
- _this._pdsize = 0;
143
- _this._tables = {
144
- blockTable: new AcDbBlockTable(_this),
145
- dimStyleTable: new AcDbDimStyleTable(_this),
146
- linetypeTable: new AcDbLinetypeTable(_this),
147
- textStyleTable: new AcDbTextStyleTable(_this),
148
- layerTable: new AcDbLayerTable(_this),
149
- viewportTable: new AcDbViewportTable(_this)
150
- };
151
- _this._dictionaries = {
152
- layouts: new AcDbLayoutDictionary(_this),
153
- imageDefs: new AcDbDictionary(_this)
154
- };
155
- return _this;
156
- }
157
- Object.defineProperty(AcDbDatabase.prototype, "tables", {
158
- /**
159
- * Gets all tables in this drawing database.
160
- *
161
- * @returns Object containing all the symbol tables in the database
162
- *
163
- * @example
164
- * ```typescript
165
- * const tables = database.tables;
166
- * const layers = tables.layerTable;
167
- * const blocks = tables.blockTable;
168
- * ```
169
- */
170
- get: function () {
171
- return this._tables;
172
- },
173
- enumerable: false,
174
- configurable: true
175
- });
176
- Object.defineProperty(AcDbDatabase.prototype, "dictionaries", {
177
- /**
178
- * Gets all named object dictionaries in this drawing database.
179
- *
180
- * @returns Object containing all the dictionaries in the database
181
- *
182
- * @example
183
- * ```typescript
184
- * const dictionaries = database.dictionaries;
185
- * const layouts = dictionaries.layouts;
186
- * ```
187
- */
188
- get: function () {
189
- return this._dictionaries;
190
- },
191
- enumerable: false,
192
- configurable: true
193
- });
194
- Object.defineProperty(AcDbDatabase.prototype, "currentSpaceId", {
195
- /**
196
- * Gets the object ID of the AcDbBlockTableRecord of the current space.
197
- *
198
- * The current space can be either model space or paper space.
199
- *
200
- * @returns The object ID of the current space
201
- *
202
- * @example
203
- * ```typescript
204
- * const currentSpaceId = database.currentSpaceId;
205
- * ```
206
- */
207
- get: function () {
208
- if (!this._currentSpace) {
209
- this._currentSpace = this._tables.blockTable.modelSpace;
210
- }
211
- return this._currentSpace.objectId;
212
- },
213
- /**
214
- * Sets the current space by object ID.
215
- *
216
- * @param value - The object ID of the block table record to set as current space
217
- * @throws {Error} When the specified block table record ID doesn't exist
218
- *
219
- * @example
220
- * ```typescript
221
- * database.currentSpaceId = 'some-block-record-id';
222
- * ```
223
- */
224
- set: function (value) {
225
- var currentSpace = this.tables.blockTable.getIdAt(value);
226
- if (currentSpace == null) {
227
- throw new Error("[AcDbDatabase] The specified block table record id '".concat(value, "' doesn't exist in the drawing database!"));
228
- }
229
- else {
230
- this._currentSpace = currentSpace;
231
- }
232
- },
233
- enumerable: false,
234
- configurable: true
235
- });
236
- Object.defineProperty(AcDbDatabase.prototype, "aunits", {
237
- /**
238
- * Gets the angle units for the database.
239
- *
240
- * This is the current AUNITS value for the database.
241
- *
242
- * @returns The angle units value
243
- *
244
- * @example
245
- * ```typescript
246
- * const angleUnits = database.aunits;
247
- * ```
248
- */
249
- get: function () {
250
- return this._aunits;
251
- },
252
- /**
253
- * Sets the angle units for the database.
254
- *
255
- * @param value - The new angle units value
256
- *
257
- * @example
258
- * ```typescript
259
- * database.aunits = AcDbAngleUnits.DecimalDegrees;
260
- * ```
261
- */
262
- set: function (value) {
263
- this._aunits = value || 0;
264
- this.triggerHeaderSysVarChangedEvent('aunits');
265
- },
266
- enumerable: false,
267
- configurable: true
268
- });
269
- Object.defineProperty(AcDbDatabase.prototype, "version", {
270
- /**
271
- * Gets the version of the database.
272
- *
273
- * @returns The version of the database
274
- *
275
- */
276
- get: function () {
277
- return this._version;
278
- },
279
- /**
280
- * Sets the version of the database.
281
- *
282
- * @param value - The version value of the database
283
- */
284
- set: function (value) {
285
- this._version = new AcDbDwgVersion(value);
286
- this.triggerHeaderSysVarChangedEvent('version');
287
- },
288
- enumerable: false,
289
- configurable: true
290
- });
291
- Object.defineProperty(AcDbDatabase.prototype, "insunits", {
292
- /**
293
- * Gets the drawing-units value for automatic scaling of blocks, images, or xrefs.
294
- *
295
- * This is the current INSUNITS value for the database.
296
- *
297
- * @returns The insertion units value
298
- *
299
- * @example
300
- * ```typescript
301
- * const insertionUnits = database.insunits;
302
- * ```
303
- */
304
- get: function () {
305
- return this._insunits;
306
- },
307
- /**
308
- * Sets the drawing-units value for automatic scaling.
309
- *
310
- * @param value - The new insertion units value
311
- *
312
- * @example
313
- * ```typescript
314
- * database.insunits = AcDbUnitsValue.Millimeters;
315
- * ```
316
- */
317
- set: function (value) {
318
- // TODO: Default value is 1 (imperial) or 4 (metric)
319
- this._insunits = value || 4;
320
- this.triggerHeaderSysVarChangedEvent('insunits');
321
- },
322
- enumerable: false,
323
- configurable: true
324
- });
325
- Object.defineProperty(AcDbDatabase.prototype, "ltscale", {
326
- /**
327
- * Gets the line type scale factor.
328
- *
329
- * @returns The line type scale factor
330
- *
331
- * @example
332
- * ```typescript
333
- * const lineTypeScale = database.ltscale;
334
- * ```
335
- */
336
- get: function () {
337
- return this._ltscale;
338
- },
339
- /**
340
- * Sets the line type scale factor.
341
- *
342
- * @param value - The new line type scale factor
343
- *
344
- * @example
345
- * ```typescript
346
- * database.ltscale = 2.0;
347
- * ```
348
- */
349
- set: function (value) {
350
- this._ltscale = value || 1;
351
- this.triggerHeaderSysVarChangedEvent('ltscale');
352
- },
353
- enumerable: false,
354
- configurable: true
355
- });
356
- Object.defineProperty(AcDbDatabase.prototype, "cecolor", {
357
- /**
358
- * Gets the color of new objects as they are created.
359
- *
360
- * @returns The current entity color
361
- *
362
- * @example
363
- * ```typescript
364
- * const currentColor = database.cecolor;
365
- * ```
366
- */
367
- get: function () {
368
- return this._cecolor;
369
- },
370
- /**
371
- * Sets the color of new objects as they are created.
372
- *
373
- * @param value - The new current entity color
374
- *
375
- * @example
376
- * ```typescript
377
- * database.cecolor = new AcCmColor(0xFF0000);
378
- * ```
379
- */
380
- set: function (value) {
381
- this._cecolor = value || 0;
382
- this.triggerHeaderSysVarChangedEvent('cecolor');
383
- },
384
- enumerable: false,
385
- configurable: true
386
- });
387
- Object.defineProperty(AcDbDatabase.prototype, "celtscale", {
388
- /**
389
- * The line type scaling for new objects relative to the ltscale setting. A line created with
390
- * celtscale = 2 in a drawing with ltscale set to 0.5 would appear the same as a line created
391
- * with celtscale = 1 in a drawing with ltscale = 1.
392
- */
393
- get: function () {
394
- return this._celtscale;
395
- },
396
- set: function (value) {
397
- this._celtscale = value || 1;
398
- this.triggerHeaderSysVarChangedEvent('celtscale');
399
- },
400
- enumerable: false,
401
- configurable: true
402
- });
403
- Object.defineProperty(AcDbDatabase.prototype, "angBase", {
404
- /**
405
- * The zero (0) base angle with respect to the current UCS in radians.
406
- */
407
- get: function () {
408
- return this._angBase;
409
- },
410
- set: function (value) {
411
- this._angBase = value || 0;
412
- this.triggerHeaderSysVarChangedEvent('angbase');
413
- },
414
- enumerable: false,
415
- configurable: true
416
- });
417
- Object.defineProperty(AcDbDatabase.prototype, "angDir", {
418
- /**
419
- * The direction of positive angles.
420
- * - 0: Counterclockwise
421
- * - 1: Clockwise
422
- */
423
- get: function () {
424
- return this._angDir;
425
- },
426
- set: function (value) {
427
- this._angDir = value || 0;
428
- this.triggerHeaderSysVarChangedEvent('angdir');
429
- },
430
- enumerable: false,
431
- configurable: true
432
- });
433
- Object.defineProperty(AcDbDatabase.prototype, "extmax", {
434
- /**
435
- * The current Model Space EXTMAX value
436
- */
437
- get: function () {
438
- return this._extents.max;
439
- },
440
- set: function (value) {
441
- if (value) {
442
- this._extents.expandByPoint(value);
443
- this.triggerHeaderSysVarChangedEvent('extmax');
444
- }
445
- },
446
- enumerable: false,
447
- configurable: true
448
- });
449
- Object.defineProperty(AcDbDatabase.prototype, "extmin", {
450
- /**
451
- * The current Model Space EXTMIN value
452
- */
453
- get: function () {
454
- return this._extents.min;
455
- },
456
- set: function (value) {
457
- if (value) {
458
- this._extents.expandByPoint(value);
459
- this.triggerHeaderSysVarChangedEvent('extmin');
460
- }
461
- },
462
- enumerable: false,
463
- configurable: true
464
- });
465
- Object.defineProperty(AcDbDatabase.prototype, "extents", {
466
- /**
467
- * The extents of current Model Space
468
- */
469
- get: function () {
470
- return this._extents;
471
- },
472
- enumerable: false,
473
- configurable: true
474
- });
475
- Object.defineProperty(AcDbDatabase.prototype, "pdmode", {
476
- /**
477
- * Point display mode. Please get more details on value of this property from [this page](https://help.autodesk.com/view/ACDLT/2022/ENU/?guid=GUID-82F9BB52-D026-4D6A-ABA6-BF29641F459B).
478
- */
479
- get: function () {
480
- return this._pdmode;
481
- },
482
- set: function (value) {
483
- this._pdmode = value || 0;
484
- this.triggerHeaderSysVarChangedEvent('pdmode');
485
- },
486
- enumerable: false,
487
- configurable: true
488
- });
489
- Object.defineProperty(AcDbDatabase.prototype, "pdsize", {
490
- /**
491
- * Point display size.
492
- * - 0: Create a point at 5 percent of the drawing area height
493
- * - > 0: Specifie an absolute size
494
- * - < 0: Specifie a percentage of the viewport size
495
- */
496
- get: function () {
497
- return this._pdsize;
498
- },
499
- set: function (value) {
500
- this._pdsize = value || 0;
501
- this.triggerHeaderSysVarChangedEvent('pdsize');
502
- },
503
- enumerable: false,
504
- configurable: true
505
- });
506
- /**
507
- * Reads drawing data from a string or ArrayBuffer.
508
- *
509
- * This method parses the provided data and populates the database with
510
- * the resulting entities, tables, and objects. The method supports
511
- * both DXF and DWG file formats.
512
- *
513
- * @param data - The drawing data as a string or ArrayBuffer
514
- * - For DXF files: Pass a string containing the DXF content
515
- * - For DWG files: Pass an ArrayBuffer instance containing the binary DWG data
516
- * @param options - Options for reading the database
517
- * @param fileType - The type of file being read (defaults to DXF)
518
- *
519
- * @example
520
- * ```typescript
521
- * // Reading a DXF file (string)
522
- * const database = new AcDbDatabase();
523
- * await database.read(dxfString, { readOnly: true }, AcDbFileType.DXF);
524
- *
525
- * // Reading a DWG file (ArrayBuffer)
526
- * const database = new AcDbDatabase();
527
- * await database.read(dwgArrayBuffer, { readOnly: true }, AcDbFileType.DWG);
528
- * ```
529
- */
530
- AcDbDatabase.prototype.read = function (data_1, options_1) {
531
- return __awaiter(this, arguments, void 0, function (data, options, fileType) {
532
- var converter;
533
- var _this = this;
534
- if (fileType === void 0) { fileType = AcDbFileType.DXF; }
535
- return __generator(this, function (_a) {
536
- switch (_a.label) {
537
- case 0:
538
- converter = AcDbDatabaseConverterManager.instance.get(fileType);
539
- if (converter == null)
540
- throw new Error("Database converter for file type '".concat(fileType, "' isn't registered and can can't read this file!"));
541
- this.clear();
542
- return [4 /*yield*/, converter.read(data, this, (options && options.minimumChunkSize) || 10, function (percentage, stage, stageStatus, data) { return __awaiter(_this, void 0, void 0, function () {
543
- var fonts_1;
544
- return __generator(this, function (_a) {
545
- switch (_a.label) {
546
- case 0:
547
- this.events.openProgress.dispatch({
548
- database: this,
549
- percentage: percentage,
550
- stage: 'CONVERSION',
551
- subStage: stage,
552
- subStageStatus: stageStatus,
553
- data: data
554
- });
555
- if (!(options &&
556
- options.fontLoader &&
557
- stage == 'FONT' &&
558
- stageStatus == 'END')) return [3 /*break*/, 2];
559
- fonts_1 = data
560
- ? data
561
- : this.tables.textStyleTable.fonts;
562
- return [4 /*yield*/, options.fontLoader.load(fonts_1)];
563
- case 1:
564
- _a.sent();
565
- _a.label = 2;
566
- case 2: return [2 /*return*/];
567
- }
568
- });
569
- }); })];
570
- case 1:
571
- _a.sent();
572
- return [2 /*return*/];
573
- }
574
- });
575
- });
576
- };
577
- /**
578
- * Read AutoCAD DXF or DWG drawing specified by the URL into the database object.
579
- * The method automatically detects the file type based on the URL extension:
580
- * - .dxf files are read as text using readAsText()
581
- * - .dwg files are read as binary data using readAsArrayBuffer()
582
- * @param url Input the URL linked to one AutoCAD DXF or DWG file
583
- * @param options Input options to read drawing data
584
- */
585
- AcDbDatabase.prototype.openUri = function (url, options) {
586
- return __awaiter(this, void 0, void 0, function () {
587
- var response, contentLength, totalBytes, loadedBytes, reader, chunks, _a, done, value, percentage, content, position, chunks_1, chunks_1_1, chunk, fileExtension;
588
- var e_1, _b;
589
- var _c;
590
- return __generator(this, function (_d) {
591
- switch (_d.label) {
592
- case 0:
593
- this.events.openProgress.dispatch({
594
- database: this,
595
- percentage: 0,
596
- stage: 'FETCH_FILE',
597
- subStageStatus: 'START'
598
- });
599
- return [4 /*yield*/, fetch(url)];
600
- case 1:
601
- response = _d.sent();
602
- if (!response.ok) {
603
- this.events.openProgress.dispatch({
604
- database: this,
605
- percentage: 100,
606
- stage: 'FETCH_FILE',
607
- subStageStatus: 'ERROR'
608
- });
609
- throw new Error("Failed to fetch file '".concat(url, "' with HTTP status code '").concat(response.status, "'!"));
610
- }
611
- contentLength = response.headers.get('content-length');
612
- totalBytes = contentLength ? parseInt(contentLength, 10) : null;
613
- loadedBytes = 0;
614
- reader = (_c = response.body) === null || _c === void 0 ? void 0 : _c.getReader();
615
- if (!reader) {
616
- throw new Error('Failed to get response reader');
617
- }
618
- chunks = [];
619
- _d.label = 2;
620
- case 2:
621
- if (!true) return [3 /*break*/, 4];
622
- return [4 /*yield*/, reader.read()];
623
- case 3:
624
- _a = _d.sent(), done = _a.done, value = _a.value;
625
- if (done) {
626
- return [3 /*break*/, 4];
627
- }
628
- chunks.push(value);
629
- loadedBytes += value.length;
630
- // Calculate and report progress if we know the total size
631
- if (totalBytes !== null) {
632
- percentage = Math.round((loadedBytes / totalBytes) * 100);
633
- this.events.openProgress.dispatch({
634
- database: this,
635
- percentage: percentage,
636
- stage: 'FETCH_FILE',
637
- subStageStatus: 'IN-PROGRESS'
638
- });
639
- }
640
- return [3 /*break*/, 2];
641
- case 4:
642
- content = new Uint8Array(loadedBytes);
643
- position = 0;
644
- try {
645
- for (chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next(); !chunks_1_1.done; chunks_1_1 = chunks_1.next()) {
646
- chunk = chunks_1_1.value;
647
- content.set(chunk, position);
648
- position += chunk.length;
649
- }
650
- }
651
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
652
- finally {
653
- try {
654
- if (chunks_1_1 && !chunks_1_1.done && (_b = chunks_1.return)) _b.call(chunks_1);
655
- }
656
- finally { if (e_1) throw e_1.error; }
657
- }
658
- fileExtension = url.toLowerCase().split('.').pop();
659
- if (!(fileExtension === 'dwg')) return [3 /*break*/, 6];
660
- // DWG files are binary, convert to ArrayBuffer
661
- return [4 /*yield*/, this.read(content.buffer, options, AcDbFileType.DWG)];
662
- case 5:
663
- // DWG files are binary, convert to ArrayBuffer
664
- _d.sent();
665
- return [3 /*break*/, 8];
666
- case 6: return [4 /*yield*/, this.read(content.buffer, options, AcDbFileType.DXF)];
667
- case 7:
668
- _d.sent();
669
- _d.label = 8;
670
- case 8:
671
- this.events.openProgress.dispatch({
672
- database: this,
673
- percentage: 100,
674
- stage: 'FETCH_FILE',
675
- subStageStatus: 'END'
676
- });
677
- return [2 /*return*/];
678
- }
679
- });
680
- });
681
- };
682
- /**
683
- * Triggers xxxAppended events with data in the database to redraw the associated viewer.
684
- */
685
- AcDbDatabase.prototype.regen = function () {
686
- return __awaiter(this, void 0, void 0, function () {
687
- var converter;
688
- var _this = this;
689
- return __generator(this, function (_a) {
690
- switch (_a.label) {
691
- case 0:
692
- converter = new AcDbRegenerator(this);
693
- return [4 /*yield*/, converter.read(null, this, 500, function (percentage, stage, stageStatus, data) { return __awaiter(_this, void 0, void 0, function () {
694
- return __generator(this, function (_a) {
695
- this.events.openProgress.dispatch({
696
- database: this,
697
- percentage: percentage,
698
- stage: 'CONVERSION',
699
- subStage: stage,
700
- subStageStatus: stageStatus,
701
- data: data
702
- });
703
- return [2 /*return*/];
704
- });
705
- }); })];
706
- case 1:
707
- _a.sent();
708
- return [2 /*return*/];
709
- }
710
- });
711
- });
712
- };
713
- /**
714
- * Create default layer, line type, dimension type, text style and layout.
715
- * @param - Options to specify data to create
716
- */
717
- AcDbDatabase.prototype.createDefaultData = function (options) {
718
- if (options === void 0) { options = {
719
- layer: true,
720
- lineType: true,
721
- textStyle: true,
722
- dimStyle: true,
723
- layout: true
724
- }; }
725
- // Create default layer
726
- if (options.layer) {
727
- var defaultColor = new AcCmColor();
728
- defaultColor.colorIndex = 7; // white
729
- this._tables.layerTable.add(new AcDbLayerTableRecord({
730
- name: '0',
731
- standardFlags: 0,
732
- linetype: 'Continuous',
733
- lineWeight: 0,
734
- isOff: false,
735
- color: defaultColor,
736
- isPlottable: true
737
- }));
738
- }
739
- // Create default line type
740
- if (options.lineType) {
741
- this._tables.linetypeTable.add(new AcDbLinetypeTableRecord({
742
- name: 'ByBlock',
743
- standardFlag: 0,
744
- description: '',
745
- totalPatternLength: 0
746
- }));
747
- this._tables.linetypeTable.add(new AcDbLinetypeTableRecord({
748
- name: 'ByLayer',
749
- standardFlag: 0,
750
- description: '',
751
- totalPatternLength: 0
752
- }));
753
- this._tables.linetypeTable.add(new AcDbLinetypeTableRecord({
754
- name: 'Continuous',
755
- standardFlag: 0,
756
- description: 'Solid line',
757
- totalPatternLength: 0
758
- }));
759
- }
760
- // Create default text style
761
- if (options.textStyle) {
762
- this._tables.textStyleTable.add(new AcDbTextStyleTableRecord({
763
- name: 'Standard',
764
- standardFlag: 0,
765
- fixedTextHeight: 0,
766
- widthFactor: 1,
767
- obliqueAngle: 0,
768
- textGenerationFlag: 0,
769
- lastHeight: 0.2,
770
- font: 'SimKai',
771
- bigFont: '',
772
- extendedFont: 'SimKai'
773
- }));
774
- }
775
- // Create default dimension style
776
- if (options.dimStyle) {
777
- this._tables.dimStyleTable.add(new AcDbDimStyleTableRecord({
778
- name: 'Standard',
779
- dimtxsty: 'Standard'
780
- }));
781
- }
782
- // Create default layer for model space
783
- if (options.layout) {
784
- var layout = new AcDbLayout();
785
- layout.layoutName = 'Model';
786
- layout.tabOrder = 0;
787
- layout.blockTableRecordId = this._tables.blockTable.modelSpace.objectId;
788
- layout.limits.min.copy({ x: 0, y: 0 });
789
- layout.limits.max.copy({ x: 1000000, y: 1000000 });
790
- layout.extents.min.copy({ x: 0, y: 0, z: 0 });
791
- layout.extents.max.copy({ x: 1000000, y: 1000000, z: 0 });
792
- this._dictionaries.layouts.setAt(layout.layoutName, layout);
793
- this._tables.blockTable.modelSpace.layoutId = layout.objectId;
794
- }
795
- };
796
- /**
797
- * Clears all data from the database.
798
- *
799
- * This method removes all entities, tables, and objects from the database,
800
- * effectively resetting it to an empty state.
801
- *
802
- * @example
803
- * ```typescript
804
- * database.clear();
805
- * ```
806
- */
807
- AcDbDatabase.prototype.clear = function () {
808
- // Clear all tables and dictionaries
809
- this._tables.blockTable.removeAll();
810
- this._tables.dimStyleTable.removeAll();
811
- this._tables.linetypeTable.removeAll();
812
- this._tables.textStyleTable.removeAll();
813
- this._tables.layerTable.removeAll();
814
- this._tables.viewportTable.removeAll();
815
- this._dictionaries.layouts.removeAll();
816
- this._currentSpace = undefined;
817
- this._extents.makeEmpty();
818
- };
819
- /**
820
- * Triggers a header system variable changed event.
821
- *
822
- * This method is called internally when header system variables
823
- * are modified to notify listeners of the change.
824
- *
825
- * @param sysVarName - The name of the system variable that changed
826
- *
827
- * @example
828
- * ```typescript
829
- * database.triggerHeaderSysVarChangedEvent('aunits');
830
- * ```
831
- */
832
- AcDbDatabase.prototype.triggerHeaderSysVarChangedEvent = function (sysVarName) {
833
- this.events.headerSysVarChanged.dispatch({
834
- database: this,
835
- name: sysVarName
836
- });
837
- };
838
- return AcDbDatabase;
839
- }(AcDbObject));
840
- export { AcDbDatabase };
841
- /* eslint-enable simple-import-sort/imports */
842
- //# sourceMappingURL=AcDbDatabase.js.map