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.
Files changed (41) hide show
  1. package/dist/assets/Build/DeepTwins/Image/fire.png +0 -0
  2. package/dist/assets/Build/DeepTwins/Image/fountain.png +0 -0
  3. package/dist/assets/Build/DeepTwins/Image/smoke.png +0 -0
  4. package/dist/esm/analyze/LineOfSightAnalysis.d.ts +44 -0
  5. package/dist/esm/analyze/LineOfSightAnalysis.js +326 -0
  6. package/dist/esm/analyze/TerrainExcavationAnalysis.d.ts +59 -0
  7. package/dist/esm/analyze/TerrainExcavationAnalysis.js +612 -0
  8. package/dist/esm/constant.d.ts +88 -0
  9. package/dist/esm/constant.js +132 -0
  10. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.d.ts +3 -0
  11. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.js +56 -21
  12. package/dist/esm/drawCommand/viewShed/config.d.ts +2 -2
  13. package/dist/esm/drawCommand/viewShed/config.js +2 -2
  14. package/dist/esm/drawer/index.d.ts +1 -1
  15. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  16. package/dist/esm/index.d.ts +15 -0
  17. package/dist/esm/index.js +24 -2
  18. package/dist/esm/map/Map.d.ts +1 -0
  19. package/dist/esm/map/Map.js +18 -0
  20. package/dist/esm/particle/BaseParticle.d.ts +61 -0
  21. package/dist/esm/particle/BaseParticle.js +196 -0
  22. package/dist/esm/particle/FireParticle.d.ts +8 -0
  23. package/dist/esm/particle/FireParticle.js +65 -0
  24. package/dist/esm/particle/FountainParticle.d.ts +10 -0
  25. package/dist/esm/particle/FountainParticle.js +80 -0
  26. package/dist/esm/particle/SmokeParticle.d.ts +8 -0
  27. package/dist/esm/particle/SmokeParticle.js +65 -0
  28. package/dist/esm/particle/common.d.ts +18 -0
  29. package/dist/esm/particle/common.js +23 -0
  30. package/dist/esm/particle/index.d.ts +5 -0
  31. package/dist/esm/particle/index.js +5 -0
  32. package/dist/esm/tileLayer/CustomRasterLayer.d.ts +188 -0
  33. package/dist/esm/tileLayer/CustomRasterLayer.js +776 -0
  34. package/dist/esm/visualization/DynamicWater.d.ts +39 -0
  35. package/dist/esm/visualization/DynamicWater.js +289 -0
  36. package/dist/esm/visualization/MigrationEffect.d.ts +36 -0
  37. package/dist/esm/visualization/MigrationEffect.js +397 -0
  38. package/dist/esm/visualization/RadarScan.d.ts +39 -0
  39. package/dist/esm/visualization/RadarScan.js +333 -0
  40. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  41. package/package.json +4 -2
package/dist/esm/index.js CHANGED
@@ -7,8 +7,10 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  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); }
8
8
  //引入cesium基础库
9
9
  import * as Cesium from 'deeptwins-cesium';
10
+ import LineOfSightAnalysis from "./analyze/LineOfSightAnalysis";
10
11
  import SubmergenceAnalysis from "./analyze/SubmergenceAnalysis";
11
12
  import SunLightAnalysis from "./analyze/SunLightAnalysis";
13
+ import TerrainExcavationAnalysis from "./analyze/TerrainExcavationAnalysis";
12
14
  import ViewshedAnalysis from "./analyze/ViewshedAnalysis";
13
15
  import ModelRoamHistory from "./cameraControl/ModelRoamHistory";
14
16
  import ModelRoamRealTime from "./cameraControl/ModelRoamRealTime";
@@ -40,8 +42,10 @@ import PolylineTrailLinkMaterialProperty from "./material/entity/PolylineTrailLi
40
42
  import ImageGlowingMaterialAppearance from "./material/primitive/ImageGlowingMaterialAppearance";
41
43
  import ImageMaterialAppearance from "./material/primitive/ImageMaterialAppearance";
42
44
  import Measure from "./measure";
45
+ import { BaseParticle, FireParticle, FountainParticle, SmokeParticle } from "./particle";
43
46
  import PositionProperty from "./property/PositionProperty";
44
47
  import ArcGisLayer from "./tileLayer/ArcGisLayer";
