@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
2
|
import { defaults } from 'lodash-es';
|
|
3
|
+
/** Default values for all application settings */
|
|
3
4
|
var DEFAULT_VALUES = {
|
|
4
5
|
isDebug: false,
|
|
5
6
|
isShowCommandLine: true,
|
|
@@ -8,14 +9,57 @@ var DEFAULT_VALUES = {
|
|
|
8
9
|
isShowStats: false,
|
|
9
10
|
fontMapping: {}
|
|
10
11
|
};
|
|
12
|
+
/** Local storage key for persisting settings */
|
|
11
13
|
var SETTINGS_LS_KEY = 'settings';
|
|
14
|
+
/**
|
|
15
|
+
* Singleton settings manager for the CAD application.
|
|
16
|
+
*
|
|
17
|
+
* This class manages application-wide settings with:
|
|
18
|
+
* - Persistent storage using localStorage
|
|
19
|
+
* - Event notification when settings change
|
|
20
|
+
* - Type-safe setting access
|
|
21
|
+
* - Default value fallbacks
|
|
22
|
+
*
|
|
23
|
+
* The settings are automatically saved to localStorage and restored on application start.
|
|
24
|
+
*
|
|
25
|
+
* @template T - The settings interface type, defaults to AcApSettings
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Get the singleton instance
|
|
30
|
+
* const settings = AcApSettingManager.instance;
|
|
31
|
+
*
|
|
32
|
+
* // Set a setting value
|
|
33
|
+
* settings.set('isShowToolbar', false);
|
|
34
|
+
*
|
|
35
|
+
* // Get a setting value
|
|
36
|
+
* const showToolbar = settings.get('isShowToolbar');
|
|
37
|
+
*
|
|
38
|
+
* // Toggle a boolean setting
|
|
39
|
+
* settings.toggle('isDebug');
|
|
40
|
+
*
|
|
41
|
+
* // Listen for setting changes
|
|
42
|
+
* settings.events.modified.addEventListener(args => {
|
|
43
|
+
* console.log(`Setting ${args.key} changed to:`, args.value);
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
12
47
|
var AcApSettingManager = /** @class */ (function () {
|
|
13
48
|
function AcApSettingManager() {
|
|
49
|
+
/** Events fired when settings are modified */
|
|
14
50
|
this.events = {
|
|
51
|
+
/** Fired when any setting is modified */
|
|
15
52
|
modified: new AcCmEventManager()
|
|
16
53
|
};
|
|
17
54
|
}
|
|
18
55
|
Object.defineProperty(AcApSettingManager, "instance", {
|
|
56
|
+
/**
|
|
57
|
+
* Gets the singleton instance of the settings manager.
|
|
58
|
+
*
|
|
59
|
+
* Creates a new instance if one doesn't exist yet.
|
|
60
|
+
*
|
|
61
|
+
* @returns The singleton settings manager instance
|
|
62
|
+
*/
|
|
19
63
|
get: function () {
|
|
20
64
|
if (!this._instance) {
|
|
21
65
|
this._instance = new AcApSettingManager();
|
|
@@ -25,6 +69,21 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
25
69
|
enumerable: false,
|
|
26
70
|
configurable: true
|
|
27
71
|
});
|
|
72
|
+
/**
|
|
73
|
+
* Sets a setting value and persists it to localStorage.
|
|
74
|
+
*
|
|
75
|
+
* Fires a modified event after the setting is saved.
|
|
76
|
+
*
|
|
77
|
+
* @template K - The setting key type
|
|
78
|
+
* @param key - The setting key to modify
|
|
79
|
+
* @param value - The new value for the setting
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* settings.set('isShowToolbar', false);
|
|
84
|
+
* settings.set('fontMapping', { 'Arial': 'Helvetica' });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
28
87
|
AcApSettingManager.prototype.set = function (key, value) {
|
|
29
88
|
var toggles = this.settings;
|
|
30
89
|
toggles[key] = value;
|
|
@@ -34,18 +93,57 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
34
93
|
value: value
|
|
35
94
|
});
|
|
36
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Gets a setting value.
|
|
98
|
+
*
|
|
99
|
+
* Returns the stored value or the default value if not set.
|
|
100
|
+
*
|
|
101
|
+
* @template K - The setting key type
|
|
102
|
+
* @param key - The setting key to retrieve
|
|
103
|
+
* @returns The setting value
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* const isDebug = settings.get('isDebug');
|
|
108
|
+
* const fontMapping = settings.get('fontMapping');
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
37
111
|
AcApSettingManager.prototype.get = function (key) {
|
|
38
112
|
return this.settings[key];
|
|
39
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Toggles a boolean setting value.
|
|
116
|
+
*
|
|
117
|
+
* Only works with boolean settings. The caller should ensure the setting is boolean.
|
|
118
|
+
*
|
|
119
|
+
* @template K - The setting key type
|
|
120
|
+
* @param key - The boolean setting key to toggle
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* settings.toggle('isDebug'); // false -> true
|
|
125
|
+
* settings.toggle('isShowToolbar'); // true -> false
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
40
128
|
AcApSettingManager.prototype.toggle = function (key) {
|
|
41
129
|
var value = this.get(key);
|
|
42
130
|
// @ts-expect-error The caller should guarantee the correct feature name passed to this function
|
|
43
131
|
this.set(key, !value);
|
|
44
132
|
};
|
|
45
133
|
Object.defineProperty(AcApSettingManager.prototype, "isDebug", {
|
|
134
|
+
/**
|
|
135
|
+
* Gets whether debug mode is enabled.
|
|
136
|
+
*
|
|
137
|
+
* @returns True if debug mode is enabled
|
|
138
|
+
*/
|
|
46
139
|
get: function () {
|
|
47
140
|
return this.get('isDebug');
|
|
48
141
|
},
|
|
142
|
+
/**
|
|
143
|
+
* Sets whether debug mode is enabled.
|
|
144
|
+
*
|
|
145
|
+
* @param value - True to enable debug mode
|
|
146
|
+
*/
|
|
49
147
|
set: function (value) {
|
|
50
148
|
this.set('isDebug', value);
|
|
51
149
|
},
|
|
@@ -53,9 +151,19 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
53
151
|
configurable: true
|
|
54
152
|
});
|
|
55
153
|
Object.defineProperty(AcApSettingManager.prototype, "isShowCommandLine", {
|
|
154
|
+
/**
|
|
155
|
+
* Gets whether the command line is visible.
|
|
156
|
+
*
|
|
157
|
+
* @returns True if command line should be shown
|
|
158
|
+
*/
|
|
56
159
|
get: function () {
|
|
57
160
|
return this.get('isShowCommandLine');
|
|
58
161
|
},
|
|
162
|
+
/**
|
|
163
|
+
* Sets whether the command line is visible.
|
|
164
|
+
*
|
|
165
|
+
* @param value - True to show the command line
|
|
166
|
+
*/
|
|
59
167
|
set: function (value) {
|
|
60
168
|
this.set('isShowCommandLine', value);
|
|
61
169
|
},
|
|
@@ -63,9 +171,19 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
63
171
|
configurable: true
|
|
64
172
|
});
|
|
65
173
|
Object.defineProperty(AcApSettingManager.prototype, "isShowCoordinate", {
|
|
174
|
+
/**
|
|
175
|
+
* Gets whether coordinate display is visible.
|
|
176
|
+
*
|
|
177
|
+
* @returns True if coordinates should be displayed
|
|
178
|
+
*/
|
|
66
179
|
get: function () {
|
|
67
180
|
return this.get('isShowCoordinate');
|
|
68
181
|
},
|
|
182
|
+
/**
|
|
183
|
+
* Sets whether coordinate display is visible.
|
|
184
|
+
*
|
|
185
|
+
* @param value - True to show coordinates
|
|
186
|
+
*/
|
|
69
187
|
set: function (value) {
|
|
70
188
|
this.set('isShowCoordinate', value);
|
|
71
189
|
},
|
|
@@ -73,9 +191,19 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
73
191
|
configurable: true
|
|
74
192
|
});
|
|
75
193
|
Object.defineProperty(AcApSettingManager.prototype, "isShowToolbar", {
|
|
194
|
+
/**
|
|
195
|
+
* Gets whether the toolbar is visible.
|
|
196
|
+
*
|
|
197
|
+
* @returns True if toolbar should be shown
|
|
198
|
+
*/
|
|
76
199
|
get: function () {
|
|
77
200
|
return this.get('isShowToolbar');
|
|
78
201
|
},
|
|
202
|
+
/**
|
|
203
|
+
* Sets whether the toolbar is visible.
|
|
204
|
+
*
|
|
205
|
+
* @param value - True to show the toolbar
|
|
206
|
+
*/
|
|
79
207
|
set: function (value) {
|
|
80
208
|
this.set('isShowToolbar', value);
|
|
81
209
|
},
|
|
@@ -83,9 +211,19 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
83
211
|
configurable: true
|
|
84
212
|
});
|
|
85
213
|
Object.defineProperty(AcApSettingManager.prototype, "isShowStats", {
|
|
214
|
+
/**
|
|
215
|
+
* Gets whether performance statistics are displayed.
|
|
216
|
+
*
|
|
217
|
+
* @returns True if stats should be shown
|
|
218
|
+
*/
|
|
86
219
|
get: function () {
|
|
87
220
|
return this.get('isShowStats');
|
|
88
221
|
},
|
|
222
|
+
/**
|
|
223
|
+
* Sets whether performance statistics are displayed.
|
|
224
|
+
*
|
|
225
|
+
* @param value - True to show stats
|
|
226
|
+
*/
|
|
89
227
|
set: function (value) {
|
|
90
228
|
this.set('isShowStats', value);
|
|
91
229
|
},
|
|
@@ -93,21 +231,44 @@ var AcApSettingManager = /** @class */ (function () {
|
|
|
93
231
|
configurable: true
|
|
94
232
|
});
|
|
95
233
|
Object.defineProperty(AcApSettingManager.prototype, "fontMapping", {
|
|
234
|
+
/**
|
|
235
|
+
* Gets the font mapping configuration.
|
|
236
|
+
*
|
|
237
|
+
* @returns The current font mapping
|
|
238
|
+
*/
|
|
96
239
|
get: function () {
|
|
97
240
|
return this.get('fontMapping');
|
|
98
241
|
},
|
|
242
|
+
/**
|
|
243
|
+
* Sets the font mapping configuration.
|
|
244
|
+
*
|
|
245
|
+
* @param value - The new font mapping
|
|
246
|
+
*/
|
|
99
247
|
set: function (value) {
|
|
100
248
|
this.set('fontMapping', value);
|
|
101
249
|
},
|
|
102
250
|
enumerable: false,
|
|
103
251
|
configurable: true
|
|
104
252
|
});
|
|
253
|
+
/**
|
|
254
|
+
* Sets a single font mapping entry.
|
|
255
|
+
*
|
|
256
|
+
* @param originalFont - The original font name
|
|
257
|
+
* @param mappedFont - The replacement font name
|
|
258
|
+
*/
|
|
105
259
|
AcApSettingManager.prototype.setFontMapping = function (originalFont, mappedFont) {
|
|
106
260
|
var mapping = this.get('fontMapping');
|
|
107
261
|
mapping[originalFont] = mappedFont;
|
|
108
262
|
this.set('fontMapping', mapping);
|
|
109
263
|
};
|
|
110
264
|
Object.defineProperty(AcApSettingManager.prototype, "settings", {
|
|
265
|
+
/**
|
|
266
|
+
* Gets the current settings object.
|
|
267
|
+
*
|
|
268
|
+
* This method combines localStorage values with default values.
|
|
269
|
+
*
|
|
270
|
+
* @returns The current settings object
|
|
271
|
+
*/
|
|
111
272
|
get: function () {
|
|
112
273
|
var values = localStorage.getItem(SETTINGS_LS_KEY);
|
|
113
274
|
var results = (values == null ? {} : JSON.parse(values));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSettingManager.js","sourceRoot":"","sources":["../../src/app/AcApSettingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApSettingManager.js","sourceRoot":"","sources":["../../src/app/AcApSettingManager.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
|
+
/**
|
|
4
|
+
* Command for converting the current CAD drawing to SVG format.
|
|
5
|
+
*
|
|
6
|
+
* This command creates an SVG converter and initiates the conversion
|
|
7
|
+
* process to export the current drawing as an SVG file. The command:
|
|
8
|
+
* - Creates a new SVG converter instance
|
|
9
|
+
* - Converts all entities in the current document to SVG
|
|
10
|
+
* - Automatically downloads the SVG file
|
|
11
|
+
*
|
|
12
|
+
* This is useful for exporting drawings to a web-friendly vector format
|
|
13
|
+
* that can be displayed in browsers or used in web applications.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const convertCmd = new AcApConvertToSvgCmd();
|
|
18
|
+
* convertCmd.execute(context); // Converts and downloads as SVG
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
3
21
|
export declare class AcApConvertToSvgCmd extends AcEdCommand {
|
|
22
|
+
/**
|
|
23
|
+
* Executes the SVG conversion command.
|
|
24
|
+
*
|
|
25
|
+
* Creates a converter instance and initiates the conversion process
|
|
26
|
+
* for the current document.
|
|
27
|
+
*
|
|
28
|
+
* @param _context - The application context (unused in this command)
|
|
29
|
+
*/
|
|
4
30
|
execute(_context: AcApContext): void;
|
|
5
31
|
}
|
|
6
32
|
//# sourceMappingURL=AcApConvertToSvgCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApConvertToSvgCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApConvertToSvgCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,OAAO,CAAC,QAAQ,EAAE,WAAW;CAI9B"}
|
|
1
|
+
{"version":3,"file":"AcApConvertToSvgCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApConvertToSvgCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAI9B"}
|
|
@@ -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"}
|