deeptwins-engine-3d 0.1.64 → 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 (196) 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/{plot/utils/Algorithm.js → drawer/algorithm.js} +1 -3
  5. package/dist/esm/drawer/common.d.ts +62 -0
  6. package/dist/esm/{plot/utils/PlotCommon.js → drawer/common.js} +104 -551
  7. package/dist/esm/{plot/utils/Coordinate.d.ts → drawer/coordinate.d.ts} +1 -0
  8. package/dist/esm/drawer/index.d.ts +11 -18
  9. package/dist/esm/drawer/index.js +329 -80
  10. package/dist/esm/{plot/utils → drawer}/plotUtil.js +1 -3
  11. package/dist/esm/drawer/shape/Assemble.d.ts +34 -0
  12. package/dist/esm/drawer/shape/Assemble.js +415 -0
  13. package/dist/esm/drawer/shape/AttackArrow.d.ts +32 -0
  14. package/dist/esm/drawer/shape/AttackArrow.js +442 -0
  15. package/dist/esm/drawer/shape/BaseShape.d.ts +15 -4
  16. package/dist/esm/drawer/shape/BaseShape.js +175 -20
  17. package/dist/esm/drawer/shape/Bow.d.ts +31 -0
  18. package/dist/esm/drawer/shape/Bow.js +375 -0
  19. package/dist/esm/drawer/shape/Circle.d.ts +37 -0
  20. package/dist/esm/drawer/shape/Circle.js +461 -0
  21. package/dist/esm/drawer/shape/Curve.d.ts +29 -0
  22. package/dist/esm/drawer/shape/Curve.js +386 -0
  23. package/dist/esm/drawer/shape/DragPoint.d.ts +32 -0
  24. package/dist/esm/drawer/shape/DragPoint.js +211 -0
  25. package/dist/esm/drawer/shape/Elliptic.d.ts +38 -0
  26. package/dist/esm/drawer/shape/Elliptic.js +491 -0
  27. package/dist/esm/drawer/shape/Formation.d.ts +33 -0
  28. package/dist/esm/drawer/shape/Formation.js +395 -0
  29. package/dist/esm/drawer/shape/PincerArrow.d.ts +32 -0
  30. package/dist/esm/drawer/shape/PincerArrow.js +445 -0
  31. package/dist/esm/drawer/shape/Point.d.ts +2 -31
  32. package/dist/esm/drawer/shape/Point.js +7 -201
  33. package/dist/esm/drawer/shape/Polygon.d.ts +1 -1
  34. package/dist/esm/drawer/shape/Polygon.js +10 -81
  35. package/dist/esm/drawer/shape/Polyline.d.ts +1 -1
  36. package/dist/esm/drawer/shape/Polyline.js +10 -81
  37. package/dist/esm/drawer/shape/RegularPolygon.d.ts +37 -0
  38. package/dist/esm/drawer/shape/RegularPolygon.js +468 -0
  39. package/dist/esm/drawer/shape/RightAngleArrow.d.ts +34 -0
  40. package/dist/esm/drawer/shape/RightAngleArrow.js +423 -0
  41. package/dist/esm/drawer/shape/Sector.d.ts +37 -0
  42. package/dist/esm/drawer/shape/Sector.js +568 -0
  43. package/dist/esm/drawer/shape/StraightArrow.d.ts +34 -0
  44. package/dist/esm/drawer/shape/StraightArrow.js +422 -0
  45. package/dist/esm/drawer/shape/SwallowtailArrow.d.ts +36 -0
  46. package/dist/esm/drawer/shape/SwallowtailArrow.js +438 -0
  47. package/dist/esm/drawer/types.d.ts +23 -0
  48. package/dist/esm/drawer/types.js +11 -0
  49. package/dist/esm/drawer/utils.d.ts +14 -0
  50. package/dist/esm/drawer/utils.js +320 -2
  51. package/dist/esm/graphicLayer/BaseSource.d.ts +1 -1
  52. package/dist/esm/index.d.ts +2 -0
  53. package/dist/esm/index.js +6 -2
  54. package/dist/esm/map/Map.d.ts +9 -0
  55. package/dist/esm/map/Map.js +115 -2
  56. package/dist/esm/material/AtmosphericDispersion.d.ts +71 -0
  57. package/dist/esm/material/AtmosphericDispersion.js +485 -33
  58. package/dist/esm/material/GlobalVolumetricCloud.d.ts +117 -0
  59. package/dist/esm/material/GlobalVolumetricCloud.js +219 -223
  60. package/dist/esm/material/entity/ImageMaterialProperty.d.ts +1 -0
  61. package/dist/esm/material/shader/AtmosphericShader.glsl +244 -0
  62. package/dist/esm/measure/Area.d.ts +17 -17
  63. package/dist/esm/measure/Area.js +95 -63
  64. package/dist/esm/measure/BaseDraw.d.ts +10 -4
  65. package/dist/esm/measure/BaseDraw.js +37 -2
  66. package/dist/esm/measure/Distance.d.ts +9 -9
  67. package/dist/esm/measure/Distance.js +52 -68
  68. package/dist/esm/measure/index.d.ts +16 -26
  69. package/dist/esm/measure/index.js +72 -84
  70. package/dist/esm/measure/types.d.ts +95 -0
  71. package/dist/esm/measure/types.js +17 -0
  72. package/dist/esm/measure/utils.d.ts +8 -7
  73. package/dist/esm/measure/utils.js +43 -24
  74. package/dist/esm/sceneFusion/Airway.d.ts +0 -0
  75. package/dist/esm/sceneFusion/Airway.js +692 -0
  76. package/dist/esm/tileLayer/ArcGisLayer.d.ts +1 -0
  77. package/dist/esm/tileLayer/ImageryLayer.d.ts +1 -0
  78. package/dist/esm/tileLayer/MvtVectorLoad.d.ts +1 -0
  79. package/dist/esm/tool/common.d.ts +1 -0
  80. package/dist/esm/tool/utils.d.ts +1 -0
  81. package/dist/esm/tool/utils.js +1 -1
  82. package/dist/esm/typings.d.ts +8 -0
  83. package/dist/esm/visualization/BaseHeatmap.d.ts +5 -0
  84. package/dist/esm/visualization/BaseHeatmap.js +54 -12
  85. package/dist/esm/visualization/Heatmap2d.d.ts +1 -0
  86. package/dist/esm/visualization/Heatmap2d.js +17 -26
  87. package/dist/esm/visualization/Heatmap3d.d.ts +8 -2
  88. package/dist/esm/visualization/Heatmap3d.js +195 -59
  89. package/dist/umd/deeptwins-engine-3d.min.js +1 -1
  90. package/package.json +1 -1
  91. package/dist/esm/plot/create/CreateAssemble.d.ts +0 -2
  92. package/dist/esm/plot/create/CreateAssemble.js +0 -63
  93. package/dist/esm/plot/create/CreateAttackArrow.d.ts +0 -5
  94. package/dist/esm/plot/create/CreateAttackArrow.js +0 -75
  95. package/dist/esm/plot/create/CreateBillboard.d.ts +0 -2
  96. package/dist/esm/plot/create/CreateBillboard.js +0 -47
  97. package/dist/esm/plot/create/CreateBow.d.ts +0 -2
  98. package/dist/esm/plot/create/CreateBow.js +0 -63
  99. package/dist/esm/plot/create/CreateCircle.d.ts +0 -2
  100. package/dist/esm/plot/create/CreateCircle.js +0 -68
  101. package/dist/esm/plot/create/CreateCurve.d.ts +0 -2
  102. package/dist/esm/plot/create/CreateCurve.js +0 -76
  103. package/dist/esm/plot/create/CreateElliptic.d.ts +0 -2
  104. package/dist/esm/plot/create/CreateElliptic.js +0 -69
  105. package/dist/esm/plot/create/CreateFlag.d.ts +0 -2
  106. package/dist/esm/plot/create/CreateFlag.js +0 -80
  107. package/dist/esm/plot/create/CreateFormation.d.ts +0 -2
  108. package/dist/esm/plot/create/CreateFormation.js +0 -65
  109. package/dist/esm/plot/create/CreateFreeLine.d.ts +0 -2
  110. package/dist/esm/plot/create/CreateFreeLine.js +0 -69
  111. package/dist/esm/plot/create/CreateFreePolygon.d.ts +0 -2
  112. package/dist/esm/plot/create/CreateFreePolygon.js +0 -65
  113. package/dist/esm/plot/create/CreateLabel.d.ts +0 -2
  114. package/dist/esm/plot/create/CreateLabel.js +0 -55
  115. package/dist/esm/plot/create/CreateLineArrow.d.ts +0 -2
  116. package/dist/esm/plot/create/CreateLineArrow.js +0 -79
  117. package/dist/esm/plot/create/CreatePincerArrow.d.ts +0 -5
  118. package/dist/esm/plot/create/CreatePincerArrow.js +0 -73
  119. package/dist/esm/plot/create/CreatePoint.d.ts +0 -2
  120. package/dist/esm/plot/create/CreatePoint.js +0 -47
  121. package/dist/esm/plot/create/CreatePolygon.d.ts +0 -2
  122. package/dist/esm/plot/create/CreatePolygon.js +0 -80
  123. package/dist/esm/plot/create/CreatePolyline.d.ts +0 -2
  124. package/dist/esm/plot/create/CreatePolyline.js +0 -70
  125. package/dist/esm/plot/create/CreateRectangle.d.ts +0 -2
  126. package/dist/esm/plot/create/CreateRectangle.js +0 -60
  127. package/dist/esm/plot/create/CreateRegularPolygon.d.ts +0 -2
  128. package/dist/esm/plot/create/CreateRegularPolygon.js +0 -75
  129. package/dist/esm/plot/create/CreateRightAngleArrow.d.ts +0 -5
  130. package/dist/esm/plot/create/CreateRightAngleArrow.js +0 -73
  131. package/dist/esm/plot/create/CreateRoundRectangle.d.ts +0 -2
  132. package/dist/esm/plot/create/CreateRoundRectangle.js +0 -63
  133. package/dist/esm/plot/create/CreateSector.d.ts +0 -2
  134. package/dist/esm/plot/create/CreateSector.js +0 -65
  135. package/dist/esm/plot/create/CreateStraightArrow.d.ts +0 -5
  136. package/dist/esm/plot/create/CreateStraightArrow.js +0 -65
  137. package/dist/esm/plot/create/CreateSwallowtailArrow.d.ts +0 -5
  138. package/dist/esm/plot/create/CreateSwallowtailArrow.js +0 -67
  139. package/dist/esm/plot/create/index.d.ts +0 -25
  140. package/dist/esm/plot/create/index.js +0 -25
  141. package/dist/esm/plot/edit/EditAssemble.d.ts +0 -8
  142. package/dist/esm/plot/edit/EditAssemble.js +0 -120
  143. package/dist/esm/plot/edit/EditAttackArrow.d.ts +0 -8
  144. package/dist/esm/plot/edit/EditAttackArrow.js +0 -182
  145. package/dist/esm/plot/edit/EditBillboard.d.ts +0 -7
  146. package/dist/esm/plot/edit/EditBillboard.js +0 -70
  147. package/dist/esm/plot/edit/EditBow.d.ts +0 -8
  148. package/dist/esm/plot/edit/EditBow.js +0 -119
  149. package/dist/esm/plot/edit/EditCircle.d.ts +0 -8
  150. package/dist/esm/plot/edit/EditCircle.js +0 -133
  151. package/dist/esm/plot/edit/EditCurve.d.ts +0 -8
  152. package/dist/esm/plot/edit/EditCurve.js +0 -180
  153. package/dist/esm/plot/edit/EditElliptic.d.ts +0 -8
  154. package/dist/esm/plot/edit/EditElliptic.js +0 -144
  155. package/dist/esm/plot/edit/EditFlag.d.ts +0 -8
  156. package/dist/esm/plot/edit/EditFlag.js +0 -121
  157. package/dist/esm/plot/edit/EditFormation.d.ts +0 -8
  158. package/dist/esm/plot/edit/EditFormation.js +0 -120
  159. package/dist/esm/plot/edit/EditLabel.d.ts +0 -7
  160. package/dist/esm/plot/edit/EditLabel.js +0 -100
  161. package/dist/esm/plot/edit/EditLineArrow.d.ts +0 -8
  162. package/dist/esm/plot/edit/EditLineArrow.js +0 -180
  163. package/dist/esm/plot/edit/EditPincerArrow.d.ts +0 -8
  164. package/dist/esm/plot/edit/EditPincerArrow.js +0 -121
  165. package/dist/esm/plot/edit/EditPoint.d.ts +0 -7
  166. package/dist/esm/plot/edit/EditPoint.js +0 -70
  167. package/dist/esm/plot/edit/EditPolygon.d.ts +0 -8
  168. package/dist/esm/plot/edit/EditPolygon.js +0 -181
  169. package/dist/esm/plot/edit/EditPolyline.d.ts +0 -8
  170. package/dist/esm/plot/edit/EditPolyline.js +0 -179
  171. package/dist/esm/plot/edit/EditRectangle.d.ts +0 -8
  172. package/dist/esm/plot/edit/EditRectangle.js +0 -119
  173. package/dist/esm/plot/edit/EditRegularPolygon.d.ts +0 -8
  174. package/dist/esm/plot/edit/EditRegularPolygon.js +0 -170
  175. package/dist/esm/plot/edit/EditRightAngleArrow.d.ts +0 -8
  176. package/dist/esm/plot/edit/EditRightAngleArrow.js +0 -143
  177. package/dist/esm/plot/edit/EditRoundRectangle.d.ts +0 -8
  178. package/dist/esm/plot/edit/EditRoundRectangle.js +0 -119
  179. package/dist/esm/plot/edit/EditSector.d.ts +0 -8
  180. package/dist/esm/plot/edit/EditSector.js +0 -120
  181. package/dist/esm/plot/edit/EditStraightArrow.d.ts +0 -8
  182. package/dist/esm/plot/edit/EditStraightArrow.js +0 -120
  183. package/dist/esm/plot/edit/EditSwallowtailArrow.d.ts +0 -8
  184. package/dist/esm/plot/edit/EditSwallowtailArrow.js +0 -121
  185. package/dist/esm/plot/edit/index.d.ts +0 -23
  186. package/dist/esm/plot/edit/index.js +0 -23
  187. package/dist/esm/plot/utils/DomUtil.d.ts +0 -34
  188. package/dist/esm/plot/utils/DomUtil.js +0 -100
  189. package/dist/esm/plot/utils/PlotCommon.d.ts +0 -101
  190. package/dist/esm/plot/utils/ReminderTip.d.ts +0 -10
  191. package/dist/esm/plot/utils/ReminderTip.js +0 -67
  192. package/dist/esm/plot/utils/Tooltip.d.ts +0 -3
  193. package/dist/esm/plot/utils/Tooltip.js +0 -97
  194. /package/dist/esm/{plot/utils/Algorithm.d.ts → drawer/algorithm.d.ts} +0 -0
  195. /package/dist/esm/{plot/utils/Coordinate.js → drawer/coordinate.js} +0 -0
  196. /package/dist/esm/{plot/utils → drawer}/plotUtil.d.ts +0 -0
