@mlightcad/cad-simple-viewer 1.2.1 → 1.2.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/package.json +6 -6
- package/dist/index.js +0 -33474
- package/dist/index.umd.cjs +0 -294
- package/dist/libredwg-parser-worker.js +0 -15411
- package/dist/mtext-renderer-worker.js +0 -29938
- package/lib/app/AcApContext.d.ts +0 -57
- package/lib/app/AcApContext.d.ts.map +0 -1
- package/lib/app/AcApContext.js +0 -106
- package/lib/app/AcApContext.js.map +0 -1
- package/lib/app/AcApDocManager.d.ts +0 -291
- package/lib/app/AcApDocManager.d.ts.map +0 -1
- package/lib/app/AcApDocManager.js +0 -498
- package/lib/app/AcApDocManager.js.map +0 -1
- package/lib/app/AcApDocument.d.ts +0 -101
- package/lib/app/AcApDocument.d.ts.map +0 -1
- package/lib/app/AcApDocument.js +0 -237
- package/lib/app/AcApDocument.js.map +0 -1
- package/lib/app/AcApFontLoader.d.ts +0 -54
- package/lib/app/AcApFontLoader.d.ts.map +0 -1
- package/lib/app/AcApFontLoader.js +0 -151
- package/lib/app/AcApFontLoader.js.map +0 -1
- package/lib/app/AcApGlobalFunc.d.ts +0 -26
- package/lib/app/AcApGlobalFunc.d.ts.map +0 -1
- package/lib/app/AcApGlobalFunc.js +0 -66
- package/lib/app/AcApGlobalFunc.js.map +0 -1
- package/lib/app/AcApSettingManager.d.ts +0 -232
- package/lib/app/AcApSettingManager.d.ts.map +0 -1
- package/lib/app/AcApSettingManager.js +0 -283
- package/lib/app/AcApSettingManager.js.map +0 -1
- package/lib/app/index.d.ts +0 -6
- package/lib/app/index.d.ts.map +0 -1
- package/lib/app/index.js +0 -6
- package/lib/app/index.js.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts +0 -32
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.js +0 -56
- package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
- package/lib/command/AcApOpenCmd.d.ts +0 -37
- package/lib/command/AcApOpenCmd.d.ts.map +0 -1
- package/lib/command/AcApOpenCmd.js +0 -60
- package/lib/command/AcApOpenCmd.js.map +0 -1
- package/lib/command/AcApPanCmd.d.ts +0 -31
- package/lib/command/AcApPanCmd.d.ts.map +0 -1
- package/lib/command/AcApPanCmd.js +0 -55
- package/lib/command/AcApPanCmd.js.map +0 -1
- package/lib/command/AcApQNewCmd.d.ts +0 -32
- package/lib/command/AcApQNewCmd.d.ts.map +0 -1
- package/lib/command/AcApQNewCmd.js +0 -56
- package/lib/command/AcApQNewCmd.js.map +0 -1
- package/lib/command/AcApRegenCmd.d.ts +0 -21
- package/lib/command/AcApRegenCmd.d.ts.map +0 -1
- package/lib/command/AcApRegenCmd.js +0 -45
- package/lib/command/AcApRegenCmd.js.map +0 -1
- package/lib/command/AcApSelectCmd.d.ts +0 -32
- package/lib/command/AcApSelectCmd.d.ts.map +0 -1
- package/lib/command/AcApSelectCmd.js +0 -56
- package/lib/command/AcApSelectCmd.js.map +0 -1
- package/lib/command/AcApSvgConvertor.d.ts +0 -53
- package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
- package/lib/command/AcApSvgConvertor.js +0 -103
- package/lib/command/AcApSvgConvertor.js.map +0 -1
- package/lib/command/AcApZoomCmd.d.ts +0 -35
- package/lib/command/AcApZoomCmd.d.ts.map +0 -1
- package/lib/command/AcApZoomCmd.js +0 -57
- package/lib/command/AcApZoomCmd.js.map +0 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -68
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +0 -1
- package/lib/command/AcApZoomToBoxCmd.js +0 -158
- package/lib/command/AcApZoomToBoxCmd.js.map +0 -1
- package/lib/command/index.d.ts +0 -11
- package/lib/command/index.d.ts.map +0 -1
- package/lib/command/index.js +0 -11
- package/lib/command/index.js.map +0 -1
- package/lib/editor/command/AcEdCommand.d.ts +0 -151
- package/lib/editor/command/AcEdCommand.d.ts.map +0 -1
- package/lib/editor/command/AcEdCommand.js +0 -164
- package/lib/editor/command/AcEdCommand.js.map +0 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts +0 -36
- package/lib/editor/command/AcEdCommandIterator.d.ts.map +0 -1
- package/lib/editor/command/AcEdCommandIterator.js +0 -65
- package/lib/editor/command/AcEdCommandIterator.js.map +0 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +0 -120
- package/lib/editor/command/AcEdCommandStack.d.ts.map +0 -1
- package/lib/editor/command/AcEdCommandStack.js +0 -235
- package/lib/editor/command/AcEdCommandStack.js.map +0 -1
- package/lib/editor/command/index.d.ts +0 -3
- package/lib/editor/command/index.d.ts.map +0 -1
- package/lib/editor/command/index.js +0 -3
- package/lib/editor/command/index.js.map +0 -1
- package/lib/editor/global/AcEdConditionWaiter.d.ts +0 -51
- package/lib/editor/global/AcEdConditionWaiter.d.ts.map +0 -1
- package/lib/editor/global/AcEdConditionWaiter.js +0 -87
- package/lib/editor/global/AcEdConditionWaiter.js.map +0 -1
- package/lib/editor/global/AcEdGlobalFunc.d.ts +0 -8
- package/lib/editor/global/AcEdGlobalFunc.d.ts.map +0 -1
- package/lib/editor/global/AcEdGlobalFunc.js +0 -14
- package/lib/editor/global/AcEdGlobalFunc.js.map +0 -1
- package/lib/editor/global/AcEdMessage.d.ts +0 -5
- package/lib/editor/global/AcEdMessage.d.ts.map +0 -1
- package/lib/editor/global/AcEdMessage.js +0 -6
- package/lib/editor/global/AcEdMessage.js.map +0 -1
- package/lib/editor/global/eventBus.d.ts +0 -103
- package/lib/editor/global/eventBus.d.ts.map +0 -1
- package/lib/editor/global/eventBus.js +0 -41
- package/lib/editor/global/eventBus.js.map +0 -1
- package/lib/editor/global/index.d.ts +0 -4
- package/lib/editor/global/index.d.ts.map +0 -1
- package/lib/editor/global/index.js +0 -4
- package/lib/editor/global/index.js.map +0 -1
- package/lib/editor/index.d.ts +0 -5
- package/lib/editor/index.d.ts.map +0 -1
- package/lib/editor/index.js +0 -5
- package/lib/editor/index.js.map +0 -1
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +0 -130
- package/lib/editor/input/AcEdCursorManager.d.ts.map +0 -1
- package/lib/editor/input/AcEdCursorManager.js +0 -155
- package/lib/editor/input/AcEdCursorManager.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
- package/lib/editor/input/AcEdSelectionSet.d.ts +0 -146
- package/lib/editor/input/AcEdSelectionSet.d.ts.map +0 -1
- package/lib/editor/input/AcEdSelectionSet.js +0 -179
- package/lib/editor/input/AcEdSelectionSet.js.map +0 -1
- package/lib/editor/input/AcEditor.d.ts +0 -111
- package/lib/editor/input/AcEditor.d.ts.map +0 -1
- package/lib/editor/input/AcEditor.js +0 -183
- package/lib/editor/input/AcEditor.js.map +0 -1
- package/lib/editor/input/index.d.ts +0 -5
- package/lib/editor/input/index.d.ts.map +0 -1
- package/lib/editor/input/index.js +0 -5
- package/lib/editor/input/index.js.map +0 -1
- package/lib/editor/view/AcEdBaseView.d.ts +0 -457
- package/lib/editor/view/AcEdBaseView.d.ts.map +0 -1
- package/lib/editor/view/AcEdBaseView.js +0 -349
- package/lib/editor/view/AcEdBaseView.js.map +0 -1
- package/lib/editor/view/AcEdLayerInfo.d.ts +0 -21
- package/lib/editor/view/AcEdLayerInfo.d.ts.map +0 -1
- package/lib/editor/view/AcEdLayerInfo.js +0 -2
- package/lib/editor/view/AcEdLayerInfo.js.map +0 -1
- package/lib/editor/view/index.d.ts +0 -3
- package/lib/editor/view/index.d.ts.map +0 -1
- package/lib/editor/view/index.js +0 -3
- package/lib/editor/view/index.js.map +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -5
- package/lib/index.js.map +0 -1
- package/lib/util/AcTrGeometryUtil.d.ts +0 -92
- package/lib/util/AcTrGeometryUtil.d.ts.map +0 -1
- package/lib/util/AcTrGeometryUtil.js +0 -109
- package/lib/util/AcTrGeometryUtil.js.map +0 -1
- package/lib/util/index.d.ts +0 -2
- package/lib/util/index.d.ts.map +0 -1
- package/lib/util/index.js +0 -2
- package/lib/util/index.js.map +0 -1
- package/lib/view/AcTrLayer.d.ts +0 -132
- package/lib/view/AcTrLayer.d.ts.map +0 -1
- package/lib/view/AcTrLayer.js +0 -199
- package/lib/view/AcTrLayer.js.map +0 -1
- package/lib/view/AcTrLayout.d.ts +0 -218
- package/lib/view/AcTrLayout.d.ts.map +0 -1
- package/lib/view/AcTrLayout.js +0 -437
- package/lib/view/AcTrLayout.js.map +0 -1
- package/lib/view/AcTrLayoutView.d.ts +0 -115
- package/lib/view/AcTrLayoutView.d.ts.map +0 -1
- package/lib/view/AcTrLayoutView.js +0 -200
- package/lib/view/AcTrLayoutView.js.map +0 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +0 -89
- package/lib/view/AcTrLayoutViewManager.d.ts.map +0 -1
- package/lib/view/AcTrLayoutViewManager.js +0 -118
- package/lib/view/AcTrLayoutViewManager.js.map +0 -1
- package/lib/view/AcTrScene.d.ts +0 -162
- package/lib/view/AcTrScene.d.ts.map +0 -1
- package/lib/view/AcTrScene.js +0 -370
- package/lib/view/AcTrScene.js.map +0 -1
- package/lib/view/AcTrView2d.d.ts +0 -262
- package/lib/view/AcTrView2d.d.ts.map +0 -1
- package/lib/view/AcTrView2d.js +0 -772
- package/lib/view/AcTrView2d.js.map +0 -1
- package/lib/view/index.d.ts +0 -2
- package/lib/view/index.d.ts.map +0 -1
- package/lib/view/index.js +0 -2
- package/lib/view/index.js.map +0 -1
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
import { AcTrBaseView } from '@mlightcad/three-renderer';
|
|
17
|
-
import { AxesGizmo, ObjectPosition } from '@mlightcad/three-viewcube';
|
|
18
|
-
import * as THREE from 'three';
|
|
19
|
-
import { AcEdViewMode } from '../editor/view/AcEdBaseView';
|
|
20
|
-
/**
|
|
21
|
-
* Each layout has its own camera and camera control. This class represents view associated with one layout.
|
|
22
|
-
*
|
|
23
|
-
* A layout view manages the visual representation and interaction for a specific AutoCAD layout.
|
|
24
|
-
* It provides:
|
|
25
|
-
* - Camera and view controls specific to the layout
|
|
26
|
-
* - Viewport management for paper space layouts
|
|
27
|
-
* - View mode switching (selection, pan, etc.)
|
|
28
|
-
* - Axes gizmo for orientation feedback
|
|
29
|
-
* - Rendering coordination with viewports
|
|
30
|
-
*
|
|
31
|
-
* The layout view coordinates between the layout's data (entities, layers) and the visual
|
|
32
|
-
* presentation, handling camera positioning, user interaction modes, and multi-viewport
|
|
33
|
-
* rendering for paper space layouts.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const layoutView = new AcTrLayoutView(renderer, layoutId, 800, 600);
|
|
38
|
-
* layoutView.mode = AcEdViewMode.PAN;
|
|
39
|
-
* layoutView.render(scene);
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
var AcTrLayoutView = /** @class */ (function (_super) {
|
|
43
|
-
__extends(AcTrLayoutView, _super);
|
|
44
|
-
/**
|
|
45
|
-
* Construct one instance of this class.
|
|
46
|
-
*
|
|
47
|
-
* @param renderer - Input renderer for this view
|
|
48
|
-
* @param layoutBtrId - Input the id of the block table record associated the layout
|
|
49
|
-
* @param width - Input width of this view in pixels
|
|
50
|
-
* @param height - Input height of this view in pixels
|
|
51
|
-
*/
|
|
52
|
-
function AcTrLayoutView(renderer, layoutBtrId, width, height) {
|
|
53
|
-
var _this = _super.call(this, renderer, width, height) || this;
|
|
54
|
-
_this._layoutBtrId = layoutBtrId;
|
|
55
|
-
_this._mode = AcEdViewMode.SELECTION;
|
|
56
|
-
_this._axesGizmo = _this.createAxesGizmo();
|
|
57
|
-
_this._viewportViews = new Map();
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
Object.defineProperty(AcTrLayoutView.prototype, "layoutBtrId", {
|
|
61
|
-
/**
|
|
62
|
-
* Gets the block table record ID associated with this layout.
|
|
63
|
-
*
|
|
64
|
-
* @returns The layout's block table record ID
|
|
65
|
-
*/
|
|
66
|
-
get: function () {
|
|
67
|
-
return this._layoutBtrId;
|
|
68
|
-
},
|
|
69
|
-
enumerable: false,
|
|
70
|
-
configurable: true
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(AcTrLayoutView.prototype, "mode", {
|
|
73
|
-
/**
|
|
74
|
-
* The view mode of the current layout view.
|
|
75
|
-
* Controls how mouse interactions are interpreted (selection vs pan mode).
|
|
76
|
-
*/
|
|
77
|
-
get: function () {
|
|
78
|
-
return this._mode;
|
|
79
|
-
},
|
|
80
|
-
set: function (value) {
|
|
81
|
-
if (value == AcEdViewMode.SELECTION) {
|
|
82
|
-
this._cameraControls.mouseButtons = {
|
|
83
|
-
MIDDLE: THREE.MOUSE.PAN
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
else if (value == AcEdViewMode.PAN) {
|
|
87
|
-
this._cameraControls.mouseButtons = {
|
|
88
|
-
LEFT: THREE.MOUSE.PAN
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
this._cameraControls.update();
|
|
92
|
-
this._mode = value;
|
|
93
|
-
},
|
|
94
|
-
enumerable: false,
|
|
95
|
-
configurable: true
|
|
96
|
-
});
|
|
97
|
-
Object.defineProperty(AcTrLayoutView.prototype, "viewportCount", {
|
|
98
|
-
/**
|
|
99
|
-
* The number of viewports in this layout view.
|
|
100
|
-
* Paper space layouts can contain multiple viewports showing different views of model space.
|
|
101
|
-
*/
|
|
102
|
-
get: function () {
|
|
103
|
-
return this._viewportViews.size;
|
|
104
|
-
},
|
|
105
|
-
enumerable: false,
|
|
106
|
-
configurable: true
|
|
107
|
-
});
|
|
108
|
-
/**
|
|
109
|
-
* Add one viewport view instance to this layout view.
|
|
110
|
-
* Viewports are used in paper space layouts to show different views of the model.
|
|
111
|
-
*
|
|
112
|
-
* @param viewportView - Input one viewport instance to add
|
|
113
|
-
*/
|
|
114
|
-
AcTrLayoutView.prototype.addViewport = function (viewportView) {
|
|
115
|
-
this._viewportViews.set(viewportView.viewport.id, viewportView);
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Remove the specified viewport view by its id from this layout view.
|
|
119
|
-
*
|
|
120
|
-
* @param id - Input the id of one viewport instance to remove
|
|
121
|
-
*/
|
|
122
|
-
AcTrLayoutView.prototype.removeViewport = function (id) {
|
|
123
|
-
this._viewportViews.delete(id);
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* Resize this layout view.
|
|
127
|
-
* Updates the view dimensions and notifies all viewports of the size change.
|
|
128
|
-
*
|
|
129
|
-
* @param width - Input new width of the layout view in pixels
|
|
130
|
-
* @param height - Input new height of the layout view in pixels
|
|
131
|
-
*/
|
|
132
|
-
AcTrLayoutView.prototype.resize = function (width, height) {
|
|
133
|
-
this._height = height;
|
|
134
|
-
this._width = width;
|
|
135
|
-
this.updateCameraFrustum();
|
|
136
|
-
this._viewportViews.forEach(function (viewportView) {
|
|
137
|
-
viewportView.update();
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Renders the scene in this layout view.
|
|
142
|
-
* Performs the main rendering pass and then renders any viewports if present.
|
|
143
|
-
* Updates the axes gizmo to reflect the current camera orientation.
|
|
144
|
-
*
|
|
145
|
-
* @param scene - The scene containing the layout data to render
|
|
146
|
-
*/
|
|
147
|
-
AcTrLayoutView.prototype.render = function (scene) {
|
|
148
|
-
var _a;
|
|
149
|
-
this._renderer.clear();
|
|
150
|
-
this._renderer.render(scene.internalScene, this._camera);
|
|
151
|
-
var modelSpaceLayout = scene.modelSpaceLayout;
|
|
152
|
-
if (modelSpaceLayout) {
|
|
153
|
-
this.drawViewports(modelSpaceLayout.internalObject);
|
|
154
|
-
}
|
|
155
|
-
(_a = this._axesGizmo) === null || _a === void 0 ? void 0 : _a.update();
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* Creates and configures the axes gizmo for this view.
|
|
159
|
-
* The gizmo shows the current coordinate system orientation and is positioned
|
|
160
|
-
* at the bottom-left of the view without a Z-axis (2D view).
|
|
161
|
-
*
|
|
162
|
-
* @returns The configured axes gizmo instance
|
|
163
|
-
*/
|
|
164
|
-
AcTrLayoutView.prototype.createAxesGizmo = function () {
|
|
165
|
-
var axesGizmo = new AxesGizmo(this._camera.internalCamera, this._renderer.internalRenderer, {
|
|
166
|
-
hasZAxis: false,
|
|
167
|
-
pos: ObjectPosition.LEFT_BOTTOM
|
|
168
|
-
});
|
|
169
|
-
return axesGizmo;
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Draw viewports into the current rendering context.
|
|
173
|
-
* Handles the complex rendering process for paper space layouts that contain
|
|
174
|
-
* multiple viewports, each with their own view of model space.
|
|
175
|
-
*
|
|
176
|
-
* @param scene - Input the scene object to draw in each viewport
|
|
177
|
-
*/
|
|
178
|
-
AcTrLayoutView.prototype.drawViewports = function (scene) {
|
|
179
|
-
if (this._viewportViews.size > 0) {
|
|
180
|
-
// Store autoClear flag value
|
|
181
|
-
var autoClear = this._renderer.autoClear;
|
|
182
|
-
this._renderer.autoClear = false;
|
|
183
|
-
var oldViewport = new THREE.Vector4();
|
|
184
|
-
this._renderer.getViewport(oldViewport);
|
|
185
|
-
this._renderer.clearDepth();
|
|
186
|
-
var visibility = scene.visible;
|
|
187
|
-
scene.visible = true;
|
|
188
|
-
this._viewportViews.forEach(function (viewportView) {
|
|
189
|
-
viewportView.render(scene);
|
|
190
|
-
});
|
|
191
|
-
scene.visible = visibility;
|
|
192
|
-
this._renderer.setViewport(oldViewport.x, oldViewport.y, oldViewport.z, oldViewport.w);
|
|
193
|
-
// Restore autoClear flag vlaue
|
|
194
|
-
this._renderer.autoClear = autoClear;
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
return AcTrLayoutView;
|
|
198
|
-
}(AcTrBaseView));
|
|
199
|
-
export { AcTrLayoutView };
|
|
200
|
-
//# sourceMappingURL=AcTrLayoutView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcTrLay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Y,GA+K/C"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { AcTrLayoutView } from './AcTrLayoutView';
|
|
2
|
-
import { AcTrScene } from './AcTrScene';
|
|
3
|
-
/**
|
|
4
|
-
* Manages multiple layout views and coordinates active layout switching.
|
|
5
|
-
*
|
|
6
|
-
* This class serves as a central coordinator for all layout views in the CAD viewer.
|
|
7
|
-
* It handles:
|
|
8
|
-
* - Managing a collection of layout views indexed by their block table record IDs
|
|
9
|
-
* - Tracking and switching the active layout
|
|
10
|
-
* - Coordinating rendering operations across layout views
|
|
11
|
-
* - Managing view lifecycle (resize, enable/disable)
|
|
12
|
-
*
|
|
13
|
-
* The layout view manager ensures that only one layout is active at a time while
|
|
14
|
-
* maintaining the state of all layouts for quick switching. It provides a unified
|
|
15
|
-
* interface for layout operations regardless of which specific layout is active.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const manager = new AcTrLayoutViewManager();
|
|
20
|
-
* manager.add(layoutView);
|
|
21
|
-
* manager.activeLayoutBtrId = 'layout1';
|
|
22
|
-
* manager.render(scene);
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare class AcTrLayoutViewManager {
|
|
26
|
-
/** The block table record ID of the currently active layout */
|
|
27
|
-
private _activeLayoutBtrId;
|
|
28
|
-
/** Map of layout views indexed by their block table record IDs */
|
|
29
|
-
private _layoutViews;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new layout view manager instance.
|
|
32
|
-
* Initializes with no active layout and an empty collection of views.
|
|
33
|
-
*/
|
|
34
|
-
constructor();
|
|
35
|
-
/**
|
|
36
|
-
* The block table record id associated with the active layout.
|
|
37
|
-
* Setting this property switches the active layout and enables/disables
|
|
38
|
-
* the appropriate layout views.
|
|
39
|
-
*/
|
|
40
|
-
get activeLayoutBtrId(): string;
|
|
41
|
-
set activeLayoutBtrId(value: string);
|
|
42
|
-
/**
|
|
43
|
-
* The active layout view.
|
|
44
|
-
* Returns the layout view corresponding to the currently active layout,
|
|
45
|
-
* or undefined if no layout is active or the active layout doesn't exist.
|
|
46
|
-
*/
|
|
47
|
-
get activeLayoutView(): AcTrLayoutView | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Return true if the layout view manager contains one layout view associated with the specified block
|
|
50
|
-
* table record id. Otherwise it returns false.
|
|
51
|
-
*
|
|
52
|
-
* @param layoutBtrId - Input the block table record id associated with the layout view
|
|
53
|
-
* @returns Return true if the layout view manager contains one layout view associated with the specified
|
|
54
|
-
* block table record id. Otherwise it returns false.
|
|
55
|
-
*/
|
|
56
|
-
has(layoutBtrId: string): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Get the layout view by the block table record id associated with the layout.
|
|
59
|
-
*
|
|
60
|
-
* @param layoutBtrId - Input the id of the block table record associated the layout
|
|
61
|
-
* @returns Return the layout view by the block table record id associated with the layout,
|
|
62
|
-
* or undefined if not found
|
|
63
|
-
*/
|
|
64
|
-
getAt(layoutBtrId: string): AcTrLayoutView | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Resize all of layout views managed by layout view manager.
|
|
67
|
-
* This is typically called when the viewport or container size changes
|
|
68
|
-
* and all layouts need to update their dimensions.
|
|
69
|
-
*
|
|
70
|
-
* @param width - Input new width of the layout view in pixels
|
|
71
|
-
* @param height - Input new height of the layout view in pixels
|
|
72
|
-
*/
|
|
73
|
-
resize(width: number, height: number): void;
|
|
74
|
-
/**
|
|
75
|
-
* Adds a layout view to the manager.
|
|
76
|
-
* The layout view is indexed by its block table record ID for fast lookup.
|
|
77
|
-
*
|
|
78
|
-
* @param layoutView - The layout view to add to the manager
|
|
79
|
-
*/
|
|
80
|
-
add(layoutView: AcTrLayoutView): void;
|
|
81
|
-
/**
|
|
82
|
-
* Render the specified scene in the current layout view.
|
|
83
|
-
* Only renders the currently active layout view, if one is set.
|
|
84
|
-
*
|
|
85
|
-
* @param scene - Input the scene to render
|
|
86
|
-
*/
|
|
87
|
-
render(scene: AcTrScene): void;
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=AcTrLayoutViewManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcTrLayoutViewManager.d.ts","sourceRoot":"","sources":["../../src/view/AcTrLayoutViewManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,qBAAqB;IAChC,+DAA+D;IAC/D,OAAO,CAAC,kBAAkB,CAAQ;IAClC,kEAAkE;IAClE,OAAO,CAAC,YAAY,CAA6B;IAEjD;;;OAGG;;IAMH;;;;OAIG;IACH,IAAI,iBAAiB,IAGQ,MAAM,CADlC;IACD,IAAI,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAKlC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,+BAEnB;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM;IAIvB;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,EAAE,MAAM;IAIzB;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMpC;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,cAAc;IAI9B;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS;CAGxB"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manages multiple layout views and coordinates active layout switching.
|
|
3
|
-
*
|
|
4
|
-
* This class serves as a central coordinator for all layout views in the CAD viewer.
|
|
5
|
-
* It handles:
|
|
6
|
-
* - Managing a collection of layout views indexed by their block table record IDs
|
|
7
|
-
* - Tracking and switching the active layout
|
|
8
|
-
* - Coordinating rendering operations across layout views
|
|
9
|
-
* - Managing view lifecycle (resize, enable/disable)
|
|
10
|
-
*
|
|
11
|
-
* The layout view manager ensures that only one layout is active at a time while
|
|
12
|
-
* maintaining the state of all layouts for quick switching. It provides a unified
|
|
13
|
-
* interface for layout operations regardless of which specific layout is active.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const manager = new AcTrLayoutViewManager();
|
|
18
|
-
* manager.add(layoutView);
|
|
19
|
-
* manager.activeLayoutBtrId = 'layout1';
|
|
20
|
-
* manager.render(scene);
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
var AcTrLayoutViewManager = /** @class */ (function () {
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new layout view manager instance.
|
|
26
|
-
* Initializes with no active layout and an empty collection of views.
|
|
27
|
-
*/
|
|
28
|
-
function AcTrLayoutViewManager() {
|
|
29
|
-
this._activeLayoutBtrId = '';
|
|
30
|
-
this._layoutViews = new Map();
|
|
31
|
-
}
|
|
32
|
-
Object.defineProperty(AcTrLayoutViewManager.prototype, "activeLayoutBtrId", {
|
|
33
|
-
/**
|
|
34
|
-
* The block table record id associated with the active layout.
|
|
35
|
-
* Setting this property switches the active layout and enables/disables
|
|
36
|
-
* the appropriate layout views.
|
|
37
|
-
*/
|
|
38
|
-
get: function () {
|
|
39
|
-
return this._activeLayoutBtrId;
|
|
40
|
-
},
|
|
41
|
-
set: function (value) {
|
|
42
|
-
this._activeLayoutBtrId = value;
|
|
43
|
-
this._layoutViews.forEach(function (layoutView) {
|
|
44
|
-
layoutView.enabled = layoutView.layoutBtrId == value;
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
enumerable: false,
|
|
48
|
-
configurable: true
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(AcTrLayoutViewManager.prototype, "activeLayoutView", {
|
|
51
|
-
/**
|
|
52
|
-
* The active layout view.
|
|
53
|
-
* Returns the layout view corresponding to the currently active layout,
|
|
54
|
-
* or undefined if no layout is active or the active layout doesn't exist.
|
|
55
|
-
*/
|
|
56
|
-
get: function () {
|
|
57
|
-
return this._layoutViews.get(this._activeLayoutBtrId);
|
|
58
|
-
},
|
|
59
|
-
enumerable: false,
|
|
60
|
-
configurable: true
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Return true if the layout view manager contains one layout view associated with the specified block
|
|
64
|
-
* table record id. Otherwise it returns false.
|
|
65
|
-
*
|
|
66
|
-
* @param layoutBtrId - Input the block table record id associated with the layout view
|
|
67
|
-
* @returns Return true if the layout view manager contains one layout view associated with the specified
|
|
68
|
-
* block table record id. Otherwise it returns false.
|
|
69
|
-
*/
|
|
70
|
-
AcTrLayoutViewManager.prototype.has = function (layoutBtrId) {
|
|
71
|
-
return this._layoutViews.has(layoutBtrId);
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Get the layout view by the block table record id associated with the layout.
|
|
75
|
-
*
|
|
76
|
-
* @param layoutBtrId - Input the id of the block table record associated the layout
|
|
77
|
-
* @returns Return the layout view by the block table record id associated with the layout,
|
|
78
|
-
* or undefined if not found
|
|
79
|
-
*/
|
|
80
|
-
AcTrLayoutViewManager.prototype.getAt = function (layoutBtrId) {
|
|
81
|
-
return this._layoutViews.get(layoutBtrId);
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Resize all of layout views managed by layout view manager.
|
|
85
|
-
* This is typically called when the viewport or container size changes
|
|
86
|
-
* and all layouts need to update their dimensions.
|
|
87
|
-
*
|
|
88
|
-
* @param width - Input new width of the layout view in pixels
|
|
89
|
-
* @param height - Input new height of the layout view in pixels
|
|
90
|
-
*/
|
|
91
|
-
AcTrLayoutViewManager.prototype.resize = function (width, height) {
|
|
92
|
-
this._layoutViews.forEach(function (layoutView) {
|
|
93
|
-
layoutView.resize(width, height);
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Adds a layout view to the manager.
|
|
98
|
-
* The layout view is indexed by its block table record ID for fast lookup.
|
|
99
|
-
*
|
|
100
|
-
* @param layoutView - The layout view to add to the manager
|
|
101
|
-
*/
|
|
102
|
-
AcTrLayoutViewManager.prototype.add = function (layoutView) {
|
|
103
|
-
this._layoutViews.set(layoutView.layoutBtrId, layoutView);
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Render the specified scene in the current layout view.
|
|
107
|
-
* Only renders the currently active layout view, if one is set.
|
|
108
|
-
*
|
|
109
|
-
* @param scene - Input the scene to render
|
|
110
|
-
*/
|
|
111
|
-
AcTrLayoutViewManager.prototype.render = function (scene) {
|
|
112
|
-
var _a;
|
|
113
|
-
(_a = this.activeLayoutView) === null || _a === void 0 ? void 0 : _a.render(scene);
|
|
114
|
-
};
|
|
115
|
-
return AcTrLayoutViewManager;
|
|
116
|
-
}());
|
|
117
|
-
export { AcTrLayoutViewManager };
|
|
118
|
-
//# sourceMappingURL=AcTrLayoutViewManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcTrLayoutViewManager.js","sourceRoot":"","sources":["../../src/view/AcTrLayoutViewManager.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAME;;;OAGG;IACH;QACE,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAA;QAC5B,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAA;IAC/B,CAAC;IAOD,sBAAI,oDAAiB;QALrB;;;;WAIG;aACH;YACE,OAAO,IAAI,CAAC,kBAAkB,CAAA;QAChC,CAAC;aACD,UAAsB,KAAa;YACjC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAA;YAC/B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAA,UAAU;gBAClC,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,WAAW,IAAI,KAAK,CAAA;YACtD,CAAC,CAAC,CAAA;QACJ,CAAC;;;OANA;IAaD,sBAAI,mDAAgB;QALpB;;;;WAIG;aACH;YACE,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;QACvD,CAAC;;;OAAA;IAED;;;;;;;OAOG;IACH,mCAAG,GAAH,UAAI,WAAmB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAC3C,CAAC;IAED;;;;;;OAMG;IACH,qCAAK,GAAL,UAAM,WAAmB;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAC3C,CAAC;IAED;;;;;;;OAOG;IACH,sCAAM,GAAN,UAAO,KAAa,EAAE,MAAc;QAClC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAA,UAAU;YAClC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,mCAAG,GAAH,UAAI,UAA0B;QAC5B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IAC3D,CAAC;IAED;;;;;OAKG;IACH,sCAAM,GAAN,UAAO,KAAgB;;QACrB,MAAA,IAAI,CAAC,gBAAgB,0CAAE,MAAM,CAAC,KAAK,CAAC,CAAA;IACtC,CAAC;IACH,4BAAC;AAAD,CAAC,AA/FD,IA+FC"}
|
package/lib/view/AcTrScene.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { AcDbObjectId, AcGeBox2d, AcGeBox3d } from '@mlightcad/data-model';
|
|
2
|
-
import { AcTrEntity, AcTrObject } from '@mlightcad/three-renderer';
|
|
3
|
-
import { AcEdLayerInfo } from 'editor';
|
|
4
|
-
import * as THREE from 'three';
|
|
5
|
-
import { AcTrLayout, AcTrLayoutStats } from './AcTrLayout';
|
|
6
|
-
/**
|
|
7
|
-
* Three.js scene manager for CAD drawings with hierarchical organization.
|
|
8
|
-
*
|
|
9
|
-
* The scene manages the complete visual representation of a CAD drawing using
|
|
10
|
-
* a hierarchical structure that mirrors CAD data organization:
|
|
11
|
-
*
|
|
12
|
-
* ```
|
|
13
|
-
* Scene
|
|
14
|
-
* └── Layout (AcTrLayout) - Paper space or model space
|
|
15
|
-
* └── Layer (AcTrLayer) - Drawing layers for organization
|
|
16
|
-
* └── Entity (AcTrEntity) - Individual CAD entities (lines, arcs, etc.)
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* ## Key Responsibilities
|
|
20
|
-
* - **Layout Management**: Handles multiple layouts (model space and paper spaces)
|
|
21
|
-
* - **Layer Organization**: Manages layer visibility and entity grouping
|
|
22
|
-
* - **Entity Rendering**: Provides access to all renderable CAD entities
|
|
23
|
-
* - **Spatial Queries**: Calculates bounding boxes and spatial relationships
|
|
24
|
-
* - **Three.js Integration**: Maintains the underlying Three.js scene
|
|
25
|
-
*
|
|
26
|
-
* The scene automatically manages the active layout and provides efficient
|
|
27
|
-
* access to entities for rendering, selection, and spatial operations.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const scene = new AcTrScene();
|
|
32
|
-
*
|
|
33
|
-
* // Set up model space
|
|
34
|
-
* scene.modelSpaceBtrId = modelSpaceId;
|
|
35
|
-
*
|
|
36
|
-
* // Add entities to layers
|
|
37
|
-
* const entity = new AcTrLine(...);
|
|
38
|
-
* scene.addEntity(entity, layerName);
|
|
39
|
-
*
|
|
40
|
-
* // Get all visible entities for rendering
|
|
41
|
-
* const entities = scene.getAllEntities();
|
|
42
|
-
*
|
|
43
|
-
* // Get scene bounds for zoom operations
|
|
44
|
-
* const bounds = scene.box;
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export declare class AcTrScene {
|
|
48
|
-
/** The underlying Three.js scene object */
|
|
49
|
-
private _scene;
|
|
50
|
-
/** Map of layout ID to layout object */
|
|
51
|
-
private _layers;
|
|
52
|
-
/** Map of layout ID to layout object */
|
|
53
|
-
private _layouts;
|
|
54
|
-
/** ID of the currently active layout */
|
|
55
|
-
private _activeLayoutBtrId;
|
|
56
|
-
/** ID of the model space layout */
|
|
57
|
-
private _modelSpaceBtrId;
|
|
58
|
-
/**
|
|
59
|
-
* Creates a new CAD scene instance.
|
|
60
|
-
*
|
|
61
|
-
* Initializes the Three.js scene and layout management structures.
|
|
62
|
-
*/
|
|
63
|
-
constructor();
|
|
64
|
-
/**
|
|
65
|
-
* The layers in this scene
|
|
66
|
-
*/
|
|
67
|
-
get layers(): Map<string, AcEdLayerInfo>;
|
|
68
|
-
/**
|
|
69
|
-
* The layouts in this scene
|
|
70
|
-
*/
|
|
71
|
-
get layouts(): Map<string, AcTrLayout>;
|
|
72
|
-
/**
|
|
73
|
-
* The bounding box of the visibile objects in this secene
|
|
74
|
-
*/
|
|
75
|
-
get box(): THREE.Box3 | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* The scene object of THREE.js. This is internally used only. Try to avoid using it.
|
|
78
|
-
*/
|
|
79
|
-
get internalScene(): THREE.Scene;
|
|
80
|
-
/**
|
|
81
|
-
* The block table record id of the model space
|
|
82
|
-
*/
|
|
83
|
-
get modelSpaceBtrId(): AcDbObjectId;
|
|
84
|
-
set modelSpaceBtrId(value: AcDbObjectId);
|
|
85
|
-
/**
|
|
86
|
-
* The block table record id associated with the current active layout
|
|
87
|
-
*/
|
|
88
|
-
get activeLayoutBtrId(): string;
|
|
89
|
-
set activeLayoutBtrId(value: string);
|
|
90
|
-
/**
|
|
91
|
-
* Get active layout
|
|
92
|
-
*/
|
|
93
|
-
get activeLayout(): AcTrLayout | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Get the layout of the model space
|
|
96
|
-
*/
|
|
97
|
-
get modelSpaceLayout(): AcTrLayout | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* The statistics of this scene
|
|
100
|
-
*/
|
|
101
|
-
get stats(): {
|
|
102
|
-
layouts: AcTrLayoutStats[];
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Add one empty layout with the specified block table record id as the its key
|
|
106
|
-
* @param ownerId Input the block table record id associated with this layout
|
|
107
|
-
* @returns Return the newly created empty layout
|
|
108
|
-
*/
|
|
109
|
-
addEmptyLayout(ownerId: AcDbObjectId): AcTrLayout;
|
|
110
|
-
/**
|
|
111
|
-
* Clear scene
|
|
112
|
-
* @returns Return this scene
|
|
113
|
-
*/
|
|
114
|
-
clear(): this;
|
|
115
|
-
/**
|
|
116
|
-
* Hover the specified entities
|
|
117
|
-
*/
|
|
118
|
-
hover(ids: AcDbObjectId[]): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Unhover the specified entities
|
|
121
|
-
*/
|
|
122
|
-
unhover(ids: AcDbObjectId[]): boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Select the specified entities
|
|
125
|
-
*/
|
|
126
|
-
select(ids: AcDbObjectId[]): boolean;
|
|
127
|
-
/**
|
|
128
|
-
* Unselect the specified entities
|
|
129
|
-
*/
|
|
130
|
-
unselect(ids: AcDbObjectId[]): boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Search entities intersected or contained in the specified bounding box.
|
|
133
|
-
* @param box Input the query bounding box
|
|
134
|
-
* @returns Return query results
|
|
135
|
-
*/
|
|
136
|
-
search(box: AcGeBox2d | AcGeBox3d): import("editor").AcEdSpatialQueryResultItem[];
|
|
137
|
-
addLayer(layer: AcEdLayerInfo): void;
|
|
138
|
-
updateLayer(layer: AcEdLayerInfo): void;
|
|
139
|
-
/**
|
|
140
|
-
* Add one AutoCAD entity into this scene. If the layout associated with this entity doesn't exist,
|
|
141
|
-
* then create one layout, add this layout into this scene, and add the entity into the layout.
|
|
142
|
-
* @param entity Input AutoCAD entity to be added into scene.
|
|
143
|
-
* @param extendBbox Input the flag whether to extend the bounding box of this scene by union the bounding box
|
|
144
|
-
* of the specified entity.
|
|
145
|
-
* @returns Return this scene
|
|
146
|
-
*/
|
|
147
|
-
addEntity(entity: AcTrEntity, extendBbox?: boolean): this;
|
|
148
|
-
/**
|
|
149
|
-
* Remove the specified entity from this scene.
|
|
150
|
-
* @param objectId Input the object id of the entity to remove
|
|
151
|
-
* @returns Return true if remove the specified entity successfully. Otherwise, return false.
|
|
152
|
-
*/
|
|
153
|
-
remove(objectId: AcDbObjectId): boolean;
|
|
154
|
-
/**
|
|
155
|
-
* Update the specified entity in this scene.
|
|
156
|
-
* @param objectId Input the entity to update
|
|
157
|
-
* @returns Return true if update the specified entity successfully. Otherwise, return false.
|
|
158
|
-
*/
|
|
159
|
-
update(entity: AcTrEntity): boolean;
|
|
160
|
-
setSnapObject(object: AcTrObject): this;
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=AcTrScene.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcTrScene.d.ts","sourceRoot":"","sources":["../../src/view/AcTrScene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,SAAS;IACpB,2CAA2C;IAC3C,OAAO,CAAC,MAAM,CAAa;IAC3B,wCAAwC;IACxC,OAAO,CAAC,OAAO,CAA4B;IAC3C,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAA+B;IAC/C,wCAAwC;IACxC,OAAO,CAAC,kBAAkB,CAAc;IACxC,mCAAmC;IACnC,OAAO,CAAC,gBAAgB,CAAc;IAEtC;;;;OAIG;;IASH;;OAEG;IACH,IAAI,MAAM,+BAET;IAED;;OAEG;IACH,IAAI,OAAO,4BAEV;IAED;;OAEG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