@mlightcad/cad-simple-viewer 1.0.0 → 1.0.1
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/README.md +296 -2
- package/dist/index.js +1347 -122
- package/dist/index.umd.cjs +2 -2
- package/lib/app/AcApContext.d.ts +45 -3
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +43 -3
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocCreator.d.ts +68 -2
- package/lib/app/AcApDocCreator.d.ts.map +1 -1
- package/lib/app/AcApDocCreator.js +67 -2
- package/lib/app/AcApDocCreator.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +227 -12
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +228 -17
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +77 -3
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +75 -3
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApFontLoader.d.ts +32 -0
- package/lib/app/AcApFontLoader.d.ts.map +1 -1
- package/lib/app/AcApFontLoader.js +30 -0
- package/lib/app/AcApFontLoader.js.map +1 -1
- package/lib/app/AcApSettingManager.d.ts +191 -3
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +161 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts +26 -0
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.js +26 -0
- package/lib/command/AcApConvertToSvgCmd.js.map +1 -1
- package/lib/command/AcApOpenCmd.d.ts +31 -0
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +31 -0
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApPanCmd.d.ts +25 -0
- package/lib/command/AcApPanCmd.d.ts.map +1 -1
- package/lib/command/AcApPanCmd.js +25 -0
- package/lib/command/AcApPanCmd.js.map +1 -1
- package/lib/command/AcApQNewCmd.d.ts +26 -0
- package/lib/command/AcApQNewCmd.d.ts.map +1 -1
- package/lib/command/AcApQNewCmd.js +26 -0
- package/lib/command/AcApQNewCmd.js.map +1 -1
- package/lib/command/AcApSelectCmd.d.ts +26 -0
- package/lib/command/AcApSelectCmd.d.ts.map +1 -1
- package/lib/command/AcApSelectCmd.js +26 -0
- package/lib/command/AcApSelectCmd.js.map +1 -1
- package/lib/command/AcApSvgConvertor.d.ts +48 -0
- package/lib/command/AcApSvgConvertor.d.ts.map +1 -1
- package/lib/command/AcApSvgConvertor.js +48 -0
- package/lib/command/AcApSvgConvertor.js.map +1 -1
- package/lib/command/AcApZoomCmd.d.ts +29 -0
- package/lib/command/AcApZoomCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomCmd.js +29 -0
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +57 -0
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +57 -0
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/editor/command/AcEdCommand.d.ts +118 -9
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +113 -9
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +59 -5
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +48 -5
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/global/eventBus.d.ts +69 -1
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js +37 -0
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/input/AcEdBaseInput.d.ts +65 -1
- package/lib/editor/input/AcEdBaseInput.d.ts.map +1 -1
- package/lib/editor/input/AcEdBaseInput.js +62 -1
- package/lib/editor/input/AcEdBaseInput.js.map +1 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +81 -0
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +1 -1
- package/lib/editor/input/AcEdBoxSelector.js +80 -0
- package/lib/editor/input/AcEdBoxSelector.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +95 -8
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +95 -11
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +38 -1
- package/lib/editor/input/AcEdInputPoint.d.ts.map +1 -1
- package/lib/editor/input/AcEdInputPoint.js +38 -1
- package/lib/editor/input/AcEdInputPoint.js.map +1 -1
- package/lib/editor/input/AcEdJig.d.ts +166 -0
- package/lib/editor/input/AcEdJig.d.ts.map +1 -1
- package/lib/editor/input/AcEdJig.js +164 -0
- package/lib/editor/input/AcEdJig.js.map +1 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +49 -0
- package/lib/editor/input/AcEdJigLoop.d.ts.map +1 -1
- package/lib/editor/input/AcEdJigLoop.js +48 -0
- package/lib/editor/input/AcEdJigLoop.js.map +1 -1
- package/lib/editor/input/AcEdSelectionSet.d.ts +122 -2
- package/lib/editor/input/AcEdSelectionSet.d.ts.map +1 -1
- package/lib/editor/input/AcEdSelectionSet.js +117 -1
- package/lib/editor/input/AcEdSelectionSet.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +90 -6
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -6
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +163 -16
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +94 -5
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/util/AcTrGeometryUtil.d.ts +65 -0
- package/lib/util/AcTrGeometryUtil.d.ts.map +1 -1
- package/lib/util/AcTrGeometryUtil.js +65 -0
- package/lib/util/AcTrGeometryUtil.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +40 -5
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +34 -5
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +122 -23
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +103 -23
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +74 -16
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +65 -16
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +58 -12
- package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -1
- package/lib/view/AcTrLayoutViewManager.js +56 -12
- package/lib/view/AcTrLayoutViewManager.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +48 -4
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +44 -4
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +71 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +65 -0
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +8 -4
|
@@ -15,11 +15,37 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
})();
|
|
16
16
|
import { AcEdCommand } from '../command';
|
|
17
17
|
import { AcEdCorsorType, AcEdViewMode } from '../editor';
|
|
18
|
+
/**
|
|
19
|
+
* Command for enabling selection mode in the CAD viewer.
|
|
20
|
+
*
|
|
21
|
+
* This command switches the view to selection mode, allowing users to
|
|
22
|
+
* select CAD entities by clicking on them. When executed, it:
|
|
23
|
+
* - Sets the view mode to SELECTION
|
|
24
|
+
* - Changes the cursor to a crosshair for precise selection
|
|
25
|
+
*
|
|
26
|
+
* In selection mode, users can click on entities to select them,
|
|
27
|
+
* which will add them to the selection set and typically show
|
|
28
|
+
* grip points for manipulation.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const selectCmd = new AcApSelectCmd();
|
|
33
|
+
* selectCmd.execute(context); // Enables selection mode
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
18
36
|
var AcApSelectCmd = /** @class */ (function (_super) {
|
|
19
37
|
__extends(AcApSelectCmd, _super);
|
|
20
38
|
function AcApSelectCmd() {
|
|
21
39
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Executes the select command.
|
|
43
|
+
*
|
|
44
|
+
* Sets the view to selection mode and updates the cursor appearance
|
|
45
|
+
* to indicate that entity selection is active.
|
|
46
|
+
*
|
|
47
|
+
* @param context - The application context containing the view
|
|
48
|
+
*/
|
|
23
49
|
AcApSelectCmd.prototype.execute = function (context) {
|
|
24
50
|
context.view.mode = AcEdViewMode.SELECTION;
|
|
25
51
|
context.view.setCursor(AcEdCorsorType.Crosshair);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSelectCmd.js","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;IAAmC,iCAAW;IAA9C;;
|
|
1
|
+
{"version":3,"file":"AcApSelectCmd.js","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAmC,iCAAW;IAA9C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,+BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,SAAS,CAAA;QAC1C,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;IAClD,CAAC;IACH,oBAAC;AAAD,CAAC,AAbD,CAAmC,WAAW,GAa7C"}
|
|
@@ -1,5 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility class for converting CAD drawings to SVG format.
|
|
3
|
+
*
|
|
4
|
+
* This class provides functionality to export the current CAD drawing
|
|
5
|
+
* to SVG format and download it as a file. It iterates through all
|
|
6
|
+
* entities in the model space and renders them using the SVG renderer.
|
|
7
|
+
*
|
|
8
|
+
* The conversion process:
|
|
9
|
+
* 1. Gets all entities from the current document's model space
|
|
10
|
+
* 2. Uses the SVG renderer to convert each entity to SVG markup
|
|
11
|
+
* 3. Exports the complete SVG content
|
|
12
|
+
* 4. Creates a downloadable file for the user
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const converter = new AcApSvgConvertor();
|
|
17
|
+
*
|
|
18
|
+
* // Convert and download current drawing as SVG
|
|
19
|
+
* converter.convert();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
1
22
|
export declare class AcApSvgConvertor {
|
|
23
|
+
/**
|
|
24
|
+
* Converts the current CAD drawing to SVG format and initiates download.
|
|
25
|
+
*
|
|
26
|
+
* This method:
|
|
27
|
+
* - Retrieves all entities from the current document's model space
|
|
28
|
+
* - Renders each entity using the SVG renderer
|
|
29
|
+
* - Exports the complete SVG markup
|
|
30
|
+
* - Automatically downloads the SVG file as 'example.svg'
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const converter = new AcApSvgConvertor();
|
|
35
|
+
* converter.convert(); // Downloads the drawing as SVG
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
2
38
|
convert(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a downloadable SVG file and triggers the download.
|
|
41
|
+
*
|
|
42
|
+
* This method:
|
|
43
|
+
* - Creates a Blob from the SVG content with proper MIME type
|
|
44
|
+
* - Generates a temporary download URL
|
|
45
|
+
* - Creates and triggers a download link
|
|
46
|
+
* - Cleans up the temporary elements
|
|
47
|
+
*
|
|
48
|
+
* @param svgContent - The SVG markup content to download
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
3
51
|
private createFileAndDownloadIt;
|
|
4
52
|
}
|
|
5
53
|
//# sourceMappingURL=AcApSvgConvertor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSvgConvertor.d.ts","sourceRoot":"","sources":["../../src/command/AcApSvgConvertor.ts"],"names":[],"mappings":"AAIA,qBAAa,gBAAgB;IAC3B,OAAO;IAUP,OAAO,CAAC,uBAAuB;CAoBhC"}
|
|
1
|
+
{"version":3,"file":"AcApSvgConvertor.d.ts","sourceRoot":"","sources":["../../src/command/AcApSvgConvertor.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;OAcG;IACH,OAAO;IAUP;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,uBAAuB;CAoBhC"}
|
|
@@ -11,9 +11,45 @@ var __values = (this && this.__values) || function(o) {
|
|
|
11
11
|
};
|
|
12
12
|
import { AcSvgRenderer } from '@mlightcad/svg-renderer';
|
|
13
13
|
import { AcApDocManager } from '../app';
|
|
14
|
+
/**
|
|
15
|
+
* Utility class for converting CAD drawings to SVG format.
|
|
16
|
+
*
|
|
17
|
+
* This class provides functionality to export the current CAD drawing
|
|
18
|
+
* to SVG format and download it as a file. It iterates through all
|
|
19
|
+
* entities in the model space and renders them using the SVG renderer.
|
|
20
|
+
*
|
|
21
|
+
* The conversion process:
|
|
22
|
+
* 1. Gets all entities from the current document's model space
|
|
23
|
+
* 2. Uses the SVG renderer to convert each entity to SVG markup
|
|
24
|
+
* 3. Exports the complete SVG content
|
|
25
|
+
* 4. Creates a downloadable file for the user
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* const converter = new AcApSvgConvertor();
|
|
30
|
+
*
|
|
31
|
+
* // Convert and download current drawing as SVG
|
|
32
|
+
* converter.convert();
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
14
35
|
var AcApSvgConvertor = /** @class */ (function () {
|
|
15
36
|
function AcApSvgConvertor() {
|
|
16
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Converts the current CAD drawing to SVG format and initiates download.
|
|
40
|
+
*
|
|
41
|
+
* This method:
|
|
42
|
+
* - Retrieves all entities from the current document's model space
|
|
43
|
+
* - Renders each entity using the SVG renderer
|
|
44
|
+
* - Exports the complete SVG markup
|
|
45
|
+
* - Automatically downloads the SVG file as 'example.svg'
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const converter = new AcApSvgConvertor();
|
|
50
|
+
* converter.convert(); // Downloads the drawing as SVG
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
17
53
|
AcApSvgConvertor.prototype.convert = function () {
|
|
18
54
|
var e_1, _a;
|
|
19
55
|
var entities = AcApDocManager.instance.curDocument.database.tables.blockTable.modelSpace.newIterator();
|
|
@@ -33,6 +69,18 @@ var AcApSvgConvertor = /** @class */ (function () {
|
|
|
33
69
|
}
|
|
34
70
|
this.createFileAndDownloadIt(renderer.export());
|
|
35
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Creates a downloadable SVG file and triggers the download.
|
|
74
|
+
*
|
|
75
|
+
* This method:
|
|
76
|
+
* - Creates a Blob from the SVG content with proper MIME type
|
|
77
|
+
* - Generates a temporary download URL
|
|
78
|
+
* - Creates and triggers a download link
|
|
79
|
+
* - Cleans up the temporary elements
|
|
80
|
+
*
|
|
81
|
+
* @param svgContent - The SVG markup content to download
|
|
82
|
+
* @private
|
|
83
|
+
*/
|
|
36
84
|
AcApSvgConvertor.prototype.createFileAndDownloadIt = function (svgContent) {
|
|
37
85
|
// Convert the SVG content into a Blob
|
|
38
86
|
var svgBlob = new Blob([svgContent], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSvgConvertor.js","sourceRoot":"","sources":["../../src/command/AcApSvgConvertor.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEvC;IAAA;
|
|
1
|
+
{"version":3,"file":"AcApSvgConvertor.js","sourceRoot":"","sources":["../../src/command/AcApSvgConvertor.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAA;IA0DA,CAAC;IAzDC;;;;;;;;;;;;;;OAcG;IACH,kCAAO,GAAP;;QACE,IAAM,QAAQ,GACZ,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA;QACzF,IAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAA;;YACpC,KAAqB,IAAA,aAAA,SAAA,QAAQ,CAAA,kCAAA,wDAAE,CAAC;gBAA3B,IAAM,MAAM,qBAAA;gBACf,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACvB,CAAC;;;;;;;;;QACD,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IACjD,CAAC;IAED;;;;;;;;;;;OAWG;IACK,kDAAuB,GAA/B,UAAgC,UAAkB;QAChD,sCAAsC;QACtC,IAAM,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE;YACrC,IAAI,EAAE,6BAA6B;SACpC,CAAC,CAAA;QAEF,4BAA4B;QAC5B,IAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;QAExC,kDAAkD;QAClD,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;QAChD,YAAY,CAAC,IAAI,GAAG,GAAG,CAAA;QACvB,YAAY,CAAC,QAAQ,GAAG,aAAa,CAAA;QAErC,mFAAmF;QACnF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;QAEvC,uBAAuB;QACvB,YAAY,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;IACH,uBAAC;AAAD,CAAC,AA1DD,IA0DC"}
|
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* Command to zoom the view to fit all visible entities.
|
|
5
|
+
*
|
|
6
|
+
* This command adjusts the view's zoom level and position to show all
|
|
7
|
+
* visible entities in the current drawing within the viewport. It's
|
|
8
|
+
* equivalent to the "Zoom Extents" or "Fit to Window" functionality
|
|
9
|
+
* found in most CAD applications.
|
|
10
|
+
*
|
|
11
|
+
* The command calculates the bounding box of all visible entities and
|
|
12
|
+
* adjusts the camera to show them all with appropriate padding.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const zoomCommand = new AcApZoomCmd();
|
|
17
|
+
* zoomCommand.globalName = 'ZOOM';
|
|
18
|
+
* zoomCommand.localName = 'Zoom to Fit';
|
|
19
|
+
*
|
|
20
|
+
* // Execute the command to fit all entities in view
|
|
21
|
+
* zoomCommand.trigger(docManager.context);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
3
24
|
export declare class AcApZoomCmd extends AcEdCommand {
|
|
25
|
+
/**
|
|
26
|
+
* Executes the zoom to fit command.
|
|
27
|
+
*
|
|
28
|
+
* Calls the view's `zoomToFit()` method to adjust the camera position
|
|
29
|
+
* and zoom level to display all visible entities within the viewport.
|
|
30
|
+
*
|
|
31
|
+
* @param context - The current application context containing the view to zoom
|
|
32
|
+
*/
|
|
4
33
|
execute(context: AcApContext): void;
|
|
5
34
|
}
|
|
6
35
|
//# sourceMappingURL=AcApZoomCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,OAAO,EAAE,WAAW;CAG7B"}
|
|
1
|
+
{"version":3,"file":"AcApZoomCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;CAG7B"}
|
|
@@ -14,11 +14,40 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import { AcEdCommand } from '../command';
|
|
17
|
+
/**
|
|
18
|
+
* Command to zoom the view to fit all visible entities.
|
|
19
|
+
*
|
|
20
|
+
* This command adjusts the view's zoom level and position to show all
|
|
21
|
+
* visible entities in the current drawing within the viewport. It's
|
|
22
|
+
* equivalent to the "Zoom Extents" or "Fit to Window" functionality
|
|
23
|
+
* found in most CAD applications.
|
|
24
|
+
*
|
|
25
|
+
* The command calculates the bounding box of all visible entities and
|
|
26
|
+
* adjusts the camera to show them all with appropriate padding.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const zoomCommand = new AcApZoomCmd();
|
|
31
|
+
* zoomCommand.globalName = 'ZOOM';
|
|
32
|
+
* zoomCommand.localName = 'Zoom to Fit';
|
|
33
|
+
*
|
|
34
|
+
* // Execute the command to fit all entities in view
|
|
35
|
+
* zoomCommand.trigger(docManager.context);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
17
38
|
var AcApZoomCmd = /** @class */ (function (_super) {
|
|
18
39
|
__extends(AcApZoomCmd, _super);
|
|
19
40
|
function AcApZoomCmd() {
|
|
20
41
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
21
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Executes the zoom to fit command.
|
|
45
|
+
*
|
|
46
|
+
* Calls the view's `zoomToFit()` method to adjust the camera position
|
|
47
|
+
* and zoom level to display all visible entities within the viewport.
|
|
48
|
+
*
|
|
49
|
+
* @param context - The current application context containing the view to zoom
|
|
50
|
+
*/
|
|
22
51
|
AcApZoomCmd.prototype.execute = function (context) {
|
|
23
52
|
context.view.zoomToFit();
|
|
24
53
|
};
|
|
@@ -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;IAAiC,+BAAW;IAA5C;;
|
|
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,SAAS,EAAE,CAAA;IAC1B,CAAC;IACH,kBAAC;AAAD,CAAC,AAZD,CAAiC,WAAW,GAY3C"}
|
|
@@ -1,11 +1,68 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
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
|
+
*/
|
|
4
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
|
+
*/
|
|
5
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
|
+
*/
|
|
6
37
|
sampler(): Promise<void>;
|
|
7
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Command for zooming to a user-selected rectangular area.
|
|
41
|
+
*
|
|
42
|
+
* This command initiates an interactive zoom-to-box operation where:
|
|
43
|
+
* - User selects a rectangular area by dragging
|
|
44
|
+
* - The view zooms to fit the selected area
|
|
45
|
+
* - The zoom level is adjusted to show the entire selected region
|
|
46
|
+
*
|
|
47
|
+
* This provides precise navigation control, allowing users to quickly
|
|
48
|
+
* focus on specific areas of large drawings.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const zoomToBoxCmd = new AcApZoomToBoxCmd();
|
|
53
|
+
* await zoomToBoxCmd.execute(context); // User selects area to zoom to
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
8
56
|
export declare class AcApZoomToBoxCmd extends AcEdCommand {
|
|
57
|
+
/**
|
|
58
|
+
* Executes the zoom-to-box command.
|
|
59
|
+
*
|
|
60
|
+
* Creates a jig for interactive area selection and initiates
|
|
61
|
+
* the drag operation for the user to select the zoom area.
|
|
62
|
+
*
|
|
63
|
+
* @param context - The application context containing the view
|
|
64
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
65
|
+
*/
|
|
9
66
|
execute(context: AcApContext): Promise<void>;
|
|
10
67
|
}
|
|
11
68
|
//# sourceMappingURL=AcApZoomToBoxCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomToBoxCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AcApZoomToBoxCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,OAAO,CAAC;IACpD;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAI9B;;;;;;;OAOG;IACG,OAAO;CAKd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;OAQG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CAInC"}
|
|
@@ -52,11 +52,42 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
import { AcApDocManager } from '../app';
|
|
53
53
|
import { AcEdCommand } from '../command';
|
|
54
54
|
import { AcEdJig } from '../editor';
|
|
55
|
+
/**
|
|
56
|
+
* Jig for handling zoom-to-box selection interaction.
|
|
57
|
+
*
|
|
58
|
+
* This jig handles the user interaction for selecting a rectangular
|
|
59
|
+
* area to zoom to. It extends {@link AcEdJig} to provide interactive
|
|
60
|
+
* selection capabilities.
|
|
61
|
+
*
|
|
62
|
+
* The jig allows users to:
|
|
63
|
+
* - Select a rectangular area on the drawing
|
|
64
|
+
* - Zoom the view to fit the selected area
|
|
65
|
+
* - Provide visual feedback during selection
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const jig = new AcApZoomToBoxJig(view);
|
|
70
|
+
* await jig.drag(); // User selects area to zoom to
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
55
73
|
var AcApZoomToBoxJig = /** @class */ (function (_super) {
|
|
56
74
|
__extends(AcApZoomToBoxJig, _super);
|
|
75
|
+
/**
|
|
76
|
+
* Creates a new zoom-to-box jig.
|
|
77
|
+
*
|
|
78
|
+
* @param view - The view that will be zoomed
|
|
79
|
+
*/
|
|
57
80
|
function AcApZoomToBoxJig(view) {
|
|
58
81
|
return _super.call(this, view) || this;
|
|
59
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Handles the selection sampling and zooming operation.
|
|
85
|
+
*
|
|
86
|
+
* This method gets the user's selection box and applies
|
|
87
|
+
* the zoom operation to fit that area in the view.
|
|
88
|
+
*
|
|
89
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
90
|
+
*/
|
|
60
91
|
AcApZoomToBoxJig.prototype.sampler = function () {
|
|
61
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
93
|
var _this = this;
|
|
@@ -75,11 +106,37 @@ var AcApZoomToBoxJig = /** @class */ (function (_super) {
|
|
|
75
106
|
return AcApZoomToBoxJig;
|
|
76
107
|
}(AcEdJig));
|
|
77
108
|
export { AcApZoomToBoxJig };
|
|
109
|
+
/**
|
|
110
|
+
* Command for zooming to a user-selected rectangular area.
|
|
111
|
+
*
|
|
112
|
+
* This command initiates an interactive zoom-to-box operation where:
|
|
113
|
+
* - User selects a rectangular area by dragging
|
|
114
|
+
* - The view zooms to fit the selected area
|
|
115
|
+
* - The zoom level is adjusted to show the entire selected region
|
|
116
|
+
*
|
|
117
|
+
* This provides precise navigation control, allowing users to quickly
|
|
118
|
+
* focus on specific areas of large drawings.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const zoomToBoxCmd = new AcApZoomToBoxCmd();
|
|
123
|
+
* await zoomToBoxCmd.execute(context); // User selects area to zoom to
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
78
126
|
var AcApZoomToBoxCmd = /** @class */ (function (_super) {
|
|
79
127
|
__extends(AcApZoomToBoxCmd, _super);
|
|
80
128
|
function AcApZoomToBoxCmd() {
|
|
81
129
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
82
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Executes the zoom-to-box command.
|
|
133
|
+
*
|
|
134
|
+
* Creates a jig for interactive area selection and initiates
|
|
135
|
+
* the drag operation for the user to select the zoom area.
|
|
136
|
+
*
|
|
137
|
+
* @param context - The application context containing the view
|
|
138
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
139
|
+
*/
|
|
83
140
|
AcApZoomToBoxCmd.prototype.execute = function (context) {
|
|
84
141
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
142
|
var jig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomToBoxCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;IAAsC,oCAAgB;IACpD,0BAAY,IAAkB;QAC5B,OAAA,MAAK,YAAC,IAAI,CAAC,SAAA;IACb,CAAC;
|
|
1
|
+
{"version":3,"file":"AcApZoomToBoxCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAsC,oCAAgB;IACpD;;;;OAIG;IACH,0BAAY,IAAkB;QAC5B,OAAA,MAAK,YAAC,IAAI,CAAC,SAAA;IACb,CAAC;IAED;;;;;;;OAOG;IACG,kCAAO,GAAb;;;;;4BACE,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;4BAC1D,OAAO,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;wBACjC,CAAC,CAAC,EAAA;;wBAFF,SAEE,CAAA;;;;;KACH;IACH,uBAAC;AAAD,CAAC,AAvBD,CAAsC,OAAO,GAuB5C;;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;IAAsC,oCAAW;IAAjD;;IAcA,CAAC;IAbC;;;;;;;;OAQG;IACG,kCAAO,GAAb,UAAc,OAAoB;;;;;;wBAC1B,GAAG,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;wBAC9C,qBAAM,GAAG,CAAC,IAAI,EAAE,EAAA;;wBAAhB,SAAgB,CAAA;;;;;KACjB;IACH,uBAAC;AAAD,CAAC,AAdD,CAAsC,WAAW,GAchD"}
|
|
@@ -1,41 +1,150 @@
|
|
|
1
1
|
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
2
|
import { AcApContext } from '../../app';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Event arguments for command lifecycle events.
|
|
5
|
+
*
|
|
6
|
+
* Contains the command instance that triggered the event.
|
|
5
7
|
*/
|
|
6
8
|
export interface AcEdCommandEventArgs {
|
|
9
|
+
/** The command instance involved in the event */
|
|
7
10
|
command: AcEdCommand;
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* Abstract base class for all CAD commands.
|
|
14
|
+
*
|
|
15
|
+
* This class provides the foundation for implementing CAD commands with:
|
|
16
|
+
* - Command name management (global and localized names)
|
|
17
|
+
* - Lifecycle event handling (command start/end)
|
|
18
|
+
* - Execution framework with context access
|
|
19
|
+
* - Event notification system
|
|
20
|
+
*
|
|
21
|
+
* Commands are the primary way users interact with the CAD system. Each command
|
|
22
|
+
* represents a specific operation like drawing lines, selecting objects, zooming, etc.
|
|
23
|
+
*
|
|
24
|
+
* ## Command Lifecycle
|
|
25
|
+
* 1. Command is triggered via `trigger()` method
|
|
26
|
+
* 2. `commandWillStart` event is fired
|
|
27
|
+
* 3. `execute()` method is called with current context
|
|
28
|
+
* 4. `commandEnded` event is fired
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* class MyDrawCommand extends AcEdCommand {
|
|
33
|
+
* constructor() {
|
|
34
|
+
* super();
|
|
35
|
+
* this.globalName = 'DRAW';
|
|
36
|
+
* this.localName = 'Draw Line';
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* execute(context: AcApContext) {
|
|
40
|
+
* // Implement command logic here
|
|
41
|
+
* const view = context.view;
|
|
42
|
+
* const document = context.doc;
|
|
43
|
+
* // ... drawing logic
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* // Usage
|
|
48
|
+
* const command = new MyDrawCommand();
|
|
49
|
+
* command.events.commandWillStart.addEventListener(args => {
|
|
50
|
+
* console.log('Command starting:', args.command.globalName);
|
|
51
|
+
* });
|
|
52
|
+
* command.trigger(context);
|
|
53
|
+
* ```
|
|
11
54
|
*/
|
|
12
55
|
export declare abstract class AcEdCommand {
|
|
56
|
+
/** The global (untranslated) name of the command */
|
|
13
57
|
private _globalName;
|
|
58
|
+
/** The local (translated) name of the command */
|
|
14
59
|
private _localName;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new command instance.
|
|
62
|
+
*
|
|
63
|
+
* Initializes the command with empty names. Subclasses should set
|
|
64
|
+
* appropriate global and local names in their constructors.
|
|
65
|
+
*/
|
|
15
66
|
constructor();
|
|
67
|
+
/** Events fired during command execution lifecycle */
|
|
16
68
|
readonly events: {
|
|
69
|
+
/** Fired just before the command starts executing */
|
|
17
70
|
commandWillStart: AcCmEventManager<AcEdCommandEventArgs>;
|
|
71
|
+
/** Fired after the command finishes executing */
|
|
18
72
|
commandEnded: AcCmEventManager<AcEdCommandEventArgs>;
|
|
19
73
|
};
|
|
20
74
|
/**
|
|
21
|
-
*
|
|
75
|
+
* Gets the global (untranslated) name of the command.
|
|
76
|
+
*
|
|
77
|
+
* The global name is typically used for programmatic access and
|
|
78
|
+
* should remain consistent across different language localizations.
|
|
79
|
+
*
|
|
80
|
+
* @returns The global command name
|
|
22
81
|
*/
|
|
23
82
|
get globalName(): string;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the global (untranslated) name of the command.
|
|
85
|
+
*
|
|
86
|
+
* @param value - The global command name (e.g., 'LINE', 'CIRCLE', 'ZOOM')
|
|
87
|
+
*/
|
|
24
88
|
set globalName(value: string);
|
|
25
89
|
/**
|
|
26
|
-
*
|
|
90
|
+
* Gets the local (translated) name of the command.
|
|
91
|
+
*
|
|
92
|
+
* The local name is displayed to users and should be localized
|
|
93
|
+
* to the current language/region.
|
|
94
|
+
*
|
|
95
|
+
* @returns The localized command name
|
|
27
96
|
*/
|
|
28
97
|
get localName(): string;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the local (translated) name of the command.
|
|
100
|
+
*
|
|
101
|
+
* @param value - The localized command name (e.g., 'Draw Line', 'Zoom In')
|
|
102
|
+
*/
|
|
29
103
|
set localName(value: string);
|
|
30
104
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
105
|
+
* Triggers the command execution with proper event handling.
|
|
106
|
+
*
|
|
107
|
+
* This method should not be overridden by subclasses as it handles
|
|
108
|
+
* the event notification workflow. Subclasses should implement the
|
|
109
|
+
* `execute()` method instead.
|
|
110
|
+
*
|
|
111
|
+
* The execution flow:
|
|
112
|
+
* 1. Fires `commandWillStart` event
|
|
113
|
+
* 2. Calls the `execute()` method
|
|
114
|
+
* 3. Fires `commandEnded` event
|
|
115
|
+
*
|
|
116
|
+
* @param context - The current application context containing view and document
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const command = new MyCommand();
|
|
121
|
+
* command.trigger(docManager.context);
|
|
122
|
+
* ```
|
|
34
123
|
*/
|
|
35
124
|
tirgger(context: AcApContext): void;
|
|
36
125
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
126
|
+
* Executes the command logic.
|
|
127
|
+
*
|
|
128
|
+
* This abstract method must be implemented by subclasses to define
|
|
129
|
+
* the specific behavior of the command. The method receives the current
|
|
130
|
+
* application context providing access to the view and document.
|
|
131
|
+
*
|
|
132
|
+
* @param _context - The current application context
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* execute(context: AcApContext) {
|
|
137
|
+
* const view = context.view;
|
|
138
|
+
* const doc = context.doc;
|
|
139
|
+
*
|
|
140
|
+
* // Get user input
|
|
141
|
+
* const point = await view.editor.getPoint();
|
|
142
|
+
*
|
|
143
|
+
* // Create entity in document
|
|
144
|
+
* const entity = new SomeEntity(point);
|
|
145
|
+
* doc.database.addEntity(entity);
|
|
146
|
+
* }
|
|
147
|
+
* ```
|
|
39
148
|
*/
|
|
40
149
|
execute(_context: AcApContext): void;
|
|
41
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommand.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"AcEdCommand.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,OAAO,EAAE,WAAW,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,8BAAsB,WAAW;IAC/B,oDAAoD;IACpD,OAAO,CAAC,WAAW,CAAQ;IAC3B,iDAAiD;IACjD,OAAO,CAAC,UAAU,CAAQ;IAE1B;;;;;OAKG;;IAMH,sDAAsD;IACtD,SAAgB,MAAM;QACpB,qDAAqD;;QAErD,iDAAiD;;MAElD;IAED;;;;;;;OAOG;IACH,IAAI,UAAU,IASQ,MAAM,CAP3B;IAED;;;;OAIG;IACH,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED;;;;;;;OAOG;IACH,IAAI,SAAS,IASQ,MAAM,CAP1B;IAED;;;;OAIG;IACH,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAE1B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;IAM5B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAG9B"}
|