@@ -1,75 +0,0 @@
1
- /**
2
- * 正多边形标绘功能
3
- */
4
- import * as Cesium from 'deeptwins-cesium';
5
- import { getCatesian3FromPX } from "../utils/Coordinate";
6
- import { getRegularPoints, newSessionid } from "../utils/PlotCommon";
7
- import CreateRemindertip from "../utils/ReminderTip";
8
- var CreateRegularPolygon = function CreateRegularPolygon(viewer, handler, resultList, options, callback) {
9
- var id = options.id || newSessionid();
10
- var color = options.color ? Cesium.Color.fromCssColorString(options.color) : Cesium.Color.BLUE.withAlpha(0.4);
11
- var onground = options.onground || true;
12
- var num = options.num && options.num > 2 ? options.num : 5; //默认绘制正五边形
13
- if (viewer.entities.getById(id)) throw new Error('the id parameter is an unique value');
14
- window.toolTip = '左键点击开始绘制';
15
- var anchorpoints = [];
16
- var regularPolygon = undefined;
17
- var centerPoint;
18
-
19
- // 左键点击事件
20
- handler.setInputAction(function (event) {
21
- window.toolTip = '左键双击键结束绘制';
22
- if (Cesium.defined(regularPolygon)) {
23
- return;
24
- }
25
- centerPoint = getCatesian3FromPX(viewer, event.position);
26
- var pointlist = getRegularPoints(centerPoint, undefined, num);
27
- anchorpoints = pointlist;
28
- var dynamicPositions = new Cesium.CallbackProperty(function () {
29
- return new Cesium.PolygonHierarchy(anchorpoints);
30
- }, false);
31
- regularPolygon = viewer.entities.add({
32
- name: 'RegularPolygon',
33
- id: id,
34
- polygon: {
35
- hierarchy: dynamicPositions,
36
- material: color,
37
- outline: true,
38
- outlineColor: Cesium.Color.GREEN,
39
- heightReference: onground ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE
40
- }
41
- });
42
- regularPolygon.GeoType = 'RegularPolygon'; //记录对象的类型,用户后续编辑等操作
43
- regularPolygon.Editable = true; //代表当前对象可编辑,false状态下不可编辑
44
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
45
- // 鼠标移动事件
46
- handler.setInputAction(function (movement) {
47
- //console.log('鼠标移动事件监测:------创建正多边形------');
48
- var endPos = movement.endPosition;
49
- CreateRemindertip(window.toolTip, endPos, true);
50
- if (Cesium.defined(regularPolygon)) {
51
- var endCartesian = getCatesian3FromPX(viewer, endPos);
52
- anchorpoints = getRegularPoints(centerPoint, endCartesian, num);
53
- }
54
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
55
- // 左键双击事件
56
- handler.setInputAction(function (event) {
57
- var endPosition = getCatesian3FromPX(viewer, event.position);
58
- anchorpoints = getRegularPoints(centerPoint, endPosition, num);
59
- regularPolygon.PottingPoint = {
60
- center: centerPoint,
61
- end: endPosition,
62
- num: num
63
- };
64
- regularPolygon.EditingPoint = {
65
- center: centerPoint,
66
- end: endPosition,
67
- num: num
68
- };
69
- resultList.push(regularPolygon);
70
- handler.destroy();
71
- CreateRemindertip(window.toolTip, null, false);
72
- if (typeof callback == 'function') callback(regularPolygon);
73
- }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
74
- };
75
- export default CreateRegularPolygon;
@@ -1,5 +0,0 @@
1
- /**
2
- * 创建直角箭头
3
- */
4
- declare const CreateRightAngleArrow: (viewer: any, handler: any, resultList: any[], options: any, callback?: ((rightAngleArrow: any) => void) | undefined) => void;
5
- export default CreateRightAngleArrow;
@@ -1,73 +0,0 @@
1
- /**
2
- * 创建直角箭头
3
- */
4
-
5
- import * as Cesium from 'deeptwins-cesium';
6
- import { getCatesian3FromPX } from "../utils/Coordinate";
7
- import { getRightAngleArrowPoints, newSessionid } from "../utils/PlotCommon";
8
- import CreateRemindertip from "../utils/ReminderTip";
9
- var CreateRightAngleArrow = function CreateRightAngleArrow(viewer, handler, resultList, options, callback) {
10
- var id = options.id || newSessionid();
11
- if (viewer.entities.getById(id)) throw new Error('the id parameter is an unique value');
12
- var color = options.color ? Cesium.Color.fromCssColorString(options.color) : Cesium.Color.RED;
13
- var onground = options.onground || true;
14
- var anchorpoints = [];
15
- var rightAngleArrow = undefined;
16
- window.toolTip = '左键点击开始绘制';
17
- //左键点击事件
18
- handler.setInputAction(function (event) {
19
- if (anchorpoints.length > 0) {
20
- return;
21
- }
22
- window.toolTip = '左键双击结束绘制';
23
- var cartesian = getCatesian3FromPX(viewer, event.position);
24
- if (!cartesian) return;
25
- anchorpoints.push(cartesian);
26
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
27
- //鼠标移动事件
28
- handler.setInputAction(function (move) {
29
- //console.log('鼠标移动事件监测:------创建攻击箭头------');
30
- var endPos = move.endPosition;
31
- CreateRemindertip(window.toolTip, endPos, true);
32
- if (anchorpoints.length === 0) {
33
- return;
34
- }
35
- var cartesian = getCatesian3FromPX(viewer, endPos);
36
- if (!cartesian) return;
37
- anchorpoints.push(cartesian);
38
- if (anchorpoints.length > 2) {
39
- anchorpoints.splice(1, 1);
40
- }
41
- if (!Cesium.defined(rightAngleArrow)) {
42
- var dynamicPositions = new Cesium.CallbackProperty(function () {
43
- var pointlist = getRightAngleArrowPoints(anchorpoints);
44
- return new Cesium.PolygonHierarchy(pointlist);
45
- }, false);
46
- rightAngleArrow = viewer.entities.add({
47
- id: id,
48
- name: 'RightAngleArrow',
49
- polygon: new Cesium.PolygonGraphics({
50
- hierarchy: dynamicPositions,
51
- show: true,
52
- fill: true,
53
- material: color,
54
- heightReference: onground ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE
55
- })
56
- });
57
- rightAngleArrow.GeoType = 'RightAngleArrow'; //记录对象的类型,用户后续编辑等操作
58
- rightAngleArrow.Editable = true; //代表当前对象可编辑,false状态下不可编辑
59
- }
60
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
61
- //左键双击事件
62
- handler.setInputAction(function (event) {
63
- rightAngleArrow.PottingPoint = Cesium.clone(anchorpoints, true); //记录对象的节点数据,用户后续编辑等操作
64
- rightAngleArrow.EditingPoint = Cesium.clone(anchorpoints, true); //记录复杂对象的编辑的节点数据,用户后续编辑等操作
65
- var pointlist = getRightAngleArrowPoints(anchorpoints);
66
- rightAngleArrow.polygon.hierarchy = new Cesium.PolygonHierarchy(pointlist);
67
- resultList.push(rightAngleArrow);
68
- handler.destroy();
69
- CreateRemindertip(window.toolTip, event.position, false);
70
- if (typeof callback == 'function') callback(rightAngleArrow);
71
- }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
72
- };
73
- export default CreateRightAngleArrow;
@@ -1,2 +0,0 @@
1
- declare const CreateRoundRectangle: (viewer: any, handler: any, resultList: any[], options: any, callback?: ((roundRectangle: any) => void) | undefined) => void;
2
- export default CreateRoundRectangle;
@@ -1,63 +0,0 @@
1
- /**
2
- * 圆角矩形标绘功能
3
- */
4
- import * as Cesium from 'deeptwins-cesium';
5
- import { getCatesian3FromPX } from "../utils/Coordinate";
6
- import { computeRoundedRectanglePoints, newSessionid } from "../utils/PlotCommon";
7
- import CreateRemindertip from "../utils/ReminderTip";
8
- var CreateRoundRectangle = function CreateRoundRectangle(viewer, handler, resultList, options, callback) {
9
- var id = options.id || newSessionid();
10
- var color = options.color ? Cesium.Color.fromCssColorString(options.color) : Cesium.Color.BLUE.withAlpha(0.4);
11
- var onground = options.onground || true;
12
- if (viewer.entities.getById(id)) throw new Error('the id parameter is an unique value');
13
- window.toolTip = '左键点击开始绘制';
14
- var anchorpoints = []; //记录圆角矩形的左上和右下两个点
15
- var roundRectangle = undefined;
16
- // 左键点击事件
17
- handler.setInputAction(function (event) {
18
- window.toolTip = '左键双击键结束绘制';
19
- var pos = getCatesian3FromPX(viewer, event.position);
20
- if (!pos || Cesium.defined(roundRectangle)) return;
21
- anchorpoints.push(pos);
22
- var dynamicPositions = new Cesium.CallbackProperty(function () {
23
- return new Cesium.PolygonHierarchy(computeRoundedRectanglePoints(anchorpoints));
24
- }, false);
25
- roundRectangle = viewer.entities.add({
26
- name: 'RoundRectangle',
27
- id: id,
28
- polygon: new Cesium.PolygonGraphics({
29
- hierarchy: dynamicPositions,
30
- show: true,
31
- fill: true,
32
- material: color,
33
- heightReference: onground ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE
34
- })
35
- });
36
- roundRectangle.GeoType = 'RoundRectangle'; //记录对象的类型,用户后续编辑等操作
37
- roundRectangle.Editable = true; //代表当前对象可编辑,false状态下不可编辑
38
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
39
- // 鼠标移动事件
40
- handler.setInputAction(function (movement) {
41
- //console.log('鼠标移动事件监测:------创建圆角矩形------');
42
- var endPos = movement.endPosition;
43
- CreateRemindertip(window.toolTip, endPos, true);
44
- if (!Cesium.defined(roundRectangle)) return;
45
- var endCartesian = getCatesian3FromPX(viewer, endPos);
46
- if (!endCartesian) return;
47
- if (anchorpoints.length > 1) {
48
- anchorpoints.pop();
49
- }
50
- anchorpoints.push(endCartesian);
51
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
52
- // 左键双击事件
53
- handler.setInputAction(function () {
54
- roundRectangle.polygon.hierarchy = new Cesium.PolygonHierarchy(computeRoundedRectanglePoints(anchorpoints));
55
- roundRectangle.PottingPoint = Cesium.clone(anchorpoints, true);
56
- roundRectangle.EditingPoint = Cesium.clone(anchorpoints, true);
57
- resultList.push(roundRectangle);
58
- handler.destroy();
59
- CreateRemindertip(window.toolTip, null, false);
60
- if (typeof callback == 'function') callback(roundRectangle);
61
- }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
62
- };
63
- export default CreateRoundRectangle;
@@ -1,2 +0,0 @@
1
- declare const CreateSector: (viewer: any, handler: any, resultList: any[], options: any, callback?: ((sector: any) => void) | undefined) => void;
2
- export default CreateSector;
@@ -1,65 +0,0 @@
1
- /**
2
- * 扇形标绘功能
3
- */
4
- import * as Cesium from 'deeptwins-cesium';
5
- import { getCatesian3FromPX } from "../utils/Coordinate";
6
- import { calculateSectorPoints, newSessionid } from "../utils/PlotCommon";
7
- import CreateRemindertip from "../utils/ReminderTip";
8
- var CreateSector = function CreateSector(viewer, handler, resultList, options, callback) {
9
- var id = options.id || newSessionid();
10
- var color = options.color ? Cesium.Color.fromCssColorString(options.color) : Cesium.Color.BLUE.withAlpha(0.4);
11
- var onground = options.onground || true;
12
- if (viewer.entities.getById(id)) throw new Error('the id parameter is an unique value');
13
- window.toolTip = '左键点击开始绘制';
14
- var anchorpoints = [];
15
- var sector = undefined;
16
- // 左键点击事件
17
- handler.setInputAction(function (event) {
18
- window.toolTip = '左键双击键结束绘制';
19
- var pos = getCatesian3FromPX(viewer, event.position);
20
- if (!pos || anchorpoints.length > 2) return;
21
- anchorpoints.push(pos);
22
- if (!Cesium.defined(sector)) {
23
- var dynamicPositions = new Cesium.CallbackProperty(function () {
24
- return new Cesium.PolygonHierarchy(calculateSectorPoints(anchorpoints));
25
- }, false);
26
- sector = viewer.entities.add({
27
- name: 'Sector',
28
- id: id,
29
- polygon: {
30
- hierarchy: dynamicPositions,
31
- material: color,
32
- outline: true,
33
- outlineColor: Cesium.Color.GREEN,
34
- heightReference: onground ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE
35
- }
36
- });
37
- sector.GeoType = 'Sector'; //记录对象的类型,用户后续编辑等操作
38
- sector.Editable = true; //代表当前对象可编辑,false状态下不可编辑
39
- }
40
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
41
- // 鼠标移动事件
42
- handler.setInputAction(function (movement) {
43
- //console.log('鼠标移动事件监测:------创建扇形------');
44
- var endPos = movement.endPosition;
45
- CreateRemindertip(window.toolTip, endPos, true);
46
- if (!Cesium.defined(sector) || anchorpoints.length < 2) return;
47
- var endCartesian = getCatesian3FromPX(viewer, endPos);
48
- if (!endCartesian) return;
49
- if (anchorpoints.length === 3) {
50
- anchorpoints.pop();
51
- }
52
- anchorpoints.push(endCartesian);
53
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
54
- // 左键双击事件
55
- handler.setInputAction(function () {
56
- sector.polygon.hierarchy = new Cesium.PolygonHierarchy(calculateSectorPoints(anchorpoints));
57
- sector.PottingPoint = Cesium.clone(anchorpoints, true);
58
- sector.EditingPoint = Cesium.clone(anchorpoints, true);
59
- resultList.push(sector);
60
- handler.destroy();
61
- CreateRemindertip(window.toolTip, null, false);
62
- if (typeof callback == 'function') callback(sector);
63
- }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
64
- };
65
- export default CreateSector;
@@ -1,5 +0,0 @@
1
- /**
2
- * 创建直线箭头
3
- */
4
- declare const CreateStraightArrow: (viewer: any, handler: any, resultList: any[], options: any, callback?: ((straightArrow: any) => void) | undefined) => void;
5
- export default CreateStraightArrow;
@@ -1,65 +0,0 @@
1
- /**
2
- * 创建直线箭头
3
- */
4
-
5
- import * as Cesium from 'deeptwins-cesium';
6
- import { getCatesian3FromPX } from "../utils/Coordinate";
7
- import { calculateSwallowPoints, newSessionid } from "../utils/PlotCommon";
8
- import CreateRemindertip from "../utils/ReminderTip";
9
- var CreateStraightArrow = function CreateStraightArrow(viewer, handler, resultList, options, callback) {
10
- var id = options.id || newSessionid();
11
- if (viewer.entities.getById(id)) throw new Error('the id parameter is an unique value');
12
- var color = options.color ? Cesium.Color.fromCssColorString(options.color) : Cesium.Color.RED;
13
- var onground = options.onground || true;
14
- var anchorpoints = [];
15
- var straightArrow = undefined;
16
- window.toolTip = '左键点击开始绘制';
17
- //左键点击事件
18
- handler.setInputAction(function (event) {
19
- window.toolTip = '左键双击结束绘制';
20
- var cartesian = getCatesian3FromPX(viewer, event.position);
21
- if (!cartesian || Cesium.defined(straightArrow)) return;
22
- anchorpoints.push(cartesian);
23
- var dynamicPositions = new Cesium.CallbackProperty(function () {
24
- var points = calculateSwallowPoints(anchorpoints, 3);
25
- return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
26
- }, false);
27
- straightArrow = viewer.entities.add({
28
- id: id,
29
- name: 'StraightArrow',
30
- polygon: new Cesium.PolygonGraphics({
31
- hierarchy: dynamicPositions,
32
- show: true,
33
- fill: true,
34
- material: color,
35
- heightReference: onground ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE
36
- })
37
- });
38
- straightArrow.GeoType = 'StraightArrow'; //记录对象的类型,用户后续编辑等操作
39
- straightArrow.Editable = true; //代表当前对象可编辑,false状态下不可编辑
40
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
41
- //鼠标移动事件
42
- handler.setInputAction(function (move) {
43
- //console.log('鼠标移动事件监测:------创建直线箭头------');
44
- var endPos = move.endPosition;
45
- CreateRemindertip(window.toolTip, endPos, true);
46
- var cartesian = getCatesian3FromPX(viewer, endPos);
47
- if (!cartesian || !Cesium.defined(straightArrow)) return;
48
- if (anchorpoints.length === 2) {
49
- anchorpoints.pop();
50
- }
51
- anchorpoints.push(cartesian);
52
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
53
- //左键双击事件
54
- handler.setInputAction(function (event) {
55
- straightArrow.PottingPoint = Cesium.clone(anchorpoints, true); //记录对象的节点数据,用户后续编辑等操作
56
- straightArrow.EditingPoint = Cesium.clone(anchorpoints, true); //记录复杂对象的编辑的节点数据,用户后续编辑等操作
57
- var points = calculateSwallowPoints(anchorpoints, 3);
58
- straightArrow.polygon.hierarchy = new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
59
- resultList.push(straightArrow);
60
- handler.destroy();
61
- CreateRemindertip(window.toolTip, event.position, false);
62
- if (typeof callback == 'function') callback(straightArrow);
63
- }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
64
- };
65
- export default CreateStraightArrow;
@@ -1,5 +0,0 @@
1
- /**
2
- * 创建燕尾箭头 type 1: 燕尾箭头 2: 燕尾箭头2
3
- */
4
- declare const CreateSwallowtailArrow: (viewer: any, handler: any, resultList: any[], options: any, callback?: ((swallowtailArrow: any) => void) | undefined) => void;
5
- export default CreateSwallowtailArrow;
@@ -1,67 +0,0 @@
1
- /**
2
- * 创建燕尾箭头 type 1: 燕尾箭头 2: 燕尾箭头2
3
- */
4
-
5
- import * as Cesium from 'deeptwins-cesium';
6
- import { getCatesian3FromPX } from "../utils/Coordinate";
7
- import { calculateSwallowPoints, newSessionid } from "../utils/PlotCommon";
8
- import CreateRemindertip from "../utils/ReminderTip";
9
- var CreateSwallowtailArrow = function CreateSwallowtailArrow(viewer, handler, resultList, options, callback) {
10
- var id = options.id || newSessionid();
11
- if (viewer.entities.getById(id)) throw new Error('the id parameter is an unique value');
12
- var color = options.color ? Cesium.Color.fromCssColorString(options.color) : Cesium.Color.RED;
13
- var onground = options.onground || true;
14
- var type = options.type || 1;
15
- var anchorpoints = [];
16
- var swallowtailArrow = undefined;
17
- window.toolTip = '左键点击开始绘制';
18
- //左键点击事件
19
- handler.setInputAction(function (event) {
20
- window.toolTip = '左键双击结束绘制';
21
- var cartesian = getCatesian3FromPX(viewer, event.position);
22
- if (!cartesian || Cesium.defined(swallowtailArrow)) return;
23
- anchorpoints.push(cartesian);
24
- var dynamicPositions = new Cesium.CallbackProperty(function () {
25
- var points = calculateSwallowPoints(anchorpoints, type);
26
- return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
27
- }, false);
28
- swallowtailArrow = viewer.entities.add({
29
- id: id,
30
- name: 'SwallowtailArrow',
31
- polygon: new Cesium.PolygonGraphics({
32
- hierarchy: dynamicPositions,
33
- show: true,
34
- fill: true,
35
- material: color,
36
- heightReference: onground ? Cesium.HeightReference.CLAMP_TO_GROUND : Cesium.HeightReference.NONE
37
- })
38
- });
39
- swallowtailArrow.GeoType = 'SwallowtailArrow'; //记录对象的类型,用户后续编辑等操作
40
- swallowtailArrow.Editable = true; //代表当前对象可编辑,false状态下不可编辑
41
- swallowtailArrow.GeoNum = type; //记录对象类型标签
42
- }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
43
- //鼠标移动事件
44
- handler.setInputAction(function (move) {
45
- //console.log('鼠标移动事件监测:------创建燕尾箭头------');
46
- var endPos = move.endPosition;
47
- CreateRemindertip(window.toolTip, endPos, true);
48
- var cartesian = getCatesian3FromPX(viewer, endPos);
49
- if (!cartesian || !Cesium.defined(swallowtailArrow)) return;
50
- if (anchorpoints.length === 2) {
51
- anchorpoints.pop();
52
- }
53
- anchorpoints.push(cartesian);
54
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
55
- //左键双击事件
56
- handler.setInputAction(function (event) {
57
- swallowtailArrow.PottingPoint = Cesium.clone(anchorpoints, true); //记录对象的节点数据,用户后续编辑等操作
58
- swallowtailArrow.EditingPoint = Cesium.clone(anchorpoints, true); //记录复杂对象的编辑的节点数据,用户后续编辑等操作
59
- var points = calculateSwallowPoints(anchorpoints, type);
60
- swallowtailArrow.polygon.hierarchy = new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
61
- resultList.push(swallowtailArrow);
62
- handler.destroy();
63
- CreateRemindertip(window.toolTip, event.position, false);
64
- if (typeof callback == 'function') callback(swallowtailArrow);
65
- }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
66
- };
67
- export default CreateSwallowtailArrow;
@@ -1,25 +0,0 @@
1
- import CreateAssemble from './CreateAssemble';
2
- import CreateAttackArrow from './CreateAttackArrow';
3
- import CreateBillboard from './CreateBillboard';
4
- import CreateBow from './CreateBow';
5
- import CreateCircle from './CreateCircle';
6
- import CreateCurve from './CreateCurve';
7
- import CreateElliptic from './CreateElliptic';
8
- import CreateFlag from './CreateFlag';
9
- import CreateFormation from './CreateFormation';
10
- import CreateFreeLine from './CreateFreeLine';
11
- import CreateFreePolygon from './CreateFreePolygon';
12
- import CreateLabel from './CreateLabel';
13
- import CreateLineArrow from './CreateLineArrow';
14
- import CreatePincerArrow from './CreatePincerArrow';
15
- import CreatePoint from './CreatePoint';
16
- import CreatePolygon from './CreatePolygon';
17
- import CreatePolyline from './CreatePolyline';
18
- import CreateRectangle from './CreateRectangle';
19
- import CreateRegularPolygon from './CreateRegularPolygon';
20
- import CreateRightAngleArrow from './CreateRightAngleArrow';
21
- import CreateRoundRectangle from './CreateRoundRectangle';
22
- import CreateSector from './CreateSector';
23
- import CreateStraightArrow from './CreateStraightArrow';
24
- import CreateSwallowtailArrow from './CreateSwallowtailArrow';
25
- export { CreateAssemble, CreateAttackArrow, CreateBillboard, CreateBow, CreateCircle, CreateCurve, CreateElliptic, CreateFlag, CreateFormation, CreateFreeLine, CreateFreePolygon, CreateLabel, CreateLineArrow, CreatePincerArrow, CreatePoint, CreatePolygon, CreatePolyline, CreateRectangle, CreateRegularPolygon, CreateRightAngleArrow, CreateRoundRectangle, CreateSector, CreateStraightArrow, CreateSwallowtailArrow, };
@@ -1,25 +0,0 @@
1
- import CreateAssemble from "./CreateAssemble";
2
- import CreateAttackArrow from "./CreateAttackArrow";
3
- import CreateBillboard from "./CreateBillboard";
4
- import CreateBow from "./CreateBow";
5
- import CreateCircle from "./CreateCircle";
6
- import CreateCurve from "./CreateCurve";
7
- import CreateElliptic from "./CreateElliptic";
8
- import CreateFlag from "./CreateFlag";
9
- import CreateFormation from "./CreateFormation";
10
- import CreateFreeLine from "./CreateFreeLine";
11
- import CreateFreePolygon from "./CreateFreePolygon";
12
- import CreateLabel from "./CreateLabel";
13
- import CreateLineArrow from "./CreateLineArrow";
14
- import CreatePincerArrow from "./CreatePincerArrow";
15
- import CreatePoint from "./CreatePoint";
16
- import CreatePolygon from "./CreatePolygon";
17
- import CreatePolyline from "./CreatePolyline";
18
- import CreateRectangle from "./CreateRectangle";
19
- import CreateRegularPolygon from "./CreateRegularPolygon";
20
- import CreateRightAngleArrow from "./CreateRightAngleArrow";
21
- import CreateRoundRectangle from "./CreateRoundRectangle";
22
- import CreateSector from "./CreateSector";
23
- import CreateStraightArrow from "./CreateStraightArrow";
24
- import CreateSwallowtailArrow from "./CreateSwallowtailArrow";
25
- export { CreateAssemble, CreateAttackArrow, CreateBillboard, CreateBow, CreateCircle, CreateCurve, CreateElliptic, CreateFlag, CreateFormation, CreateFreeLine, CreateFreePolygon, CreateLabel, CreateLineArrow, CreatePincerArrow, CreatePoint, CreatePolygon, CreatePolyline, CreateRectangle, CreateRegularPolygon, CreateRightAngleArrow, CreateRoundRectangle, CreateSector, CreateStraightArrow, CreateSwallowtailArrow };
@@ -1,8 +0,0 @@
1
- declare const EditAssemble: (viewer: any, entity: any, handler: any, collection: {
2
- id: string;
3
- source: any;
4
- target: any;
5
- geoType: string;
6
- processEntities?: any[];
7
- }[]) => void;
8
- export default EditAssemble;
@@ -1,120 +0,0 @@
1
- /**
2
- * 编辑集结地方法
3
- */
4
- import * as Cesium from 'deeptwins-cesium';
5
- import { getCatesian3FromPX } from "../utils/Coordinate";
6
- import { computeAssemblePoints, lockingMap, newSessionid } from "../utils/PlotCommon";
7
- var EditAssemble = function EditAssemble(viewer, entity, handler, collection) {
8
- var editItem = collection.find(function (ele) {
9
- return ele.id === entity.id;
10
- });
11
- var editEntity;
12
- var sourcePos = entity.EditingPoint;
13
- var updatePos = Cesium.clone(sourcePos, true);
14
- entity.show = false;
15
- var dynamicPositions = new Cesium.CallbackProperty(function () {
16
- var points = computeAssemblePoints(updatePos);
17
- return new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArrayHeights(points));
18
- }, false);
19
- if (editItem) {
20
- editEntity = editItem.target;
21
- editEntity.show = true;
22
- editEntity.polygon.hierarchy = dynamicPositions;
23
- editItem.processEntities = initVertexEntities();
24
- } else {
25
- var newAssemble = Cesium.clone(entity.polygon);
26
- newAssemble.material = Cesium.Color.RED.withAlpha(0.4);
27
- newAssemble.hierarchy = dynamicPositions;
28
- editEntity = viewer.entities.add({
29
- GeoType: 'EditAssemble',
30
- Editable: true,
31
- id: 'edit_' + entity.id,
32
- polygon: newAssemble
33
- });
34
- var vertexs = initVertexEntities();
35
- collection.push({
36
- id: entity.id,
37
- source: entity,
38
- target: editEntity,
39
- geoType: 'remix_assemble',
40
- processEntities: vertexs
41
- });
42
- }
43
- var boolDown = false; //鼠标左键是否处于摁下状态
44
- var currentPickVertex = undefined; //当前选择的要编辑的节点
45
- var currentPickPolygon = undefined; //当前选择的要移动的集结地
46
- // 左键摁下事件
47
- handler.setInputAction(function (event) {
48
- boolDown = true;
49
- var pick = viewer.scene.pick(event.position);
50
- if (Cesium.defined(pick) && pick.id) {
51
- var pickEntity = pick.id;
52
- if (!pickEntity.GeoType || !pickEntity.Editable) {
53
- return;
54
- }
55
- if (pickEntity.GeoType === 'AssembleEditPoint') {
56
- lockingMap(viewer, false);
57
- currentPickVertex = pickEntity;
58
- } else if (pickEntity.GeoType === 'EditAssemble') {
59
- lockingMap(viewer, false);
60
- currentPickPolygon = pickEntity;
61
- }
62
- }
63
- }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
64
- // 鼠标移动事件
65
- handler.setInputAction(function (event) {
66
- //console.log('鼠标移动事件监测:------集结地编辑中------');
67
- if (boolDown && currentPickVertex) {
68
- var pos = getCatesian3FromPX(viewer, event.endPosition);
69
- if (pos) {
70
- updatePos[currentPickVertex.description] = pos;
71
- }
72
- }
73
- if (boolDown && currentPickPolygon) {
74
- var startPosition = viewer.scene.pickPosition(event.startPosition);
75
- var endPosition = viewer.scene.pickPosition(event.endPosition);
76
- var changed_x = endPosition.x - startPosition.x;
77
- var changed_y = endPosition.y - startPosition.y;
78
- var changed_z = endPosition.z - startPosition.z;
79
- updatePos[0] = new Cesium.Cartesian3(updatePos[0].x + changed_x, updatePos[0].y + changed_y, updatePos[0].z + changed_z);
80
- updatePos[1] = new Cesium.Cartesian3(updatePos[1].x + changed_x, updatePos[1].y + changed_y, updatePos[1].z + changed_z);
81
- }
82
- }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
83
- // 左键抬起事件
84
- handler.setInputAction(function () {
85
- entity.polygon.hierarchy = editEntity.polygon.hierarchy;
86
- boolDown = false;
87
- currentPickVertex = undefined;
88
- currentPickPolygon = undefined;
89
- lockingMap(viewer, true);
90
- entity.EditingPoint = updatePos;
91
- }, Cesium.ScreenSpaceEventType.LEFT_UP);
92
- function initVertexEntities() {
93
- var processEntities = [];
94
- var _loop = function _loop(index) {
95
- var verEntity = viewer.entities.add({
96
- id: 'edit_' + newSessionid(),
97
- position: new Cesium.CallbackProperty(function () {
98
- return updatePos[index];
99
- }, false),
100
- point: {
101
- pixelSize: 20,
102
- color: Cesium.Color.YELLOW.withAlpha(0.6),
103
- outlineWidth: 2,
104
- heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
105
- outlineColor: Cesium.Color.DARKRED.withAlpha(1)
106
- },
107
- show: true,
108
- description: index //记录节点索引
109
- });
110
- verEntity.GeoType = 'AssembleEditPoint';
111
- verEntity.Editable = true;
112
- processEntities.push(verEntity);
113
- };
114
- for (var index = 0; index < updatePos.length; index++) {
115
- _loop(index);
116
- }
117
- return processEntities;
118
- }
119
- };
120
- export default EditAssemble;
@@ -1,8 +0,0 @@
1
- declare const EditAttackArrow: (viewer: any, entity: any, handler: any, collection: {
2
- id: string;
3
- source: any;
4
- target: any;
5
- geoType: string;
6
- processEntities?: any[];
7
- }[]) => void;
8
- export default EditAttackArrow;