@mlightcad/data-model 1.9.14 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/dist/data-model.cjs +7 -7
  2. package/lib/base/AcDbObject.d.ts +1 -1
  3. package/lib/base/AcDbObject.d.ts.map +1 -1
  4. package/lib/base/AcDbObject.js +2 -3
  5. package/lib/base/AcDbObject.js.map +1 -1
  6. package/lib/converter/AcDbFontNameCollector.d.ts.map +1 -1
  7. package/lib/converter/AcDbFontNameCollector.js.map +1 -1
  8. package/lib/database/AcDbAbstractViewTableRecord.d.ts +16 -9
  9. package/lib/database/AcDbAbstractViewTableRecord.d.ts.map +1 -1
  10. package/lib/database/AcDbAbstractViewTableRecord.js +62 -57
  11. package/lib/database/AcDbAbstractViewTableRecord.js.map +1 -1
  12. package/lib/database/AcDbBlockTable.d.ts.map +1 -1
  13. package/lib/database/AcDbBlockTable.js +7 -7
  14. package/lib/database/AcDbBlockTable.js.map +1 -1
  15. package/lib/database/AcDbBlockTableRecord.d.ts +24 -16
  16. package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -1
  17. package/lib/database/AcDbBlockTableRecord.js +29 -21
  18. package/lib/database/AcDbBlockTableRecord.js.map +1 -1
  19. package/lib/database/AcDbDatabase.d.ts +16 -27
  20. package/lib/database/AcDbDatabase.d.ts.map +1 -1
  21. package/lib/database/AcDbDatabase.js +65 -103
  22. package/lib/database/AcDbDatabase.js.map +1 -1
  23. package/lib/database/AcDbLayerTableRecord.d.ts +21 -0
  24. package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -1
  25. package/lib/database/AcDbLayerTableRecord.js +52 -23
  26. package/lib/database/AcDbLayerTableRecord.js.map +1 -1
  27. package/lib/database/AcDbLinetypeTableRecord.d.ts +30 -13
  28. package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -1
  29. package/lib/database/AcDbLinetypeTableRecord.js +39 -18
  30. package/lib/database/AcDbLinetypeTableRecord.js.map +1 -1
  31. package/lib/database/AcDbRegAppTableRecord.d.ts +12 -3
  32. package/lib/database/AcDbRegAppTableRecord.d.ts.map +1 -1
  33. package/lib/database/AcDbRegAppTableRecord.js +10 -4
  34. package/lib/database/AcDbRegAppTableRecord.js.map +1 -1
  35. package/lib/database/AcDbSymbolTable.d.ts +7 -3
  36. package/lib/database/AcDbSymbolTable.d.ts.map +1 -1
  37. package/lib/database/AcDbSymbolTable.js +8 -4
  38. package/lib/database/AcDbSymbolTable.js.map +1 -1
  39. package/lib/database/AcDbSymbolTableRecord.d.ts +16 -0
  40. package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -1
  41. package/lib/database/AcDbSymbolTableRecord.js +39 -0
  42. package/lib/database/AcDbSymbolTableRecord.js.map +1 -1
  43. package/lib/database/AcDbSysVarManager.d.ts.map +1 -1
  44. package/lib/database/AcDbSysVarManager.js +8 -7
  45. package/lib/database/AcDbSysVarManager.js.map +1 -1
  46. package/lib/database/AcDbTextStyleTable.d.ts +3 -3
  47. package/lib/database/AcDbTextStyleTable.d.ts.map +1 -1
  48. package/lib/database/AcDbTextStyleTable.js +3 -3
  49. package/lib/database/AcDbTextStyleTable.js.map +1 -1
  50. package/lib/database/AcDbTextStyleTableRecord.d.ts +36 -45
  51. package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -1
  52. package/lib/database/AcDbTextStyleTableRecord.js +75 -79
  53. package/lib/database/AcDbTextStyleTableRecord.js.map +1 -1
  54. package/lib/database/AcDbViewTableRecord.d.ts +28 -25
  55. package/lib/database/AcDbViewTableRecord.d.ts.map +1 -1
  56. package/lib/database/AcDbViewTableRecord.js +35 -29
  57. package/lib/database/AcDbViewTableRecord.js.map +1 -1
  58. package/lib/database/AcDbViewportTable.d.ts.map +1 -1
  59. package/lib/database/AcDbViewportTable.js +3 -2
  60. package/lib/database/AcDbViewportTable.js.map +1 -1
  61. package/lib/database/AcDbViewportTableRecord.d.ts +32 -29
  62. package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -1
  63. package/lib/database/AcDbViewportTableRecord.js +42 -41
  64. package/lib/database/AcDbViewportTableRecord.js.map +1 -1
  65. package/lib/database/index.d.ts +7 -1
  66. package/lib/database/index.d.ts.map +1 -1
  67. package/lib/database/index.js.map +1 -1
  68. package/lib/database/transaction/AcDbChangeApplier.d.ts +19 -1
  69. package/lib/database/transaction/AcDbChangeApplier.d.ts.map +1 -1
  70. package/lib/database/transaction/AcDbChangeApplier.js +80 -0
  71. package/lib/database/transaction/AcDbChangeApplier.js.map +1 -1
  72. package/lib/database/transaction/AcDbChangeRecorder.d.ts +10 -0
  73. package/lib/database/transaction/AcDbChangeRecorder.d.ts.map +1 -1
  74. package/lib/database/transaction/AcDbChangeRecorder.js +12 -0
  75. package/lib/database/transaction/AcDbChangeRecorder.js.map +1 -1
  76. package/lib/database/transaction/AcDbDatabaseTransactionManager.d.ts +33 -0
  77. package/lib/database/transaction/AcDbDatabaseTransactionManager.d.ts.map +1 -1
  78. package/lib/database/transaction/AcDbDatabaseTransactionManager.js +207 -52
  79. package/lib/database/transaction/AcDbDatabaseTransactionManager.js.map +1 -1
  80. package/lib/database/transaction/AcDbTransaction.d.ts.map +1 -1
  81. package/lib/database/transaction/AcDbTransaction.js +6 -0
  82. package/lib/database/transaction/AcDbTransaction.js.map +1 -1
  83. package/lib/database/transaction/index.d.ts.map +1 -1
  84. package/lib/database/transaction/index.js.map +1 -1
  85. package/lib/entity/AcDbEllipse.d.ts +7 -7
  86. package/lib/entity/AcDbEllipse.d.ts.map +1 -1
  87. package/lib/entity/AcDbEllipse.js +15 -10
  88. package/lib/entity/AcDbEllipse.js.map +1 -1
  89. package/lib/entity/AcDbEntity.d.ts +0 -11
  90. package/lib/entity/AcDbEntity.d.ts.map +1 -1
  91. package/lib/entity/AcDbEntity.js +0 -16
  92. package/lib/entity/AcDbEntity.js.map +1 -1
  93. package/lib/entity/AcDbGripHelpers.d.ts.map +1 -1
  94. package/lib/entity/AcDbGripHelpers.js.map +1 -1
  95. package/lib/entity/AcDbHatch.d.ts.map +1 -1
  96. package/lib/entity/AcDbHatch.js.map +1 -1
  97. package/lib/entity/AcDbMLeader.d.ts.map +1 -1
  98. package/lib/entity/AcDbMLeader.js.map +1 -1
  99. package/lib/entity/AcDbMLine.d.ts +6 -0
  100. package/lib/entity/AcDbMLine.d.ts.map +1 -1
  101. package/lib/entity/AcDbMLine.js +42 -12
  102. package/lib/entity/AcDbMLine.js.map +1 -1
  103. package/lib/entity/AcDbPolyline.js +210 -19
  104. package/lib/entity/AcDbPolyline.js.map +1 -1
  105. package/lib/entity/AcDbShape.d.ts.map +1 -1
  106. package/lib/entity/AcDbShape.js +4 -3
  107. package/lib/entity/AcDbShape.js.map +1 -1
  108. package/lib/entity/AcDbSpline.d.ts.map +1 -1
  109. package/lib/entity/AcDbSpline.js.map +1 -1
  110. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -1
  111. package/lib/entity/dimension/AcDb3PointAngularDimension.js +1 -6
  112. package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -1
  113. package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -1
  114. package/lib/entity/dimension/AcDbArcDimension.js +1 -6
  115. package/lib/entity/dimension/AcDbArcDimension.js.map +1 -1
  116. package/lib/entity/dimension/AcDbDimension.d.ts +5 -5
  117. package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -1
  118. package/lib/entity/dimension/AcDbDimension.js +7 -7
  119. package/lib/entity/dimension/AcDbDimension.js.map +1 -1
  120. package/lib/index.d.ts +1 -1
  121. package/lib/index.d.ts.map +1 -1
  122. package/lib/index.js.map +1 -1
  123. package/lib/object/AcDbDictionary.d.ts.map +1 -1
  124. package/lib/object/AcDbDictionary.js +1 -3
  125. package/lib/object/AcDbDictionary.js.map +1 -1
  126. package/package.json +4 -4
