@mlightcad/data-model 1.0.0

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 (301) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -0
  3. package/dist/data-model.js +19887 -0
  4. package/dist/data-model.umd.cjs +5 -0
  5. package/lib/base/AcDbHostApplicationServices.d.ts +30 -0
  6. package/lib/base/AcDbHostApplicationServices.d.ts.map +1 -0
  7. package/lib/base/AcDbHostApplicationServices.js +54 -0
  8. package/lib/base/AcDbHostApplicationServices.js.map +1 -0
  9. package/lib/base/AcDbObject.d.ts +70 -0
  10. package/lib/base/AcDbObject.d.ts.map +1 -0
  11. package/lib/base/AcDbObject.js +113 -0
  12. package/lib/base/AcDbObject.js.map +1 -0
  13. package/lib/base/index.d.ts +3 -0
  14. package/lib/base/index.d.ts.map +1 -0
  15. package/lib/base/index.js +3 -0
  16. package/lib/base/index.js.map +1 -0
  17. package/lib/converter/AcDbBatchProcessing.d.ts +43 -0
  18. package/lib/converter/AcDbBatchProcessing.d.ts.map +1 -0
  19. package/lib/converter/AcDbBatchProcessing.js +165 -0
  20. package/lib/converter/AcDbBatchProcessing.js.map +1 -0
  21. package/lib/converter/AcDbDxfConverter.d.ts +39 -0
  22. package/lib/converter/AcDbDxfConverter.d.ts.map +1 -0
  23. package/lib/converter/AcDbDxfConverter.js +567 -0
  24. package/lib/converter/AcDbDxfConverter.js.map +1 -0
  25. package/lib/converter/AcDbDxfParseWorker.d.ts +2 -0
  26. package/lib/converter/AcDbDxfParseWorker.d.ts.map +1 -0
  27. package/lib/converter/AcDbDxfParseWorker.js +6 -0
  28. package/lib/converter/AcDbDxfParseWorker.js.map +1 -0
  29. package/lib/converter/AcDbEntitiyConverter.d.ts +36 -0
  30. package/lib/converter/AcDbEntitiyConverter.d.ts.map +1 -0
  31. package/lib/converter/AcDbEntitiyConverter.js +491 -0
  32. package/lib/converter/AcDbEntitiyConverter.js.map +1 -0
  33. package/lib/converter/AcDbObjectConverter.d.ts +9 -0
  34. package/lib/converter/AcDbObjectConverter.d.ts.map +1 -0
  35. package/lib/converter/AcDbObjectConverter.js +30 -0
  36. package/lib/converter/AcDbObjectConverter.js.map +1 -0
  37. package/lib/converter/index.d.ts +3 -0
  38. package/lib/converter/index.d.ts.map +1 -0
  39. package/lib/converter/index.js +3 -0
  40. package/lib/converter/index.js.map +1 -0
  41. package/lib/database/AcDbBlockTable.d.ts +15 -0
  42. package/lib/database/AcDbBlockTable.d.ts.map +1 -0
  43. package/lib/database/AcDbBlockTable.js +46 -0
  44. package/lib/database/AcDbBlockTable.js.map +1 -0
  45. package/lib/database/AcDbBlockTableRecord.d.ts +49 -0
  46. package/lib/database/AcDbBlockTableRecord.d.ts.map +1 -0
  47. package/lib/database/AcDbBlockTableRecord.js +108 -0
  48. package/lib/database/AcDbBlockTableRecord.js.map +1 -0
  49. package/lib/database/AcDbDatabase.d.ts +211 -0
  50. package/lib/database/AcDbDatabase.d.ts.map +1 -0
  51. package/lib/database/AcDbDatabase.js +395 -0
  52. package/lib/database/AcDbDatabase.js.map +1 -0
  53. package/lib/database/AcDbDatabaseConverter.d.ts +120 -0
  54. package/lib/database/AcDbDatabaseConverter.d.ts.map +1 -0
  55. package/lib/database/AcDbDatabaseConverter.js +376 -0
  56. package/lib/database/AcDbDatabaseConverter.js.map +1 -0
  57. package/lib/database/AcDbDatabaseConverterManager.d.ts +59 -0
  58. package/lib/database/AcDbDatabaseConverterManager.d.ts.map +1 -0
  59. package/lib/database/AcDbDatabaseConverterManager.js +98 -0
  60. package/lib/database/AcDbDatabaseConverterManager.js.map +1 -0
  61. package/lib/database/AcDbDatabaseConverterRegister.d.ts +54 -0
  62. package/lib/database/AcDbDatabaseConverterRegister.d.ts.map +1 -0
  63. package/lib/database/AcDbDatabaseConverterRegister.js +84 -0
  64. package/lib/database/AcDbDatabaseConverterRegister.js.map +1 -0
  65. package/lib/database/AcDbDimStyleTable.d.ts +11 -0
  66. package/lib/database/AcDbDimStyleTable.d.ts.map +1 -0
  67. package/lib/database/AcDbDimStyleTable.js +29 -0
  68. package/lib/database/AcDbDimStyleTable.js.map +1 -0
  69. package/lib/database/AcDbDimStyleTableRecord.d.ts +682 -0
  70. package/lib/database/AcDbDimStyleTableRecord.d.ts.map +1 -0
  71. package/lib/database/AcDbDimStyleTableRecord.js +1250 -0
  72. package/lib/database/AcDbDimStyleTableRecord.js.map +1 -0
  73. package/lib/database/AcDbLayerTable.d.ts +14 -0
  74. package/lib/database/AcDbLayerTable.d.ts.map +1 -0
  75. package/lib/database/AcDbLayerTable.js +55 -0
  76. package/lib/database/AcDbLayerTable.js.map +1 -0
  77. package/lib/database/AcDbLayerTableRecord.d.ts +98 -0
  78. package/lib/database/AcDbLayerTableRecord.d.ts.map +1 -0
  79. package/lib/database/AcDbLayerTableRecord.js +235 -0
  80. package/lib/database/AcDbLayerTableRecord.js.map +1 -0
  81. package/lib/database/AcDbLinetypeTable.d.ts +11 -0
  82. package/lib/database/AcDbLinetypeTable.d.ts.map +1 -0
  83. package/lib/database/AcDbLinetypeTable.js +29 -0
  84. package/lib/database/AcDbLinetypeTable.js.map +1 -0
  85. package/lib/database/AcDbLinetypeTableRecord.d.ts +47 -0
  86. package/lib/database/AcDbLinetypeTableRecord.d.ts.map +1 -0
  87. package/lib/database/AcDbLinetypeTableRecord.js +97 -0
  88. package/lib/database/AcDbLinetypeTableRecord.js.map +1 -0
  89. package/lib/database/AcDbSymbolTable.d.ts +74 -0
  90. package/lib/database/AcDbSymbolTable.d.ts.map +1 -0
  91. package/lib/database/AcDbSymbolTable.js +136 -0
  92. package/lib/database/AcDbSymbolTable.js.map +1 -0
  93. package/lib/database/AcDbSymbolTableRecord.d.ts +16 -0
  94. package/lib/database/AcDbSymbolTableRecord.d.ts.map +1 -0
  95. package/lib/database/AcDbSymbolTableRecord.js +44 -0
  96. package/lib/database/AcDbSymbolTableRecord.js.map +1 -0
  97. package/lib/database/AcDbTextStyleTable.d.ts +14 -0
  98. package/lib/database/AcDbTextStyleTable.d.ts.map +1 -0
  99. package/lib/database/AcDbTextStyleTable.js +78 -0
  100. package/lib/database/AcDbTextStyleTable.js.map +1 -0
  101. package/lib/database/AcDbTextStyleTableRecord.d.ts +67 -0
  102. package/lib/database/AcDbTextStyleTableRecord.d.ts.map +1 -0
  103. package/lib/database/AcDbTextStyleTableRecord.js +166 -0
  104. package/lib/database/AcDbTextStyleTableRecord.js.map +1 -0
  105. package/lib/database/AcDbViewportTable.d.ts +11 -0
  106. package/lib/database/AcDbViewportTable.d.ts.map +1 -0
  107. package/lib/database/AcDbViewportTable.js +29 -0
  108. package/lib/database/AcDbViewportTable.js.map +1 -0
  109. package/lib/database/AcDbViewportTableRecord.d.ts +89 -0
  110. package/lib/database/AcDbViewportTableRecord.d.ts.map +1 -0
  111. package/lib/database/AcDbViewportTableRecord.js +262 -0
  112. package/lib/database/AcDbViewportTableRecord.js.map +1 -0
  113. package/lib/database/index.d.ts +18 -0
  114. package/lib/database/index.d.ts.map +1 -0
  115. package/lib/database/index.js +18 -0
  116. package/lib/database/index.js.map +1 -0
  117. package/lib/entity/AcDbArc.d.ts +67 -0
  118. package/lib/entity/AcDbArc.d.ts.map +1 -0
  119. package/lib/entity/AcDbArc.js +154 -0
  120. package/lib/entity/AcDbArc.js.map +1 -0
  121. package/lib/entity/AcDbBlockReference.d.ts +54 -0
  122. package/lib/entity/AcDbBlockReference.d.ts.map +1 -0
  123. package/lib/entity/AcDbBlockReference.js +168 -0
  124. package/lib/entity/AcDbBlockReference.js.map +1 -0
  125. package/lib/entity/AcDbCircle.d.ts +51 -0
  126. package/lib/entity/AcDbCircle.d.ts.map +1 -0
  127. package/lib/entity/AcDbCircle.js +115 -0
  128. package/lib/entity/AcDbCircle.js.map +1 -0
  129. package/lib/entity/AcDbCurve.d.ts +9 -0
  130. package/lib/entity/AcDbCurve.d.ts.map +1 -0
  131. package/lib/entity/AcDbCurve.js +25 -0
  132. package/lib/entity/AcDbCurve.js.map +1 -0
  133. package/lib/entity/AcDbEllipse.d.ts +53 -0
  134. package/lib/entity/AcDbEllipse.d.ts.map +1 -0
  135. package/lib/entity/AcDbEllipse.js +119 -0
  136. package/lib/entity/AcDbEllipse.js.map +1 -0
  137. package/lib/entity/AcDbEntity.d.ts +103 -0
  138. package/lib/entity/AcDbEntity.d.ts.map +1 -0
  139. package/lib/entity/AcDbEntity.js +292 -0
  140. package/lib/entity/AcDbEntity.js.map +1 -0
  141. package/lib/entity/AcDbHatch.d.ts +116 -0
  142. package/lib/entity/AcDbHatch.d.ts.map +1 -0
  143. package/lib/entity/AcDbHatch.js +200 -0
  144. package/lib/entity/AcDbHatch.js.map +1 -0
  145. package/lib/entity/AcDbLeader.d.ts +94 -0
  146. package/lib/entity/AcDbLeader.d.ts.map +1 -0
  147. package/lib/entity/AcDbLeader.js +217 -0
  148. package/lib/entity/AcDbLeader.js.map +1 -0
  149. package/lib/entity/AcDbLine.d.ts +55 -0
  150. package/lib/entity/AcDbLine.d.ts.map +1 -0
  151. package/lib/entity/AcDbLine.js +158 -0
  152. package/lib/entity/AcDbLine.js.map +1 -0
  153. package/lib/entity/AcDbMText.d.ts +119 -0
  154. package/lib/entity/AcDbMText.d.ts.map +1 -0
  155. package/lib/entity/AcDbMText.js +300 -0
  156. package/lib/entity/AcDbMText.js.map +1 -0
  157. package/lib/entity/AcDbPoint.d.ts +32 -0
  158. package/lib/entity/AcDbPoint.d.ts.map +1 -0
  159. package/lib/entity/AcDbPoint.js +75 -0
  160. package/lib/entity/AcDbPoint.js.map +1 -0
  161. package/lib/entity/AcDbPolyline.d.ts +72 -0
  162. package/lib/entity/AcDbPolyline.d.ts.map +1 -0
  163. package/lib/entity/AcDbPolyline.js +154 -0
  164. package/lib/entity/AcDbPolyline.js.map +1 -0
  165. package/lib/entity/AcDbRasterImage.d.ts +163 -0
  166. package/lib/entity/AcDbRasterImage.d.ts.map +1 -0
  167. package/lib/entity/AcDbRasterImage.js +406 -0
  168. package/lib/entity/AcDbRasterImage.js.map +1 -0
  169. package/lib/entity/AcDbRay.d.ts +42 -0
  170. package/lib/entity/AcDbRay.d.ts.map +1 -0
  171. package/lib/entity/AcDbRay.js +102 -0
  172. package/lib/entity/AcDbRay.js.map +1 -0
  173. package/lib/entity/AcDbSpline.d.ts +37 -0
  174. package/lib/entity/AcDbSpline.d.ts.map +1 -0
  175. package/lib/entity/AcDbSpline.js +71 -0
  176. package/lib/entity/AcDbSpline.js.map +1 -0
  177. package/lib/entity/AcDbTable.d.ts +141 -0
  178. package/lib/entity/AcDbTable.d.ts.map +1 -0
  179. package/lib/entity/AcDbTable.js +358 -0
  180. package/lib/entity/AcDbTable.js.map +1 -0
  181. package/lib/entity/AcDbText.d.ts +110 -0
  182. package/lib/entity/AcDbText.d.ts.map +1 -0
  183. package/lib/entity/AcDbText.js +255 -0
  184. package/lib/entity/AcDbText.js.map +1 -0
  185. package/lib/entity/AcDbTrace.d.ts +64 -0
  186. package/lib/entity/AcDbTrace.d.ts.map +1 -0
  187. package/lib/entity/AcDbTrace.js +145 -0
  188. package/lib/entity/AcDbTrace.js.map +1 -0
  189. package/lib/entity/AcDbViewport.d.ts +58 -0
  190. package/lib/entity/AcDbViewport.d.ts.map +1 -0
  191. package/lib/entity/AcDbViewport.js +179 -0
  192. package/lib/entity/AcDbViewport.js.map +1 -0
  193. package/lib/entity/AcDbWipeout.d.ts +9 -0
  194. package/lib/entity/AcDbWipeout.d.ts.map +1 -0
  195. package/lib/entity/AcDbWipeout.js +40 -0
  196. package/lib/entity/AcDbWipeout.js.map +1 -0
  197. package/lib/entity/AcDbXline.d.ts +42 -0
  198. package/lib/entity/AcDbXline.d.ts.map +1 -0
  199. package/lib/entity/AcDbXline.js +102 -0
  200. package/lib/entity/AcDbXline.js.map +1 -0
  201. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts +46 -0
  202. package/lib/entity/dimension/AcDb3PointAngularDimension.d.ts.map +1 -0
  203. package/lib/entity/dimension/AcDb3PointAngularDimension.js +111 -0
  204. package/lib/entity/dimension/AcDb3PointAngularDimension.js.map +1 -0
  205. package/lib/entity/dimension/AcDbAlignedDimension.d.ts +77 -0
  206. package/lib/entity/dimension/AcDbAlignedDimension.d.ts.map +1 -0
  207. package/lib/entity/dimension/AcDbAlignedDimension.js +203 -0
  208. package/lib/entity/dimension/AcDbAlignedDimension.js.map +1 -0
  209. package/lib/entity/dimension/AcDbArcDimension.d.ts +46 -0
  210. package/lib/entity/dimension/AcDbArcDimension.d.ts.map +1 -0
  211. package/lib/entity/dimension/AcDbArcDimension.js +111 -0
  212. package/lib/entity/dimension/AcDbArcDimension.js.map +1 -0
  213. package/lib/entity/dimension/AcDbDiametricDimension.d.ts +69 -0
  214. package/lib/entity/dimension/AcDbDiametricDimension.d.ts.map +1 -0
  215. package/lib/entity/dimension/AcDbDiametricDimension.js +199 -0
  216. package/lib/entity/dimension/AcDbDiametricDimension.js.map +1 -0
  217. package/lib/entity/dimension/AcDbDimension.d.ts +161 -0
  218. package/lib/entity/dimension/AcDbDimension.d.ts.map +1 -0
  219. package/lib/entity/dimension/AcDbDimension.js +375 -0
  220. package/lib/entity/dimension/AcDbDimension.js.map +1 -0
  221. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts +44 -0
  222. package/lib/entity/dimension/AcDbOrdinateDimension.d.ts.map +1 -0
  223. package/lib/entity/dimension/AcDbOrdinateDimension.js +99 -0
  224. package/lib/entity/dimension/AcDbOrdinateDimension.js.map +1 -0
  225. package/lib/entity/dimension/AcDbRadialDimension.d.ts +69 -0
  226. package/lib/entity/dimension/AcDbRadialDimension.d.ts.map +1 -0
  227. package/lib/entity/dimension/AcDbRadialDimension.js +148 -0
  228. package/lib/entity/dimension/AcDbRadialDimension.js.map +1 -0
  229. package/lib/entity/dimension/index.d.ts +8 -0
  230. package/lib/entity/dimension/index.d.ts.map +1 -0
  231. package/lib/entity/dimension/index.js +8 -0
  232. package/lib/entity/dimension/index.js.map +1 -0
  233. package/lib/entity/index.d.ts +23 -0
  234. package/lib/entity/index.d.ts.map +1 -0
  235. package/lib/entity/index.js +23 -0
  236. package/lib/entity/index.js.map +1 -0
  237. package/lib/index.d.ts +10 -0
  238. package/lib/index.d.ts.map +1 -0
  239. package/lib/index.js +10 -0
  240. package/lib/index.js.map +1 -0
  241. package/lib/misc/AcDbAngleUnits.d.ts +8 -0
  242. package/lib/misc/AcDbAngleUnits.d.ts.map +1 -0
  243. package/lib/misc/AcDbAngleUnits.js +9 -0
  244. package/lib/misc/AcDbAngleUnits.js.map +1 -0
  245. package/lib/misc/AcDbConstants.d.ts +4 -0
  246. package/lib/misc/AcDbConstants.d.ts.map +1 -0
  247. package/lib/misc/AcDbConstants.js +4 -0
  248. package/lib/misc/AcDbConstants.js.map +1 -0
  249. package/lib/misc/AcDbDimArrowType.d.ts +86 -0
  250. package/lib/misc/AcDbDimArrowType.d.ts.map +1 -0
  251. package/lib/misc/AcDbDimArrowType.js +87 -0
  252. package/lib/misc/AcDbDimArrowType.js.map +1 -0
  253. package/lib/misc/AcDbObjectIterator.d.ts +16 -0
  254. package/lib/misc/AcDbObjectIterator.d.ts.map +1 -0
  255. package/lib/misc/AcDbObjectIterator.js +28 -0
  256. package/lib/misc/AcDbObjectIterator.js.map +1 -0
  257. package/lib/misc/AcDbOsnapMode.d.ts +43 -0
  258. package/lib/misc/AcDbOsnapMode.d.ts.map +1 -0
  259. package/lib/misc/AcDbOsnapMode.js +44 -0
  260. package/lib/misc/AcDbOsnapMode.js.map +1 -0
  261. package/lib/misc/AcDbRenderingCache.d.ts +61 -0
  262. package/lib/misc/AcDbRenderingCache.d.ts.map +1 -0
  263. package/lib/misc/AcDbRenderingCache.js +154 -0
  264. package/lib/misc/AcDbRenderingCache.js.map +1 -0
  265. package/lib/misc/AcDbUnitsValue.d.ts +51 -0
  266. package/lib/misc/AcDbUnitsValue.d.ts.map +1 -0
  267. package/lib/misc/AcDbUnitsValue.js +71 -0
  268. package/lib/misc/AcDbUnitsValue.js.map +1 -0
  269. package/lib/misc/index.d.ts +8 -0
  270. package/lib/misc/index.d.ts.map +1 -0
  271. package/lib/misc/index.js +8 -0
  272. package/lib/misc/index.js.map +1 -0
  273. package/lib/object/AcDbDictionary.d.ts +80 -0
  274. package/lib/object/AcDbDictionary.d.ts.map +1 -0
  275. package/lib/object/AcDbDictionary.js +144 -0
  276. package/lib/object/AcDbDictionary.js.map +1 -0
  277. package/lib/object/AcDbRasterImageDef.d.ts +25 -0
  278. package/lib/object/AcDbRasterImageDef.d.ts.map +1 -0
  279. package/lib/object/AcDbRasterImageDef.js +54 -0
  280. package/lib/object/AcDbRasterImageDef.js.map +1 -0
  281. package/lib/object/index.d.ts +4 -0
  282. package/lib/object/index.d.ts.map +1 -0
  283. package/lib/object/index.js +4 -0
  284. package/lib/object/index.js.map +1 -0
  285. package/lib/object/layout/AcDbLayout.d.ts +51 -0
  286. package/lib/object/layout/AcDbLayout.d.ts.map +1 -0
  287. package/lib/object/layout/AcDbLayout.js +120 -0
  288. package/lib/object/layout/AcDbLayout.js.map +1 -0
  289. package/lib/object/layout/AcDbLayoutDictionary.d.ts +19 -0
  290. package/lib/object/layout/AcDbLayoutDictionary.d.ts.map +1 -0
  291. package/lib/object/layout/AcDbLayoutDictionary.js +94 -0
  292. package/lib/object/layout/AcDbLayoutDictionary.js.map +1 -0
  293. package/lib/object/layout/AcDbLayoutManager.d.ts +101 -0
  294. package/lib/object/layout/AcDbLayoutManager.d.ts.map +1 -0
  295. package/lib/object/layout/AcDbLayoutManager.js +154 -0
  296. package/lib/object/layout/AcDbLayoutManager.js.map +1 -0
  297. package/lib/object/layout/index.d.ts +4 -0
  298. package/lib/object/layout/index.d.ts.map +1 -0
  299. package/lib/object/layout/index.js +4 -0
  300. package/lib/object/layout/index.js.map +1 -0
  301. package/package.json +46 -0
