@mlightcad/cad-simple-viewer 1.4.11 → 1.4.13

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 (321) hide show
  1. package/dist/index.js +20139 -12511
  2. package/dist/index.umd.cjs +102 -94
  3. package/dist/libredwg-parser-worker.js +6958 -12596
  4. package/lib/app/AcApAnnotation.d.ts.map +1 -1
  5. package/lib/app/AcApAnnotation.js +3 -3
  6. package/lib/app/AcApAnnotation.js.map +1 -1
  7. package/lib/app/AcApDocManager.d.ts +61 -4
  8. package/lib/app/AcApDocManager.d.ts.map +1 -1
  9. package/lib/app/AcApDocManager.js +162 -29
  10. package/lib/app/AcApDocManager.js.map +1 -1
  11. package/lib/app/AcApDocument.d.ts +6 -0
  12. package/lib/app/AcApDocument.d.ts.map +1 -1
  13. package/lib/app/AcApDocument.js +12 -0
  14. package/lib/app/AcApDocument.js.map +1 -1
  15. package/lib/app/AcApProgress.d.ts.map +1 -1
  16. package/lib/app/AcApProgress.js +3 -3
  17. package/lib/app/AcApProgress.js.map +1 -1
  18. package/lib/app/AcApSettingManager.d.ts.map +1 -1
  19. package/lib/app/AcApSettingManager.js +3 -1
  20. package/lib/app/AcApSettingManager.js.map +1 -1
  21. package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -1
  22. package/lib/command/AcApArcCmd.d.ts +140 -0
  23. package/lib/command/AcApArcCmd.d.ts.map +1 -0
  24. package/lib/command/AcApArcCmd.js +1009 -0
  25. package/lib/command/AcApArcCmd.js.map +1 -0
  26. package/lib/command/AcApCircleCmd.d.ts +59 -0
  27. package/lib/command/AcApCircleCmd.d.ts.map +1 -1
  28. package/lib/command/AcApCircleCmd.js +490 -13
  29. package/lib/command/AcApCircleCmd.js.map +1 -1
  30. package/lib/command/AcApClearMeasurementsCmd.d.ts +1 -1
  31. package/lib/command/AcApClearMeasurementsCmd.d.ts.map +1 -1
  32. package/lib/command/AcApClearMeasurementsCmd.js +2 -4
  33. package/lib/command/AcApClearMeasurementsCmd.js.map +1 -1
  34. package/lib/command/AcApConvertToDxfCmd.d.ts +9 -0
  35. package/lib/command/AcApConvertToDxfCmd.d.ts.map +1 -0
  36. package/lib/command/{AcApZoomToBoxCmd.js → AcApConvertToDxfCmd.js} +14 -40
  37. package/lib/command/AcApConvertToDxfCmd.js.map +1 -0
  38. package/lib/command/AcApConvertToPngCmd.d.ts +35 -0
  39. package/lib/command/AcApConvertToPngCmd.d.ts.map +1 -0
  40. package/lib/command/AcApConvertToPngCmd.js +127 -0
  41. package/lib/command/AcApConvertToPngCmd.js.map +1 -0
  42. package/lib/command/AcApDimLinearCmd.d.ts.map +1 -1
  43. package/lib/command/AcApDimLinearCmd.js +14 -5
  44. package/lib/command/AcApDimLinearCmd.js.map +1 -1
  45. package/lib/command/AcApDxfConvertor.d.ts +12 -0
  46. package/lib/command/AcApDxfConvertor.d.ts.map +1 -0
  47. package/lib/command/AcApDxfConvertor.js +37 -0
  48. package/lib/command/AcApDxfConvertor.js.map +1 -0
  49. package/lib/command/AcApEllipseCmd.d.ts +87 -0
  50. package/lib/command/AcApEllipseCmd.d.ts.map +1 -0
  51. package/lib/command/AcApEllipseCmd.js +583 -0
  52. package/lib/command/AcApEllipseCmd.js.map +1 -0
  53. package/lib/command/AcApEraseCmd.d.ts.map +1 -1
  54. package/lib/command/AcApEraseCmd.js +10 -6
  55. package/lib/command/AcApEraseCmd.js.map +1 -1
  56. package/lib/command/AcApHatchCmd.d.ts +210 -0
  57. package/lib/command/AcApHatchCmd.d.ts.map +1 -0
  58. package/lib/command/AcApHatchCmd.js +808 -0
  59. package/lib/command/AcApHatchCmd.js.map +1 -0
  60. package/lib/command/AcApLayerCmd.d.ts +217 -0
  61. package/lib/command/AcApLayerCmd.d.ts.map +1 -0
  62. package/lib/command/AcApLayerCmd.js +768 -0
  63. package/lib/command/AcApLayerCmd.js.map +1 -0
  64. package/lib/command/AcApLineCmd.d.ts +36 -1
  65. package/lib/command/AcApLineCmd.d.ts.map +1 -1
  66. package/lib/command/AcApLineCmd.js +159 -16
  67. package/lib/command/AcApLineCmd.js.map +1 -1
  68. package/lib/command/AcApMTextCmd.d.ts.map +1 -1
  69. package/lib/command/AcApMTextCmd.js +6 -3
  70. package/lib/command/AcApMTextCmd.js.map +1 -1
  71. package/lib/command/AcApMeasureAngleCmd.d.ts.map +1 -1
  72. package/lib/command/AcApMeasureAngleCmd.js +134 -123
  73. package/lib/command/AcApMeasureAngleCmd.js.map +1 -1
  74. package/lib/command/AcApMeasureArcCmd.d.ts.map +1 -1
  75. package/lib/command/AcApMeasureArcCmd.js +165 -147
  76. package/lib/command/AcApMeasureArcCmd.js.map +1 -1
  77. package/lib/command/AcApMeasureAreaCmd.d.ts.map +1 -1
  78. package/lib/command/AcApMeasureAreaCmd.js +186 -175
  79. package/lib/command/AcApMeasureAreaCmd.js.map +1 -1
  80. package/lib/command/AcApMeasureDistanceCmd.d.ts.map +1 -1
  81. package/lib/command/AcApMeasureDistanceCmd.js +51 -39
  82. package/lib/command/AcApMeasureDistanceCmd.js.map +1 -1
  83. package/lib/command/AcApMoveCmd.d.ts +16 -0
  84. package/lib/command/AcApMoveCmd.d.ts.map +1 -0
  85. package/lib/command/AcApMoveCmd.js +278 -0
  86. package/lib/command/AcApMoveCmd.js.map +1 -0
  87. package/lib/command/AcApPngConvertor.d.ts +95 -0
  88. package/lib/command/AcApPngConvertor.d.ts.map +1 -0
  89. package/lib/command/AcApPngConvertor.js +205 -0
  90. package/lib/command/AcApPngConvertor.js.map +1 -0
  91. package/lib/command/AcApPolygonCmd.d.ts +69 -0
  92. package/lib/command/AcApPolygonCmd.d.ts.map +1 -0
  93. package/lib/command/AcApPolygonCmd.js +422 -0
  94. package/lib/command/AcApPolygonCmd.js.map +1 -0
  95. package/lib/command/AcApPolylineCmd.d.ts +71 -0
  96. package/lib/command/AcApPolylineCmd.d.ts.map +1 -0
  97. package/lib/command/AcApPolylineCmd.js +569 -0
  98. package/lib/command/AcApPolylineCmd.js.map +1 -0
  99. package/lib/command/AcApRectCmd.d.ts +149 -4
  100. package/lib/command/AcApRectCmd.d.ts.map +1 -1
  101. package/lib/command/AcApRectCmd.js +717 -29
  102. package/lib/command/AcApRectCmd.js.map +1 -1
  103. package/lib/command/AcApRevCircleCmd.d.ts +8 -0
  104. package/lib/command/AcApRevCircleCmd.d.ts.map +1 -1
  105. package/lib/command/AcApRevCircleCmd.js +30 -6
  106. package/lib/command/AcApRevCircleCmd.js.map +1 -1
  107. package/lib/command/AcApRevCloudCmd.d.ts.map +1 -1
  108. package/lib/command/AcApRevCloudCmd.js +10 -4
  109. package/lib/command/AcApRevCloudCmd.js.map +1 -1
  110. package/lib/command/AcApRevRectCmd.d.ts +8 -0
  111. package/lib/command/AcApRevRectCmd.d.ts.map +1 -1
  112. package/lib/command/AcApRevRectCmd.js +78 -6
  113. package/lib/command/AcApRevRectCmd.js.map +1 -1
  114. package/lib/command/AcApSketchCmd.d.ts.map +1 -1
  115. package/lib/command/AcApSketchCmd.js +11 -7
  116. package/lib/command/AcApSketchCmd.js.map +1 -1
  117. package/lib/command/AcApSplineCmd.d.ts +85 -0
  118. package/lib/command/AcApSplineCmd.d.ts.map +1 -0
  119. package/lib/command/AcApSplineCmd.js +620 -0
  120. package/lib/command/AcApSplineCmd.js.map +1 -0
  121. package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
  122. package/lib/command/AcApSysVarCmd.js +6 -3
  123. package/lib/command/AcApSysVarCmd.js.map +1 -1
  124. package/lib/command/AcApZoomCmd.d.ts +91 -20
  125. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  126. package/lib/command/AcApZoomCmd.js +288 -23
  127. package/lib/command/AcApZoomCmd.js.map +1 -1
  128. package/lib/command/index.d.ts +12 -1
  129. package/lib/command/index.d.ts.map +1 -1
  130. package/lib/command/index.js +12 -1
  131. package/lib/command/index.js.map +1 -1
  132. package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -1
  133. package/lib/editor/command/AcEdCommandIterator.js.map +1 -1
  134. package/lib/editor/command/AcEdCommandStack.d.ts +54 -1
  135. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
  136. package/lib/editor/command/AcEdCommandStack.js +207 -25
  137. package/lib/editor/command/AcEdCommandStack.js.map +1 -1
  138. package/lib/editor/global/AcEdUiTheme.d.ts +4 -0
  139. package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -0
  140. package/lib/editor/global/AcEdUiTheme.js +44 -0
  141. package/lib/editor/global/AcEdUiTheme.js.map +1 -0
  142. package/lib/editor/global/index.d.ts +1 -0
  143. package/lib/editor/global/index.d.ts.map +1 -1
  144. package/lib/editor/global/index.js +1 -0
  145. package/lib/editor/global/index.js.map +1 -1
  146. package/lib/editor/input/AcEdCursorManager.d.ts +10 -0
  147. package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
  148. package/lib/editor/input/AcEdCursorManager.js +24 -4
  149. package/lib/editor/input/AcEdCursorManager.js.map +1 -1
  150. package/lib/editor/input/AcEdInputModifiers.d.ts +39 -0
  151. package/lib/editor/input/AcEdInputModifiers.d.ts.map +1 -0
  152. package/lib/editor/input/AcEdInputModifiers.js +2 -0
  153. package/lib/editor/input/AcEdInputModifiers.js.map +1 -0
  154. package/lib/editor/input/AcEdInputToggles.d.ts +24 -0
  155. package/lib/editor/input/AcEdInputToggles.d.ts.map +1 -0
  156. package/lib/editor/input/AcEdInputToggles.js +2 -0
  157. package/lib/editor/input/AcEdInputToggles.js.map +1 -0
  158. package/lib/editor/input/AcEdPromptStateMachine.d.ts +110 -0
  159. package/lib/editor/input/AcEdPromptStateMachine.d.ts.map +1 -0
  160. package/lib/editor/input/AcEdPromptStateMachine.js +147 -0
  161. package/lib/editor/input/AcEdPromptStateMachine.js.map +1 -0
  162. package/lib/editor/input/AcEdSelectionFilter.d.ts +79 -0
  163. package/lib/editor/input/AcEdSelectionFilter.d.ts.map +1 -0
  164. package/lib/editor/input/AcEdSelectionFilter.js +231 -0
  165. package/lib/editor/input/AcEdSelectionFilter.js.map +1 -0
  166. package/lib/editor/input/AcEditor.d.ts +77 -10
  167. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  168. package/lib/editor/input/AcEditor.js +162 -1
  169. package/lib/editor/input/AcEditor.js.map +1 -1
  170. package/lib/editor/input/index.d.ts +4 -0
  171. package/lib/editor/input/index.d.ts.map +1 -1
  172. package/lib/editor/input/index.js +4 -0
  173. package/lib/editor/input/index.js.map +1 -1
  174. package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -1
  175. package/lib/editor/input/marker/AcEdMarker.js +3 -3
  176. package/lib/editor/input/marker/AcEdMarker.js.map +1 -1
  177. package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +47 -0
  178. package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -1
  179. package/lib/editor/input/prompt/AcEdKeywordCollection.js +30 -4
  180. package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -1
  181. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +8 -1
  182. package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
  183. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +19 -2
  184. package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
  185. package/lib/editor/input/prompt/AcEdPromptBoxResult.d.ts +12 -0
  186. package/lib/editor/input/prompt/AcEdPromptBoxResult.d.ts.map +1 -0
  187. package/lib/editor/input/prompt/AcEdPromptBoxResult.js +30 -0
  188. package/lib/editor/input/prompt/AcEdPromptBoxResult.js.map +1 -0
  189. package/lib/editor/input/prompt/AcEdPromptDoubleResult.d.ts +9 -0
  190. package/lib/editor/input/prompt/AcEdPromptDoubleResult.d.ts.map +1 -0
  191. package/lib/editor/input/prompt/AcEdPromptDoubleResult.js +28 -0
  192. package/lib/editor/input/prompt/AcEdPromptDoubleResult.js.map +1 -0
  193. package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts +18 -1
  194. package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts.map +1 -1
  195. package/lib/editor/input/prompt/AcEdPromptEntityOptions.js +32 -5
  196. package/lib/editor/input/prompt/AcEdPromptEntityOptions.js.map +1 -1
  197. package/lib/editor/input/prompt/AcEdPromptEntityResult.d.ts +14 -0
  198. package/lib/editor/input/prompt/AcEdPromptEntityResult.d.ts.map +1 -0
  199. package/lib/editor/input/prompt/AcEdPromptEntityResult.js +31 -0
  200. package/lib/editor/input/prompt/AcEdPromptEntityResult.js.map +1 -0
  201. package/lib/editor/input/prompt/AcEdPromptIntegerResult.d.ts +9 -0
  202. package/lib/editor/input/prompt/AcEdPromptIntegerResult.d.ts.map +1 -0
  203. package/lib/editor/input/prompt/AcEdPromptIntegerResult.js +28 -0
  204. package/lib/editor/input/prompt/AcEdPromptIntegerResult.js.map +1 -0
  205. package/lib/editor/input/prompt/AcEdPromptKeywordOptions.d.ts +1 -1
  206. package/lib/editor/input/prompt/AcEdPromptKeywordOptions.d.ts.map +1 -1
  207. package/lib/editor/input/prompt/AcEdPromptKeywordOptions.js +2 -2
  208. package/lib/editor/input/prompt/AcEdPromptKeywordOptions.js.map +1 -1
  209. package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +1 -1
  210. package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -1
  211. package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +2 -2
  212. package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -1
  213. package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +9 -3
  214. package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -1
  215. package/lib/editor/input/prompt/AcEdPromptOptions.js +22 -4
  216. package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -1
  217. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +1 -1
  218. package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
  219. package/lib/editor/input/prompt/AcEdPromptPointOptions.js +2 -2
  220. package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
  221. package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +3 -3
  222. package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts +1 -1
  223. package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts.map +1 -1
  224. package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js +2 -2
  225. package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js.map +1 -1
  226. package/lib/editor/input/prompt/AcEdPromptSelectionResult.d.ts +12 -0
  227. package/lib/editor/input/prompt/AcEdPromptSelectionResult.d.ts.map +1 -0
  228. package/lib/editor/input/prompt/AcEdPromptSelectionResult.js +30 -0
  229. package/lib/editor/input/prompt/AcEdPromptSelectionResult.js.map +1 -0
  230. package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +1 -1
  231. package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -1
  232. package/lib/editor/input/prompt/AcEdPromptStringOptions.js +2 -2
  233. package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -1
  234. package/lib/editor/input/prompt/index.d.ts +9 -0
  235. package/lib/editor/input/prompt/index.d.ts.map +1 -1
  236. package/lib/editor/input/prompt/index.js +9 -0
  237. package/lib/editor/input/prompt/index.js.map +1 -1
  238. package/lib/editor/input/session/AcEdKeywordSession.d.ts +67 -1
  239. package/lib/editor/input/session/AcEdKeywordSession.d.ts.map +1 -1
  240. package/lib/editor/input/session/AcEdKeywordSession.js +78 -1
  241. package/lib/editor/input/session/AcEdKeywordSession.js.map +1 -1
  242. package/lib/editor/input/ui/AcEdCommandLine.d.ts +27 -1
  243. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  244. package/lib/editor/input/ui/AcEdCommandLine.js +75 -10
  245. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  246. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +24 -1
  247. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  248. package/lib/editor/input/ui/AcEdFloatingInput.js +147 -27
  249. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  250. package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +2 -0
  251. package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -1
  252. package/lib/editor/input/ui/AcEdFloatingInputBox.js +4 -0
  253. package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
  254. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +30 -1
  255. package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
  256. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +46 -15
  257. package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
  258. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +33 -0
  259. package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
  260. package/lib/editor/input/ui/AcEdFloatingMessage.d.ts +12 -0
  261. package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
  262. package/lib/editor/input/ui/AcEdFloatingMessage.js +61 -2
  263. package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
  264. package/lib/editor/input/ui/AcEdInputManager.d.ts +403 -29
  265. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  266. package/lib/editor/input/ui/AcEdInputManager.js +1313 -414
  267. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  268. package/lib/editor/input/ui/AcEdRubberBand.d.ts +15 -1
  269. package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
  270. package/lib/editor/input/ui/AcEdRubberBand.js +43 -11
  271. package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
  272. package/lib/editor/view/AcEdBaseView.d.ts +66 -0
  273. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  274. package/lib/editor/view/AcEdBaseView.js +170 -0
  275. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  276. package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
  277. package/lib/i18n/en/command.d.ts +36 -3
  278. package/lib/i18n/en/command.d.ts.map +1 -1
  279. package/lib/i18n/en/command.js +36 -3
  280. package/lib/i18n/en/command.js.map +1 -1
  281. package/lib/i18n/en/jig.d.ts +553 -0
  282. package/lib/i18n/en/jig.d.ts.map +1 -1
  283. package/lib/i18n/en/jig.js +557 -4
  284. package/lib/i18n/en/jig.js.map +1 -1
  285. package/lib/i18n/zh/command.d.ts +36 -3
  286. package/lib/i18n/zh/command.d.ts.map +1 -1
  287. package/lib/i18n/zh/command.js +36 -3
  288. package/lib/i18n/zh/command.js.map +1 -1
  289. package/lib/i18n/zh/jig.d.ts +553 -0
  290. package/lib/i18n/zh/jig.d.ts.map +1 -1
  291. package/lib/i18n/zh/jig.js +557 -4
  292. package/lib/i18n/zh/jig.js.map +1 -1
  293. package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
  294. package/lib/plugin/AcApPluginManager.js.map +1 -1
  295. package/lib/util/AcApMeasurementElementGenerator.d.ts +36 -0
  296. package/lib/util/AcApMeasurementElementGenerator.d.ts.map +1 -0
  297. package/lib/util/AcApMeasurementElementGenerator.js +92 -0
  298. package/lib/util/AcApMeasurementElementGenerator.js.map +1 -0
  299. package/lib/util/index.d.ts +1 -1
  300. package/lib/util/index.d.ts.map +1 -1
  301. package/lib/util/index.js +1 -1
  302. package/lib/util/index.js.map +1 -1
  303. package/lib/view/AcTrLayer.d.ts.map +1 -1
  304. package/lib/view/AcTrLayer.js +5 -3
  305. package/lib/view/AcTrLayer.js.map +1 -1
  306. package/lib/view/AcTrLayoutView.d.ts +6 -0
  307. package/lib/view/AcTrLayoutView.d.ts.map +1 -1
  308. package/lib/view/AcTrLayoutView.js +20 -0
  309. package/lib/view/AcTrLayoutView.js.map +1 -1
  310. package/lib/view/AcTrView2d.d.ts +0 -1
  311. package/lib/view/AcTrView2d.d.ts.map +1 -1
  312. package/lib/view/AcTrView2d.js +103 -50
  313. package/lib/view/AcTrView2d.js.map +1 -1
  314. package/package.json +15 -13
  315. package/lib/command/AcApZoomToBoxCmd.d.ts +0 -29
  316. package/lib/command/AcApZoomToBoxCmd.d.ts.map +0 -1
  317. package/lib/command/AcApZoomToBoxCmd.js.map +0 -1
  318. package/lib/util/AcApMeasurementUtils.d.ts +0 -12
  319. package/lib/util/AcApMeasurementUtils.d.ts.map +0 -1
  320. package/lib/util/AcApMeasurementUtils.js +0 -36
  321. package/lib/util/AcApMeasurementUtils.js.map +0 -1