@@ -1,6 +1,14 @@
1
1
  import { AcGiTextStyle } from '@mlightcad/graphic-interface';
2
2
  import { AcDbDxfFiler } from '../base/AcDbDxfFiler';
3
- import { AcDbSymbolTableRecord } from './AcDbSymbolTableRecord';
3
+ import { AcDbSymbolTableRecord, AcDbSymbolTableRecordAttrs } from './AcDbSymbolTableRecord';
4
+ /**
5
+ * Interface defining the attributes for text style table records.
6
+ *
7
+ * Merges {@link AcDbSymbolTableRecordAttrs} with {@link AcGiTextStyle} fields
8
+ * (excluding the duplicate `name` property).
9
+ */
10
+ export interface AcDbTextStyleTableRecordAttrs extends AcDbSymbolTableRecordAttrs, Omit<AcGiTextStyle, 'name'> {
11
+ }
4
12
  /**
5
13
  * Represents a record in the text style table.
6
14
  *
@@ -10,41 +18,42 @@ import { AcDbSymbolTableRecord } from './AcDbSymbolTableRecord';
10
18
  *
11
19
  * @example
12
20
  * ```typescript
13
- * const textStyle = new AcGiBaseTextStyle();
14
- * textStyle.name = 'MyStyle';
15
- * textStyle.font = 'Arial';
16
- * const record = new AcDbTextStyleTableRecord(textStyle);
21
+ * const record = new AcDbTextStyleTableRecord({
22
+ * name: 'MyStyle',
23
+ * font: 'Arial'
24
+ * });
17
25
  * ```
18
26
  */
