@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,833 +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 { AcDbDatabaseConverterManager, AcDbFileType } from './AcDbDatabaseConverterManager';
67
- import { AcDbAngleUnits, AcDbCodePage, AcDbUnitsValue } from '../misc';
68
- import { AcDbDictionary, AcDbLayout, AcDbLayoutDictionary } from '../object';
69
- import { AcDbBlockTable } from './AcDbBlockTable';
70
- import { AcDbDimStyleTable } from './AcDbDimStyleTable';
71
- import { AcDbLayerTable } from './AcDbLayerTable';
72
- import { AcDbLayerTableRecord } from './AcDbLayerTableRecord';
73
- import { AcDbLinetypeTable } from './AcDbLinetypeTable';
74
- import { AcDbTextStyleTable } from './AcDbTextStyleTable';
75
- import { AcDbViewportTable } from './AcDbViewportTable';
76
- import { AcGeBox3d } from '@mlightcad/geometry-engine';
77
- import { AcDbLinetypeTableRecord } from './AcDbLinetypeTableRecord';
78
- import { AcDbTextStyleTableRecord } from './AcDbTextStyleTableRecord';
79
- import { AcDbDimStyleTableRecord } from './AcDbDimStyleTableRecord';
80
- import { AcDbDwgVersion } from './AcDbDwgVersion';
81
- /**
82
- * The AcDbDatabase class represents an AutoCAD drawing file.
83
- *
84
- * Each AcDbDatabase object contains the various header variables, symbol tables,
85
- * table records, entities, and objects that make up the drawing. The AcDbDatabase
86
- * class has member functions to allow access to all the symbol tables, to read
87
- * and write to DWG files, to get or set database defaults, to execute various
88
- * database-level operations, and to get or set all header variables.
89
- *
90
- * @example
91
- * ```typescript
92
- * const database = new AcDbDatabase();
93
- * await database.read(dxfData, { readOnly: true });
94
- * const entities = database.tables.blockTable.modelSpace.entities;
95
- * ```
96
- */
97
- var AcDbDatabase = /** @class */ (function (_super) {
98
- __extends(AcDbDatabase, _super);
99
- /**
100
- * Creates a new AcDbDatabase instance.
101
- */
102
- function AcDbDatabase() {
103
- var _this = _super.call(this) || this;
104
- /**
105
- * Events that can be triggered by the database.
106
- *
107
- * These events allow applications to respond to various database operations
108
- * such as entity modifications, layer changes, and progress updates.
109
- */
110
- _this.events = {
111
- /** Fired when an object is set to the dictionary */
112
- dictObjetSet: new AcCmEventManager(),
113
- /** Fired when an object in the dictionary is removed */
114
- dictObjectErased: new AcCmEventManager(),
115
- /** Fired when an entity is appended to the database */
116
- entityAppended: new AcCmEventManager(),
117
- /** Fired when an entity is modified in the database */
118
- entityModified: new AcCmEventManager(),
119
- /** Fired when a layer is appended to the database */
120
- layerAppended: new AcCmEventManager(),
121
- /** Fired when a layer is modified in the database */
122
- layerModified: new AcCmEventManager(),
123
- /** Fired when a layer is erased from the database */
124
- layerErased: new AcCmEventManager(),
125
- /** Fired during database opening operations to report progress */
126
- openProgress: new AcCmEventManager(),
127
- /** Fired when a header system variable is changed */
128
- headerSysVarChanged: new AcCmEventManager()
129
- };
130
- _this._version = new AcDbDwgVersion('AC1014');
131
- _this._codepage = AcDbCodePage.UTF16;
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, "codepage", {
292
- /**
293
- * Gets the code page of the database.
294
- *
295
- * @returns The code page of the database
296
- *
297
- */
298
- get: function () {
299
- return this._codepage;
300
- },
301
- /**
302
- * Sets the code page of the database.
303
- *
304
- * @param value - The code page value of the database
305
- */
306
- set: function (value) {
307
- this._codepage = value;
308
- this.triggerHeaderSysVarChangedEvent('codepage');
309
- },
310
- enumerable: false,
311
- configurable: true
312
- });
313
- Object.defineProperty(AcDbDatabase.prototype, "insunits", {
314
- /**
315
- * Gets the drawing-units value for automatic scaling of blocks, images, or xrefs.
316
- *
317
- * This is the current INSUNITS value for the database.
318
- *
319
- * @returns The insertion units value
320
- *
321
- * @example
322
- * ```typescript
323
- * const insertionUnits = database.insunits;
324
- * ```
325
- */
326
- get: function () {
327
- return this._insunits;
328
- },
329
- /**
330
- * Sets the drawing-units value for automatic scaling.
331
- *
332
- * @param value - The new insertion units value
333
- *
334
- * @example
335
- * ```typescript
336
- * database.insunits = AcDbUnitsValue.Millimeters;
337
- * ```
338
- */
339
- set: function (value) {
340
- // TODO: Default value is 1 (imperial) or 4 (metric)
341
- this._insunits = value || 4;
342
- this.triggerHeaderSysVarChangedEvent('insunits');
343
- },
344
- enumerable: false,
345
- configurable: true
346
- });
347
- Object.defineProperty(AcDbDatabase.prototype, "ltscale", {
348
- /**
349
- * Gets the line type scale factor.
350
- *
351
- * @returns The line type scale factor
352
- *
353
- * @example
354
- * ```typescript
355
- * const lineTypeScale = database.ltscale;
356
- * ```
357
- */
358
- get: function () {
359
- return this._ltscale;
360
- },
361
- /**
362
- * Sets the line type scale factor.
363
- *
364
- * @param value - The new line type scale factor
365
- *
366
- * @example
367
- * ```typescript
368
- * database.ltscale = 2.0;
369
- * ```
370
- */
371
- set: function (value) {
372
- this._ltscale = value || 1;
373
- this.triggerHeaderSysVarChangedEvent('ltscale');
374
- },
375
- enumerable: false,
376
- configurable: true
377
- });
378
- Object.defineProperty(AcDbDatabase.prototype, "cecolor", {
379
- /**
380
- * Gets the color of new objects as they are created.
381
- *
382
- * @returns The current entity color
383
- *
384
- * @example
385
- * ```typescript
386
- * const currentColor = database.cecolor;
387
- * ```
388
- */
389
- get: function () {
390
- return this._cecolor;
391
- },
392
- /**
393
- * Sets the color of new objects as they are created.
394
- *
395
- * @param value - The new current entity color
396
- *
397
- * @example
398
- * ```typescript
399
- * database.cecolor = new AcCmColor(0xFF0000);
400
- * ```
401
- */
402
- set: function (value) {
403
- this._cecolor = value || 0;
404
- this.triggerHeaderSysVarChangedEvent('cecolor');
405
- },
406
- enumerable: false,
407
- configurable: true
408
- });
409
- Object.defineProperty(AcDbDatabase.prototype, "celtscale", {
410
- /**
411
- * The line type scaling for new objects relative to the ltscale setting. A line created with
412
- * celtscale = 2 in a drawing with ltscale set to 0.5 would appear the same as a line created
413
- * with celtscale = 1 in a drawing with ltscale = 1.
414
- */
415
- get: function () {
416
- return this._celtscale;
417
- },
418
- set: function (value) {
419
- this._celtscale = value || 1;
420
- this.triggerHeaderSysVarChangedEvent('celtscale');
421
- },
422
- enumerable: false,
423
- configurable: true
424
- });
425
- Object.defineProperty(AcDbDatabase.prototype, "angBase", {
426
- /**
427
- * The zero (0) base angle with respect to the current UCS in radians.
428
- */
429
- get: function () {
430
- return this._angBase;
431
- },
432
- set: function (value) {
433
- this._angBase = value || 0;
434
- this.triggerHeaderSysVarChangedEvent('angbase');
435
- },
436
- enumerable: false,
437
- configurable: true
438
- });
439
- Object.defineProperty(AcDbDatabase.prototype, "angDir", {
440
- /**
441
- * The direction of positive angles.
442
- * - 0: Counterclockwise
443
- * - 1: Clockwise
444
- */
445
- get: function () {
446
- return this._angDir;
447
- },
448
- set: function (value) {
449
- this._angDir = value || 0;
450
- this.triggerHeaderSysVarChangedEvent('angdir');
451
- },
452
- enumerable: false,
453
- configurable: true
454
- });
455
- Object.defineProperty(AcDbDatabase.prototype, "extmax", {
456
- /**
457
- * The current Model Space EXTMAX value
458
- */
459
- get: function () {
460
- return this._extents.max;
461
- },
462
- set: function (value) {
463
- if (value) {
464
- this._extents.expandByPoint(value);
465
- this.triggerHeaderSysVarChangedEvent('extmax');
466
- }
467
- },
468
- enumerable: false,
469
- configurable: true
470
- });
471
- Object.defineProperty(AcDbDatabase.prototype, "extmin", {
472
- /**
473
- * The current Model Space EXTMIN value
474
- */
475
- get: function () {
476
- return this._extents.min;
477
- },
478
- set: function (value) {
479
- if (value) {
480
- this._extents.expandByPoint(value);
481
- this.triggerHeaderSysVarChangedEvent('extmin');
482
- }
483
- },
484
- enumerable: false,
485
- configurable: true
486
- });
487
- Object.defineProperty(AcDbDatabase.prototype, "extents", {
488
- /**
489
- * The extents of current Model Space
490
- */
491
- get: function () {
492
- return this._extents;
493
- },
494
- enumerable: false,
495
- configurable: true
496
- });
497
- Object.defineProperty(AcDbDatabase.prototype, "pdmode", {
498
- /**
499
- * 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).
500
- */
501
- get: function () {
502
- return this._pdmode;
503
- },
504
- set: function (value) {
505
- this._pdmode = value || 0;
506
- this.triggerHeaderSysVarChangedEvent('pdmode');
507
- },
508
- enumerable: false,
509
- configurable: true
510
- });
511
- Object.defineProperty(AcDbDatabase.prototype, "pdsize", {
512
- /**
513
- * Point display size.
514
- * - 0: Create a point at 5 percent of the drawing area height
515
- * - > 0: Specifie an absolute size
516
- * - < 0: Specifie a percentage of the viewport size
517
- */
518
- get: function () {
519
- return this._pdsize;
520
- },
521
- set: function (value) {
522
- this._pdsize = value || 0;
523
- this.triggerHeaderSysVarChangedEvent('pdsize');
524
- },
525
- enumerable: false,
526
- configurable: true
527
- });
528
- /**
529
- * Reads drawing data from a string or ArrayBuffer.
530
- *
531
- * This method parses the provided data and populates the database with
532
- * the resulting entities, tables, and objects. The method supports
533
- * both DXF and DWG file formats.
534
- *
535
- * @param data - The drawing data as a string or ArrayBuffer
536
- * - For DXF files: Pass a string containing the DXF content
537
- * - For DWG files: Pass an ArrayBuffer instance containing the binary DWG data
538
- * @param options - Options for reading the database
539
- * @param fileType - The type of file being read (defaults to DXF)
540
- *
541
- * @example
542
- * ```typescript
543
- * // Reading a DXF file (string)
544
- * const database = new AcDbDatabase();
545
- * await database.read(dxfString, { readOnly: true }, AcDbFileType.DXF);
546
- *
547
- * // Reading a DWG file (ArrayBuffer)
548
- * const database = new AcDbDatabase();
549
- * await database.read(dwgArrayBuffer, { readOnly: true }, AcDbFileType.DWG);
550
- * ```
551
- */
552
- AcDbDatabase.prototype.read = function (data_1, options_1) {
553
- return __awaiter(this, arguments, void 0, function (data, options, fileType) {
554
- var converter;
555
- var _this = this;
556
- if (fileType === void 0) { fileType = AcDbFileType.DXF; }
557
- return __generator(this, function (_a) {
558
- switch (_a.label) {
559
- case 0:
560
- converter = AcDbDatabaseConverterManager.instance.get(fileType);
561
- if (converter == null)
562
- throw new Error("Database converter for file type '".concat(fileType, "' isn't registered and can can't read this file!"));
563
- this.clear();
564
- return [4 /*yield*/, converter.read(data, this, (options && options.minimumChunkSize) || 10, function (percentage, stage, stageStatus, data) { return __awaiter(_this, void 0, void 0, function () {
565
- var fonts_1;
566
- return __generator(this, function (_a) {
567
- switch (_a.label) {
568
- case 0:
569
- this.events.openProgress.dispatch({
570
- database: this,
571
- percentage: percentage,
572
- stage: 'CONVERSION',
573
- subStage: stage,
574
- subStageStatus: stageStatus,
575
- data: data
576
- });
577
- if (!(options &&
578
- options.fontLoader &&
579
- stage == 'FONT' &&
580
- stageStatus == 'END')) return [3 /*break*/, 2];
581
- fonts_1 = data
582
- ? data
583
- : this.tables.textStyleTable.fonts;
584
- return [4 /*yield*/, options.fontLoader.load(fonts_1)];
585
- case 1:
586
- _a.sent();
587
- _a.label = 2;
588
- case 2: return [2 /*return*/];
589
- }
590
- });
591
- }); })];
592
- case 1:
593
- _a.sent();
594
- return [2 /*return*/];
595
- }
596
- });
597
- });
598
- };
599
- /**
600
- * Read AutoCAD DXF or DWG drawing specified by the URL into the database object.
601
- * The method automatically detects the file type based on the URL extension:
602
- * - .dxf files are read as text using readAsText()
603
- * - .dwg files are read as binary data using readAsArrayBuffer()
604
- * @param url Input the URL linked to one AutoCAD DXF or DWG file
605
- * @param options Input options to read drawing data
606
- */
607
- AcDbDatabase.prototype.openUri = function (url, options) {
608
- return __awaiter(this, void 0, void 0, function () {
609
- var response, contentLength, totalBytes, loadedBytes, reader, chunks, _a, done, value, percentage, content, position, chunks_1, chunks_1_1, chunk, fileExtension;
610
- var e_1, _b;
611
- var _c;
612
- return __generator(this, function (_d) {
613
- switch (_d.label) {
614
- case 0:
615
- this.events.openProgress.dispatch({
616
- database: this,
617
- percentage: 0,
618
- stage: 'FETCH_FILE',
619
- subStageStatus: 'START'
620
- });
621
- return [4 /*yield*/, fetch(url)];
622
- case 1:
623
- response = _d.sent();
624
- if (!response.ok) {
625
- this.events.openProgress.dispatch({
626
- database: this,
627
- percentage: 100,
628
- stage: 'FETCH_FILE',
629
- subStageStatus: 'ERROR'
630
- });
631
- throw new Error("Failed to fetch file '".concat(url, "' with HTTP status code '").concat(response.status, "'!"));
632
- }
633
- contentLength = response.headers.get('content-length');
634
- totalBytes = contentLength ? parseInt(contentLength, 10) : null;
635
- loadedBytes = 0;
636
- reader = (_c = response.body) === null || _c === void 0 ? void 0 : _c.getReader();
637
- if (!reader) {
638
- throw new Error('Failed to get response reader');
639
- }
640
- chunks = [];
641
- _d.label = 2;
642
- case 2:
643
- if (!true) return [3 /*break*/, 4];
644
- return [4 /*yield*/, reader.read()];
645
- case 3:
646
- _a = _d.sent(), done = _a.done, value = _a.value;
647
- if (done) {
648
- return [3 /*break*/, 4];
649
- }
650
- chunks.push(value);
651
- loadedBytes += value.length;
652
- // Calculate and report progress if we know the total size
653
- if (totalBytes !== null) {
654
- percentage = Math.round((loadedBytes / totalBytes) * 100);
655
- this.events.openProgress.dispatch({
656
- database: this,
657
- percentage: percentage,
658
- stage: 'FETCH_FILE',
659
- subStageStatus: 'IN-PROGRESS'
660
- });
661
- }
662
- return [3 /*break*/, 2];
663
- case 4:
664
- content = new Uint8Array(loadedBytes);
665
- position = 0;
666
- try {
667
- for (chunks_1 = __values(chunks), chunks_1_1 = chunks_1.next(); !chunks_1_1.done; chunks_1_1 = chunks_1.next()) {
668
- chunk = chunks_1_1.value;
669
- content.set(chunk, position);
670
- position += chunk.length;
671
- }
672
- }
673
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
674
- finally {
675
- try {
676
- if (chunks_1_1 && !chunks_1_1.done && (_b = chunks_1.return)) _b.call(chunks_1);
677
- }
678
- finally { if (e_1) throw e_1.error; }
679
- }
680
- fileExtension = url.toLowerCase().split('.').pop();
681
- if (!(fileExtension === 'dwg')) return [3 /*break*/, 6];
682
- // DWG files are binary, convert to ArrayBuffer
683
- return [4 /*yield*/, this.read(content.buffer, options, AcDbFileType.DWG)];
684
- case 5:
685
- // DWG files are binary, convert to ArrayBuffer
686
- _d.sent();
687
- return [3 /*break*/, 8];
688
- case 6: return [4 /*yield*/, this.read(content.buffer, options, AcDbFileType.DXF)];
689
- case 7:
690
- _d.sent();
691
- _d.label = 8;
692
- case 8:
693
- this.events.openProgress.dispatch({
694
- database: this,
695
- percentage: 100,
696
- stage: 'FETCH_FILE',
697
- subStageStatus: 'END'
698
- });
699
- return [2 /*return*/];
700
- }
701
- });
702
- });
703
- };
704
- /**
705
- * Create default layer, line type, dimension type, text style and layout.
706
- * @param - Options to specify data to create
707
- */
708
- AcDbDatabase.prototype.createDefaultData = function (options) {
709
- if (options === void 0) { options = {
710
- layer: true,
711
- lineType: true,
712
- textStyle: true,
713
- dimStyle: true,
714
- layout: true
715
- }; }
716
- // Create default layer
717
- if (options.layer) {
718
- var defaultColor = new AcCmColor();
719
- defaultColor.colorIndex = 7; // white
720
- this._tables.layerTable.add(new AcDbLayerTableRecord({
721
- name: '0',
722
- standardFlags: 0,
723
- linetype: 'Continuous',
724
- lineWeight: 0,
725
- isOff: false,
726
- color: defaultColor,
727
- isPlottable: true
728
- }));
729
- }
730
- // Create default line type
731
- if (options.lineType) {
732
- this._tables.linetypeTable.add(new AcDbLinetypeTableRecord({
733
- name: 'ByBlock',
734
- standardFlag: 0,
735
- description: '',
736
- totalPatternLength: 0
737
- }));
738
- this._tables.linetypeTable.add(new AcDbLinetypeTableRecord({
739
- name: 'ByLayer',
740
- standardFlag: 0,
741
- description: '',
742
- totalPatternLength: 0
743
- }));
744
- this._tables.linetypeTable.add(new AcDbLinetypeTableRecord({
745
- name: 'Continuous',
746
- standardFlag: 0,
747
- description: 'Solid line',
748
- totalPatternLength: 0
749
- }));
750
- }
751
- // Create default text style
752
- if (options.textStyle) {
753
- this._tables.textStyleTable.add(new AcDbTextStyleTableRecord({
754
- name: 'Standard',
755
- standardFlag: 0,
756
- fixedTextHeight: 0,
757
- widthFactor: 1,
758
- obliqueAngle: 0,
759
- textGenerationFlag: 0,
760
- lastHeight: 0.2,
761
- font: 'SimKai',
762
- bigFont: '',
763
- extendedFont: 'SimKai'
764
- }));
765
- }
766
- // Create default dimension style
767
- if (options.dimStyle) {
768
- this._tables.dimStyleTable.add(new AcDbDimStyleTableRecord({
769
- name: 'Standard',
770
- dimtxsty: 'Standard'
771
- }));
772
- }
773
- // Create default layer for model space
774
- if (options.layout) {
775
- var layout = new AcDbLayout();
776
- layout.layoutName = 'Model';
777
- layout.tabOrder = 0;
778
- layout.blockTableRecordId = this._tables.blockTable.modelSpace.objectId;
779
- layout.limits.min.copy({ x: 0, y: 0 });
780
- layout.limits.max.copy({ x: 1000000, y: 1000000 });
781
- layout.extents.min.copy({ x: 0, y: 0, z: 0 });
782
- layout.extents.max.copy({ x: 1000000, y: 1000000, z: 0 });
783
- this._dictionaries.layouts.setAt(layout.layoutName, layout);
784
- this._tables.blockTable.modelSpace.layoutId = layout.objectId;
785
- }
786
- };
787
- /**
788
- * Clears all data from the database.
789
- *
790
- * This method removes all entities, tables, and objects from the database,
791
- * effectively resetting it to an empty state.
792
- *
793
- * @example
794
- * ```typescript
795
- * database.clear();
796
- * ```
797
- */
798
- AcDbDatabase.prototype.clear = function () {
799
- // Clear all tables and dictionaries
800
- this._tables.blockTable.removeAll();
801
- this._tables.dimStyleTable.removeAll();
802
- this._tables.linetypeTable.removeAll();
803
- this._tables.textStyleTable.removeAll();
804
- this._tables.layerTable.removeAll();
805
- this._tables.viewportTable.removeAll();
806
- this._dictionaries.layouts.removeAll();
807
- this._currentSpace = undefined;
808
- this._extents.makeEmpty();
809
- };
810
- /**
811
- * Triggers a header system variable changed event.
812
- *
813
- * This method is called internally when header system variables
814
- * are modified to notify listeners of the change.
815
- *
816
- * @param sysVarName - The name of the system variable that changed
817
- *
818
- * @example
819
- * ```typescript
820
- * database.triggerHeaderSysVarChangedEvent('aunits');
821
- * ```
822
- */
823
- AcDbDatabase.prototype.triggerHeaderSysVarChangedEvent = function (sysVarName) {
824
- this.events.headerSysVarChanged.dispatch({
825
- database: this,
826
- name: sysVarName
827
- });
828
- };
829
- return AcDbDatabase;
830
- }(AcDbObject));
831
- export { AcDbDatabase };
832
- /* eslint-enable simple-import-sort/imports */
833
- //# sourceMappingURL=AcDbDatabase.js.map