deeptwins-engine-3d 0.1.69 → 0.1.71
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/assets/Build/DeepTwins/Image/fire.png +0 -0
- package/dist/assets/Build/DeepTwins/Image/fountain.png +0 -0
- package/dist/assets/Build/DeepTwins/Image/smoke.png +0 -0
- package/dist/esm/analyze/LineOfSightAnalysis.d.ts +44 -0
- package/dist/esm/analyze/LineOfSightAnalysis.js +326 -0
- package/dist/esm/analyze/TerrainExcavationAnalysis.d.ts +59 -0
- package/dist/esm/analyze/TerrainExcavationAnalysis.js +612 -0
- package/dist/esm/constant.d.ts +88 -0
- package/dist/esm/constant.js +132 -0
- package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.d.ts +3 -0
- package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +56 -21
- package/dist/esm/drawCommand/viewShed/config.d.ts +2 -2
- package/dist/esm/drawCommand/viewShed/config.js +2 -2
- package/dist/esm/drawer/index.d.ts +1 -1
- package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +24 -2
- package/dist/esm/map/Map.d.ts +1 -0
- package/dist/esm/map/Map.js +18 -0
- package/dist/esm/particle/BaseParticle.d.ts +61 -0
- package/dist/esm/particle/BaseParticle.js +196 -0
- package/dist/esm/particle/FireParticle.d.ts +8 -0
- package/dist/esm/particle/FireParticle.js +65 -0
- package/dist/esm/particle/FountainParticle.d.ts +10 -0
- package/dist/esm/particle/FountainParticle.js +80 -0
- package/dist/esm/particle/SmokeParticle.d.ts +8 -0
- package/dist/esm/particle/SmokeParticle.js +65 -0
- package/dist/esm/particle/common.d.ts +18 -0
- package/dist/esm/particle/common.js +23 -0
- package/dist/esm/particle/index.d.ts +5 -0
- package/dist/esm/particle/index.js +5 -0
- package/dist/esm/tileLayer/CustomRasterLayer.d.ts +188 -0
- package/dist/esm/tileLayer/CustomRasterLayer.js +776 -0
- package/dist/esm/visualization/DynamicWater.d.ts +39 -0
- package/dist/esm/visualization/DynamicWater.js +289 -0
- package/dist/esm/visualization/MigrationEffect.d.ts +36 -0
- package/dist/esm/visualization/MigrationEffect.js +397 -0
- package/dist/esm/visualization/RadarScan.d.ts +39 -0
- package/dist/esm/visualization/RadarScan.js +333 -0
- package/dist/umd/deeptwins-engine-3d.min.js +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
var _excluded = ["heading", "pitch", "scale"];
|
|
2
|
+
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); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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); }
|
|
6
|
+
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; }
|
|
7
|
+
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; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
18
|
+
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); }
|
|
19
|
+
import * as Cesium from 'deeptwins-cesium';
|
|
20
|
+
import { cloneDeep, merge } from 'lodash';
|
|
21
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
22
|
+
import { DEFAULT_RADAR_SCAN_STYLE } from "../constant";
|
|
23
|
+
import RectangularSensorPrimitive from "../drawCommand/viewShed/RectangularSensorPrimitive";
|
|
24
|
+
import * as utils from "../tool/utils";
|
|
25
|
+
var REBUILD_STYLE_KEYS = ['radius', 'xHalfAngle', 'yHalfAngle', 'heading', 'pitch', 'roll', 'speed', 'scanPlaneMode', 'color', 'lineColor', 'scanPlaneColor', 'slice', 'showLateralSurfaces', 'showDomeSurfaces', 'showDomeLines', 'showSectorLines', 'showSectorSegmentLines', 'showScanPlane', 'showThroughEllipsoid'];
|
|
26
|
+
|
|
27
|
+
// 立体雷达扫描
|
|
28
|
+
var RadarScan = /*#__PURE__*/function () {
|
|
29
|
+
function RadarScan() {
|
|
30
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
|
+
_classCallCheck(this, RadarScan);
|
|
32
|
+
_defineProperty(this, "_mapContext", void 0);
|
|
33
|
+
_defineProperty(this, "id", void 0);
|
|
34
|
+
_defineProperty(this, "position", void 0);
|
|
35
|
+
_defineProperty(this, "style", void 0);
|
|
36
|
+
_defineProperty(this, "primitive", null);
|
|
37
|
+
_defineProperty(this, "isDestroyed", false);
|
|
38
|
+
_defineProperty(this, "_isAdded", false);
|
|
39
|
+
var position = options.position,
|
|
40
|
+
_options$style = options.style,
|
|
41
|
+
style = _options$style === void 0 ? {} : _options$style;
|
|
42
|
+
this.id = uuidv4();
|
|
43
|
+
this.position = position;
|
|
44
|
+
this.style = merge(DEFAULT_RADAR_SCAN_STYLE(), cloneDeep(style || {}));
|
|
45
|
+
}
|
|
46
|
+
_createClass(RadarScan, [{
|
|
47
|
+
key: "getMap",
|
|
48
|
+
value: function getMap() {
|
|
49
|
+
var _this$_mapContext;
|
|
50
|
+
return (_this$_mapContext = this._mapContext) === null || _this$_mapContext === void 0 ? void 0 : _this$_mapContext.getMap();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 添加到地图
|
|
54
|
+
}, {
|
|
55
|
+
key: "addToMap",
|
|
56
|
+
value: function addToMap(map) {
|
|
57
|
+
if (!this._canOperate()) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (this._isAdded && this.getMap() === map) {
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
if (this._isAdded) {
|
|
64
|
+
this.remove();
|
|
65
|
+
}
|
|
66
|
+
this._mapContext = map._mapContext;
|
|
67
|
+
this._rebuildPrimitive();
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 移除雷达扫描
|
|
72
|
+
}, {
|
|
73
|
+
key: "remove",
|
|
74
|
+
value: function remove() {
|
|
75
|
+
if (this.isDestroyed || !this._isAdded) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
var map = this.getMap();
|
|
79
|
+
if (map && this.primitive) {
|
|
80
|
+
map.scene.primitives.remove(this.primitive);
|
|
81
|
+
}
|
|
82
|
+
this.primitive = null;
|
|
83
|
+
this._isAdded = false;
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// 显示隐藏
|
|
88
|
+
}, {
|
|
89
|
+
key: "show",
|
|
90
|
+
value: function show(isShow) {
|
|
91
|
+
if (!this._canOperate()) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.style.show = isShow;
|
|
95
|
+
if (this.primitive) {
|
|
96
|
+
this.primitive.show = isShow;
|
|
97
|
+
}
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// 更新雷达位置
|
|
102
|
+
}, {
|
|
103
|
+
key: "setPosition",
|
|
104
|
+
value: function setPosition(position) {
|
|
105
|
+
if (!this._canOperate()) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
this.position = position;
|
|
109
|
+
if (this._isAdded) {
|
|
110
|
+
this._rebuildPrimitive();
|
|
111
|
+
}
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 更新雷达样式
|
|
116
|
+
}, {
|
|
117
|
+
key: "setStyle",
|
|
118
|
+
value: function setStyle() {
|
|
119
|
+
var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
120
|
+
if (!this._canOperate()) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
var needRebuild = REBUILD_STYLE_KEYS.some(function (key) {
|
|
124
|
+
return Object.prototype.hasOwnProperty.call(style, key);
|
|
125
|
+
});
|
|
126
|
+
this.style = merge(this.style, cloneDeep(style || {}));
|
|
127
|
+
if (!this._isAdded) {
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
if (needRebuild) {
|
|
131
|
+
this._rebuildPrimitive();
|
|
132
|
+
} else {
|
|
133
|
+
this.show(this.style.show);
|
|
134
|
+
}
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// 飞行至雷达扫描范围
|
|
139
|
+
}, {
|
|
140
|
+
key: "flyTo",
|
|
141
|
+
value: function flyTo() {
|
|
142
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
143
|
+
if (!this._canOperate() || !this.getMap()) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
var center = this._getCenterCartesian();
|
|
147
|
+
if (!center) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
var boundingSphere = new Cesium.BoundingSphere(center, this._normalizePositiveNumber(this.style.radius, 5000));
|
|
151
|
+
var _ref = options || {},
|
|
152
|
+
_ref$heading = _ref.heading,
|
|
153
|
+
heading = _ref$heading === void 0 ? 0 : _ref$heading,
|
|
154
|
+
_ref$pitch = _ref.pitch,
|
|
155
|
+
pitch = _ref$pitch === void 0 ? -45 : _ref$pitch,
|
|
156
|
+
_ref$scale = _ref.scale,
|
|
157
|
+
scale = _ref$scale === void 0 ? 1.6 : _ref$scale,
|
|
158
|
+
currOptions = _objectWithoutProperties(_ref, _excluded);
|
|
159
|
+
boundingSphere.radius = boundingSphere.radius * scale;
|
|
160
|
+
var backOptions = _objectSpread({}, currOptions);
|
|
161
|
+
if (heading || pitch) {
|
|
162
|
+
backOptions.offset = new Cesium.HeadingPitchRange(utils.toRadians(heading), utils.toRadians(pitch), 0);
|
|
163
|
+
}
|
|
164
|
+
this.getMap().camera.flyToBoundingSphere(boundingSphere, backOptions);
|
|
165
|
+
return this;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// 销毁
|
|
169
|
+
}, {
|
|
170
|
+
key: "destroy",
|
|
171
|
+
value: function destroy() {
|
|
172
|
+
if (this.isDestroyed) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this.remove();
|
|
176
|
+
this.position = undefined;
|
|
177
|
+
this._mapContext = undefined;
|
|
178
|
+
this.isDestroyed = true;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// 是否能进行操作
|
|
182
|
+
}, {
|
|
183
|
+
key: "_canOperate",
|
|
184
|
+
value: function _canOperate() {
|
|
185
|
+
if (this.isDestroyed) {
|
|
186
|
+
utils.error('RadarScan实例已销毁');
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
}, {
|
|
192
|
+
key: "_rebuildPrimitive",
|
|
193
|
+
value: function _rebuildPrimitive() {
|
|
194
|
+
var map = this.getMap();
|
|
195
|
+
if (!map) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (this.primitive) {
|
|
199
|
+
map.scene.primitives.remove(this.primitive);
|
|
200
|
+
this.primitive = null;
|
|
201
|
+
}
|
|
202
|
+
var modelMatrix = this._createModelMatrix();
|
|
203
|
+
if (!modelMatrix) {
|
|
204
|
+
utils.error('RadarScan请传入有效position参数');
|
|
205
|
+
this._isAdded = false;
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this.primitive = map.scene.primitives.add(new RectangularSensorPrimitive({
|
|
209
|
+
show: this.style.show,
|
|
210
|
+
radius: this._normalizePositiveNumber(this.style.radius, 5000),
|
|
211
|
+
xHalfAngle: this._normalizeHalfAngle(this.style.xHalfAngle, 35),
|
|
212
|
+
yHalfAngle: this._normalizeHalfAngle(this.style.yHalfAngle, 25),
|
|
213
|
+
slice: this._normalizeSlice(this.style.slice),
|
|
214
|
+
modelMatrix: modelMatrix,
|
|
215
|
+
material: Cesium.Material.fromType(Cesium.Material.ColorType, {
|
|
216
|
+
color: utils.colorString(this.style.color)
|
|
217
|
+
}),
|
|
218
|
+
lineColor: utils.colorString(this.style.lineColor),
|
|
219
|
+
scanPlaneColor: utils.colorString(this.style.scanPlaneColor),
|
|
220
|
+
scanPlaneMode: this._normalizeScanPlaneMode(this.style.scanPlaneMode),
|
|
221
|
+
speed: this._normalizeNumber(this.style.speed, 6),
|
|
222
|
+
showLateralSurfaces: this.style.showLateralSurfaces !== false,
|
|
223
|
+
showDomeSurfaces: this.style.showDomeSurfaces !== false,
|
|
224
|
+
showDomeLines: this.style.showDomeLines !== false,
|
|
225
|
+
showSectorLines: this.style.showSectorLines !== false,
|
|
226
|
+
showSectorSegmentLines: this.style.showSectorSegmentLines !== false,
|
|
227
|
+
showScanPlane: this.style.showScanPlane !== false,
|
|
228
|
+
showThroughEllipsoid: this.style.showThroughEllipsoid === true
|
|
229
|
+
}));
|
|
230
|
+
this._isAdded = true;
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
key: "_createModelMatrix",
|
|
234
|
+
value: function _createModelMatrix() {
|
|
235
|
+
var map = this.getMap();
|
|
236
|
+
var center = this._getCenterCartesian();
|
|
237
|
+
if (!map || !center) {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
var camera = new Cesium.Camera(map.scene);
|
|
241
|
+
camera.position = Cesium.Cartesian3.clone(center);
|
|
242
|
+
camera.setView({
|
|
243
|
+
destination: center,
|
|
244
|
+
orientation: new Cesium.HeadingPitchRoll(utils.toRadians(this.style.heading || 0), utils.toRadians(this.style.pitch || 0), utils.toRadians(this.style.roll || 0))
|
|
245
|
+
});
|
|
246
|
+
var direction = Cesium.Cartesian3.clone(camera.directionWC);
|
|
247
|
+
var up = Cesium.Cartesian3.clone(camera.upWC);
|
|
248
|
+
var right = Cesium.Cartesian3.clone(camera.rightWC);
|
|
249
|
+
var rotation = new Cesium.Matrix3();
|
|
250
|
+
Cesium.Matrix3.setColumn(rotation, 0, right, rotation);
|
|
251
|
+
Cesium.Matrix3.setColumn(rotation, 1, up, rotation);
|
|
252
|
+
Cesium.Matrix3.setColumn(rotation, 2, direction, rotation);
|
|
253
|
+
return Cesium.Matrix4.fromRotationTranslation(rotation, center);
|
|
254
|
+
}
|
|
255
|
+
}, {
|
|
256
|
+
key: "_getCenterCartesian",
|
|
257
|
+
value: function _getCenterCartesian() {
|
|
258
|
+
var position = this._normalizePosition(this.position);
|
|
259
|
+
if (!position) {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
return utils.lngLatAltToCartesian3(position.lng, position.lat, position.alt);
|
|
263
|
+
}
|
|
264
|
+
}, {
|
|
265
|
+
key: "_normalizePosition",
|
|
266
|
+
value: function _normalizePosition(position) {
|
|
267
|
+
if (Array.isArray(position)) {
|
|
268
|
+
var _position = _slicedToArray(position, 3),
|
|
269
|
+
lng = _position[0],
|
|
270
|
+
lat = _position[1],
|
|
271
|
+
_position$ = _position[2],
|
|
272
|
+
alt = _position$ === void 0 ? 0 : _position$;
|
|
273
|
+
if (!Number.isFinite(lng) || !Number.isFinite(lat)) {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
lng: lng,
|
|
278
|
+
lat: lat,
|
|
279
|
+
alt: Number.isFinite(alt) ? alt : 0
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
if (position && _typeof(position) === 'object') {
|
|
283
|
+
var _lng = position.lng,
|
|
284
|
+
_lat = position.lat,
|
|
285
|
+
_position$alt = position.alt,
|
|
286
|
+
_alt = _position$alt === void 0 ? 0 : _position$alt;
|
|
287
|
+
if (!Number.isFinite(_lng) || !Number.isFinite(_lat)) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
lng: _lng,
|
|
292
|
+
lat: _lat,
|
|
293
|
+
alt: Number.isFinite(_alt) ? _alt : 0
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
}, {
|
|
299
|
+
key: "_normalizeScanPlaneMode",
|
|
300
|
+
value: function _normalizeScanPlaneMode(mode) {
|
|
301
|
+
return mode === 'V' ? 'V' : 'H';
|
|
302
|
+
}
|
|
303
|
+
}, {
|
|
304
|
+
key: "_normalizeSlice",
|
|
305
|
+
value: function _normalizeSlice(slice) {
|
|
306
|
+
var normalizedSlice = Math.floor(this._normalizeNumber(slice, 48));
|
|
307
|
+
return normalizedSlice < 8 ? 8 : normalizedSlice;
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "_normalizeHalfAngle",
|
|
311
|
+
value: function _normalizeHalfAngle(angle, fallback) {
|
|
312
|
+
var normalizedAngle = this._normalizeNumber(angle, fallback);
|
|
313
|
+
if (normalizedAngle <= 0) {
|
|
314
|
+
return fallback;
|
|
315
|
+
}
|
|
316
|
+
return normalizedAngle >= 180 ? 180 : normalizedAngle;
|
|
317
|
+
}
|
|
318
|
+
}, {
|
|
319
|
+
key: "_normalizePositiveNumber",
|
|
320
|
+
value: function _normalizePositiveNumber(value, fallback) {
|
|
321
|
+
var normalizedValue = this._normalizeNumber(value, fallback);
|
|
322
|
+
return normalizedValue > 0 ? normalizedValue : fallback;
|
|
323
|
+
}
|
|
324
|
+
}, {
|
|
325
|
+
key: "_normalizeNumber",
|
|
326
|
+
value: function _normalizeNumber(value, fallback) {
|
|
327
|
+
var normalizedValue = Number(value);
|
|
328
|
+
return Number.isFinite(normalizedValue) ? normalizedValue : fallback;
|
|
329
|
+
}
|
|
330
|
+
}]);
|
|
331
|
+
return RadarScan;
|
|
332
|
+
}();
|
|
333
|
+
export { RadarScan as default };
|