48
+ import CustomRasterLayer from "./tileLayer/CustomRasterLayer";
45
49
  import MvtVectorLoad from "./tileLayer/MvtVectorLoad";
46
50
  import RasterLayer from "./tileLayer/RasterLayer";
47
51
  import WmsLayer from "./tileLayer/WmsLayer";
@@ -54,10 +58,13 @@ import { loadCss } from "./tool/utils";
54
58
  import ToolTip from "./toolTip";
55
59
  import VideoProject from "./videoFusion/VideoProject";
56
60
  import VideoTexture from "./videoFusion/VideoTexture";
61
+ import DynamicWater from "./visualization/DynamicWater";
57
62
  import Frustum from "./visualization/Frustum";
58
63
  import Heatmap2d from "./visualization/Heatmap2d";
59
64
  import Heatmap3d from "./visualization/Heatmap3d";
65
+ import MigrationEffect from "./visualization/MigrationEffect";
60
66
  import PointCluster from "./visualization/PointCluster";
67
+ import RadarScan from "./visualization/RadarScan";
61
68
  // drawCommand
62
69
  import { ViewShedAnalyserLayer, VolumeClouds } from "./drawCommand";
63
70
  window.Cesium = Cesium;
@@ -66,14 +73,15 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
66
73
  // 全局加载css
67
74
  loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
68
75
  // 打印版本信息
69
- console.log('DeepTwinsEngine3D Version:', "0.1.69");
76
+ console.log('DeepTwinsEngine3D Version:', "0.1.71");
70
77
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
71
78
  _classCallCheck(this, DeepTwinsEngine3D);
72
79
  });
73
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.69");
80
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.71");
74
81
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
75
82
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
76
83
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
84
+ _defineProperty(DeepTwinsEngine3D, "CustomRasterLayer", CustomRasterLayer);
77
85
  _defineProperty(DeepTwinsEngine3D, "WmsLayer", WmsLayer);
78
86
  _defineProperty(DeepTwinsEngine3D, "WmtsLayer", WmtsLayer);
79
87
  _defineProperty(DeepTwinsEngine3D, "ArcGisLayer", ArcGisLayer);
@@ -81,6 +89,10 @@ _defineProperty(DeepTwinsEngine3D, "BarrierLayer", BarrierLayer);
81
89
  _defineProperty(DeepTwinsEngine3D, "FactorLayer", FactorLayer);
82
90
  _defineProperty(DeepTwinsEngine3D, "DeepTwins", DeepTwins);
83
91
  _defineProperty(DeepTwinsEngine3D, "WeatherEffects", WeatherEffects);
92
+ _defineProperty(DeepTwinsEngine3D, "BaseParticle", BaseParticle);
93
+ _defineProperty(DeepTwinsEngine3D, "FireParticle", FireParticle);
94
+ _defineProperty(DeepTwinsEngine3D, "SmokeParticle", SmokeParticle);
95
+ _defineProperty(DeepTwinsEngine3D, "FountainParticle", FountainParticle);
84
96
  _defineProperty(DeepTwinsEngine3D, "Drawer", Drawer);
85
97
  _defineProperty(DeepTwinsEngine3D, "Measure", Measure);
86
98
  _defineProperty(DeepTwinsEngine3D, "Rotate", Rotate);
