@mlightcad/data-model 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/dist/data-model.js +5490 -1022
  2. package/dist/data-model.umd.cjs +2 -2
  3. package/lib/base/AcDbHostApplicationServices.d.ts +72 -6
  4. package/lib/base/AcDbHostApplicationServices.d.ts.map +1 -1
  5. package/lib/base/AcDbHostApplicationServices.js +71 -7
  6. package/lib/base/AcDbHostApplicationServices.js.map +1 -1
  7. package/lib/base/AcDbObject.d.ts +160 -25
  8. package/lib/base/AcDbObject.d.ts.map +1 -1
  9. package/lib/base/AcDbObject.js +149 -25
  10. package/lib/base/AcDbObject.js.map +1 -1
  11. package/lib/converter/AcDbBatchProcessing.d.ts +112 -10
  12. package/lib/converter/AcDbBatchProcessing.d.ts.map +1 -1
  13. package/lib/converter/AcDbBatchProcessing.js +110 -11
  14. package/lib/converter/AcDbBatchProcessing.js.map +1 -1
  15. package/lib/converter/AcDbDxfConverter.d.ts +224 -6
  16. package/lib/converter/AcDbDxfConverter.d.ts.map +1 -1
  17. package/lib/converter/AcDbDxfConverter.js +224 -6
  18. package/lib/converter/AcDbDxfConverter.js.map +1 -1
  19. package/lib/converter/AcDbDxfParseWorker.d.ts +16 -0
  20. package/lib/converter/AcDbDxfParseWorker.d.ts.map +1 -1
  21. package/lib/converter/AcDbDxfParseWorker.js +16 -0
  22. package/lib/converter/AcDbDxfParseWorker.js.map +1 -1
  23. package/lib/converter/AcDbEntitiyConverter.d.ts +118 -3
  24. package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -1
  25. package/lib/converter/AcDbEntitiyConverter.js +118 -3
  26. package/lib/converter/AcDbEntitiyConverter.js.map +1 -1
  27. package/lib/converter/AcDbObjectConverter.d.ts +52 -0
  28. package/lib/converter/AcDbObjectConverter.d.ts.map +1 -1
  29. package/lib/converter/AcDbObjectConverter.js +52 -0
  30. package/lib/converter/AcDbObjectConverter.js.map +1 -1
  31. package/lib/database/AcDbBlockTable.d.ts +35 -3
  32. package/lib/database/AcDbBlockTable.d.ts.map +1 -1
  33. package/lib/database/AcDbBlockTable.js +35 -3
  34. package/lib/database/AcDbBlockTable.js.map +1 -1
  35. package/lib/database/AcDbBlockTableRecord.d.ts +98 -15
  36. package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -1
  37. package/lib/database/AcDbBlockTableRecord.js +96 -15
  38. package/lib/database/AcDbBlockTableRecord.js.map +1 -1
  39. package/lib/database/AcDbDatabase.d.ts +303 -33
  40. package/lib/database/AcDbDatabase.d.ts.map +1 -1
  41. package/lib/database/AcDbDatabase.js +223 -39
  42. package/lib/database/AcDbDatabase.js.map +1 -1
  43. package/lib/database/AcDbDatabaseConverter.d.ts +77 -12
  44. package/lib/database/AcDbDatabaseConverter.d.ts.map +1 -1
  45. package/lib/database/AcDbDatabaseConverter.js +46 -13
  46. package/lib/database/AcDbDatabaseConverter.js.map +1 -1
  47. package/lib/database/AcDbDatabaseConverterManager.d.ts +97 -15
  48. package/lib/database/AcDbDatabaseConverterManager.d.ts.map +1 -1
  49. package/lib/database/AcDbDatabaseConverterManager.js +90 -15
  50. package/lib/database/AcDbDatabaseConverterManager.js.map +1 -1
  51. package/lib/database/AcDbDimStyleTable.d.ts +22 -2
  52. package/lib/database/AcDbDimStyleTable.d.ts.map +1 -1
  53. package/lib/database/AcDbDimStyleTable.js +22 -2
  54. package/lib/database/AcDbDimStyleTable.js.map +1 -1
  55. package/lib/database/AcDbDimStyleTableRecord.d.ts +115 -0
  56. package/lib/database/AcDbDimStyleTableRecord.d.ts.map +1 -1
  57. package/lib/database/AcDbDimStyleTableRecord.js +44 -0
  58. package/lib/database/AcDbDimStyleTableRecord.js.map +1 -1
  59. package/lib/database/AcDbLayerTable.d.ts +39 -2
  60. package/lib/database/AcDbLayerTable.d.ts.map +1 -1
  61. package/lib/database/AcDbLayerTable.js +39 -2
  62. package/lib/database/AcDbLayerTable.js.map +1 -1
  63. package/lib/database/AcDbLayerTableRecord.d.ts +198 -18
  64. package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -1
  65. package/lib/database/AcDbLayerTableRecord.js +182 -19
  66. package/lib/database/AcDbLayerTableRecord.js.map +1 -1
  67. package/lib/database/AcDbLinetypeTable.d.ts +21 -2
  68. package/lib/database/AcDbLinetypeTable.d.ts.map +1 -1
  69. package/lib/database/AcDbLinetypeTable.js +21 -2
  70. package/lib/database/AcDbLinetypeTable.js.map +1 -1
  71. package/lib/database/AcDbLinetypeTableRecord.d.ts +46 -14
  72. package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -1
  73. package/lib/database/AcDbLinetypeTableRecord.js +46 -14
  74. package/lib/database/AcDbLinetypeTableRecord.js.map +1 -1
  75. package/lib/database/AcDbSymbolTable.d.ts +134 -29
  76. package/lib/database/AcDbSymbolTable.d.ts.map +1 -1
  77. package/lib/database/AcDbSymbolTable.js +133 -37
  78. package/lib/database/AcDbSymbolTable.js.map +1 -1
  79. package/lib/database/AcDbSymbolTableRecord.d.ts +47 -2
  80. package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -1
  81. package/lib/database/AcDbSymbolTableRecord.js +40 -2
  82. package/lib/database/AcDbSymbolTableRecord.js.map +1 -1
  83. package/lib/database/AcDbTextStyleTable.d.ts +36 -2
  84. package/lib/database/AcDbTextStyleTable.d.ts.map +1 -1
  85. package/lib/database/AcDbTextStyleTable.js +36 -2
  86. package/lib/database/AcDbTextStyleTable.js.map +1 -1
  87. package/lib/database/AcDbTextStyleTableRecord.d.ts +129 -17
  88. package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -1
  89. package/lib/database/AcDbTextStyleTableRecord.js +127 -17
  90. package/lib/database/AcDbTextStyleTableRecord.js.map +1 -1
  91. package/lib/database/AcDbViewportTable.d.ts +22 -2
  92. package/lib/database/AcDbViewportTable.d.ts.map +1 -1
  93. package/lib/database/AcDbViewportTable.js +22 -2
  94. package/lib/database/AcDbViewportTable.js.map +1 -1
  95. package/lib/database/AcDbViewportTableRecord.d.ts +74 -9
  96. package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -1
  97. package/lib/database/AcDbViewportTableRecord.js +65 -9
  98. package/lib/database/AcDbViewportTableRecord.js.map +1 -1
  99. package/lib/entity/AcDbArc.d.ts +202 -17
  100. package/lib/entity/AcDbArc.d.ts.map +1 -1
  101. package/lib/entity/AcDbArc.js +201 -17
  102. package/lib/entity/AcDbArc.js.map +1 -1
  103. package/lib/entity/AcDbBlockReference.d.ts +147 -13
  104. package/lib/entity/AcDbBlockReference.d.ts.map +1 -1
  105. package/lib/entity/AcDbBlockReference.js +142 -13
  106. package/lib/entity/AcDbBlockReference.js.map +1 -1
  107. package/lib/entity/AcDbCircle.d.ts +145 -12
  108. package/lib/entity/AcDbCircle.d.ts.map +1 -1
  109. package/lib/entity/AcDbCircle.js +144 -12
  110. package/lib/entity/AcDbCircle.js.map +1 -1
  111. package/lib/entity/AcDbCurve.d.ts +33 -2
  112. package/lib/entity/AcDbCurve.d.ts.map +1 -1
  113. package/lib/entity/AcDbCurve.js +17 -0
  114. package/lib/entity/AcDbCurve.js.map +1 -1
  115. package/lib/entity/AcDbEllipse.d.ts +168 -16
  116. package/lib/entity/AcDbEllipse.d.ts.map +1 -1
  117. package/lib/entity/AcDbEllipse.js +167 -16
  118. package/lib/entity/AcDbEllipse.js.map +1 -1
  119. package/lib/entity/AcDbEntity.d.ts +299 -35
  120. package/lib/entity/AcDbEntity.d.ts.map +1 -1
  121. package/lib/entity/AcDbEntity.js +275 -27
  122. package/lib/entity/AcDbEntity.js.map +1 -1
  123. package/lib/entity/AcDbHatch.d.ts +60 -4
  124. package/lib/entity/AcDbHatch.d.ts.map +1 -1
  125. package/lib/entity/AcDbHatch.js +52 -4
  126. package/lib/entity/AcDbHatch.js.map +1 -1
  127. package/lib/entity/AcDbLeader.d.ts +157 -10
  128. package/lib/entity/AcDbLeader.d.ts.map +1 -1
  129. package/lib/entity/AcDbLeader.js +149 -10
  130. package/lib/entity/AcDbLeader.js.map +1 -1
  131. package/lib/entity/AcDbLine.d.ts +154 -13
  132. package/lib/entity/AcDbLine.d.ts.map +1 -1
  133. package/lib/entity/AcDbLine.js +153 -13
  134. package/lib/entity/AcDbLine.js.map +1 -1
  135. package/lib/entity/AcDbMText.d.ts +127 -11
  136. package/lib/entity/AcDbMText.d.ts.map +1 -1
  137. package/lib/entity/AcDbMText.js +112 -11
  138. package/lib/entity/AcDbMText.js.map +1 -1
  139. package/lib/entity/AcDbPoint.d.ts +86 -7
  140. package/lib/entity/AcDbPoint.d.ts.map +1 -1
  141. package/lib/entity/AcDbPoint.js +85 -7
  142. package/lib/entity/AcDbPoint.js.map +1 -1
  143. package/lib/entity/AcDbPolyline.d.ts +172 -25
  144. package/lib/entity/AcDbPolyline.d.ts.map +1 -1
  145. package/lib/entity/AcDbPolyline.js +170 -25
  146. package/lib/entity/AcDbPolyline.js.map +1 -1
  147. package/lib/entity/AcDbRasterImage.d.ts +75 -31
  148. package/lib/entity/AcDbRasterImage.d.ts.map +1 -1
  149. package/lib/entity/AcDbRasterImage.js +60 -31
  150. package/lib/entity/AcDbRasterImage.js.map +1 -1
  151. package/lib/entity/AcDbRay.d.ts +115 -9
  152. package/lib/entity/AcDbRay.d.ts.map +1 -1
  153. package/lib/entity/AcDbRay.js +113 -9
  154. package/lib/entity/AcDbRay.js.map +1 -1
  155. package/lib/entity/AcDbSpline.d.ts +106 -14
  156. package/lib/entity/AcDbSpline.d.ts.map +1 -1
  157. package/lib/entity/AcDbSpline.js +67 -4
  158. package/lib/entity/AcDbSpline.js.map +1 -1
  159. package/lib/entity/AcDbTable.d.ts +161 -44
  160. package/lib/entity/AcDbTable.d.ts.map +1 -1
  161. package/lib/entity/AcDbTable.js +135 -44
  162. package/lib/entity/AcDbTable.js.map +1 -1
  163. package/lib/entity/AcDbText.d.ts +298 -25
  164. package/lib/entity/AcDbText.d.ts.map +1 -1
  165. package/lib/entity/AcDbText.js +288 -25
  166. package/lib/entity/AcDbText.js.map +1 -1
  167. package/lib/entity/AcDbTrace.d.ts +150 -23
  168. package/lib/entity/AcDbTrace.d.ts.map +1 -1
  169. package/lib/entity/AcDbTrace.js +147 -23
  170. package/lib/entity/AcDbTrace.js.map +1 -1
  171. package/lib/entity/AcDbViewport.d.ts +122 -9
  172. package/lib/entity/AcDbViewport.d.ts.map +1 -1
  173. package/lib/entity/AcDbViewport.js +122 -9
  174. package/lib/entity/AcDbViewport.js.map +1 -1
  175. package/lib/entity/AcDbWipeout.d.ts +29 -1
  176. package/lib/entity/AcDbWipeout.d.ts.map +1 -1
  177. package/lib/entity/AcDbWipeout.js +29 -1
  178. package/lib/entity/AcDbWipeout.js.map +1 -1
  179. package/lib/entity/AcDbXline.d.ts +116 -9
  180. package/lib/entity/AcDbXline.d.ts.map +1 -1
  181. package/lib/entity/AcDbXline.js +114 -9
  182. package/lib/entity/AcDbXline.js.map +1 -1
  183. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +56 -12
  184. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -1
  185. package/lib/entity/dimension/AcDb3PointAngularDimension.js +56 -12
  186. package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -1
  187. package/lib/entity/dimension/AcDbAlignedDimension.d.ts +158 -17
  188. package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +1 -1
  189. package/lib/entity/dimension/AcDbAlignedDimension.js +153 -17
  190. package/lib/entity/dimension/AcDbAlignedDimension.js.map +1 -1
  191. package/lib/entity/dimension/AcDbArcDimension.d.ts +58 -12
  192. package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -1
  193. package/lib/entity/dimension/AcDbArcDimension.js +58 -12
  194. package/lib/entity/dimension/AcDbArcDimension.js.map +1 -1
  195. package/lib/entity/dimension/AcDbDiametricDimension.d.ts +99 -25
  196. package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +1 -1
  197. package/lib/entity/dimension/AcDbDiametricDimension.js +99 -25
  198. package/lib/entity/dimension/AcDbDiametricDimension.js.map +1 -1
  199. package/lib/entity/dimension/AcDbDimension.d.ts +108 -14
  200. package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -1
  201. package/lib/entity/dimension/AcDbDimension.js +99 -14
  202. package/lib/entity/dimension/AcDbDimension.js.map +1 -1
  203. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +48 -16
  204. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +1 -1
  205. package/lib/entity/dimension/AcDbOrdinateDimension.js +48 -16
  206. package/lib/entity/dimension/AcDbOrdinateDimension.js.map +1 -1
  207. package/lib/entity/dimension/AcDbRadialDimension.d.ts +167 -24
  208. package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +1 -1
  209. package/lib/entity/dimension/AcDbRadialDimension.js +162 -24
  210. package/lib/entity/dimension/AcDbRadialDimension.js.map +1 -1
  211. package/lib/misc/AcDbAngleUnits.d.ts +12 -0
  212. package/lib/misc/AcDbAngleUnits.d.ts.map +1 -1
  213. package/lib/misc/AcDbAngleUnits.js +12 -0
  214. package/lib/misc/AcDbAngleUnits.js.map +1 -1
  215. package/lib/misc/AcDbConstants.d.ts +20 -0
  216. package/lib/misc/AcDbConstants.d.ts.map +1 -1
  217. package/lib/misc/AcDbConstants.js +20 -0
  218. package/lib/misc/AcDbConstants.js.map +1 -1
  219. package/lib/misc/AcDbDimArrowType.d.ts +24 -21
  220. package/lib/misc/AcDbDimArrowType.d.ts.map +1 -1
  221. package/lib/misc/AcDbDimArrowType.js +24 -21
  222. package/lib/misc/AcDbDimArrowType.js.map +1 -1
  223. package/lib/misc/AcDbObjectIterator.d.ts +42 -3
  224. package/lib/misc/AcDbObjectIterator.d.ts.map +1 -1
  225. package/lib/misc/AcDbObjectIterator.js +42 -3
  226. package/lib/misc/AcDbObjectIterator.js.map +1 -1
  227. package/lib/misc/AcDbOsnapMode.d.ts +18 -10
  228. package/lib/misc/AcDbOsnapMode.d.ts.map +1 -1
  229. package/lib/misc/AcDbOsnapMode.js +18 -10
  230. package/lib/misc/AcDbOsnapMode.js.map +1 -1
  231. package/lib/misc/AcDbRenderingCache.d.ts +107 -29
  232. package/lib/misc/AcDbRenderingCache.d.ts.map +1 -1
  233. package/lib/misc/AcDbRenderingCache.js +105 -29
  234. package/lib/misc/AcDbRenderingCache.js.map +1 -1
  235. package/lib/misc/AcDbUnitsValue.d.ts +58 -8
  236. package/lib/misc/AcDbUnitsValue.d.ts.map +1 -1
  237. package/lib/misc/AcDbUnitsValue.js +58 -8
  238. package/lib/misc/AcDbUnitsValue.js.map +1 -1
  239. package/lib/object/AcDbDictionary.d.ts +128 -30
  240. package/lib/object/AcDbDictionary.d.ts.map +1 -1
  241. package/lib/object/AcDbDictionary.js +126 -30
  242. package/lib/object/AcDbDictionary.js.map +1 -1
  243. package/lib/object/AcDbRasterImageDef.d.ts +38 -9
  244. package/lib/object/AcDbRasterImageDef.d.ts.map +1 -1
  245. package/lib/object/AcDbRasterImageDef.js +37 -9
  246. package/lib/object/AcDbRasterImageDef.js.map +1 -1
  247. package/lib/object/layout/AcDbLayout.d.ts +152 -13
  248. package/lib/object/layout/AcDbLayout.d.ts.map +1 -1
  249. package/lib/object/layout/AcDbLayout.js +146 -13
  250. package/lib/object/layout/AcDbLayout.js.map +1 -1
  251. package/lib/object/layout/AcDbLayoutDictionary.d.ts +35 -7
  252. package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +1 -1
  253. package/lib/object/layout/AcDbLayoutDictionary.js +35 -7
  254. package/lib/object/layout/AcDbLayoutDictionary.js.map +1 -1
  255. package/lib/object/layout/AcDbLayoutManager.d.ts +103 -31
  256. package/lib/object/layout/AcDbLayoutManager.d.ts.map +1 -1
  257. package/lib/object/layout/AcDbLayoutManager.js +98 -31
  258. package/lib/object/layout/AcDbLayoutManager.js.map +1 -1
  259. package/package.json +8 -4
