@mlightcad/cad-simple-viewer 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13000 -10094
- package/dist/index.umd.cjs +327 -24
- package/dist/libredwg-parser-worker.js +7267 -7238
- package/dist/mtext-renderer-worker.js +81 -41
- package/lib/app/AcApContext.js +1 -1
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +20 -3
- 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/AcApProgress.d.ts +133 -0
- package/lib/app/AcApProgress.d.ts.map +1 -0
- package/lib/app/AcApProgress.js +148 -0
- package/lib/app/AcApProgress.js.map +1 -0
- package/lib/app/AcApSettingManager.d.ts +42 -0
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +63 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/index.d.ts +0 -1
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +0 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCircleCmd.d.ts +21 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApCircleCmd.js +115 -0
- package/lib/command/AcApCircleCmd.js.map +1 -0
- package/lib/command/AcApDimCmd.d.ts +57 -0
- package/lib/command/AcApDimCmd.d.ts.map +1 -0
- package/lib/command/AcApDimCmd.js +228 -0
- package/lib/command/AcApDimCmd.js.map +1 -0
- package/lib/command/AcApLogCmd.d.ts +13 -0
- package/lib/command/AcApLogCmd.d.ts.map +1 -0
- package/lib/command/AcApLogCmd.js +97 -0
- package/lib/command/AcApLogCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +15 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -0
- package/lib/command/AcApSysVarCmd.js +94 -0
- package/lib/command/AcApSysVarCmd.js.map +1 -0
- package/lib/command/AcApZoomCmd.js +1 -1
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -36
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +4 -61
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/command/index.d.ts +4 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +4 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +19 -1
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +40 -0
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +14 -30
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +32 -31
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts +103 -0
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdPreviewJig.js +82 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +58 -11
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -22
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js +25 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts +8 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js +29 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts +7 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js +28 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +14 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.js +2 -0
- package/lib/editor/input/handler/AcEdInputHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js +44 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js +24 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +16 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.js +19 -0
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.js +24 -0
- package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -0
- package/lib/editor/input/handler/index.d.ts +9 -0
- package/lib/editor/input/handler/index.d.ts.map +1 -0
- package/lib/editor/input/handler/index.js +9 -0
- package/lib/editor/input/handler/index.js.map +1 -0
- package/lib/editor/input/index.d.ts +4 -1
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +4 -1
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +72 -0
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdMarker.js +124 -0
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +52 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +91 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -0
- package/lib/editor/input/marker/index.d.ts +3 -0
- package/lib/editor/input/marker/index.d.ts.map +1 -0
- package/lib/editor/input/marker/index.js +3 -0
- package/lib/editor/input/marker/index.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts +63 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.js +120 -0
- package/lib/editor/input/prompt/AcEdKeyword.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +52 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js +103 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +75 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +182 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +114 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts +10 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js +31 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts +39 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js +84 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +59 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +140 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts +19 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js +36 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +61 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js +179 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +113 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +25 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js +38 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts +27 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js +19 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts +22 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js +23 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +54 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +124 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -0
- package/lib/editor/input/prompt/index.d.ts +11 -0
- package/lib/editor/input/prompt/index.d.ts.map +1 -0
- package/lib/editor/input/prompt/index.js +11 -0
- package/lib/editor/input/prompt/index.js.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +116 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.js +481 -0
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +151 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js +239 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +60 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +104 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +154 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js +2 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts +132 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.js +477 -0
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts +66 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.js +276 -0
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +3 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -0
- package/lib/editor/input/ui/index.js +3 -0
- package/lib/editor/input/ui/index.js.map +1 -0
- package/lib/editor/view/AcEdBaseView.d.ts +54 -16
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -11
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdLayerInfo.d.ts +5 -0
- package/lib/editor/view/AcEdLayerInfo.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +135 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -0
- package/lib/i18n/AcApI18n.js +208 -0
- package/lib/i18n/AcApI18n.js.map +1 -0
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -0
- package/lib/i18n/en/command.js +17 -0
- package/lib/i18n/en/command.js.map +1 -0
- package/lib/i18n/en/jig.d.ts +11 -0
- package/lib/i18n/en/jig.d.ts.map +1 -0
- package/lib/i18n/en/jig.js +10 -0
- package/lib/i18n/en/jig.js.map +1 -0
- package/lib/i18n/en/main.d.ts +37 -0
- package/lib/i18n/en/main.d.ts.map +1 -0
- package/lib/i18n/en/main.js +36 -0
- package/lib/i18n/en/main.js.map +1 -0
- package/lib/i18n/index.d.ts +6 -0
- package/lib/i18n/index.d.ts.map +1 -0
- package/lib/i18n/index.js +31 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -0
- package/lib/i18n/zh/command.js +17 -0
- package/lib/i18n/zh/command.js.map +1 -0
- package/lib/i18n/zh/jig.d.ts +11 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -0
- package/lib/i18n/zh/jig.js +10 -0
- package/lib/i18n/zh/jig.js.map +1 -0
- package/lib/i18n/zh/main.d.ts +37 -0
- package/lib/i18n/zh/main.d.ts.map +1 -0
- package/lib/i18n/zh/main.js +36 -0
- package/lib/i18n/zh/main.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +29 -5
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +44 -6
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +13 -7
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +29 -21
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +22 -8
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +36 -9
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +19 -4
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +135 -43
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +7 -7
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AcDbAlignedDimension, AcDbDatabase, AcGePoint2dLike, AcGePoint3dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcApContext } from '../app';
|
|
3
|
+
import { AcEdBaseView, AcEdCommand, AcEdPreviewJig } from '../editor';
|
|
4
|
+
export declare class AcApDimJig extends AcEdPreviewJig<AcGePoint3dLike> {
|
|
5
|
+
private _db;
|
|
6
|
+
private _dim;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new zoom-to-box jig.
|
|
9
|
+
*
|
|
10
|
+
* @param view - The view that will be zoomed
|
|
11
|
+
*/
|
|
12
|
+
constructor(view: AcEdBaseView, db: AcDbDatabase, xline1Point: AcGePoint3dLike);
|
|
13
|
+
get entity(): AcDbAlignedDimension;
|
|
14
|
+
update(point: AcGePoint3dLike): void;
|
|
15
|
+
private updateBlock;
|
|
16
|
+
private calculateDimPoint;
|
|
17
|
+
private calculateAngle;
|
|
18
|
+
/**
|
|
19
|
+
* Adjust start point and end point of extension line
|
|
20
|
+
* @param extensionLine Input extension line to adjust its start point and end point
|
|
21
|
+
*/
|
|
22
|
+
private adjustExtensionLine;
|
|
23
|
+
/**
|
|
24
|
+
* Return one array which contains three lines of the alinged dimension.
|
|
25
|
+
* - The first line in the array is dimension line.
|
|
26
|
+
* - The second line and the third line in the array are extension lines.
|
|
27
|
+
* @returns Return three lines of the alinged dimension
|
|
28
|
+
*/
|
|
29
|
+
private createLines;
|
|
30
|
+
/**
|
|
31
|
+
* Find the point `p2` on a line starting from `p1` at a specified angle
|
|
32
|
+
* and at a distance `length` from `p1`.
|
|
33
|
+
*
|
|
34
|
+
* @param p1 - The start point of the line.
|
|
35
|
+
* @param angle - The angle of the line in radians relative to the x-axis.
|
|
36
|
+
* @param length - The distance from `p1` to `p2`.
|
|
37
|
+
* @returns Return the point `p2`.
|
|
38
|
+
*/
|
|
39
|
+
protected findPointOnLine(p1: AcGePoint2dLike, angle: number, length: number): AcGePoint2dLike;
|
|
40
|
+
private createExtensionLine;
|
|
41
|
+
/**
|
|
42
|
+
* Compute the intersection point between a line 'line1' and a line 'line2' that passes through
|
|
43
|
+
* a given point 'p' and is perpendicular to line 'line1'.
|
|
44
|
+
*
|
|
45
|
+
* @param line The 'line1'.
|
|
46
|
+
* @param p The point through which the perpendicular 'line2' passes.
|
|
47
|
+
* @returns Returns the intersection point of 'line1' and 'line2'.
|
|
48
|
+
*/
|
|
49
|
+
private findIntersectionPoint;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Example Command to create one aligned dimension.
|
|
53
|
+
*/
|
|
54
|
+
export declare class AcApDimCmd extends AcEdCommand {
|
|
55
|
+
execute(context: AcApContext): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=AcApDimCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApDimCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApDimCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAEpB,YAAY,EAGZ,eAAe,EACf,eAAe,EAEhB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,EAEf,MAAM,WAAW,CAAA;AAGlB,qBAAa,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,IAAI,CAAsB;IAElC;;;;OAIG;gBAED,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,YAAY,EAChB,WAAW,EAAE,eAAe;IAQ9B,IAAI,MAAM,IAAI,oBAAoB,CAEjC;IAED,MAAM,CAAC,KAAK,EAAE,eAAe;IAa7B,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,cAAc;IAMtB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAK3B;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IA8BnB;;;;;;;;OAQG;IACH,SAAS,CAAC,eAAe,CACvB,EAAE,EAAE,eAAe,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,eAAe;IAOlB,OAAO,CAAC,mBAAmB;IAM3B;;;;;;;OAOG;IACH,OAAO,CAAC,qBAAqB;CAqB9B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACnC,OAAO,CAAC,OAAO,EAAE,WAAW;CAiBnC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
29
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
30
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
31
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
32
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
33
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
37
|
+
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);
|
|
38
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
39
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
40
|
+
function step(op) {
|
|
41
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
42
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
43
|
+
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;
|
|
44
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
45
|
+
switch (op[0]) {
|
|
46
|
+
case 0: case 1: t = op; break;
|
|
47
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
48
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
49
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
50
|
+
default:
|
|
51
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
52
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
53
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
54
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
55
|
+
if (t[2]) _.ops.pop();
|
|
56
|
+
_.trys.pop(); continue;
|
|
57
|
+
}
|
|
58
|
+
op = body.call(thisArg, _);
|
|
59
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
60
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
import { AcDbAlignedDimension, AcDbBlockTableRecord, AcDbLine, AcGeLine3d, AcGeVector3d } from '@mlightcad/data-model';
|
|
64
|
+
import { AcApDocManager } from '../app';
|
|
65
|
+
import { AcEdCommand, AcEdPreviewJig, AcEdPromptPointOptions } from '../editor';
|
|
66
|
+
import { AcApI18n } from '../i18n';
|
|
67
|
+
var AcApDimJig = /** @class */ (function (_super) {
|
|
68
|
+
__extends(AcApDimJig, _super);
|
|
69
|
+
/**
|
|
70
|
+
* Creates a new zoom-to-box jig.
|
|
71
|
+
*
|
|
72
|
+
* @param view - The view that will be zoomed
|
|
73
|
+
*/
|
|
74
|
+
function AcApDimJig(view, db, xline1Point) {
|
|
75
|
+
var _this = _super.call(this, view) || this;
|
|
76
|
+
_this._db = db;
|
|
77
|
+
_this._dim = new AcDbAlignedDimension(xline1Point, xline1Point, xline1Point);
|
|
78
|
+
_this._dim.rotation = 0;
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
Object.defineProperty(AcApDimJig.prototype, "entity", {
|
|
82
|
+
get: function () {
|
|
83
|
+
return this._dim;
|
|
84
|
+
},
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
AcApDimJig.prototype.update = function (point) {
|
|
89
|
+
this._dim.xLine2Point = point;
|
|
90
|
+
this._dim.rotation = this.calculateAngle(this._dim.xLine2Point, this._dim.xLine1Point);
|
|
91
|
+
this._dim.dimLinePoint = this.calculateDimPoint(100);
|
|
92
|
+
var blockName = '*UDIM';
|
|
93
|
+
this.updateBlock(blockName);
|
|
94
|
+
this._dim.dimBlockId = blockName;
|
|
95
|
+
};
|
|
96
|
+
AcApDimJig.prototype.updateBlock = function (blockName) {
|
|
97
|
+
this._db.tables.blockTable.remove(blockName);
|
|
98
|
+
// Create block and add the hatch entity in this block
|
|
99
|
+
var block = new AcDbBlockTableRecord();
|
|
100
|
+
block.name = blockName;
|
|
101
|
+
var lines = this.createLines();
|
|
102
|
+
lines.forEach(function (line) {
|
|
103
|
+
return block.appendEntity(new AcDbLine(line.startPoint, line.endPoint));
|
|
104
|
+
});
|
|
105
|
+
this._db.tables.blockTable.add(block);
|
|
106
|
+
return block;
|
|
107
|
+
};
|
|
108
|
+
AcApDimJig.prototype.calculateDimPoint = function (distance) {
|
|
109
|
+
var angle = this._dim.rotation + Math.PI / 2;
|
|
110
|
+
var dimPoint = this.findPointOnLine(this._dim.xLine1Point, angle, distance);
|
|
111
|
+
return __assign(__assign({}, dimPoint), { z: 0 });
|
|
112
|
+
};
|
|
113
|
+
AcApDimJig.prototype.calculateAngle = function (p1, p2) {
|
|
114
|
+
var dx = p2.x - p1.x;
|
|
115
|
+
var dy = p2.y - p1.y;
|
|
116
|
+
return Math.atan2(dy, dx);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Adjust start point and end point of extension line
|
|
120
|
+
* @param extensionLine Input extension line to adjust its start point and end point
|
|
121
|
+
*/
|
|
122
|
+
AcApDimJig.prototype.adjustExtensionLine = function (extensionLine) {
|
|
123
|
+
extensionLine.extend(10);
|
|
124
|
+
extensionLine.extend(-10, true);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Return one array which contains three lines of the alinged dimension.
|
|
128
|
+
* - The first line in the array is dimension line.
|
|
129
|
+
* - The second line and the third line in the array are extension lines.
|
|
130
|
+
* @returns Return three lines of the alinged dimension
|
|
131
|
+
*/
|
|
132
|
+
AcApDimJig.prototype.createLines = function () {
|
|
133
|
+
var lines = [];
|
|
134
|
+
var extensionLine1 = this.createExtensionLine(this._dim.xLine1Point);
|
|
135
|
+
var extensionLine2 = this.createExtensionLine(this._dim.xLine2Point);
|
|
136
|
+
var intersectionPoint1 = this.findIntersectionPoint(extensionLine1, this._dim.dimLinePoint);
|
|
137
|
+
var intersectionPoint2 = this.findIntersectionPoint(extensionLine2, this._dim.dimLinePoint);
|
|
138
|
+
var dimensionLine = new AcGeLine3d(intersectionPoint1, intersectionPoint2);
|
|
139
|
+
lines.push(dimensionLine);
|
|
140
|
+
// Create the first extension line with extension
|
|
141
|
+
extensionLine1.endPoint = intersectionPoint1;
|
|
142
|
+
this.adjustExtensionLine(extensionLine1);
|
|
143
|
+
lines.push(extensionLine1);
|
|
144
|
+
// Create the second extension line with extension
|
|
145
|
+
extensionLine2.endPoint = intersectionPoint2;
|
|
146
|
+
this.adjustExtensionLine(extensionLine2);
|
|
147
|
+
lines.push(extensionLine2);
|
|
148
|
+
return lines;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Find the point `p2` on a line starting from `p1` at a specified angle
|
|
152
|
+
* and at a distance `length` from `p1`.
|
|
153
|
+
*
|
|
154
|
+
* @param p1 - The start point of the line.
|
|
155
|
+
* @param angle - The angle of the line in radians relative to the x-axis.
|
|
156
|
+
* @param length - The distance from `p1` to `p2`.
|
|
157
|
+
* @returns Return the point `p2`.
|
|
158
|
+
*/
|
|
159
|
+
AcApDimJig.prototype.findPointOnLine = function (p1, angle, length) {
|
|
160
|
+
// Calculate the new point p2
|
|
161
|
+
var x = p1.x + length * Math.cos(angle);
|
|
162
|
+
var y = p1.y + length * Math.sin(angle);
|
|
163
|
+
return { x: x, y: y };
|
|
164
|
+
};
|
|
165
|
+
AcApDimJig.prototype.createExtensionLine = function (point) {
|
|
166
|
+
var angle = this._dim.rotation + Math.PI / 2;
|
|
167
|
+
var anotherPoint = this.findPointOnLine(point, angle, 200);
|
|
168
|
+
return new AcGeLine3d(point, __assign(__assign({}, anotherPoint), { z: point.z }));
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Compute the intersection point between a line 'line1' and a line 'line2' that passes through
|
|
172
|
+
* a given point 'p' and is perpendicular to line 'line1'.
|
|
173
|
+
*
|
|
174
|
+
* @param line The 'line1'.
|
|
175
|
+
* @param p The point through which the perpendicular 'line2' passes.
|
|
176
|
+
* @returns Returns the intersection point of 'line1' and 'line2'.
|
|
177
|
+
*/
|
|
178
|
+
AcApDimJig.prototype.findIntersectionPoint = function (line1, p) {
|
|
179
|
+
var p1 = line1.startPoint;
|
|
180
|
+
var p2 = line1.endPoint;
|
|
181
|
+
// Direction of line1 (p1 - p2)
|
|
182
|
+
var directionOfLine1 = new AcGeVector3d().subVectors(p2, p1).normalize();
|
|
183
|
+
// Vector from point 'p1' to point 'p3'
|
|
184
|
+
var vectorFromP1ToP3 = new AcGeVector3d().subVectors(p, p1);
|
|
185
|
+
// Project vectorAP onto directionL to get the projection vector
|
|
186
|
+
var projectionLength = vectorFromP1ToP3.dot(directionOfLine1);
|
|
187
|
+
var projectionVector = new AcGeVector3d()
|
|
188
|
+
.copy(directionOfLine1)
|
|
189
|
+
.multiplyScalar(projectionLength);
|
|
190
|
+
// Intersection point is the point on line L at the projection
|
|
191
|
+
var intersection = new AcGeVector3d().addVectors(p1, projectionVector);
|
|
192
|
+
return intersection;
|
|
193
|
+
};
|
|
194
|
+
return AcApDimJig;
|
|
195
|
+
}(AcEdPreviewJig));
|
|
196
|
+
export { AcApDimJig };
|
|
197
|
+
/**
|
|
198
|
+
* Example Command to create one aligned dimension.
|
|
199
|
+
*/
|
|
200
|
+
var AcApDimCmd = /** @class */ (function (_super) {
|
|
201
|
+
__extends(AcApDimCmd, _super);
|
|
202
|
+
function AcApDimCmd() {
|
|
203
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
204
|
+
}
|
|
205
|
+
AcApDimCmd.prototype.execute = function (context) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
207
|
+
var xLine1PointPrompt, xLine1Point, xLine2PointPrompt;
|
|
208
|
+
return __generator(this, function (_a) {
|
|
209
|
+
switch (_a.label) {
|
|
210
|
+
case 0:
|
|
211
|
+
xLine1PointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.circle.center'));
|
|
212
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(xLine1PointPrompt)];
|
|
213
|
+
case 1:
|
|
214
|
+
xLine1Point = _a.sent();
|
|
215
|
+
xLine2PointPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.circle.center'));
|
|
216
|
+
xLine2PointPrompt.jig = new AcApDimJig(context.view, context.doc.database, xLine1Point);
|
|
217
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getPoint(xLine2PointPrompt)];
|
|
218
|
+
case 2:
|
|
219
|
+
_a.sent();
|
|
220
|
+
return [2 /*return*/];
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
return AcApDimCmd;
|
|
226
|
+
}(AcEdCommand));
|
|
227
|
+
export { AcApDimCmd };
|
|
228
|
+
//# sourceMappingURL=AcApDimCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApDimCmd.js","sourceRoot":"","sources":["../../src/command/AcApDimCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAEpB,QAAQ,EACR,UAAU,EAGV,YAAY,EACb,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAe,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAEL,WAAW,EACX,cAAc,EACd,sBAAsB,EACvB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC;IAAgC,8BAA+B;IAI7D;;;;OAIG;IACH,oBACE,IAAkB,EAClB,EAAgB,EAChB,WAA4B;QAE5B,YAAA,MAAK,YAAC,IAAI,CAAC,SAAA;QACX,KAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QACb,KAAI,CAAC,IAAI,GAAG,IAAI,oBAAoB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;QAC3E,KAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAA;;IACxB,CAAC;IAED,sBAAI,8BAAM;aAAV;YACE,OAAO,IAAI,CAAC,IAAI,CAAA;QAClB,CAAC;;;OAAA;IAED,2BAAM,GAAN,UAAO,KAAs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W,GAkB1C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* This is an internal command used to log some debug information in console.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcApLogCmd extends AcEdCommand {
|
|
8
|
+
execute(context: AcApContext): void;
|
|
9
|
+
private printSelectionSet;
|
|
10
|
+
private printStats;
|
|
11
|
+
private printPerformanceData;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=AcApLogCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLogCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApLogCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;GAGG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC,OAAO,CAAC,OAAO,EAAE,WAAW;IAM5B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,UAAU;IAqDlB,OAAO,CAAC,oBAAoB;CAG7B"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcCmPerformanceCollector } from '@mlightcad/data-model';
|
|
17
|
+
import { AcEdCommand } from '../command';
|
|
18
|
+
/**
|
|
19
|
+
* This is an internal command used to log some debug information in console.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
var AcApLogCmd = /** @class */ (function (_super) {
|
|
23
|
+
__extends(AcApLogCmd, _super);
|
|
24
|
+
function AcApLogCmd() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
AcApLogCmd.prototype.execute = function (context) {
|
|
28
|
+
this.printSelectionSet(context);
|
|
29
|
+
this.printStats(context);
|
|
30
|
+
this.printPerformanceData();
|
|
31
|
+
};
|
|
32
|
+
AcApLogCmd.prototype.printSelectionSet = function (context) {
|
|
33
|
+
var modelSpace = context.doc.database.tables.blockTable.modelSpace;
|
|
34
|
+
context.view.selectionSet.ids.forEach(function (id) {
|
|
35
|
+
var entity = modelSpace.getIdAt(id);
|
|
36
|
+
if (entity)
|
|
37
|
+
console.log(entity);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
AcApLogCmd.prototype.printStats = function (context) {
|
|
41
|
+
var layouts = context.view.stats.layouts;
|
|
42
|
+
console.log('Geometry information in current drawing:');
|
|
43
|
+
var _loop_1 = function (index) {
|
|
44
|
+
console.group("Layout: ".concat(index));
|
|
45
|
+
var layout = layouts[index];
|
|
46
|
+
var sizes = [0, 0, 0, 0, 0, 0];
|
|
47
|
+
var totals = [0, 0, 0, 0, 0, 0];
|
|
48
|
+
var data = layout.layers.map(function (layer) {
|
|
49
|
+
sizes[0] = layer.line.indexed.geometrySize / 1024;
|
|
50
|
+
sizes[1] = layer.line.nonIndexed.geometrySize / 1024;
|
|
51
|
+
sizes[2] = layer.mesh.indexed.geometrySize / 1024;
|
|
52
|
+
sizes[3] = layer.mesh.nonIndexed.geometrySize / 1024;
|
|
53
|
+
sizes[4] = layer.point.indexed.geometrySize / 1024;
|
|
54
|
+
sizes[5] = layer.point.nonIndexed.geometrySize / 1024;
|
|
55
|
+
totals[0] += sizes[0];
|
|
56
|
+
totals[1] += sizes[1];
|
|
57
|
+
totals[2] += sizes[2];
|
|
58
|
+
totals[3] += sizes[3];
|
|
59
|
+
totals[4] += sizes[4];
|
|
60
|
+
totals[5] += sizes[5];
|
|
61
|
+
return {
|
|
62
|
+
name: layer.name,
|
|
63
|
+
'idx line (KB)': sizes[0].toFixed(1),
|
|
64
|
+
'line (KB)': sizes[1].toFixed(1),
|
|
65
|
+
'idx mesh (KB)': sizes[2].toFixed(1),
|
|
66
|
+
'mesh (KB)': sizes[3].toFixed(1),
|
|
67
|
+
'idx point (KB)': sizes[4].toFixed(1),
|
|
68
|
+
'point (KB)': sizes[5].toFixed(1),
|
|
69
|
+
'total geo (KB)': (layer.summary.totalGeometrySize / 1024).toFixed(1),
|
|
70
|
+
'total mapping (KB)': (layer.summary.totalMappingSize / 1024).toFixed(1)
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
data.push({
|
|
74
|
+
name: 'total',
|
|
75
|
+
'idx line (KB)': totals[0].toFixed(1),
|
|
76
|
+
'line (KB)': totals[1].toFixed(1),
|
|
77
|
+
'idx mesh (KB)': totals[2].toFixed(1),
|
|
78
|
+
'mesh (KB)': totals[3].toFixed(1),
|
|
79
|
+
'idx point (KB)': totals[4].toFixed(1),
|
|
80
|
+
'point (KB)': totals[5].toFixed(1),
|
|
81
|
+
'total geo (KB)': (layout.summary.totalSize.geometry / 1024).toFixed(1),
|
|
82
|
+
'total mapping (KB)': (layout.summary.totalSize.mapping / 1024).toFixed(1)
|
|
83
|
+
});
|
|
84
|
+
console.table(data);
|
|
85
|
+
console.groupEnd();
|
|
86
|
+
};
|
|
87
|
+
for (var index = 0; index < layouts.length; ++index) {
|
|
88
|
+
_loop_1(index);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
AcApLogCmd.prototype.printPerformanceData = function () {
|
|
92
|
+
AcCmPerformanceCollector.getInstance().printAll();
|
|
93
|
+
};
|
|
94
|
+
return AcApLogCmd;
|
|
95
|
+
}(AcEdCommand));
|
|
96
|
+
export { AcApLogCmd };
|
|
97
|
+
//# sourceMappingURL=AcApLogCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLogCmd.js","sourceRoot":"","sources":["../../src/command/AcApLogCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAGhE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;GAGG;AACH;IAAgC,8BAAW;IAA3C;;IAuEA,CAAC;IAtEC,4BAAO,GAAP,UAAQ,OAAoB;QAC1B,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QACxB,IAAI,CAAC,oBAAoB,EAAE,CAAA;IAC7B,CAAC;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,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;YACrC,IAAI,MAAM;gBAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACJ,CAAC;IAEO,+BAAU,GAAlB,UAAmB,OAAoB;QACrC,IAAM,OAAO,GAAI,OAAO,CAAC,IAAmB,CAAC,KAAK,CAAC,OAAO,CAAA;QAC1D,OAAO,CAAC,GAAG,CAAC,0CAA0C,C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AC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACjC,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACtC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBAClC,gBAAgB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACvE,oBAAoB,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,OAAO,CACrE,CAAC,CACF;aACF,CAAC,CAAA;YACF,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACnB,OAAO,CAAC,QAAQ,EAAE,CAAA;;QA9CpB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,KAAK;oBAA1C,KAAK;SA+Cb;IACH,CAAC;IAEO,yCAAoB,GAA5B;QACE,wBAAwB,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAA;IACnD,CAAC;IACH,iBAAC;AAAD,CAAC,AAvED,CAAgC,WAAW,GAuE1C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AcApContext } from '../app';
|
|
2
|
+
import { AcEdCommand } from '../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Command for modifying value of one system variable. All of system variables share
|
|
5
|
+
* this command.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcApSysVarCmd extends AcEdCommand {
|
|
8
|
+
/**
|
|
9
|
+
* Executes the command to modify the value of one system variable.
|
|
10
|
+
*
|
|
11
|
+
* @param context - The application context containing the view
|
|
12
|
+
*/
|
|
13
|
+
execute(_context: AcApContext): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=AcApSysVarCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApSysVarCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSysVarCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAA2B,MAAM,WAAW,CAAA;AAGhE;;;GAGG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACG,OAAO,CAAC,QAAQ,EAAE,WAAW;CAUpC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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 { AcDbSysVarManager } from '@mlightcad/data-model';
|
|
53
|
+
import { AcApDocManager } from '../app';
|
|
54
|
+
import { AcEdCommand, AcEdPromptStringOptions } from '../editor';
|
|
55
|
+
import { AcApI18n } from '../i18n';
|
|
56
|
+
/**
|
|
57
|
+
* Command for modifying value of one system variable. All of system variables share
|
|
58
|
+
* this command.
|
|
59
|
+
*/
|
|
60
|
+
var AcApSysVarCmd = /** @class */ (function (_super) {
|
|
61
|
+
__extends(AcApSysVarCmd, _super);
|
|
62
|
+
function AcApSysVarCmd() {
|
|
63
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Executes the command to modify the value of one system variable.
|
|
67
|
+
*
|
|
68
|
+
* @param context - The application context containing the view
|
|
69
|
+
*/
|
|
70
|
+
AcApSysVarCmd.prototype.execute = function (_context) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var prompt, value, sysVarManager, sysVar;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
prompt = new AcEdPromptStringOptions(AcApI18n.t('jig.sysvar.prompt'));
|
|
77
|
+
AcEdPromptStringOptions;
|
|
78
|
+
return [4 /*yield*/, AcApDocManager.instance.editor.getString(prompt)];
|
|
79
|
+
case 1:
|
|
80
|
+
value = _a.sent();
|
|
81
|
+
sysVarManager = AcDbSysVarManager.instance();
|
|
82
|
+
sysVar = sysVarManager.getDescriptor(this.globalName);
|
|
83
|
+
if (sysVar) {
|
|
84
|
+
sysVarManager.setVar(this.globalName, value);
|
|
85
|
+
}
|
|
86
|
+
return [2 /*return*/];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return AcApSysVarCmd;
|
|
92
|
+
}(AcEdCommand));
|
|
93
|
+
export { AcApSysVarCmd };
|
|
94
|
+
//# sourceMappingURL=AcApSysVarCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApSysVarCmd.js","sourceRoot":"","sources":["../../src/command/AcApSysVarCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAe,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC;;;GAGG;AACH;IAAmC,iCAAW;IAA9C;;IAgBA,CAAC;IAfC;;;;OAIG;IACG,+BAAO,GAAb,UAAc,QAAqB;;;;;;wBAC3B,MAAM,GAAG,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAA;wBAC3E,uBAAuB,CAAA;wBACT,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAA;;wBAA9D,KAAK,GAAG,SAAsD;wBAC9D,aAAa,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAA;wBAC5C,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;wBAC3D,IAAI,MAAM,EAAE,CAAC;4BACX,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;wBAC9C,CAAC;;;;;KACF;IACH,oBAAC;AAAD,CAAC,AAhBD,CAAmC,WAAW,GAgB7C"}
|
|
@@ -49,7 +49,7 @@ var AcApZoomCmd = /** @class */ (function (_super) {
|
|
|
49
49
|
* @param context - The current application context containing the view to zoom
|
|
50
50
|
*/
|
|
51
51
|
AcApZoomCmd.prototype.execute = function (context) {
|
|
52
|
-
context.view.
|
|
52
|
+
context.view.zoomToFitDrawing();
|
|
53
53
|
};
|
|
54
54
|
return AcApZoomCmd;
|
|
55
55
|
}(AcEdCommand));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAiC,+BAAW;IAA5C;;IAYA,CAAC;IAXC;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"AcApZoomCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAiC,+BAAW;IAA5C;;IAYA,CAAC;IAXC;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAA;IACjC,CAAC;IACH,kBAAC;AAAD,CAAC,AAZD,CAAiC,WAAW,GAY3C"}
|
|
@@ -1,41 +1,5 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
-
import { AcEdBaseView, AcEdJig } from '../editor';
|
|
4
|
-
/**
|
|
5
|
-
* Jig for handling zoom-to-box selection interaction.
|
|
6
|
-
*
|
|
7
|
-
* This jig handles the user interaction for selecting a rectangular
|
|
8
|
-
* area to zoom to. It extends {@link AcEdJig} to provide interactive
|
|
9
|
-
* selection capabilities.
|
|
10
|
-
*
|
|
11
|
-
* The jig allows users to:
|
|
12
|
-
* - Select a rectangular area on the drawing
|
|
13
|
-
* - Zoom the view to fit the selected area
|
|
14
|
-
* - Provide visual feedback during selection
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const jig = new AcApZoomToBoxJig(view);
|
|
19
|
-
* await jig.drag(); // User selects area to zoom to
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare class AcApZoomToBoxJig extends AcEdJig<boolean> {
|
|
23
|
-
/**
|
|
24
|
-
* Creates a new zoom-to-box jig.
|
|
25
|
-
*
|
|
26
|
-
* @param view - The view that will be zoomed
|
|
27
|
-
*/
|
|
28
|
-
constructor(view: AcEdBaseView);
|
|
29
|
-
/**
|
|
30
|
-
* Handles the selection sampling and zooming operation.
|
|
31
|
-
*
|
|
32
|
-
* This method gets the user's selection box and applies
|
|
33
|
-
* the zoom operation to fit that area in the view.
|
|
34
|
-
*
|
|
35
|
-
* @returns Promise that resolves when the zoom operation completes
|
|
36
|
-
*/
|
|
37
|
-
sampler(): Promise<void>;
|
|
38
|
-
}
|
|
39
3
|
/**
|
|
40
4
|
* Command for zooming to a user-selected rectangular area.
|
|
41
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomToBoxCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"AcApZoomToBoxCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;OAQG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CAInC"}
|