deeptwins-engine-3d 0.1.65 → 0.1.66

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 (37) hide show
  1. package/dist/esm/constant.d.ts +1 -0
  2. package/dist/esm/drawCommand/viewShed/RectangularSensorPrimitive.d.ts +1 -0
  3. package/dist/esm/drawCommand/viewShed/ViewShedAnalyserLayer.d.ts +1 -0
  4. package/dist/esm/drawer/common.d.ts +1 -0
  5. package/dist/esm/drawer/coordinate.d.ts +1 -0
  6. package/dist/esm/drawer/index.d.ts +1 -1
  7. package/dist/esm/drawer/shape/BaseShape.d.ts +1 -0
  8. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  9. package/dist/esm/index.d.ts +2 -0
  10. package/dist/esm/index.js +6 -2
  11. package/dist/esm/map/Map.d.ts +9 -0
  12. package/dist/esm/map/Map.js +115 -2
  13. package/dist/esm/material/AtmosphericDispersion.d.ts +71 -0
  14. package/dist/esm/material/AtmosphericDispersion.js +485 -33
  15. package/dist/esm/material/GlobalVolumetricCloud.d.ts +117 -0
  16. package/dist/esm/material/GlobalVolumetricCloud.js +219 -223
  17. package/dist/esm/material/entity/ImageMaterialProperty.d.ts +1 -0
  18. package/dist/esm/material/shader/AtmosphericShader.glsl +244 -0
  19. package/dist/esm/measure/BaseDraw.d.ts +1 -0
  20. package/dist/esm/measure/types.d.ts +1 -0
  21. package/dist/esm/measure/utils.d.ts +1 -0
  22. package/dist/esm/sceneFusion/Airway.d.ts +0 -0
  23. package/dist/esm/sceneFusion/Airway.js +692 -0
  24. package/dist/esm/tileLayer/ArcGisLayer.d.ts +1 -0
  25. package/dist/esm/tileLayer/ImageryLayer.d.ts +1 -0
  26. package/dist/esm/tileLayer/MvtVectorLoad.d.ts +1 -0
  27. package/dist/esm/tool/common.d.ts +1 -0
  28. package/dist/esm/tool/utils.d.ts +1 -0
  29. package/dist/esm/typings.d.ts +8 -0
  30. package/dist/esm/visualization/BaseHeatmap.d.ts +5 -0
  31. package/dist/esm/visualization/BaseHeatmap.js +54 -12
  32. package/dist/esm/visualization/Heatmap2d.d.ts +1 -0
  33. package/dist/esm/visualization/Heatmap2d.js +17 -26
  34. package/dist/esm/visualization/Heatmap3d.d.ts +8 -2
  35. package/dist/esm/visualization/Heatmap3d.js +195 -59
  36. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  37. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="deepteins-engine-3d/typings" />
1
2
  import * as Cesium from 'deeptwins-cesium';
2
3
  export declare const DEFAULT_ION = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZjBlODExOC04YjVhLTQzNzMtODBhMi0yZDhiYzBiZDU5M2IiLCJpZCI6MTA4MDYzLCJpYXQiOjE2NjMyMTIyNjJ9.9JzfwwppbN82Dd38iwczmXkWvPpEak75gKnqw0_yVVs";
