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