@mlightcad/cad-simple-viewer 1.4.10 → 1.4.12
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.
- package/LICENSE +21 -21
- package/README.md +88 -88
- package/dist/index.js +21257 -14069
- package/dist/index.umd.cjs +201 -76
- package/dist/libredwg-parser-worker.js +6604 -12157
- package/dist/mtext-renderer-worker.js +28725 -28097
- package/lib/app/AcApAnnotation.d.ts.map +1 -1
- package/lib/app/AcApAnnotation.js +3 -3
- package/lib/app/AcApAnnotation.js.map +1 -1
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +3 -3
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +24 -1
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +67 -12
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +6 -0
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +14 -2
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApProgress.d.ts.map +1 -1
- package/lib/app/AcApProgress.js +3 -3
- package/lib/app/AcApProgress.js.map +1 -1
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +3 -1
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -1
- package/lib/command/AcApArcCmd.d.ts +140 -0
- package/lib/command/AcApArcCmd.d.ts.map +1 -0
- package/lib/command/AcApArcCmd.js +1009 -0
- package/lib/command/AcApArcCmd.js.map +1 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -1
- package/lib/command/AcApCircleCmd.js +10 -4
- package/lib/command/AcApCircleCmd.js.map +1 -1
- package/lib/command/AcApClearMeasurementsCmd.d.ts +13 -0
- package/lib/command/AcApClearMeasurementsCmd.d.ts.map +1 -0
- package/lib/command/AcApClearMeasurementsCmd.js +84 -0
- package/lib/command/AcApClearMeasurementsCmd.js.map +1 -0
- package/lib/command/AcApConvertToDxfCmd.d.ts +9 -0
- package/lib/command/AcApConvertToDxfCmd.d.ts.map +1 -0
- package/lib/command/AcApConvertToDxfCmd.js +75 -0
- package/lib/command/AcApConvertToDxfCmd.js.map +1 -0
- package/lib/command/AcApDimLinearCmd.d.ts.map +1 -1
- package/lib/command/AcApDimLinearCmd.js +14 -5
- package/lib/command/AcApDimLinearCmd.js.map +1 -1
- package/lib/command/AcApDxfConvertor.d.ts +12 -0
- package/lib/command/AcApDxfConvertor.d.ts.map +1 -0
- package/lib/command/AcApDxfConvertor.js +37 -0
- package/lib/command/AcApDxfConvertor.js.map +1 -0
- package/lib/command/AcApEraseCmd.d.ts.map +1 -1
- package/lib/command/AcApEraseCmd.js +10 -6
- package/lib/command/AcApEraseCmd.js.map +1 -1
- package/lib/command/AcApLineCmd.d.ts.map +1 -1
- package/lib/command/AcApLineCmd.js +10 -4
- package/lib/command/AcApLineCmd.js.map +1 -1
- package/lib/command/AcApLogCmd.js +3 -3
- package/lib/command/AcApLogCmd.js.map +1 -1
- package/lib/command/AcApMTextCmd.d.ts +12 -0
- package/lib/command/AcApMTextCmd.d.ts.map +1 -0
- package/lib/command/AcApMTextCmd.js +123 -0
- package/lib/command/AcApMTextCmd.js.map +1 -0
- package/lib/command/AcApMeasureAngleCmd.d.ts +15 -0
- package/lib/command/AcApMeasureAngleCmd.d.ts.map +1 -0
- package/lib/command/AcApMeasureAngleCmd.js +369 -0
- package/lib/command/AcApMeasureAngleCmd.js.map +1 -0
- package/lib/command/AcApMeasureArcCmd.d.ts +25 -0
- package/lib/command/AcApMeasureArcCmd.d.ts.map +1 -0
- package/lib/command/AcApMeasureArcCmd.js +429 -0
- package/lib/command/AcApMeasureArcCmd.js.map +1 -0
- package/lib/command/AcApMeasureAreaCmd.d.ts +21 -0
- package/lib/command/AcApMeasureAreaCmd.d.ts.map +1 -0
- package/lib/command/AcApMeasureAreaCmd.js +387 -0
- package/lib/command/AcApMeasureAreaCmd.js.map +1 -0
- package/lib/command/AcApMeasureDistanceCmd.d.ts +34 -0
- package/lib/command/AcApMeasureDistanceCmd.d.ts.map +1 -0
- package/lib/command/AcApMeasureDistanceCmd.js +191 -0
- package/lib/command/AcApMeasureDistanceCmd.js.map +1 -0
- package/lib/command/AcApPolylineCmd.d.ts +71 -0
- package/lib/command/AcApPolylineCmd.d.ts.map +1 -0
- package/lib/command/AcApPolylineCmd.js +569 -0
- package/lib/command/AcApPolylineCmd.js.map +1 -0
- package/lib/command/AcApRectCmd.d.ts.map +1 -1
- package/lib/command/AcApRectCmd.js +10 -4
- package/lib/command/AcApRectCmd.js.map +1 -1
- package/lib/command/AcApRevCloudCmd.d.ts.map +1 -1
- package/lib/command/AcApRevCloudCmd.js +10 -4
- package/lib/command/AcApRevCloudCmd.js.map +1 -1
- package/lib/command/AcApSketchCmd.d.ts.map +1 -1
- package/lib/command/AcApSketchCmd.js +11 -7
- package/lib/command/AcApSketchCmd.js.map +1 -1
- package/lib/command/AcApSplineCmd.d.ts +20 -0
- package/lib/command/AcApSplineCmd.d.ts.map +1 -0
- package/lib/command/AcApSplineCmd.js +213 -0
- package/lib/command/AcApSplineCmd.js.map +1 -0
- package/lib/command/AcApSwitchBgCmd.js +2 -2
- package/lib/command/AcApSwitchBgCmd.js.map +1 -1
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
- package/lib/command/AcApSysVarCmd.js +20 -7
- package/lib/command/AcApSysVarCmd.js.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +10 -5
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/command/index.d.ts +11 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +11 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandIterator.js.map +1 -1
- package/lib/editor/global/AcEdConditionWaiter.d.ts +1 -1
- package/lib/editor/global/AcEdConditionWaiter.d.ts.map +1 -1
- package/lib/editor/global/AcEdConditionWaiter.js +3 -2
- package/lib/editor/global/AcEdConditionWaiter.js.map +1 -1
- package/lib/editor/global/AcEdUiTheme.d.ts +4 -0
- package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -0
- package/lib/editor/global/AcEdUiTheme.js +44 -0
- package/lib/editor/global/AcEdUiTheme.js.map +1 -0
- package/lib/editor/global/index.d.ts +1 -0
- package/lib/editor/global/index.d.ts.map +1 -1
- package/lib/editor/global/index.js +1 -0
- package/lib/editor/global/index.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +10 -0
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +26 -6
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdInputModifiers.d.ts +39 -0
- package/lib/editor/input/AcEdInputModifiers.d.ts.map +1 -0
- package/lib/editor/input/AcEdInputModifiers.js +2 -0
- package/lib/editor/input/AcEdInputModifiers.js.map +1 -0
- package/lib/editor/input/AcEdInputToggles.d.ts +24 -0
- package/lib/editor/input/AcEdInputToggles.d.ts.map +1 -0
- package/lib/editor/input/AcEdInputToggles.js +2 -0
- package/lib/editor/input/AcEdInputToggles.js.map +1 -0
- package/lib/editor/input/AcEdPromptStateMachine.d.ts +110 -0
- package/lib/editor/input/AcEdPromptStateMachine.d.ts.map +1 -0
- package/lib/editor/input/AcEdPromptStateMachine.js +147 -0
- package/lib/editor/input/AcEdPromptStateMachine.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +58 -9
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +98 -3
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/index.d.ts +3 -0
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +3 -0
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.js +3 -3
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -1
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdKeywordCollection.js +11 -4
- package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +20 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +80 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptBoxResult.d.ts +12 -0
- package/lib/editor/input/prompt/AcEdPromptBoxResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptBoxResult.js +30 -0
- package/lib/editor/input/prompt/AcEdPromptBoxResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleResult.d.ts +9 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleResult.js +28 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptEntityOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptEntityOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptEntityOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptEntityResult.d.ts +14 -0
- package/lib/editor/input/prompt/AcEdPromptEntityResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptEntityResult.js +31 -0
- package/lib/editor/input/prompt/AcEdPromptEntityResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerResult.d.ts +9 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerResult.js +28 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptKeywordOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +3 -2
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptOptions.js +15 -4
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +3 -3
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionResult.d.ts +12 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionResult.js +30 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +1 -1
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +2 -2
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -1
- package/lib/editor/input/prompt/index.d.ts +10 -0
- package/lib/editor/input/prompt/index.d.ts.map +1 -1
- package/lib/editor/input/prompt/index.js +10 -0
- package/lib/editor/input/prompt/index.js.map +1 -1
- package/lib/editor/input/session/AcEdKeywordSession.d.ts +2 -1
- package/lib/editor/input/session/AcEdKeywordSession.d.ts.map +1 -1
- package/lib/editor/input/session/AcEdKeywordSession.js +7 -1
- package/lib/editor/input/session/AcEdKeywordSession.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +4 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +34 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +23 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +140 -26
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +2 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +4 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +7 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +14 -6
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +5 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts +12 -0
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.js +61 -2
- package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +47 -13
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +854 -389
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.d.ts +79 -0
- package/lib/editor/input/ui/AcEdMTextEditor.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMTextEditor.js +157 -0
- package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.js +1 -1
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
- package/lib/editor/input/ui/index.d.ts +2 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -1
- package/lib/editor/input/ui/index.js +1 -0
- package/lib/editor/input/ui/index.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +81 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +173 -1
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
- package/lib/i18n/en/command.d.ts +21 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +21 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +131 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +131 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +21 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +21 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +131 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +131 -0
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/plugin/AcApPluginExample.d.ts.map +1 -1
- package/lib/plugin/AcApPluginExample.js +7 -6
- package/lib/plugin/AcApPluginExample.js.map +1 -1
- package/lib/plugin/AcApPluginManager.d.ts +4 -4
- package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
- package/lib/plugin/AcApPluginManager.js +7 -6
- package/lib/plugin/AcApPluginManager.js.map +1 -1
- package/lib/util/AcApMeasurementElementGenerator.d.ts +36 -0
- package/lib/util/AcApMeasurementElementGenerator.d.ts.map +1 -0
- package/lib/util/AcApMeasurementElementGenerator.js +92 -0
- package/lib/util/AcApMeasurementElementGenerator.js.map +1 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +14 -0
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +21 -0
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +11 -0
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +30 -0
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +7 -1
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +16 -2
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +16 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +145 -56
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +10 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLogCmd.js","sourceRoot":"","sources":["../../src/command/AcApLogCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApLogCmd.js","sourceRoot":"","sources":["../../src/command/AcApLogCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,wBAAwB,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAGrE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;GAGG;AACH;IAAgC,8BAAW;IAA3C;;IAiHA,CAAC;IAhHO,4BAAO,GAAb,UAAc,OAAoB;;;gBAChC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;gBAC/B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;gBACxB,IAAI,CAAC,oBAAoB,EAAE,CAAA;;;;KAC5B;IAEO,sCAAiB,GAAzB,UAA0B,OAAoB;QAC5C,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAA;QACpE,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,UAAA,EAAE;YACtC,IAAM,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C,SAAS,GAAG,IAAI,CACzC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACZ,uBAAuB,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc;oBAC/D,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI;oBACpE,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI;oBACpE,uBAAuB,EACrB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK;oBAC/C,uBAAuB,EACrB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK;oBAC/C,sBAAsB,EAAE,CACtB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,GAAG,IAAI,CACxC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACZ,0BAA0B,EAAE,CAC1B,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CACvC,CAAC,OAAO,CAAC,CAAC,CAAC;iBACb;aACF,CAAC,CAAA;YACF,OAAO,CAAC,QAAQ,EAAE,CAAA;;QAvFpB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK;oBAA1C,KAAK;SAwFb;IACH,CAAC;IAEO,yCAAoB,GAA5B;QACE,wBAAwB,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAA;IACnD,CAAC;IACH,iBAAC;AAAD,CAAC,AAjHD,CAAgC,WAAW,GAiH1C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcEdCommand } from '../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Command to create one mtext entity.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcApMTextCmd extends AcEdCommand {
|
|
7
|
+
private readonly mtextEditor;
|
|
8
|
+
constructor();
|
|
9
|
+
execute(context: AcApContext): Promise<void>;
|
|
10
|
+
private pixelsToWorldY;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AcApMTextCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMTextCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApMTextCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EACL,WAAW,EAKZ,MAAM,WAAW,CAAA;AAIlB;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwB;;IAO9C,OAAO,CAAC,OAAO,EAAE,WAAW;IA4ClC,OAAO,CAAC,cAAc;CAKvB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcDbMText } from '@mlightcad/data-model';
|
|
53
|
+
import { AcApDocManager } from '../app';
|
|
54
|
+
import { AcEdCommand, AcEdMTextEditor, AcEdOpenMode, AcEdPromptBoxOptions, AcEdPromptStatus } from '../editor';
|
|
55
|
+
import { AcApI18n } from '../i18n';
|
|
56
|
+
/**
|
|
57
|
+
* Command to create one mtext entity.
|
|
58
|
+
*/
|
|
59
|
+
var AcApMTextCmd = /** @class */ (function (_super) {
|
|
60
|
+
__extends(AcApMTextCmd, _super);
|
|
61
|
+
function AcApMTextCmd() {
|
|
62
|
+
var _this = _super.call(this) || this;
|
|
63
|
+
_this.mtextEditor = new AcEdMTextEditor();
|
|
64
|
+
_this.mode = AcEdOpenMode.Write;
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
AcApMTextCmd.prototype.execute = function (context) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
var boxPrompt, boxResult, box, width, view, textHeight, location, toolbarFontFamilies, result, contents, mtext;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
switch (_a.label) {
|
|
72
|
+
case 0:
|
|
73
|
+
boxPrompt = new AcEdPromptBoxOptions(AcApI18n.t('main.inputManager.firstCorner'), AcApI18n.t('main.inputManager.secondCorner'));
|
|
74
|
+
boxPrompt.useBasePoint = false;
|
|
75
|
+
boxPrompt.useDashedLine = false;
|
|
76
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getBox(boxPrompt)];
|
|
77
|
+
case 1:
|
|
78
|
+
boxResult = _a.sent();
|
|
79
|
+
if (boxResult.status !== AcEdPromptStatus.OK || !boxResult.value)
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
box = boxResult.value;
|
|
82
|
+
width = Math.max(Math.abs(box.max.x - box.min.x), 1e-4);
|
|
83
|
+
view = context.view;
|
|
84
|
+
textHeight = this.pixelsToWorldY(view, 24);
|
|
85
|
+
location = { x: box.min.x, y: box.max.y, z: 0 };
|
|
86
|
+
toolbarFontFamilies = Array.from(new Set(AcApDocManager.instance.avaiableFonts
|
|
87
|
+
.flatMap(function (fontInfo) { return fontInfo.name; })
|
|
88
|
+
.map(function (fontName) { return fontName.trim(); })
|
|
89
|
+
.filter(function (fontName) { return fontName.length > 0; })));
|
|
90
|
+
return [4 /*yield*/, this.mtextEditor.open({
|
|
91
|
+
view: view,
|
|
92
|
+
location: location,
|
|
93
|
+
width: width,
|
|
94
|
+
textHeight: textHeight,
|
|
95
|
+
toolbarFontFamilies: toolbarFontFamilies
|
|
96
|
+
})];
|
|
97
|
+
case 2:
|
|
98
|
+
result = _a.sent();
|
|
99
|
+
if (!result)
|
|
100
|
+
return [2 /*return*/];
|
|
101
|
+
contents = result.contents.trim();
|
|
102
|
+
if (!contents)
|
|
103
|
+
return [2 /*return*/];
|
|
104
|
+
mtext = new AcDbMText();
|
|
105
|
+
mtext.location = location;
|
|
106
|
+
mtext.contents = result.contents;
|
|
107
|
+
mtext.width = result.width;
|
|
108
|
+
mtext.height = result.height;
|
|
109
|
+
context.doc.database.tables.blockTable.modelSpace.appendEntity(mtext);
|
|
110
|
+
return [2 /*return*/];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
AcApMTextCmd.prototype.pixelsToWorldY = function (view, pixels) {
|
|
116
|
+
var p0 = view.screenToWorld({ x: 0, y: 0 });
|
|
117
|
+
var p1 = view.screenToWorld({ x: 0, y: pixels });
|
|
118
|
+
return Math.max(Math.abs(p1.y - p0.y), 1e-4);
|
|
119
|
+
};
|
|
120
|
+
return AcApMTextCmd;
|
|
121
|
+
}(AcEdCommand));
|
|
122
|
+
export { AcApMTextCmd };
|
|
123
|
+
//# sourceMappingURL=AcApMTextCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMTextCmd.js","sourceRoot":"","sources":["../../src/command/AcApMTextCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAe,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAGlC;;GAEG;AACH;IAAkC,gCAAW;IAG3C;QACE,YAAA,MAAK,WAAE,SAAA;QAHQ,iBAAW,GAAG,IAAI,eAAe,EAAE,CAAA;QAIlD,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAEK,8BAAO,GAAb,UAAc,OAAoB;;;;;;wBAC1B,SAAS,GAAG,IAAI,oBAAoB,CACxC,QAAQ,CAAC,CAAC,CAAC,+BAA+B,CAAC,EAC3C,QAAQ,CAAC,CAAC,CAAC,gCAAgC,CAAC,CAC7C,CAAA;wBACD,SAAS,CAAC,YAAY,GAAG,KAAK,CAAA;wBAC9B,SAAS,CAAC,aAAa,GAAG,KAAK,CAAA;wBACb,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAA;;wBAAlE,SAAS,GAAG,SAAsD;wBACxE,IAAI,SAAS,CAAC,MAAM,KAAK,gBAAgB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK;4BAAE,sBAAM;wBAClE,GAAG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KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAA;wBACzB,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;wBAChC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;wBAC1B,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;wBAE5B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;;;;;KACtE;IAEO,qCAAc,GAAtB,UAAuB,IAAgB,EAAE,MAAc;QACrD,IAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;QAC7C,IAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IACH,mBAAC;AAAD,CAAC,AAzDD,CAAkC,WAAW,GAyD5C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcEdCommand } from '../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Command that measures the angle between two arms sharing a common vertex.
|
|
5
|
+
*
|
|
6
|
+
* Prompts the user to pick three world points: the vertex, a point on the
|
|
7
|
+
* first arm, and a point on the second arm. After the second arm is confirmed,
|
|
8
|
+
* transient CAD lines are added for both arms and persistent DOM overlays
|
|
9
|
+
* (arc canvas + dots + badge) are placed via {@link AcTrHtmlTransientManager}.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AcApMeasureAngleCmd extends AcEdCommand {
|
|
12
|
+
constructor();
|
|
13
|
+
execute(context: AcApContext): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=AcApMeasureAngleCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureAngleCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApMeasureAngleCmd.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAEL,WAAW,EAOZ,MAAM,WAAW,CAAA;AAkOlB;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;;IAM5C,OAAO,CAAC,OAAO,EAAE,WAAW;CAoKnC"}
|
|
@@ -0,0 +1,369 @@
|
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcDbLine, AcGiLineWeight } from '@mlightcad/data-model';
|
|
53
|
+
import { AcEdCommand, AcEdCorsorType, AcEdOpenMode, AcEdPreviewJig, AcEdPromptPointOptions, AcEdPromptStatus, AcEdViewMode } from '../editor';
|
|
54
|
+
import { AcApI18n } from '../i18n';
|
|
55
|
+
import { cssColor, makeBadge, makeDot, makeLiveBadge, makeOverlayCanvas, measurementColor } from '../util';
|
|
56
|
+
import { registerMeasurementCleanup } from './AcApClearMeasurementsCmd';
|
|
57
|
+
/** Returns the angle in degrees between two arms sharing a common vertex. */
|
|
58
|
+
function calcAngleDeg(vertex, arm1, arm2) {
|
|
59
|
+
var dx1 = arm1.x - vertex.x;
|
|
60
|
+
var dy1 = arm1.y - vertex.y;
|
|
61
|
+
var dx2 = arm2.x - vertex.x;
|
|
62
|
+
var dy2 = arm2.y - vertex.y;
|
|
63
|
+
var dot = dx1 * dx2 + dy1 * dy2;
|
|
64
|
+
var cross = dx1 * dy2 - dy1 * dx2;
|
|
65
|
+
var rad = Math.atan2(Math.abs(cross), dot);
|
|
66
|
+
return (rad * 180) / Math.PI;
|
|
67
|
+
}
|
|
68
|
+
/** Normalises an angle into [0, 2pi). */
|
|
69
|
+
var normaliseAngle = function (a) {
|
|
70
|
+
return ((a % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI);
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Draws the first arm (vertex->arm1) as a dashed line on a canvas overlay,
|
|
74
|
+
* used during second arm selection so the user can see the first arm.
|
|
75
|
+
*/
|
|
76
|
+
function drawArm1OnCanvas(canvas, view, vertex, arm1, color) {
|
|
77
|
+
var rect = view.canvas.getBoundingClientRect();
|
|
78
|
+
var dpr = window.devicePixelRatio || 1;
|
|
79
|
+
var w = Math.round(rect.width);
|
|
80
|
+
var h = Math.round(rect.height);
|
|
81
|
+
var origin = view.canvasToContainer({ x: 0, y: 0 });
|
|
82
|
+
canvas.style.left = "".concat(origin.x, "px");
|
|
83
|
+
canvas.style.top = "".concat(origin.y, "px");
|
|
84
|
+
canvas.style.width = "".concat(w, "px");
|
|
85
|
+
canvas.style.height = "".concat(h, "px");
|
|
86
|
+
if (canvas.width !== w * dpr || canvas.height !== h * dpr) {
|
|
87
|
+
canvas.width = w * dpr;
|
|
88
|
+
canvas.height = h * dpr;
|
|
89
|
+
}
|
|
90
|
+
var ctx = canvas.getContext('2d');
|
|
91
|
+
if (!ctx)
|
|
92
|
+
return;
|
|
93
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
94
|
+
ctx.save();
|
|
95
|
+
ctx.scale(dpr, dpr);
|
|
96
|
+
var sv = view.worldToScreen(vertex);
|
|
97
|
+
var sa = view.worldToScreen(arm1);
|
|
98
|
+
ctx.beginPath();
|
|
99
|
+
ctx.moveTo(sv.x, sv.y);
|
|
100
|
+
ctx.lineTo(sa.x, sa.y);
|
|
101
|
+
ctx.strokeStyle = cssColor(color);
|
|
102
|
+
ctx.lineWidth = 2;
|
|
103
|
+
ctx.setLineDash([8, 5]);
|
|
104
|
+
ctx.stroke();
|
|
105
|
+
ctx.setLineDash([]);
|
|
106
|
+
ctx.restore();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Draws an arc between two arms on a canvas overlay for the persistent
|
|
110
|
+
* angle visualization.
|
|
111
|
+
*/
|
|
112
|
+
function drawAngleArcOnCanvas(canvas, view, vertex, arm1, arm2, color) {
|
|
113
|
+
var rect = view.canvas.getBoundingClientRect();
|
|
114
|
+
var dpr = window.devicePixelRatio || 1;
|
|
115
|
+
var w = Math.round(rect.width);
|
|
116
|
+
var h = Math.round(rect.height);
|
|
117
|
+
var origin = view.canvasToContainer({ x: 0, y: 0 });
|
|
118
|
+
canvas.style.left = "".concat(origin.x, "px");
|
|
119
|
+
canvas.style.top = "".concat(origin.y, "px");
|
|
120
|
+
canvas.style.width = "".concat(w, "px");
|
|
121
|
+
canvas.style.height = "".concat(h, "px");
|
|
122
|
+
if (canvas.width !== w * dpr || canvas.height !== h * dpr) {
|
|
123
|
+
canvas.width = w * dpr;
|
|
124
|
+
canvas.height = h * dpr;
|
|
125
|
+
}
|
|
126
|
+
var ctx = canvas.getContext('2d');
|
|
127
|
+
if (!ctx)
|
|
128
|
+
return;
|
|
129
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
130
|
+
ctx.save();
|
|
131
|
+
ctx.scale(dpr, dpr);
|
|
132
|
+
var sv = view.worldToScreen(vertex);
|
|
133
|
+
var sa1 = view.worldToScreen(arm1);
|
|
134
|
+
var sa2 = view.worldToScreen(arm2);
|
|
135
|
+
var len1 = Math.hypot(sa1.x - sv.x, sa1.y - sv.y);
|
|
136
|
+
var len2 = Math.hypot(sa2.x - sv.x, sa2.y - sv.y);
|
|
137
|
+
var arcR = Math.max(Math.min(len1, len2) * 0.3, 15);
|
|
138
|
+
var startAngle = Math.atan2(sa1.y - sv.y, sa1.x - sv.x);
|
|
139
|
+
var endAngle = Math.atan2(sa2.y - sv.y, sa2.x - sv.x);
|
|
140
|
+
var antiClockwise = normaliseAngle(endAngle - startAngle) > Math.PI;
|
|
141
|
+
ctx.beginPath();
|
|
142
|
+
ctx.arc(sv.x, sv.y, arcR, startAngle, endAngle, antiClockwise);
|
|
143
|
+
ctx.strokeStyle = cssColor(color);
|
|
144
|
+
ctx.lineWidth = 2;
|
|
145
|
+
ctx.stroke();
|
|
146
|
+
ctx.restore();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Simple rubber-band jig for picking arm1: draws a transient line
|
|
150
|
+
* from vertex to cursor.
|
|
151
|
+
*/
|
|
152
|
+
var AcApMeasureArm1Jig = /** @class */ (function (_super) {
|
|
153
|
+
__extends(AcApMeasureArm1Jig, _super);
|
|
154
|
+
function AcApMeasureArm1Jig(view, vertex, color) {
|
|
155
|
+
var _this = _super.call(this, view) || this;
|
|
156
|
+
_this._line = new AcDbLine(vertex, vertex);
|
|
157
|
+
_this._line.color = color;
|
|
158
|
+
_this._line.lineWeight = AcGiLineWeight.LineWeight070;
|
|
159
|
+
return _this;
|
|
160
|
+
}
|
|
161
|
+
Object.defineProperty(AcApMeasureArm1Jig.prototype, "entity", {
|
|
162
|
+
get: function () {
|
|
163
|
+
return this._line;
|
|
164
|
+
},
|
|
165
|
+
enumerable: false,
|
|
166
|
+
configurable: true
|
|
167
|
+
});
|
|
168
|
+
AcApMeasureArm1Jig.prototype.update = function (p) {
|
|
169
|
+
this._line.endPoint = p;
|
|
170
|
+
};
|
|
171
|
+
return AcApMeasureArm1Jig;
|
|
172
|
+
}(AcEdPreviewJig));
|
|
173
|
+
/**
|
|
174
|
+
* Preview jig for picking arm2: draws a transient line from vertex to
|
|
175
|
+
* cursor, redraws the first arm as a dashed canvas line, and shows a live
|
|
176
|
+
* angle badge.
|
|
177
|
+
*/
|
|
178
|
+
var AcApMeasureAngleJig = /** @class */ (function (_super) {
|
|
179
|
+
__extends(AcApMeasureAngleJig, _super);
|
|
180
|
+
function AcApMeasureAngleJig(view, vertex, arm1, canvas, color) {
|
|
181
|
+
var _this = _super.call(this, view) || this;
|
|
182
|
+
_this._vertex = vertex;
|
|
183
|
+
_this._arm1 = arm1;
|
|
184
|
+
_this._view = view;
|
|
185
|
+
_this._canvas = canvas;
|
|
186
|
+
_this._color = color;
|
|
187
|
+
_this._line = new AcDbLine(vertex, vertex);
|
|
188
|
+
_this._line.color = color;
|
|
189
|
+
_this._line.lineWeight = AcGiLineWeight.LineWeight070;
|
|
190
|
+
_this._badge = makeLiveBadge(color);
|
|
191
|
+
return _this;
|
|
192
|
+
}
|
|
193
|
+
Object.defineProperty(AcApMeasureAngleJig.prototype, "entity", {
|
|
194
|
+
get: function () {
|
|
195
|
+
return this._line;
|
|
196
|
+
},
|
|
197
|
+
enumerable: false,
|
|
198
|
+
configurable: true
|
|
199
|
+
});
|
|
200
|
+
AcApMeasureAngleJig.prototype.update = function (p) {
|
|
201
|
+
this._line.endPoint = p;
|
|
202
|
+
// Redraw the first arm dashed line (stays in sync with pan/zoom)
|
|
203
|
+
drawArm1OnCanvas(this._canvas, this._view, this._vertex, this._arm1, this._color);
|
|
204
|
+
var deg = calcAngleDeg(this._vertex, this._arm1, p);
|
|
205
|
+
this._badge.textContent = "~ ".concat(deg.toFixed(2), "\u00B0");
|
|
206
|
+
this._badge.style.display = 'block';
|
|
207
|
+
var rect = this._view.canvas.getBoundingClientRect();
|
|
208
|
+
var sv = this._view.worldToScreen(this._vertex);
|
|
209
|
+
this._badge.style.left = "".concat(sv.x + rect.left, "px");
|
|
210
|
+
this._badge.style.top = "".concat(sv.y + rect.top - 30, "px");
|
|
211
|
+
};
|
|
212
|
+
AcApMeasureAngleJig.prototype.end = function () {
|
|
213
|
+
_super.prototype.end.call(this);
|
|
214
|
+
this._badge.remove();
|
|
215
|
+
};
|
|
216
|
+
return AcApMeasureAngleJig;
|
|
217
|
+
}(AcEdPreviewJig));
|
|
218
|
+
/**
|
|
219
|
+
* Command that measures the angle between two arms sharing a common vertex.
|
|
220
|
+
*
|
|
221
|
+
* Prompts the user to pick three world points: the vertex, a point on the
|
|
222
|
+
* first arm, and a point on the second arm. After the second arm is confirmed,
|
|
223
|
+
* transient CAD lines are added for both arms and persistent DOM overlays
|
|
224
|
+
* (arc canvas + dots + badge) are placed via {@link AcTrHtmlTransientManager}.
|
|
225
|
+
*/
|
|
226
|
+
var AcApMeasureAngleCmd = /** @class */ (function (_super) {
|
|
227
|
+
__extends(AcApMeasureAngleCmd, _super);
|
|
228
|
+
function AcApMeasureAngleCmd() {
|
|
229
|
+
var _this = _super.call(this) || this;
|
|
230
|
+
_this.mode = AcEdOpenMode.Read;
|
|
231
|
+
return _this;
|
|
232
|
+
}
|
|
233
|
+
AcApMeasureAngleCmd.prototype.execute = function (context) {
|
|
234
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
235
|
+
var editor, color;
|
|
236
|
+
var _this = this;
|
|
237
|
+
return __generator(this, function (_a) {
|
|
238
|
+
switch (_a.label) {
|
|
239
|
+
case 0:
|
|
240
|
+
editor = context.view.editor;
|
|
241
|
+
color = measurementColor(context.doc.database);
|
|
242
|
+
return [4 /*yield*/, context.view.withMode(AcEdViewMode.SELECTION, function () {
|
|
243
|
+
return editor.withCursor(AcEdCorsorType.Crosshair, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
244
|
+
var vertexPrompt, vertexResult, vertex, arm1Prompt, arm1Result, arm1, armCanvas, redrawOnViewChange, arm2Prompt, arm2, arm2Result, _a, degrees, line1, line2, persistCanvas, redrawPersist, htManager, id, dx1, dy1, dx2, dy2, wLen1, wLen2, u1x, u1y, u2x, u2y, bx, by, bLen, badgeOffset, badgeWorld;
|
|
245
|
+
return __generator(this, function (_b) {
|
|
246
|
+
switch (_b.label) {
|
|
247
|
+
case 0:
|
|
248
|
+
vertexPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.measureAngle.vertex'));
|
|
249
|
+
return [4 /*yield*/, editor.getPoint(vertexPrompt)];
|
|
250
|
+
case 1:
|
|
251
|
+
vertexResult = _b.sent();
|
|
252
|
+
if (vertexResult.status !== AcEdPromptStatus.OK)
|
|
253
|
+
return [2 /*return*/];
|
|
254
|
+
vertex = vertexResult.value;
|
|
255
|
+
arm1Prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.measureAngle.arm1'));
|
|
256
|
+
arm1Prompt.useBasePoint = true;
|
|
257
|
+
arm1Prompt.jig = new AcApMeasureArm1Jig(context.view, vertex, color);
|
|
258
|
+
return [4 /*yield*/, editor.getPoint(arm1Prompt)];
|
|
259
|
+
case 2:
|
|
260
|
+
arm1Result = _b.sent();
|
|
261
|
+
if (arm1Result.status !== AcEdPromptStatus.OK)
|
|
262
|
+
return [2 /*return*/];
|
|
263
|
+
arm1 = arm1Result.value;
|
|
264
|
+
armCanvas = makeOverlayCanvas(context.view.container);
|
|
265
|
+
drawArm1OnCanvas(armCanvas, context.view, vertex, arm1, color);
|
|
266
|
+
redrawOnViewChange = function () {
|
|
267
|
+
return drawArm1OnCanvas(armCanvas, context.view, vertex, arm1, color);
|
|
268
|
+
};
|
|
269
|
+
context.view.events.viewChanged.addEventListener(redrawOnViewChange);
|
|
270
|
+
arm2Prompt = new AcEdPromptPointOptions(AcApI18n.t('jig.measureAngle.arm2'));
|
|
271
|
+
arm2Prompt.jig = new AcApMeasureAngleJig(context.view, vertex, arm1, armCanvas, color);
|
|
272
|
+
_b.label = 3;
|
|
273
|
+
case 3:
|
|
274
|
+
_b.trys.push([3, 5, , 6]);
|
|
275
|
+
return [4 /*yield*/, editor.getPoint(arm2Prompt)];
|
|
276
|
+
case 4:
|
|
277
|
+
arm2Result = _b.sent();
|
|
278
|
+
if (arm2Result.status !== AcEdPromptStatus.OK) {
|
|
279
|
+
// User pressed ESC / cancelled — clean up construction-phase DOM
|
|
280
|
+
context.view.events.viewChanged.removeEventListener(redrawOnViewChange);
|
|
281
|
+
armCanvas.remove();
|
|
282
|
+
return [2 /*return*/];
|
|
283
|
+
}
|
|
284
|
+
arm2 = arm2Result.value;
|
|
285
|
+
return [3 /*break*/, 6];
|
|
286
|
+
case 5:
|
|
287
|
+
_a = _b.sent();
|
|
288
|
+
// User pressed ESC / cancelled — clean up construction-phase DOM
|
|
289
|
+
context.view.events.viewChanged.removeEventListener(redrawOnViewChange);
|
|
290
|
+
armCanvas.remove();
|
|
291
|
+
return [2 /*return*/];
|
|
292
|
+
case 6:
|
|
293
|
+
// Clean up construction-phase canvas
|
|
294
|
+
context.view.events.viewChanged.removeEventListener(redrawOnViewChange);
|
|
295
|
+
armCanvas.remove();
|
|
296
|
+
degrees = calcAngleDeg(vertex, arm1, arm2);
|
|
297
|
+
line1 = new AcDbLine(vertex, arm1);
|
|
298
|
+
line1.color = color;
|
|
299
|
+
line1.lineWeight = AcGiLineWeight.LineWeight070;
|
|
300
|
+
context.view.addTransientEntity(line1);
|
|
301
|
+
line2 = new AcDbLine(vertex, arm2);
|
|
302
|
+
line2.color = color;
|
|
303
|
+
line2.lineWeight = AcGiLineWeight.LineWeight070;
|
|
304
|
+
context.view.addTransientEntity(line2);
|
|
305
|
+
persistCanvas = makeOverlayCanvas(context.view.container);
|
|
306
|
+
drawAngleArcOnCanvas(persistCanvas, context.view, vertex, arm1, arm2, color);
|
|
307
|
+
redrawPersist = function () {
|
|
308
|
+
return drawAngleArcOnCanvas(persistCanvas, context.view, vertex, arm1, arm2, color);
|
|
309
|
+
};
|
|
310
|
+
context.view.events.viewChanged.addEventListener(redrawPersist);
|
|
311
|
+
htManager = context.view.htmlTransientManager;
|
|
312
|
+
id = "angle-".concat(Date.now());
|
|
313
|
+
htManager.add("".concat(id, "-dotV"), makeDot(color), vertex, 'measurement');
|
|
314
|
+
htManager.add("".concat(id, "-dot1"), makeDot(color), arm1, 'measurement');
|
|
315
|
+
htManager.add("".concat(id, "-dot2"), makeDot(color), arm2, 'measurement');
|
|
316
|
+
dx1 = arm1.x - vertex.x;
|
|
317
|
+
dy1 = arm1.y - vertex.y;
|
|
318
|
+
dx2 = arm2.x - vertex.x;
|
|
319
|
+
dy2 = arm2.y - vertex.y;
|
|
320
|
+
wLen1 = Math.hypot(dx1, dy1);
|
|
321
|
+
wLen2 = Math.hypot(dx2, dy2);
|
|
322
|
+
u1x = wLen1 > 0 ? dx1 / wLen1 : 1;
|
|
323
|
+
u1y = wLen1 > 0 ? dy1 / wLen1 : 0;
|
|
324
|
+
u2x = wLen2 > 0 ? dx2 / wLen2 : 1;
|
|
325
|
+
u2y = wLen2 > 0 ? dy2 / wLen2 : 0;
|
|
326
|
+
bx = u1x + u2x;
|
|
327
|
+
by = u1y + u2y;
|
|
328
|
+
bLen = Math.hypot(bx, by);
|
|
329
|
+
if (bLen > 0) {
|
|
330
|
+
bx /= bLen;
|
|
331
|
+
by /= bLen;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
// Arms are exactly opposite — use perpendicular
|
|
335
|
+
bx = -u1y;
|
|
336
|
+
by = u1x;
|
|
337
|
+
}
|
|
338
|
+
badgeOffset = Math.max(Math.min(wLen1, wLen2) * 0.4, Math.max(wLen1, wLen2) * 0.15);
|
|
339
|
+
badgeWorld = {
|
|
340
|
+
x: vertex.x + bx * badgeOffset,
|
|
341
|
+
y: vertex.y + by * badgeOffset
|
|
342
|
+
};
|
|
343
|
+
htManager.add("".concat(id, "-badge"), makeBadge(color, "".concat(degrees.toFixed(2), "\u00B0")), badgeWorld, 'measurement');
|
|
344
|
+
registerMeasurementCleanup(function () {
|
|
345
|
+
context.view.removeTransientEntity(line1.objectId);
|
|
346
|
+
context.view.removeTransientEntity(line2.objectId);
|
|
347
|
+
persistCanvas.remove();
|
|
348
|
+
context.view.events.viewChanged.removeEventListener(redrawPersist);
|
|
349
|
+
htManager.remove("".concat(id, "-dotV"));
|
|
350
|
+
htManager.remove("".concat(id, "-dot1"));
|
|
351
|
+
htManager.remove("".concat(id, "-dot2"));
|
|
352
|
+
htManager.remove("".concat(id, "-badge"));
|
|
353
|
+
});
|
|
354
|
+
return [2 /*return*/];
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}); });
|
|
358
|
+
})];
|
|
359
|
+
case 1:
|
|
360
|
+
_a.sent();
|
|
361
|
+
return [2 /*return*/];
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
return AcApMeasureAngleCmd;
|
|
367
|
+
}(AcEdCommand));
|
|
368
|
+
export { AcApMeasureAngleCmd };
|
|
369
|
+
//# sourceMappingURL=AcApMeasureAngleCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureAngleCmd.js","sourceRoot":"","sources":["../../src/command/AcApMeasureAngleCmd.ts"],"names":[],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F,CA4JE,CACH,EAAA;;wBA9JD,SA8JC,CAAA;;;;;KACF;IACH,0BAAC;AAAD,CAAC,AA1KD,CAAyC,WAAW,GA0KnD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcEdCommand } from '../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Command that measures the length of an arc on an existing circle or arc entity.
|
|
5
|
+
*
|
|
6
|
+
* Uses a two-phase pick flow that mirrors AutoCAD's arc-length measurement:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Phase 1 — entity snap**: The user hovers over a circle or arc in the
|
|
9
|
+
* drawing. A square snap indicator appears on the circumference and the
|
|
10
|
+
* entity geometry is captured. Clicking confirms the start point.
|
|
11
|
+
*
|
|
12
|
+
* 2. **Phase 2 — end point**: The same square indicator follows the cursor,
|
|
13
|
+
* always locked to the captured circle. A canvas overlay draws the shorter
|
|
14
|
+
* arc between the start and current position in real time, together with a
|
|
15
|
+
* live badge showing the arc length.
|
|
16
|
+
*
|
|
17
|
+
* Persistent overlays are placed via {@link AcTrHtmlTransientManager} for dots
|
|
18
|
+
* and badge. The arc canvas is managed with a viewChanged listener cleaned up
|
|
19
|
+
* via {@link registerMeasurementCleanup}.
|
|
20
|
+
*/
|
|
21
|
+
export declare class AcApMeasureArcCmd extends AcEdCommand {
|
|
22
|
+
constructor();
|
|
23
|
+
execute(context: AcApContext): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=AcApMeasureArcCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureArcCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApMeasureArcCmd.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAEL,WAAW,EAOZ,MAAM,WAAW,CAAA;AAwQlB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;;IAM1C,OAAO,CAAC,OAAO,EAAE,WAAW;CAsJnC"}
|