3
4
  export declare const DEFAULT_VIEW_CONFIG: () => {
@@ -1,3 +1,4 @@
1
+ /// <reference types="deepteins-engine-3d/typings" />
1
2
  import * as Cesium from 'deeptwins-cesium';
2
3
  declare class RectangularSensorPrimitive {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference types="deepteins-engine-3d/typings" />
1
2
  import * as Cesium from 'deeptwins-cesium';
2
3
  declare class ViewShedAnalyserLayer {
3
4
  /**
@@ -1,3 +1,4 @@
1
+ /// <reference path="../typings.d.ts" />
1
2
  import * as Cesium from 'deeptwins-cesium';
2
3
  /**
3
4
  * 根据控制点生成贝塞尔曲线点集。
@@ -1,3 +1,4 @@
1
+ /// <reference path="../typings.d.ts" />
1
2
  /**
2
3
  * 地图坐标相关方法
3
4
  */
@@ -7,7 +7,7 @@ export declare const MULTI_POINT_SHAPE_TYPES: {
7
7
  readonly PINCER_ARROW: "pincerArrow";
8
8
  readonly SECTOR: "sector";
9
9
  };
10
- export declare const MULTI_POINT_SHAPES: ("polyline" | "polygon" | "attackArrow" | "curve" | "pincerArrow" | "sector")[];
10
+ export declare const MULTI_POINT_SHAPES: ("polygon" | "polyline" | "attackArrow" | "curve" | "pincerArrow" | "sector")[];
11
11
  declare class Drawer implements DrawContext {
12
12
  private readonly _mapContext;
13
13
  private readonly _drawContext;
@@ -1,3 +1,4 @@
1
+ /// <reference types="deepteins-engine-3d/typings" />
1
2
  import * as Cesium from 'deeptwins-cesium';
2
3
  import { DrawContext } from '../types';
3
4
  import DragPoint from './DragPoint';
@@ -15,7 +15,7 @@ export default class BaseSource {
15
15
  remove(): void;
16
16
  setData(data: any): this | undefined;
17
17
  _toDestroy(): void;
18
- static analysisSourceType(data: any): "clampedPolygonGrid" | "wkt" | "sourceId" | "sourceInstance" | "geoJson" | "other";
18
+ static analysisSourceType(data: any): "other" | "clampedPolygonGrid" | "wkt" | "sourceId" | "sourceInstance" | "geoJson";
19
19
  static wktToGeoJon(wkt: string): any;
20
20
  static geoJsonToGeoCartesian3Array(geoJson: any): any[];
21
21
  static handleFeaturePoint(feature: any): any;
@@ -76,5 +76,7 @@ export declare class DeepTwinsEngine3D {
76
76
  static VolumeClouds: any;
77
77
  static ToolTip: any;
78
78
  static MvtVectorLoad: any;
79
+ static AtmosphericDispersion: any;
80
+ static GlobalVolumetricCloud: any;
79
81
  }
80
82
  export default DeepTwinsEngine3D;
package/dist/esm/index.js CHANGED
@@ -28,6 +28,8 @@ import PoiLayer from "./lowAltitude/PoiLayer";
28
28
  import VisitLayer from "./lowAltitude/VisitLayer";
29
29
  import GroundSkyBox from "./map/GroundSkyBox";
30
30
  import Map from "./map/Map";
31
+ import AtmosphericDispersion from "./material/AtmosphericDispersion";
32
+ import GlobalVolumetricCloud from "./material/GlobalVolumetricCloud";
31
33
  import VolumeCloud from "./material/VolumeCloud";
32
34
  import WeatherEffects from "./material/WeatherEffects";
33
35
  import CircleWaveMaterialProperty from "./material/entity/CircleWaveMaterialProperty";
@@ -64,11 +66,11 @@ DEEP_TWINS_BASE_URL && (window.CESIUM_BASE_URL = DEEP_TWINS_BASE_URL);
64
66
  // 全局加载css
65
67
  loadCss(Cesium.buildModuleUrl('Widgets/widgets.css'));
66
68
  // 打印版本信息
67
- console.log('DeepTwinsEngine3D Version:', "0.1.65");
69
+ console.log('DeepTwinsEngine3D Version:', "0.1.66");
68
70
  export var DeepTwinsEngine3D = /*#__PURE__*/_createClass(function DeepTwinsEngine3D() {
69
71
  _classCallCheck(this, DeepTwinsEngine3D);
70
72
  });
71
- _defineProperty(DeepTwinsEngine3D, "Version", "0.1.65");
73
+ _defineProperty(DeepTwinsEngine3D, "Version", "0.1.66");
72
74
  _defineProperty(DeepTwinsEngine3D, "Map", Map);
73
75
  _defineProperty(DeepTwinsEngine3D, "GroundSkyBox", GroundSkyBox);
74
76
  _defineProperty(DeepTwinsEngine3D, "RasterLayer", RasterLayer);
@@ -144,4 +146,6 @@ _defineProperty(DeepTwinsEngine3D, "ViewShedAnalyserLayer", ViewShedAnalyserLaye
144
146
  _defineProperty(DeepTwinsEngine3D, "VolumeClouds", VolumeClouds);
145
147
  _defineProperty(DeepTwinsEngine3D, "ToolTip", ToolTip);
146
148
  _defineProperty(DeepTwinsEngine3D, "MvtVectorLoad", MvtVectorLoad);
149
+ _defineProperty(DeepTwinsEngine3D, "AtmosphericDispersion", AtmosphericDispersion);
150
+ _defineProperty(DeepTwinsEngine3D, "GlobalVolumetricCloud", GlobalVolumetricCloud);
147
151
  export default DeepTwinsEngine3D;
@@ -1,3 +1,4 @@
1
+ /// <reference path="../typings.d.ts" />
1
2
  import * as Cesium from 'deeptwins-cesium';
2
3
  export interface MapContext {
3
4
  getMap: any;
@@ -13,6 +14,7 @@ export default class Map extends Cesium.Viewer implements MapContext {
13
14
  private _hasGSModel;
14
15
  private _event;
15
16
  private _eventTrick;
17
+ private _plugins;
16
18
  constructor(container: any, options: any);
17
19
  getMap(): this;
18
20
  private _createLogoContainer;
@@ -71,5 +73,12 @@ export default class Map extends Cesium.Viewer implements MapContext {
71
73
  removeEffect(effect: any): void;
72
74
  on(type: any, event: any): any;
73
75
  addModuleLayer: (moduleLayer: any) => any;
76
+ private _normalizePlugins;
77
+ private _getPluginConstructor;
78
+ private _getPluginKey;
79
+ private _isSamePlugin;
80
+ private _findPluginEntry;
81
+ addPlugins(plugins: any): any;
82
+ removePlugins(plugins: any): any;
74
83
  destroy(): void;
75
84
  }
@@ -1,5 +1,9 @@
1
1
  var _excluded = ["camera", "deepTwins", "scene", "clock", "globe", "cameraController", "resolutionScale"];
2
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 _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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
3
7
  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; }
4
8
  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; }
5
9
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
@@ -83,6 +87,8 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
83
87
  _defineProperty(_assertThisInitialized(_this), "_event", void 0);
84
88
  // 默认的事件监听
85
89
  _defineProperty(_assertThisInitialized(_this), "_eventTrick", []);
90
+ // 插件
91
+ _defineProperty(_assertThisInitialized(_this), "_plugins", {});
86
92
  // 添加yunjing 模型
87
93
  _defineProperty(_assertThisInitialized(_this), "addModuleLayer", function (moduleLayer) {
88
94
  var yunjing = moduleLayer.addToMap(_assertThisInitialized(_this));
@@ -715,10 +721,116 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
715
721
  }
716
722
  }
717
723
  }, {
718
- key: "destroy",
724
+ key: "_normalizePlugins",
719
725
  value:
726
+ // 规范插件
727
+ function _normalizePlugins(plugins) {
728
+ if (isNil(plugins)) {
729
+ return [];
730
+ }
731
+ return flattenDeep([plugins]).filter(Boolean);
732
+ }
733
+
734
+ // 获取插件构造器
735
+ }, {
736
+ key: "_getPluginConstructor",
737
+ value: function _getPluginConstructor(plugin) {
738
+ return typeof plugin === 'function' ? plugin : plugin === null || plugin === void 0 ? void 0 : plugin.constructor;
739
+ }
740
+
741
+ // 获取插件key
742
+ }, {
743
+ key: "_getPluginKey",
744
+ value: function _getPluginKey(plugin) {
745
+ var pluginConstructor = this._getPluginConstructor(plugin);
746
+ if (pluginConstructor !== null && pluginConstructor !== void 0 && pluginConstructor.name) {
747
+ return pluginConstructor.name;
748
+ }
749
+ throw new Error("Unable to get plugin \"".concat(plugin.name, "\""));
750
+ }
751
+
752
+ // 判断插件是否已存在
753
+ }, {
754
+ key: "_isSamePlugin",
755
+ value: function _isSamePlugin(pluginInstance, plugin) {
756
+ return pluginInstance === plugin || typeof plugin === 'function' && (pluginInstance === null || pluginInstance === void 0 ? void 0 : pluginInstance.constructor) === plugin;
757
+ }
758
+
759
+ // 查找插件
760
+ }, {
761
+ key: "_findPluginEntry",
762
+ value: function _findPluginEntry(plugin) {
763
+ var pluginKey = this._getPluginKey(plugin);
764
+ if (pluginKey && this._plugins[pluginKey]) {
765
+ return {
766
+ key: pluginKey,
767
+ instance: this._plugins[pluginKey]
768
+ };
769
+ }
770
+ var entries = Object.entries(this._plugins);
771
+ for (var i = 0; i < entries.length; i++) {
772
+ var _entries$i = _slicedToArray(entries[i], 2),
773
+ key = _entries$i[0],
774
+ pluginInstance = _entries$i[1];
775
+ if (this._isSamePlugin(pluginInstance, plugin)) {
776
+ return {
777
+ key: key,
778
+ instance: pluginInstance
779
+ };
780
+ }
781
+ }
782
+ }
783
+
784
+ // 添加自定义插件
785
+ }, {
786
+ key: "addPlugins",
787
+ value: function addPlugins(plugins) {
788
+ var _this7 = this;
789
+ var pluginList = this._normalizePlugins(plugins);
790
+ var instances = pluginList.map(function (plugin) {
791
+ var existsPlugin = _this7._findPluginEntry(plugin);
792
+ if (existsPlugin) {
793
+ return existsPlugin.instance;
794
+ }
795
+ var pluginInstance = typeof plugin === 'function' ? new plugin(_this7) : plugin;
796
+ var pluginKey = _this7._getPluginKey(plugin);
797
+ _this7._plugins[pluginKey] = pluginInstance;
798
+ return pluginInstance;
799
+ }).filter(Boolean);
800
+ return Array.isArray(plugins) ? instances : instances[0];
801
+ }
802
+
803
+ // 移除自定义插件
804
+ }, {
805
+ key: "removePlugins",
806
+ value: function removePlugins(plugins) {
807
+ var _this8 = this;
808
+ var pluginList = this._normalizePlugins(plugins);
809
+ var removedPlugins = [];
810
+ pluginList.forEach(function (plugin) {
811
+ var existsPlugin = _this8._findPluginEntry(plugin);
812
+ if (!existsPlugin) {
813
+ return;
814
+ }
815
+ var key = existsPlugin.key,
816
+ instance = existsPlugin.instance;
817
+ if (!(key in _this8._plugins)) {
818
+ return;
819
+ }
820
+ delete _this8._plugins[key];
821
+ var pluginInstance = instance;
822
+ if (typeof (pluginInstance === null || pluginInstance === void 0 ? void 0 : pluginInstance.destroy) === 'function') {
823
+ pluginInstance.destroy();
824
+ }
825
+ removedPlugins.push(pluginInstance);
826
+ });
827
+ return Array.isArray(plugins) ? removedPlugins : removedPlugins[0];
828
+ }
829
+
720
830
  // 销毁
721
- function destroy() {
831
+ }, {
832
+ key: "destroy",
833
+ value: function destroy() {
722
834
  this._eventTrick.forEach(function (t) {
723
835
  t.off();
724
836
  });
@@ -728,6 +840,7 @@ var Map = /*#__PURE__*/function (_Cesium$Viewer) {
728
840
  this._yunjing = null;
729
841
  }
730
842
  this._hasGSModel = false;
843
+ this.removePlugins(Object.values(this._plugins));
731
844
  _get(_getPrototypeOf(Map.prototype), "destroy", this).call(this);
732
845
  }
733
846
  }]);
@@ -0,0 +1,71 @@
1
+ /// <reference path="../typings.d.ts" />
2
+ import * as Cesium from 'deeptwins-cesium';
3
+ import { MapContext } from '../map/Map';
4
+ interface AtmosphericDispersionParams {
5
+ u_threshold: number;
6
+ u_blendFactor: number;
7
+ u_lightIntensity: number;
8
+ u_scatterStrength: number;
9
+ u_tonemapExposure: number;
10
+ u_mieExtinctionStrength: number;
11
+ u_fogOpacity: number;
12
+ u_fogPower: number;
13
+ u_clearMixBias: number;
14
+ }
15
+ interface AtmosphericDispersionZoomDampingOptions {
16
+ enableZoomDamping: boolean;
17
+ dampingStartPitchDeg: number;
18
+ dampingFullPitchDeg: number;
19
+ minZoomScale: number;
20
+ }
21
+ type AtmosphericDispersionClockText = `${number}:${number}:${number}`;
22
+ type AtmosphericDispersionClockOption = 'auto' | AtmosphericDispersionClockText;
23
+ interface AtmosphericDispersionClockOptions {
24
+ clock: AtmosphericDispersionClockOption;
25
+ }
26
+ type AtmosphericDispersionOptions = Partial<AtmosphericDispersionParams & AtmosphericDispersionZoomDampingOptions & AtmosphericDispersionClockOptions>;
27
+ export declare class AtmosphericDispersion {
28
+ _mapContext: MapContext | undefined;
29
+ params: AtmosphericDispersionParams;
30
+ originalOptions: AtmosphericDispersionOptions;
31
+ atmosphericDispersion: Cesium.PostProcessStage | null;
32
+ zoomDampingOptions: AtmosphericDispersionZoomDampingOptions;
33
+ clockOption: AtmosphericDispersionClockOption;
34
+ private _cameraChangedHandler;
35
+ private readonly _zoomDampingOwnerId;
36
+ private readonly _clockControlOwnerId;
37
+ constructor(map: any, options?: AtmosphericDispersionOptions);
38
+ getMap(): any;
39
+ private _buildParams;
40
+ private _buildZoomDampingOptions;
41
+ private _normalizeClockText;
42
+ private _buildClockOption;
43
+ private _initialize;
44
+ private _getCameraController;
45
+ private _getZoomDampingControllerState;
46
+ private _normalizeZoomFactor;
47
+ private _getClockControlState;
48
+ private _getEffectiveClockOption;
49
+ private _buildClockCurrentTime;
50
+ private _startClockAutoSync;
51
+ private _stopClockAutoSync;
52
+ private _syncSceneClockControl;
53
+ private _applyClockControl;
54
+ private _releaseClockControl;
55
+ private _syncClockControlState;
56
+ private _bindCameraChangedHandler;
57
+ private _unbindCameraChangedHandler;
58
+ private _handleCameraChanged;
59
+ private _computeDampedZoomFactor;
60
+ private _syncControllerZoomFactor;
61
+ private _applyZoomDamping;
62
+ private _releaseZoomDamping;
63
+ private _syncZoomDampingState;
64
+ updateParameters(params: AtmosphericDispersionOptions): this;
65
+ resetParameters(): this;
66
+ show(): this;
67
+ hide(): this;
68
+ isEnabled(): boolean;
69
+ destroy(): void;
70
+ }
71
+ export default AtmosphericDispersion;