@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
@@ -1,15 +1,54 @@
1
1
  /**
2
- * Iterator used for iterating over database objects in a map.
2
+ * Iterator used for iterating over database objects.
3
+ *
4
+ * This class provides an iterator interface for traversing collections
5
+ * of database objects. It implements both IterableIterator and provides
6
+ * additional methods for checking if more items are available.
7
+ *
8
+ * @template ResultType - The type of objects being iterated over
3
9
  */
4
10
  export declare class AcDbObjectIterator<ResultType> implements IterableIterator<ResultType> {
11
+ /** Current index in the iteration */
5
12
  private i;
6
13
  private _records;
7
14
  private _keys;
15
+ /**
16
+ * Creates a new AcDbObjectIterator instance.
17
+ *
18
+ * @param records - Array of objects to iterate over
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const entities = [entity1, entity2, entity3];
23
+ * const iterator = new AcDbObjectIterator(entities);
24
+ * ```
25
+ */
8
26
  constructor(records: Map<string, ResultType>);
27
+ /**
28
+ * Returns the iterator itself, allowing it to be used in for...of loops.
29
+ *
30
+ * @returns This iterator instance
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * for (const entity of iterator) {
35
+ * console.log('Entity:', entity);
36
+ * }
37
+ * ```
38
+ */
9
39
  [Symbol.iterator](): IterableIterator<ResultType>;
10
40
  /**
11
- * Increment the iterator to the next entry.
12
- * @returns Return the next entry
41
+ * Increments the iterator to the next entry.
42
+ *
43
+ * @returns Iterator result containing the next value or null if done
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const result = iterator.next();
48
+ * if (!result.done) {
49
+ * console.log('Next item:', result.value);
50
+ * }
51
+ * ```
13
52
  */
14
53
  next(): IteratorResult<ResultType, null>;
15
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbObjectIterator.d.ts","sourceRoot":"","sources":["../../src/misc/AcDbObjectIterator.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,kBAAkB,CAAC,UAAU,CACxC,YAAW,gBAAgB,CAAC,UAAU,CAAC;IAEvC,OAAO,CAAC,CAAC,CAAI;IACb,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,KAAK,CAAU;gBAEX,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAK5C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAIjD;;;OAGG;IACH,IAAI,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC;CAQzC"}
1
+ {"version":3,"file":"AcDbObjectIterator.d.ts","sourceRoot":"","sources":["../../src/misc/AcDbObjectIterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,kBAAkB,CAAC,UAAU,CACxC,YAAW,gBAAgB,CAAC,UAAU,CAAC;IAEvC,qCAAqC;IACrC,OAAO,CAAC,CAAC,CAAI;IACb,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,KAAK,CAAU;IAEvB;;;;;;;;;;OAUG;gBACS,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAK5C;;;;;;;;;;;OAWG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAIjD;;;;;;;;;;;;OAYG;IACH,IAAI,IAAI,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC;CAQzC"}
@@ -1,18 +1,57 @@
1
1
  /**
2
- * Iterator used for iterating over database objects in a map.
2
+ * Iterator used for iterating over database objects.
3
+ *
4
+ * This class provides an iterator interface for traversing collections
5
+ * of database objects. It implements both IterableIterator and provides
6
+ * additional methods for checking if more items are available.
7
+ *
8
+ * @template ResultType - The type of objects being iterated over
3
9
  */
4
10
  var AcDbObjectIterator = /** @class */ (function () {
11
+ /**
12
+ * Creates a new AcDbObjectIterator instance.
13
+ *
14
+ * @param records - Array of objects to iterate over
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const entities = [entity1, entity2, entity3];
19
+ * const iterator = new AcDbObjectIterator(entities);
20
+ * ```
21
+ */
5
22
  function AcDbObjectIterator(records) {
23
+ /** Current index in the iteration */
6
24
  this.i = 0;
7
25
  this._records = records;
8
26
  this._keys = Array.from(records.keys());
9
27
  }
28
+ /**
29
+ * Returns the iterator itself, allowing it to be used in for...of loops.
30
+ *
31
+ * @returns This iterator instance
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * for (const entity of iterator) {
36
+ * console.log('Entity:', entity);
37
+ * }
38
+ * ```
39
+ */
10
40
  AcDbObjectIterator.prototype[Symbol.iterator] = function () {
11
41
  return this;
12
42
  };
13
43
  /**
14
- * Increment the iterator to the next entry.
15
- * @returns Return the next entry
44
+ * Increments the iterator to the next entry.
45
+ *
46
+ * @returns Iterator result containing the next value or null if done
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * const result = iterator.next();
51
+ * if (!result.done) {
52
+ * console.log('Next item:', result.value);
53
+ * }
54
+ * ```
16
55
  */
17
56
  AcDbObjectIterator.prototype.next = function () {
18
57
  while (this.i < this._keys.length) {
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbObjectIterator.js","sourceRoot":"","sources":["../../src/misc/AcDbObjectIterator.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAOE,4BAAY,OAAgC;QAJpC,MAAC,GAAG,CAAC,CAAA;QAKX,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IACzC,CAAC;IAED,6BAAC,MAAM,CAAC,QAAQ,CAAC,GAAjB;QACE,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,iCAAI,GAAJ;QACE,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClC,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAe,CAAA;YACjE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAA;YACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;QACtC,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACpC,CAAC;IACH,yBAAC;AAAD,CAAC,AA5BD,IA4BC"}
1
+ {"version":3,"file":"AcDbObjectIterator.js","sourceRoot":"","sources":["../../src/misc/AcDbObjectIterator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH;IAQE;;;;;;;;;;OAUG;IACH,4BAAY,OAAgC;QAhB5C,qCAAqC;QAC7B,MAAC,GAAG,CAAC,CAAA;QAgBX,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IACvC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,6BAAC,MAAM,CAAC,QAAQ,CAAC,GAAjB;QACE,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,iCAAI,GAAJ;QACE,OAAO,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAClC,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAe,CAAA;YACjE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAA;YACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;QACtC,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACpC,CAAC;IACH,yBAAC;AAAD,CAAC,AA7DD,IA6DC"}
@@ -1,42 +1,50 @@
1
+ /**
2
+ * Enumeration of object snap modes used in AutoCAD.
3
+ *
4
+ * Object snap modes define the types of geometric points that can be
5
+ * snapped to when drawing or editing entities. These modes help ensure
6
+ * precise positioning and alignment of objects.
7
+ */
1
8
  export declare enum AcDbOsnapMode {
2
9
  /**
3
- * End point
10
+ * End point - snaps to the endpoint of a line, arc, or other entity
4
11
  */
5
12
  EndPoint = 1,
6
13
  /**
7
- * Middle point
14
+ * Middle point - snaps to the midpoint of a line or arc
8
15
  */
9
16
  MidPoint = 2,
10
17
  /**
11
- * Center
18
+ * Center - snaps to the center point of a circle, arc, or ellipse
12
19
  */
13
20
  Center = 3,
14
21
  /**
15
- * Node
22
+ * Node - snaps to a point entity
16
23
  */
17
24
  Node = 4,
18
25
  /**
19
- * Quadrant
26
+ * Quadrant - snaps to the quadrant points of a circle or ellipse
27
+ * (0°, 90°, 180°, 270°)
20
28
  */
21
29
  Quadrant = 5,
22
30
  /**
23
- * Insertion
31
+ * Insertion - snaps to the insertion point of text, blocks, or other objects
24
32
  */
25
33
  Insertion = 7,
26
34
  /**
27
- * Perpendicular
35
+ * Perpendicular - snaps to a point perpendicular to a line or arc
28
36
  */
29
37
  Perpendicular = 8,
30
38
  /**
31
- * Tangent
39
+ * Tangent - snaps to a point tangent to a circle or arc
32
40
  */
33
41
  Tangent = 9,
34
42
  /**
35
- * Nearest
43
+ * Nearest - snaps to the nearest point on an entity
36
44
  */
37
45
  Nearest = 10,
38
46
  /**
39
- * Center of the object
47
+ * Center of the object - snaps to the centroid or center of mass of an object
40
48
  */
41
49
  Centroid = 11
42
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbOsnapMode.d.ts","sourceRoot":"","sources":["../../src/misc/AcDbOsnapMode.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,IAAI,IAAI;IACR;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,SAAS,IAAI;IACb;;OAEG;IACH,aAAa,IAAI;IACjB;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,OAAO,KAAK;IACZ;;OAEG;IACH,QAAQ,KAAK;CACd"}
1
+ {"version":3,"file":"AcDbOsnapMode.d.ts","sourceRoot":"","sources":["../../src/misc/AcDbOsnapMode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,IAAI,IAAI;IACR;;;OAGG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,SAAS,IAAI;IACb;;OAEG;IACH,aAAa,IAAI;IACjB;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,OAAO,KAAK;IACZ;;OAEG;IACH,QAAQ,KAAK;CACd"}
@@ -1,43 +1,51 @@
1
+ /**
2
+ * Enumeration of object snap modes used in AutoCAD.
3
+ *
4
+ * Object snap modes define the types of geometric points that can be
5
+ * snapped to when drawing or editing entities. These modes help ensure
6
+ * precise positioning and alignment of objects.
7
+ */
1
8
  export var AcDbOsnapMode;
2
9
  (function (AcDbOsnapMode) {
3
10
  /**
4
- * End point
11
+ * End point - snaps to the endpoint of a line, arc, or other entity
5
12
  */
6
13
  AcDbOsnapMode[AcDbOsnapMode["EndPoint"] = 1] = "EndPoint";
7
14
  /**
8
- * Middle point
15
+ * Middle point - snaps to the midpoint of a line or arc
9
16
  */
10
17
  AcDbOsnapMode[AcDbOsnapMode["MidPoint"] = 2] = "MidPoint";
11
18
  /**
12
- * Center
19
+ * Center - snaps to the center point of a circle, arc, or ellipse
13
20
  */
14
21
  AcDbOsnapMode[AcDbOsnapMode["Center"] = 3] = "Center";
15
22
  /**
16
- * Node
23
+ * Node - snaps to a point entity
17
24
  */
18
25
  AcDbOsnapMode[AcDbOsnapMode["Node"] = 4] = "Node";
19
26
  /**
20
- * Quadrant
27
+ * Quadrant - snaps to the quadrant points of a circle or ellipse
28
+ * (0°, 90°, 180°, 270°)
21
29
  */
22
30
  AcDbOsnapMode[AcDbOsnapMode["Quadrant"] = 5] = "Quadrant";
23
31
  /**
24
- * Insertion
32
+ * Insertion - snaps to the insertion point of text, blocks, or other objects
25
33
  */
26
34
  AcDbOsnapMode[AcDbOsnapMode["Insertion"] = 7] = "Insertion";
27
35
  /**
28
- * Perpendicular
36
+ * Perpendicular - snaps to a point perpendicular to a line or arc
29
37
  */
30
38
  AcDbOsnapMode[AcDbOsnapMode["Perpendicular"] = 8] = "Perpendicular";
31
39
  /**
32
- * Tangent
40
+ * Tangent - snaps to a point tangent to a circle or arc
33
41
  */
34
42
  AcDbOsnapMode[AcDbOsnapMode["Tangent"] = 9] = "Tangent";
35
43
  /**
36
- * Nearest
44
+ * Nearest - snaps to the nearest point on an entity
37
45
  */
38
46
  AcDbOsnapMode[AcDbOsnapMode["Nearest"] = 10] = "Nearest";
39
47
  /**
40
- * Center of the object
48
+ * Center of the object - snaps to the centroid or center of mass of an object
41
49
  */
42
50
  AcDbOsnapMode[AcDbOsnapMode["Centroid"] = 11] = "Centroid";
43
51
  })(AcDbOsnapMode || (AcDbOsnapMode = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbOsnapMode.js","sourceRoot":"","sources":["../../src/misc/AcDbOsnapMode.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAyCX;AAzCD,WAAY,aAAa;IACvB;;OAEG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,qDAAU,CAAA;IACV;;OAEG;IACH,iDAAQ,CAAA;IACR;;OAEG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,2DAAa,CAAA;IACb;;OAEG;IACH,mEAAiB,CAAA;IACjB;;OAEG;IACH,uDAAW,CAAA;IACX;;OAEG;IACH,wDAAY,CAAA;IACZ;;OAEG;IACH,0DAAa,CAAA;AACf,CAAC,EAzCW,aAAa,KAAb,aAAa,QAyCxB"}
1
+ {"version":3,"file":"AcDbOsnapMode.js","sourceRoot":"","sources":["../../src/misc/AcDbOsnapMode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,aA0CX;AA1CD,WAAY,aAAa;IACvB;;OAEG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,qDAAU,CAAA;IACV;;OAEG;IACH,iDAAQ,CAAA;IACR;;;OAGG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,2DAAa,CAAA;IACb;;OAEG;IACH,mEAAiB,CAAA;IACjB;;OAEG;IACH,uDAAW,CAAA;IACX;;OAEG;IACH,wDAAY,CAAA;IACZ;;OAEG;IACH,0DAAa,CAAA;AACf,CAAC,EA1CW,aAAa,KAAb,aAAa,QA0CxB"}
@@ -3,58 +3,136 @@ import { AcGiEntity, AcGiRenderer } from '@mlightcad/graphic-interface';
3
3
  import { AcDbBlockTableRecord } from '../database';
4
4
  /**
5
5
  * Internal class used to cache rendered results to avoid duplicated rendering.
6
- * It can be used to improve performance to render block references.
7
- * Because differnt color will result in different material, the block name and
8
- * color are used together to create the key.
6
+ *
7
+ * This class can be used to improve performance when rendering block references.
8
+ * Because different colors will result in different materials, the block name and
9
+ * color are used together to create the cache key.
10
+ *
9
11
  * @internal
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const cache = AcDbRenderingCache.instance;
16
+ * const key = cache.createKey('MyBlock', 0xFF0000);
17
+ * const renderedEntity = cache.draw(renderer, blockRecord, 0xFF0000);
18
+ * ```
10
19
  */
11
20
  export declare class AcDbRenderingCache {
21
+ /** Map of cached rendering results indexed by key */
12
22
  private _blocks;
23
+ /** Singleton instance of the cache */
13
24
  private static _instance?;
25
+ /**
26
+ * Gets the singleton instance of the rendering cache.
27
+ *
28
+ * @returns The singleton instance of AcDbRenderingCache
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * const cache = AcDbRenderingCache.instance;
33
+ * ```
34
+ */
14
35
  static get instance(): AcDbRenderingCache;
36
+ /**
37
+ * Creates a new AcDbRenderingCache instance.
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * const cache = new AcDbRenderingCache();
42
+ * ```
43
+ */
15
44
  constructor();
16
45
  /**
17
- * Create one key by combining the inputted name and the inputted color
18
- * @param name Input the name
19
- * @param color Input the color
46
+ * Creates a cache key by combining the block name and color.
47
+ *
48
+ * @param name - The block name
49
+ * @param color - The color value
50
+ * @returns A unique key for the cache entry
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * const key = cache.createKey('MyBlock', 0xFF0000);
55
+ * // Returns: "MyBlock_16711680"
56
+ * ```
20
57
  */
21
58
  createKey(name: string, color: number): string;
22
59
  /**
23
- * Store rendering results of one block in the cache.
24
- * @param key Input the key of the rendering results
25
- * @param group Input rendering results with specified key
26
- * @returns Return the inputted rendering results
60
+ * Stores rendering results of a block in the cache.
61
+ *
62
+ * @param key - The key for the rendering results
63
+ * @param group - The rendering results to store
64
+ * @returns The stored rendering results (deep cloned)
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const renderedEntity = cache.set(key, entity);
69
+ * ```
27
70
  */
28
71
  set(key: string, group: AcGiEntity): AcGiEntity;
29
72
  /**
30
- * Get rendering results with the specified key
31
- * @param name Input the key of the rendering results
32
- * @return Return rendering results with the specified key if found it.
33
- * Othewise, return undefined.
73
+ * Gets rendering results with the specified key.
74
+ *
75
+ * @param name - The key of the rendering results
76
+ * @returns The rendering results with the specified key, or undefined if not found
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * const cachedEntity = cache.get('MyBlock_16711680');
81
+ * if (cachedEntity) {
82
+ * // Use cached entity
83
+ * }
84
+ * ```
34
85
  */
35
86
  get(name: string): AcGiEntity | undefined;
36
87
  /**
37
- * Return true if the cache contains rendering results with the specified key.
38
- * @param name Input the key of the rendering results
39
- * @return Return true if the cache contains rendering results with the specified
40
- * key. Otherwise, reutrn false.
88
+ * Checks if rendering results with the specified key exist in the cache.
89
+ *
90
+ * @param name - The key to check
91
+ * @returns True if the key exists in the cache, false otherwise
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * if (cache.has('MyBlock_16711680')) {
96
+ * console.log('Cached result found');
97
+ * }
98
+ * ```
41
99
  */
42
100
  has(name: string): boolean;
43
101
  /**
44
- * Remove all of rendering results stored in the cache.
102
+ * Clears all cached rendering results.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * cache.clear();
107
+ * console.log('Cache cleared');
108
+ * ```
45
109
  */
46
110
  clear(): void;
47
111
  /**
48
- * Render the specified the block. If rendering results of the block is already in cache,
49
- * use cached data. Otherwise, render it and store rendered results in cache.
50
- * @param renderer Input renderer used to render the block
51
- * @param blockTableRecord Input the block to render
52
- * @param color Input overriden color when color of entitis in the block is 'ByBlock'. If
53
- * not specified, use color of entities directly.
54
- * @param cache Input the flag whether to cache the rendering results
55
- * @param transform Input matrix transform applied on the block
56
- * @param normal Input extrusion direction of the block
57
- * @returns Return rendering results of the block
112
+ * Draws a block table record and optionally caches the result.
113
+ *
114
+ * This method renders the block table record using the specified renderer
115
+ * and color, and optionally stores the result in the cache for future use.
116
+ *
117
+ * @param renderer - The renderer to use for drawing
118
+ * @param blockTableRecord - The block table record to draw
119
+ * @param color - The color to use for rendering
120
+ * @param cache - Whether to cache the rendering result (default: true)
121
+ * @param transform - Optional transformation matrix to apply
122
+ * @param normal - Optional normal vector
123
+ * @returns The rendered entity
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * const renderedEntity = cache.draw(
128
+ * renderer,
129
+ * blockRecord,
130
+ * 0xFF0000,
131
+ * true,
132
+ * transform,
133
+ * normal
134
+ * );
135
+ * ```
58
136
  */
59
137
  draw(renderer: AcGiRenderer, blockTableRecord: AcDbBlockTableRecord, color: number, cache?: boolean, transform?: AcGeMatrix3d, normal?: AcGeVector3d): AcGiEntity | undefined;
60
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbRenderingCache.d.ts","sourceRoot":"","sources":["../../src/misc/AcDbRenderingCache.ts"],"names":[],"mappings":"A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,CAAC,CAAoB;IAE7C;;;;;;;;;OASG;IACH,MAAM,KAAK,QAAQ,uBAKlB;IAED;;;;;;;OAOG;;IAKH;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAIrC;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU;IAMlC;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM;IAQhB;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM;IAIhB;;;;;;;;OAQG;IACH,KAAK;IAIL;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,IAAI,CACF,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,oBAAoB,EACtC,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,OAAc,EACrB,SAAS,CAAC,EAAE,YAAY,EACxB,MAAM,CAAC,EAAE,YAAY;CAyCxB"}
@@ -12,16 +12,43 @@ var __values = (this && this.__values) || function(o) {
12
12
  import { AcCmColor } from '@mlightcad/common';
13
13
  /**
14
14
  * Internal class used to cache rendered results to avoid duplicated rendering.
15
- * It can be used to improve performance to render block references.
16
- * Because differnt color will result in different material, the block name and
17
- * color are used together to create the key.
15
+ *
16
+ * This class can be used to improve performance when rendering block references.
17
+ * Because different colors will result in different materials, the block name and
18
+ * color are used together to create the cache key.
19
+ *
18
20
  * @internal
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * const cache = AcDbRenderingCache.instance;
25
+ * const key = cache.createKey('MyBlock', 0xFF0000);
26
+ * const renderedEntity = cache.draw(renderer, blockRecord, 0xFF0000);
27
+ * ```
19
28
  */
20
29
  var AcDbRenderingCache = /** @class */ (function () {
30
+ /**
31
+ * Creates a new AcDbRenderingCache instance.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const cache = new AcDbRenderingCache();
36
+ * ```
37
+ */
21
38
  function AcDbRenderingCache() {
22
39
  this._blocks = new Map();
23
40
  }
24
41
  Object.defineProperty(AcDbRenderingCache, "instance", {
42
+ /**
43
+ * Gets the singleton instance of the rendering cache.
44
+ *
45
+ * @returns The singleton instance of AcDbRenderingCache
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * const cache = AcDbRenderingCache.instance;
50
+ * ```
51
+ */
25
52
  get: function () {
26
53
  if (!this._instance) {
27
54
  this._instance = new AcDbRenderingCache();
@@ -32,18 +59,32 @@ var AcDbRenderingCache = /** @class */ (function () {
32
59
  configurable: true
33
60
  });
34
61
  /**
35
- * Create one key by combining the inputted name and the inputted color
36
- * @param name Input the name
37
- * @param color Input the color
62
+ * Creates a cache key by combining the block name and color.
63
+ *
64
+ * @param name - The block name
65
+ * @param color - The color value
66
+ * @returns A unique key for the cache entry
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const key = cache.createKey('MyBlock', 0xFF0000);
71
+ * // Returns: "MyBlock_16711680"
72
+ * ```
38
73
  */
39
74
  AcDbRenderingCache.prototype.createKey = function (name, color) {
40
75
  return "".concat(name, "_").concat(color);
41
76
  };
42
77
  /**
43
- * Store rendering results of one block in the cache.
44
- * @param key Input the key of the rendering results
45
- * @param group Input rendering results with specified key
46
- * @returns Return the inputted rendering results
78
+ * Stores rendering results of a block in the cache.
79
+ *
80
+ * @param key - The key for the rendering results
81
+ * @param group - The rendering results to store
82
+ * @returns The stored rendering results (deep cloned)
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const renderedEntity = cache.set(key, entity);
87
+ * ```
47
88
  */
48
89
  AcDbRenderingCache.prototype.set = function (key, group) {
49
90
  group = group.fastDeepClone();
@@ -51,10 +92,18 @@ var AcDbRenderingCache = /** @class */ (function () {
51
92
  return group;
52
93
  };
53
94
  /**
54
- * Get rendering results with the specified key
55
- * @param name Input the key of the rendering results
56
- * @return Return rendering results with the specified key if found it.
57
- * Othewise, return undefined.
95
+ * Gets rendering results with the specified key.
96
+ *
97
+ * @param name - The key of the rendering results
98
+ * @returns The rendering results with the specified key, or undefined if not found
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * const cachedEntity = cache.get('MyBlock_16711680');
103
+ * if (cachedEntity) {
104
+ * // Use cached entity
105
+ * }
106
+ * ```
58
107
  */
59
108
  AcDbRenderingCache.prototype.get = function (name) {
60
109
  var block = this._blocks.get(name);
@@ -64,31 +113,58 @@ var AcDbRenderingCache = /** @class */ (function () {
64
113
  return block;
65
114
  };
66
115
  /**
67
- * Return true if the cache contains rendering results with the specified key.
68
- * @param name Input the key of the rendering results
69
- * @return Return true if the cache contains rendering results with the specified
70
- * key. Otherwise, reutrn false.
116
+ * Checks if rendering results with the specified key exist in the cache.
117
+ *
118
+ * @param name - The key to check
119
+ * @returns True if the key exists in the cache, false otherwise
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * if (cache.has('MyBlock_16711680')) {
124
+ * console.log('Cached result found');
125
+ * }
126
+ * ```
71
127
  */
72
128
  AcDbRenderingCache.prototype.has = function (name) {
73
129
  return this._blocks.has(name);
74
130
  };
75
131
  /**
76
- * Remove all of rendering results stored in the cache.
132
+ * Clears all cached rendering results.
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * cache.clear();
137
+ * console.log('Cache cleared');
138
+ * ```
77
139
  */
78
140
  AcDbRenderingCache.prototype.clear = function () {
79
141
  this._blocks.clear();
80
142
  };
81
143
  /**
82
- * Render the specified the block. If rendering results of the block is already in cache,
83
- * use cached data. Otherwise, render it and store rendered results in cache.
84
- * @param renderer Input renderer used to render the block
85
- * @param blockTableRecord Input the block to render
86
- * @param color Input overriden color when color of entitis in the block is 'ByBlock'. If
87
- * not specified, use color of entities directly.
88
- * @param cache Input the flag whether to cache the rendering results
89
- * @param transform Input matrix transform applied on the block
90
- * @param normal Input extrusion direction of the block
91
- * @returns Return rendering results of the block
144
+ * Draws a block table record and optionally caches the result.
145
+ *
146
+ * This method renders the block table record using the specified renderer
147
+ * and color, and optionally stores the result in the cache for future use.
148
+ *
149
+ * @param renderer - The renderer to use for drawing
150
+ * @param blockTableRecord - The block table record to draw
151
+ * @param color - The color to use for rendering
152
+ * @param cache - Whether to cache the rendering result (default: true)
153
+ * @param transform - Optional transformation matrix to apply
154
+ * @param normal - Optional normal vector
155
+ * @returns The rendered entity
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * const renderedEntity = cache.draw(
160
+ * renderer,
161
+ * blockRecord,
162
+ * 0xFF0000,
163
+ * true,
164
+ * transform,
165
+ * normal
166
+ * );
167
+ * ```
92
168
  */
93
169
  AcDbRenderingCache.prototype.draw = function (renderer, blockTableRecord, color, cache, transform, normal) {
94
170
  var e_1, _a;
@@ -1 +1 @@
1
- {"version":3,"file":"AcDbRenderingCache.js","sourceRoot":"","sources":["../../src/misc/AcDbRenderingCache.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAM7C;;;;;;GAMG;AACH;IAWE;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAA;IAC1B,CAAC;IATD,sBAAW,8BAAQ;aAAnB;YACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACpB,IAAI,CAAC,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAA;YAC3C,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;;;OAAA;IAMD;;;;OAIG;IACH,sCAAS,GAAT,UAAU,IAAY,EAAE,KAAa;QACnC,OAAO,UAAG,IAAI,cAAI,KAAK,CAAE,CAAA;IAC3B,CAAC;IAED;;;;;OAKG;IACH,gCAAG,GAAH,UAAI,GAAW,EAAE,KAAiB;QAChC,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,CAAA;QAC7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAC5B,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;;;;OAKG;IACH,gC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