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