19
- export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
20
- /** The text style configuration */
21
- private _textStyle;
27
+ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord<AcDbTextStyleTableRecordAttrs> {
22
28
  /**
23
29
  * Creates a new AcDbTextStyleTableRecord instance.
24
30
  *
25
- * @param textStyle - The text style configuration to use
31
+ * Property `font` may be empty. When it contains a file extension, the extension is removed
32
+ * during construction.
33
+ *
34
+ * @param attrs - Input attribute values for this text style table record
35
+ * @param defaultAttrs - Default values for attributes of this text style table record
26
36
  *
27
37
  * @example
28
38
  * ```typescript
29
- * const textStyle = new AcGiBaseTextStyle();
30
- * textStyle.name = 'MyStyle';
31
- * const record = new AcDbTextStyleTableRecord(textStyle);
39
+ * const record = new AcDbTextStyleTableRecord({
40
+ * name: 'MyStyle',
41
+ * font: 'Arial'
42
+ * });
32
43
  * ```
33
44
  */
34
- constructor(textStyle: AcGiTextStyle);
45
+ constructor(attrs?: Partial<AcDbTextStyleTableRecordAttrs>, defaultAttrs?: Partial<AcDbTextStyleTableRecordAttrs>);
35
46
  /**
36
47
  * Gets or sets the obliquing angle.
37
48
  *
38
49
  * The obliquing angle is the angle from the text's vertical; that is, the
39
- * top of the text "slants" relative to the bottom--the same as the slope in this italic text.
40
- * Positive angles slant characters forward at their tops. Negative angles have 2pi added to them
41
- * to convert them to their positive equivalent.
50
+ * top of the text "slants" relative to the bottom. Positive angles slant
51
+ * characters forward at their tops.
42
52
  *
43
53
  * @returns The obliquing angle in radians
44
54
  *
45
55
  * @example
46
56
  * ```typescript
47
- * const angle = record.obliquingAngle;
48
57
  * record.obliquingAngle = Math.PI / 6; // 30 degrees
49
58
  * ```
50
59
  */
@@ -54,18 +63,13 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
54
63
  * Gets or sets the text height used for the last text created using this text style.
55
64
  *
56
65
  * This value is updated automatically by AutoCAD after the creation of any text object
57
- * that references this text style table record. If the textSize value for this text style
58
- * is 0, then the priorSize value is used by AutoCAD as the default text height for the
59
- * next text created using this text style.
60
- *
61
- * This value is automatically changed by the use of the text command. It will only be
62
- * automatically changed if the textSize is set to 0 so that users are prompted for a height.
66
+ * that references this text style table record. If {@link textSize} is 0, then priorSize
67
+ * is used as the default text height for the next text created using this text style.
63
68
  *
64
69
  * @returns The prior text size
65
70
  *
66
71
  * @example
67
72
  * ```typescript
68
- * const priorSize = record.priorSize;
69
73
  * record.priorSize = 12.0;
70
74
  * ```
71
75
  */
@@ -74,15 +78,13 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
74
78
  /**
75
79
  * Gets or sets the default size of the text drawn with this text style.
76
80
  *
77
- * If the text size is set to 0, then each use of the AutoCAD text commands prompt
78
- * for a text height to use in creating the text entity. If textSize is non-zero,
79
- * the text command will not prompt for a text height and will use this value.
81
+ * If the text size is set to 0, AutoCAD prompts for a text height when creating text.
82
+ * If textSize is non-zero, that fixed height is used instead.
80
83
  *
81
84
  * @returns The default text size
82
85
  *
83
86
  * @example
84
87
  * ```typescript
85
- * const textSize = record.textSize;
86
88
  * record.textSize = 10.0; // Fixed text height
87
89
  * ```
88
90
  */
@@ -91,15 +93,13 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
91
93
  /**
92
94
  * Gets or sets the width factor (also referred to as the relative X-scale factor) for the text style.
93
95
  *
94
- * The width factor is applied to the text's width to allow the width to be adjusted
95
- * independently of the height. For example, if the width factor value is 0.8, then the text is
96
- * drawn with a width that is 80% of its normal "unadjusted" width.
96
+ * The width factor is applied to the text's width independently of the height. For example,
97
+ * a value of 0.8 draws text at 80% of its normal width.
97
98
  *
98
99
  * @returns The width factor
99
100
  *
100
101
  * @example
101
102
  * ```typescript
102
- * const xScale = record.xScale;
103
103
  * record.xScale = 0.8; // 80% width
104
104
  * ```
105
105
  */
@@ -114,9 +114,6 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
114
114
  *
115
115
  * @example
116
116
  * ```typescript
117
- * if (record.isVertical) {
118
- * console.log('Text style is vertical');
119
- * }
120
117
  * record.isVertical = true;
121
118
  * ```
122
119
  */
@@ -135,7 +132,6 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
135
132
  * if (record.isShapeFile) {
136
133
  * console.log('Shape file definition:', record.fileName);
137
134
  * }
138
- * record.isShapeFile = true;
139
135
  * ```
140
136
  */
141
137
  get isShapeFile(): boolean;
@@ -147,7 +143,6 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
147
143
  *
148
144
  * @example
149
145
  * ```typescript
150
- * const fileName = record.fileName;
151
146
  * record.fileName = 'Arial';
152
147
  * ```
153
148
  */
@@ -163,7 +158,6 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
163
158
  *
164
159
  * @example
165
160
  * ```typescript
166
- * const bigFontFileName = record.bigFontFileName;
167
161
  * record.bigFontFileName = 'bigfont.shx';
168
162
  * ```
169
163
  */
@@ -172,7 +166,10 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
172
166
  /**
173
167
  * Gets the text style information used by the renderer.
174
168
  *
175
- * @returns The text style configuration
169
+ * Returns a snapshot assembled from stored attributes. Mutating the returned object
170
+ * does not update this table record; use the dedicated setters instead.
171
+ *
172
+ * @returns The text style configuration assembled from stored attributes
176
173
  *
177
174
  * @example
178
175
  * ```typescript
@@ -186,12 +183,6 @@ export declare class AcDbTextStyleTableRecord extends AcDbSymbolTableRecord {
186
183
  *
187
184
  * @param pathName - The file path or name
188
185
  * @returns The file name without extension
189
- *
190
- * @example
191
- * ```typescript
192
- * const fileName = this.getFileNameWithoutExtension('arial.ttf');
193
- * // Returns: 'arial'
194
- * ```
195
186
  */
196
187
  private getFileNameWithoutExtension;
197
188
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbTextStyleTableRecord.d.ts","sourceRoot":"","sources":["../../src/database/AcDbTextStyleTableRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D;;;;;;;;;;;;;;GAcG;AACH,qBAAa,wBAAyB,SAAQ,qBAAqB;IACjE,mCAAmC;IACnC,OAAO,CAAC,UAAU,CAAe;IAEjC;;;;;;;;;;;OAWG;gBACS,SAAS,EAAE,aAAa;IAWpC;;;;;;;;;;;;;;;OAeG;IACH,IAAI,cAAc,IAGQ,MAAM,CAD/B;IACD,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,EAE/B;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,SAAS,IAGQ,MAAM,CAD1B;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAE1B;IAED;;;;;;;;;;;;;;OAc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this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { defaults } from '@mlightcad/common';
16
17
  import { AcDbSymbolTableRecord } from './AcDbSymbolTableRecord';
17
18
  /**
18
19
  * Represents a record in the text style table.
@@ -23,10 +24,10 @@ import { AcDbSymbolTableRecord } from './AcDbSymbolTableRecord';
23
24
  *
24
25
  * @example
25
26
  * ```typescript
26
- * const textStyle = new AcGiBaseTextStyle();
27
- * textStyle.name = 'MyStyle';
28
- * textStyle.font = 'Arial';
29
- * const record = new AcDbTextStyleTableRecord(textStyle);
27
+ * const record = new AcDbTextStyleTableRecord({
28
+ * name: 'MyStyle',
29
+ * font: 'Arial'
30
+ * });
30
31
  * ```
31
32
  */
32
33
  var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
@@ -34,22 +35,37 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
34
35
  /**
35
36
  * Creates a new AcDbTextStyleTableRecord instance.
36
37
  *
37
- * @param textStyle - The text style configuration to use
38
+ * Property `font` may be empty. When it contains a file extension, the extension is removed
39
+ * during construction.
40
+ *
41
+ * @param attrs - Input attribute values for this text style table record
42
+ * @param defaultAttrs - Default values for attributes of this text style table record
38
43
  *
39
44
  * @example
40
45
  * ```typescript
41
- * const textStyle = new AcGiBaseTextStyle();
42
- * textStyle.name = 'MyStyle';
43
- * const record = new AcDbTextStyleTableRecord(textStyle);
46
+ * const record = new AcDbTextStyleTableRecord({
47
+ * name: 'MyStyle',
48
+ * font: 'Arial'
49
+ * });
44
50
  * ```
45
51
  */
46
- function AcDbTextStyleTableRecord(textStyle) {
47
- var _this = _super.call(this) || this;
48
- _this.name = textStyle.name;
49
- _this._textStyle = textStyle;
50
- // Property `font` in text style may be empty string
51
- // If it contans file extension, just remove file extension.
52
- _this._textStyle.font = _this.getFileNameWithoutExtension(_this._textStyle.font || _this._textStyle.extendedFont || _this.name);
52
+ function AcDbTextStyleTableRecord(attrs, defaultAttrs) {
53
+ var _this = this;
54
+ attrs = attrs || {};
55
+ defaults(attrs, {
56
+ standardFlag: 0,
57
+ fixedTextHeight: 0,
58
+ widthFactor: 1,
59
+ obliqueAngle: 0,
60
+ textGenerationFlag: 0,
61
+ lastHeight: 0,
62
+ font: '',
63
+ bigFont: ''
64
+ });
65
+ _this = _super.call(this, attrs, defaultAttrs) || this;
66
+ _this.setAttr('font', _this.getFileNameWithoutExtension(_this.getAttr('font') ||
67
+ _this.getAttrWithoutException('extendedFont') ||
68
+ _this.name));
53
69
  return _this;
54
70
  }
55
71
  Object.defineProperty(AcDbTextStyleTableRecord.prototype, "obliquingAngle", {
@@ -57,23 +73,21 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
57
73
  * Gets or sets the obliquing angle.
58
74
  *
59
75
  * The obliquing angle is the angle from the text's vertical; that is, the
60
- * top of the text "slants" relative to the bottom--the same as the slope in this italic text.
61
- * Positive angles slant characters forward at their tops. Negative angles have 2pi added to them
62
- * to convert them to their positive equivalent.
76
+ * top of the text "slants" relative to the bottom. Positive angles slant
77
+ * characters forward at their tops.
63
78
  *
64
79
  * @returns The obliquing angle in radians
65
80
  *
66
81
  * @example
67
82
  * ```typescript
68
- * const angle = record.obliquingAngle;
69
83
  * record.obliquingAngle = Math.PI / 6; // 30 degrees
70
84
  * ```
71
85
  */
72
86
  get: function () {
73
- return this._textStyle.obliqueAngle;
87
+ return this.getAttr('obliqueAngle');
74
88
  },
75
89
  set: function (value) {
76
- this._textStyle.obliqueAngle = value;
90
+ this.setAttr('obliqueAngle', value);
77
91
  },
78
92
  enumerable: false,
79
93
  configurable: true
@@ -83,26 +97,21 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
83
97
  * Gets or sets the text height used for the last text created using this text style.
84
98
  *
85
99
  * This value is updated automatically by AutoCAD after the creation of any text object
86
- * that references this text style table record. If the textSize value for this text style
87
- * is 0, then the priorSize value is used by AutoCAD as the default text height for the
88
- * next text created using this text style.
89
- *
90
- * This value is automatically changed by the use of the text command. It will only be
91
- * automatically changed if the textSize is set to 0 so that users are prompted for a height.
100
+ * that references this text style table record. If {@link textSize} is 0, then priorSize
101
+ * is used as the default text height for the next text created using this text style.
92
102
  *
93
103
  * @returns The prior text size
94
104
  *
95
105
  * @example
96
106
  * ```typescript
97
- * const priorSize = record.priorSize;
98
107
  * record.priorSize = 12.0;
99
108
  * ```
100
109
  */
101
110
  get: function () {
102
- return this._textStyle.lastHeight;
111
+ return this.getAttr('lastHeight');
103
112
  },
104
113
  set: function (value) {
105
- this._textStyle.lastHeight = value;
114
+ this.setAttr('lastHeight', value);
106
115
  },
107
116
  enumerable: false,
108
117
  configurable: true
@@ -111,23 +120,21 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
111
120
  /**
112
121
  * Gets or sets the default size of the text drawn with this text style.
113
122
  *
114
- * If the text size is set to 0, then each use of the AutoCAD text commands prompt
115
- * for a text height to use in creating the text entity. If textSize is non-zero,
116
- * the text command will not prompt for a text height and will use this value.
123
+ * If the text size is set to 0, AutoCAD prompts for a text height when creating text.
124
+ * If textSize is non-zero, that fixed height is used instead.
117
125
  *
118
126
  * @returns The default text size
119
127
  *
120
128
  * @example
121
129
  * ```typescript
122
- * const textSize = record.textSize;
123
130
  * record.textSize = 10.0; // Fixed text height
124
131
  * ```
125
132
  */
126
133
  get: function () {
127
- return this._textStyle.fixedTextHeight;
134
+ return this.getAttr('fixedTextHeight');
128
135
  },
129
136
  set: function (value) {
130
- this._textStyle.fixedTextHeight = value;
137
+ this.setAttr('fixedTextHeight', value);
131
138
  },
132
139
  enumerable: false,
133
140
  configurable: true
@@ -136,23 +143,21 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
136
143
  /**
137
144
  * Gets or sets the width factor (also referred to as the relative X-scale factor) for the text style.
138
145
  *
139
- * The width factor is applied to the text's width to allow the width to be adjusted
140
- * independently of the height. For example, if the width factor value is 0.8, then the text is
141
- * drawn with a width that is 80% of its normal "unadjusted" width.
146
+ * The width factor is applied to the text's width independently of the height. For example,
147
+ * a value of 0.8 draws text at 80% of its normal width.
142
148
  *
143
149
  * @returns The width factor
144
150
  *
145
151
  * @example
146
152
  * ```typescript
147
- * const xScale = record.xScale;
148
153
  * record.xScale = 0.8; // 80% width
149
154
  * ```
150
155
  */
151
156
  get: function () {
152
- return this._textStyle.widthFactor;
157
+ return this.getAttr('widthFactor');
153
158
  },
154
159
  set: function (value) {
155
- this._textStyle.widthFactor = value;
160
+ this.setAttr('widthFactor', value);
156
161
  },
157
162
  enumerable: false,
158
163
  configurable: true
@@ -167,22 +172,15 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
167
172
  *
168
173
  * @example
169
174
  * ```typescript
170
- * if (record.isVertical) {
171
- * console.log('Text style is vertical');
172
- * }
173
175
  * record.isVertical = true;
174
176
  * ```
175
177
  */
176
178
  get: function () {
177
- return (this._textStyle.standardFlag & 4) === 4;
179
+ return (this.getAttr('standardFlag') & 4) === 4;
178
180
  },
179
181
  set: function (value) {
180
- if (value) {
181
- this._textStyle.standardFlag |= 4;
182
- }
183
- else {
184
- this._textStyle.standardFlag &= ~4;
185
- }
182
+ var standardFlag = this.getAttr('standardFlag');
183
+ this.setAttr('standardFlag', value ? standardFlag | 4 : standardFlag & ~4);
186
184
  },
187
185
  enumerable: false,
188
186
  configurable: true
@@ -201,19 +199,14 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
201
199
  * if (record.isShapeFile) {
202
200
  * console.log('Shape file definition:', record.fileName);
203
201
  * }
204
- * record.isShapeFile = true;
205
202
  * ```
206
203
  */
207
204
  get: function () {
208
- return (this._textStyle.standardFlag & 1) === 1;
205
+ return (this.getAttr('standardFlag') & 1) === 1;
209
206
  },
210
207
  set: function (value) {
211
- if (value) {
212
- this._textStyle.standardFlag |= 1;
213
- }
214
- else {
215
- this._textStyle.standardFlag &= ~1;
216
- }
208
+ var standardFlag = this.getAttr('standardFlag');
209
+ this.setAttr('standardFlag', value ? standardFlag | 1 : standardFlag & ~1);
217
210
  },
218
211
  enumerable: false,
219
212
  configurable: true
@@ -226,15 +219,14 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
226
219
  *
227
220
  * @example
228
221
  * ```typescript
229
- * const fileName = record.fileName;
230
222
  * record.fileName = 'Arial';
231
223
  * ```
232
224
  */
233
225
  get: function () {
234
- return this._textStyle.font;
226
+ return this.getAttr('font');
235
227
  },
236
228
  set: function (value) {
237
- this._textStyle.font = value;
229
+ this.setAttr('font', value);
238
230
  },
239
231
  enumerable: false,
240
232
  configurable: true
@@ -250,15 +242,14 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
250
242
  *
251
243
  * @example
252
244
  * ```typescript
253
- * const bigFontFileName = record.bigFontFileName;
254
245
  * record.bigFontFileName = 'bigfont.shx';
255
246
  * ```
256
247
  */
257
248
  get: function () {
258
- return this._textStyle.bigFont;
249
+ return this.getAttr('bigFont');
259
250
  },
260
251
  set: function (value) {
261
- this._textStyle.bigFont = value;
252
+ this.setAttr('bigFont', value);
262
253
  },
263
254
  enumerable: false,
264
255
  configurable: true
@@ -267,7 +258,10 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
267
258
  /**
268
259
  * Gets the text style information used by the renderer.
269
260
  *
270
- * @returns The text style configuration
261
+ * Returns a snapshot assembled from stored attributes. Mutating the returned object
262
+ * does not update this table record; use the dedicated setters instead.
263
+ *
264
+ * @returns The text style configuration assembled from stored attributes
271
265
  *
272
266
  * @example
273
267
  * ```typescript
@@ -276,7 +270,18 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
276
270
  * ```
277
271
  */
278
272
  get: function () {
279
- return this._textStyle;
273
+ return {
274
+ name: this.name,
275
+ standardFlag: this.getAttr('standardFlag'),
276
+ fixedTextHeight: this.getAttr('fixedTextHeight'),
277
+ widthFactor: this.getAttr('widthFactor'),
278
+ obliqueAngle: this.getAttr('obliqueAngle'),
279
+ textGenerationFlag: this.getAttr('textGenerationFlag'),
280
+ lastHeight: this.getAttr('lastHeight'),
281
+ font: this.getAttr('font'),
282
+ bigFont: this.getAttr('bigFont'),
283
+ extendedFont: this.getAttrWithoutException('extendedFont')
284
+ };
280
285
  },
281
286
  enumerable: false,
282
287
  configurable: true
@@ -286,23 +291,14 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
286
291
  *
287
292
  * @param pathName - The file path or name
288
293
  * @returns The file name without extension
289
- *
290
- * @example
291
- * ```typescript
292
- * const fileName = this.getFileNameWithoutExtension('arial.ttf');
293
- * // Returns: 'arial'
294
- * ```
295
294
  */
296
295
  AcDbTextStyleTableRecord.prototype.getFileNameWithoutExtension = function (pathName) {
297
296
  var fileName = pathName.split('/').pop();
298
297
  if (fileName) {
299
- // Find the last dot to separate the extension, if any
300
298
  var dotIndex = fileName.lastIndexOf('.');
301
- // If no dot is found, return the file name as is
302
299
  if (dotIndex === -1) {
303
300
  return fileName;
304
301
  }
305
- // Otherwise, return the part before the last dot (file name without extension)
306
302
  return fileName.substring(0, dotIndex);
307
303
  }
308
304
  return pathName;
@@ -317,11 +313,11 @@ var AcDbTextStyleTableRecord = /** @class */ (function (_super) {
317
313
  _super.prototype.dxfOutFields.call(this, filer);
318
314
  filer.writeSubclassMarker('AcDbTextStyleTableRecord');
319
315
  filer.writeString(2, this.name);
320
- filer.writeInt16(70, this.textStyle.standardFlag);
316
+ filer.writeInt16(70, this.getAttr('standardFlag'));
321
317
  filer.writeDouble(40, this.textSize);
322
318
  filer.writeDouble(41, this.xScale);
323
319
  filer.writeAngle(50, this.obliquingAngle);
324
- filer.writeInt16(71, this.textStyle.textGenerationFlag);
320
+ filer.writeInt16(71, this.getAttr('textGenerationFlag'));
325
321
  filer.writeDouble(42, this.priorSize);
326
322
  filer.writeString(3, this.fileName);
327
323
  filer.writeString(4, this.bigFontFileName);
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbTextStyleTableRecord.js","sourceRoot":"","sources":["../../src/database/AcDbTextStyleTableRecord.ts"],"names":[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K,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAA;QACxD,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACrC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IACH,+BAAC;AAAD,CAAC,AAlRD,CAA8C,qBAAqB,GAkRlE"}
@@ -1,5 +1,28 @@
1
1
  import { AcDbDxfFiler } from '../base/AcDbDxfFiler';
2
- import { AcDbAbstractViewTableRecord } from './AcDbAbstractViewTableRecord';
2
+ import { AcDbAbstractViewTableRecord, AcDbAbstractViewTableRecordAttrs } from './AcDbAbstractViewTableRecord';
3
+ /**
4
+ * Interface defining the attributes for view table records.
5
+ */
6
+ export interface AcDbViewTableRecordAttrs extends AcDbAbstractViewTableRecordAttrs {
7
+ /** Standard flags for the view record */
8
+ standardFlags: number;
9
+ /** View width in DCS */
10
+ viewWidth: number;
11
+ /** Whether a UCS is associated with this view */
12
+ ucsAssociated: boolean;
13
+ /** Whether the camera is plottable */
14
+ cameraPlottable: boolean;
15
+ /** UCS elevation when a UCS is associated */
16
+ ucsElevation: number;
17
+ /** Named UCS object ID (optional) */
18
+ ucsObjectId?: string;
19
+ /** Base UCS object ID (optional) */
20
+ ucsBaseObjectId?: string;
21
+ /** Background object ID for the view */
22
+ backgroundObjectId?: string;
23
+ /** Live section object ID for the view */
24
+ liveSectionObjectId?: string;
25
+ }
3
26
  /**
4
27
  * Represents a view table record in AutoCAD.
5
28
  *
@@ -14,34 +37,14 @@ import { AcDbAbstractViewTableRecord } from './AcDbAbstractViewTableRecord';
14
37
  * viewRecord.gsView.viewHeight = 1000;
15
38
  * ```
16
39
  */
17
- export declare class AcDbViewTableRecord extends AcDbAbstractViewTableRecord {
18
- /** Standard flags for the view record */
19
- private _standardFlags;
20
- /** View width in DCS */
21
- private _viewWidth;
22
- /** Whether a UCS is associated with this view */
23
- private _ucsAssociated;
24
- /** Whether the camera is plottable */
25
- private _cameraPlottable;
26
- /** UCS elevation when a UCS is associated */
27
- private _ucsElevation;
28
- /** Named UCS object ID (optional) */
29
- private _ucsObjectId?;
30
- /** Base UCS object ID (optional) */
31
- private _ucsBaseObjectId?;
32
- /** Background object ID for the view */
33
- private _backgroundObjectId?;
34
- /** Live section object ID for the view */
35
- private _liveSectionObjectId?;
40
+ export declare class AcDbViewTableRecord extends AcDbAbstractViewTableRecord<AcDbViewTableRecordAttrs> {
36
41
  /**
37
42
  * Creates a new AcDbViewTableRecord instance.
38
43
  *
39
- * @example
40
- * ```typescript
41
- * const viewRecord = new AcDbViewTableRecord();
42
- * ```
44
+ * @param attrs - Input attribute values for this view table record
45
+ * @param defaultAttrs - Default values for attributes of this view table record
43
46
  */
44
- constructor();
47
+ constructor(attrs?: Partial<AcDbViewTableRecordAttrs>, defaultAttrs?: Partial<AcDbViewTableRecordAttrs>);
45
48
  /**
46
49
  * Gets or sets the standard flags for this view record.
47
50
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbViewTableRecord.d.ts","sourceRoot":"","sources":["../../src/database/AcDbViewTableRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAE3E;;;;;;;;;;;;;GAaG;AACH,qBAAa,mBAAoB,SAAQ,2BAA2B;IAClE,yCAAyC;IACzC,OAAO,CAAC,cAAc,CAAQ;IAC9B,wBAAwB;IACxB,OAAO,CAAC,UAAU,CAAQ;IAC1B,iDAAiD;IACjD,OAAO,CAAC,cAAc,CAAS;IAC/B,sCAAsC;IACtC,OAAO,CAAC,gBAAgB,CAAS;IACjC,6CAA6C;IAC7C,OAAO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