@mlightcad/data-model 1.1.2 → 1.1.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.js +5501 -1021
- package/dist/data-model.umd.cjs +2 -2
- package/lib/base/AcDbHostApplicationServices.d.ts +72 -6
- package/lib/base/AcDbHostApplicationServices.d.ts.map +1 -1
- package/lib/base/AcDbHostApplicationServices.js +71 -7
- package/lib/base/AcDbHostApplicationServices.js.map +1 -1
- package/lib/base/AcDbObject.d.ts +160 -25
- package/lib/base/AcDbObject.d.ts.map +1 -1
- package/lib/base/AcDbObject.js +149 -25
- package/lib/base/AcDbObject.js.map +1 -1
- package/lib/converter/AcDbBatchProcessing.d.ts +112 -10
- package/lib/converter/AcDbBatchProcessing.d.ts.map +1 -1
- package/lib/converter/AcDbBatchProcessing.js +110 -11
- package/lib/converter/AcDbBatchProcessing.js.map +1 -1
- package/lib/converter/AcDbDxfConverter.d.ts +224 -6
- package/lib/converter/AcDbDxfConverter.d.ts.map +1 -1
- package/lib/converter/AcDbDxfConverter.js +224 -6
- package/lib/converter/AcDbDxfConverter.js.map +1 -1
- package/lib/converter/AcDbDxfParseWorker.d.ts +16 -0
- package/lib/converter/AcDbDxfParseWorker.d.ts.map +1 -1
- package/lib/converter/AcDbDxfParseWorker.js +16 -0
- package/lib/converter/AcDbDxfParseWorker.js.map +1 -1
- package/lib/converter/AcDbEntitiyConverter.d.ts +118 -3
- package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -1
- package/lib/converter/AcDbEntitiyConverter.js +118 -3
- package/lib/converter/AcDbEntitiyConverter.js.map +1 -1
- package/lib/converter/AcDbObjectConverter.d.ts +52 -0
- package/lib/converter/AcDbObjectConverter.d.ts.map +1 -1
- package/lib/converter/AcDbObjectConverter.js +52 -0
- package/lib/converter/AcDbObjectConverter.js.map +1 -1
- package/lib/database/AcDbBlockTable.d.ts +35 -3
- package/lib/database/AcDbBlockTable.d.ts.map +1 -1
- package/lib/database/AcDbBlockTable.js +35 -3
- package/lib/database/AcDbBlockTable.js.map +1 -1
- package/lib/database/AcDbBlockTableRecord.d.ts +98 -15
- package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbBlockTableRecord.js +96 -15
- package/lib/database/AcDbBlockTableRecord.js.map +1 -1
- package/lib/database/AcDbDatabase.d.ts +312 -36
- package/lib/database/AcDbDatabase.d.ts.map +1 -1
- package/lib/database/AcDbDatabase.js +237 -46
- package/lib/database/AcDbDatabase.js.map +1 -1
- package/lib/database/AcDbDatabaseConverter.d.ts +79 -14
- package/lib/database/AcDbDatabaseConverter.d.ts.map +1 -1
- package/lib/database/AcDbDatabaseConverter.js +46 -13
- package/lib/database/AcDbDatabaseConverter.js.map +1 -1
- package/lib/database/AcDbDatabaseConverterManager.d.ts +97 -15
- package/lib/database/AcDbDatabaseConverterManager.d.ts.map +1 -1
- package/lib/database/AcDbDatabaseConverterManager.js +90 -15
- package/lib/database/AcDbDatabaseConverterManager.js.map +1 -1
- package/lib/database/AcDbDimStyleTable.d.ts +22 -2
- package/lib/database/AcDbDimStyleTable.d.ts.map +1 -1
- package/lib/database/AcDbDimStyleTable.js +22 -2
- package/lib/database/AcDbDimStyleTable.js.map +1 -1
- package/lib/database/AcDbDimStyleTableRecord.d.ts +115 -0
- package/lib/database/AcDbDimStyleTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbDimStyleTableRecord.js +44 -0
- package/lib/database/AcDbDimStyleTableRecord.js.map +1 -1
- package/lib/database/AcDbLayerTable.d.ts +39 -2
- package/lib/database/AcDbLayerTable.d.ts.map +1 -1
- package/lib/database/AcDbLayerTable.js +39 -2
- package/lib/database/AcDbLayerTable.js.map +1 -1
- package/lib/database/AcDbLayerTableRecord.d.ts +198 -18
- package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbLayerTableRecord.js +182 -19
- package/lib/database/AcDbLayerTableRecord.js.map +1 -1
- package/lib/database/AcDbLinetypeTable.d.ts +21 -2
- package/lib/database/AcDbLinetypeTable.d.ts.map +1 -1
- package/lib/database/AcDbLinetypeTable.js +21 -2
- package/lib/database/AcDbLinetypeTable.js.map +1 -1
- package/lib/database/AcDbLinetypeTableRecord.d.ts +46 -14
- package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbLinetypeTableRecord.js +46 -14
- package/lib/database/AcDbLinetypeTableRecord.js.map +1 -1
- package/lib/database/AcDbSymbolTable.d.ts +134 -29
- package/lib/database/AcDbSymbolTable.d.ts.map +1 -1
- package/lib/database/AcDbSymbolTable.js +133 -37
- package/lib/database/AcDbSymbolTable.js.map +1 -1
- package/lib/database/AcDbSymbolTableRecord.d.ts +47 -2
- package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbSymbolTableRecord.js +40 -2
- package/lib/database/AcDbSymbolTableRecord.js.map +1 -1
- package/lib/database/AcDbTextStyleTable.d.ts +36 -2
- package/lib/database/AcDbTextStyleTable.d.ts.map +1 -1
- package/lib/database/AcDbTextStyleTable.js +36 -2
- package/lib/database/AcDbTextStyleTable.js.map +1 -1
- package/lib/database/AcDbTextStyleTableRecord.d.ts +129 -17
- package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbTextStyleTableRecord.js +127 -17
- package/lib/database/AcDbTextStyleTableRecord.js.map +1 -1
- package/lib/database/AcDbViewportTable.d.ts +22 -2
- package/lib/database/AcDbViewportTable.d.ts.map +1 -1
- package/lib/database/AcDbViewportTable.js +22 -2
- package/lib/database/AcDbViewportTable.js.map +1 -1
- package/lib/database/AcDbViewportTableRecord.d.ts +74 -9
- package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -1
- package/lib/database/AcDbViewportTableRecord.js +65 -9
- package/lib/database/AcDbViewportTableRecord.js.map +1 -1
- package/lib/entity/AcDbArc.d.ts +202 -17
- package/lib/entity/AcDbArc.d.ts.map +1 -1
- package/lib/entity/AcDbArc.js +201 -17
- package/lib/entity/AcDbArc.js.map +1 -1
- package/lib/entity/AcDbBlockReference.d.ts +147 -13
- package/lib/entity/AcDbBlockReference.d.ts.map +1 -1
- package/lib/entity/AcDbBlockReference.js +142 -13
- package/lib/entity/AcDbBlockReference.js.map +1 -1
- package/lib/entity/AcDbCircle.d.ts +145 -12
- package/lib/entity/AcDbCircle.d.ts.map +1 -1
- package/lib/entity/AcDbCircle.js +144 -12
- package/lib/entity/AcDbCircle.js.map +1 -1
- package/lib/entity/AcDbCurve.d.ts +33 -2
- package/lib/entity/AcDbCurve.d.ts.map +1 -1
- package/lib/entity/AcDbCurve.js +17 -0
- package/lib/entity/AcDbCurve.js.map +1 -1
- package/lib/entity/AcDbEllipse.d.ts +168 -16
- package/lib/entity/AcDbEllipse.d.ts.map +1 -1
- package/lib/entity/AcDbEllipse.js +167 -16
- package/lib/entity/AcDbEllipse.js.map +1 -1
- package/lib/entity/AcDbEntity.d.ts +299 -35
- package/lib/entity/AcDbEntity.d.ts.map +1 -1
- package/lib/entity/AcDbEntity.js +275 -27
- package/lib/entity/AcDbEntity.js.map +1 -1
- package/lib/entity/AcDbHatch.d.ts +60 -4
- package/lib/entity/AcDbHatch.d.ts.map +1 -1
- package/lib/entity/AcDbHatch.js +52 -4
- package/lib/entity/AcDbHatch.js.map +1 -1
- package/lib/entity/AcDbLeader.d.ts +157 -10
- package/lib/entity/AcDbLeader.d.ts.map +1 -1
- package/lib/entity/AcDbLeader.js +149 -10
- package/lib/entity/AcDbLeader.js.map +1 -1
- package/lib/entity/AcDbLine.d.ts +154 -13
- package/lib/entity/AcDbLine.d.ts.map +1 -1
- package/lib/entity/AcDbLine.js +153 -13
- package/lib/entity/AcDbLine.js.map +1 -1
- package/lib/entity/AcDbMText.d.ts +127 -11
- package/lib/entity/AcDbMText.d.ts.map +1 -1
- package/lib/entity/AcDbMText.js +112 -11
- package/lib/entity/AcDbMText.js.map +1 -1
- package/lib/entity/AcDbPoint.d.ts +86 -7
- package/lib/entity/AcDbPoint.d.ts.map +1 -1
- package/lib/entity/AcDbPoint.js +85 -7
- package/lib/entity/AcDbPoint.js.map +1 -1
- package/lib/entity/AcDbPolyline.d.ts +172 -25
- package/lib/entity/AcDbPolyline.d.ts.map +1 -1
- package/lib/entity/AcDbPolyline.js +170 -25
- package/lib/entity/AcDbPolyline.js.map +1 -1
- package/lib/entity/AcDbRasterImage.d.ts +75 -31
- package/lib/entity/AcDbRasterImage.d.ts.map +1 -1
- package/lib/entity/AcDbRasterImage.js +60 -31
- package/lib/entity/AcDbRasterImage.js.map +1 -1
- package/lib/entity/AcDbRay.d.ts +115 -9
- package/lib/entity/AcDbRay.d.ts.map +1 -1
- package/lib/entity/AcDbRay.js +113 -9
- package/lib/entity/AcDbRay.js.map +1 -1
- package/lib/entity/AcDbSpline.d.ts +106 -14
- package/lib/entity/AcDbSpline.d.ts.map +1 -1
- package/lib/entity/AcDbSpline.js +67 -4
- package/lib/entity/AcDbSpline.js.map +1 -1
- package/lib/entity/AcDbTable.d.ts +161 -44
- package/lib/entity/AcDbTable.d.ts.map +1 -1
- package/lib/entity/AcDbTable.js +135 -44
- package/lib/entity/AcDbTable.js.map +1 -1
- package/lib/entity/AcDbText.d.ts +298 -25
- package/lib/entity/AcDbText.d.ts.map +1 -1
- package/lib/entity/AcDbText.js +288 -25
- package/lib/entity/AcDbText.js.map +1 -1
- package/lib/entity/AcDbTrace.d.ts +150 -23
- package/lib/entity/AcDbTrace.d.ts.map +1 -1
- package/lib/entity/AcDbTrace.js +147 -23
- package/lib/entity/AcDbTrace.js.map +1 -1
- package/lib/entity/AcDbViewport.d.ts +122 -9
- package/lib/entity/AcDbViewport.d.ts.map +1 -1
- package/lib/entity/AcDbViewport.js +122 -9
- package/lib/entity/AcDbViewport.js.map +1 -1
- package/lib/entity/AcDbWipeout.d.ts +29 -1
- package/lib/entity/AcDbWipeout.d.ts.map +1 -1
- package/lib/entity/AcDbWipeout.js +29 -1
- package/lib/entity/AcDbWipeout.js.map +1 -1
- package/lib/entity/AcDbXline.d.ts +116 -9
- package/lib/entity/AcDbXline.d.ts.map +1 -1
- package/lib/entity/AcDbXline.js +114 -9
- package/lib/entity/AcDbXline.js.map +1 -1
- package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +56 -12
- package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDb3PointAngularDimension.js +56 -12
- package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbAlignedDimension.d.ts +158 -17
- package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbAlignedDimension.js +153 -17
- package/lib/entity/dimension/AcDbAlignedDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbArcDimension.d.ts +58 -12
- package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbArcDimension.js +58 -12
- package/lib/entity/dimension/AcDbArcDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbDiametricDimension.d.ts +99 -25
- package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbDiametricDimension.js +99 -25
- package/lib/entity/dimension/AcDbDiametricDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbDimension.d.ts +108 -14
- package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbDimension.js +99 -14
- package/lib/entity/dimension/AcDbDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +48 -16
- package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbOrdinateDimension.js +48 -16
- package/lib/entity/dimension/AcDbOrdinateDimension.js.map +1 -1
- package/lib/entity/dimension/AcDbRadialDimension.d.ts +167 -24
- package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +1 -1
- package/lib/entity/dimension/AcDbRadialDimension.js +162 -24
- package/lib/entity/dimension/AcDbRadialDimension.js.map +1 -1
- package/lib/misc/AcDbAngleUnits.d.ts +12 -0
- package/lib/misc/AcDbAngleUnits.d.ts.map +1 -1
- package/lib/misc/AcDbAngleUnits.js +12 -0
- package/lib/misc/AcDbAngleUnits.js.map +1 -1
- package/lib/misc/AcDbConstants.d.ts +20 -0
- package/lib/misc/AcDbConstants.d.ts.map +1 -1
- package/lib/misc/AcDbConstants.js +20 -0
- package/lib/misc/AcDbConstants.js.map +1 -1
- package/lib/misc/AcDbDimArrowType.d.ts +24 -21
- package/lib/misc/AcDbDimArrowType.d.ts.map +1 -1
- package/lib/misc/AcDbDimArrowType.js +24 -21
- package/lib/misc/AcDbDimArrowType.js.map +1 -1
- package/lib/misc/AcDbObjectIterator.d.ts +42 -3
- package/lib/misc/AcDbObjectIterator.d.ts.map +1 -1
- package/lib/misc/AcDbObjectIterator.js +42 -3
- package/lib/misc/AcDbObjectIterator.js.map +1 -1
- package/lib/misc/AcDbOsnapMode.d.ts +18 -10
- package/lib/misc/AcDbOsnapMode.d.ts.map +1 -1
- package/lib/misc/AcDbOsnapMode.js +18 -10
- package/lib/misc/AcDbOsnapMode.js.map +1 -1
- package/lib/misc/AcDbRenderingCache.d.ts +107 -29
- package/lib/misc/AcDbRenderingCache.d.ts.map +1 -1
- package/lib/misc/AcDbRenderingCache.js +105 -29
- package/lib/misc/AcDbRenderingCache.js.map +1 -1
- package/lib/misc/AcDbUnitsValue.d.ts +58 -8
- package/lib/misc/AcDbUnitsValue.d.ts.map +1 -1
- package/lib/misc/AcDbUnitsValue.js +58 -8
- package/lib/misc/AcDbUnitsValue.js.map +1 -1
- package/lib/object/AcDbDictionary.d.ts +128 -30
- package/lib/object/AcDbDictionary.d.ts.map +1 -1
- package/lib/object/AcDbDictionary.js +126 -30
- package/lib/object/AcDbDictionary.js.map +1 -1
- package/lib/object/AcDbRasterImageDef.d.ts +38 -9
- package/lib/object/AcDbRasterImageDef.d.ts.map +1 -1
- package/lib/object/AcDbRasterImageDef.js +37 -9
- package/lib/object/AcDbRasterImageDef.js.map +1 -1
- package/lib/object/layout/AcDbLayout.d.ts +152 -13
- package/lib/object/layout/AcDbLayout.d.ts.map +1 -1
- package/lib/object/layout/AcDbLayout.js +146 -13
- package/lib/object/layout/AcDbLayout.js.map +1 -1
- package/lib/object/layout/AcDbLayoutDictionary.d.ts +35 -7
- package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +1 -1
- package/lib/object/layout/AcDbLayoutDictionary.js +35 -7
- package/lib/object/layout/AcDbLayoutDictionary.js.map +1 -1
- package/lib/object/layout/AcDbLayoutManager.d.ts +103 -31
- package/lib/object/layout/AcDbLayoutManager.d.ts.map +1 -1
- package/lib/object/layout/AcDbLayoutManager.js +98 -31
- package/lib/object/layout/AcDbLayoutManager.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,36 +1,68 @@
|
|
|
1
1
|
import { AcGeBox3d } from '@mlightcad/geometry-engine';
|
|
2
2
|
import { AcGiEntity, AcGiMTextAttachmentPoint, AcGiRenderer } from '@mlightcad/graphic-interface';
|
|
3
3
|
import { AcDbBlockReference } from './AcDbBlockReference';
|
|
4
|
+
/**
|
|
5
|
+
* Interface defining the properties of a table cell within an AcDbTable entity.
|
|
6
|
+
*
|
|
7
|
+
* Table cells can contain various types of content including text, blocks, and other
|
|
8
|
+
* entities. Each cell has properties that control its appearance, content, and behavior.
|
|
9
|
+
*/
|
|
4
10
|
export interface AcDbTableCell {
|
|
11
|
+
/** The text content displayed in the cell */
|
|
5
12
|
text: string;
|
|
13
|
+
/** The attachment point for text positioning within the cell */
|
|
6
14
|
attachmentPoint: AcGiMTextAttachmentPoint;
|
|
15
|
+
/** Optional text style name for the cell content */
|
|
7
16
|
textStyle?: string;
|
|
17
|
+
/** Optional rotation angle for the cell content in radians */
|
|
8
18
|
rotation?: number;
|
|
19
|
+
/** The type of cell (text, block, etc.) */
|
|
9
20
|
cellType: number;
|
|
21
|
+
/** Optional flag value for cell behavior */
|
|
10
22
|
flagValue?: number;
|
|
23
|
+
/** Optional value indicating merged cell information */
|
|
11
24
|
mergedValue?: number;
|
|
25
|
+
/** Optional auto-fit behavior setting */
|
|
12
26
|
autoFit?: number;
|
|
27
|
+
/** Optional border width for merged cells */
|
|
13
28
|
borderWidth?: number;
|
|
29
|
+
/** Optional border height for merged cells */
|
|
14
30
|
borderHeight?: number;
|
|
31
|
+
/** Optional override flag for cell properties */
|
|
15
32
|
overrideFlag?: number;
|
|
33
|
+
/** Optional virtual edge flag for cell borders */
|
|
16
34
|
virtualEdgeFlag?: number;
|
|
35
|
+
/** Optional field object ID for text type cells */
|
|
17
36
|
fieldObjetId?: string;
|
|
37
|
+
/** Optional block table record ID for block type cells */
|
|
18
38
|
blockTableRecordId?: string;
|
|
39
|
+
/** Optional scale factor for block type cells */
|
|
19
40
|
blockScale?: number;
|
|
41
|
+
/** Optional number of block attributes */
|
|
20
42
|
blockAttrNum?: number;
|
|
43
|
+
/** Optional array of attribute definition IDs */
|
|
21
44
|
attrDefineId?: string[];
|
|
45
|
+
/** Optional attribute text content */
|
|
22
46
|
attrText?: string;
|
|
47
|
+
/** The height of text in the cell */
|
|
23
48
|
textHeight: number;
|
|
49
|
+
/** Extended cell flags from AutoCAD 2007 and later */
|
|
24
50
|
extendedCellFlags?: number;
|
|
25
51
|
}
|
|
26
52
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
53
|
+
* Represents a table entity in AutoCAD.
|
|
54
|
+
*
|
|
55
|
+
* A table is generally thought of as an n x m rectangular array of cells whose contents
|
|
56
|
+
* consist of annotation objects, primarily text. Tables often contain a title row, a
|
|
57
|
+
* header row, and multiple data rows.
|
|
30
58
|
*
|
|
31
|
-
* After creating a new table object using the constructor, applications usually need to
|
|
32
|
-
* number of rows and columns, column width, row height, insert
|
|
33
|
-
* Applications can also enter text or
|
|
59
|
+
* After creating a new table object using the constructor, applications usually need to
|
|
60
|
+
* set the table style, number of rows and columns, column width, row height, insert
|
|
61
|
+
* position, width direction, and normal vector. Applications can also enter text or
|
|
62
|
+
* block contents into each cell using methods of this class.
|
|
63
|
+
*
|
|
64
|
+
* Tables are commonly used for bills of materials, schedules, data sheets, and other
|
|
65
|
+
* tabular information in technical drawings and documentation.
|
|
34
66
|
*/
|
|
35
67
|
export declare class AcDbTable extends AcDbBlockReference {
|
|
36
68
|
private _attachmentPoint;
|
|
@@ -39,103 +71,188 @@ export declare class AcDbTable extends AcDbBlockReference {
|
|
|
39
71
|
private _rowHeight;
|
|
40
72
|
private _columnWidth;
|
|
41
73
|
private _cells;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new table entity.
|
|
76
|
+
*
|
|
77
|
+
* @param name - The name of the table block reference
|
|
78
|
+
* @param numRows - The number of rows in the table
|
|
79
|
+
* @param numColumns - The number of columns in the table
|
|
80
|
+
*/
|
|
42
81
|
constructor(name: string, numRows: number, numColumns: number);
|
|
43
82
|
/**
|
|
44
|
-
*
|
|
83
|
+
* Gets or sets the cell alignment value for this table.
|
|
84
|
+
*
|
|
85
|
+
* This property controls how text is positioned within table cells by default.
|
|
86
|
+
* Individual cells can override this setting with their own attachment point.
|
|
87
|
+
*
|
|
88
|
+
* @returns The default attachment point for table cells
|
|
45
89
|
*/
|
|
46
90
|
get attachmentPoint(): AcGiMTextAttachmentPoint;
|
|
47
91
|
set attachmentPoint(value: AcGiMTextAttachmentPoint);
|
|
48
92
|
/**
|
|
49
|
-
*
|
|
93
|
+
* Gets or sets the number of rows in the table.
|
|
94
|
+
*
|
|
95
|
+
* Changing this value will resize the table and may affect existing cell data.
|
|
96
|
+
*
|
|
97
|
+
* @returns The current number of rows in the table
|
|
50
98
|
*/
|
|
51
99
|
get numRows(): number;
|
|
52
100
|
set numRows(value: number);
|
|
53
101
|
/**
|
|
54
|
-
*
|
|
102
|
+
* Gets or sets the number of columns in the table.
|
|
103
|
+
*
|
|
104
|
+
* Changing this value will resize the table and may affect existing cell data.
|
|
105
|
+
*
|
|
106
|
+
* @returns The current number of columns in the table
|
|
55
107
|
*/
|
|
56
108
|
get numColumns(): number;
|
|
57
109
|
set numColumns(value: number);
|
|
58
110
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* @param
|
|
62
|
-
* @
|
|
111
|
+
* Gets the number of contents in the specified cell.
|
|
112
|
+
*
|
|
113
|
+
* @param row - Row index. Must be greater than or equal to 0 and less than the number of rows
|
|
114
|
+
* @param col - Column index. Must be greater than or equal to 0 and less than the number of columns
|
|
115
|
+
* @returns The number of contents in the specified cell
|
|
63
116
|
*/
|
|
64
117
|
numContents(row: number, col: number): number;
|
|
65
118
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @
|
|
119
|
+
* Gets the row height of the specified row in the table.
|
|
120
|
+
*
|
|
121
|
+
* @param index - Zero-based row index
|
|
122
|
+
* @returns The row height of the specified row in the table
|
|
69
123
|
*/
|
|
70
124
|
rowHeight(index: number): number;
|
|
71
125
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* @param
|
|
126
|
+
* Sets the row height for the specified row index in the table.
|
|
127
|
+
*
|
|
128
|
+
* @param index - Zero-based row index
|
|
129
|
+
* @param height - Height to be used for the specified row
|
|
75
130
|
*/
|
|
76
131
|
setRowHeight(index: number, height: number): void;
|
|
77
132
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
133
|
+
* Sets a uniform row height for all the rows in the table.
|
|
134
|
+
*
|
|
135
|
+
* @param height - Height to be used for all the rows in the table
|
|
80
136
|
*/
|
|
81
137
|
setUniformRowHeight(height: number): void;
|
|
82
138
|
/**
|
|
83
|
-
*
|
|
139
|
+
* Gets the column width at the specified column index in the table.
|
|
140
|
+
*
|
|
141
|
+
* @param index - Zero-based column index
|
|
142
|
+
* @returns The width of the specified column
|
|
84
143
|
*/
|
|
85
144
|
columnWidth(index: number): number;
|
|
86
145
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
146
|
+
* Sets a uniform column width for all the columns in the table.
|
|
147
|
+
*
|
|
148
|
+
* @param width - Uniform width to be used for all the columns in the table
|
|
89
149
|
*/
|
|
90
150
|
setUniformColumnWidth(width: number): void;
|
|
91
151
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @param
|
|
152
|
+
* Sets the column width at the specified column index in the table.
|
|
153
|
+
*
|
|
154
|
+
* @param index - Zero-based column index
|
|
155
|
+
* @param width - Width to be used for the specified column
|
|
95
156
|
*/
|
|
96
157
|
setColumnWidth(index: number, width: number): void;
|
|
97
158
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* @
|
|
159
|
+
* Gets the cell at the specified index.
|
|
160
|
+
*
|
|
161
|
+
* @param index - Cell index (calculated as row * numColumns + column)
|
|
162
|
+
* @returns The specified cell by index, or undefined if index is out of range
|
|
101
163
|
*/
|
|
102
164
|
cell(index: number): AcDbTableCell | undefined;
|
|
103
165
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
166
|
+
* Sets the cell at the specified index.
|
|
167
|
+
*
|
|
168
|
+
* @param index - Cell index (calculated as row * numColumns + column)
|
|
169
|
+
* @param cell - The cell data to set
|
|
106
170
|
*/
|
|
107
171
|
setCell(index: number, cell: AcDbTableCell): void;
|
|
108
172
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
173
|
+
* Gets the text string in the specified cell.
|
|
174
|
+
*
|
|
175
|
+
* @param row - Integer specifying the zero-based row index for the cell
|
|
176
|
+
* @param col - Integer specifying the zero-based column index for the cell
|
|
177
|
+
* @param content - Content index. Should be greater than or equal to 0 and less than the number of contents
|
|
178
|
+
* @returns The text string in the specified cell
|
|
113
179
|
*/
|
|
114
180
|
textString(row: number, col: number, content?: number): string;
|
|
115
181
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
182
|
+
* Sets the text for the first content at the specified content index.
|
|
183
|
+
*
|
|
184
|
+
* @param row - Integer specifying the zero-based row index for the cell
|
|
185
|
+
* @param col - Integer specifying the zero-based column index for the cell
|
|
186
|
+
* @param text - Text string to set
|
|
120
187
|
*/
|
|
121
188
|
setTextString(row: number, col: number, text: string): void;
|
|
122
189
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @param
|
|
126
|
-
* @
|
|
190
|
+
* Checks if the content of the specified cell is empty.
|
|
191
|
+
*
|
|
192
|
+
* @param row - Integer specifying the zero-based row index for the cell
|
|
193
|
+
* @param col - Integer specifying the zero-based column index for the cell
|
|
194
|
+
* @returns True if the content of the specified cell is empty, false otherwise
|
|
127
195
|
*/
|
|
128
196
|
isEmpty(row: number, col: number): boolean;
|
|
129
197
|
/**
|
|
198
|
+
* Gets the geometric extents (bounding box) of this table entity.
|
|
199
|
+
*
|
|
200
|
+
* The geometric extents define the minimum bounding box that completely contains
|
|
201
|
+
* the table entity, including all its cells, borders, and content.
|
|
202
|
+
*
|
|
203
|
+
* @returns A 3D bounding box containing the table entity
|
|
130
204
|
* @inheritdoc
|
|
131
205
|
*/
|
|
132
206
|
get geometricExtents(): AcGeBox3d;
|
|
133
207
|
/**
|
|
208
|
+
* Renders the table entity using the specified graphics renderer.
|
|
209
|
+
*
|
|
210
|
+
* This method draws the table structure including borders, cell content, and text.
|
|
211
|
+
* It handles the rendering of individual cells, merged cells, and applies the
|
|
212
|
+
* appropriate transformations and styling.
|
|
213
|
+
*
|
|
214
|
+
* @param renderer - The graphics renderer used to draw the table
|
|
215
|
+
* @returns The rendered graphics entity representing the table
|
|
134
216
|
* @inheritdoc
|
|
135
217
|
*/
|
|
136
218
|
draw(renderer: AcGiRenderer): AcGiEntity;
|
|
219
|
+
/**
|
|
220
|
+
* Marks cells as visited to handle merged cell rendering.
|
|
221
|
+
*
|
|
222
|
+
* This method prevents duplicate rendering of merged cells by marking all
|
|
223
|
+
* constituent cells as visited.
|
|
224
|
+
*
|
|
225
|
+
* @param visited - Array tracking which cells have been processed
|
|
226
|
+
* @param currentIndex - Index of the current cell being processed
|
|
227
|
+
* @param columnCount - Total number of columns in the table
|
|
228
|
+
* @param columnSpan - Number of columns this cell spans
|
|
229
|
+
* @param rowSpan - Number of rows this cell spans
|
|
230
|
+
* @private
|
|
231
|
+
*/
|
|
137
232
|
private fillVisited;
|
|
233
|
+
/**
|
|
234
|
+
* Gets the text style for a specific cell.
|
|
235
|
+
*
|
|
236
|
+
* This method retrieves the appropriate text style for the cell, falling back
|
|
237
|
+
* to the standard style if no specific style is specified.
|
|
238
|
+
*
|
|
239
|
+
* @param cell - The cell for which to get the text style
|
|
240
|
+
* @returns The text style configuration for the cell
|
|
241
|
+
* @private
|
|
242
|
+
*/
|
|
138
243
|
private getTextStyle;
|
|
244
|
+
/**
|
|
245
|
+
* Calculates the text offset within a table cell based on attachment point.
|
|
246
|
+
*
|
|
247
|
+
* This method determines the appropriate positioning offset for text within
|
|
248
|
+
* a cell based on the specified attachment point and cell dimensions.
|
|
249
|
+
*
|
|
250
|
+
* @param textAlign - The text alignment/attachment point value
|
|
251
|
+
* @param width - The width of the cell
|
|
252
|
+
* @param height - The height of the cell
|
|
253
|
+
* @returns A vector representing the text offset from the cell corner
|
|
254
|
+
* @private
|
|
255
|
+
*/
|
|
139
256
|
private getTableTextOffset;
|
|
140
257
|
}
|
|
141
258
|
//# sourceMappingURL=AcDbTable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcDbTable.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIV,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAEL,UAAU,EACV,wBAAwB,EAExB,YAAY,EAEb,MAAM,8BAA8B,CAAA;AAGrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,wBAAwB,C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,WAAW;IAkBnB;;;;;;;;;OASG;IACH,OAAO,CAAC,YAAY;IAapB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,kBAAkB;CAwC3B"}
|
package/lib/entity/AcDbTable.js
CHANGED
|
@@ -29,16 +29,29 @@ import { AcGiMTextAttachmentPoint } from '@mlightcad/graphic-interface';
|
|
|
29
29
|
import { AcDbBlockReference } from './AcDbBlockReference';
|
|
30
30
|
var tempVector = /*@__PURE__*/ new AcGeVector3d();
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* array of cells whose contents consist of annotation objects, primarily text. Tables often contain a title
|
|
34
|
-
* row, a header row, and multiple data rows.
|
|
32
|
+
* Represents a table entity in AutoCAD.
|
|
35
33
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* A table is generally thought of as an n x m rectangular array of cells whose contents
|
|
35
|
+
* consist of annotation objects, primarily text. Tables often contain a title row, a
|
|
36
|
+
* header row, and multiple data rows.
|
|
37
|
+
*
|
|
38
|
+
* After creating a new table object using the constructor, applications usually need to
|
|
39
|
+
* set the table style, number of rows and columns, column width, row height, insert
|
|
40
|
+
* position, width direction, and normal vector. Applications can also enter text or
|
|
41
|
+
* block contents into each cell using methods of this class.
|
|
42
|
+
*
|
|
43
|
+
* Tables are commonly used for bills of materials, schedules, data sheets, and other
|
|
44
|
+
* tabular information in technical drawings and documentation.
|
|
39
45
|
*/
|
|
40
46
|
var AcDbTable = /** @class */ (function (_super) {
|
|
41
47
|
__extends(AcDbTable, _super);
|
|
48
|
+
/**
|
|
49
|
+
* Creates a new table entity.
|
|
50
|
+
*
|
|
51
|
+
* @param name - The name of the table block reference
|
|
52
|
+
* @param numRows - The number of rows in the table
|
|
53
|
+
* @param numColumns - The number of columns in the table
|
|
54
|
+
*/
|
|
42
55
|
function AcDbTable(name, numRows, numColumns) {
|
|
43
56
|
var _this = _super.call(this, name) || this;
|
|
44
57
|
_this._attachmentPoint = AcGiMTextAttachmentPoint.TopLeft;
|
|
@@ -51,7 +64,12 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
51
64
|
}
|
|
52
65
|
Object.defineProperty(AcDbTable.prototype, "attachmentPoint", {
|
|
53
66
|
/**
|
|
54
|
-
*
|
|
67
|
+
* Gets or sets the cell alignment value for this table.
|
|
68
|
+
*
|
|
69
|
+
* This property controls how text is positioned within table cells by default.
|
|
70
|
+
* Individual cells can override this setting with their own attachment point.
|
|
71
|
+
*
|
|
72
|
+
* @returns The default attachment point for table cells
|
|
55
73
|
*/
|
|
56
74
|
get: function () {
|
|
57
75
|
return this._attachmentPoint;
|
|
@@ -64,7 +82,11 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
64
82
|
});
|
|
65
83
|
Object.defineProperty(AcDbTable.prototype, "numRows", {
|
|
66
84
|
/**
|
|
67
|
-
*
|
|
85
|
+
* Gets or sets the number of rows in the table.
|
|
86
|
+
*
|
|
87
|
+
* Changing this value will resize the table and may affect existing cell data.
|
|
88
|
+
*
|
|
89
|
+
* @returns The current number of rows in the table
|
|
68
90
|
*/
|
|
69
91
|
get: function () {
|
|
70
92
|
return this._numRows;
|
|
@@ -77,7 +99,11 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
77
99
|
});
|
|
78
100
|
Object.defineProperty(AcDbTable.prototype, "numColumns", {
|
|
79
101
|
/**
|
|
80
|
-
*
|
|
102
|
+
* Gets or sets the number of columns in the table.
|
|
103
|
+
*
|
|
104
|
+
* Changing this value will resize the table and may affect existing cell data.
|
|
105
|
+
*
|
|
106
|
+
* @returns The current number of columns in the table
|
|
81
107
|
*/
|
|
82
108
|
get: function () {
|
|
83
109
|
return this._numColumns;
|
|
@@ -89,10 +115,11 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
89
115
|
configurable: true
|
|
90
116
|
});
|
|
91
117
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* @param
|
|
95
|
-
* @
|
|
118
|
+
* Gets the number of contents in the specified cell.
|
|
119
|
+
*
|
|
120
|
+
* @param row - Row index. Must be greater than or equal to 0 and less than the number of rows
|
|
121
|
+
* @param col - Column index. Must be greater than or equal to 0 and less than the number of columns
|
|
122
|
+
* @returns The number of contents in the specified cell
|
|
96
123
|
*/
|
|
97
124
|
// @ts-expect-error not use '_' prefix so that typedoc can the correct parameter to generate doc
|
|
98
125
|
AcDbTable.prototype.numContents = function (row, col) {
|
|
@@ -100,53 +127,62 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
100
127
|
return 1;
|
|
101
128
|
};
|
|
102
129
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* @
|
|
130
|
+
* Gets the row height of the specified row in the table.
|
|
131
|
+
*
|
|
132
|
+
* @param index - Zero-based row index
|
|
133
|
+
* @returns The row height of the specified row in the table
|
|
106
134
|
*/
|
|
107
135
|
AcDbTable.prototype.rowHeight = function (index) {
|
|
108
136
|
return this._rowHeight[index];
|
|
109
137
|
};
|
|
110
138
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* @param
|
|
139
|
+
* Sets the row height for the specified row index in the table.
|
|
140
|
+
*
|
|
141
|
+
* @param index - Zero-based row index
|
|
142
|
+
* @param height - Height to be used for the specified row
|
|
114
143
|
*/
|
|
115
144
|
AcDbTable.prototype.setRowHeight = function (index, height) {
|
|
116
145
|
this._rowHeight[index] = height;
|
|
117
146
|
};
|
|
118
147
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
148
|
+
* Sets a uniform row height for all the rows in the table.
|
|
149
|
+
*
|
|
150
|
+
* @param height - Height to be used for all the rows in the table
|
|
121
151
|
*/
|
|
122
152
|
AcDbTable.prototype.setUniformRowHeight = function (height) {
|
|
123
153
|
this._rowHeight.fill(height);
|
|
124
154
|
};
|
|
125
155
|
/**
|
|
126
|
-
*
|
|
156
|
+
* Gets the column width at the specified column index in the table.
|
|
157
|
+
*
|
|
158
|
+
* @param index - Zero-based column index
|
|
159
|
+
* @returns The width of the specified column
|
|
127
160
|
*/
|
|
128
161
|
AcDbTable.prototype.columnWidth = function (index) {
|
|
129
162
|
return this._columnWidth[index];
|
|
130
163
|
};
|
|
131
164
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
165
|
+
* Sets a uniform column width for all the columns in the table.
|
|
166
|
+
*
|
|
167
|
+
* @param width - Uniform width to be used for all the columns in the table
|
|
134
168
|
*/
|
|
135
169
|
AcDbTable.prototype.setUniformColumnWidth = function (width) {
|
|
136
170
|
this._columnWidth.fill(width);
|
|
137
171
|
};
|
|
138
172
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* @param
|
|
173
|
+
* Sets the column width at the specified column index in the table.
|
|
174
|
+
*
|
|
175
|
+
* @param index - Zero-based column index
|
|
176
|
+
* @param width - Width to be used for the specified column
|
|
142
177
|
*/
|
|
143
178
|
AcDbTable.prototype.setColumnWidth = function (index, width) {
|
|
144
179
|
this._columnWidth[index] = width;
|
|
145
180
|
};
|
|
146
181
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* @
|
|
182
|
+
* Gets the cell at the specified index.
|
|
183
|
+
*
|
|
184
|
+
* @param index - Cell index (calculated as row * numColumns + column)
|
|
185
|
+
* @returns The specified cell by index, or undefined if index is out of range
|
|
150
186
|
*/
|
|
151
187
|
AcDbTable.prototype.cell = function (index) {
|
|
152
188
|
if (index < 0 || index >= this._cells.length)
|
|
@@ -154,42 +190,54 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
154
190
|
return this._cells[index];
|
|
155
191
|
};
|
|
156
192
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
193
|
+
* Sets the cell at the specified index.
|
|
194
|
+
*
|
|
195
|
+
* @param index - Cell index (calculated as row * numColumns + column)
|
|
196
|
+
* @param cell - The cell data to set
|
|
159
197
|
*/
|
|
160
198
|
AcDbTable.prototype.setCell = function (index, cell) {
|
|
161
199
|
this._cells[index] = cell;
|
|
162
200
|
};
|
|
163
201
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* @param
|
|
167
|
-
* @param
|
|
202
|
+
* Gets the text string in the specified cell.
|
|
203
|
+
*
|
|
204
|
+
* @param row - Integer specifying the zero-based row index for the cell
|
|
205
|
+
* @param col - Integer specifying the zero-based column index for the cell
|
|
206
|
+
* @param content - Content index. Should be greater than or equal to 0 and less than the number of contents
|
|
207
|
+
* @returns The text string in the specified cell
|
|
168
208
|
*/
|
|
169
209
|
// @ts-expect-error not use '_' prefix so that typedoc can the correct parameter to generate doc
|
|
170
210
|
AcDbTable.prototype.textString = function (row, col, content) {
|
|
171
211
|
return this._cells[row * col].text;
|
|
172
212
|
};
|
|
173
213
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* @param
|
|
177
|
-
* @param
|
|
214
|
+
* Sets the text for the first content at the specified content index.
|
|
215
|
+
*
|
|
216
|
+
* @param row - Integer specifying the zero-based row index for the cell
|
|
217
|
+
* @param col - Integer specifying the zero-based column index for the cell
|
|
218
|
+
* @param text - Text string to set
|
|
178
219
|
*/
|
|
179
220
|
AcDbTable.prototype.setTextString = function (row, col, text) {
|
|
180
221
|
this._cells[row * col].text = text;
|
|
181
222
|
};
|
|
182
223
|
/**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
* @param
|
|
186
|
-
* @
|
|
224
|
+
* Checks if the content of the specified cell is empty.
|
|
225
|
+
*
|
|
226
|
+
* @param row - Integer specifying the zero-based row index for the cell
|
|
227
|
+
* @param col - Integer specifying the zero-based column index for the cell
|
|
228
|
+
* @returns True if the content of the specified cell is empty, false otherwise
|
|
187
229
|
*/
|
|
188
230
|
AcDbTable.prototype.isEmpty = function (row, col) {
|
|
189
231
|
return !this._cells[row * col].text;
|
|
190
232
|
};
|
|
191
233
|
Object.defineProperty(AcDbTable.prototype, "geometricExtents", {
|
|
192
234
|
/**
|
|
235
|
+
* Gets the geometric extents (bounding box) of this table entity.
|
|
236
|
+
*
|
|
237
|
+
* The geometric extents define the minimum bounding box that completely contains
|
|
238
|
+
* the table entity, including all its cells, borders, and content.
|
|
239
|
+
*
|
|
240
|
+
* @returns A 3D bounding box containing the table entity
|
|
193
241
|
* @inheritdoc
|
|
194
242
|
*/
|
|
195
243
|
get: function () {
|
|
@@ -200,6 +248,14 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
200
248
|
configurable: true
|
|
201
249
|
});
|
|
202
250
|
/**
|
|
251
|
+
* Renders the table entity using the specified graphics renderer.
|
|
252
|
+
*
|
|
253
|
+
* This method draws the table structure including borders, cell content, and text.
|
|
254
|
+
* It handles the rendering of individual cells, merged cells, and applies the
|
|
255
|
+
* appropriate transformations and styling.
|
|
256
|
+
*
|
|
257
|
+
* @param renderer - The graphics renderer used to draw the table
|
|
258
|
+
* @returns The rendered graphics entity representing the table
|
|
203
259
|
* @inheritdoc
|
|
204
260
|
*/
|
|
205
261
|
AcDbTable.prototype.draw = function (renderer) {
|
|
@@ -287,6 +343,19 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
287
343
|
group.applyMatrix(_tmpMatrix);
|
|
288
344
|
return group;
|
|
289
345
|
};
|
|
346
|
+
/**
|
|
347
|
+
* Marks cells as visited to handle merged cell rendering.
|
|
348
|
+
*
|
|
349
|
+
* This method prevents duplicate rendering of merged cells by marking all
|
|
350
|
+
* constituent cells as visited.
|
|
351
|
+
*
|
|
352
|
+
* @param visited - Array tracking which cells have been processed
|
|
353
|
+
* @param currentIndex - Index of the current cell being processed
|
|
354
|
+
* @param columnCount - Total number of columns in the table
|
|
355
|
+
* @param columnSpan - Number of columns this cell spans
|
|
356
|
+
* @param rowSpan - Number of rows this cell spans
|
|
357
|
+
* @private
|
|
358
|
+
*/
|
|
290
359
|
AcDbTable.prototype.fillVisited = function (visited, currentIndex, columnCount, columnSpan, rowSpan) {
|
|
291
360
|
if (rowSpan == 1 && columnSpan == 1) {
|
|
292
361
|
visited[currentIndex] = true;
|
|
@@ -299,6 +368,16 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
299
368
|
}
|
|
300
369
|
}
|
|
301
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* Gets the text style for a specific cell.
|
|
373
|
+
*
|
|
374
|
+
* This method retrieves the appropriate text style for the cell, falling back
|
|
375
|
+
* to the standard style if no specific style is specified.
|
|
376
|
+
*
|
|
377
|
+
* @param cell - The cell for which to get the text style
|
|
378
|
+
* @returns The text style configuration for the cell
|
|
379
|
+
* @private
|
|
380
|
+
*/
|
|
302
381
|
AcDbTable.prototype.getTextStyle = function (cell) {
|
|
303
382
|
var textStyleTable = this.database.tables.textStyleTable;
|
|
304
383
|
var style;
|
|
@@ -311,6 +390,18 @@ var AcDbTable = /** @class */ (function (_super) {
|
|
|
311
390
|
}
|
|
312
391
|
return style.textStyle;
|
|
313
392
|
};
|
|
393
|
+
/**
|
|
394
|
+
* Calculates the text offset within a table cell based on attachment point.
|
|
395
|
+
*
|
|
396
|
+
* This method determines the appropriate positioning offset for text within
|
|
397
|
+
* a cell based on the specified attachment point and cell dimensions.
|
|
398
|
+
*
|
|
399
|
+
* @param textAlign - The text alignment/attachment point value
|
|
400
|
+
* @param width - The width of the cell
|
|
401
|
+
* @param height - The height of the cell
|
|
402
|
+
* @returns A vector representing the text offset from the cell corner
|
|
403
|
+
* @private
|
|
404
|
+
*/
|
|
314
405
|
AcDbTable.prototype.getTableTextOffset = function (textAlign, width, height) {
|
|
315
406
|
var offset = new AcGeVector3d();
|
|
316
407
|
switch (textAlign) {
|