@anov/3d-ability 0.0.125 → 0.0.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/business/Area/Fence/FenceBase.d.ts +35 -0
- package/dist/business/Area/Fence/fence_base_01.d.ts +11 -0
- package/dist/business/Area/Fence/fence_feeting_01.d.ts +11 -0
- package/dist/business/Area/Fence/fence_roll_01.d.ts +11 -0
- package/dist/business/Area/FillArea/FillAreaBase.d.ts +32 -0
- package/dist/business/Area/FillArea/fillArea_face_01.d.ts +11 -0
- package/dist/business/Area/FillArea/fillArea_line_01.d.ts +10 -0
- package/dist/business/Base/ObjectLayer.d.ts +1 -0
- package/dist/business/Base/ObjectLayer.js +8 -4
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Box/index.d.ts +13 -0
- package/dist/business/Box/index.js +97 -0
- package/dist/business/Box/index.js.map +1 -0
- package/dist/business/Box/interface.d.ts +10 -0
- package/dist/business/Box/interface.js +2 -0
- package/dist/business/Box/interface.js.map +1 -0
- package/dist/business/Box/types.d.ts +10 -0
- package/dist/business/Box/types.js +2 -0
- package/dist/business/Box/types.js.map +1 -0
- package/dist/business/Cylinder/index.d.ts +13 -0
- package/dist/business/Cylinder/index.js +95 -0
- package/dist/business/Cylinder/index.js.map +1 -0
- package/dist/business/Cylinder/interface.d.ts +10 -0
- package/dist/business/Cylinder/interface.js +2 -0
- package/dist/business/Cylinder/interface.js.map +1 -0
- package/dist/business/Cylinder/types.d.ts +9 -0
- package/dist/business/Cylinder/types.js +2 -0
- package/dist/business/Cylinder/types.js.map +1 -0
- package/dist/business/InfoPanel/index.d.ts +42 -0
- package/dist/business/InfoPanel/index.js +288 -0
- package/dist/business/InfoPanel/index.js.map +1 -0
- package/dist/business/InfoPanel/type.d.ts +52 -0
- package/dist/business/InfoPanel/type.js +2 -0
- package/dist/business/InfoPanel/type.js.map +1 -0
- package/dist/business/Line/index.d.ts +13 -0
- package/dist/business/Line/index.js +110 -0
- package/dist/business/Line/index.js.map +1 -0
- package/dist/business/Line/interface.d.ts +9 -0
- package/dist/business/Line/interface.js +2 -0
- package/dist/business/Line/interface.js.map +1 -0
- package/dist/business/Line/types.d.ts +6 -0
- package/dist/business/Line/types.js +2 -0
- package/dist/business/Line/types.js.map +1 -0
- package/dist/business/Plane/index.d.ts +13 -0
- package/dist/business/Plane/index.js +96 -0
- package/dist/business/Plane/index.js.map +1 -0
- package/dist/business/Plane/interface.d.ts +19 -0
- package/dist/business/Plane/interface.js +2 -0
- package/dist/business/Plane/interface.js.map +1 -0
- package/dist/business/Plane/types.d.ts +8 -0
- package/dist/business/Plane/types.js +2 -0
- package/dist/business/Plane/types.js.map +1 -0
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/title/index.d.ts +1 -1
- package/dist/business/Sphere/index.d.ts +13 -0
- package/dist/business/Sphere/index.js +89 -0
- package/dist/business/Sphere/index.js.map +1 -0
- package/dist/business/Sphere/interface.d.ts +10 -0
- package/dist/business/Sphere/interface.js +2 -0
- package/dist/business/Sphere/interface.js.map +1 -0
- package/dist/business/Sphere/types.d.ts +6 -0
- package/dist/business/Sphere/types.js +2 -0
- package/dist/business/Sphere/types.js.map +1 -0
- package/dist/business/VideoPanel/index.d.ts +59 -0
- package/dist/business/VideoPanel/index.js +364 -0
- package/dist/business/VideoPanel/index.js.map +1 -0
- package/dist/business/VideoPanel/type.d.ts +62 -0
- package/dist/business/VideoPanel/type.js +2 -0
- package/dist/business/VideoPanel/type.js.map +1 -0
- package/dist/business/index.d.ts +7 -0
- package/dist/business/index.js +7 -0
- package/dist/business/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.d.ts +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +5 -6
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
var _excluded = ["value"],
|
|
2
|
+
_excluded2 = ["value"];
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
25
|
+
/**
|
|
26
|
+
* @file index.ts
|
|
27
|
+
* @description 信息面板
|
|
28
|
+
* @author xingwei
|
|
29
|
+
* @createTime 2025-08-22
|
|
30
|
+
* @lastEditTime 2025-08-22
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import ObjectLayer from "../Base/ObjectLayer";
|
|
34
|
+
import _ from 'lodash';
|
|
35
|
+
import { Group, Vector3, createLabel } from '@anov/3d-core';
|
|
36
|
+
var DEFAULT_OPTION = {
|
|
37
|
+
position: [0, 0, 0],
|
|
38
|
+
type: 'info',
|
|
39
|
+
title: {
|
|
40
|
+
value: '面板标题',
|
|
41
|
+
fontSize: '20px'
|
|
42
|
+
},
|
|
43
|
+
content: {
|
|
44
|
+
value: '面板内容',
|
|
45
|
+
fontSize: '16px'
|
|
46
|
+
},
|
|
47
|
+
width: 300,
|
|
48
|
+
height: 200,
|
|
49
|
+
bgColor: '#fff',
|
|
50
|
+
borderRadius: 8,
|
|
51
|
+
closable: true,
|
|
52
|
+
padding: '10px'
|
|
53
|
+
};
|
|
54
|
+
var InfoPanel = /*#__PURE__*/function (_ObjectLayer) {
|
|
55
|
+
_inherits(InfoPanel, _ObjectLayer);
|
|
56
|
+
var _super = _createSuper(InfoPanel);
|
|
57
|
+
function InfoPanel(option) {
|
|
58
|
+
var _this;
|
|
59
|
+
_classCallCheck(this, InfoPanel);
|
|
60
|
+
_this = _super.call(this);
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "_title", void 0);
|
|
62
|
+
_defineProperty(_assertThisInitialized(_this), "_content", void 0);
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "_width", void 0);
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "_height", void 0);
|
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "_bgColor", void 0);
|
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "_position", void 0);
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "_type", void 0);
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "_borderRadius", 10);
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "_bgUrl", void 0);
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "_className", void 0);
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "_customStyle", void 0);
|
|
72
|
+
_defineProperty(_assertThisInitialized(_this), "_closeable", void 0);
|
|
73
|
+
_defineProperty(_assertThisInitialized(_this), "_padding", void 0);
|
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "_group", void 0);
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "_onClose", void 0);
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "visible", false);
|
|
77
|
+
var params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
|
|
78
|
+
var _title = params.title,
|
|
79
|
+
_content = params.content,
|
|
80
|
+
_width = params.width,
|
|
81
|
+
_height = params.height,
|
|
82
|
+
_bgColor = params.bgColor,
|
|
83
|
+
_position = params.position,
|
|
84
|
+
_type = params.type,
|
|
85
|
+
_bgUrl = params.bgUrl,
|
|
86
|
+
_className = params.className,
|
|
87
|
+
_customStyle = params.customStyle,
|
|
88
|
+
_borderRadius = params.borderRadius,
|
|
89
|
+
_padding = params.padding,
|
|
90
|
+
_closeable = params.closable,
|
|
91
|
+
_onClose = params.onClose;
|
|
92
|
+
Object.assign(_assertThisInitialized(_this), {
|
|
93
|
+
_title: _title,
|
|
94
|
+
_content: _content,
|
|
95
|
+
_width: _width,
|
|
96
|
+
_height: _height,
|
|
97
|
+
_bgColor: _bgColor,
|
|
98
|
+
_position: _position,
|
|
99
|
+
_type: _type,
|
|
100
|
+
_bgUrl: _bgUrl,
|
|
101
|
+
_className: _className,
|
|
102
|
+
_customStyle: _customStyle,
|
|
103
|
+
_borderRadius: _borderRadius,
|
|
104
|
+
_padding: _padding,
|
|
105
|
+
_closeable: _closeable,
|
|
106
|
+
_onClose: _onClose
|
|
107
|
+
});
|
|
108
|
+
_this._group = new Group();
|
|
109
|
+
_this._group.visible = _this.visible;
|
|
110
|
+
_this.init();
|
|
111
|
+
return _this;
|
|
112
|
+
}
|
|
113
|
+
_createClass(InfoPanel, [{
|
|
114
|
+
key: "init",
|
|
115
|
+
value: function init() {
|
|
116
|
+
this.createBox();
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "createBox",
|
|
120
|
+
value: function createBox() {
|
|
121
|
+
// 使用 DocumentFragment 减少重排
|
|
122
|
+
// const fragment = document.createDocumentFragment();
|
|
123
|
+
var bgDom = this.createBgDom(); //创建容器盒子
|
|
124
|
+
var headerDom = this.createHeaderDom(); //创建头部盒子
|
|
125
|
+
|
|
126
|
+
// 创建内容
|
|
127
|
+
var contentDom = document.createElement('div');
|
|
128
|
+
contentDom.className = 'panel-content';
|
|
129
|
+
if (typeof this._content.value === 'string') {
|
|
130
|
+
contentDom.textContent = this._content.value;
|
|
131
|
+
} else if (this._content.value instanceof HTMLElement) {
|
|
132
|
+
contentDom.appendChild(this._content.value);
|
|
133
|
+
}
|
|
134
|
+
var _this$_content = this._content,
|
|
135
|
+
value = _this$_content.value,
|
|
136
|
+
contentStyle = _objectWithoutProperties(_this$_content, _excluded);
|
|
137
|
+
// 正确设置样式的方式
|
|
138
|
+
Object.assign(contentDom.style, contentStyle); //待测试
|
|
139
|
+
|
|
140
|
+
bgDom.appendChild(headerDom);
|
|
141
|
+
bgDom.appendChild(contentDom);
|
|
142
|
+
var bgObject = createLabel(bgDom);
|
|
143
|
+
bgObject.position.set(0, 0, 0);
|
|
144
|
+
bgObject.center.set(0, 0);
|
|
145
|
+
this._group.add(bgObject);
|
|
146
|
+
this.add(this._group);
|
|
147
|
+
this.applyPosition(); // 初始化自动定位
|
|
148
|
+
}
|
|
149
|
+
/** 创建背景 */
|
|
150
|
+
}, {
|
|
151
|
+
key: "createBgDom",
|
|
152
|
+
value: function createBgDom() {
|
|
153
|
+
//创建容器盒子
|
|
154
|
+
var bgDom = document.createElement('div');
|
|
155
|
+
Object.assign(bgDom.style, {
|
|
156
|
+
width: "".concat(this._width, "px"),
|
|
157
|
+
height: "".concat(this._height, "px"),
|
|
158
|
+
// left: `${this._position[0]}px`,
|
|
159
|
+
// top: `${this._position[1]}px`,
|
|
160
|
+
overflow: 'hidden',
|
|
161
|
+
padding: this._padding,
|
|
162
|
+
borderRadius: this._bgUrl ? '' : "".concat(this._borderRadius, "px"),
|
|
163
|
+
backgroundColor: this._bgUrl ? '' : this._bgColor,
|
|
164
|
+
backgroundImage: this._bgUrl ? "url(".concat(this._bgUrl, ")") : '',
|
|
165
|
+
backgroundSize: this._bgUrl ? 'contain' : '',
|
|
166
|
+
backgroundRepeat: this._bgUrl ? 'no-repeat' : '',
|
|
167
|
+
boxSizing: 'border-box'
|
|
168
|
+
});
|
|
169
|
+
if (this._className) bgDom.className = this._className;
|
|
170
|
+
if (this._customStyle) Object.assign(bgDom.style, this._customStyle);
|
|
171
|
+
return bgDom;
|
|
172
|
+
}
|
|
173
|
+
/** 创建头部 */
|
|
174
|
+
}, {
|
|
175
|
+
key: "createHeaderDom",
|
|
176
|
+
value: function createHeaderDom() {
|
|
177
|
+
var _this2 = this;
|
|
178
|
+
var headerDom = document.createElement('div');
|
|
179
|
+
headerDom.className = 'panel-header';
|
|
180
|
+
headerDom.style.display = 'flex';
|
|
181
|
+
headerDom.style.alignItems = 'center';
|
|
182
|
+
// 创建标题
|
|
183
|
+
var titleDom = document.createElement('p');
|
|
184
|
+
titleDom.className = 'panel-title';
|
|
185
|
+
titleDom.style.display = 'flex';
|
|
186
|
+
titleDom.style.flex = '1';
|
|
187
|
+
titleDom.textContent = this._title.value;
|
|
188
|
+
var _this$_title = this._title,
|
|
189
|
+
titleValue = _this$_title.value,
|
|
190
|
+
titleStyle = _objectWithoutProperties(_this$_title, _excluded2);
|
|
191
|
+
// 正确设置样式的方式
|
|
192
|
+
Object.assign(titleDom.style, titleStyle); //待测试
|
|
193
|
+
|
|
194
|
+
headerDom.appendChild(titleDom);
|
|
195
|
+
|
|
196
|
+
// 创建关闭按钮
|
|
197
|
+
if (this._closeable) {
|
|
198
|
+
var closeDom = document.createElement('div');
|
|
199
|
+
closeDom.className = 'panel-close';
|
|
200
|
+
closeDom.style.cursor = 'pointer';
|
|
201
|
+
closeDom.style.fontSize = this._title.fontSize;
|
|
202
|
+
closeDom.style.color = this._title.color;
|
|
203
|
+
closeDom.textContent = 'x';
|
|
204
|
+
closeDom.style.pointerEvents = 'auto';
|
|
205
|
+
closeDom.onclick = function () {
|
|
206
|
+
_this2.close();
|
|
207
|
+
};
|
|
208
|
+
headerDom.appendChild(closeDom);
|
|
209
|
+
}
|
|
210
|
+
return headerDom;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** 自动定位面板 */
|
|
214
|
+
}, {
|
|
215
|
+
key: "applyPosition",
|
|
216
|
+
value: function applyPosition() {
|
|
217
|
+
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Vector3(0, 0, 0);
|
|
218
|
+
if (Array.isArray(this._position)) {
|
|
219
|
+
// 如果是数组 [x, y]
|
|
220
|
+
var _this$_position = _slicedToArray(this._position, 3),
|
|
221
|
+
x = _this$_position[0],
|
|
222
|
+
y = _this$_position[1],
|
|
223
|
+
z = _this$_position[2];
|
|
224
|
+
this._group.position.set(x, y, z); // 注意y轴取反
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}, {
|
|
228
|
+
key: "open",
|
|
229
|
+
value: function open() {
|
|
230
|
+
this.visible = true;
|
|
231
|
+
this._group.visible = true;
|
|
232
|
+
|
|
233
|
+
// 同步 DOM 节点显示
|
|
234
|
+
// this._group.children.forEach((child: any) => {
|
|
235
|
+
// if (child.element) {
|
|
236
|
+
// child.element.style.display = 'block';
|
|
237
|
+
// }
|
|
238
|
+
// });
|
|
239
|
+
}
|
|
240
|
+
}, {
|
|
241
|
+
key: "close",
|
|
242
|
+
value: function close() {
|
|
243
|
+
this.visible = false;
|
|
244
|
+
this._group.visible = false;
|
|
245
|
+
|
|
246
|
+
// 同步 DOM 节点隐藏
|
|
247
|
+
// this._group.children.forEach((child: any) => {
|
|
248
|
+
// if (child.element) {
|
|
249
|
+
// child.element.style.display = 'none';
|
|
250
|
+
// }
|
|
251
|
+
// });
|
|
252
|
+
if (this._onClose) {
|
|
253
|
+
this._onClose();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}, {
|
|
257
|
+
key: "update",
|
|
258
|
+
value: function update(option) {
|
|
259
|
+
var merged = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);
|
|
260
|
+
this._title = merged.title;
|
|
261
|
+
this._content = merged.content;
|
|
262
|
+
this._width = merged.width;
|
|
263
|
+
this._height = merged.height;
|
|
264
|
+
this._bgColor = merged.bgColor;
|
|
265
|
+
this._borderRadius = merged.borderRadius || 0;
|
|
266
|
+
this._bgUrl = merged.bgUrl;
|
|
267
|
+
this._className = merged.className;
|
|
268
|
+
this._customStyle = merged.style;
|
|
269
|
+
this._group.clear();
|
|
270
|
+
this.init();
|
|
271
|
+
}
|
|
272
|
+
}, {
|
|
273
|
+
key: "destroy",
|
|
274
|
+
value: function destroy() {
|
|
275
|
+
this._group.clear();
|
|
276
|
+
this.remove(this._group);
|
|
277
|
+
// 清理DOM引用
|
|
278
|
+
this._group.children.forEach(function (child) {
|
|
279
|
+
if (child.element && child.element.parentNode) {
|
|
280
|
+
child.element.parentNode.removeChild(child.element);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}]);
|
|
285
|
+
return InfoPanel;
|
|
286
|
+
}(ObjectLayer);
|
|
287
|
+
export { InfoPanel };
|
|
288
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ObjectLayer","_","Group","Vector3","createLabel","DEFAULT_OPTION","position","type","title","value","fontSize","content","width","height","bgColor","borderRadius","closable","padding","InfoPanel","_ObjectLayer","_inherits","_super","_createSuper","option","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","params","mergeWith","cloneDeep","_title","_content","_width","_height","_bgColor","_position","_type","_bgUrl","bgUrl","_className","className","_customStyle","customStyle","_borderRadius","_padding","_closeable","_onClose","onClose","Object","assign","_group","visible","init","_createClass","key","createBox","bgDom","createBgDom","headerDom","createHeaderDom","contentDom","document","createElement","textContent","HTMLElement","appendChild","_this$_content","contentStyle","_objectWithoutProperties","_excluded","style","bgObject","set","center","add","applyPosition","concat","overflow","backgroundColor","backgroundImage","backgroundSize","backgroundRepeat","boxSizing","_this2","display","alignItems","titleDom","flex","_this$_title","titleValue","titleStyle","_excluded2","closeDom","cursor","color","pointerEvents","onclick","close","offset","arguments","length","undefined","Array","isArray","_this$_position","_slicedToArray","x","y","z","open","update","merged","clear","destroy","remove","children","forEach","child","element","parentNode","removeChild"],"sources":["../../../src/business/InfoPanel/index.ts"],"sourcesContent":["/**\n * @file index.ts\n * @description 信息面板\n * @author xingwei\n * @createTime 2025-08-22\n * @lastEditTime 2025-08-22\n */\n\n\nimport ObjectLayer from \"../Base/ObjectLayer\";\nimport _ from 'lodash'\nimport { Group, Vector3, createLabel, CSS2DRenderer, Mesh, SphereGeometry, MeshBasicMaterial } from '@anov/3d-core'\nimport type {Option, TitleOption, ContentOption, PanelType, PanelPosition} from './type'\nimport { IPanel } from './type'\n\nconst DEFAULT_OPTION = {\n position: [0, 0, 0],\n type: 'info',\n title: {\n value: '面板标题',\n fontSize: '20px',\n },\n content: {\n value: '面板内容',\n fontSize: '16px',\n },\n width: 300,\n height: 200,\n bgColor: '#fff',\n borderRadius: 8,\n closable: true,\n padding: '10px'\n}\n\nclass InfoPanel extends ObjectLayer implements IPanel{\n private _title: TitleOption\n private _content: ContentOption\n private _width: number\n private _height: number\n private _bgColor: string\n private _position: Array<number>\n private _type: PanelType\n private _borderRadius: number = 10\n private _bgUrl: string\n private _className: string\n private _customStyle: any\n private _closeable: boolean\n private _padding: string \n private _group: Group\n private _onClose: Function\n visible: boolean = false;\n\n constructor(option: Option) {\n super();\n const params = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option)\n const {\n title: _title,\n content: _content,\n width: _width,\n height: _height,\n bgColor: _bgColor,\n position: _position,\n type: _type,\n bgUrl: _bgUrl,\n className: _className,\n customStyle: _customStyle,\n borderRadius: _borderRadius,\n padding: _padding,\n closable: _closeable,\n onClose: _onClose\n } = params;\n\n Object.assign(this, {\n _title, _content, _width, _height, _bgColor, _position, _type,\n _bgUrl, _className, _customStyle, _borderRadius, _padding,_closeable, _onClose\n });\n \n this._group = new Group()\n this._group.visible = this.visible\n this.init()\n }\n private init(){\n this.createBox()\n \n }\n\n\n private createBox(){\n\n // 使用 DocumentFragment 减少重排\n // const fragment = document.createDocumentFragment();\n const bgDom = this.createBgDom() //创建容器盒子\n const headerDom = this.createHeaderDom() //创建头部盒子\n\n\n // 创建内容\n const contentDom = document.createElement('div')\n contentDom.className = 'panel-content'\n if(typeof this._content.value === 'string'){\n contentDom.textContent = this._content.value\n }else if(this._content.value instanceof HTMLElement){\n contentDom.appendChild(this._content.value)\n }\n \n const {value, ...contentStyle} = this._content\n // 正确设置样式的方式\n Object.assign(contentDom.style, contentStyle) //待测试\n\n bgDom.appendChild(headerDom)\n bgDom.appendChild(contentDom)\n\n\n const bgObject = createLabel(bgDom);\n bgObject.position.set(0, 0, 0);\n bgObject.center.set(0, 0);\n\n this._group.add(bgObject);\n\n this.add(this._group)\n this.applyPosition(); // 初始化自动定位\n }\n /** 创建背景 */\n private createBgDom(){\n //创建容器盒子\n const bgDom = document.createElement('div');\n Object.assign(bgDom.style, {\n width: `${this._width}px`,\n height: `${this._height}px`,\n // left: `${this._position[0]}px`,\n // top: `${this._position[1]}px`,\n overflow: 'hidden',\n padding: this._padding,\n borderRadius: this._bgUrl ? '' : `${this._borderRadius}px`,\n backgroundColor: this._bgUrl ? '' : this._bgColor,\n backgroundImage: this._bgUrl ? `url(${this._bgUrl})` : '',\n backgroundSize: this._bgUrl ? 'contain' : '',\n backgroundRepeat: this._bgUrl ? 'no-repeat' : '',\n boxSizing: 'border-box'\n \n });\n if (this._className) bgDom.className = this._className;\n if (this._customStyle) Object.assign(bgDom.style, this._customStyle);\n return bgDom;\n }\n /** 创建头部 */\n private createHeaderDom(){\n const headerDom = document.createElement('div')\n headerDom.className = 'panel-header'\n headerDom.style.display = 'flex'\n headerDom.style.alignItems = 'center'\n // 创建标题\n const titleDom = document.createElement('p')\n titleDom.className = 'panel-title'\n titleDom.style.display = 'flex'\n titleDom.style.flex = '1'\n titleDom.textContent = this._title.value\n const {value: titleValue, ...titleStyle} = this._title\n // 正确设置样式的方式\n Object.assign(titleDom.style, titleStyle) //待测试\n\n headerDom.appendChild(titleDom)\n\n // 创建关闭按钮\n if(this._closeable){\n const closeDom = document.createElement('div')\n closeDom.className = 'panel-close'\n closeDom.style.cursor = 'pointer'\n closeDom.style.fontSize = this._title.fontSize\n closeDom.style.color = this._title.color\n closeDom.textContent = 'x'\n closeDom.style.pointerEvents = 'auto'\n closeDom.onclick = () => {\n this.close()\n }\n headerDom.appendChild(closeDom)\n }\n return headerDom\n }\n\n /** 自动定位面板 */\n private applyPosition(offset: Vector3 = new Vector3(0, 0, 0)) {\n if (Array.isArray(this._position)) {\n // 如果是数组 [x, y]\n const [x, y, z] = this._position;\n this._group.position.set(x, y, z); // 注意y轴取反\n }\n }\n\n public open(){\n this.visible = true\n this._group.visible = true;\n\n // 同步 DOM 节点显示\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'block';\n // }\n // });\n }\n public close(){\n this.visible = false\n this._group.visible = false;\n\n // 同步 DOM 节点隐藏\n // this._group.children.forEach((child: any) => {\n // if (child.element) {\n // child.element.style.display = 'none';\n // }\n // });\n if(this._onClose){\n this._onClose()\n }\n }\n public update(option: Option){\n const merged = _.mergeWith(_.cloneDeep(DEFAULT_OPTION), option);\n this._title = merged.title;\n this._content = merged.content;\n this._width = merged.width;\n this._height = merged.height;\n this._bgColor = merged.bgColor;\n this._borderRadius = merged.borderRadius || 0;\n this._bgUrl = merged.bgUrl;\n this._className = merged.className;\n this._customStyle = merged.style;\n\n this._group.clear();\n this.init();\n }\n destroy(): void {\n this._group.clear();\n this.remove(this._group)\n // 清理DOM引用\n this._group.children.forEach((child: any) => {\n if (child.element && child.element.parentNode) {\n child.element.parentNode.removeChild(child.element);\n }\n });\n }\n}\n\nexport {InfoPanel}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA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D,SAAA0G,QAAA,EAAgB;MACZ,IAAI,CAAC/D,MAAM,CAAC8D,KAAK,CAAC,CAAC;MACnB,IAAI,CAACE,MAAM,CAAC,IAAI,CAAChE,MAAM,CAAC;MACxB;MACA,IAAI,CAACA,MAAM,CAACiE,QAAQ,CAACC,OAAO,CAAC,UAACC,KAAU,EAAK;QACzC,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,UAAU,EAAE;UAC3CF,KAAK,CAACC,OAAO,CAACC,UAAU,CAACC,WAAW,CAACH,KAAK,CAACC,OAAO,CAAC;QACvD;MACJ,CAAC,CAAC;IACN;EAAC;EAAA,OAAAtG,SAAA;AAAA,EA3MmBlB,WAAW;AA8MnC,SAAQkB,SAAS"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface IPanel {
|
|
2
|
+
/** 打开面板 */
|
|
3
|
+
open: () => void;
|
|
4
|
+
/** 关闭面板 */
|
|
5
|
+
close: () => void;
|
|
6
|
+
/** 更新面板 */
|
|
7
|
+
update: (option: Option) => void;
|
|
8
|
+
/** 销毁面板 */
|
|
9
|
+
destroy: () => void;
|
|
10
|
+
}
|
|
11
|
+
export type Option = Partial<{
|
|
12
|
+
position: Array<number>;
|
|
13
|
+
type: PanelType;
|
|
14
|
+
title: TitleOption;
|
|
15
|
+
content: ContentOption;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
bgColor: string;
|
|
19
|
+
bgUrl: string;
|
|
20
|
+
borderRadius: number;
|
|
21
|
+
padding: string;
|
|
22
|
+
closeable: boolean;
|
|
23
|
+
className: string;
|
|
24
|
+
customStyle: object;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
}>;
|
|
27
|
+
export type PanelPosition = 'left' | 'right' | 'top' | 'bottom' | 'center';
|
|
28
|
+
export type PanelType = 'info' | 'warning' | 'error' | 'success';
|
|
29
|
+
export type TitleOption = Partial<{
|
|
30
|
+
value: string;
|
|
31
|
+
fontSize: string;
|
|
32
|
+
color: string;
|
|
33
|
+
fontFamily: string;
|
|
34
|
+
fontWeight: number;
|
|
35
|
+
lineHeight: number | string;
|
|
36
|
+
textAlign: string;
|
|
37
|
+
padding: string;
|
|
38
|
+
margin: string;
|
|
39
|
+
icon: string;
|
|
40
|
+
}>;
|
|
41
|
+
export type ContentOption = Partial<{
|
|
42
|
+
value: string | HTMLElement;
|
|
43
|
+
fontSize: string;
|
|
44
|
+
color: string;
|
|
45
|
+
fontFamily: string;
|
|
46
|
+
fontWeight: number;
|
|
47
|
+
lineHeight: string;
|
|
48
|
+
textAlign: string;
|
|
49
|
+
padding: string;
|
|
50
|
+
margin: string;
|
|
51
|
+
textIndent: string;
|
|
52
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/business/InfoPanel/type.ts"],"sourcesContent":["\nexport interface IPanel {\n /** 打开面板 */\n open: () => void;\n /** 关闭面板 */\n close: () => void;\n /** 更新面板 */\n update: (option: Option) => void;\n /** 销毁面板 */\n destroy: () => void;\n}\n\n// 面板配置项\nexport type Option = Partial<{\n position: Array<number>; // 位置\n type: PanelType; // 类型\n title: TitleOption; // 标题\n content: ContentOption; // 内容\n width: number; // 宽度\n height: number; // 高度\n bgColor: string; // 背景颜色\n bgUrl: string; // 背景图片\n borderRadius: number; // 圆角\n padding: string; // 内边距\n closeable: boolean; // 是否显示关闭按钮\n className: string; // 自定义类名\n customStyle: object; // 自定义样式\n onClose: () => void; // 关闭回调\n}>\n\n// 面板位置\nexport type PanelPosition = 'left' | 'right' | 'top' | 'bottom' | 'center';\n\n// 面板类型\nexport type PanelType = 'info' | 'warning' | 'error' | 'success';\n\n// 标题\nexport type TitleOption = Partial<{\n value: string;\n fontSize: string;\n color: string;\n fontFamily: string;\n fontWeight: number;\n lineHeight: number | string;\n textAlign: string;\n padding: string;\n margin: string;\n icon: string;\n}>\n\n// 内容\nexport type ContentOption = Partial<{\n value: string | HTMLElement;\n fontSize: string;\n color: string;\n fontFamily: string;\n fontWeight: number;\n lineHeight: string;\n textAlign: string;\n padding: string;\n margin: string;\n textIndent: string;\n}>\n\n"],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ObjectLayer from '../Base/ObjectLayer';
|
|
2
|
+
import type { options } from './types';
|
|
3
|
+
import { ILine } from './interface';
|
|
4
|
+
import type { Line as TLine } from '@anov/3d-core';
|
|
5
|
+
export declare class Line extends ObjectLayer implements ILine {
|
|
6
|
+
private line;
|
|
7
|
+
constructor(options: options);
|
|
8
|
+
createLine(options: options): TLine;
|
|
9
|
+
/** 更新线条 */
|
|
10
|
+
updateLine(options: options): void;
|
|
11
|
+
/** 销毁释放资源 */
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
14
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
/*
|
|
25
|
+
* @Descripttion:
|
|
26
|
+
* @version:
|
|
27
|
+
* @Author: 周志国
|
|
28
|
+
* @Date: 2025-09-08 16:09:35
|
|
29
|
+
* @LastEditors: 周志国
|
|
30
|
+
* @LastEditTime: 2025-09-08 17:02:11
|
|
31
|
+
* @changeLog:
|
|
32
|
+
* @FilePath: /anov-3d-webgl/packages/anov-3d-ability/src/business/Line/index.ts
|
|
33
|
+
*/
|
|
34
|
+
import ObjectLayer from "../Base/ObjectLayer";
|
|
35
|
+
import { Vector3, BufferGeometry, LineDashedMaterial, LineBasicMaterial, Line as ThreeLine } from '@anov/3d-core';
|
|
36
|
+
export var Line = /*#__PURE__*/function (_ObjectLayer) {
|
|
37
|
+
_inherits(Line, _ObjectLayer);
|
|
38
|
+
var _super = _createSuper(Line);
|
|
39
|
+
function Line(options) {
|
|
40
|
+
var _this;
|
|
41
|
+
_classCallCheck(this, Line);
|
|
42
|
+
_this = _super.call(this);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "line", void 0);
|
|
44
|
+
_this.line = _this.createLine(options);
|
|
45
|
+
_this.add(_this.line); // 挂载到 ObjectLayer 中
|
|
46
|
+
return _this;
|
|
47
|
+
}
|
|
48
|
+
_createClass(Line, [{
|
|
49
|
+
key: "createLine",
|
|
50
|
+
value: function createLine(options) {
|
|
51
|
+
var points = options.points,
|
|
52
|
+
_options$dashed = options.dashed,
|
|
53
|
+
dashed = _options$dashed === void 0 ? false : _options$dashed,
|
|
54
|
+
_options$material = options.material,
|
|
55
|
+
material = _options$material === void 0 ? {} : _options$material;
|
|
56
|
+
var vecPoints = points.map(function (p) {
|
|
57
|
+
return Array.isArray(p) ? _construct(Vector3, _toConsumableArray(p)) : p;
|
|
58
|
+
});
|
|
59
|
+
var geometry = new BufferGeometry().setFromPoints(vecPoints);
|
|
60
|
+
// 默认参数
|
|
61
|
+
var defaultBasic = {
|
|
62
|
+
color: 0xffffff,
|
|
63
|
+
linewidth: 1,
|
|
64
|
+
linecap: 'round',
|
|
65
|
+
linejoin: 'round',
|
|
66
|
+
opacity: 1,
|
|
67
|
+
transparent: false,
|
|
68
|
+
visible: true,
|
|
69
|
+
depthTest: true,
|
|
70
|
+
depthWrite: true
|
|
71
|
+
};
|
|
72
|
+
var defaultDashed = _objectSpread(_objectSpread({}, defaultBasic), {}, {
|
|
73
|
+
scale: 1,
|
|
74
|
+
dashSize: 3,
|
|
75
|
+
gapSize: 1
|
|
76
|
+
});
|
|
77
|
+
var mat = dashed ? new LineDashedMaterial(_objectSpread(_objectSpread({}, defaultDashed), material)) : new LineBasicMaterial(_objectSpread(_objectSpread({}, defaultBasic), material));
|
|
78
|
+
var line = new ThreeLine(geometry, mat);
|
|
79
|
+
if (dashed) line.computeLineDistances();
|
|
80
|
+
return line;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** 更新线条 */
|
|
84
|
+
}, {
|
|
85
|
+
key: "updateLine",
|
|
86
|
+
value: function updateLine(options) {
|
|
87
|
+
if (this.line) {
|
|
88
|
+
this.remove(this.line);
|
|
89
|
+
this.line.geometry.dispose();
|
|
90
|
+
this.line.material.dispose();
|
|
91
|
+
}
|
|
92
|
+
this.line = this.createLine(options);
|
|
93
|
+
this.add(this.line);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** 销毁释放资源 */
|
|
97
|
+
}, {
|
|
98
|
+
key: "destroy",
|
|
99
|
+
value: function destroy() {
|
|
100
|
+
if (!this.line) return;
|
|
101
|
+
this.remove(this.line);
|
|
102
|
+
this.line.geometry.dispose();
|
|
103
|
+
this.line.material.dispose();
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
this.line = null;
|
|
106
|
+
}
|
|
107
|
+
}]);
|
|
108
|
+
return Line;
|
|
109
|
+
}(ObjectLayer);
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ObjectLayer","Vector3","BufferGeometry","LineDashedMaterial","LineBasicMaterial","Line","ThreeLine","_ObjectLayer","_inherits","_super","_createSuper","options","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","line","createLine","add","_createClass","key","value","points","_options$dashed","dashed","_options$material","material","vecPoints","map","p","Array","isArray","_construct","_toConsumableArray","geometry","setFromPoints","defaultBasic","color","linewidth","linecap","linejoin","opacity","transparent","visible","depthTest","depthWrite","defaultDashed","_objectSpread","scale","dashSize","gapSize","mat","computeLineDistances","updateLine","remove","dispose","destroy"],"sources":["../../../src/business/Line/index.ts"],"sourcesContent":["/*\n * @Descripttion: \n * @version: \n * @Author: 周志国\n * @Date: 2025-09-08 16:09:35\n * @LastEditors: 周志国\n * @LastEditTime: 2025-09-08 17:02:11\n * @changeLog: \n * @FilePath: /anov-3d-webgl/packages/anov-3d-ability/src/business/Line/index.ts\n */\nimport ObjectLayer from '../Base/ObjectLayer'\nimport type { options } from './types'\nimport { ILine } from './interface'\nimport type { Line as TLine } from '@anov/3d-core'\nimport {\n Vector3,\n BufferGeometry,\n LineDashedMaterial,\n LineDashedMaterialParameters,\n LineBasicMaterial,\n LineBasicMaterialParameters,\n Line as ThreeLine\n} from '@anov/3d-core'\n\nexport class Line extends ObjectLayer implements ILine {\n private line: TLine\n\n constructor(options: options) {\n super()\n this.line = this.createLine(options)\n this.add(this.line) // 挂载到 ObjectLayer 中\n }\n\n public createLine(options: options): TLine {\n const { points, dashed = false, material = {} } = options\n const vecPoints = points.map(p =>\n Array.isArray(p) ? new Vector3(...p) : p\n )\n const geometry = new BufferGeometry().setFromPoints(vecPoints)\n // 默认参数\n const defaultBasic: LineBasicMaterialParameters = {\n color: 0xffffff,\n linewidth: 1,\n linecap: 'round',\n linejoin: 'round',\n opacity: 1,\n transparent: false,\n visible: true,\n depthTest: true,\n depthWrite: true\n }\n\n const defaultDashed: LineDashedMaterialParameters = {\n ...defaultBasic,\n scale: 1,\n dashSize: 3,\n gapSize: 1\n }\n\n const mat = dashed\n ? new LineDashedMaterial({ ...defaultDashed, ...material })\n : new LineBasicMaterial({ ...defaultBasic, ...material })\n\n const line = new ThreeLine(geometry, mat)\n\n if (dashed) line.computeLineDistances()\n\n return line\n }\n\n /** 更新线条 */\n public updateLine(options: options) {\n if (this.line) {\n this.remove(this.line)\n this.line.geometry.dispose()\n ; (this.line.material as any).dispose()\n }\n this.line = this.createLine(options)\n this.add(this.line)\n }\n\n /** 销毁释放资源 */\n public destroy() {\n if (!this.line) return\n this.remove(this.line)\n this.line.geometry.dispose()\n ; (this.line.material as any).dispose()\n // @ts-ignore\n this.line = null\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,WAAW;AAIlB,SACEC,OAAO,EACPC,cAAc,EACdC,kBAAkB,EAElBC,iBAAiB,EAEjBC,IAAI,IAAIC,SAAS,QACZ,eAAe;AAEtB,WAAcD,IAAI,0BAAAE,YAAA;EAAAC,SAAA,CAAAH,IAAA,EAAAE,YAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAL,IAAA;EAGhB,SAAAA,KAAYM,OAAgB,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAR,IAAA;IAC5BO,KAAA,GAAAH,MAAA,CAAAK,IAAA;IAAOC,eAAA,CAAAC,sBAAA,CAAAJ,KAAA;IACPA,KAAA,CAAKK,IAAI,GAAGL,KAAA,CAAKM,UAAU,CAACP,OAAO,CAAC;IACpCC,KAAA,CAAKO,GAAG,CAACP,KAAA,CAAKK,IAAI,CAAC,EAAC;IAAA,OAAAL,KAAA;EACtB;EAACQ,YAAA,CAAAf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AAI,GAAG,IAAIX,SAAS,CAAC6B,QAAQ,EAAEiB,GAAG,CAAC;MAEzC,IAAI3B,MAAM,EAAER,IAAI,CAACoC,oBAAoB,CAAC,CAAC;MAEvC,OAAOpC,IAAI;IACb;;IAEA;EAAA;IAAAI,GAAA;IAAAC,KAAA,EACA,SAAAgC,WAAkB3C,OAAgB,EAAE;MAClC,IAAI,IAAI,CAACM,IAAI,EAAE;QACb,IAAI,CAACsC,MAAM,CAAC,IAAI,CAACtC,IAAI,CAAC;QACtB,IAAI,CAACA,IAAI,CAACkB,QAAQ,CAACqB,OAAO,CAAC,CAAC;QACvB,IAAI,CAACvC,IAAI,CAACU,QAAQ,CAAS6B,OAAO,CAAC,CAAC;MAC3C;MACA,IAAI,CAACvC,IAAI,GAAG,IAAI,CAACC,UAAU,CAACP,OAAO,CAAC;MACpC,IAAI,CAACQ,GAAG,CAAC,IAAI,CAACF,IAAI,CAAC;IACrB;;IAEA;EAAA;IAAAI,GAAA;IAAAC,KAAA,EACA,SAAAmC,QAAA,EAAiB;MACf,IAAI,CAAC,IAAI,CAACxC,IAAI,EAAE;MAChB,IAAI,CAACsC,MAAM,CAAC,IAAI,CAACtC,IAAI,CAAC;MACtB,IAAI,CAACA,IAAI,CAACkB,QAAQ,CAACqB,OAAO,CAAC,CAAC;MACvB,IAAI,CAACvC,IAAI,CAACU,QAAQ,CAAS6B,OAAO,CAAC,CAAC;MACzC;MACA,IAAI,CAACvC,IAAI,GAAG,IAAI;IAClB;EAAC;EAAA,OAAAZ,IAAA;AAAA,EAjEwBL,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/business/Line/interface.ts"],"sourcesContent":["/*\n * @Descripttion: \n * @version: \n * @Author: 周志国\n * @Date: 2025-09-08 16:17:44\n * @LastEditors: 周志国\n * @LastEditTime: 2025-09-09 09:44:32\n * @changeLog: \n * @FilePath: /anov-3d-webgl/packages/anov-3d-ability/src/business/Line/interface.ts\n */\nimport type { options } from './types'\nimport type { Line } from '@anov/3d-core'\n\nexport interface ILine {\n /**\n * 创建线\n * @param options - 参数配置\n */\n createLine: (options: options) => Line\n} "],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/business/Line/types.ts"],"sourcesContent":["/*\n * @Descripttion: \n * @version: \n * @Author: 周志国\n * @Date: 2025-09-08 16:09:24\n * @LastEditors: 周志国\n * @LastEditTime: 2025-09-08 16:15:04\n * @changeLog: \n * @FilePath: /anov-3d-webgl/packages/anov-3d-ability/src/business/Line/types.ts\n */\nimport type { LineBasicMaterialParameters, LineDashedMaterialParameters } from '@anov/3d-core'\nexport type options = {\n points: [number, number, number][];\n dashed?: boolean;\n material?: LineBasicMaterialParameters | LineDashedMaterialParameters;\n}"],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ObjectLayer from '../Base/ObjectLayer';
|
|
2
|
+
import type { options } from './types';
|
|
3
|
+
import { IPlane } from './interface';
|
|
4
|
+
import { Mesh } from '@anov/3d-core';
|
|
5
|
+
export declare class Plane extends ObjectLayer implements IPlane {
|
|
6
|
+
private mesh;
|
|
7
|
+
private currentOptions;
|
|
8
|
+
constructor(options: options);
|
|
9
|
+
createPlane(options: options): Mesh;
|
|
10
|
+
updatePlane(options: options): void;
|
|
11
|
+
/** 销毁释放资源 */
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|