@@ -49,85 +49,773 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
49
49
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
50
  }
51
51
  };
52
- import { AcDbPolyline, AcGePoint2d } from '@mlightcad/data-model';
52
+ import { AcDbPolyline, AcGePoint2d, AcGePoint3d } from '@mlightcad/data-model';
53
53
  import { AcApDocManager } from '../app';
54
- import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptPointOptions } from '../editor';
54
+ import { AcEdCommand, AcEdOpenMode, AcEdPreviewJig, AcEdPromptAngleOptions, AcEdPromptDoubleOptions, AcEdPromptPointOptions, AcEdPromptStateMachine, AcEdPromptStatus, eventBus } from '../editor';
55
55
  import { AcApI18n } from '../i18n';
56
- function updateRect(rect, firstPoint, secondPoint) {
56
+ var EPSILON = 1e-9;
57
+ var FILLET_BULGE_BASE = Math.tan(Math.PI / 8);
58
+ var DEFAULT_RECT_SETTINGS = {
59
+ chamferDist1: 0,
60
+ chamferDist2: 0,
61
+ filletRadius: 0,
62
+ width: 0,
63
+ elevation: 0,
64
+ thickness: 0,
65
+ rotation: 0
66
+ };
67
+ function addKeyword(prompt, key) {
68
+ prompt.keywords.add(AcApI18n.t("jig.rect.keywords.".concat(key, ".display")), AcApI18n.t("jig.rect.keywords.".concat(key, ".global")), AcApI18n.t("jig.rect.keywords.".concat(key, ".local")));
69
+ }
70
+ function addDoubleKeyword(prompt, key) {
71
+ prompt.keywords.add(AcApI18n.t("jig.rect.keywords.".concat(key, ".display")), AcApI18n.t("jig.rect.keywords.".concat(key, ".global")), AcApI18n.t("jig.rect.keywords.".concat(key, ".local")));
72
+ }
73
+ function warnRectMessage(key) {
74
+ eventBus.emit('message', {
75
+ message: AcApI18n.t("jig.rect.".concat(key)),
76
+ type: 'warning'
77
+ });
78
+ }
79
+ function toWorldPoint(origin, local, rotation) {
80
+ var cos = Math.cos(rotation);
81
+ var sin = Math.sin(rotation);
82
+ return new AcGePoint2d(origin.x + local.x * cos - local.y * sin, origin.y + local.x * sin + local.y * cos);
83
+ }
84
+ function toLocalVector(origin, point, rotation) {
85
+ var dx = point.x - origin.x;
86
+ var dy = point.y - origin.y;
87
+ var cos = Math.cos(rotation);
88
+ var sin = Math.sin(rotation);
89
+ return new AcGePoint2d(dx * cos + dy * sin, -dx * sin + dy * cos);
90
+ }
91
+ function normalizeNonNegative(value) {
92
+ if (!Number.isFinite(value !== null && value !== void 0 ? value : NaN))
93
+ return 0;
94
+ return Math.max(0, value !== null && value !== void 0 ? value : 0);
95
+ }
96
+ function buildSquareVertices(lx, ly) {
97
+ return [
98
+ { point: new AcGePoint2d(0, 0) },
99
+ { point: new AcGePoint2d(lx, 0) },
100
+ { point: new AcGePoint2d(lx, ly) },
101
+ { point: new AcGePoint2d(0, ly) }
102
+ ];
103
+ }
104
+ function buildChamferVertices(lx, ly, distance1, distance2) {
105
+ var sx = lx >= 0 ? 1 : -1;
106
+ var sy = ly >= 0 ? 1 : -1;
107
+ var absX = Math.abs(lx);
108
+ var absY = Math.abs(ly);
109
+ var d1 = Math.min(normalizeNonNegative(distance1), absX / 2);
110
+ var d2 = Math.min(normalizeNonNegative(distance2), absY / 2);
111
+ if (d1 <= EPSILON && d2 <= EPSILON) {
112
+ return buildSquareVertices(lx, ly);
113
+ }
114
+ var c1Out = new AcGePoint2d(sx * d1, 0);
115
+ var c1In = new AcGePoint2d(0, sy * d2);
116
+ var c2In = new AcGePoint2d(lx - sx * d1, 0);
117
+ var c2Out = new AcGePoint2d(lx, sy * d2);
118
+ var c3In = new AcGePoint2d(lx, ly - sy * d2);
119
+ var c3Out = new AcGePoint2d(lx - sx * d1, ly);
120
+ var c4In = new AcGePoint2d(sx * d1, ly);
121
+ var c4Out = new AcGePoint2d(0, ly - sy * d2);
122
+ return [
123
+ { point: c1Out },
124
+ { point: c2In },
125
+ { point: c2Out },
126
+ { point: c3In },
127
+ { point: c3Out },
128
+ { point: c4In },
129
+ { point: c4Out },
130
+ { point: c1In }
131
+ ];
132
+ }
133
+ function buildFilletVertices(lx, ly, radius) {
134
+ var absX = Math.abs(lx);
135
+ var absY = Math.abs(ly);
136
+ var r = Math.min(normalizeNonNegative(radius), absX / 2, absY / 2);
137
+ if (r <= EPSILON)
138
+ return buildSquareVertices(lx, ly);
139
+ var chamferLike = buildChamferVertices(lx, ly, r, r);
140
+ var orientation = lx * ly >= 0 ? 1 : -1;
141
+ var bulge = orientation * FILLET_BULGE_BASE;
142
+ // Arc segments are: c2In->c2Out, c3In->c3Out, c4In->c4Out, c1In->c1Out(closed).
143
+ // These are represented by bulge on vertices 1, 3, 5, 7 respectively.
144
+ return chamferLike.map(function (vertex, index) { return ({
145
+ point: vertex.point,
146
+ bulge: index % 2 === 1 ? bulge : undefined
147
+ }); });
148
+ }
149
+ function resolveRectVertices(lx, ly, settings) {
150
+ if (settings.filletRadius > EPSILON) {
151
+ return buildFilletVertices(lx, ly, settings.filletRadius);
152
+ }
153
+ if (settings.chamferDist1 > EPSILON || settings.chamferDist2 > EPSILON) {
154
+ return buildChamferVertices(lx, ly, settings.chamferDist1, settings.chamferDist2);
155
+ }
156
+ return buildSquareVertices(lx, ly);
157
+ }
158
+ function updateRect(rect, firstPoint, input, settings) {
159
+ var lx = 0;
160
+ var ly = 0;
161
+ if (input.mode === 'corner') {
162
+ var local = toLocalVector(firstPoint, input.secondPoint, settings.rotation);
163
+ lx = local.x;
164
+ ly = local.y;
165
+ }
166
+ else {
167
+ lx = input.length;
168
+ ly = input.width;
169
+ }
170
+ if (Math.abs(lx) <= EPSILON || Math.abs(ly) <= EPSILON)
171
+ return false;
57
172
  rect.reset(false);
58
- // Add four vertices to form a rectangle
59
- // First vertex: the first point (one corner)
60
- rect.addVertexAt(0, new AcGePoint2d(firstPoint));
61
- // Second vertex: same Y as first point, X from current point
62
- rect.addVertexAt(1, new AcGePoint2d(secondPoint.x, firstPoint.y));
63
- // Third vertex: the current point (opposite corner)
64
- rect.addVertexAt(2, new AcGePoint2d(secondPoint));
65
- // Fourth vertex: same X as first point, Y from current point
66
- rect.addVertexAt(3, new AcGePoint2d(firstPoint.x, secondPoint.y));
173
+ var vertices = resolveRectVertices(lx, ly, settings);
174
+ var segWidth = normalizeNonNegative(settings.width);
175
+ vertices.forEach(function (vertex, index) {
176
+ var worldPoint = toWorldPoint(firstPoint, vertex.point, settings.rotation);
177
+ if (segWidth > EPSILON) {
178
+ rect.addVertexAt(index, worldPoint, vertex.bulge, segWidth, segWidth);
179
+ }
180
+ else {
181
+ rect.addVertexAt(index, worldPoint, vertex.bulge);
182
+ }
183
+ });
184
+ rect.elevation = settings.elevation;
67
185
  rect.closed = true;
186
+ return true;
68
187
  }
188
+ /**
189
+ * Dynamic preview jig for RECT command.
190
+ */
69
191
  var AcApRectJig = /** @class */ (function (_super) {
70
192
  __extends(AcApRectJig, _super);
71
193
  /**
72
- * Creates a line jig.
194
+ * Creates a dynamic rectangle preview jig.
73
195
  *
74
- * @param view - The associated view
196
+ * @param view - Active editor view used to render transient geometry.
197
+ * @param start - First corner point of the rectangle.
198
+ * @param settingsProvider - Callback that returns current command settings.
75
199
  */
76
- function AcApRectJig(view, start) {
200
+ function AcApRectJig(view, start, settingsProvider) {
77
201
  var _this = _super.call(this, view) || this;
78
202
  _this._rect = new AcDbPolyline();
79
203
  _this._firstPoint = new AcGePoint2d(start);
204
+ _this._settingsProvider = settingsProvider;
80
205
  return _this;
81
206
  }
82
207
  Object.defineProperty(AcApRectJig.prototype, "entity", {
208
+ /**
209
+ * Gets the transient polyline entity displayed by the jig.
210
+ */
83
211
  get: function () {
84
212
  return this._rect;
85
213
  },
86
214
  enumerable: false,
87
215
  configurable: true
88
216
  });
217
+ /**
218
+ * Rebuilds preview geometry from the current cursor point.
219
+ *
220
+ * @param secondPoint - Dynamic opposite corner point under the cursor.
221
+ */
89
222
  AcApRectJig.prototype.update = function (secondPoint) {
90
- updateRect(this._rect, this._firstPoint, secondPoint);
223
+ updateRect(this._rect, this._firstPoint, { mode: 'corner', secondPoint: secondPoint }, this._settingsProvider());
91
224
  };
92
225
  return AcApRectJig;
93
226
  }(AcEdPreviewJig));
94
227
  export { AcApRectJig };
95
228
  /**
96
- * Command to create one rectangle.
229
+ * Static rectangle preview jig used for non-point prompts (angle/number input).
230
+ *
231
+ * The geometry is built once in the constructor and then kept unchanged.
232
+ *
233
+ * @typeParam T - Prompt value type that drives this jig instance.
234
+ */
235
+ var AcApRectStaticJig = /** @class */ (function (_super) {
236
+ __extends(AcApRectStaticJig, _super);
237
+ /**
238
+ * Creates a static preview jig with precomputed rectangle geometry.
239
+ *
240
+ * @param view - Active editor view.
241
+ * @param firstPoint - Rectangle base corner.
242
+ * @param input - Rectangle construction input (corner or dimensions).
243
+ * @param settings - Rectangle style/transform settings.
244
+ */
245
+ function AcApRectStaticJig(view, firstPoint, input, settings) {
246
+ var _this = _super.call(this, view) || this;
247
+ _this._rect = new AcDbPolyline();
248
+ updateRect(_this._rect, firstPoint, input, settings);
249
+ return _this;
250
+ }
251
+ Object.defineProperty(AcApRectStaticJig.prototype, "entity", {
252
+ /**
253
+ * Gets the transient static rectangle entity.
254
+ */
255
+ get: function () {
256
+ return this._rect;
257
+ },
258
+ enumerable: false,
259
+ configurable: true
260
+ });
261
+ /**
262
+ * No-op update hook required by preview jig interface.
263
+ *
264
+ * @param _value - Prompt value (unused for static preview).
265
+ */
266
+ AcApRectStaticJig.prototype.update = function (_value) {
267
+ // No-op. Static preview.
268
+ };
269
+ return AcApRectStaticJig;
270
+ }(AcEdPreviewJig));
271
+ function cloneRectSettings(settings) {
272
+ return {
273
+ chamferDist1: settings.chamferDist1,
274
+ chamferDist2: settings.chamferDist2,
275
+ filletRadius: settings.filletRadius,
276
+ width: settings.width,
277
+ elevation: settings.elevation,
278
+ thickness: settings.thickness,
279
+ rotation: settings.rotation
280
+ };
281
+ }
282
+ function isPositive(value) {
283
+ return Number.isFinite(value !== null && value !== void 0 ? value : NaN) && (value !== null && value !== void 0 ? value : 0) > EPSILON;
284
+ }
285
+ /**
286
+ * Command to create one rectangle with AutoCAD-like branching options.
97
287
  */
98
288
  var AcApRectCmd = /** @class */ (function (_super) {
99
289
  __extends(AcApRectCmd, _super);
290
+ /**
291
+ * Creates RECT command instance.
292
+ */
100
293
  function AcApRectCmd() {
101
294
  var _this = _super.call(this) || this;
102
295
  _this.mode = AcEdOpenMode.Write;
103
296
  return _this;
104
297
  }
298
+ /**
299
+ * Command entry point.
300
+ *
301
+ * Flow:
302
+ * 1. Prompt first corner and first-stage options.
303
+ * 2. Prompt second-corner input, dimensions, or area workflow.
304
+ * 3. Build final polyline and append it to model space.
305
+ *
306
+ * @param context - Current application/document context.
307
+ */
105
308
  AcApRectCmd.prototype.execute = function (context) {
106
309
  return __awaiter(this, void 0, void 0, function () {
107
- var firstPointPrompt, firstPoint, secondPointPrompt, secondPoint, db, rect;
310
+ var settings, firstPoint, secondInput, rect, isValid;
108
311
  return __generator(this, function (_a) {
109
312
  switch (_a.label) {
110
313
  case 0:
111
- firstPointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.rect.firstPoint'));
112
- return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(firstPointPrompt)];
314
+ settings = cloneRectSettings(AcApRectCmd._settings);
315
+ return [4 /*yield*/, this.promptFirstCorner(settings)];
113
316
  case 1:
114
317
  firstPoint = _a.sent();
115
- secondPointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.rect.nextPoint'));
116
- secondPointPrompt.jig = new AcApRectJig(context.view, firstPoint);
117
- secondPointPrompt.useDashedLine = false;
118
- secondPointPrompt.useBasePoint = true;
119
- return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(secondPointPrompt)];
318
+ if (!firstPoint)
319
+ return [2 /*return*/];
320
+ return [4 /*yield*/, this.promptSecondInput(context, firstPoint, settings)];
120
321
  case 2:
121
- secondPoint = _a.sent();
122
- db = context.doc.database;
322
+ secondInput = _a.sent();
323
+ if (!secondInput)
324
+ return [2 /*return*/];
123
325
  rect = new AcDbPolyline();
124
- updateRect(rect, firstPoint, secondPoint);
125
- db.tables.blockTable.modelSpace.appendEntity(rect);
326
+ isValid = updateRect(rect, firstPoint, secondInput, settings);
327
+ if (!isValid) {
328
+ warnRectMessage('invalidRect');
329
+ return [2 /*return*/];
330
+ }
331
+ if (settings.thickness > EPSILON) {
332
+ warnRectMessage('thicknessNotSupported');
333
+ }
334
+ context.doc.database.tables.blockTable.modelSpace.appendEntity(rect);
335
+ AcApRectCmd._settings = cloneRectSettings(settings);
126
336
  return [2 /*return*/];
127
337
  }
128
338
  });
129
339
  });
130
340
  };
341
+ /**
342
+ * Prompts for the first rectangle corner while handling setup keywords.
343
+ *
344
+ * Supported options at this step: Chamfer, Elevation, Fillet, Thickness, Width.
345
+ *
346
+ * @param settings - Mutable settings object updated in-place by options.
347
+ * @returns First corner point, or `undefined` when user cancels.
348
+ */
349
+ AcApRectCmd.prototype.promptFirstCorner = function (settings) {
350
+ return __awaiter(this, void 0, void 0, function () {
351
+ var prompt_1, result, keyword, ok, ok, ok, ok, ok;
352
+ var _a;
353
+ return __generator(this, function (_b) {
354
+ switch (_b.label) {
355
+ case 0:
356
+ if (!true) return [3 /*break*/, 12];
357
+ prompt_1 = new AcEdPromptPointOptions(AcApI18n.t('jig.rect.firstPointWithOptions'));
358
+ addKeyword(prompt_1, 'chamfer');
359
+ addKeyword(prompt_1, 'elevation');
360
+ addKeyword(prompt_1, 'fillet');
361
+ addKeyword(prompt_1, 'thickness');
362
+ addKeyword(prompt_1, 'width');
363
+ return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(prompt_1)];
364
+ case 1:
365
+ result = _b.sent();
366
+ if (result.status === AcEdPromptStatus.OK) {
367
+ return [2 /*return*/, result.value];
368
+ }
369
+ if (result.status !== AcEdPromptStatus.Keyword)
370
+ return [2 /*return*/, undefined];
371
+ keyword = (_a = result.stringResult) !== null && _a !== void 0 ? _a : '';
372
+ if (!(keyword === 'Chamfer')) return [3 /*break*/, 3];
373
+ return [4 /*yield*/, this.promptChamfer(settings)];
374
+ case 2:
375
+ ok = _b.sent();
376
+ if (!ok)
377
+ return [2 /*return*/, undefined];
378
+ return [3 /*break*/, 11];
379
+ case 3:
380
+ if (!(keyword === 'Elevation')) return [3 /*break*/, 5];
381
+ return [4 /*yield*/, this.promptElevation(settings)];
382
+ case 4:
383
+ ok = _b.sent();
384
+ if (!ok)
385
+ return [2 /*return*/, undefined];
386
+ return [3 /*break*/, 11];
387
+ case 5:
388
+ if (!(keyword === 'Fillet')) return [3 /*break*/, 7];
389
+ return [4 /*yield*/, this.promptFillet(settings)];
390
+ case 6:
391
+ ok = _b.sent();
392
+ if (!ok)
393
+ return [2 /*return*/, undefined];
394
+ return [3 /*break*/, 11];
395
+ case 7:
396
+ if (!(keyword === 'Thickness')) return [3 /*break*/, 9];
397
+ return [4 /*yield*/, this.promptThickness(settings)];
398
+ case 8:
399
+ ok = _b.sent();
400
+ if (!ok)
401
+ return [2 /*return*/, undefined];
402
+ return [3 /*break*/, 11];
403
+ case 9:
404
+ if (!(keyword === 'Width')) return [3 /*break*/, 11];
405
+ return [4 /*yield*/, this.promptWidth(settings)];
406
+ case 10:
407
+ ok = _b.sent();
408
+ if (!ok)
409
+ return [2 /*return*/, undefined];
410
+ _b.label = 11;
411
+ case 11: return [3 /*break*/, 0];
412
+ case 12: return [2 /*return*/];
413
+ }
414
+ });
415
+ });
416
+ };
417
+ /**
418
+ * Prompts for rectangle completion input after first corner is known.
419
+ *
420
+ * Supports direct opposite corner pick or switching to Area/Dimensions/Rotation
421
+ * branches through a point-prompt state machine.
422
+ *
423
+ * @param context - Current application/document context.
424
+ * @param firstPoint - First corner point.
425
+ * @param settings - Mutable rectangle settings used by preview/build.
426
+ * @returns Final rectangle build input, or `undefined` on cancel.
427
+ */
428
+ AcApRectCmd.prototype.promptSecondInput = function (context, firstPoint, settings) {
429
+ return __awaiter(this, void 0, void 0, function () {
430
+ var finalInput, CornerState, machine;
431
+ return __generator(this, function (_a) {
432
+ switch (_a.label) {
433
+ case 0:
434
+ CornerState = /** @class */ (function () {
435
+ /**
436
+ * Creates corner state handler.
437
+ *
438
+ * @param cmd - Owning RECT command instance.
439
+ */
440
+ function CornerState(cmd) {
441
+ this.cmd = cmd;
442
+ }
443
+ /**
444
+ * Builds the point prompt for second-corner input.
445
+ *
446
+ * @returns Configured point prompt with keywords and preview jig.
447
+ */
448
+ CornerState.prototype.buildPrompt = function () {
449
+ var prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.rect.otherCornerWithOptions'));
450
+ addKeyword(prompt, 'area');
451
+ addKeyword(prompt, 'dimensions');
452
+ addKeyword(prompt, 'rotation');
453
+ prompt.useDashedLine = false;
454
+ prompt.useBasePoint = true;
455
+ prompt.basePoint = new AcGePoint3d(firstPoint);
456
+ prompt.jig = new AcApRectJig(context.view, firstPoint, function () { return settings; });
457
+ return prompt;
458
+ };
459
+ /**
460
+ * Handles point/keyword result and drives state transitions.
461
+ *
462
+ * @param result - User input result from point prompt.
463
+ * @returns State-machine step result.
464
+ */
465
+ CornerState.prototype.handleResult = function (result) {
466
+ return __awaiter(this, void 0, void 0, function () {
467
+ var keyword, ok, dims, dims;
468
+ var _a;
469
+ return __generator(this, function (_b) {
470
+ switch (_b.label) {
471
+ case 0:
472
+ if (result.status === AcEdPromptStatus.OK) {
473
+ finalInput = { mode: 'corner', secondPoint: result.value };
474
+ return [2 /*return*/, 'finish'];
475
+ }
476
+ if (result.status !== AcEdPromptStatus.Keyword)
477
+ return [2 /*return*/, 'finish'];
478
+ keyword = (_a = result.stringResult) !== null && _a !== void 0 ? _a : '';
479
+ if (!(keyword === 'Rotation')) return [3 /*break*/, 2];
480
+ return [4 /*yield*/, this.cmd.promptRotation(context, firstPoint, settings)];
481
+ case 1:
482
+ ok = _b.sent();
483
+ if (!ok)
484
+ return [2 /*return*/, 'finish'];
485
+ return [2 /*return*/, 'continue'];
486
+ case 2:
487
+ if (!(keyword === 'Dimensions')) return [3 /*break*/, 4];
488
+ return [4 /*yield*/, this.cmd.promptDimensions(context, firstPoint, settings)];
489
+ case 3:
490
+ dims = _b.sent();
491
+ if (!dims)
492
+ return [2 /*return*/, 'finish'];
493
+ finalInput = dims;
494
+ return [2 /*return*/, 'finish'];
495
+ case 4:
496
+ if (!(keyword === 'Area')) return [3 /*break*/, 6];
497
+ return [4 /*yield*/, this.cmd.promptArea(context, firstPoint, settings)];
498
+ case 5:
499
+ dims = _b.sent();
500
+ if (!dims)
501
+ return [2 /*return*/, 'finish'];
502
+ finalInput = dims;
503
+ return [2 /*return*/, 'finish'];
504
+ case 6: return [2 /*return*/, 'continue'];
505
+ }
506
+ });
507
+ });
508
+ };
509
+ return CornerState;
510
+ }());
511
+ machine = new AcEdPromptStateMachine();
512
+ machine.setState(new CornerState(this));
513
+ return [4 /*yield*/, machine.run(function (prompt) { return AcApDocManager.instance.editor.getPoint(prompt); })];
514
+ case 1:
515
+ _a.sent();
516
+ return [2 /*return*/, finalInput];
517
+ }
518
+ });
519
+ });
520
+ };
521
+ /**
522
+ * Prompts for a strictly positive numeric value.
523
+ *
524
+ * @param message - Prompt message text.
525
+ * @param jig - Optional preview jig displayed during input.
526
+ * @returns Positive number, or `undefined` when canceled.
527
+ */
528
+ AcApRectCmd.prototype.promptPositiveDouble = function (message, jig) {
529
+ return __awaiter(this, void 0, void 0, function () {
530
+ var prompt_2, result;
531
+ return __generator(this, function (_a) {
532
+ switch (_a.label) {
533
+ case 0:
534
+ if (!true) return [3 /*break*/, 2];
535
+ prompt_2 = new AcEdPromptDoubleOptions(message);
536
+ prompt_2.allowNegative = false;
537
+ prompt_2.allowZero = false;
538
+ if (jig)
539
+ prompt_2.jig = jig;
540
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDouble(prompt_2)];
541
+ case 1:
542
+ result = _a.sent();
543
+ if (result.status !== AcEdPromptStatus.OK)
544
+ return [2 /*return*/, undefined];
545
+ if (isPositive(result.value))
546
+ return [2 /*return*/, result.value];
547
+ warnRectMessage('invalidPositive');
548
+ return [3 /*break*/, 0];
549
+ case 2: return [2 /*return*/];
550
+ }
551
+ });
552
+ });
553
+ };
554
+ /**
555
+ * Prompts chamfer distances and updates settings.
556
+ *
557
+ * Also clears fillet mode, because chamfer and fillet are mutually exclusive.
558
+ *
559
+ * @param settings - Mutable rectangle settings.
560
+ * @returns `true` when values are accepted, otherwise `false`.
561
+ */
562
+ AcApRectCmd.prototype.promptChamfer = function (settings) {
563
+ return __awaiter(this, void 0, void 0, function () {
564
+ var d1, d2;
565
+ return __generator(this, function (_a) {
566
+ switch (_a.label) {
567
+ case 0: return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.chamferFirst'))];
568
+ case 1:
569
+ d1 = _a.sent();
570
+ if (!isPositive(d1))
571
+ return [2 /*return*/, false];
572
+ return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.chamferSecond'))];
573
+ case 2:
574
+ d2 = _a.sent();
575
+ if (!isPositive(d2))
576
+ return [2 /*return*/, false];
577
+ settings.chamferDist1 = d1;
578
+ settings.chamferDist2 = d2;
579
+ settings.filletRadius = 0;
580
+ return [2 /*return*/, true];
581
+ }
582
+ });
583
+ });
584
+ };
585
+ /**
586
+ * Prompts fillet radius and updates settings.
587
+ *
588
+ * Also clears chamfer values, because fillet and chamfer are mutually exclusive.
589
+ *
590
+ * @param settings - Mutable rectangle settings.
591
+ * @returns `true` when value is accepted, otherwise `false`.
592
+ */
593
+ AcApRectCmd.prototype.promptFillet = function (settings) {
594
+ return __awaiter(this, void 0, void 0, function () {
595
+ var radius;
596
+ return __generator(this, function (_a) {
597
+ switch (_a.label) {
598
+ case 0: return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.filletRadius'))];
599
+ case 1:
600
+ radius = _a.sent();
601
+ if (!isPositive(radius))
602
+ return [2 /*return*/, false];
603
+ settings.filletRadius = radius;
604
+ settings.chamferDist1 = 0;
605
+ settings.chamferDist2 = 0;
606
+ return [2 /*return*/, true];
607
+ }
608
+ });
609
+ });
610
+ };
611
+ /**
612
+ * Prompts segment width and updates settings.
613
+ *
614
+ * @param settings - Mutable rectangle settings.
615
+ * @returns `true` when value is accepted, otherwise `false`.
616
+ */
617
+ AcApRectCmd.prototype.promptWidth = function (settings) {
618
+ return __awaiter(this, void 0, void 0, function () {
619
+ var prompt, result;
620
+ return __generator(this, function (_a) {
621
+ switch (_a.label) {
622
+ case 0:
623
+ prompt = new AcEdPromptDoubleOptions(AcApI18n.t('jig.rect.segmentWidth'));
624
+ prompt.allowNegative = false;
625
+ prompt.allowZero = true;
626
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDouble(prompt)];
627
+ case 1:
628
+ result = _a.sent();
629
+ if (result.status !== AcEdPromptStatus.OK)
630
+ return [2 /*return*/, false];
631
+ settings.width = normalizeNonNegative(result.value);
632
+ return [2 /*return*/, true];
633
+ }
634
+ });
635
+ });
636
+ };
637
+ /**
638
+ * Prompts elevation and updates settings.
639
+ *
640
+ * @param settings - Mutable rectangle settings.
641
+ * @returns `true` when value is accepted, otherwise `false`.
642
+ */
643
+ AcApRectCmd.prototype.promptElevation = function (settings) {
644
+ return __awaiter(this, void 0, void 0, function () {
645
+ var prompt, result;
646
+ var _a;
647
+ return __generator(this, function (_b) {
648
+ switch (_b.label) {
649
+ case 0:
650
+ prompt = new AcEdPromptDoubleOptions(AcApI18n.t('jig.rect.elevationValue'));
651
+ prompt.allowNegative = true;
652
+ prompt.allowZero = true;
653
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDouble(prompt)];
654
+ case 1:
655
+ result = _b.sent();
656
+ if (result.status !== AcEdPromptStatus.OK)
657
+ return [2 /*return*/, false];
658
+ settings.elevation = (_a = result.value) !== null && _a !== void 0 ? _a : 0;
659
+ return [2 /*return*/, true];
660
+ }
661
+ });
662
+ });
663
+ };
664
+ /**
665
+ * Prompts thickness and updates settings.
666
+ *
667
+ * @param settings - Mutable rectangle settings.
668
+ * @returns `true` when value is accepted, otherwise `false`.
669
+ */
670
+ AcApRectCmd.prototype.promptThickness = function (settings) {
671
+ return __awaiter(this, void 0, void 0, function () {
672
+ var prompt, result;
673
+ return __generator(this, function (_a) {
674
+ switch (_a.label) {
675
+ case 0:
676
+ prompt = new AcEdPromptDoubleOptions(AcApI18n.t('jig.rect.thicknessValue'));
677
+ prompt.allowNegative = false;
678
+ prompt.allowZero = true;
679
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDouble(prompt)];
680
+ case 1:
681
+ result = _a.sent();
682
+ if (result.status !== AcEdPromptStatus.OK)
683
+ return [2 /*return*/, false];
684
+ settings.thickness = normalizeNonNegative(result.value);
685
+ return [2 /*return*/, true];
686
+ }
687
+ });
688
+ });
689
+ };
690
+ /**
691
+ * Prompts rectangle rotation angle and updates settings.
692
+ *
693
+ * @param context - Current application/document context.
694
+ * @param firstPoint - First corner used as angle base point.
695
+ * @param settings - Mutable rectangle settings.
696
+ * @returns `true` when value is accepted, otherwise `false`.
697
+ */
698
+ AcApRectCmd.prototype.promptRotation = function (context, firstPoint, settings) {
699
+ return __awaiter(this, void 0, void 0, function () {
700
+ var prompt, result;
701
+ var _a;
702
+ return __generator(this, function (_b) {
703
+ switch (_b.label) {
704
+ case 0:
705
+ prompt = new AcEdPromptAngleOptions(AcApI18n.t('jig.rect.rotationAngle'));
706
+ prompt.useBasePoint = true;
707
+ prompt.useDashedLine = true;
708
+ prompt.basePoint = new AcGePoint3d(firstPoint);
709
+ prompt.allowNegative = true;
710
+ prompt.allowZero = true;
711
+ prompt.jig = new AcApRectStaticJig(context.view, firstPoint, { mode: 'dimensions', length: 1, width: 1 }, settings);
712
+ return [4 /*yield*/, AcApDocManager.instance.editor.getAngle(prompt)];
713
+ case 1:
714
+ result = _b.sent();
715
+ if (result.status !== AcEdPromptStatus.OK)
716
+ return [2 /*return*/, false];
717
+ settings.rotation = (((_a = result.value) !== null && _a !== void 0 ? _a : 0) * Math.PI) / 180;
718
+ return [2 /*return*/, true];
719
+ }
720
+ });
721
+ });
722
+ };
723
+ /**
724
+ * Prompts rectangle length and width explicitly.
725
+ *
726
+ * @param context - Current application/document context.
727
+ * @param firstPoint - First corner point.
728
+ * @param settings - Mutable rectangle settings.
729
+ * @returns Dimension-based build input, or `undefined` on cancel.
730
+ */
731
+ AcApRectCmd.prototype.promptDimensions = function (context, firstPoint, settings) {
732
+ return __awaiter(this, void 0, void 0, function () {
733
+ var seedInput, length, width;
734
+ return __generator(this, function (_a) {
735
+ switch (_a.label) {
736
+ case 0:
737
+ seedInput = {
738
+ mode: 'dimensions',
739
+ length: 1,
740
+ width: 1
741
+ };
742
+ return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.dimensionLength'), new AcApRectStaticJig(context.view, firstPoint, seedInput, settings))];
743
+ case 1:
744
+ length = _a.sent();
745
+ if (!isPositive(length))
746
+ return [2 /*return*/, undefined];
747
+ return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.dimensionWidth'), new AcApRectStaticJig(context.view, firstPoint, { mode: 'dimensions', length: length, width: 1 }, settings))];
748
+ case 2:
749
+ width = _a.sent();
750
+ if (!isPositive(width))
751
+ return [2 /*return*/, undefined];
752
+ return [2 /*return*/, {
753
+ mode: 'dimensions',
754
+ length: length,
755
+ width: width
756
+ }];
757
+ }
758
+ });
759
+ });
760
+ };
761
+ /**
762
+ * Prompts rectangle area, then asks for either known length or known width.
763
+ *
764
+ * @param context - Current application/document context.
765
+ * @param firstPoint - First corner point.
766
+ * @param settings - Mutable rectangle settings.
767
+ * @returns Dimension-based build input derived from area, or `undefined`.
768
+ */
769
+ AcApRectCmd.prototype.promptArea = function (context, firstPoint, settings) {
770
+ return __awaiter(this, void 0, void 0, function () {
771
+ var area, knownPrompt, knownResult, width, length;
772
+ return __generator(this, function (_a) {
773
+ switch (_a.label) {
774
+ case 0: return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.areaValue'), new AcApRectStaticJig(context.view, firstPoint, { mode: 'dimensions', length: 1, width: 1 }, settings))];
775
+ case 1:
776
+ area = _a.sent();
777
+ if (!isPositive(area))
778
+ return [2 /*return*/, undefined];
779
+ knownPrompt = new AcEdPromptDoubleOptions(AcApI18n.t('jig.rect.areaLengthOrWidth'));
780
+ addDoubleKeyword(knownPrompt, 'rectWidth');
781
+ knownPrompt.allowNegative = false;
782
+ knownPrompt.allowZero = false;
783
+ knownPrompt.jig = new AcApRectStaticJig(context.view, firstPoint, { mode: 'dimensions', length: 1, width: 1 }, settings);
784
+ return [4 /*yield*/, AcApDocManager.instance.editor.getDouble(knownPrompt)];
785
+ case 2:
786
+ knownResult = _a.sent();
787
+ if (!(knownResult.status === AcEdPromptStatus.Keyword)) return [3 /*break*/, 4];
788
+ if (knownResult.stringResult !== 'Width')
789
+ return [2 /*return*/, undefined];
790
+ return [4 /*yield*/, this.promptPositiveDouble(AcApI18n.t('jig.rect.areaSpecifyWidth'), new AcApRectStaticJig(context.view, firstPoint, { mode: 'dimensions', length: 1, width: 1 }, settings))];
791
+ case 3:
792
+ width = _a.sent();
793
+ if (!isPositive(width))
794
+ return [2 /*return*/, undefined];
795
+ return [2 /*return*/, {
796
+ mode: 'dimensions',
797
+ length: (area !== null && area !== void 0 ? area : 0) / (width !== null && width !== void 0 ? width : 1),
798
+ width: width
799
+ }];
800
+ case 4:
801
+ if (knownResult.status !== AcEdPromptStatus.OK)
802
+ return [2 /*return*/, undefined];
803
+ if (!isPositive(knownResult.value))
804
+ return [2 /*return*/, undefined];
805
+ length = knownResult.value;
806
+ return [2 /*return*/, {
807
+ mode: 'dimensions',
808
+ length: length,
809
+ width: (area !== null && area !== void 0 ? area : 0) / length
810
+ }];
811
+ }
812
+ });
813
+ });
814
+ };
815
+ /**
816
+ * Last-used rectangle settings persisted between command invocations.
817
+ */
818
+ AcApRectCmd._settings = cloneRectSettings(DEFAULT_RECT_SETTINGS);
131
819
  return AcApRectCmd;
132
820
  }(AcEdCommand));
133
821
  export { AcApRectCmd };