@@ -0,0 +1,200 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { AcGeArea2d, AcGeBox3d } from '@mlightcad/geometry-engine';
17
+ import { AcDbEntity } from './AcDbEntity';
18
+ /**
19
+ * Hatch pattern type
20
+ */
21
+ export var AcDbHatchPatternType;
22
+ (function (AcDbHatchPatternType) {
23
+ /**
24
+ * A user-defined pattern provides a direct method to define a simple hatch pattern using a specified
25
+ * hatch entity linetype. The definition data for user-defined hatch pattern include angle, space and
26
+ * double. "Angle" specifies an angle for the hatch pattern relative to the X axis of the hatch plane
27
+ * in OCS. "Space" defines the vertical distance between two consecutive pattern lines. "Double"
28
+ * specifies that a second set of lines is to be drawn at 90 degrees to the original lines. When
29
+ * specifying a user-defined hatch pattern, you don't need to set the pattern name. AutoCAD designates
30
+ * a default pattern name "U" for all user-defined patterns.
31
+ */
32
+ AcDbHatchPatternType[AcDbHatchPatternType["UserDefined"] = 0] = "UserDefined";
33
+ /**
34
+ * A predefined pattern type allows you to select a hatch pattern from the AutoCAD standard hatch
35
+ * pattern file acad.pat in the "support" directory. The file contains many predefined hatch patterns,
36
+ * including ANGLE, ANSI31, BRICK, CLAY, etc. When you use a predefined pattern, you can also specify
37
+ * a scale and angle in order to modify the hatch's appearance. Solid fill is a new predefined pattern
38
+ * type that enables the application to fill in the hatch area with a specified color. The reserved
39
+ * name for this new pattern is "SOLID." SOLID does not appear in the file acad.pat because it has no
40
+ * definition data. To specify a solid, use the keyword "SOLID".
41
+ */
42
+ AcDbHatchPatternType[AcDbHatchPatternType["Predefined"] = 1] = "Predefined";
43
+ /**
44
+ * A custom-defined pattern type stores the pattern in its own PAT file, in which the name of the
45
+ * hatch pattern must match the name of the file. For instance, you must store the TEST hatch pattern
46
+ * in a file named test.pat, and the file must be located in the ACAD search path. When you use a
47
+ * custom-defined pattern, you can also specify a scale and angle in order to modify the hatch's
48
+ * appearance.
49
+ */
50
+ AcDbHatchPatternType[AcDbHatchPatternType["Custom"] = 2] = "Custom";
51
+ })(AcDbHatchPatternType || (AcDbHatchPatternType = {}));
52
+ /**
53
+ * Hatch style
54
+ */
55
+ export var AcDbHatchStyle;
56
+ (function (AcDbHatchStyle) {
57
+ /**
58
+ * Normal hatch style will hatch inward from the outer loop. If it encounters an internal intersection,
59
+ * it turns off hatching until it encounters another intersection. Thus, areas separated from the
60
+ * outside of the hatched area by an odd number of intersections are hatched, while areas separated by
61
+ * an even number of intersections are not.
62
+ */
63
+ AcDbHatchStyle[AcDbHatchStyle["Normal"] = 0] = "Normal";
64
+ /**
65
+ * Outer hatch style will hatch inward from the outer loop. It turns off hatching if it encounters an
66
+ * intersection and does not turn it back on. Because this process starts from both ends of each hatch
67
+ * line, only the outmost level of the structure is hatched, and the internal structure is left blank.
68
+ */
69
+ AcDbHatchStyle[AcDbHatchStyle["Outer"] = 1] = "Outer";
70
+ /**
71
+ * Ignore hatch style will hatch inward from the outer loop and ignores all internal loops.
72
+ */
73
+ AcDbHatchStyle[AcDbHatchStyle["Ignore"] = 2] = "Ignore";
74
+ })(AcDbHatchStyle || (AcDbHatchStyle = {}));
75
+ /**
76
+ * The class represents the hatch entity in AutoCAD.
77
+ */
78
+ var AcDbHatch = /** @class */ (function (_super) {
79
+ __extends(AcDbHatch, _super);
80
+ /**
81
+ * Create one empty polyline
82
+ */
83
+ function AcDbHatch() {
84
+ var _this = _super.call(this) || this;
85
+ _this._elevation = 0;
86
+ _this._geo = new AcGeArea2d();
87
+ _this._definitionLines = [];
88
+ _this._patternName = '';
89
+ _this._patternType = AcDbHatchPatternType.Predefined;
90
+ _this._patternAngle = 0;
91
+ _this._patternScale = 1;
92
+ _this._hatchStyle = AcDbHatchStyle.Normal;
93
+ return _this;
94
+ }
95
+ Object.defineProperty(AcDbHatch.prototype, "definitionLines", {
96
+ get: function () {
97
+ return this._definitionLines;
98
+ },
99
+ enumerable: false,
100
+ configurable: true
101
+ });
102
+ Object.defineProperty(AcDbHatch.prototype, "patternName", {
103
+ /**
104
+ * The pattern name of this hatch.
105
+ */
106
+ get: function () {
107
+ return this._patternName;
108
+ },
109
+ set: function (value) {
110
+ this._patternName = value;
111
+ },
112
+ enumerable: false,
113
+ configurable: true
114
+ });
115
+ Object.defineProperty(AcDbHatch.prototype, "patternType", {
116
+ /**
117
+ * The pattern name of this hatch.
118
+ */
119
+ get: function () {
120
+ return this._patternType;
121
+ },
122
+ set: function (value) {
123
+ this._patternType = value;
124
+ },
125
+ enumerable: false,
126
+ configurable: true
127
+ });
128
+ Object.defineProperty(AcDbHatch.prototype, "patternAngle", {
129
+ /**
130
+ * The pattern angle (in radians) of this hatch.
131
+ */
132
+ get: function () {
133
+ return this._patternAngle;
134
+ },
135
+ set: function (value) {
136
+ this._patternAngle = value;
137
+ },
138
+ enumerable: false,
139
+ configurable: true
140
+ });
141
+ Object.defineProperty(AcDbHatch.prototype, "patternScale", {
142
+ /**
143
+ * The pattern scale of the hatch entity. It is a non-zero positive number.
144
+ */
145
+ get: function () {
146
+ return this._patternScale;
147
+ },
148
+ set: function (value) {
149
+ this._patternScale = value;
150
+ },
151
+ enumerable: false,
152
+ configurable: true
153
+ });
154
+ Object.defineProperty(AcDbHatch.prototype, "hatchStyle", {
155
+ /**
156
+ * The pattern style of the hatch entity.
157
+ */
158
+ get: function () {
159
+ return this._hatchStyle;
160
+ },
161
+ set: function (value) {
162
+ this._hatchStyle = value;
163
+ },
164
+ enumerable: false,
165
+ configurable: true
166
+ });
167
+ /**
168
+ * Append one loop to loops of this area. If it is the first loop added, it is the outter loop.
169
+ * Otherwise, it is an inner loop.
170
+ * @param loop Input the loop to append
171
+ */
172
+ AcDbHatch.prototype.add = function (loop) {
173
+ this._geo.add(loop);
174
+ };
175
+ Object.defineProperty(AcDbHatch.prototype, "geometricExtents", {
176
+ /**
177
+ * @inheritdoc
178
+ */
179
+ get: function () {
180
+ var box = this._geo.box;
181
+ return new AcGeBox3d({ x: box.min.x, y: box.min.y, z: this._elevation }, { x: box.max.x, y: box.max.y, z: this._elevation });
182
+ },
183
+ enumerable: false,
184
+ configurable: true
185
+ });
186
+ /**
187
+ * @inheritdoc
188
+ */
189
+ AcDbHatch.prototype.draw = function (renderer) {
190
+ return renderer.area(this._geo, {
191
+ color: this.rgbColor,
192
+ solidFill: false,
193
+ patternAngle: this.patternAngle,
194
+ patternLines: this.definitionLines
195
+ });
196
+ };
197
+ return AcDbHatch;
198
+ }(AcDbEntity));
199
+ export { AcDbHatch };
200
+ //# sourceMappingURL=AcDbHatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcDbHatch.js","sourceRoot":"","sources":["../../src/entity/AcDbHatch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAEV,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC;;GAEG;AACH,MAAM,CAAN,IAAY,oBA6BX;AA7BD,WAAY,oBAAoB;IAC9B;;;;;;;;OAQG;IACH,6EAAe,CAAA;IACf;;;;;;;;OAQG;IACH,2EAAc,CAAA;IACd;;;;;;OAMG;IACH,mEAAU,CAAA;AACZ,CAAC,EA7BW,oBAAoB,KAApB,oBAAoB,QA6B/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAkBX;AAlBD,WAAY,cAAc;IACxB;;;;;OAKG;IACH,uDAAU,CAAA;IACV;;;;OAIG;IACH,qDAAS,CAAA;IACT;;OAEG;IACH,uDAAU,CAAA;AACZ,CAAC,EAlBW,cAAc,KAAd,cAAc,QAkBzB;AAED;;GAEG;AACH;IAA+B,6BAAU;IAUvC;;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;aACH;YACE,OAAO,IAAI,CAAC,WAAW,CAAA;QACzB,CAAC;aACD,UAAe,KAAqB;YAClC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;QAC1B,CAAC;;;OAHA;IAKD;;;;OAIG;IACH,uBAAG,GAAH,UAAI,IAAoB;QACtB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;IAKD,sBAAI,uCAAgB;QAHpB;;WAEG;aACH;YACE,IAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAA;YACzB,OAAO,IAAI,SAAS,CAClB,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,EAClD,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,CACnD,CAAA;QACH,CAAC;;;OAAA;IAED;;OAEG;IACH,wBAAI,GAAJ,UAAK,QAAsB;QACzB,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAC9B,KAAK,EAAE,IAAI,CAAC,QAAQ;YACpB,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,YAAY,EAAE,IAAI,CAAC,eAAe;SACnC,CAAC,CAAA;IACJ,CAAC;IACH,gBAAC;AAAD,CAAC,AA9GD,CAA+B,UAAU,GA8GxC"}
@@ -0,0 +1,94 @@
1
+ import { AcGeBox3d, AcGePoint3dLike } from '@mlightcad/geometry-engine';
2
+ import { AcGiRenderer } from '@mlightcad/graphic-interface';
3
+ import { AcDbCurve } from './AcDbCurve';
4
+ export declare enum AcDbLeaderAnnotationType {
5
+ MText = 0,
6
+ Fcf = 1,
7
+ BlockReference = 2,
8
+ NoAnnotation = 3
9
+ }
10
+ /**
11
+ * The class represents the LEADER entity within AutoCAD. Leaders are considered as dimensions in AutoCAD,
12
+ * which means they are controlled by dimension variable settings and dimension styles.
13
+ */
14
+ export declare class AcDbLeader extends AcDbCurve {
15
+ private _isSplined;
16
+ private _splineGeo?;
17
+ private _updated;
18
+ private _hasArrowHead;
19
+ private _vertices;
20
+ private _dimensionStyle;
21
+ private _hasHookLine;
22
+ private _annoType;
23
+ /**
24
+ * Construct an instance of the leader entity.
25
+ */
26
+ constructor();
27
+ /**
28
+ * Return true if this leader is spline-fit. Otherwise return false.
29
+ */
30
+ get isSplined(): boolean;
31
+ set isSplined(value: boolean);
32
+ /**
33
+ * Return true if arrowhead is currently enabled for this leader. Otherwise return false.
34
+ */
35
+ get hasArrowHead(): boolean;
36
+ set hasArrowHead(value: boolean);
37
+ /**
38
+ * Return true if this leader has a hookline. Otherwise return false. The "hookline" is the small
39
+ * horizontal line at the end of the leader line just before the annotation.
40
+ */
41
+ get hasHookLine(): boolean;
42
+ set hasHookLine(value: boolean);
43
+ /**
44
+ * The number of vertices in the leader's vertex list.
45
+ */
46
+ get numVertices(): number;
47
+ /**
48
+ * The dimension style applied on this leader
49
+ */
50
+ get dimensionStyle(): string;
51
+ set dimensionStyle(value: string);
52
+ /**
53
+ * The leader's annotation type.
54
+ */
55
+ get annoType(): AcDbLeaderAnnotationType;
56
+ set annoType(value: AcDbLeaderAnnotationType);
57
+ /**
58
+ * Appends vertex to the end of the vertex list for this leader. If vertex is not in the plane of the
59
+ * leader, then it will be projected parallel the leader's normal onto the leader's plane and the
60
+ * projection will be appended to the leader's vertex list. If the new vertex is too close to the one
61
+ * next to it (that is, within 1.e-10 for X, Y, and Z), the new vertex will not be appended.
62
+ * @param point Input point (in WCS coordinates) to add to the vertex list
63
+ */
64
+ appendVertex(point: AcGePoint3dLike): void;
65
+ /**
66
+ * Reset the vertex at index to the point point projected (along the plane normal) onto the plane
67
+ * containing the leader. It doesn't reset the vertex if that would cause one of the segments to
68
+ * become zero length (within 1e-10).
69
+ * @param index Input index number (0 based) of the vertex to change
70
+ * @param point Input new point value (in WCS) to use
71
+ */
72
+ setVertexAt(index: number, point: AcGePoint3dLike): void;
73
+ /**
74
+ * Get the point that is the vertex at the location index (0 based) in this leader's vertex array.
75
+ * @param index Input index number (0 based) of the vertex desired
76
+ */
77
+ vertexAt(index: number): void;
78
+ /**
79
+ * @inheritdoc
80
+ */
81
+ get geometricExtents(): AcGeBox3d;
82
+ /**
83
+ * @inheritdoc
84
+ */
85
+ get closed(): boolean;
86
+ set closed(_value: boolean);
87
+ /**
88
+ * @inheritdoc
89
+ */
90
+ draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
91
+ private get splineGeo();
92
+ private createSplineIfNeeded;
93
+ }
94
+ //# sourceMappingURL=AcDbLeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcDbLeader.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbLeader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,eAAe,EAEhB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,oBAAY,wBAAwB;IAClC,KAAK,IAAI;IACT,GAAG,IAAI;IACP,cAAc,IAAI;IAClB,YAAY,IAAI;CACjB;AAED;;;GAGG;AACH,qBAAa,UAAW,SAAQ,SAAS;IACvC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAe;IAChC,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,SAAS,CAA0B;IAE3C;;OAEG;;IAYH;;OAEG;IACH,IAAI,SAAS,IAGQ,OAAO,CAD3B;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAE3B;IAED;;OAEG;IACH,IAAI,YAAY,IAGQ,OAAO,CAD9B;IACD,IAAI,YAAY,CAAC,KAAK,EAAE,OAAO,EAE9B;IAED;;;OAGG;IACH,IAAI,WAAW,IAGQ,OAAO,CAD7B;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,OAAO,EAE7B;IAED;;OAEG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IAED;;OAEG;IACH,IAAI,cAAc,IAGQ,MAAM,CAD/B;IACD,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,EAE/B;IAED;;OAEG;IACH,IAAI,QAAQ,IAGQ,wBAAwB,CAD3C;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,wBAAwB,EAE3C;IAED;;;;;;OAMG;IACH,YAAY,CAAC,KAAK,EAAE,eAAe;IAKnC;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe;IASjD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM;IAOtB;;OAEG;IACH,IAAI,gBAAgB,cAOnB;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAEzB;IAED;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;IAS3B,OAAO,KAAK,SAAS,GAGpB;IAED,OAAO,CAAC,oBAAoB;CAU7B"}
@@ -0,0 +1,217 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { AcGeBox3d, AcGePoint3d, AcGeSpline3d } from '@mlightcad/geometry-engine';
17
+ import { AcDbCurve } from './AcDbCurve';
18
+ export var AcDbLeaderAnnotationType;
19
+ (function (AcDbLeaderAnnotationType) {
20
+ AcDbLeaderAnnotationType[AcDbLeaderAnnotationType["MText"] = 0] = "MText";
21
+ AcDbLeaderAnnotationType[AcDbLeaderAnnotationType["Fcf"] = 1] = "Fcf";
22
+ AcDbLeaderAnnotationType[AcDbLeaderAnnotationType["BlockReference"] = 2] = "BlockReference";
23
+ AcDbLeaderAnnotationType[AcDbLeaderAnnotationType["NoAnnotation"] = 3] = "NoAnnotation";
24
+ })(AcDbLeaderAnnotationType || (AcDbLeaderAnnotationType = {}));
25
+ /**
26
+ * The class represents the LEADER entity within AutoCAD. Leaders are considered as dimensions in AutoCAD,
27
+ * which means they are controlled by dimension variable settings and dimension styles.
28
+ */
29
+ var AcDbLeader = /** @class */ (function (_super) {
30
+ __extends(AcDbLeader, _super);
31
+ /**
32
+ * Construct an instance of the leader entity.
33
+ */
34
+ function AcDbLeader() {
35
+ var _this = _super.call(this) || this;
36
+ _this._isSplined = false;
37
+ _this._updated = false;
38
+ _this._hasArrowHead = false;
39
+ _this._vertices = [];
40
+ _this._dimensionStyle = '';
41
+ _this._hasHookLine = false;
42
+ _this._annoType = AcDbLeaderAnnotationType.NoAnnotation;
43
+ return _this;
44
+ }
45
+ Object.defineProperty(AcDbLeader.prototype, "isSplined", {
46
+ /**
47
+ * Return true if this leader is spline-fit. Otherwise return false.
48
+ */
49
+ get: function () {
50
+ return this._isSplined;
51
+ },
52
+ set: function (value) {
53
+ this._isSplined = value;
54
+ },
55
+ enumerable: false,
56
+ configurable: true
57
+ });
58
+ Object.defineProperty(AcDbLeader.prototype, "hasArrowHead", {
59
+ /**
60
+ * Return true if arrowhead is currently enabled for this leader. Otherwise return false.
61
+ */
62
+ get: function () {
63
+ return this._hasArrowHead;
64
+ },
65
+ set: function (value) {
66
+ this._hasArrowHead = value;
67
+ },
68
+ enumerable: false,
69
+ configurable: true
70
+ });
71
+ Object.defineProperty(AcDbLeader.prototype, "hasHookLine", {
72
+ /**
73
+ * Return true if this leader has a hookline. Otherwise return false. The "hookline" is the small
74
+ * horizontal line at the end of the leader line just before the annotation.
75
+ */
76
+ get: function () {
77
+ return this._hasHookLine;
78
+ },
79
+ set: function (value) {
80
+ this._hasHookLine = value;
81
+ },
82
+ enumerable: false,
83
+ configurable: true
84
+ });
85
+ Object.defineProperty(AcDbLeader.prototype, "numVertices", {
86
+ /**
87
+ * The number of vertices in the leader's vertex list.
88
+ */
89
+ get: function () {
90
+ return this._vertices.length;
91
+ },
92
+ enumerable: false,
93
+ configurable: true
94
+ });
95
+ Object.defineProperty(AcDbLeader.prototype, "dimensionStyle", {
96
+ /**
97
+ * The dimension style applied on this leader
98
+ */
99
+ get: function () {
100
+ return this._dimensionStyle;
101
+ },
102
+ set: function (value) {
103
+ this._dimensionStyle = value;
104
+ },
105
+ enumerable: false,
106
+ configurable: true
107
+ });
108
+ Object.defineProperty(AcDbLeader.prototype, "annoType", {
109
+ /**
110
+ * The leader's annotation type.
111
+ */
112
+ get: function () {
113
+ return this._annoType;
114
+ },
115
+ set: function (value) {
116
+ this._annoType = value;
117
+ },
118
+ enumerable: false,
119
+ configurable: true
120
+ });
121
+ /**
122
+ * Appends vertex to the end of the vertex list for this leader. If vertex is not in the plane of the
123
+ * leader, then it will be projected parallel the leader's normal onto the leader's plane and the
124
+ * projection will be appended to the leader's vertex list. If the new vertex is too close to the one
125
+ * next to it (that is, within 1.e-10 for X, Y, and Z), the new vertex will not be appended.
126
+ * @param point Input point (in WCS coordinates) to add to the vertex list
127
+ */
128
+ AcDbLeader.prototype.appendVertex = function (point) {
129
+ this._vertices.push(new AcGePoint3d().copy(point));
130
+ this._updated = true;
131
+ };
132
+ /**
133
+ * Reset the vertex at index to the point point projected (along the plane normal) onto the plane
134
+ * containing the leader. It doesn't reset the vertex if that would cause one of the segments to
135
+ * become zero length (within 1e-10).
136
+ * @param index Input index number (0 based) of the vertex to change
137
+ * @param point Input new point value (in WCS) to use
138
+ */
139
+ AcDbLeader.prototype.setVertexAt = function (index, point) {
140
+ if (index < 0 || index >= this._vertices.length) {
141
+ // TODO: Project the point onto the plane containing the leader
142
+ this._vertices[index].copy(point);
143
+ this._updated = true;
144
+ }
145
+ throw new Error('The vertex index is out of range!');
146
+ };
147
+ /**
148
+ * Get the point that is the vertex at the location index (0 based) in this leader's vertex array.
149
+ * @param index Input index number (0 based) of the vertex desired
150
+ */
151
+ AcDbLeader.prototype.vertexAt = function (index) {
152
+ if (index < 0 || index >= this._vertices.length) {
153
+ this._vertices[index];
154
+ }
155
+ throw new Error('The vertex index is out of range!');
156
+ };
157
+ Object.defineProperty(AcDbLeader.prototype, "geometricExtents", {
158
+ /**
159
+ * @inheritdoc
160
+ */
161
+ get: function () {
162
+ if (this._isSplined && this.splineGeo) {
163
+ return this.splineGeo.calculateBoundingBox();
164
+ }
165
+ else {
166
+ var box = new AcGeBox3d();
167
+ return box.setFromPoints(this._vertices);
168
+ }
169
+ },
170
+ enumerable: false,
171
+ configurable: true
172
+ });
173
+ Object.defineProperty(AcDbLeader.prototype, "closed", {
174
+ /**
175
+ * @inheritdoc
176
+ */
177
+ get: function () {
178
+ return false;
179
+ },
180
+ set: function (_value) {
181
+ // TODO: Not sure whether the leader really support setting value of property 'closed'
182
+ },
183
+ enumerable: false,
184
+ configurable: true
185
+ });
186
+ /**
187
+ * @inheritdoc
188
+ */
189
+ AcDbLeader.prototype.draw = function (renderer) {
190
+ if (this.isSplined && this.splineGeo) {
191
+ var points = this.splineGeo.getPoints(100);
192
+ return renderer.lines(points, this.lineStyle);
193
+ }
194
+ else {
195
+ return renderer.lines(this._vertices, this.lineStyle);
196
+ }
197
+ };
198
+ Object.defineProperty(AcDbLeader.prototype, "splineGeo", {
199
+ get: function () {
200
+ this.createSplineIfNeeded();
201
+ return this._splineGeo;
202
+ },
203
+ enumerable: false,
204
+ configurable: true
205
+ });
206
+ AcDbLeader.prototype.createSplineIfNeeded = function () {
207
+ if (this.isSplined &&
208
+ this.numVertices >= 2 &&
209
+ (this._splineGeo == null || this._updated)) {
210
+ this._splineGeo = new AcGeSpline3d(this._vertices, 'Uniform');
211
+ this._updated = false;
212
+ }
213
+ };
214
+ return AcDbLeader;
215
+ }(AcDbCurve));
216
+ export { AcDbLeader };
217
+ //# sourceMappingURL=AcDbLeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcDbLeader.js","sourceRoot":"","sources":["../../src/entity/AcDbLeader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,WAAW,EAEX,YAAY,EACb,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,CAAN,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,yEAAS,CAAA;IACT,qEAAO,CAAA;IACP,2FAAkB,CAAA;IAClB,uFAAgB,CAAA;AAClB,CAAC,EALW,wBAAwB,KAAxB,wBAAwB,QAKnC;AAED;;;GAGG;AACH;IAAgC,8BAAS;IAUvC;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,UAAU,GAAG,KAAK,CAAA;QACvB,KAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;QACrB,KAAI,CAAC,aAAa,GAAG,KAAK,CAAA;QAC1B,KAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,KAAI,CAAC,eAAe,GAAG,EAAE,CAAA;QACzB,KAAI,CAAC,YAAY,GAAG,KAAK,CAAA;QACzB,KAAI,CAAC,SAAS,GAAG,wBAAwB,CAAC,YAAY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AO,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QAC/C,CAAC;aAAM,CAAC;YACN,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;QACvD,CAAC;IACH,CAAC;IAED,sBAAY,iCAAS;aAArB;YACE,IAAI,CAAC,oBAAoB,EAAE,CAAA;YAC3B,OAAO,IAAI,CAAC,UAAU,CAAA;QACxB,CAAC;;;OAAA;IAEO,yCAAoB,GAA5B;QACE,IACE,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,WAAW,IAAI,CAAC;YACrB,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,EAC1C,CAAC;YACD,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;YAC7D,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;QACvB,CAAC;IACH,CAAC;IACH,iBAAC;AAAD,CAAC,AA1KD,CAAgC,SAAS,GA0KxC"}
@@ -0,0 +1,55 @@
1
+ import { AcGeBox3d, AcGeMatrix3d, AcGePoint3d, AcGePoint3dLike } from '@mlightcad/geometry-engine';
2
+ import { AcGiRenderer } from '@mlightcad/graphic-interface';
3
+ import { AcDbOsnapMode } from '../misc/AcDbOsnapMode';
4
+ import { AcDbCurve } from './AcDbCurve';
5
+ /**
6
+ * The class represents the line entity in AutoCAD. A line object is a 3d object
7
+ * that is specified by its start point, endpoint, and normal vector.
8
+ */
9
+ export declare class AcDbLine extends AcDbCurve {
10
+ private _geo;
11
+ /**
12
+ * This constructor initializes the line object to use start as the start point, and end
13
+ * as the endpoint. Both points must be in WCS coordinates.
14
+ */
15
+ constructor(start: AcGePoint3dLike, end: AcGePoint3dLike);
16
+ /**
17
+ * The starting point of this line.
18
+ */
19
+ get startPoint(): AcGePoint3d;
20
+ set startPoint(value: AcGePoint3dLike);
21
+ /**
22
+ * The end point of this line.
23
+ */
24
+ get endPoint(): AcGePoint3d;
25
+ set endPoint(value: AcGePoint3dLike);
26
+ /**
27
+ * The middle point of this line.
28
+ */
29
+ get midPoint(): AcGePoint3d;
30
+ /**
31
+ * @inheritdoc
32
+ */
33
+ get geometricExtents(): AcGeBox3d;
34
+ /**
35
+ * @inheritdoc
36
+ */
37
+ get closed(): boolean;
38
+ /**
39
+ * @inheritdoc
40
+ */
41
+ subGetGripPoints(): AcGePoint3d[];
42
+ /**
43
+ * @inheritdoc
44
+ */
45
+ subGetOsnapPoints(osnapMode: AcDbOsnapMode, _gsSelectionMark: number, pickPoint: AcGePoint3d, _lastPoint: AcGePoint3d, snapPoints: AcGePoint3d[]): void;
46
+ /**
47
+ * @inheritdoc
48
+ */
49
+ transformBy(matrix: AcGeMatrix3d): this;
50
+ /**
51
+ * @inheritdoc
52
+ */
53
+ draw(renderer: AcGiRenderer): import("@mlightcad/graphic-interface").AcGiEntity;
54
+ }
55
+ //# sourceMappingURL=AcDbLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcDbLine.d.ts","sourceRoot":"","sources":["../../src/entity/AcDbLine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,YAAY,EACZ,WAAW,EACX,eAAe,EAChB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;GAGG;AACH,qBAAa,QAAS,SAAQ,SAAS;IACrC,OAAO,CAAC,IAAI,CAAY;IACxB;;;OAGG;gBACS,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe;IAKxD;;OAEG;IACH,IAAI,UAAU,IAAI,WAAW,CAE5B;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,eAAe,EAEpC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAE1B;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,eAAe,EAElC;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,SAAS,CAEhC;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,gBAAgB;IAQhB;;OAEG;IACH,iBAAiB,CACf,SAAS,EAAE,aAAa,EACxB,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EAAE;IAoC3B;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,YAAY;IAKhC;;OAEG;IACH,IAAI,CAAC,QAAQ,EAAE,YAAY;CAS5B"}