@mlightcad/cad-simple-viewer 1.0.0 → 1.0.2
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 +1348 -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 +229 -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 +76 -7
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js +38 -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 { AcApSvgConvertor } from './AcApSvgConvertor';
|
|
18
|
+
/**
|
|
19
|
+
* Command for converting the current CAD drawing to SVG format.
|
|
20
|
+
*
|
|
21
|
+
* This command creates an SVG converter and initiates the conversion
|
|
22
|
+
* process to export the current drawing as an SVG file. The command:
|
|
23
|
+
* - Creates a new SVG converter instance
|
|
24
|
+
* - Converts all entities in the current document to SVG
|
|
25
|
+
* - Automatically downloads the SVG file
|
|
26
|
+
*
|
|
27
|
+
* This is useful for exporting drawings to a web-friendly vector format
|
|
28
|
+
* that can be displayed in browsers or used in web applications.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const convertCmd = new AcApConvertToSvgCmd();
|
|
33
|
+
* convertCmd.execute(context); // Converts and downloads as SVG
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
18
36
|
var AcApConvertToSvgCmd = /** @class */ (function (_super) {
|
|
19
37
|
__extends(AcApConvertToSvgCmd, _super);
|
|
20
38
|
function AcApConvertToSvgCmd() {
|
|
21
39
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Executes the SVG conversion command.
|
|
43
|
+
*
|
|
44
|
+
* Creates a converter instance and initiates the conversion process
|
|
45
|
+
* for the current document.
|
|
46
|
+
*
|
|
47
|
+
* @param _context - The application context (unused in this command)
|
|
48
|
+
*/
|
|
23
49
|
AcApConvertToSvgCmd.prototype.execute = function (_context) {
|
|
24
50
|
var converter = new AcApSvgConvertor();
|
|
25
51
|
converter.convert();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApConvertToSvgCmd.js","sourceRoot":"","sources":["../../src/command/AcApConvertToSvgCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;IAAyC,uCAAW;IAApD;;
|
|
1
|
+
{"version":3,"file":"AcApConvertToSvgCmd.js","sourceRoot":"","sources":["../../src/command/AcApConvertToSvgCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAyC,uCAAW;IAApD;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,qCAAO,GAAP,UAAQ,QAAqB;QAC3B,IAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAA;QACxC,SAAS,CAAC,OAAO,EAAE,CAAA;IACrB,CAAC;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,WAAW,GAanD"}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* Command to open a CAD file.
|
|
5
|
+
*
|
|
6
|
+
* This command triggers the file opening workflow by emitting an 'open-file' event
|
|
7
|
+
* on the global event bus. The actual file opening logic is handled by other
|
|
8
|
+
* components listening for this event (typically the UI layer).
|
|
9
|
+
*
|
|
10
|
+
* The command follows the standard CAD pattern where the command itself is lightweight
|
|
11
|
+
* and delegates the actual work to specialized handlers.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const openCommand = new AcApOpenCmd();
|
|
16
|
+
* openCommand.globalName = 'OPEN';
|
|
17
|
+
* openCommand.localName = 'Open File';
|
|
18
|
+
*
|
|
19
|
+
* // Trigger the command
|
|
20
|
+
* openCommand.trigger(docManager.context);
|
|
21
|
+
*
|
|
22
|
+
* // The command will emit 'open-file' event for UI components to handle
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
3
25
|
export declare class AcApOpenCmd extends AcEdCommand {
|
|
26
|
+
/**
|
|
27
|
+
* Executes the open file command.
|
|
28
|
+
*
|
|
29
|
+
* Emits an 'open-file' event on the global event bus to trigger
|
|
30
|
+
* the file opening workflow. UI components typically listen for
|
|
31
|
+
* this event to display file selection dialogs.
|
|
32
|
+
*
|
|
33
|
+
* @param _context - The current application context (not used in this command)
|
|
34
|
+
*/
|
|
4
35
|
execute(_context: AcApContext): void;
|
|
5
36
|
}
|
|
6
37
|
//# sourceMappingURL=AcApOpenCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApOpenCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApOpenCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,QAAQ,EAAE,WAAW;CAG9B"}
|
|
1
|
+
{"version":3,"file":"AcApOpenCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApOpenCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAG9B"}
|
|
@@ -15,11 +15,42 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
})();
|
|
16
16
|
import { AcEdCommand } from '../command';
|
|
17
17
|
import { eventBus } from '../editor';
|
|
18
|
+
/**
|
|
19
|
+
* Command to open a CAD file.
|
|
20
|
+
*
|
|
21
|
+
* This command triggers the file opening workflow by emitting an 'open-file' event
|
|
22
|
+
* on the global event bus. The actual file opening logic is handled by other
|
|
23
|
+
* components listening for this event (typically the UI layer).
|
|
24
|
+
*
|
|
25
|
+
* The command follows the standard CAD pattern where the command itself is lightweight
|
|
26
|
+
* and delegates the actual work to specialized handlers.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const openCommand = new AcApOpenCmd();
|
|
31
|
+
* openCommand.globalName = 'OPEN';
|
|
32
|
+
* openCommand.localName = 'Open File';
|
|
33
|
+
*
|
|
34
|
+
* // Trigger the command
|
|
35
|
+
* openCommand.trigger(docManager.context);
|
|
36
|
+
*
|
|
37
|
+
* // The command will emit 'open-file' event for UI components to handle
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
18
40
|
var AcApOpenCmd = /** @class */ (function (_super) {
|
|
19
41
|
__extends(AcApOpenCmd, _super);
|
|
20
42
|
function AcApOpenCmd() {
|
|
21
43
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Executes the open file command.
|
|
47
|
+
*
|
|
48
|
+
* Emits an 'open-file' event on the global event bus to trigger
|
|
49
|
+
* the file opening workflow. UI components typically listen for
|
|
50
|
+
* this event to display file selection dialogs.
|
|
51
|
+
*
|
|
52
|
+
* @param _context - The current application context (not used in this command)
|
|
53
|
+
*/
|
|
23
54
|
AcApOpenCmd.prototype.execute = function (_context) {
|
|
24
55
|
eventBus.emit('open-file', {});
|
|
25
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApOpenCmd.js","sourceRoot":"","sources":["../../src/command/AcApOpenCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC;IAAiC,+BAAW;IAA5C;;
|
|
1
|
+
{"version":3,"file":"AcApOpenCmd.js","sourceRoot":"","sources":["../../src/command/AcApOpenCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAAiC,+BAAW;IAA5C;;IAaA,CAAC;IAZC;;;;;;;;OAQG;IACH,6BAAO,GAAP,UAAQ,QAAqB;QAC3B,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IAChC,CAAC;IACH,kBAAC;AAAD,CAAC,AAbD,CAAiC,WAAW,GAa3C"}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* Command for enabling pan mode in the CAD viewer.
|
|
5
|
+
*
|
|
6
|
+
* This command switches the view to pan mode, allowing users to drag
|
|
7
|
+
* and move the drawing around the canvas. When executed, it:
|
|
8
|
+
* - Sets the view mode to PAN
|
|
9
|
+
* - Changes the cursor to a grab cursor for visual feedback
|
|
10
|
+
*
|
|
11
|
+
* Pan mode allows users to click and drag to move the viewport,
|
|
12
|
+
* providing an intuitive way to navigate large drawings.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const panCmd = new AcApPanCmd();
|
|
17
|
+
* panCmd.execute(context); // Enables pan mode
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
3
20
|
export declare class AcApPanCmd extends AcEdCommand {
|
|
21
|
+
/**
|
|
22
|
+
* Executes the pan command.
|
|
23
|
+
*
|
|
24
|
+
* Sets the view to pan mode and updates the cursor appearance
|
|
25
|
+
* to indicate that panning is active.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The application context containing the view
|
|
28
|
+
*/
|
|
4
29
|
execute(context: AcApContext): void;
|
|
5
30
|
}
|
|
6
31
|
//# sourceMappingURL=AcApPanCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPanCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApPanCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,qBAAa,UAAW,SAAQ,WAAW;IACzC,OAAO,CAAC,OAAO,EAAE,WAAW;CAI7B"}
|
|
1
|
+
{"version":3,"file":"AcApPanCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApPanCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;CAI7B"}
|
|
@@ -15,11 +15,36 @@ 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 pan mode in the CAD viewer.
|
|
20
|
+
*
|
|
21
|
+
* This command switches the view to pan mode, allowing users to drag
|
|
22
|
+
* and move the drawing around the canvas. When executed, it:
|
|
23
|
+
* - Sets the view mode to PAN
|
|
24
|
+
* - Changes the cursor to a grab cursor for visual feedback
|
|
25
|
+
*
|
|
26
|
+
* Pan mode allows users to click and drag to move the viewport,
|
|
27
|
+
* providing an intuitive way to navigate large drawings.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const panCmd = new AcApPanCmd();
|
|
32
|
+
* panCmd.execute(context); // Enables pan mode
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
18
35
|
var AcApPanCmd = /** @class */ (function (_super) {
|
|
19
36
|
__extends(AcApPanCmd, _super);
|
|
20
37
|
function AcApPanCmd() {
|
|
21
38
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Executes the pan command.
|
|
42
|
+
*
|
|
43
|
+
* Sets the view to pan mode and updates the cursor appearance
|
|
44
|
+
* to indicate that panning is active.
|
|
45
|
+
*
|
|
46
|
+
* @param context - The application context containing the view
|
|
47
|
+
*/
|
|
23
48
|
AcApPanCmd.prototype.execute = function (context) {
|
|
24
49
|
context.view.mode = AcEdViewMode.PAN;
|
|
25
50
|
context.view.setCursor(AcEdCorsorType.Grab);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApPanCmd.js","sourceRoot":"","sources":["../../src/command/AcApPanCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;IAAgC,8BAAW;IAA3C;;
|
|
1
|
+
{"version":3,"file":"AcApPanCmd.js","sourceRoot":"","sources":["../../src/command/AcApPanCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH;IAAgC,8BAAW;IAA3C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,4BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,GAAG,CAAA;QACpC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC;IACH,iBAAC;AAAD,CAAC,AAbD,CAAgC,WAAW,GAa1C"}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* Command for creating a new CAD document from a template.
|
|
5
|
+
*
|
|
6
|
+
* This command opens a predefined template drawing (acadiso.dxf) from
|
|
7
|
+
* a CDN to create a new document. The template provides:
|
|
8
|
+
* - Standard ISO drawing settings
|
|
9
|
+
* - Predefined layers and styles
|
|
10
|
+
* - Default drawing setup
|
|
11
|
+
*
|
|
12
|
+
* This is equivalent to "Quick New" functionality in traditional CAD applications,
|
|
13
|
+
* providing users with a ready-to-use drawing environment.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const qNewCmd = new AcApQNewCmd();
|
|
18
|
+
* qNewCmd.execute(context); // Creates new document from template
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
3
21
|
export declare class AcApQNewCmd extends AcEdCommand {
|
|
22
|
+
/**
|
|
23
|
+
* Executes the quick new command.
|
|
24
|
+
*
|
|
25
|
+
* Opens the ISO template from the CDN to create a new document
|
|
26
|
+
* with standard drawing settings.
|
|
27
|
+
*
|
|
28
|
+
* @param _context - The application context (unused in this command)
|
|
29
|
+
*/
|
|
4
30
|
execute(_context: AcApContext): void;
|
|
5
31
|
}
|
|
6
32
|
//# sourceMappingURL=AcApQNewCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApQNewCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApQNewCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,QAAQ,EAAE,WAAW;CAI9B"}
|
|
1
|
+
{"version":3,"file":"AcApQNewCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApQNewCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAI9B"}
|
|
@@ -15,11 +15,37 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
})();
|
|
16
16
|
import { AcApDocManager } from '../app';
|
|
17
17
|
import { AcEdCommand } from '../command';
|
|
18
|
+
/**
|
|
19
|
+
* Command for creating a new CAD document from a template.
|
|
20
|
+
*
|
|
21
|
+
* This command opens a predefined template drawing (acadiso.dxf) from
|
|
22
|
+
* a CDN to create a new document. The template provides:
|
|
23
|
+
* - Standard ISO drawing settings
|
|
24
|
+
* - Predefined layers and styles
|
|
25
|
+
* - Default drawing setup
|
|
26
|
+
*
|
|
27
|
+
* This is equivalent to "Quick New" functionality in traditional CAD applications,
|
|
28
|
+
* providing users with a ready-to-use drawing environment.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const qNewCmd = new AcApQNewCmd();
|
|
33
|
+
* qNewCmd.execute(context); // Creates new document from template
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
18
36
|
var AcApQNewCmd = /** @class */ (function (_super) {
|
|
19
37
|
__extends(AcApQNewCmd, _super);
|
|
20
38
|
function AcApQNewCmd() {
|
|
21
39
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Executes the quick new command.
|
|
43
|
+
*
|
|
44
|
+
* Opens the ISO template from the CDN to create a new document
|
|
45
|
+
* with standard drawing settings.
|
|
46
|
+
*
|
|
47
|
+
* @param _context - The application context (unused in this command)
|
|
48
|
+
*/
|
|
23
49
|
AcApQNewCmd.prototype.execute = function (_context) {
|
|
24
50
|
var baseUrl = 'https://cdn.jsdelivr.net/gh/mlight-lee/cad-data/templates/';
|
|
25
51
|
AcApDocManager.instance.openUrl(baseUrl + 'acadiso.dxf');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApQNewCmd.js","sourceRoot":"","sources":["../../src/command/AcApQNewCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;IAAiC,+BAAW;IAA5C;;
|
|
1
|
+
{"version":3,"file":"AcApQNewCmd.js","sourceRoot":"","sources":["../../src/command/AcApQNewCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAiC,+BAAW;IAA5C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,QAAqB;QAC3B,IAAM,OAAO,GAAG,4DAA4D,CAAA;QAC5E,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,GAAG,aAAa,CAAC,CAAA;IAC1D,CAAC;IACH,kBAAC;AAAD,CAAC,AAbD,CAAiC,WAAW,GAa3C"}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* Command for enabling selection mode in the CAD viewer.
|
|
5
|
+
*
|
|
6
|
+
* This command switches the view to selection mode, allowing users to
|
|
7
|
+
* select CAD entities by clicking on them. When executed, it:
|
|
8
|
+
* - Sets the view mode to SELECTION
|
|
9
|
+
* - Changes the cursor to a crosshair for precise selection
|
|
10
|
+
*
|
|
11
|
+
* In selection mode, users can click on entities to select them,
|
|
12
|
+
* which will add them to the selection set and typically show
|
|
13
|
+
* grip points for manipulation.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const selectCmd = new AcApSelectCmd();
|
|
18
|
+
* selectCmd.execute(context); // Enables selection mode
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
3
21
|
export declare class AcApSelectCmd extends AcEdCommand {
|
|
22
|
+
/**
|
|
23
|
+
* Executes the select command.
|
|
24
|
+
*
|
|
25
|
+
* Sets the view to selection mode and updates the cursor appearance
|
|
26
|
+
* to indicate that entity selection is active.
|
|
27
|
+
*
|
|
28
|
+
* @param context - The application context containing the view
|
|
29
|
+
*/
|
|
4
30
|
execute(context: AcApContext): void;
|
|
5
31
|
}
|
|
6
32
|
//# sourceMappingURL=AcApSelectCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSelectCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,qBAAa,aAAc,SAAQ,WAAW;IAC5C,OAAO,CAAC,OAAO,EAAE,WAAW;CAI7B"}
|
|
1
|
+
{"version":3,"file":"AcApSelectCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;CAI7B"}
|
|
@@ -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"}
|