@@ -100,7 +112,10 @@ _defineProperty(DeepTwinsEngine3D, "ImageGlowingMaterialAppearance", ImageGlowin
100
112
  _defineProperty(DeepTwinsEngine3D, "VolumeCloud", VolumeCloud);
101
113
  _defineProperty(DeepTwinsEngine3D, "Heatmap2d", Heatmap2d);
102
114
  _defineProperty(DeepTwinsEngine3D, "Heatmap3d", Heatmap3d);
115
+ _defineProperty(DeepTwinsEngine3D, "DynamicWater", DynamicWater);
116
+ _defineProperty(DeepTwinsEngine3D, "MigrationEffect", MigrationEffect);
103
117
  _defineProperty(DeepTwinsEngine3D, "PointCluster", PointCluster);
118
+ _defineProperty(DeepTwinsEngine3D, "RadarScan", RadarScan);
104
119
  _defineProperty(DeepTwinsEngine3D, "PositionProperty", PositionProperty);
105
120
  _defineProperty(DeepTwinsEngine3D, "Frustum", Frustum);
106
121
  _defineProperty(DeepTwinsEngine3D, "GridDraw", GridDraw);
@@ -131,12 +146,19 @@ _defineProperty(DeepTwinsEngine3D, "NearFarScalar", Cesium.NearFarScalar);
131
146
  _defineProperty(DeepTwinsEngine3D, "DistanceDisplayCondition", Cesium.DistanceDisplayCondition);
132
147
  _defineProperty(DeepTwinsEngine3D, "BoundingRectangle", Cesium.BoundingRectangle);
133
148
  _defineProperty(DeepTwinsEngine3D, "SplitDirection", Cesium.SplitDirection);
149
+ _defineProperty(DeepTwinsEngine3D, "ParticleEmitter", Cesium.ParticleEmitter);
150
+ _defineProperty(DeepTwinsEngine3D, "ParticleBurst", Cesium.ParticleBurst);
151
+ _defineProperty(DeepTwinsEngine3D, "CircleEmitter", Cesium.CircleEmitter);
152
+ _defineProperty(DeepTwinsEngine3D, "ConeEmitter", Cesium.ConeEmitter);
153
+ _defineProperty(DeepTwinsEngine3D, "SphereEmitter", Cesium.SphereEmitter);
134
154
  _defineProperty(DeepTwinsEngine3D, "ImageGlowingMaterialProperty", ImageGlowingMaterialProperty);
135
155
  _defineProperty(DeepTwinsEngine3D, "SubmergenceAnalysis", SubmergenceAnalysis);
136
156
  _defineProperty(DeepTwinsEngine3D, "SunLightAnalysis", SunLightAnalysis);
137
157
  _defineProperty(DeepTwinsEngine3D, "KmlDataSource", Cesium.KmlDataSource);
138
158
  _defineProperty(DeepTwinsEngine3D, "Compass", Compass);
139
159
  _defineProperty(DeepTwinsEngine3D, "ViewshedAnalysis", ViewshedAnalysis);
160
+ _defineProperty(DeepTwinsEngine3D, "LineOfSightAnalysis", LineOfSightAnalysis);
161
+ _defineProperty(DeepTwinsEngine3D, "TerrainExcavationAnalysis", TerrainExcavationAnalysis);
140
162
  _defineProperty(DeepTwinsEngine3D, "VisitLayer", VisitLayer);
141
163
  _defineProperty(DeepTwinsEngine3D, "PoiLayer", PoiLayer);
142
164
  _defineProperty(DeepTwinsEngine3D, "FlightPlanning", FlightPlanning);
@@ -42,6 +42,7 @@ export default class Map extends Cesium.Viewer implements MapContext {
42
42
  roll: number;
43
43
  };
44
44
  setCameraView(cameraView: any, options?: any): void;
45
+ setCameraViewByBbox(bbox: number[], options?: any): void;
45
46
  cancelCameraFly(): void;
46
47
  completeCameraFly(): void;
47
48
  setDefaultLayer(name: string, index?: number): Cesium.ImageryLayerCollection | undefined;
@@ -428,6 +428,24 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
428
428
  }, options));
429
429
  }
430
430
 