@@ -2,62 +2,189 @@ import { AcGeBox3d, AcGePoint3d, AcGePointLike } from '@mlightcad/geometry-engin
2
2
  import { AcGiRenderer } from '@mlightcad/graphic-interface';
3
3
  import { AcDbCurve } from './AcDbCurve';
4
4
  /**
5
- * The class represents the trace entity in AutoCAD, which represents a filled four-sided polygon.
6
- * It is typically used to create trace-like shapes. It is one of the simpler types of entities
7
- * within the AutoCAD database and can be visualized as a "filled polyline" with four vertices,
8
- * where each edge connects two consecutive points.
5
+ * Represents a trace entity in AutoCAD.
9
6
  *
10
- * This entity was more commonly used in earlier versions of AutoCAD, especially before the
11
- * introduction of more advanced entities like solid and hatches. Today, it's not as commonly used
12
- * since solid provides similar capabilities with more flexibility.
7
+ * A trace is a 3D geometric object that represents a filled four-sided polygon.
8
+ * It is typically used to create trace-like shapes and can be visualized as a
9
+ * "filled polyline" with four vertices, where each edge connects two consecutive points.
10
+ *
11
+ * This entity was more commonly used in earlier versions of AutoCAD, especially before
12
+ * the introduction of more advanced entities like solid and hatches. Today, it's not
13
+ * as commonly used since solid provides similar capabilities with more flexibility.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * // Create a trace entity
18
+ * const trace = new AcDbTrace();
19
+ * trace.setPointAt(0, new AcGePoint3d(0, 0, 0));
20
+ * trace.setPointAt(1, new AcGePoint3d(10, 0, 0));
21
+ * trace.setPointAt(2, new AcGePoint3d(10, 5, 0));
22
+ * trace.setPointAt(3, new AcGePoint3d(0, 5, 0));
23
+ *
24
+ * // Access trace properties
25
+ * console.log(`Elevation: ${trace.elevation}`);
26
+ * console.log(`Thickness: ${trace.thickness}`);
27
+ * ```
13
28
  */