431
+ // 设置相机到bbox范围
432
+ }, {
433
+ key: "setCameraViewByBbox",
434
+ value: function setCameraViewByBbox(bbox) {
435
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
436
+ if (!Array.isArray(bbox) || bbox.length < 4) return;
437
+ var _bbox = _slicedToArray(bbox, 4),
438
+ west = _bbox[0],
439
+ south = _bbox[1],
440
+ east = _bbox[2],
441
+ north = _bbox[3];
442
+ var isValidBbox = [west, south, east, north].every(Number.isFinite);
443
+ if (!isValidBbox) return;
444
+ this.camera.flyTo(_objectSpread({
445
+ destination: Cesium.Rectangle.fromDegrees(west, south, east, north)
446
+ }, options));
447
+ }
448
+
431
449
  // 取消镜头的飞行和setCameraView等操作
432
450
  }, {
433
451
  key: "cancelCameraFly",
@@ -0,0 +1,61 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import * as Cesium from 'deeptwins-cesium';
3
+ import { MapContext } from '../map/Map';
4
+ export type ParticlePosition = Cesium.Cartesian3 | [number, number] | [number, number, number];
5
+ export type ParticleColor = string | Cesium.Color;
6
+ export type ParticleImageSize = Cesium.Cartesian2 | [number, number];
7
+ export interface BaseParticleOptions {
8
+ show?: boolean;
9
+ position?: ParticlePosition;
10
+ heading?: number;
11
+ pitch?: number;
12
+ roll?: number;
13
+ updateCallback?: Cesium.ParticleSystem.updateCallback;
14
+ emitter?: Cesium.ParticleEmitter;
15
+ emissionRate?: number;
16
+ bursts?: Cesium.ParticleBurst[];
17
+ loop?: boolean;
18
+ scale?: number;
19
+ startScale?: number;
20
+ endScale?: number;
21
+ color?: ParticleColor;
22
+ startColor?: ParticleColor;
23
+ endColor?: ParticleColor;
24
+ image?: any;
25
+ imageSize?: ParticleImageSize;
26
+ minimumImageSize?: ParticleImageSize;
27
+ maximumImageSize?: ParticleImageSize;
28
+ sizeInMeters?: boolean;
29
+ speed?: number;
30
+ minimumSpeed?: number;
31
+ maximumSpeed?: number;
32
+ lifetime?: number;
33
+ particleLife?: number;
34
+ minimumParticleLife?: number;
35
+ maximumParticleLife?: number;
36
+ mass?: number;
37
+ minimumMass?: number;
38
+ maximumMass?: number;
39
+ }
40
+ export default class BaseParticle {
41
+ _mapContext: MapContext | undefined;
42
+ particleSystem: Cesium.ParticleSystem | null;
43
+ options: BaseParticleOptions;
44
+ isDestroyed: boolean;
45
+ constructor(map: any, options?: BaseParticleOptions);
46
+ getMap(): any;
47
+ getPrimitive(): Cesium.ParticleSystem | null;
48
+ show(isShow: boolean): void;
49
+ destroy(): void;
50
+ private _assertMap;
51
+ private _canOperate;
52
+ private _createParticleSystem;
53
+ private _resolveParticleOptions;
54
+ private _resolveModelMatrix;
55
+ private _resolveEmitterModelMatrix;
56
+ private _createCameraViewEmitterModelMatrix;
57
+ private _hasEmitterOrientation;
58
+ private _resolvePosition;
59
+ private _resolveColor;
60
+ private _resolveImageSize;
61
+ }
@@ -0,0 +1,196 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
4
+ 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); }
5
+ 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; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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; }
9
+ 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; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ 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); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ 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; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
+ 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); }
16
+ import * as Cesium from 'deeptwins-cesium';
17
+ import * as utils from "../tool/utils";
18
+ import { getInternalParticleOptions, omitExternalMatrixOptions } from "./common";
19
+ var CAMERA_HEADING_OFFSET_DEGREES = 90;
20
+ var EMITTER_FORWARD_AXIS_CORRECTION = Cesium.Matrix3.fromRotationY(Cesium.Math.PI_OVER_TWO);
21
+ var BaseParticle = /*#__PURE__*/function () {
22
+ function BaseParticle(map) {
23
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
24
+ _classCallCheck(this, BaseParticle);
25
+ _defineProperty(this, "_mapContext", void 0);
26
+ _defineProperty(this, "particleSystem", null);
27
+ _defineProperty(this, "options", void 0);
28
+ _defineProperty(this, "isDestroyed", false);
29
+ this._assertMap(map);
30
+ this._mapContext = map._mapContext || {
31
+ getMap: function getMap() {
32
+ return map;
33
+ }
34
+ };
35
+ var internalOptions = getInternalParticleOptions(options);
36
+ var safeOptions = omitExternalMatrixOptions(options);
37
+ this.options = safeOptions;
38
+ this.particleSystem = this._createParticleSystem(safeOptions, internalOptions);
39
+ this.getMap().scene.primitives.add(this.particleSystem);
40
+ }
41
+ _createClass(BaseParticle, [{
42
+ key: "getMap",
43
+ value: function getMap() {
44
+ return this._mapContext && this._mapContext.getMap();
45
+ }
46
+ }, {
47
+ key: "getPrimitive",
48
+ value: function getPrimitive() {
49
+ return this.particleSystem;
50
+ }
51
+ }, {
52
+ key: "show",
53
+ value: function show(isShow) {
54
+ if (!this._canOperate()) {
55
+ return;
56
+ }
57
+ this.particleSystem && (this.particleSystem.show = isShow);
58
+ }
59
+ }, {
60
+ key: "destroy",
61
+ value: function destroy() {
62
+ var _map$scene;
63
+ if (this.isDestroyed) {
64
+ return;
65
+ }
66
+ this.isDestroyed = true;
67
+ var primitive = this.particleSystem;
68
+ var map = this.getMap();
69
+ if (primitive && map !== null && map !== void 0 && (_map$scene = map.scene) !== null && _map$scene !== void 0 && (_map$scene = _map$scene.primitives) !== null && _map$scene !== void 0 && _map$scene.contains(primitive)) {
70
+ map.scene.primitives.remove(primitive);
71
+ } else if (primitive && !primitive.isDestroyed()) {
72
+ primitive.destroy();
73
+ }
74
+ this.particleSystem = null;
75
+ this._mapContext = undefined;
76
+ }
77
+ }, {
78
+ key: "_assertMap",
79
+ value: function _assertMap(map) {
80
+ var _map$scene2;
81
+ if (!(map !== null && map !== void 0 && (_map$scene2 = map.scene) !== null && _map$scene2 !== void 0 && _map$scene2.primitives)) {
82
+ throw new Error('BaseParticle需要传入有效的Cesium Viewer实例');
83
+ }
84
+ }
85
+ }, {
86
+ key: "_canOperate",
87
+ value: function _canOperate() {
88
+ if (this.isDestroyed) {
89
+ utils.error('BaseParticle实例已销毁');
90
+ return false;
91
+ }
92
+ return true;
93
+ }
94
+ }, {
95
+ key: "_createParticleSystem",
96
+ value: function _createParticleSystem(options, internalOptions) {
97
+ return new Cesium.ParticleSystem(this._resolveParticleOptions(options, internalOptions));
98
+ }
99
+ }, {
100
+ key: "_resolveParticleOptions",
101
+ value: function _resolveParticleOptions(options, internalOptions) {
102
+ var particleInputOptions = _objectSpread({}, options);
103
+ delete particleInputOptions.heading;
104
+ delete particleInputOptions.pitch;
105
+ delete particleInputOptions.roll;
106
+ var particleOptions = _objectSpread(_objectSpread({}, particleInputOptions), {}, {
107
+ modelMatrix: this._resolveModelMatrix(options, internalOptions),
108
+ color: this._resolveColor(particleInputOptions.color),
109
+ startColor: this._resolveColor(particleInputOptions.startColor),
110
+ endColor: this._resolveColor(particleInputOptions.endColor),
111
+ imageSize: this._resolveImageSize(particleInputOptions.imageSize),
112
+ minimumImageSize: this._resolveImageSize(particleInputOptions.minimumImageSize),
113
+ maximumImageSize: this._resolveImageSize(particleInputOptions.maximumImageSize)
114
+ });
115
+ var emitterModelMatrix = this._resolveEmitterModelMatrix(options, internalOptions);
116
+ if (emitterModelMatrix) {
117
+ return _objectSpread(_objectSpread({}, particleOptions), {}, {
118
+ emitterModelMatrix: emitterModelMatrix
119
+ });
120
+ }
121
+ return particleOptions;
122
+ }
123
+ }, {
124
+ key: "_resolveModelMatrix",
125
+ value: function _resolveModelMatrix(options, internalOptions) {
126
+ if (internalOptions !== null && internalOptions !== void 0 && internalOptions.modelMatrix) {
127
+ return Cesium.Matrix4.clone(internalOptions.modelMatrix);
128
+ }
129
+ if (options.position) {
130
+ return Cesium.Transforms.eastNorthUpToFixedFrame(this._resolvePosition(options.position));
131
+ }
132
+ return Cesium.Matrix4.clone(Cesium.Matrix4.IDENTITY);
133
+ }
134
+ }, {
135
+ key: "_resolveEmitterModelMatrix",
136
+ value: function _resolveEmitterModelMatrix(options, internalOptions) {
137
+ if (internalOptions !== null && internalOptions !== void 0 && internalOptions.emitterModelMatrix) {
138
+ return Cesium.Matrix4.clone(internalOptions.emitterModelMatrix);
139
+ }
140
+ if (!this._hasEmitterOrientation(options)) {
141
+ return undefined;
142
+ }
143
+ return this._createCameraViewEmitterModelMatrix(options);
144
+ }
145
+ }, {
146
+ key: "_createCameraViewEmitterModelMatrix",
147
+ value: function _createCameraViewEmitterModelMatrix(options) {
148
+ var headingPitchRoll = Cesium.HeadingPitchRoll.fromDegrees((options.heading || 0) - CAMERA_HEADING_OFFSET_DEGREES, options.pitch || 0, options.roll || 0);
149
+ var cameraViewRotation = Cesium.Matrix3.fromHeadingPitchRoll(headingPitchRoll);
150
+ var emitterRotation = Cesium.Matrix3.multiply(cameraViewRotation, EMITTER_FORWARD_AXIS_CORRECTION, new Cesium.Matrix3());
151
+ return Cesium.Matrix4.fromRotationTranslation(emitterRotation, Cesium.Cartesian3.ZERO);
152
+ }
153
+ }, {
154
+ key: "_hasEmitterOrientation",
155
+ value: function _hasEmitterOrientation(options) {
156
+ return options.heading !== undefined || options.pitch !== undefined || options.roll !== undefined;
157
+ }
158
+ }, {
159
+ key: "_resolvePosition",
160
+ value: function _resolvePosition(position) {
161
+ if (position instanceof Cesium.Cartesian3) {
162
+ return Cesium.Cartesian3.clone(position);
163
+ }
164
+ var _position = _slicedToArray(position, 3),
165
+ lng = _position[0],
166
+ lat = _position[1],
167
+ _position$ = _position[2],
168
+ alt = _position$ === void 0 ? 0 : _position$;
169
+ return Cesium.Cartesian3.fromDegrees(lng, lat, alt);
170
+ }
171
+ }, {
172
+ key: "_resolveColor",
173
+ value: function _resolveColor(color) {
174
+ if (!color) {
175
+ return color;
176
+ }
177
+ return utils.colorString(color);
178
+ }
179
+ }, {
180
+ key: "_resolveImageSize",
181
+ value: function _resolveImageSize(imageSize) {
182
+ if (!imageSize) {
183
+ return imageSize;
184
+ }
185
+ if (imageSize instanceof Cesium.Cartesian2) {
186
+ return Cesium.Cartesian2.clone(imageSize);
187
+ }
188
+ var _imageSize = _slicedToArray(imageSize, 2),
189
+ width = _imageSize[0],
190
+ height = _imageSize[1];
191
+ return new Cesium.Cartesian2(width, height);
192
+ }
193
+ }]);
194
+ return BaseParticle;
195
+ }();
196
+ export { BaseParticle as default };
@@ -0,0 +1,8 @@
1
+ import BaseParticle, { BaseParticleOptions } from './BaseParticle';
2
+ export type FireParticleOptions = BaseParticleOptions & {
3
+ emitterRadius?: number;
4
+ };
5
+ export default class FireParticle extends BaseParticle {
6
+ constructor(map: any, options?: FireParticleOptions);
7
+ private static _resolveOptions;
8
+ }
@@ -0,0 +1,65 @@
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
+ var _excluded = ["emitter", "emitterRadius"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ 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; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ 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); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ 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); }; }
16
+ 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); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ 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; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+ import * as Cesium from 'deeptwins-cesium';
21
+ import { colorString, getDeepTwinsFile } from "../tool/utils";
22
+ import BaseParticle from "./BaseParticle";
23
+ var DEFAULT_FIRE_PARTICLE_OPTIONS = {
24
+ image: getDeepTwinsFile('Image/fire.png'),
25
+ emissionRate: 80,
26
+ loop: true,
27
+ startColor: colorString('#FFD95CE6'),
28
+ endColor: colorString('#E51A0000'),
29
+ startScale: 1.0,
30
+ endScale: 3.5,
31
+ minimumImageSize: new Cesium.Cartesian2(1.0, 1.0),
32
+ maximumImageSize: new Cesium.Cartesian2(2.8, 2.8),
33
+ sizeInMeters: true,
34
+ minimumSpeed: 1.0,
35
+ maximumSpeed: 4.0,
36
+ minimumParticleLife: 0.8,
37
+ maximumParticleLife: 1.8,
38
+ minimumMass: 0.8,
39
+ maximumMass: 1.2,
40
+ emitterRadius: 1.5
41
+ };
42
+ var FireParticle = /*#__PURE__*/function (_BaseParticle) {
43
+ _inherits(FireParticle, _BaseParticle);
44
+ var _super = _createSuper(FireParticle);
45
+ function FireParticle(map) {
46
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47
+ _classCallCheck(this, FireParticle);
48
+ var particleOptions = FireParticle._resolveOptions(options);
49
+ return _super.call(this, map, particleOptions);
50
+ }
51
+ _createClass(FireParticle, null, [{
52
+ key: "_resolveOptions",
53
+ value: function _resolveOptions(options) {
54
+ var nextOptions = _objectSpread(_objectSpread({}, DEFAULT_FIRE_PARTICLE_OPTIONS), options);
55
+ var emitter = nextOptions.emitter,
56
+ emitterRadius = nextOptions.emitterRadius,
57
+ particleOptions = _objectWithoutProperties(nextOptions, _excluded);
58
+ return _objectSpread(_objectSpread({}, particleOptions), {}, {
59
+ emitter: emitter || new Cesium.CircleEmitter(emitterRadius)
60
+ });
61
+ }
62
+ }]);
63
+ return FireParticle;
64
+ }(BaseParticle);
65
+ export { FireParticle as default };
@@ -0,0 +1,10 @@
1
+ import BaseParticle, { BaseParticleOptions } from './BaseParticle';
2
+ export type FountainParticleOptions = BaseParticleOptions & {
3
+ emitterAngle?: number;
4
+ gravity?: number;
5
+ };
6
+ export default class FountainParticle extends BaseParticle {
7
+ constructor(map: any, options?: FountainParticleOptions);
8
+ private static _resolveOptions;
9
+ private static _createGravityCallback;
10
+ }
@@ -0,0 +1,80 @@
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
+ var _excluded = ["emitter", "emitterAngle", "gravity", "updateCallback"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ 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; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ 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); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ 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); }; }
16
+ 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); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ 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; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+ import * as Cesium from 'deeptwins-cesium';
21
+ import { colorString, getDeepTwinsFile } from "../tool/utils";
22
+ import BaseParticle from "./BaseParticle";
23
+ var DEFAULT_FOUNTAIN_GRAVITY = 9.8;
24
+ var FOUNTAIN_GRAVITY_SCRATCH = new Cesium.Cartesian3();
25
+ var DEFAULT_FOUNTAIN_PARTICLE_OPTIONS = {
26
+ image: getDeepTwinsFile('Image/fountain.png'),
27
+ emissionRate: 180,
28
+ loop: true,
29
+ startColor: colorString('#BDEBFFFF'),
30
+ endColor: colorString('#FFFFFF00'),
31
+ startScale: 0.6,
32
+ endScale: 1.8,
33
+ minimumImageSize: new Cesium.Cartesian2(0.3, 0.3),
34
+ maximumImageSize: new Cesium.Cartesian2(1.1, 1.1),
35
+ sizeInMeters: true,
36
+ minimumSpeed: 6.0,
37
+ maximumSpeed: 12.0,
38
+ minimumParticleLife: 1.2,
39
+ maximumParticleLife: 2.4,
40
+ minimumMass: 0.8,
41
+ maximumMass: 1.2,
42
+ emitterAngle: Cesium.Math.toRadians(25),
43
+ gravity: DEFAULT_FOUNTAIN_GRAVITY
44
+ };
45
+ var FountainParticle = /*#__PURE__*/function (_BaseParticle) {
46
+ _inherits(FountainParticle, _BaseParticle);
47
+ var _super = _createSuper(FountainParticle);
48
+ function FountainParticle(map) {
49
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
50
+ _classCallCheck(this, FountainParticle);
51
+ var particleOptions = FountainParticle._resolveOptions(options);
52
+ return _super.call(this, map, particleOptions);
53
+ }
54
+ _createClass(FountainParticle, null, [{
55
+ key: "_resolveOptions",
56
+ value: function _resolveOptions(options) {
57
+ var nextOptions = _objectSpread(_objectSpread({}, DEFAULT_FOUNTAIN_PARTICLE_OPTIONS), options);
58
+ var emitter = nextOptions.emitter,
59
+ emitterAngle = nextOptions.emitterAngle,
60
+ gravity = nextOptions.gravity,
61
+ updateCallback = nextOptions.updateCallback,
62
+ particleOptions = _objectWithoutProperties(nextOptions, _excluded);
63
+ return _objectSpread(_objectSpread({}, particleOptions), {}, {
64
+ emitter: emitter || new Cesium.ConeEmitter(emitterAngle),
65
+ updateCallback: updateCallback || FountainParticle._createGravityCallback(gravity !== null && gravity !== void 0 ? gravity : DEFAULT_FOUNTAIN_GRAVITY)
66
+ });
67
+ }
68
+ }, {
69
+ key: "_createGravityCallback",
70
+ value: function _createGravityCallback(gravity) {
71
+ return function (particle, dt) {
72
+ var gravityVector = Cesium.Cartesian3.normalize(particle.position, FOUNTAIN_GRAVITY_SCRATCH);
73
+ Cesium.Cartesian3.multiplyByScalar(gravityVector, -gravity * dt, gravityVector);
74
+ particle.velocity = Cesium.Cartesian3.add(particle.velocity, gravityVector, particle.velocity);
75
+ };
76
+ }
77
+ }]);
78
+ return FountainParticle;
79
+ }(BaseParticle);
80
+ export { FountainParticle as default };
@@ -0,0 +1,8 @@
1
+ import BaseParticle, { BaseParticleOptions } from './BaseParticle';
2
+ export type SmokeParticleOptions = BaseParticleOptions & {
3
+ emitterRadius?: number;
4
+ };
5
+ export default class SmokeParticle extends BaseParticle {
6
+ constructor(map: any, options?: SmokeParticleOptions);
7
+ private static _resolveOptions;
8
+ }
@@ -0,0 +1,65 @@
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
+ var _excluded = ["emitter", "emitterRadius"];
3
+ 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; }
4
+ 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; }
5
+ 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; }
6
+ 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; }
7
+ 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; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ 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); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ 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); }
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
15
+ 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); }; }
16
+ 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); }
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+ 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; } }
19
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
20
+ import * as Cesium from 'deeptwins-cesium';
21
+ import { colorString, getDeepTwinsFile } from "../tool/utils";
22
+ import BaseParticle from "./BaseParticle";
23
+ var DEFAULT_SMOKE_PARTICLE_OPTIONS = {
24
+ image: getDeepTwinsFile('Image/smoke.png'),
25
+ emissionRate: 45,
26
+ loop: true,
27
+ startColor: colorString('#B8B8B8A6'),
28
+ endColor: colorString('#3F3F3F00'),
29
+ startScale: 1.2,
30
+ endScale: 6.0,
31
+ minimumImageSize: new Cesium.Cartesian2(1.0, 1.0),
32
+ maximumImageSize: new Cesium.Cartesian2(3.0, 3.0),
33
+ sizeInMeters: true,
34
+ minimumSpeed: 0.4,
35
+ maximumSpeed: 1.6,
36
+ minimumParticleLife: 2.0,
37
+ maximumParticleLife: 4.0,
38
+ minimumMass: 0.8,
39
+ maximumMass: 1.5,
40
+ emitterRadius: 2
41
+ };
42
+ var SmokeParticle = /*#__PURE__*/function (_BaseParticle) {
43
+ _inherits(SmokeParticle, _BaseParticle);
44
+ var _super = _createSuper(SmokeParticle);
45
+ function SmokeParticle(map) {
46
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47
+ _classCallCheck(this, SmokeParticle);
48
+ var particleOptions = SmokeParticle._resolveOptions(options);
49
+ return _super.call(this, map, particleOptions);
50
+ }
51
+ _createClass(SmokeParticle, null, [{
52
+ key: "_resolveOptions",
53
+ value: function _resolveOptions(options) {
54
+ var nextOptions = _objectSpread(_objectSpread({}, DEFAULT_SMOKE_PARTICLE_OPTIONS), options);
55
+ var emitter = nextOptions.emitter,
56
+ emitterRadius = nextOptions.emitterRadius,
57
+ particleOptions = _objectWithoutProperties(nextOptions, _excluded);
58
+ return _objectSpread(_objectSpread({}, particleOptions), {}, {
59
+ emitter: emitter || new Cesium.CircleEmitter(emitterRadius)
60
+ });
61
+ }
62
+ }]);
63
+ return SmokeParticle;
64
+ }(BaseParticle);
65
+ export { SmokeParticle as default };