14
29
  export declare class AcDbTrace extends AcDbCurve {
30
+ /** The elevation (Z-coordinate) of the trace plane */
15
31
  private _elevation;
32
+ /** The four vertices of the trace */
16
33
  private _vertices;
34
+ /** The thickness (extrusion) of the trace */
17
35
  private _thickness;
18
36
  /**
19
- * Create one empty trace entity
37
+ * Creates a new trace entity.
38
+ *
39
+ * This constructor initializes a trace with default values.
40
+ * All vertices are set to the origin, elevation is 0, and thickness is 1.
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * const trace = new AcDbTrace();
45
+ * // Set the four vertices to create a rectangle
46
+ * trace.setPointAt(0, new AcGePoint3d(0, 0, 0));
47
+ * trace.setPointAt(1, new AcGePoint3d(10, 0, 0));
48
+ * trace.setPointAt(2, new AcGePoint3d(10, 5, 0));
49
+ * trace.setPointAt(3, new AcGePoint3d(0, 5, 0));
50
+ * ```
20
51
  */
21
52
  constructor();
22
53
  /**
23
- * The distance of the trace's plane from the WCS origin.
54
+ * Gets the elevation of this trace.
55
+ *
56
+ * The elevation is the distance of the trace's plane from the WCS origin
57
+ * along the Z-axis.
58
+ *
59
+ * @returns The elevation value
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * const elevation = trace.elevation;
64
+ * console.log(`Trace elevation: ${elevation}`);
65
+ * ```
24
66
  */
25
67
  get elevation(): number;
68
+ /**
69
+ * Sets the elevation of this trace.
70
+ *
71
+ * @param value - The new elevation value
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * trace.elevation = 10;
76
+ * ```
77
+ */
26
78
  set elevation(value: number);
27
79
  /**
28
- * @inheritdoc
80
+ * Gets whether this trace is closed.
81
+ *
82
+ * Traces are always closed entities, so this always returns true.
83
+ *
84
+ * @returns Always true for traces
29
85
  */
30
86
  get closed(): boolean;
31
87
  /**
32
- * The thickness for the text. The thickness is the text's dimension along its normal vector
33
- * direction (sometimes called the extrusion direction).
88
+ * Gets the thickness of this trace.
89
+ *
90
+ * The thickness is the trace's dimension along its normal vector direction
91
+ * (sometimes called the extrusion direction).
92
+ *
93
+ * @returns The thickness value
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const thickness = trace.thickness;
98
+ * console.log(`Trace thickness: ${thickness}`);
99
+ * ```
34
100
  */
35
101
  get thickness(): number;
102
+ /**
103
+ * Sets the thickness of this trace.
104
+ *
105
+ * @param value - The new thickness value
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * trace.thickness = 2.0;
110
+ * ```
111
+ */
36
112
  set thickness(value: number);
37
113
  /**
38
- * Return the point in the trace whose index is equal to the specified `index` value. `index` can have
39
- * a value of 0, 1, 2, or 3, depending on which point is desired (that is, 0 for the first point, 1 for
40
- * the second point, etc.). The returned point is in WCS coordinates.
41
- * @param index Input index (0 based) of the vertex.
42
- * @returns Return the point in the trace whose index is equal to the specified `index` value.
114
+ * Gets the point at the specified index in this trace.
115
+ *
116
+ * The index can be 0, 1, 2, or 3, representing the four vertices of the trace.
117
+ * If the index is out of range, it returns the first or last vertex accordingly.
118
+ *
119
+ * @param index - The index (0-3) of the vertex to get
120
+ * @returns The point at the specified index in WCS coordinates
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * const point0 = trace.getPointAt(0);
125
+ * const point1 = trace.getPointAt(1);
126
+ * console.log(`Vertex 0: ${point0.x}, ${point0.y}, ${point0.z}`);
127
+ * ```
43
128
  */
44
129
  getPointAt(index: number): AcGePoint3d;
45
130
  /**
46
- * Set sets the `index`'th point in the trace to the value `point`. `index` must be 0, 1, 2, or 3.
47
- * `point` must be in WCS coordinates.
48
- * @param index Input index (0-3) of the point to set in the trace
131
+ * Sets the point at the specified index in this trace.
132
+ *
133
+ * The index must be 0, 1, 2, or 3, representing the four vertices of the trace.
134
+ * If the index is out of range, it sets the first or last vertex accordingly.
135
+ *
136
+ * @param index - The index (0-3) of the vertex to set
137
+ * @param point - The new point in WCS coordinates
138
+ *
139
+ * @example
140
+ * ```typescript
141
+ * trace.setPointAt(0, new AcGePoint3d(0, 0, 0));
142
+ * trace.setPointAt(1, new AcGePoint3d(10, 0, 0));
143
+ * trace.setPointAt(2, new AcGePoint3d(10, 5, 0));
144
+ * trace.setPointAt(3, new AcGePoint3d(0, 5, 0));
145
+ * ```
49
146
  */
50
147
  setPointAt(index: number, point: AcGePointLike): AcGePoint3d | undefined;
51
148
  /**
52
- * @inheritdoc
149
+ * Gets the geometric extents (bounding box) of this trace.
150
+ *
151
+ * @returns The bounding box that encompasses the entire trace
152
+ *
153
+ * @example
154
+ * ```typescript
155
+ * const extents = trace.geometricExtents;
156
+ * console.log(`Trace bounds: ${extents.minPoint} to ${extents.maxPoint}`);
157
+ * ```
53
158
  */
54
159
  get geometricExtents(): AcGeBox3d;
55
160
  /**
56
- * @inheritdoc
161
+ * Gets the grip points for this trace.
162
+ *
163
+ * Grip points are control points that can be used to modify the trace.
164
+ * For a trace, the grip points are all four vertices.
165
+ *
166
+ * @returns Array of grip points (all four vertices)
167
+ *
168
+ * @example
169
+ * ```typescript
170
+ * const gripPoints = trace.subGetGripPoints();
171
+ * // gripPoints contains all four vertices of the trace
172
+ * ```
57
173
  */
58
174
  subGetGripPoints(): AcGePoint3d[];
59
175
  /**
60
- * @inheritdoc
176
+ * Draws this trace using the specified renderer.
177
+ *
178
+ * This method renders the trace as a filled area using the trace's
179
+ * current style properties.
180
+ *
181
+ * @param renderer - The renderer to use for drawing
182
+ * @returns The rendered trace entity, or undefined if drawing failed
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const renderedTrace = trace.draw(renderer);
187
+ * ```
61
188
  */
62
189
  draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
63
190
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbTrace.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbTrace.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,WAAW,EACX,aAAa,EAEd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,SAAS,CAAsD;IACvE,OAAO,CAAC,UAAU,CAAQ;IAE1B;;OAEG;;IAaH;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAE1B;IAED;;O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IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAMtC;;;;;;;;;;;;;;;;OAgBG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;IAM9C;;;;;;;;;;OAUG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAEhC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAAgB;IAQhB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAW5B"}
@@ -16,19 +16,47 @@ var __extends = (this && this.__extends) || (function () {
16
16
  import { AcGeArea2d, AcGeBox3d, AcGePoint3d, AcGePolyline2d } from '@mlightcad/geometry-engine';
17
17
  import { AcDbCurve } from './AcDbCurve';
18
18
  /**
19
- * The class represents the trace entity in AutoCAD, which represents a filled four-sided polygon.
20
- * It is typically used to create trace-like shapes. It is one of the simpler types of entities
21
- * within the AutoCAD database and can be visualized as a "filled polyline" with four vertices,
22
- * where each edge connects two consecutive points.
19
+ * Represents a trace entity in AutoCAD.
23
20
  *
24
- * This entity was more commonly used in earlier versions of AutoCAD, especially before the
25
- * introduction of more advanced entities like solid and hatches. Today, it's not as commonly used
26
- * since solid provides similar capabilities with more flexibility.
21
+ * A trace is a 3D geometric object that represents a filled four-sided polygon.
22
+ * It is typically used to create trace-like shapes and can be visualized as a
23
+ * "filled polyline" with four vertices, where each edge connects two consecutive points.
24
+ *
25
+ * This entity was more commonly used in earlier versions of AutoCAD, especially before
26
+ * the introduction of more advanced entities like solid and hatches. Today, it's not
27
+ * as commonly used since solid provides similar capabilities with more flexibility.
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * // Create a trace entity
32
+ * const trace = new AcDbTrace();
33
+ * trace.setPointAt(0, new AcGePoint3d(0, 0, 0));
34
+ * trace.setPointAt(1, new AcGePoint3d(10, 0, 0));
35
+ * trace.setPointAt(2, new AcGePoint3d(10, 5, 0));
36
+ * trace.setPointAt(3, new AcGePoint3d(0, 5, 0));
37
+ *
38
+ * // Access trace properties
39
+ * console.log(`Elevation: ${trace.elevation}`);
40
+ * console.log(`Thickness: ${trace.thickness}`);
41
+ * ```
27
42
  */
28
43
  var AcDbTrace = /** @class */ (function (_super) {
29
44
  __extends(AcDbTrace, _super);
30
45
  /**
31
- * Create one empty trace entity
46
+ * Creates a new trace entity.
47
+ *
48
+ * This constructor initializes a trace with default values.
49
+ * All vertices are set to the origin, elevation is 0, and thickness is 1.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const trace = new AcDbTrace();
54
+ * // Set the four vertices to create a rectangle
55
+ * trace.setPointAt(0, new AcGePoint3d(0, 0, 0));
56
+ * trace.setPointAt(1, new AcGePoint3d(10, 0, 0));
57
+ * trace.setPointAt(2, new AcGePoint3d(10, 5, 0));
58
+ * trace.setPointAt(3, new AcGePoint3d(0, 5, 0));
59
+ * ```
32
60
  */
33
61
  function AcDbTrace() {
34
62
  var _this = _super.call(this) || this;
@@ -44,11 +72,32 @@ var AcDbTrace = /** @class */ (function (_super) {
44
72
  }
45
73
  Object.defineProperty(AcDbTrace.prototype, "elevation", {
46
74
  /**
47
- * The distance of the trace's plane from the WCS origin.
75
+ * Gets the elevation of this trace.
76
+ *
77
+ * The elevation is the distance of the trace's plane from the WCS origin
78
+ * along the Z-axis.
79
+ *
80
+ * @returns The elevation value
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * const elevation = trace.elevation;
85
+ * console.log(`Trace elevation: ${elevation}`);
86
+ * ```
48
87
  */
49
88
  get: function () {
50
89
  return this._elevation;
51
90
  },
91
+ /**
92
+ * Sets the elevation of this trace.
93
+ *
94
+ * @param value - The new elevation value
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * trace.elevation = 10;
99
+ * ```
100
+ */
52
101
  set: function (value) {
53
102
  this._elevation = value;
54
103
  },
@@ -57,7 +106,11 @@ var AcDbTrace = /** @class */ (function (_super) {
57
106
  });
58
107
  Object.defineProperty(AcDbTrace.prototype, "closed", {
59
108
  /**
60
- * @inheritdoc
109
+ * Gets whether this trace is closed.
110
+ *
111
+ * Traces are always closed entities, so this always returns true.
112
+ *
113
+ * @returns Always true for traces
61
114
  */
62
115
  get: function () {
63
116
  return true;
@@ -67,12 +120,32 @@ var AcDbTrace = /** @class */ (function (_super) {
67
120
  });
68
121
  Object.defineProperty(AcDbTrace.prototype, "thickness", {
69
122
  /**
70
- * The thickness for the text. The thickness is the text's dimension along its normal vector
71
- * direction (sometimes called the extrusion direction).
123
+ * Gets the thickness of this trace.
124
+ *
125
+ * The thickness is the trace's dimension along its normal vector direction
126
+ * (sometimes called the extrusion direction).
127
+ *
128
+ * @returns The thickness value
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const thickness = trace.thickness;
133
+ * console.log(`Trace thickness: ${thickness}`);
134
+ * ```
72
135
  */
73
136
  get: function () {
74
137
  return this._thickness;
75
138
  },
139
+ /**
140
+ * Sets the thickness of this trace.
141
+ *
142
+ * @param value - The new thickness value
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * trace.thickness = 2.0;
147
+ * ```
148
+ */
76
149
  set: function (value) {
77
150
  this._thickness = value;
78
151
  },
@@ -80,11 +153,20 @@ var AcDbTrace = /** @class */ (function (_super) {
80
153
  configurable: true
81
154
  });
82
155
  /**
83
- * Return the point in the trace whose index is equal to the specified `index` value. `index` can have
84
- * a value of 0, 1, 2, or 3, depending on which point is desired (that is, 0 for the first point, 1 for
85
- * the second point, etc.). The returned point is in WCS coordinates.
86
- * @param index Input index (0 based) of the vertex.
87
- * @returns Return the point in the trace whose index is equal to the specified `index` value.
156
+ * Gets the point at the specified index in this trace.
157
+ *
158
+ * The index can be 0, 1, 2, or 3, representing the four vertices of the trace.
159
+ * If the index is out of range, it returns the first or last vertex accordingly.
160
+ *
161
+ * @param index - The index (0-3) of the vertex to get
162
+ * @returns The point at the specified index in WCS coordinates
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * const point0 = trace.getPointAt(0);
167
+ * const point1 = trace.getPointAt(1);
168
+ * console.log(`Vertex 0: ${point0.x}, ${point0.y}, ${point0.z}`);
169
+ * ```
88
170
  */
89
171
  AcDbTrace.prototype.getPointAt = function (index) {
90
172
  if (index < 0)
@@ -94,9 +176,21 @@ var AcDbTrace = /** @class */ (function (_super) {
94
176
  return this._vertices[index];
95
177
  };
96
178
  /**
97
- * Set sets the `index`'th point in the trace to the value `point`. `index` must be 0, 1, 2, or 3.
98
- * `point` must be in WCS coordinates.
99
- * @param index Input index (0-3) of the point to set in the trace
179
+ * Sets the point at the specified index in this trace.
180
+ *
181
+ * The index must be 0, 1, 2, or 3, representing the four vertices of the trace.
182
+ * If the index is out of range, it sets the first or last vertex accordingly.
183
+ *
184
+ * @param index - The index (0-3) of the vertex to set
185
+ * @param point - The new point in WCS coordinates
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * trace.setPointAt(0, new AcGePoint3d(0, 0, 0));
190
+ * trace.setPointAt(1, new AcGePoint3d(10, 0, 0));
191
+ * trace.setPointAt(2, new AcGePoint3d(10, 5, 0));
192
+ * trace.setPointAt(3, new AcGePoint3d(0, 5, 0));
193
+ * ```
100
194
  */
101
195
  AcDbTrace.prototype.setPointAt = function (index, point) {
102
196
  if (index < 0)
@@ -107,7 +201,15 @@ var AcDbTrace = /** @class */ (function (_super) {
107
201
  };
108
202
  Object.defineProperty(AcDbTrace.prototype, "geometricExtents", {
109
203
  /**
110
- * @inheritdoc
204
+ * Gets the geometric extents (bounding box) of this trace.
205
+ *
206
+ * @returns The bounding box that encompasses the entire trace
207
+ *
208
+ * @example
209
+ * ```typescript
210
+ * const extents = trace.geometricExtents;
211
+ * console.log(`Trace bounds: ${extents.minPoint} to ${extents.maxPoint}`);
212
+ * ```
111
213
  */
112
214
  get: function () {
113
215
  return new AcGeBox3d().setFromPoints(this._vertices);
@@ -116,7 +218,18 @@ var AcDbTrace = /** @class */ (function (_super) {
116
218
  configurable: true
117
219
  });
118
220
  /**
119
- * @inheritdoc
221
+ * Gets the grip points for this trace.
222
+ *
223
+ * Grip points are control points that can be used to modify the trace.
224
+ * For a trace, the grip points are all four vertices.
225
+ *
226
+ * @returns Array of grip points (all four vertices)
227
+ *
228
+ * @example
229
+ * ```typescript
230
+ * const gripPoints = trace.subGetGripPoints();
231
+ * // gripPoints contains all four vertices of the trace
232
+ * ```
120
233
  */
121
234
  AcDbTrace.prototype.subGetGripPoints = function () {
122
235
  var gripPoints = new Array();
@@ -126,7 +239,18 @@ var AcDbTrace = /** @class */ (function (_super) {
126
239
  return gripPoints;
127
240
  };
128
241
  /**
129
- * @inheritdoc
242
+ * Draws this trace using the specified renderer.
243
+ *
244
+ * This method renders the trace as a filled area using the trace's
245
+ * current style properties.
246
+ *
247
+ * @param renderer - The renderer to use for drawing
248
+ * @returns The rendered trace entity, or undefined if drawing failed
249
+ *
250
+ * @example
251
+ * ```typescript
252
+ * const renderedTrace = trace.draw(renderer);
253
+ * ```
130
254
  */
131
255
  AcDbTrace.prototype.draw = function (renderer) {
132
256
  var polyline = new AcGePolyline2d(this._vertices, true);
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbTrace.js","sourceRoot":"","sources":["../../src/entity/AcDbTrace.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EAEX,cAAc,EACf,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;GASG;AACH;IAA+B,6BAAS;IAKtC;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,UAAU,GAAG,CAAC,CAAA;QACnB,KAAI,CAAC,UAAU,GAAG,CAAC,CAAA;QACnB,KAAI,CAAC,SAAS,GAAG;YACf,IAAI,WAAW,EAAE;YACjB,IAAI,WAAW,EAAE;YACjB,IAAI,WAAW,EAAE;YACjB,IAAI,WAAW,EAAE;SAClB,CAAA;;IACH,CAAC;IAKD,sBAAI,g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AAA;IACnC,CAAC;IAaD,sBAAI,uCAAgB;QAXpB;;;;;;;;;;WAUG;aACH;YACE,OAAO,IAAI,SAAS,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACtD,CAAC;;;OAAA;IAED;;;;;;;;;;;;;OAaG;IACH,oCAAgB,GAAhB;QACE,IAAM,UAAU,GAAG,IAAI,KAAK,EAAe,CAAA;QAC3C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC;YACvC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;QACzC,CAAC;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,wBAAI,GAAJ,UAAK,QAAsB;QACzB,IAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;QACzD,IAAM,IAAI,GAAG,IAAI,UAAU,EAAE,CAAA;QAC7B,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE;YACzB,KAAK,EAAE,IAAI,CAAC,QAAQ;YACpB,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,EAAE;SACjB,CAAC,CAAA;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AA1ND,CAA+B,SAAS,GA0NvC"}
@@ -1,6 +1,28 @@
1
1
  import { AcGeBox3d, AcGePoint3d } from '@mlightcad/geometry-engine';
2
2
  import { AcGiEntity, AcGiRenderer, AcGiViewport } from '@mlightcad/graphic-interface';
3
3
  import { AcDbEntity } from './AcDbEntity';
4
+ /**
5
+ * Represents a viewport entity in AutoCAD drawings.
6
+ *
7
+ * A viewport is a rectangular window that displays a portion of the drawing model space
8
+ * within paper space layouts. Viewports allow users to create multiple views of the same
9
+ * drawing at different scales and orientations on a single sheet.
10
+ *
11
+ * Key characteristics:
12
+ * - Viewports exist primarily in paper space layouts
13
+ * - Each viewport has a unique ID number (except the default system viewport with ID 1)
14
+ * - Viewports can be active or inactive
15
+ * - The viewport entity itself is drawn as a rectangular border in paper space
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * const viewport = new AcDbViewport();
20
+ * viewport.centerPoint = new AcGePoint3d(0, 0, 0);
21
+ * viewport.width = 10;
22
+ * viewport.height = 8;
23
+ * viewport.number = 2;
24
+ * ```
25
+ */
4
26
  export declare class AcDbViewport extends AcDbEntity {
5
27
  private _centerPoint;
6
28
  private _height;
@@ -8,51 +30,142 @@ export declare class AcDbViewport extends AcDbEntity {
8
30
  private _viewCenter;
9
31
  private _viewHeight;
10
32
  private _number;
33
+ /**
34
+ * Creates a new AcDbViewport instance.
35
+ *
36
+ * Initializes all properties with default values:
37
+ * - centerPoint: origin (0,0,0)
38
+ * - height: 0
39
+ * - width: 0
40
+ * - viewCenter: origin (0,0,0)
41
+ * - viewHeight: 0
42
+ * - number: -1 (indicating inactive viewport)
43
+ */
11
44
  constructor();
12
45
  /**
13
- * The viewport ID number. This is the number that is reported by the AutoCAD CVPORT system variable
46
+ * Gets or sets the viewport ID number.
47
+ *
48
+ * This is the number that is reported by the AutoCAD CVPORT system variable
14
49
  * when the viewport is the current viewport in the AutoCAD editor. If the viewport is inactive, -1
15
50
  * is returned.
16
- * This value is not saved with the drawing, and changes each time the drawing is opened.
51
+ *
52
+ * Important notes:
53
+ * - This value is not saved with the drawing, and changes each time the drawing is opened
54
+ * - Viewport ID 1 is reserved for the system-defined default viewport in paper space
55
+ * - Active viewports have IDs greater than 1
56
+ * - Inactive viewports return -1
57
+ *
58
+ * @returns The viewport ID number
17
59
  */
18
60
  get number(): number;
19
61
  set number(value: number);
20
62
  /**
21
- * The center point of the viewport entity in WCS coordinates (within Paper Space).
63
+ * Gets or sets the center point of the viewport entity in WCS coordinates (within Paper Space).
64
+ *
65
+ * This point represents the geometric center of the viewport's rectangular boundary
66
+ * in paper space coordinates, not the center of the model space view within the viewport.
67
+ *
68
+ * @returns The center point of the viewport entity
22
69
  */
23
70
  get centerPoint(): AcGePoint3d;
24
71
  set centerPoint(value: AcGePoint3d);
25
72
  /**
26
- * The height of the viewport entity's window in drawing units.
73
+ * Gets or sets the height of the viewport entity's window in drawing units.
74
+ *
75
+ * This represents the height of the viewport's rectangular boundary in paper space,
76
+ * measured in the current drawing units. It defines the vertical extent of the
77
+ * viewport border, not the height of the model space view within it.
78
+ *
79
+ * @returns The height of the viewport entity in drawing units
27
80
  */
28
81
  get height(): number;
29
82
  set height(value: number);
30
83
  /**
31
- * The width of the viewport entity's window in drawing units. This is the width in Paper Space
32
- * of the viewport itself, not the width of the Model Space view within the viewport.
84
+ * Gets or sets the width of the viewport entity's window in drawing units.
85
+ *
86
+ * This represents the width of the viewport's rectangular boundary in paper space,
87
+ * measured in the current drawing units. It defines the horizontal extent of the
88
+ * viewport border, not the width of the model space view within the viewport.
89
+ *
90
+ * Note: This is the width in Paper Space of the viewport itself, not the width
91
+ * of the Model Space view within the viewport.
92
+ *
93
+ * @returns The width of the viewport entity in drawing units
33
94
  */
34
95
  get width(): number;
35
96
  set width(value: number);
36
97
  /**
37
- * The view center (in display coordinate system coordinates) of the view in the viewport.
98
+ * Gets or sets the view center in display coordinate system coordinates.
99
+ *
100
+ * This point represents the center of the model space view that is displayed
101
+ * within the viewport. It is specified in the display coordinate system and
102
+ * determines what portion of the model space drawing is visible in the viewport.
103
+ *
104
+ * @returns The center point of the model space view within the viewport
38
105
  */
39
106
  get viewCenter(): AcGePoint3d;
40
107
  set viewCenter(value: AcGePoint3d);
41
108
  /**
42
- * The height (in display coordinate system coordinates) of the Model Space view within the viewport.
43
- * Zooming the view out within the viewport increases this value and zooming in decreases this value.
109
+ * Gets or sets the height of the Model Space view within the viewport.
110
+ *
111
+ * This value represents the height of the model space view that is displayed
112
+ * within the viewport, specified in display coordinate system coordinates.
113
+ *
114
+ * Zoom behavior:
115
+ * - Zooming the view out within the viewport increases this value
116
+ * - Zooming the view in within the viewport decreases this value
117
+ *
118
+ * @returns The height of the model space view in display coordinates
44
119
  */
45
120
  get viewHeight(): number;
46
121
  set viewHeight(value: number);
47
122
  /**
123
+ * Gets the geometric extents of the viewport entity.
124
+ *
125
+ * This method returns a bounding box that encompasses the entire viewport entity
126
+ * in world coordinate system (WCS) coordinates.
127
+ *
128
+ * @returns A bounding box containing the viewport entity
48
129
  * @inheritdoc
49
130
  */
50
131
  get geometricExtents(): AcGeBox3d;
51
132
  /**
133
+ * Renders the viewport entity using the specified renderer.
134
+ *
135
+ * The viewport is drawn as a rectangular border when the following conditions are met:
136
+ * - The viewport entity is not in model space (i.e., it's in paper space)
137
+ * - The viewport ID number is greater than 1 (not the default system viewport)
138
+ *
139
+ * In paper space layouts, there is always a system-defined "default" viewport that exists as
140
+ * the bottom-most item. This viewport doesn't show any entities and is mainly for internal
141
+ * AutoCAD purposes. The viewport ID number of this system-defined "default" viewport is 1.
142
+ *
143
+ * @param renderer - The renderer to use for drawing the viewport
144
+ * @returns A render group containing the viewport border lines, or undefined if not drawn
52
145
  * @inheritdoc
53
146
  */
54
147
  draw(renderer: AcGiRenderer): AcGiEntity | undefined;
148
+ /**
149
+ * Converts this AcDbViewport to an AcGiViewport for rendering purposes.
150
+ *
151
+ * This method creates a graphic interface viewport object that contains all the
152
+ * necessary properties for rendering the viewport in the graphics system.
153
+ *
154
+ * @returns An AcGiViewport instance with all viewport properties copied
155
+ */
55
156
  toGiViewport(): AcGiViewport;
157
+ /**
158
+ * Creates the rectangular border lines for the viewport.
159
+ *
160
+ * This private method generates four line entities that form a rectangle representing
161
+ * the viewport's boundary. The rectangle is centered on the viewport's center point
162
+ * and has dimensions specified by the viewport's width and height.
163
+ *
164
+ * @param viewport - The graphic interface viewport containing rendering properties
165
+ * @param renderer - The renderer to use for creating the line entities
166
+ * @returns An array of line entities forming the viewport border
167
+ * @private
168
+ */
56
169
  private createViewportRect;
57
170
  }
58
171
  //# sourceMappingURL=AcDbViewport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbViewport.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbViewport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACb,MAAM,8BAA8B,CAAA;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,qBAAa,YAAa,SAAQ,UAAU;IAC1C,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,OAAO,CAAQ;;IAYvB;;;;;OAKG;IACH,IAAI,MAAM,IAGQ,MAAM,CADvB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IAED;;OAEG;IACH,IAAI,WAAW,IAGQ,WAAW,CADjC;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,WAAW,EAEjC;IAED;;OAEG;IACH,IAAI,MAAM,IAGQ,MAAM,CADvB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IAED;;;OAGG;IACH,IAAI,KAAK,IAGQ,MAAM,CADtB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAEtB;IAED;;OAEG;IACH,IAAI,UAAU,IAGQ,WAAW,CADhC;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,WAAW,EAEhC;IAED;;;OAGG;IACH,IAAI,UAAU,IAGQ,MAAM,CAD3B;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAGhC;IAED;;OAEG;IACH,IAAI,CAAC,Q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